aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
Diffstat (limited to 'community')
-rw-r--r--community/java-sigar/APKBUILD48
-rw-r--r--community/java-sigar/fix-inlined-functions-definition.patch29
-rw-r--r--community/java-sigar/musl-compat-HZ.patch12
-rw-r--r--community/java-sigar/musl-compat-strerror_r.patch24
-rw-r--r--community/java-sigar/tirpc.patch25
5 files changed, 138 insertions, 0 deletions
diff --git a/community/java-sigar/APKBUILD b/community/java-sigar/APKBUILD
new file mode 100644
index 0000000000..03cf505c6f
--- /dev/null
+++ b/community/java-sigar/APKBUILD
@@ -0,0 +1,48 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=java-sigar
+_pkgname=sigar
+pkgver=1.6.4
+pkgrel=0
+pkgdesc="System Information Gatherer And Reporter"
+url="https://github.com/hyperic/sigar/"
+arch="all !aarch64"
+license="Apache-2.0"
+depends="$pkgname-native=$pkgver-r$pkgrel"
+subpackages="$pkgname-native"
+makedepends="apache-ant libtirpc-dev linux-headers openjdk8 perl"
+source="https://github.com/hyperic/$_pkgname/archive/$_pkgname-$pkgver.tar.gz
+ musl-compat-HZ.patch
+ musl-compat-strerror_r.patch
+ tirpc.patch
+ fix-inlined-functions-definition.patch
+ "
+builddir="$srcdir/$_pkgname-$_pkgname-$pkgver"
+
+build() {
+ cd "$builddir"/bindings/java
+ ant build
+}
+
+package() {
+ cd "$builddir"/bindings/java
+
+ install -m 644 -D sigar-bin/lib/sigar.jar \
+ "$pkgdir"/usr/share/java/$_pkgname-$pkgver.jar
+ ln -s $_pkgname-$pkgver.jar "$pkgdir"/usr/share/java/$_pkgname.jar
+}
+
+native() {
+ pkgdesc="$pkgdesc (native library)"
+ depends=""
+
+ cd "$builddir"/bindings/java
+ install -m 755 -D sigar-bin/lib/libsigar-*-linux.so \
+ "$subpkgdir"/usr/lib/libsigar.so
+}
+
+sha512sums="0515f3501a51357d6ac01dc5e3ecffae10995f347b98c66928adff247b86e52112d2bf9cf78b2633941eb9c7fb23f019f4885c41348fe461239e4eebd147253e sigar-1.6.4.tar.gz
+bfb4f6f945207be652c58cfc8d3a552c84424d0ca9a3c0bf4177f4caa24c65a44ed3342b28d6d80d82a3e61d72f61d9c4194902bafa5372710db71f85e713f0f musl-compat-HZ.patch
+ea85154edc0ca2b15d556bbfe4fa61b37d2a53befa969b4c91d976b502f14ce138b0dbbd7d46985aa809a490df97b6ef388f3f16820e1e14b52fc85851342527 musl-compat-strerror_r.patch
+c6bda65e389a62495951a908f675fbe4aa24b3b819e8e4bc9fee87e9e59ca5533b9ad738737d42f7d7665cc077a3bbc868420aa281536d0673a62e94b165488c tirpc.patch
+ff313c86155c6c6e827cca1ea092308fce3f57eff88fb097e7f2f125ce42b44e45de57f7f45dd0b440fae854a169fad3e2ebe9d2fc9f2c7406413928ed081e15 fix-inlined-functions-definition.patch"
diff --git a/community/java-sigar/fix-inlined-functions-definition.patch b/community/java-sigar/fix-inlined-functions-definition.patch
new file mode 100644
index 0000000000..24cdb7292b
--- /dev/null
+++ b/community/java-sigar/fix-inlined-functions-definition.patch
@@ -0,0 +1,29 @@
+From d5c7a43eba53a421908bfcc5d84419fbab1b2528 Mon Sep 17 00:00:00 2001
+From: AlexYaruki <alexyaruki@gmail.com>
+Date: Fri, 2 Sep 2016 12:45:46 +0200
+Subject: [PATCH] Fix to inlined functions definition
+
+Fixes:
+
+ Error relocating bindings/java/sigar-bin/lib/libsigar-amd64-linux.so: sigar_skip_multiple_token: symbol not found
+ Error relocating bindings/java/sigar-bin/lib/libsigar-amd64-linux.so: sigar_skip_token: symbol not found
+
+diff --git a/include/sigar_util.h b/include/sigar_util.h
+index b3c4dd7d..9545d0f6 100644
+--- a/include/sigar_util.h
++++ b/include/sigar_util.h
+@@ -75,11 +75,11 @@ int sigar_inet_ntoa(sigar_t *sigar,
+ struct hostent *sigar_gethostbyname(const char *name,
+ sigar_hostent_t *data);
+
+-SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
++extern SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
+
+-SIGAR_INLINE char *sigar_skip_token(char *p);
++extern SIGAR_INLINE char *sigar_skip_token(char *p);
+
+-SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
++extern SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
+
+ char *sigar_getword(char **line, char stop);
+
diff --git a/community/java-sigar/musl-compat-HZ.patch b/community/java-sigar/musl-compat-HZ.patch
new file mode 100644
index 0000000000..19aa619095
--- /dev/null
+++ b/community/java-sigar/musl-compat-HZ.patch
@@ -0,0 +1,12 @@
+The HZ define is not exposed by musl libc.
+
+--- a/src/os/linux/linux_sigar.c
++++ b/src/os/linux/linux_sigar.c
+@@ -23,6 +23,7 @@
+ #include <sys/stat.h>
+ #include <sys/times.h>
+ #include <sys/utsname.h>
++#include <linux/param.h>
+
+ #include "sigar.h"
+ #include "sigar_private.h"
diff --git a/community/java-sigar/musl-compat-strerror_r.patch b/community/java-sigar/musl-compat-strerror_r.patch
new file mode 100644
index 0000000000..fcdd519ec4
--- /dev/null
+++ b/community/java-sigar/musl-compat-strerror_r.patch
@@ -0,0 +1,24 @@
+From e78f794c22e7825374d1d9bda37f649ed2f725d3 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 14 Mar 2016 14:17:29 +0000
+Subject: [PATCH] only enable the GNU libc strerror_r on GNU libc
+
+We don't want use the non-standard GNU libc variant of strerror_r on
+musl libc, or any libc other than GNU.
+---
+ src/os/linux/sigar_os.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/os/linux/sigar_os.h b/src/os/linux/sigar_os.h
+index 29a2ba32..7e1ead7d 100644
+--- a/src/os/linux/sigar_os.h
++++ b/src/os/linux/sigar_os.h
+@@ -70,7 +70,7 @@ struct sigar_t {
+ };
+
+ #define HAVE_STRERROR_R
+-#ifndef __USE_XOPEN2K
++#if !defined(__USE_XOPEN2K) && defined(__GLIBC__)
+ /* use gnu version of strerror_r */
+ #define HAVE_STRERROR_R_GLIBC
+ #endif
diff --git a/community/java-sigar/tirpc.patch b/community/java-sigar/tirpc.patch
new file mode 100644
index 0000000000..41454e5313
--- /dev/null
+++ b/community/java-sigar/tirpc.patch
@@ -0,0 +1,25 @@
+--- a/bindings/java/build.xml
++++ b/bindings/java/build.xml
+@@ -223,6 +223,7 @@
+ <path location="../../src/os/${jni.src}"/>
+ <path location="${build}/src"/>
+ <path location="src/jni"/>
++ <path location="/usr/include/tirpc"/>
+ </path>
+
+ <!-- extra solaris libs -->
+@@ -243,6 +243,14 @@
+ <condition property="jni.libset.libs" value="odm,cfg,perfstat,pthreads">
+ <isset property="aix"/>
+ </condition>
++
++ <condition property="jni.libset.dir" value="/usr/lib">
++ <isset property="linux"/>
++ </condition>
++
++ <condition property="jni.libset.libs" value="tirpc">
++ <isset property="linux"/>
++ </condition>
+ </target>
+
+ <target name="copy-includes">