/[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.19 - (show annotations) (download)
Fri Jun 28 02:37:48 2013 UTC (9 months, 3 weeks ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.18: +7 -4 lines
do not fail the linker script hack when the package contains no linker scripts at all

1 # Copyright 1999-2013 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.18 2013/02/24 23:30:02 pacho 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 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 }

  ViewVC Help
Powered by ViewVC 1.1.20