zlib: build and check the shared compression library against Vinix musl
@@ -0,0 +1,28 @@
1+defpkgbuild(zlib,
2+ #:pkgname, "zlib",
3+ #:pkgver, "1.4",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "DEFLATE compression library and development headers",
6+ #:arch, [#:x86-64],
7+ #:license, "Zlib",
8+ #:url, "https://zlib.net/",
9+ #:depends, ["musl"],
10+ #:source, ["https://zlib.net/fossils/zlib-1.4.tar.gz"],
11+ #:sha256sums, ["02dd159783677a749c04adbdd02b55b8a2bcc7e054f51b76b549199a916ad584"],
12+
13+ #:build, fn() {
14+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
15+ run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH",
16+ string-append("CC=gcc --sysroot=", root, " -specs=", root, "/usr/lib/musl-gcc-sysroot.specs"),
17+ "CFLAGS=-O2", "CHOST=x86_64-linux-musl", "AR=ar", "RANLIB=ranlib",
18+ "zlib-1.4/configure", "--prefix=/usr", "--shared", "--disable-crcvx")
19+ run("make")
20+ },
21+ #:check, fn() {
22+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
23+ run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".", "./examplesh")
24+ },
25+ #:package, fn() {
26+ run("make", "install", string-append("DESTDIR=", pkgdir()))
27+ run("install", "-Dm644", "zlib-1.4/LICENSE", string-append(pkgdir(), "/usr/share/licenses/zlib/LICENSE"))
28+ })