/[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 - (hide annotations) (download)
Fri Jun 28 02:37:48 2013 UTC (9 months, 2 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 pacho 1.17 # Copyright 1999-2013 Gentoo Foundation
2 kingtaco 1.1 # Distributed under the terms of the GNU General Public License v2
3 vapier 1.19 # $Header: /var/cvsroot/gentoo-x86/eclass/emul-linux-x86.eclass,v 1.18 2013/02/24 23:30:02 pacho Exp $
4 kingtaco 1.1
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 pacho 1.17 inherit multilib
12 pacho 1.6
13 pacho 1.9 case "${EAPI:-0}" in
14 pacho 1.17 3|4|5)
15     EXPORT_FUNCTIONS src_prepare src_install
16 pacho 1.9 ;;
17     *) die "EAPI=${EAPI} is not supported" ;;
18     esac
19 kingtaco 1.1
20     DESCRIPTION="Provides precompiled 32bit libraries"
21 pacho 1.5 #HOMEPAGE="http://amd64.gentoo.org/emul/content.xml"
22     HOMEPAGE="http://dev.gentoo.org/~pacho/emul.html"
23 pacho 1.17 SRC_URI="http://dev.gentoo.org/~pacho/emul/${P}.tar.xz"
24    
25     IUSE="+development"
26 kingtaco 1.1
27     RESTRICT="strip"
28 kingtaco 1.3 S=${WORKDIR}
29 kingtaco 1.1
30 pacho 1.12 QA_PREBUILT="*"
31    
32 kingtaco 1.1 SLOT="0"
33    
34     DEPEND=">=sys-apps/findutils-4.2.26"
35     RDEPEND=""
36    
37 pacho 1.9 emul-linux-x86_src_prepare() {
38 pacho 1.7 ALLOWED=${ALLOWED:-^${S}/etc/env.d}
39 pacho 1.17 use development && ALLOWED="${ALLOWED}|/usr/lib32/pkgconfig"
40 pacho 1.18 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 kingtaco 1.1 }
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 pacho 1.9 cp -pPR "${S}"/* "${ED}"/ || die "copying files failed!"
56 pacho 1.13
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 vapier 1.14 if [[ -d ${D}/lib32 ]] ; then
63     mv "${D}"/lib32 "${D}"/${x86_libdir} || die
64     fi
65 vapier 1.16
66     pushd "${D}"/usr/${x86_libdir} >/dev/null
67    
68     # Fix linker script paths.
69 vapier 1.19 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 vapier 1.16
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 pacho 1.13 fi
85 kingtaco 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20