/[gentoo-x86]/app-emulation/xen/xen-4.1.2.ebuild
Gentoo

Contents of /app-emulation/xen/xen-4.1.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Nov 7 17:34:55 2011 UTC (3 years, 1 month ago) by alexxy
Branch: MAIN
Changes since 1.1: +5 -5 lines
adding of tc-getLD, prepared by Ian Delaney aka idella4

(Portage version: 2.2.0_alpha72/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen/xen-4.1.2.ebuild,v 1.1 2011/10/25 18:43:54 alexxy Exp $
4
5 EAPI="4"
6
7 if [[ $PV == *9999 ]]; then
8 KEYWORDS=""
9 REPO="xen-unstable.hg"
10 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
11 S="${WORKDIR}/${REPO}"
12 live_eclass="mercurial"
13 else
14 KEYWORDS="~amd64 ~x86"
15 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz"
16 fi
17
18 inherit mount-boot flag-o-matic toolchain-funcs ${live_eclass}
19
20 DESCRIPTION="The Xen virtual machine monitor"
21 HOMEPAGE="http://xen.org/"
22
23 LICENSE="GPL-2"
24 SLOT="0"
25 IUSE="custom-cflags debug flask pae xsm"
26
27 RDEPEND="|| ( sys-boot/grub
28 sys-boot/grub-static )"
29 PDEPEND="~app-emulation/xen-tools-${PV}"
30
31 RESTRICT="test"
32
33 # Approved by QA team in bug #144032
34 QA_WX_LOAD="boot/xen-syms-${PV}"
35
36 REQUIRED_USE="
37 flask? ( xsm )
38 "
39
40 pkg_setup() {
41 if [[ -z ${XEN_TARGET_ARCH} ]]; then
42 if use x86 && use amd64; then
43 die "Confusion! Both x86 and amd64 are set in your use flags!"
44 elif use x86; then
45 export XEN_TARGET_ARCH="x86_32"
46 elif use amd64; then
47 export XEN_TARGET_ARCH="x86_64"
48 else
49 die "Unsupported architecture!"
50 fi
51 fi
52
53 if use flask ; then
54 export "XSM_ENABLE=y"
55 export "FLASK_ENABLE=y"
56 elif use xsm ; then
57 export "XSM_ENABLE=y"
58 fi
59 }
60
61 src_prepare() {
62
63 # Drop .config
64 sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
65
66 # if the user *really* wants to use their own custom-cflags, let them
67 if use custom-cflags; then
68 einfo "User wants their own CFLAGS - removing defaults"
69 # try and remove all the default custom-cflags
70 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
71 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
72 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
73 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
74 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
75 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
76 -i {} \; || die "failed to re-set custom-cflags"
77 fi
78
79 # remove -Werror for gcc-4.6's sake
80 find "${S}" -name 'Makefile*' -o -name '*.mk' -o -name 'common.make' | \
81 xargs sed -i 's/ *-Werror */ /'
82 # not strictly necessary to fix this
83 sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
84 }
85
86 src_configure() {
87 use debug && myopt="${myopt} debug=y"
88 use pae && myopt="${myopt} pae=y"
89
90 if use custom-cflags; then
91 filter-flags -fPIE -fstack-protector
92 replace-flags -O3 -O2
93 else
94 unset CFLAGS
95 fi
96 }
97
98 src_compile() {
99 # Send raw LDFLAGS so that --as-needed works
100 emake CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
101 }
102
103 src_install() {
104 local myopt
105 use debug && myopt="${myopt} debug=y"
106 use pae && myopt="${myopt} pae=y"
107
108 emake LDFLAGS="$(raw-ldflags)" DESTDIR="${ED}" -C xen ${myopt} install
109 }
110
111 pkg_postinst() {
112 elog "Official Xen Guide and the unoffical wiki page:"
113 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
114 elog " http://en.gentoo-wiki.com/wiki/Xen/"
115
116 if use pae; then
117 echo
118 ewarn "This is a PAE build of Xen. It will *only* boot PAE kernels!"
119 fi
120 }

  ViewVC Help
Powered by ViewVC 1.1.20