summaryrefslogtreecommitdiff
path: root/i486-stage1/libcap
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-02-04 09:37:37 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-02-04 09:37:37 +0100
commit043b28ac8ebcaedac5d39bdf7f1f366b7818a666 (patch)
tree4f7784dc6b5530bbb7623d0ca2ddb4c71beb3c40 /i486-stage1/libcap
parent7be0daa504d7c43e20dc5583350417bff8d0f474 (diff)
downloadbootstrap32-043b28ac8ebcaedac5d39bdf7f1f366b7818a666.tar.xz
reorganized directory structure for package description, patches and other files
Diffstat (limited to 'i486-stage1/libcap')
-rw-r--r--i486-stage1/libcap/DESCR22
-rw-r--r--i486-stage1/libcap/libcap-2.25-gperf.patch12
2 files changed, 34 insertions, 0 deletions
diff --git a/i486-stage1/libcap/DESCR b/i486-stage1/libcap/DESCR
new file mode 100644
index 0000000..c58fb49
--- /dev/null
+++ b/i486-stage1/libcap/DESCR
@@ -0,0 +1,22 @@
+# libcap is needed for coreutils
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@KERNEL_HEADERS=/usr/include@BUILD_CC=gcc CC=$TARGET_ARCH-gcc AR=$TARGET_ARCH-ar RANLIB=$TARGET_ARCH-ranlib KERNEL_HEADERS=/usr/include@" PKGBUILD
+
+# https://bugs.gentoo.org/604802
+# gperf_case_strncmp (register const char *s1, register const char *s2, register size_t n)
+# gperf output is somehow broken for cross-compilation
+# https://bugs.gentoo.org/attachment.cgi?id=462080
+# TODO: https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/log/
+# wget -O libcap-2.25-gperf.patch 'https://604802.bugs.gentoo.org/attachment.cgi?id=462080'
+# copy libcap-2.25-gperf.patch from i486 folder
+sed -i 's@source=(@source=(libcap-2.25-gperf.patch @' PKGBUILD
+sed -i "s@md5sums=(@md5sums=('SKIP' @" PKGBUILD
+sed -i '2!N; /prepare() *{ *\n *cd/ a \ patch -Np1 < ${srcdir}/libcap-2.25-gperf.patch' PKGBUILD
+
+# TODO: mail this to https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/log/
+# libcap needs pam just when building a test (which we cannot execute anyway)
+# test.c:3:10: fatal error: security/pam_modules.h: No such file or directory
+# #include <security/pam_modules.h>
+# => add pam as dependency and build it as we need it anyway sooner or later
diff --git a/i486-stage1/libcap/libcap-2.25-gperf.patch b/i486-stage1/libcap/libcap-2.25-gperf.patch
new file mode 100644
index 0000000..ddce2c4
--- /dev/null
+++ b/i486-stage1/libcap/libcap-2.25-gperf.patch
@@ -0,0 +1,12 @@
+diff -rauN libcap-2.25/libcap/Makefile libcap-2.25-crossfix/libcap/Makefile
+--- libcap-2.25/libcap/Makefile 2016-01-31 01:01:41.000000000 +0100
++++ libcap-2.25-crossfix/libcap/Makefile 2017-12-07 21:44:49.040000002 +0100
+@@ -41,7 +41,7 @@
+ ./_makenames > cap_names.h
+
+ $(GPERF_OUTPUT): cap_names.list.h
+- perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
++ perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --includes --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
+
+ cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
+ @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"