argp-standalone: build the option parser with target musl
@@ -0,0 +1,30 @@
1+defpkgbuild(argp-standalone,
2+ #:pkgname, "argp-standalone",
3+ #:pkgver, "1.5.0",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "GNU argp option parser for musl programs",
6+ #:arch, [#:x86-64, #:aarch64],
7+ #:url, "https://github.com/argp-standalone/argp-standalone",
8+ #:license, "LGPL-2.1-or-later",
9+ #:depends, ["musl"],
10+ #:source, ["argp-standalone-1.5.0.tar.gz::https://github.com/argp-standalone/argp-standalone/archive/refs/tags/1.5.0.tar.gz",
11+ "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/main/argp-standalone/gnu89-inline.patch"],
12+ #:sha256sums, ["c29eae929dfebd575c38174f2c8c315766092cec99a8f987569d0cad3c6d64f6",
13+ "29be7cf514ecebe0c8879e9c510931d5ed03cb5f06ddd230f08b541b168fd5b6"],
14+ #:prepare, fn() {
15+ run("patch", "--batch", "--fuzz=0", "-d", "argp-standalone-1.5.0", "-p1", "-i", "../gnu89-inline.patch")
16+ run("env", "-C", "argp-standalone-1.5.0", "autoreconf", "-fi")
17+ },
18+ #:build, fn() {
19+ run("env", "CFLAGS=-O2 -fPIC", string-append("CPPFLAGS=-I", srcdir(), "/argp-standalone-1.5.0"),
20+ "vinix-configure", "argp-standalone-1.5.0/configure")
21+ run("make")
22+ },
23+ #:check, fn() {
24+ run("vinix-run", "./argp-test", "--help")
25+ },
26+ #:package, fn() {
27+ run("install", "-Dm644", "libargp.a", string-append(pkgdir(), "/usr/lib/libargp.a"))
28+ run("install", "-Dm644", "argp-standalone-1.5.0/argp.h", string-append(pkgdir(), "/usr/include/argp.h"))
29+ run("install", "-Dm644", "argp-standalone-1.5.0/README.md", string-append(pkgdir(), "/usr/share/licenses/argp-standalone/README.md"))
30+ })