commit:     19111a37141aee3704830806a4419c1cced2d131
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  6 02:14:51 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul  6 02:14:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19111a37

app-emulation/virtualbox: fix build w/o PAM; respect CFLAGS

Closes: https://bugs.gentoo.org/583148
Closes: https://bugs.gentoo.org/843437
Thanks-to: François-Xavier Carton <fx.carton91 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/virtualbox-6.1.34-no-pam.patch           | 22 +++++++++++++++
 ....1.34-r2.ebuild => virtualbox-6.1.34-r3.ebuild} | 32 ++++++++++++----------
 2 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/app-emulation/virtualbox/files/virtualbox-6.1.34-no-pam.patch 
b/app-emulation/virtualbox/files/virtualbox-6.1.34-no-pam.patch
new file mode 100644
index 000000000000..9266cece55bd
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-6.1.34-no-pam.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/843437
+https://www.virtualbox.org/changeset/94406/vbox
+
+--- a/src/VBox/Runtime/Makefile.kmk
++++ b/src/VBox/Runtime/Makefile.kmk
+@@ -324,4 +324,7 @@
+ ifdef IPRT_WITH_FUTEX_BASED_SEMS
+  RuntimeR3_DEFS.linux  += IPRT_WITH_FUTEX_BASED_SEMS
++endif
++ifdef IPRT_WITHOUT_PAM
++ RuntimeR3_DEFS        += IPRT_WITHOUT_PAM
+ endif
+ RuntimeR3_INCS         = \
+--- a/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
++++ b/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
+@@ -86,4 +86,5 @@
+ 
+ #if !defined(IPRT_USE_PAM) \
++ && !defined(IPRT_WITHOUT_PAM) \
+  && ( defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) 
|| defined(RT_OS_NETBSD) || defined(RT_OS_OPENBSD) )
+ # define IPRT_USE_PAM
+

diff --git a/app-emulation/virtualbox/virtualbox-6.1.34-r2.ebuild 
b/app-emulation/virtualbox/virtualbox-6.1.34-r3.ebuild
similarity index 96%
rename from app-emulation/virtualbox/virtualbox-6.1.34-r2.ebuild
rename to app-emulation/virtualbox/virtualbox-6.1.34-r3.ebuild
index 73fc49ceb444..3920e11b0d57 100644
--- a/app-emulation/virtualbox/virtualbox-6.1.34-r2.ebuild
+++ b/app-emulation/virtualbox/virtualbox-6.1.34-r3.ebuild
@@ -4,23 +4,25 @@
 EAPI=8
 
 PYTHON_COMPAT=( python3_{8..10} )
-inherit desktop flag-o-matic java-pkg-opt-2 linux-info pax-utils 
python-single-r1 tmpfiles toolchain-funcs udev xdg
+inherit desktop edo flag-o-matic java-pkg-opt-2 linux-info pax-utils 
python-single-r1 tmpfiles toolchain-funcs udev xdg
 
 MY_PN="VirtualBox"
 MY_PV="${PV/beta/BETA}"
 MY_PV="${MY_PV/rc/RC}"
 MY_P=${MY_PN}-${MY_PV}
-[[ "${PV}" == *a ]] && DIR_PV="$(ver_cut 1-3)"
+[[ ${PV} == *a ]] && DIR_PV="$(ver_cut 1-3)"
 
 DESCRIPTION="Family of powerful x86 virtualization products for enterprise and 
home use"
 HOMEPAGE="https://www.virtualbox.org/";
 
SRC_URI="https://download.virtualbox.org/virtualbox/${DIR_PV:-${MY_PV}}/${MY_P}.tar.bz2
        
https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-6.1.12-patches-01.tar.xz";
+S="${WORKDIR}/${MY_PN}-${DIR_PV:-${MY_PV}}"
 
 LICENSE="GPL-2 dtrace? ( CDDL )"
 SLOT="0/$(ver_cut 1-2)"
-[[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
-KEYWORDS="~amd64"
+if [[ ${PV} != *_beta* ]] && [[ ${PV} != *_rc* ]] ; then
+       KEYWORDS="~amd64"
+fi
 IUSE="alsa debug doc dtrace headless java lvm +opus pam pax-kernel pch 
pulseaudio +opengl python +qt5 +sdk +udev vboxwebsrv vnc"
 
 COMMON_DEPEND="
@@ -121,12 +123,10 @@ QA_WX_LOAD="
 "
 
 QA_PRESTRIPPED="
-       /usr/lib64/virtualbox/VMMR0.r0
-       /usr/lib64/virtualbox/VBoxDDR0.r0
+       usr/lib64/virtualbox/VMMR0.r0
+       usr/lib64/virtualbox/VBoxDDR0.r0
 "
 
-S="${WORKDIR}/${MY_PN}-${DIR_PV:-${MY_PV}}"
-
 REQUIRED_USE="
        java? ( sdk )
        python? ( sdk )
@@ -136,7 +136,8 @@ REQUIRED_USE="
 
 PATCHES=(
        "${FILESDIR}/${P}-vboxr0.patch"
-       "${FILESDIR}/${PN}-6.1.34-python3.10.patch" #852152
+       "${FILESDIR}/${PN}-6.1.34-python3.10.patch" # bug #852152
+       "${FILESDIR}/${PN}-6.1.34-no-pam.patch" # bug #843437
 )
 
 pkg_pretend() {
@@ -225,11 +226,6 @@ src_prepare() {
        default
 }
 
-doecho() {
-       echo "$@"
-       "$@" || die
-}
-
 src_configure() {
        local myconf=(
                --with-gcc="$(tc-getCC)"
@@ -261,8 +257,14 @@ src_configure() {
        if use amd64 && ! has_multilib_profile ; then
                myconf+=( --disable-vmmraw )
        fi
+
+       cat >> LocalConfig.kmk <<-EOF || die
+               CFLAGS=${CFLAGS}
+               CXXFLAGS=${CXXFLAGS}
+       EOF
+
        # not an autoconf script
-       doecho ./configure "${myconf[@]}"
+       edo ./configure "${myconf[@]}"
 }
 
 src_compile() {

Reply via email to