aboutsummaryrefslogtreecommitdiffstats
path: root/community/libbytesize/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/libbytesize/APKBUILD')
-rw-r--r--community/libbytesize/APKBUILD50
1 files changed, 50 insertions, 0 deletions
diff --git a/community/libbytesize/APKBUILD b/community/libbytesize/APKBUILD
new file mode 100644
index 0000000000..56c9a3d79c
--- /dev/null
+++ b/community/libbytesize/APKBUILD
@@ -0,0 +1,50 @@
+# Contributor: Leo <thinkabit.ukim@gmail.com>
+# Contributor: André Klitzing <aklitzing@gmail.com>
+# Maintainer: André Klitzing <aklitzing@gmail.com>
+pkgname=libbytesize
+pkgver=2.2
+pkgrel=0
+pkgdesc="Library for working with arbitrary big sizes in bytes"
+options="!check" # Tests require dealing with locales
+url="https://github.com/rhinstaller/libbytesize"
+arch="all"
+license="LGPL-2.1-or-later"
+makedepends="gettext-dev gmp-dev mpfr-dev pcre2-dev python3"
+checkdepends="bash py3-six"
+subpackages="$pkgname-dev $pkgname-lang py-$pkgname:_py:noarch $pkgname-doc
+ $pkgname-tools:_tools:noarch"
+source="https://github.com/storaged-project/libbytesize/releases/download/$pkgver/libbytesize-$pkgver.tar.gz"
+
+build() {
+ CFLAGS="$CFLAGS -lintl" ./configure --prefix=/usr
+ make
+}
+
+check() {
+ # Disable test that depends on unpackaged pocketlint
+ sed -i 's|canary_tests.sh$||g' tests/Makefile
+
+ make check
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+}
+
+_py() {
+ pkgdesc="Python bindings for $pkgname"
+ depends="python3 py3-six"
+
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
+}
+
+_tools() {
+ pkgdesc="Tools for libbytesize"
+ depends="py-$pkgname"
+
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin
+}
+
+sha512sums="4538ac3499a24023c21fe07f527e400f99509921e377248970ac2da0eaf1655ddb261f432eed46a59ef69a1275ba7d1e5b0cc488d64eeea936b6cfa54c552ac1 libbytesize-2.2.tar.gz"