libcgroup: unbreak musl + libtool>=2.4.6

This commit is contained in:
Jürgen Buchmüller 2015-10-25 14:29:02 +01:00
parent 83b107a3d3
commit d827eb5d00
3 changed files with 58 additions and 3 deletions

View file

@ -0,0 +1,22 @@
In musl libc these macros are defined in the deprecated
include file sys/cdefs.h
--- include/libcgroup.h 2014-01-13 15:05:56.000000000 +0100
+++ include/libcgroup.h 2015-10-25 14:03:32.921207668 +0100
@@ -16,6 +16,16 @@
#ifndef _LIBCGROUP_H
#define _LIBCGROUP_H
+#if !defined(__GLIBC__)
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+#endif /* !defined(__GLIBC__) */
+
#define _LIBCGROUP_H_INSIDE
#include <libcgroup/error.h>

View file

@ -0,0 +1,22 @@
The musl libc strerror_r(3) semantics are different from
GNU libc's if _GNU_SOURCE is defined.
--- src/api.c 2014-01-13 15:05:56.000000000 +0100
+++ src/api.c 2015-10-25 14:09:18.690232596 +0100
@@ -3332,8 +3332,16 @@
const char *cgroup_strerror(int code)
{
+#if defined(__GLIBC__)
if (code == ECGOTHER)
return strerror_r(cgroup_get_last_errno(), errtext, MAXLEN);
+#else
+ if (code == ECGOTHER) {
+ if (0 == strerror_r(cgroup_get_last_errno(), errtext, MAXLEN))
+ return errtext;
+ return "strerror_r() failed";
+ }
+#endif
return cgroup_strerror_codes[code % ECGROUPNOTCOMPILED];
}

View file

@ -1,10 +1,10 @@
# Template file for 'libcgroup'
pkgname=libcgroup
version=0.41
revision=4
revision=5
build_style=gnu-configure
configure_args="--sbindir=/usr/bin --enable-pam-module-dir=/usr/lib/security"
hostmakedepends="flex libtool"
hostmakedepends="flex automake libtool"
makedepends="pam-devel"
short_desc="Library that abstracts the control group file system in Linux"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
@ -13,8 +13,19 @@ homepage="http://libcg.sourceforge.net"
distfiles="${SOURCEFORGE_SITE}/libcg/$pkgname-$version.tar.bz2"
checksum=e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51
case "$XBPS_TARGET_MACHINE" in
*-musl) # Add musl-fts implementation
makedepends+=" musl-fts"
LDFLAGS="-lfts"
;;
esac
pre_configure() {
libtoolize -f
autoreconf -if
}
post_configure() {
# Disable tests
sed -i Makefile -e "/SUBDIRS =/ s; tests;;"
}
libcgroup-utils_package() {