summaryrefslogtreecommitdiff
path: root/sys-apps/prefix-chain-utils
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/prefix-chain-utils')
-rw-r--r--sys-apps/prefix-chain-utils/Manifest6
-rw-r--r--sys-apps/prefix-chain-utils/files/prefix-chain-wrapper.in83
-rw-r--r--sys-apps/prefix-chain-utils/files/startprefix.in45
-rw-r--r--sys-apps/prefix-chain-utils/metadata.xml8
-rw-r--r--sys-apps/prefix-chain-utils/prefix-chain-utils-0.2-r7.ebuild64
5 files changed, 206 insertions, 0 deletions
diff --git a/sys-apps/prefix-chain-utils/Manifest b/sys-apps/prefix-chain-utils/Manifest
new file mode 100644
index 000000000000..cdac25aaae23
--- /dev/null
+++ b/sys-apps/prefix-chain-utils/Manifest
@@ -0,0 +1,6 @@
+AUX prefix-chain-wrapper.in 2229 SHA256 01e5d68e599b3b4a33dfffbb4d2d509617856c8416599431a01794c24edc48c7 SHA512 9bdc4ef2ca011a60bdb6f28aa94d111bd9683884de051e214ef6911f7cd18387fec2a5ee684f27bb74dc81f59c5d7d14b01647e7860920e2c23c34e75d134afa WHIRLPOOL 44fa9672fb0e7439b40406f95617e727aaebe0490c870826cd720eea42a7e3cd2c5e6de9b7e2108ef5cd69ad414a8d1ebb023349aa30009e7987b2f77113fb63
+AUX startprefix.in 1630 SHA256 e39474665a3ecccc408c3756a42ea864f01cfe38c331580af30467c0b53b9a35 SHA512 2492a12ed4a58bbd3af596fdfbdf57b6f158b8ada18a00c5b07dcac737197f232a044bb6277c186a272f423eeee0d805bcb6bf9756c574fd9248570743b99d03 WHIRLPOOL 85bdb634e87088aef9780a6cf63b45cf2499d6359e949743b060075c3d2986d7c1c4f4ad3ecfa6a903eebd64878c868f5da42c17873ca9503b9f498979f30605
+EBUILD prefix-chain-utils-0.2-r7.ebuild 1678 SHA256 e3c3c4ffa4f2dd0b63322b50c5edc439aab15f4dc2b9bb61c3ec810301b7cd8f SHA512 a7dd2d2822bb27fea0d94539c84abbd04198e0c906e39513e6afa00cff97d2a95a29a51d21b48a2b483f1b82f947b0ca2cdc02a607169665e2198c32519c1c82 WHIRLPOOL 6543a4b805e2b0ec841189cf3fffffdb9f6e65c5bbc3d5afa7d632932ef1970417206a88aef00307d80c2081b70e823237df157153d6a593694bc2783c689dfa
+MISC ChangeLog 2555 SHA256 13acbdb6b63a70336e4ead007f0d87533aec105694966b51d0c6507f57991645 SHA512 8dbb7eb8bc1de8864f5a2b251c0ef596435277b0c9d63c479dc96159918eafdad1d6dbe2326e680eef82081c83b847bd5bcb1d37e8b575d666d8640147ac1cb6 WHIRLPOOL f21d3721001dabcc48c2de32ce6720603c3a9e2c482e35749d94535eca984e6293440671246ae25c5c6e243829a16ba03fd3a5bcf09a28d2f25be286f26c0dd7
+MISC ChangeLog-2015 1042 SHA256 df4d6e39c906820bb09ff1af57369af54d44bfd6c393ac19be7fe4ab2d49bcb6 SHA512 72308c8bf78679703fa77d835575b3caf815e64db5a0cd6228cab7a18a41a2bae5a1ffee5240d0fd40bf86722d5a48aa33f80b3461a3424bfc2141058f37aa59 WHIRLPOOL afb89ef8b1f829b98827cc9c0eacf3f13b39581cf1b7c146f5d74782dcd5341b3232a01880c18285e3503d675c8a0954c7da9bdb8accd4e7d84746cf77fce9fe
+MISC metadata.xml 243 SHA256 acb891975882d2b75bb5a1a76063f1d61ad1d96c799548e7f141e1623a0cc57e SHA512 8489be9ea6eac385511b0d193b1b61fad9c8e0d4cb86fd711e6faf04e66b2c935ae64ce6ce0a044d036e76de6787e5d440d67f831e89261a71e74b645a0999d9 WHIRLPOOL e06d2acbfdb38aa17edb0da41bcafece9c9a5d0542c9192ee3b74ae0b6250d24fb096e3a153f6a215a29d3dd7c5794f2c67f0917db3aa3f1cc65e86ea27e228f
diff --git a/sys-apps/prefix-chain-utils/files/prefix-chain-wrapper.in b/sys-apps/prefix-chain-utils/files/prefix-chain-wrapper.in
new file mode 100644
index 000000000000..d612cc46bb28
--- /dev/null
+++ b/sys-apps/prefix-chain-utils/files/prefix-chain-wrapper.in
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+if [ -r /cygdrive/. ]; then
+ winpath2unix() { cygpath -u "$1"; }
+ unixpath2win() { cygpath -w "$1"; }
+fi
+
+link_dirs=()
+opts=()
+chost="@GENTOO_PORTAGE_CHOST@"
+prefix="@GENTOO_PORTAGE_EPREFIX@"
+absprefix=${prefix}
+if [[ ${CHOST} == *"-winnt"* ]]; then
+ # we may get called from windows binary, like pkgdata in dev-libs/icu
+ # in this case, PATH elements get the "/dev/fs/C/WINDOWS/SUA" prefix
+ absprefix=$(winpath2unix "$(unixpath2win "${absprefix}")")
+fi
+[[ $0 == *windres* ]] && mode=compile || mode=link
+orig_args=("$@")
+
+for opt in "$@"; do
+ case "$opt" in
+ -L) link_dirs=("${link_dirs[@]}" "-L$1"); shift ;;
+ -L*) link_dirs=("${link_dirs[@]}" "${opt}") ;;
+ *)
+ case "${opt}" in
+ -v)
+ # -v done right: only use mode version if -v is the _only_
+ # argument on the command line.
+ [[ ${#orig_args[@]} -gt 1 ]] || mode=version
+ ;;
+ --version) mode=version ;;
+ -c|-E|-S) mode=compile ;;
+ -print-search-dirs) mode=dirs ;;
+ esac
+ opts=("${opts[@]}" "${opt}")
+ ;;
+ esac
+done
+
+save_ifs=$IFS
+IFS=':'
+new_path=
+for p in $PATH; do
+ IFS=$save_ifs
+ [[ "${p#${absprefix}}" != "${p}" ]] && continue
+ if [[ -z "${new_path}" ]]; then
+ new_path="${p}"
+ else
+ new_path="${new_path}:${p}"
+ fi
+done
+IFS=$save_ifs
+
+PATH=${new_path}
+
+# toolchain-prefix-wrapper's ld-wrapper understands '-R' for aix and hpux too.
+# parity (winnt) understands -rpath only ...
+case "${chost}" in
+*-winnt*) rpath_opt="-Wl,-rpath," ;;
+*) rpath_opt="-Wl,-R," ;;
+esac
+
+pfx_link=("-L${prefix}/usr/lib" "-L${prefix}/lib")
+pfx_link_r=("${rpath_opt}${prefix}/lib" "${rpath_opt}${prefix}/usr/lib")
+pfx_comp=("-I${prefix}/include" "-I${prefix}/usr/include")
+
+case "$mode" in
+link) exec "$(basename $0)" "${link_dirs[@]}" "${pfx_link[@]}" "${opts[@]}" "${pfx_comp[@]}" "${pfx_link_r[@]}" ;;
+compile) exec "$(basename $0)" "${link_dirs[@]}" "${opts[@]}" "${pfx_comp[@]}" ;;
+version) exec "$(basename $0)" "${orig_args[@]}" ;;
+dirs)
+ "$(basename $0)" "${orig_args[@]}" | while read line; do
+ if [[ "${line}" == "libraries: ="* ]]; then
+ echo "libraries: =${prefix}/usr/lib:${prefix}/lib:${line#"libraries: ="}"
+ else
+ echo "${line}"
+ fi
+ done
+ ;;
+*) echo "cannot infer $0's mode from comamnd line arguments"; exit 1 ;;
+esac
+
diff --git a/sys-apps/prefix-chain-utils/files/startprefix.in b/sys-apps/prefix-chain-utils/files/startprefix.in
new file mode 100644
index 000000000000..3882ffe14a9c
--- /dev/null
+++ b/sys-apps/prefix-chain-utils/files/startprefix.in
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+
+if [[ -r "@GENTOO_PORTAGE_EPREFIX@"/lib/gentoo/functions.sh ]]; then
+ . "@GENTOO_PORTAGE_EPREFIX@"/lib/gentoo/functions.sh
+elif [[ -r "@GENTOO_PORTAGE_EPREFIX@"/etc/init.d/functions.sh ]]; then
+ . "@GENTOO_PORTAGE_EPREFIX@"/etc/init.d/functions.sh
+elif [[ -r "@GENTOO_PORTAGE_EPREFIX@"/sbin/functions.sh ]]; then
+ . "@GENTOO_PORTAGE_EPREFIX@"/sbin/functions.sh
+fi
+
+einfo "entering chained prefix @GENTOO_PORTAGE_EPREFIX@ ..."
+
+# inform profiles very early of us beeing interactive (or at least,
+# we will _start_ an interactive shell, so we want the according bits.)
+set -i
+
+. "@GENTOO_PORTAGE_EPREFIX@"/etc/profile
+
+# if there is no local portage, foreign portage instances need to know
+# where to merge to - and thus we need to set EPREFIX.
+# the other way round, if there is a local portage, EPREFIX may not
+# point anywhere else than to our local EPREFIX or be unset...
+
+# DISABLED: this is done by etc/profile now, to be able to start a
+# prefix environment by sourcing etc/profile.
+
+#if [[ -x "@GENTOO_PORTAGE_EPREFIX@"/usr/bin/emerge ]]; then
+# if [[ -n "${EPREFIX}" ]] && [[ "${EPREFIX}" != "@GENTOO_PORTAGE_EPREFIX@" ]]; then
+# ewarn "EPREFIX is set. this will render portage unusable, unsetting"
+# unset EPREFIX
+# fi
+#else
+# export EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
+#fi
+
+# a common problem: the child has no less installed, but baselayout insists
+# on setting PAGER to EPREFIX/usr/bin/less. everything gets back to normal
+# when unsetting PAGER in this case.
+if [[ ! -x "${PAGER}" ]]; then
+ unset PAGER
+fi
+
+bash --noprofile
+einfo "leaving chained prefix @GENTOO_PORTAGE_EPREFIX@ ..."
+
diff --git a/sys-apps/prefix-chain-utils/metadata.xml b/sys-apps/prefix-chain-utils/metadata.xml
new file mode 100644
index 000000000000..d33cce94b0d4
--- /dev/null
+++ b/sys-apps/prefix-chain-utils/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>prefix@gentoo.org</email>
+ <name>Gentoo Prefix</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/prefix-chain-utils/prefix-chain-utils-0.2-r7.ebuild b/sys-apps/prefix-chain-utils/prefix-chain-utils-0.2-r7.ebuild
new file mode 100644
index 000000000000..b447752a1536
--- /dev/null
+++ b/sys-apps/prefix-chain-utils/prefix-chain-utils-0.2-r7.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit prefix
+
+DESCRIPTION="Chained EPREFIX utilities and wrappers"
+HOMEPAGE="https://dev.gentoo.org/~haubi"
+SRC_URI=""
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~ppc-aix ~x86-linux ~sparc-solaris ~x86-solaris ~x86-winnt"
+IUSE=""
+
+DEPEND=""
+RDEPEND="sys-devel/gcc-config"
+
+src_unpack() {
+ mkdir -p "${S}"
+}
+
+src_install() {
+ cp "${FILESDIR}"/*.in "${T}"
+ eprefixify "${T}"/*.in
+
+ for x in "${T}"/*.in; do
+ mv ${x} ${x%.in}
+ done
+
+ # install toolchain wrapper.
+ wrapperdir=/usr/${CHOST}/gcc-bin/${CHOST}-prefix-chain-wrapper/${PV}
+ wrappercfg=${CHOST}-prefix-chain-wrapper-${PV}
+
+ exeinto $wrapperdir
+ sed -i -e "s,@GENTOO_PORTAGE_CHOST@,${CHOST},g" "${T}"/prefix-chain-wrapper
+ doexe "${T}"/prefix-chain-wrapper
+
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-gcc
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-g++
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-cpp
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-c++
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-windres
+
+ dosym $wrapperdir/${CHOST}-gcc $wrapperdir/gcc
+ dosym $wrapperdir/${CHOST}-g++ $wrapperdir/g++
+ dosym $wrapperdir/${CHOST}-cpp $wrapperdir/cpp
+ dosym $wrapperdir/${CHOST}-c++ $wrapperdir/c++
+ dosym $wrapperdir/${CHOST}-windres $wrapperdir/windres
+
+ # LDPATH is required to keep gcc-config happy :(
+ cat > "${T}"/$wrappercfg <<EOF
+GCC_PATH="${EPREFIX}/$wrapperdir"
+LDPATH="${EPREFIX}/$wrapperdir"
+EOF
+
+ insinto /etc/env.d/gcc
+ doins "${T}"/$wrappercfg
+
+ # install startprefix script.
+ exeinto /
+ doexe "${T}"/startprefix
+}