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