aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2022-06-13 02:39:58 +0200
committerJakub Jirutka <jakub@jirutka.cz>2022-06-13 02:42:32 +0200
commit71025c08db4d8df53ee4c4fb5a8a3864720aa49b (patch)
treedf52eb5582cd0955a590ff6a8ba07f89c2a12a48
parenta4d857f27581341abc40b68dad8901569f359050 (diff)
community/hidapi: build static library
Closes !35251 Co-Authored-By: David Dumas <david.dumas@tweag.io>
-rw-r--r--community/hidapi/APKBUILD19
1 files changed, 15 insertions, 4 deletions
diff --git a/community/hidapi/APKBUILD b/community/hidapi/APKBUILD
index 0d0e48fc43a..57123940f1f 100644
--- a/community/hidapi/APKBUILD
+++ b/community/hidapi/APKBUILD
@@ -20,15 +20,26 @@ options="!check" # No tests
builddir="$srcdir/hidapi-hidapi-$pkgver"
build() {
- cmake -B build -G Ninja \
+ _build build/static -DBUILD_SHARED_LIBS=OFF
+ _build build/shared -DBUILD_SHARED_LIBS=ON
+}
+
+_build() {
+ local outdir=$1; shift
+
+ cmake -B "$outdir" -G Ninja \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_INSTALL_LIBDIR=lib
- cmake --build build
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ "$@"
+ cmake --build "$outdir"
}
package() {
- DESTDIR="$pkgdir" cmake --install build
+ DESTDIR="$pkgdir" cmake --install build/shared
+
+ DESTDIR=".tmp" cmake --install build/static
+ mv .tmp/usr/lib/*.a "$pkgdir"/usr/lib/
}
sha512sums="