summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haubenwallner <haubi@gentoo.org>2020-03-09 15:47:24 +0100
committerSam James <sam@gentoo.org>2023-05-26 07:07:50 +0100
commit4a89021d31213acfde52945512b6da0d01965963 (patch)
tree8679b99a74bf629a1c55d51a50d5909db0a97beb
parentapp-portage/prefix-toolkit: drop /portage from child's PORTAGE_TMPDIR (diff)
downloadprefix-toolkit-4a89021d31213acfde52945512b6da0d01965963.tar.gz
prefix-toolkit-4a89021d31213acfde52945512b6da0d01965963.tar.bz2
prefix-toolkit-4a89021d31213acfde52945512b6da0d01965963.zip
app-portage/prefix-toolkit(winnt): pull pthreads4w, intercept -pthreadprefix-toolkit-6
Some X11 library build system is dumb enough to just use -pthread, while others do triage this, before trying with -lpthread. So we intercept the -pthread compiler flag and add -lpthread instead. We cannot do that in parity because pthreads4w is installed in the stacked prefix, where it is built using parity. Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> (cherry picked from commit f2795c7e3b35c00c41cfc5a9937c55639a57783a)
-rw-r--r--prefix-stack-ccwrap15
-rw-r--r--prefix-stack-setup4
-rw-r--r--prefix-toolkit-6.ebuild (renamed from prefix-toolkit-5.ebuild)26
3 files changed, 41 insertions, 4 deletions
diff --git a/prefix-stack-ccwrap b/prefix-stack-ccwrap
index 4e297ce..00b3a36 100644
--- a/prefix-stack-ccwrap
+++ b/prefix-stack-ccwrap
@@ -7,6 +7,7 @@ fi
myself=${0##*/} # basename $0
link_dirs=()
+linkopts=()
opts=()
chost="@GENTOO_PORTAGE_CHOST@"
prefix="@GENTOO_PORTAGE_EPREFIX@"
@@ -21,6 +22,18 @@ orig_args=("$@")
for opt in "$@"
do
+ if [[ ${chost} == *"-winnt"* ]]; then
+ # We depend on dev-libs/pthreads4w, no?
+ case ${opt} in
+ -pthread | -lpthread)
+ case " ${linkopts[*]} " in
+ *" -lpthread "*) ;;
+ *) linkopts=( "${linkopts[@]}" "-lpthread" ) ;;
+ esac
+ continue
+ ;;
+ esac
+ fi
case "$opt" in
-L)
link_dirs=("${link_dirs[@]}" "-L$1")
@@ -83,7 +96,7 @@ esac
[[ ${myself} == *-*-*-* ]] || myself=${chost}-${myself#${chost}-}
case "$mode" in
-link) exec "${myself}" "${link_dirs[@]}" "${pfx_link[@]}" "${opts[@]}" "${pfx_comp[@]}" "${pfx_link_r[@]}" ;;
+link) exec "${myself}" "${link_dirs[@]}" "${pfx_link[@]}" "${opts[@]}" "${pfx_comp[@]}" "${pfx_link_r[@]}" "${linkopts[@]}" ;;
compile) exec "${myself}" "${link_dirs[@]}" "${opts[@]}" "${pfx_comp[@]}" ;;
version) exec "${myself}" "${orig_args[@]}" ;;
dirs)
diff --git a/prefix-stack-setup b/prefix-stack-setup
index 6527fba..305441d 100644
--- a/prefix-stack-setup
+++ b/prefix-stack-setup
@@ -224,6 +224,10 @@ ebegin "installing required basic packages"
sys-devel/gnuconfig \
sys-devel/gcc-config
+ # get eventual dependencies, add to world
+ emerge --verbose --update --deep \
+ app-portage/prefix-toolkit
+
# select the stack wrapper profile from gcc-config
env -i PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" \
"$(type -P bash)" "${CHILD_EPREFIX}"/usr/bin/gcc-config 1
diff --git a/prefix-toolkit-5.ebuild b/prefix-toolkit-6.ebuild
index 62f9452..a052312 100644
--- a/prefix-toolkit-5.ebuild
+++ b/prefix-toolkit-6.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -11,7 +11,7 @@ LICENSE="GPL-3"
SLOT="0"
[[ ${PV} == 9999 ]] ||
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
DEPEND="
!app-portage/prefix-chain-setup
@@ -31,6 +31,9 @@ RDEPEND="${DEPEND}
app-portage/elt-patches
sys-devel/gnuconfig
sys-devel/gcc-config
+ elibc_Winnt? (
+ dev-libs/pthreads4w
+ )
)
"
@@ -547,6 +550,10 @@ ebegin "installing required basic packages"
sys-devel/gnuconfig \
sys-devel/gcc-config
+ # get eventual dependencies, add to world
+ emerge --verbose --update --deep \
+ app-portage/prefix-toolkit
+
# select the stack wrapper profile from gcc-config
env -i PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" \
"$(type -P bash)" "${CHILD_EPREFIX}"/usr/bin/gcc-config 1
@@ -572,6 +579,7 @@ fi
myself=${0##*/} # basename $0
link_dirs=()
+linkopts=()
opts=()
chost="@GENTOO_PORTAGE_CHOST@"
prefix="@GENTOO_PORTAGE_EPREFIX@"
@@ -586,6 +594,18 @@ orig_args=("$@")
for opt in "$@"
do
+ if [[ ${chost} == *"-winnt"* ]]; then
+ # We depend on dev-libs/pthreads4w, no?
+ case ${opt} in
+ -pthread | -lpthread)
+ case " ${linkopts[*]} " in
+ *" -lpthread "*) ;;
+ *) linkopts=( "${linkopts[@]}" "-lpthread" ) ;;
+ esac
+ continue
+ ;;
+ esac
+ fi
case "$opt" in
-L)
link_dirs=("${link_dirs[@]}" "-L$1")
@@ -648,7 +668,7 @@ esac
[[ ${myself} == *-*-*-* ]] || myself=${chost}-${myself#${chost}-}
case "$mode" in
-link) exec "${myself}" "${link_dirs[@]}" "${pfx_link[@]}" "${opts[@]}" "${pfx_comp[@]}" "${pfx_link_r[@]}" ;;
+link) exec "${myself}" "${link_dirs[@]}" "${pfx_link[@]}" "${opts[@]}" "${pfx_comp[@]}" "${pfx_link_r[@]}" "${linkopts[@]}" ;;
compile) exec "${myself}" "${link_dirs[@]}" "${opts[@]}" "${pfx_comp[@]}" ;;
version) exec "${myself}" "${orig_args[@]}" ;;
dirs)