| 1 | selected := get-environment-variable("VPAC_TARGET_ARCH") |
| 2 | arch := if string?(selected) { selected } else if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" } |
| 3 | arm := string=?(arch, "aarch64") |
| 4 | musl := if arm { "musl>=1.2.6-4" } else { "musl" } |
| 5 | |
| 6 | defpkgbuild(make, |
| 7 | #:pkgname, "make", |
| 8 | #:pkgver, "4.4.1", |
| 9 | #:pkgrel, 4, |
| 10 | #:pkgdesc, "GNU Make for Vinix", |
| 11 | #:arch, [#:x86-64, #:aarch64], |
| 12 | #:url, "https://www.gnu.org/software/make/", |
| 13 | #:license, "GPL-3.0-or-later", |
| 14 | #:depends, [musl], |
| 15 | #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/make-4.4.1.tar.gz"], |
| 16 | #:sha256sums, ["dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3"], |
| 17 | #:build, fn() { |
| 18 | run("env", "CFLAGS=-O2 -std=gnu17", "vinix-configure", "make-4.4.1/configure", "--disable-nls", "--without-guile") |
| 19 | ; Keep the cross-compiler for configure checks and use the target tool by default. |
| 20 | run("sed", "-i", "s/^#define MAKE_CXX .*/#define MAKE_CXX \"g++\"/", "src/config.h") |
| 21 | run("make") |
| 22 | }, |
| 23 | #:check, fn() { |
| 24 | run("env", "-u", "CXX", "vinix-run", "./make", "-f", "/dev/null", "--eval=all: ; @test \"$(CXX)\" = g++", "all") |
| 25 | }, |
| 26 | #:package, fn() { |
| 27 | run("make", string-append("DESTDIR=", pkgdir()), "install") |
| 28 | run("ln", "-s", "make", string-append(pkgdir(), "/usr/bin/gmake")) |
| 29 | run("vinix-run", string-append(pkgdir(), "/usr/bin/gmake"), "-f", "/dev/null", |
| 30 | "--eval=all: ; @echo Vinix gmake works", "all") |
| 31 | run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir")) |
| 32 | run("install", "-Dm644", "make-4.4.1/COPYING", string-append(pkgdir(), "/usr/share/licenses/make/COPYING")) |
| 33 | }) |
| 34 | |