vinix-ports / zlib / PKGBUILD.vile
31 lines · 29 sloc · 1.29 KB
Raw
1selected := get-environment-variable("VPAC_TARGET_ARCH")
2arch := if string?(selected) { selected } else if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" }
3cross := get-environment-variable("CROSS_COMPILE")
4prefix := if string?(cross) { cross } else { "" }
5
6defpkgbuild(zlib,
7 #:pkgname, "zlib",
8 #:pkgver, "1.4",
9 #:pkgrel, 2,
10 #:pkgdesc, "DEFLATE compression library and development headers",
11 #:arch, [#:x86-64, #:aarch64],
12 #:license, "Zlib",
13 #:url, "https://zlib.net/",
14 #:depends, ["musl"],
15 #:source, ["https://zlib.net/fossils/zlib-1.4.tar.gz"],
16 #:sha256sums, ["02dd159783677a749c04adbdd02b55b8a2bcc7e054f51b76b549199a916ad584"],
17
18 #:build, fn() {
19 run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH",
20 "CC=vinix-cc", "CFLAGS=-O2", string-append("CHOST=", arch, "-linux-musl"),
21 string-append("AR=", prefix, "ar"), string-append("RANLIB=", prefix, "ranlib"),
22 "zlib-1.4/configure", "--prefix=/usr", "--shared", "--disable-crcvx")
23 run("make")
24 },
25 #:check, fn() {
26 run("vinix-run", "--library-path", ".", "./examplesh")
27 },
28 #:package, fn() {
29 run("make", "install", string-append("DESTDIR=", pkgdir()))
30 run("install", "-Dm644", "zlib-1.4/LICENSE", string-append(pkgdir(), "/usr/share/licenses/zlib/LICENSE"))
31 })
32