| 1 | defpkgbuild(xz, |
| 2 | #:pkgname, "xz", |
| 3 | #:pkgver, "5.8.4", |
| 4 | #:pkgrel, 2, |
| 5 | #:pkgdesc, "XZ and LZMA compression tools and shared library", |
| 6 | #:arch, [#:x86-64, #:aarch64], |
| 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 | run("vinix-cmake", "xz-5.8.4", "build", "-DBUILD_SHARED_LIBS=ON", "-DXZ_NLS=OFF", "-DBUILD_TESTING=OFF") |
| 14 | run("cmake", "--build", "build") |
| 15 | }, |
| 16 | #:check, fn() { |
| 17 | run("cp", "xz-5.8.4/README", "original") |
| 18 | run("cp", "original", "roundtrip") |
| 19 | run("vinix-run", "--library-path", "build", "build/xz", "--threads=1", "roundtrip") |
| 20 | run("vinix-run", "--library-path", "build", "build/xz", "-d", "roundtrip.xz") |
| 21 | run("cmp", "original", "roundtrip") |
| 22 | }, |
| 23 | #:package, fn() { |
| 24 | run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", "build") |
| 25 | for-each(fn(name) { |
| 26 | run("install", "-Dm644", string-append("xz-5.8.4/", name), string-append(pkgdir(), "/usr/share/licenses/xz/", name)) |
| 27 | }, list("COPYING", "COPYING.0BSD", "COPYING.GPLv2", "COPYING.GPLv3", "COPYING.LGPLv2.1")) |
| 28 | }) |
| 29 | |