| 1 | defpkgbuild(libarchive, |
| 2 | #:pkgname, "libarchive", |
| 3 | #:pkgver, "3.8.11", |
| 4 | #:pkgrel, 1, |
| 5 | #:pkgdesc, "Archive library and bsdtar, bsdcpio and bsdcat utilities", |
| 6 | #:arch, [#:x86-64, #:aarch64], |
| 7 | #:url, "https://libarchive.org/", |
| 8 | #:license, "BSD-2-Clause AND BSD-3-Clause AND LicenseRef-Public-Domain", |
| 9 | #:depends, ["musl", "acl", "attr", "bzip2", "expat", "lz4", "openssl", "xz", "zlib", "zstd"], |
| 10 | #:makedepends, ["linux-headers"], |
| 11 | #:source, ["https://libarchive.org/downloads/libarchive-3.8.11.tar.xz"], |
| 12 | #:sha256sums, ["a3dc0872b1b39da34dc18ef1b944f0f11ffd37425d70ae04be679279f1cf43d2"], |
| 13 | #:build, fn() { |
| 14 | run("vinix-configure", "libarchive-3.8.11/configure", "--without-xml2", "--with-expat", "--with-openssl", "--with-zlib", "--with-bz2lib", "--with-lz4", "--with-zstd", "--with-lzma", "--enable-acl", "--enable-xattr") |
| 15 | run("make") |
| 16 | }, |
| 17 | #:check, fn() { |
| 18 | for-each(fn(feature) { |
| 19 | run("grep", "-Fx", string-append("#define HAVE_", feature, " 1"), "config.h") |
| 20 | }, list("LIBACL", "FGETXATTR", "LIBBZ2", "LIBEXPAT", "LIBLZ4", "LIBLZMA", "LIBZSTD", "ZLIB_H", "OPENSSL_EVP_H")) |
| 21 | run("make", "install", string-append("DESTDIR=", srcdir(), "/checked")) |
| 22 | run("vinix-run", "--library-path", "checked/usr/lib", "checked/usr/bin/bsdtar", "--version") |
| 23 | run("cp", "libarchive-3.8.11/COPYING", "payload") |
| 24 | run("mkdir", "extracted") |
| 25 | run("vinix-run", "--library-path", "checked/usr/lib", "checked/usr/bin/bsdtar", "--zstd", "-cf", "test.pkg.tar.zst", "payload") |
| 26 | run("vinix-run", "--library-path", "checked/usr/lib", "checked/usr/bin/bsdtar", "-xf", "test.pkg.tar.zst", "-C", "extracted") |
| 27 | run("cmp", "payload", "extracted/payload") |
| 28 | run("vinix-run", "--library-path", "checked/usr/lib", "checked/usr/bin/bsdtar", "-cJf", "test.tar.xz", "payload") |
| 29 | run("vinix-run", "--library-path", "checked/usr/lib", "checked/usr/bin/bsdtar", "-tf", "test.tar.xz") |
| 30 | }, |
| 31 | #:package, fn() { |
| 32 | run("make", "install", string-append("DESTDIR=", pkgdir())) |
| 33 | run("find", pkgdir(), "-name", "*.la", "-delete") |
| 34 | run("install", "-Dm644", "libarchive-3.8.11/COPYING", string-append(pkgdir(), "/usr/share/licenses/libarchive/COPYING")) |
| 35 | }) |
| 36 | |