commit:     ed283b6255f2113865198fec01820b79b73708e3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 20 04:00:40 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 20 04:00:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed283b62

sys-libs/pam_wrapper: fix compile for multilib

We don't want to try build Python bindings for the multilib ABI (it's pointless,
it's only used for tests in other packages anyway).

Closes: https://bugs.gentoo.org/737468
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...1.1.3-r1.ebuild => pam_wrapper-1.1.3-r2.ebuild} | 46 ++++++++++++++++------
 1 file changed, 34 insertions(+), 12 deletions(-)

diff --git a/sys-libs/pam_wrapper/pam_wrapper-1.1.3-r1.ebuild 
b/sys-libs/pam_wrapper/pam_wrapper-1.1.3-r2.ebuild
similarity index 52%
rename from sys-libs/pam_wrapper/pam_wrapper-1.1.3-r1.ebuild
rename to sys-libs/pam_wrapper/pam_wrapper-1.1.3-r2.ebuild
index a95f837c4bb..65144032259 100644
--- a/sys-libs/pam_wrapper/pam_wrapper-1.1.3-r1.ebuild
+++ b/sys-libs/pam_wrapper/pam_wrapper-1.1.3-r2.ebuild
@@ -19,7 +19,6 @@ LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
 IUSE="test"
-
 RESTRICT="!test? ( test )"
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
@@ -27,7 +26,6 @@ RDEPEND="
        ${PYTHON_DEPS}
        sys-libs/pam:0=[${MULTILIB_USEDEP}]
 "
-
 DEPEND="
        ${RDEPEND}
        test? ( dev-util/cmocka[${MULTILIB_USEDEP}] )
@@ -35,26 +33,50 @@ DEPEND="
 
 multilib_src_configure() {
        configure_for_python() {
-               local libpam="${EPREFIX}"
-               multilib_is_native_abi || libpam+="/usr"
-               libpam+="/$(get_libdir)/libpam.so.0"
+               local libpam="${EPREFIX}/$(get_libdir)/libpam.so.0"
 
                local mycmakeargs=(
                        -DPAM_LIBRARY="${libpam}"
-                       -DUNIT_TESTING=$(usex test)
-                       -DPYTHON2_LIBRARY="/dev/null" # Disabled
-                       -DPYTHON3_INCLUDE_DIR="$(python_get_includedir)"
-                       -DPYTHON3_SITELIB="$(python_get_sitedir)"
+                       -DUNIT_TESTING=OFF
                )
+
                cmake_src_configure
        }
-       python_foreach_impl configure_for_python
+
+       if multilib_is_native_abi ; then
+               # Build the Pythons for each version (but only for the native 
ABI)
+               # bug #737468
+               python_foreach_impl configure_for_python
+       fi
+
+       # Do the regular build now
+       local libpam="${EPREFIX}"
+       multilib_is_native_abi || libpam+="/usr"
+       libpam+="/$(get_libdir)/libpam.so.0"
+
+       local mycmakeargs=(
+               -DPAM_LIBRARY="${libpam}"
+               -DUNIT_TESTING=$(usex test)
+               -DCMAKE_DISABLE_FIND_PACKAGE_Python{Libs,Interp,SiteLibs}=ON
+       )
+
+       cmake_src_configure
 }
 
 multilib_src_compile() {
-       python_foreach_impl cmake_src_compile
+       if multilib_is_native_abi ; then
+               python_foreach_impl cmake_src_compile
+       fi
+
+       # Compile the "proper" version without Python last
+       cmake_src_compile
 }
 
 multilib_src_install() {
-       python_foreach_impl cmake_src_install
+       if multilib_is_native_abi ; then
+               python_foreach_impl cmake_src_install
+       fi
+
+       # Install the "proper" version without Python last
+       cmake_src_install
 }

Reply via email to