Build and check compression, UUID, FFI, Expat and pkgconf ports
@@ -0,0 +1,45 @@
1+defpkgbuild(bzip2,
2+ #:pkgname, "bzip2",
3+ #:pkgver, "1.0.8",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "Block-sorting compressor and libbz2",
6+ #:arch, [#:x86-64],
7+ #:license, "bzip2-1.0.6",
8+ #:url, "https://sourceware.org/bzip2/",
9+ #:depends, ["musl"],
10+ #:source, ["https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz", "bzip2.pc"],
11+ #:sha256sums, ["ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
12+ "b029266dd94f768874e3913d8a791fe0ee7e5509cfc0457e85e8fefd150ec376"],
13+ #:prepare, fn() {
14+ ; Existing Vinix consumers ask the loader for libbz2.so.1.
15+ run("sed", "-i", "s/-Wl,libbz2.so.1.0 /-Wl,libbz2.so.1 /", "bzip2-1.0.8/Makefile-libbz2_so")
16+ },
17+ #:build, fn() {
18+ run("make", "-C", "bzip2-1.0.8", "-f", "Makefile-libbz2_so", "CC=vinix-cc")
19+ run("ln", "-s", "libbz2.so.1.0.8", "bzip2-1.0.8/libbz2.so.1")
20+ run("make", "-C", "bzip2-1.0.8", "CC=vinix-cc", "libbz2.a", "bzip2recover")
21+ },
22+ #:check, fn() {
23+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
24+ run("cp", "bzip2-1.0.8/sample1.bz2", "input.bz2")
25+ run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", "bzip2-1.0.8",
26+ "bzip2-1.0.8/bzip2-shared", "-dk", "input.bz2")
27+ run("cmp", "input", "bzip2-1.0.8/sample1.ref")
28+ },
29+ #:package, fn() {
30+ dest := string-append(pkgdir(), "/usr")
31+ run("install", "-Dm755", "bzip2-1.0.8/libbz2.so.1.0.8", string-append(dest, "/lib/libbz2.so.1.0.8"))
32+ for-each(fn(link) {
33+ run("ln", "-s", "libbz2.so.1.0.8", string-append(dest, "/lib/", link))
34+ }, list("libbz2.so", "libbz2.so.1", "libbz2.so.1.0"))
35+ run("install", "-Dm644", "bzip2-1.0.8/libbz2.a", string-append(dest, "/lib/libbz2.a"))
36+ run("install", "-Dm644", "bzip2-1.0.8/bzlib.h", string-append(dest, "/include/bzlib.h"))
37+ run("install", "-Dm644", "bzip2.pc", string-append(dest, "/lib/pkgconfig/bzip2.pc"))
38+ run("install", "-Dm755", "bzip2-1.0.8/bzip2-shared", string-append(dest, "/bin/bzip2"))
39+ run("install", "-Dm755", "bzip2-1.0.8/bzip2recover", string-append(dest, "/bin/bzip2recover"))
40+ for-each(fn(link) {
41+ run("ln", "-s", "bzip2", string-append(dest, "/bin/", link))
42+ }, list("bunzip2", "bzcat"))
43+ run("install", "-Dm644", "bzip2-1.0.8/bzip2.1", string-append(dest, "/share/man/man1/bzip2.1"))
44+ run("install", "-Dm644", "bzip2-1.0.8/LICENSE", string-append(dest, "/share/licenses/bzip2/LICENSE"))
45+ })
@@ -0,0 +1,9 @@
1+prefix=/usr
2+libdir=${prefix}/lib
3+includedir=${prefix}/include
4+
5+Name: bzip2
6+Description: Burrows-Wheeler block-sorting compression library
7+Version: 1.0.8
8+Libs: -L${libdir} -lbz2
9+Cflags: -I${includedir}
@@ -0,0 +1,28 @@
1+defpkgbuild(expat,
2+ #:pkgname, "expat",
3+ #:pkgver, "2.11.0",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "Expat XML parser, headers and xmlwf",
6+ #:arch, [#:x86-64],
7+ #:license, "MIT",
8+ #:url, "https://libexpat.github.io/",
9+ #:depends, ["musl"],
10+ #:source, ["https://github.com/libexpat/libexpat/releases/download/R_2_11_0/expat-2.11.0.tar.xz"],
11+ #:sha256sums, ["61e7614b602201c28a189dafee78f5bceaee192bbde46a930752ff09cf5542fa"],
12+
13+ #:build, fn() {
14+ run("env", "CC=vinix-cc", "expat-2.11.0/configure", "--prefix=/usr",
15+ "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl",
16+ "--without-docbook", "--without-examples", "--without-tests")
17+ run("make")
18+ },
19+ #:check, fn() {
20+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
21+ run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", "lib/.libs",
22+ "xmlwf/.libs/xmlwf", "expat-2.11.0/doc/xmlwf.xml")
23+ },
24+ #:package, fn() {
25+ run("make", "install", string-append("DESTDIR=", pkgdir()))
26+ run("rm", string-append(pkgdir(), "/usr/lib/libexpat.la"))
27+ run("install", "-Dm644", "expat-2.11.0/COPYING", string-append(pkgdir(), "/usr/share/licenses/expat/COPYING"))
28+ })
@@ -0,0 +1,29 @@
1+defpkgbuild(libffi,
2+ #:pkgname, "libffi",
3+ #:pkgver, "3.8.2",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "Portable foreign function calls and closures",
6+ #:arch, [#:x86-64],
7+ #:license, "MIT",
8+ #:url, "https://sourceware.org/libffi/",
9+ #:depends, ["musl"],
10+ #:source, ["https://github.com/libffi/libffi/releases/download/v3.8.2/libffi-3.8.2.tar.gz"],
11+ #:sha256sums, ["a699fda2b090c4b46cb79cf60c4dacfce480eb05742c0de66acf3af174a47f92"],
12+
13+ #:build, fn() {
14+ run("env", "CC=vinix-cc", "libffi-3.8.2/configure", "--prefix=/usr",
15+ "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl",
16+ "--disable-multi-os-directory", "--disable-docs", "--enable-pax_emutramp", "--enable-portable-binary", "--disable-exec-static-tramp")
17+ run("make")
18+ },
19+ #:check, fn() {
20+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
21+ run("vinix-cc", "-Iinclude", "-I.", "libffi-3.8.2/testsuite/libffi.call/strlen2.c",
22+ "-L.libs", "-lffi", "-o", "test-calling-convention")
23+ run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".libs", "./test-calling-convention")
24+ },
25+ #:package, fn() {
26+ run("make", "install", string-append("DESTDIR=", pkgdir()))
27+ run("rm", string-append(pkgdir(), "/usr/lib/libffi.la"))
28+ run("install", "-Dm644", "libffi-3.8.2/LICENSE", string-append(pkgdir(), "/usr/share/licenses/libffi/LICENSE"))
29+ })
@@ -0,0 +1,38 @@
1+defpkgbuild(libuuid,
2+ #:pkgname, "libuuid",
3+ #:pkgver, "2.40.4",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "UUID library and development files from util-linux",
6+ #:arch, [#:x86-64],
7+ #:license, "BSD-3-Clause",
8+ #:url, "https://www.kernel.org/pub/linux/utils/util-linux/",
9+ #:depends, ["musl"],
10+ #:makedepends, ["linux-headers"],
11+ #:source, ["https://www.kernel.org/pub/linux/utils/util-linux/v2.40/util-linux-2.40.4.tar.xz"],
12+ #:sha256sums, ["5c1daf733b04e9859afdc3bd87cc481180ee0f88b5c0946b16fdec931975fb79"],
13+
14+ #:build, fn() {
15+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
16+ run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH",
17+ "CC=vinix-cc",
18+ "PKG_CONFIG_PATH=", string-append("PKG_CONFIG_LIBDIR=", root, "/usr/lib/pkgconfig"),
19+ string-append("PKG_CONFIG_SYSROOT_DIR=", root),
20+ "util-linux-2.40.4/configure", "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl",
21+ "--prefix=/usr", "--disable-all-programs", "--enable-libuuid", "--without-python",
22+ "--disable-nls", "--disable-asciidoc")
23+ run("make", "libuuid.la", "libuuid/uuid.pc")
24+ },
25+ #:check, fn() {
26+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
27+ run("make", "test_uuid_parser")
28+ run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".libs", ".libs/test_uuid_parser")
29+ },
30+ #:package, fn() {
31+ run("install", "-d", string-append(pkgdir(), "/usr/lib"))
32+ run("./libtool", "--mode=install", "install", "-c", "libuuid.la", string-append(pkgdir(), "/usr/lib/"))
33+ run("rm", string-append(pkgdir(), "/usr/lib/libuuid.la"))
34+ run("install", "-Dm644", "util-linux-2.40.4/libuuid/src/uuid.h", string-append(pkgdir(), "/usr/include/uuid/uuid.h"))
35+ run("install", "-Dm644", "libuuid/uuid.pc", string-append(pkgdir(), "/usr/lib/pkgconfig/uuid.pc"))
36+ run("install", "-Dm644", "util-linux-2.40.4/Documentation/licenses/COPYING.BSD-3-Clause",
37+ string-append(pkgdir(), "/usr/share/licenses/libuuid/COPYING"))
38+ })
@@ -0,0 +1,30 @@
1+defpkgbuild(pkgconf,
2+ #:pkgname, "pkgconf",
3+ #:pkgver, "2.3.0",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "Query compiler and linker flags for installed libraries",
6+ #:arch, [#:x86-64],
7+ #:license, "ISC",
8+ #:url, "https://pkgconf.org/",
9+ #:depends, ["musl"],
10+ #:source, ["https://distfiles.ariadne.space/pkgconf/pkgconf-2.3.0.tar.xz"],
11+ #:sha256sums, ["3a9080ac51d03615e7c1910a0a2a8df08424892b5f13b0628a204d3fcce0ea8b"],
12+
13+ #:build, fn() {
14+ run("env", "CC=vinix-cc", "pkgconf-2.3.0/configure", "--prefix=/usr",
15+ "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl",
16+ "--with-pkg-config-dir=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig")
17+ run("make")
18+ },
19+ #:check, fn() {
20+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
21+ run("env", "PKG_CONFIG_PATH=", "PKG_CONFIG_LIBDIR=.",
22+ string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", ".libs",
23+ ".libs/pkgconf", "--exact-version=2.3.0", "libpkgconf")
24+ },
25+ #:package, fn() {
26+ run("make", "install", string-append("DESTDIR=", pkgdir()))
27+ run("ln", "-s", "pkgconf", string-append(pkgdir(), "/usr/bin/pkg-config"))
28+ run("rm", string-append(pkgdir(), "/usr/lib/libpkgconf.la"))
29+ run("install", "-Dm644", "pkgconf-2.3.0/COPYING", string-append(pkgdir(), "/usr/share/licenses/pkgconf/COPYING"))
30+ })
@@ -0,0 +1,36 @@
1+defpkgbuild(xz,
2+ #:pkgname, "xz",
3+ #:pkgver, "5.8.4",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "XZ and LZMA compression tools and shared library",
6+ #:arch, [#:x86-64],
7+ #:license, "0BSD AND LGPL-2.1-or-later AND GPL-2.0-or-later",
8+ #:url, "https://tukaani.org/xz/",
9+ #:depends, ["musl"],
10+ #:source, ["https://github.com/tukaani-project/xz/archive/refs/tags/v5.8.4/xz-5.8.4.tar.gz"],
11+ #:sha256sums, ["b6b34c52e672e810d339db14e0c10b5b6f5f67a30d8d05cdac5d8cb4d82f78d5"],
12+ #:build, fn() {
13+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
14+ run("cmake", "-S", "xz-5.8.4", "-B", "build", "-DCMAKE_BUILD_TYPE=Release",
15+ "-DCMAKE_SYSTEM_NAME=Linux", "-DCMAKE_SYSTEM_PROCESSOR=x86_64", "-DCMAKE_C_COMPILER=vinix-cc",
16+ string-append("-DCMAKE_SYSROOT=", root), "-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY",
17+ "-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY", "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY",
18+ "-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER", "-DCMAKE_INSTALL_PREFIX=/usr", "-DCMAKE_INSTALL_LIBDIR=lib",
19+ "-DBUILD_SHARED_LIBS=ON", "-DXZ_NLS=OFF", "-DBUILD_TESTING=OFF")
20+ run("cmake", "--build", "build", "--parallel", "1")
21+ },
22+ #:check, fn() {
23+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
24+ loader := string-append(root, "/lib/ld-musl-x86_64.so.1")
25+ run("cp", "xz-5.8.4/README", "original")
26+ run("cp", "original", "roundtrip")
27+ run(loader, "--library-path", "build", "build/xz", "--threads=1", "roundtrip")
28+ run(loader, "--library-path", "build", "build/xz", "-d", "roundtrip.xz")
29+ run("cmp", "original", "roundtrip")
30+ },
31+ #:package, fn() {
32+ run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", "build")
33+ for-each(fn(name) {
34+ run("install", "-Dm644", string-append("xz-5.8.4/", name), string-append(pkgdir(), "/usr/share/licenses/xz/", name))
35+ }, list("COPYING", "COPYING.0BSD", "COPYING.GPLv2", "COPYING.GPLv3", "COPYING.LGPLv2.1"))
36+ })
@@ -0,0 +1,34 @@
1+defpkgbuild(zstd,
2+ #:pkgname, "zstd",
3+ #:pkgver, "1.6.0",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "Zstandard compression library and development headers",
6+ #:arch, [#:x86-64],
7+ #:license, "BSD-3-Clause OR GPL-2.0-only",
8+ #:url, "https://facebook.github.io/zstd/",
9+ #:depends, ["musl"],
10+ #:source, ["zstd-1.6.0.tar.gz::https://github.com/facebook/zstd/archive/refs/tags/v1.6.0.tar.gz"],
11+ #:sha256sums, ["289bb207935e5b4f241239f9832e665fa6b9636c3f87f479e125371e13842b8e"],
12+ #:build, fn() {
13+ run("make", "-C", "zstd-1.6.0/lib", "CC=vinix-cc", "libzstd-release")
14+ },
15+ #:check, fn() {
16+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
17+ loader := string-append(root, "/lib/ld-musl-x86_64.so.1")
18+ for-each(fn(program) {
19+ run("vinix-cc", "-Izstd-1.6.0/lib", string-append("zstd-1.6.0/examples/", program, ".c"),
20+ "-Lzstd-1.6.0/lib", "-lzstd", "-o", program)
21+ }, list("simple_compression", "simple_decompression"))
22+ run("cp", "zstd-1.6.0/README.md", "sample")
23+ run(loader, "--library-path", "zstd-1.6.0/lib", "./simple_compression", "sample")
24+ run(loader, "--library-path", "zstd-1.6.0/lib", "./simple_decompression", "sample.zst")
25+ run("zstd", "--quiet", "--decompress", "sample.zst", "-o", "decoded")
26+ run("cmp", "sample", "decoded")
27+ },
28+ #:package, fn() {
29+ run("make", "-C", "zstd-1.6.0/lib", "CC=vinix-cc", "PREFIX=/usr", string-append("DESTDIR=", pkgdir()),
30+ "install-shared", "install-includes", "install-pc")
31+ for-each(fn(name) {
32+ run("install", "-Dm644", string-append("zstd-1.6.0/", name), string-append(pkgdir(), "/usr/share/licenses/zstd/", name))
33+ }, list("LICENSE", "COPYING"))
34+ })