| 1 | selected := get-environment-variable("VPAC_TARGET_ARCH") |
| 2 | arch := if string?(selected) { selected } else if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" } |
| 3 | |
| 4 | defpkgbuild(libxshmfence, |
| 5 | #:pkgname, "libxshmfence", |
| 6 | #:pkgver, "1.3.2", |
| 7 | #:pkgrel, if string=?("aarch64", arch) { 2 } else { 1 }, |
| 8 | #:pkgdesc, "X11 shared memory fences", |
| 9 | #:arch, [#:x86-64, #:aarch64], |
| 10 | #:license, "MIT", |
| 11 | #:url, "https://www.x.org/", |
| 12 | #:depends, if string=?("aarch64", arch) { ["musl>=1.2.6-4", "xorgproto"] } else { ["musl", "xorgproto"] }, |
| 13 | #:makedepends, ["linux-headers"], |
| 14 | #:source, ["https://xorg.freedesktop.org/archive/individual/lib/libxshmfence-1.3.2.tar.xz"], |
| 15 | #:sha256sums, ["870df257bc40b126d91b5a8f1da6ca8a524555268c50b59c0acd1a27f361606f"], |
| 16 | |
| 17 | #:prepare, fn() { |
| 18 | ; Installed pkg-config files must use the consumer's sysroot. |
| 19 | run("sed", "-i", "s/ @XPROTO_CFLAGS@//", "libxshmfence-1.3.2/xshmfence.pc.in") |
| 20 | }, |
| 21 | #:build, fn() { |
| 22 | run("vinix-configure", "libxshmfence-1.3.2/configure", "--enable-futex") |
| 23 | run("make") |
| 24 | }, |
| 25 | #:check, fn() { |
| 26 | run("test", "-s", "src/.libs/libxshmfence.so") |
| 27 | run("readelf", "-d", "src/.libs/libxshmfence.so") |
| 28 | }, |
| 29 | #:package, fn() { |
| 30 | run("make", "install", string-append("DESTDIR=", pkgdir())) |
| 31 | run("find", pkgdir(), "-name", "*.la", "-delete") |
| 32 | run("install", "-Dm644", "libxshmfence-1.3.2/COPYING", |
| 33 | string-append(pkgdir(), "/usr/share/licenses/libxshmfence/COPYING")) |
| 34 | }) |
| 35 | |