summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-20 14:52:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-23 22:35:01 +0000
commite1767e1287ffcd207bb20b526d3673d0bde70e83 (patch)
tree24a917cd1b6e12fc081bf78eb2d4d57161e7ef09 /meta/recipes-support
parentc907ea3246abc742dc7cf7e010b7c5c32c46a84f (diff)
downloadpoky-e1767e1287ffcd207bb20b526d3673d0bde70e83.tar.gz
libcap-ng: Fix python bindings determinism issue
(From OE-Core rev: e4ff283d8ae7f77b523a648e7c0dbbb1781008fe) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r--meta/recipes-support/libcap-ng/libcap-ng.inc4
-rw-r--r--meta/recipes-support/libcap-ng/libcap-ng/determinism.patch59
-rw-r--r--meta/recipes-support/libcap-ng/libcap-ng/python.patch20
3 files changed, 72 insertions, 11 deletions
diff --git a/meta/recipes-support/libcap-ng/libcap-ng.inc b/meta/recipes-support/libcap-ng/libcap-ng.inc
index 8c52b5d0b9..016d8e5174 100644
--- a/meta/recipes-support/libcap-ng/libcap-ng.inc
+++ b/meta/recipes-support/libcap-ng/libcap-ng.inc
@@ -8,9 +8,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
8 file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06" 8 file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
9 9
10SRC_URI = "https://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \ 10SRC_URI = "https://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \
11 file://determinism.patch \
11 file://python.patch \ 12 file://python.patch \
12" 13"
13 14
14SRC_URI[sha256sum] = "52c083b77c2b0d8449dee141f9c3eba76e6d4c5ad44ef05df25891126cb85ae9" 15SRC_URI[sha256sum] = "52c083b77c2b0d8449dee141f9c3eba76e6d4c5ad44ef05df25891126cb85ae9"
15 16
17EXTRA_OECONF_append_class-target = " --with-capability_header=${STAGING_INCDIR}/linux/capability.h"
18EXTRA_OECONF_append_class-nativesdk = " --with-capability_header=${STAGING_INCDIR}/linux/capability.h"
19
16BBCLASSEXTEND = "native nativesdk" 20BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/libcap-ng/libcap-ng/determinism.patch b/meta/recipes-support/libcap-ng/libcap-ng/determinism.patch
new file mode 100644
index 0000000000..fbb7380f56
--- /dev/null
+++ b/meta/recipes-support/libcap-ng/libcap-ng/determinism.patch
@@ -0,0 +1,59 @@
1[PATCH] bindings/python: Allow hardcoded path to capability.h to be overridden
2
3Currently the path to capability.h is hardcoded. When cross compiling
4the host capabiity.h may be different to the target copy, leading
5to different options being encoded in the python bindings than
6expected. This causes a reproducibility issue amongst other potential
7problems.
8
9Add a configure option to optionally specify the right path to the
10correct header as its probably safer/more reliable than trying to
11query the compiler to get the header path.
12
13Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org
14Upstream-Status: Submitted [https://github.com/stevegrubb/libcap-ng/pull/30]
15
16Index: libcap-ng-0.8.2/configure.ac
17===================================================================
18--- libcap-ng-0.8.2.orig/configure.ac
19+++ libcap-ng-0.8.2/configure.ac
20@@ -63,6 +63,13 @@ AC_CHECK_HEADERS(sys/vfs.h, [
21 AC_CHECK_HEADERS(linux/magic.h, [] [AC_MSG_WARN(linux/magic.h is required in order to verify procfs.)])
22 ], [AC_MSG_WARN(sys/vfs.h is required in order to verify procfs.)])
23
24+
25+AC_ARG_WITH([capability_header],
26+ [AS_HELP_STRING([--with-capability_header=path : path to cpapbility.h])],
27+ [CAPABILITY_HEADER=$withval],
28+ [CAPABILITY_HEADER=/usr/include/linux/capability.h])
29+AC_SUBST(CAPABILITY_HEADER)
30+
31 AC_C_CONST
32 AC_C_INLINE
33 AM_PROG_CC_C_O
34Index: libcap-ng-0.8.2/bindings/python3/Makefile.am
35===================================================================
36--- libcap-ng-0.8.2.orig/bindings/python3/Makefile.am
37+++ libcap-ng-0.8.2/bindings/python3/Makefile.am
38@@ -41,7 +41,7 @@ nodist__capng_la_SOURCES = capng_wrap.c
39 capng.py capng_wrap.c: ${srcdir}/../src/capng_swig.i caps.h capng.h
40 swig -o capng_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/capng_swig.i
41 caps.h:
42- cat /usr/include/linux/capability.h | grep '^#define CAP' | grep -v '[()]' > caps.h
43+ cat $(CAPABILITY_HEADER) | grep '^#define CAP' | grep -v '[()]' > caps.h
44 capng.h:
45 cat ${top_srcdir}/src/cap-ng.h | grep -v '_state' > capng.h
46
47Index: libcap-ng-0.8.2/bindings/python/Makefile.am
48===================================================================
49--- libcap-ng-0.8.2.orig/bindings/python/Makefile.am
50+++ libcap-ng-0.8.2/bindings/python/Makefile.am
51@@ -38,7 +38,7 @@ nodist__capng_la_SOURCES = capng_wrap.c
52 capng.py capng_wrap.c: ${srcdir}/../src/capng_swig.i caps.h capng.h
53 swig -o capng_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/capng_swig.i
54 caps.h:
55- cat /usr/include/linux/capability.h | grep '^#define CAP' | grep -v '[()]' > caps.h
56+ cat $(CAPABILITY_HEADER) | grep '^#define CAP' | grep -v '[()]' > caps.h
57 capng.h:
58 cat ${top_srcdir}/src/cap-ng.h | grep -v '_state' > capng.h
59
diff --git a/meta/recipes-support/libcap-ng/libcap-ng/python.patch b/meta/recipes-support/libcap-ng/libcap-ng/python.patch
index fcd6f9cd33..8db03ca31f 100644
--- a/meta/recipes-support/libcap-ng/libcap-ng/python.patch
+++ b/meta/recipes-support/libcap-ng/libcap-ng/python.patch
@@ -13,10 +13,10 @@ Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
13 configure.ac | 17 ++--------------- 13 configure.ac | 17 ++---------------
14 2 files changed, 5 insertions(+), 16 deletions(-) 14 2 files changed, 5 insertions(+), 16 deletions(-)
15 15
16diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am 16Index: libcap-ng-0.8.2/bindings/python/Makefile.am
17index 999b184..c8e49db 100644 17===================================================================
18--- a/bindings/python/Makefile.am 18--- libcap-ng-0.8.2.orig/bindings/python/Makefile.am
19+++ b/bindings/python/Makefile.am 19+++ libcap-ng-0.8.2/bindings/python/Makefile.am
20@@ -23,7 +23,9 @@ 20@@ -23,7 +23,9 @@
21 SUBDIRS = test 21 SUBDIRS = test
22 CONFIG_CLEAN_FILES = *.loT *.rej *.orig 22 CONFIG_CLEAN_FILES = *.loT *.rej *.orig
@@ -28,11 +28,11 @@ index 999b184..c8e49db 100644
28 SWIG_FLAGS = -python 28 SWIG_FLAGS = -python
29 SWIG_INCLUDES = ${AM_CPPFLAGS} 29 SWIG_INCLUDES = ${AM_CPPFLAGS}
30 pyexec_PYTHON = capng.py 30 pyexec_PYTHON = capng.py
31diff --git a/configure.ac b/configure.ac 31Index: libcap-ng-0.8.2/configure.ac
32index 8b46f51..2d7e00c 100644 32===================================================================
33--- a/configure.ac 33--- libcap-ng-0.8.2.orig/configure.ac
34+++ b/configure.ac 34+++ libcap-ng-0.8.2/configure.ac
35@@ -141,21 +141,8 @@ fi 35@@ -169,21 +169,8 @@ fi
36 36
37 # Setup Python2 with the interpreter found previously. 37 # Setup Python2 with the interpreter found previously.
38 AM_PATH_PYTHON 38 AM_PATH_PYTHON
@@ -56,5 +56,3 @@ index 8b46f51..2d7e00c 100644
56 fi 56 fi
57 AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes") 57 AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes")
58 58
59--
602.25.1