summaryrefslogtreecommitdiff
path: root/sys-libs/libseccomp/libseccomp-9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/libseccomp/libseccomp-9999.ebuild')
-rw-r--r--sys-libs/libseccomp/libseccomp-9999.ebuild33
1 files changed, 20 insertions, 13 deletions
diff --git a/sys-libs/libseccomp/libseccomp-9999.ebuild b/sys-libs/libseccomp/libseccomp-9999.ebuild
index 9df6cc592e47..c445290913e2 100644
--- a/sys-libs/libseccomp/libseccomp-9999.ebuild
+++ b/sys-libs/libseccomp/libseccomp-9999.ebuild
@@ -5,6 +5,7 @@ EAPI=7
PYTHON_COMPAT=( python3_{7..9} )
DISTUTILS_OPTIONAL=1
+DISTUTILS_USE_SETUPTOOLS=no
inherit distutils-r1 multilib-minimal
@@ -24,11 +25,7 @@ LICENSE="LGPL-2.1"
SLOT="0"
IUSE="python static-libs"
-REQUIRED_USE="
- python? (
- static-libs
- ${PYTHON_REQUIRED_USE}
- )"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
DEPEND="python? ( ${PYTHON_DEPS} )"
RDEPEND="${DEPEND}"
@@ -41,6 +38,9 @@ BDEPEND="${DEPEND}
DEPEND="${DEPEND} >=sys-kernel/linux-headers-4.3"
src_prepare() {
+ local PATCHES=(
+ "${FILESDIR}/libseccomp-python-shared.patch"
+ )
default
if [[ "${PV}" == *9999 ]] ; then
sed -i -e "s/0.0.0/${PRERELEASE}/" configure.ac
@@ -56,16 +56,24 @@ multilib_src_configure() {
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
+do_python() {
+ # setup.py reads VERSION_RELEASE from the environment
+ local -x VERSION_RELEASE=${PRERELEASE-${PV}}
+ pushd "${BUILD_DIR}/src/python" >/dev/null || die
+ "$@"
+ popd >/dev/null || die
+}
+
multilib_src_compile() {
emake
if multilib_is_native_abi && use python ; then
- cd "${S}/src/python" || die
- sed -i -e "s/=.*VERSION_RELEASE.*,/=\"${PRERELEASE}\",/" \
- -e "/extra_objects/s,\.\.,${OLDPWD}/src," \
- setup.py || die
- local -x CPPFLAGS="-I${OLDPWD}/include -I../../include"
- distutils-r1_src_compile
+ # setup.py expects libseccomp.so to live in "../.libs"
+ # Copy the python files to the right place for this.
+ rm -r "${BUILD_DIR}/src/python" || die
+ cp -r "${S}/src/python" "${BUILD_DIR}/src/python" || die
+ local -x CPPFLAGS="-I\"${BUILD_DIR}/include\" -I\"${S}/include\" ${CPPFLAGS}"
+ do_python distutils-r1_src_compile
fi
}
@@ -73,8 +81,7 @@ multilib_src_install() {
emake DESTDIR="${D}" install
if multilib_is_native_abi && use python ; then
- cd "${S}/src/python" || die
- distutils-r1_src_install
+ do_python distutils-r1_src_install
fi
}