vinix-ports / lz4 / PKGBUILD.vile
30 lines · 29 sloc · 1.41 KB
Raw
1cross := get-environment-variable("CROSS_COMPILE")
2prefix := if string?(cross) { cross } else { "" }
3
4defpkgbuild(lz4,
5 #:pkgname, "lz4",
6 #:pkgver, "1.10.0",
7 #:pkgrel, 1,
8 #:pkgdesc, "Fast LZ4 compression library, headers and command-line tools",
9 #:arch, [#:x86-64, #:aarch64],
10 #:url, "https://github.com/lz4/lz4",
11 #:license, "BSD-2-Clause AND GPL-2.0-or-later",
12 #:depends, ["musl"],
13 #:source, ["lz4-1.10.0.tar.gz::https://github.com/lz4/lz4/archive/v1.10.0.tar.gz"],
14 #:sha256sums, ["537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b"],
15 #:build, fn() {
16 run("make", "-C", "lz4-1.10.0", "CC=vinix-cc", string-append("AR=", prefix, "ar"), "PREFIX=/usr")
17 },
18 #:check, fn() {
19 run("vinix-run", "--library-path", "lz4-1.10.0/lib", "lz4-1.10.0/programs/lz4",
20 "-f", "lz4-1.10.0/README.md", "sample.lz4")
21 run("vinix-run", "--library-path", "lz4-1.10.0/lib", "lz4-1.10.0/programs/lz4",
22 "-df", "sample.lz4", "decoded")
23 run("cmp", "lz4-1.10.0/README.md", "decoded")
24 },
25 #:package, fn() {
26 run("make", "-C", "lz4-1.10.0", "CC=vinix-cc", string-append("AR=", prefix, "ar"),
27 "PREFIX=/usr", string-append("DESTDIR=", pkgdir()), "install")
28 run("install", "-Dm644", "lz4-1.10.0/lib/LICENSE", string-append(pkgdir(), "/usr/share/licenses/lz4/LICENSE"))
29 run("install", "-Dm644", "lz4-1.10.0/programs/COPYING", string-append(pkgdir(), "/usr/share/licenses/lz4/COPYING"))
30 })
31