defpkgbuild(btop, #:pkgname, "btop", #:pkgver, "1.4.0", #:pkgrel, 1, #:pkgdesc, "Terminal resource monitor", #:arch, [#:x86-64, #:aarch64], #:url, "https://github.com/aristocratos/btop", #:license, "Apache-2.0", #:depends, ["gcc-libs", "musl"], #:makedepends, ["linux-headers", "make"], #:source, ["btop-1.4.0.tar.gz::https://codeload.github.com/aristocratos/btop/tar.gz/refs/tags/v1.4.0"], #:sha256sums, ["ac0d2371bf69d5136de7e9470c6fb286cbee2e16b4c7a6d2cd48a14796e86650"], #:build, fn() { flags := get-environment-variable("LDFLAGS") ; The bootstrap GCC uses explicit musl specs. Use the target unwinder and ; emit the ELF program header it uses to locate C++ exception tables. linker := string-append("LDFLAGS=", if string?(flags) { flags } else { "" }, " -Wl,--eh-frame-hdr -lgcc_s") run("make", "-C", "btop-1.4.0", "PLATFORM=Linux", "CC=vinix-cc", "CXX=vinix-c++", "THREADS=2", "GIT_COMMIT=", "OPTFLAGS=-O2 -ftree-vectorize", "ADDFLAGS=-fno-ipa-cp", linker) }, #:check, fn() { run("vinix-run", "btop-1.4.0/bin/btop", "--version") }, #:package, fn() { run("make", "-C", "btop-1.4.0", "install", "PREFIX=/usr", "CC=vinix-cc", "CXX=vinix-c++", string-append("DESTDIR=", pkgdir())) run("install", "-Dm644", "btop-1.4.0/LICENSE", string-append(pkgdir(), "/usr/share/licenses/btop/LICENSE")) })