prefix-chain-utils-0.2-r6.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit prefix
  4. DESCRIPTION="Chained EPREFIX utilities and wrappers"
  5. HOMEPAGE="https://dev.gentoo.org/~haubi"
  6. SRC_URI=""
  7. LICENSE="GPL-3"
  8. SLOT="0"
  9. KEYWORDS="~ppc-aix ~x86-linux ~sparc-solaris ~x86-solaris ~x86-winnt"
  10. IUSE=""
  11. DEPEND=""
  12. RDEPEND="sys-devel/gcc-config"
  13. src_install() {
  14. cp "${FILESDIR}"/*.in "${T}"
  15. eprefixify "${T}"/*.in
  16. for x in "${T}"/*.in; do
  17. mv ${x} ${x%.in}
  18. done
  19. # install toolchain wrapper.
  20. wrapperdir=/usr/${CHOST}/gcc-bin/${CHOST}-prefix-chain-wrapper/${PV}
  21. wrappercfg=${CHOST}-prefix-chain-wrapper-${PV}
  22. exeinto $wrapperdir
  23. sed -i -e "s,@GENTOO_PORTAGE_CHOST@,${CHOST},g" "${T}"/prefix-chain-wrapper
  24. doexe "${T}"/prefix-chain-wrapper
  25. dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-gcc
  26. dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-g++
  27. dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-cpp
  28. dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-c++
  29. dosym $wrapperdir/${CHOST}-gcc $wrapperdir/gcc
  30. dosym $wrapperdir/${CHOST}-g++ $wrapperdir/g++
  31. dosym $wrapperdir/${CHOST}-cpp $wrapperdir/cpp
  32. dosym $wrapperdir/${CHOST}-c++ $wrapperdir/c++
  33. # LDPATH is required to keep gcc-config happy :(
  34. cat > "${T}"/$wrappercfg <<EOF
  35. GCC_PATH="${EPREFIX}/$wrapperdir"
  36. LDPATH="${EPREFIX}/$wrapperdir"
  37. EOF
  38. insinto /etc/env.d/gcc
  39. doins "${T}"/$wrappercfg
  40. # install startprefix script.
  41. exeinto /
  42. doexe "${T}"/startprefix
  43. }