summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2021-05-23 16:49:45 -0400
committerMike Gilbert <floppym@gentoo.org>2021-05-23 18:26:03 -0400
commit0e4b6f02ff363c24df72105616bbad85af62f219 (patch)
tree6dd7fdc472d484ea1fb9719ea86f0353bc5ea1c6 /sys-libs/libseccomp/libseccomp-9999.ebuild
parentdev-util/conf2struct: Added ~mips to KEYWORDS (diff)
downloadgentoo-0e4b6f02ff363c24df72105616bbad85af62f219.tar.gz
gentoo-0e4b6f02ff363c24df72105616bbad85af62f219.tar.bz2
gentoo-0e4b6f02ff363c24df72105616bbad85af62f219.zip
sys-libs/libseccomp: rework python support
Apply a patch to link against the shared library. Eliminate a messy sed expression by copying some files around instead. Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'sys-libs/libseccomp/libseccomp-9999.ebuild')
-rw-r--r--sys-libs/libseccomp/libseccomp-9999.ebuild32
1 files changed, 19 insertions, 13 deletions
diff --git a/sys-libs/libseccomp/libseccomp-9999.ebuild b/sys-libs/libseccomp/libseccomp-9999.ebuild
index 9256faff2b5c..c445290913e2 100644
--- a/sys-libs/libseccomp/libseccomp-9999.ebuild
+++ b/sys-libs/libseccomp/libseccomp-9999.ebuild
@@ -25,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}"
@@ -42,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
@@ -57,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
}
@@ -74,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
}