/[gentoo-x86]/eclass/emul-linux-x86.eclass
Gentoo

Contents of /eclass/emul-linux-x86.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (show annotations) (download)
Fri May 9 07:13:47 2014 UTC (5 months, 1 week ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.23: +6 -2 lines
Remove i686-* renamed tools as well with USE=abi_x86_32.

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/emul-linux-x86.eclass,v 1.23 2014/05/09 06:51:21 mgorny Exp $
4
5 #
6 # Original Author: Mike Doty <kingtaco@gentoo.org>
7 # Adapted from emul-libs.eclass
8 # Purpose: Providing a template for the app-emulation/emul-linux-* packages
9 #
10
11 inherit eutils multilib
12
13 case "${EAPI:-0}" in
14 3|4|5)
15 EXPORT_FUNCTIONS src_prepare src_install
16 ;;
17 *) die "EAPI=${EAPI} is not supported" ;;
18 esac
19
20 DESCRIPTION="Provides precompiled 32bit libraries"
21 #HOMEPAGE="http://amd64.gentoo.org/emul/content.xml"
22 HOMEPAGE="http://dev.gentoo.org/~pacho/emul.html"
23 SRC_URI="http://dev.gentoo.org/~pacho/emul/${P}.tar.xz"
24
25 IUSE="+development"
26
27 RESTRICT="strip"
28 S=${WORKDIR}
29
30 QA_PREBUILT="*"
31
32 SLOT="0"
33
34 DEPEND=">=sys-apps/findutils-4.2.26"
35 RDEPEND=""
36
37 emul-linux-x86_src_prepare() {
38 ALLOWED=${ALLOWED:-^${S}/etc/env.d}
39 use development && ALLOWED="${ALLOWED}|/usr/lib32/pkgconfig"
40 find "${S}" ! -type d ! '(' -name '*.so' -o -name '*.so.[0-9]*' -o -name '*.h' ')' | egrep -v "${ALLOWED}" | xargs -d $'\n' rm -f || die 'failed to remove everything but *.so*'
41 }
42
43 emul-linux-x86_src_install() {
44 for dir in etc/env.d etc/revdep-rebuild ; do
45 if [[ -d "${S}"/${dir} ]] ; then
46 for f in "${S}"/${dir}/* ; do
47 mv -f "$f"{,-emul}
48 done
49 fi
50 done
51
52 # remove void directories
53 find "${S}" -depth -type d -print0 | xargs -0 rmdir 2&>/dev/null
54
55 cp -pPR "${S}"/* "${ED}"/ || die "copying files failed!"
56
57 # Do not hardcode lib32, bug #429726
58 local x86_libdir=$(get_abi_LIBDIR x86)
59 if [[ ${x86_libdir} != "lib32" ]] ; then
60 ewarn "Moving lib32/ to ${x86_libdir}/; some libs might not work"
61 mv "${D}"/usr/lib32 "${D}"/usr/${x86_libdir} || die
62 if [[ -d ${D}/lib32 ]] ; then
63 mv "${D}"/lib32 "${D}"/${x86_libdir} || die
64 fi
65
66 pushd "${D}"/usr/${x86_libdir} >/dev/null
67
68 # Fix linker script paths.
69 local ldscripts
70 if ldscripts=( $(grep -ls '^GROUP.*/lib32/' *.so) ) ; then
71 sed -i \
72 -e "s:/lib32/:/${x86_libdir}/:" \
73 "${ldscripts[@]}" || die
74 fi
75
76 # Rewrite symlinks (if need be).
77 local sym tgt
78 while read sym ; do
79 tgt=$(readlink "${sym}")
80 ln -sf "${tgt/lib32/${x86_libdir}}" "${sym}" || die
81 done < <(find -xtype l)
82
83 popd >/dev/null
84 fi
85
86 # Since header wrapping is added as part of gx86-multilib support,
87 # all packages involved install their own copies of i686* headers
88 # when built with abi_x86_32.
89 if [[ -d "${D}"/usr/include ]] && use abi_x86_32; then
90 rm -r "${D}"/usr/include || die
91 fi
92 # The same goes for ${CHOST}- multilib tool prefixing.
93 if path_exists "${D}"/usr/bin/i686-pc-linux-gnu-* && use abi_x86_32; then
94 rm "${D}"/usr/bin/i686-pc-linux-gnu-* || die
95 fi
96 }

  ViewVC Help
Powered by ViewVC 1.1.20