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