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

Contents of /app-emulation/xen/xen-4.2.5-r6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Apr 3 09:37:42 2015 UTC (3 years, 3 months ago) by dlan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
drop old after new stabilization

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0xAABEFD55)

1 # Copyright 1999-2015 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.2.5-r6.ebuild,v 1.3 2015/03/13 09:48:32 ago Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_6,2_7} )
8
9 if [[ $PV == *9999 ]]; then
10 KEYWORDS=""
11 REPO="xen-unstable.hg"
12 EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
13 S="${WORKDIR}/${REPO}"
14 live_eclass="mercurial"
15 else
16 KEYWORDS="amd64 x86"
17 UPSTREAM_VER=5
18 GENTOO_VER=
19
20 [[ -n ${UPSTREAM_VER} ]] && \
21 UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
22 [[ -n ${GENTOO_VER} ]] && \
23 GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P}-gentoo-patches-${GENTOO_VER}.tar.xz"
24 SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
25 ${UPSTREAM_PATCHSET_URI}
26 ${GENTOO_PATCHSET_URI}"
27 fi
28
29 inherit mount-boot flag-o-matic python-any-r1 toolchain-funcs eutils ${live_eclass}
30
31 DESCRIPTION="The Xen virtual machine monitor"
32 HOMEPAGE="http://xen.org/"
33 LICENSE="GPL-2"
34 SLOT="0"
35 IUSE="custom-cflags debug efi flask pae xsm"
36
37 DEPEND="${PYTHON_DEPS}
38 efi? ( >=sys-devel/binutils-2.22[multitarget] )
39 !efi? ( >=sys-devel/binutils-2.22[-multitarget] )"
40 RDEPEND=""
41 PDEPEND="~app-emulation/xen-tools-${PV}"
42
43 RESTRICT="test"
44
45 # Approved by QA team in bug #144032
46 QA_WX_LOAD="boot/xen-syms-${PV}"
47
48 REQUIRED_USE="
49 flask? ( xsm )
50 "
51
52 pkg_setup() {
53 python-any-r1_pkg_setup
54 if [[ -z ${XEN_TARGET_ARCH} ]]; then
55 if use x86 && use amd64; then
56 die "Confusion! Both x86 and amd64 are set in your use flags!"
57 elif use x86; then
58 export XEN_TARGET_ARCH="x86_32"
59 elif use amd64; then
60 export XEN_TARGET_ARCH="x86_64"
61 else
62 die "Unsupported architecture!"
63 fi
64 fi
65
66 if use flask ; then
67 export "XSM_ENABLE=y"
68 export "FLASK_ENABLE=y"
69 elif use xsm ; then
70 export "XSM_ENABLE=y"
71 fi
72 }
73
74 src_prepare() {
75 # Upstream's patchset
76 if [[ -n ${UPSTREAM_VER} ]]; then
77 EPATCH_SUFFIX="patch" \
78 EPATCH_FORCE="yes" \
79 EPATCH_OPTS="-p1" \
80 epatch "${WORKDIR}"/patches-upstream
81 fi
82
83 # Gentoo's patchset
84 if [[ -n ${GENTOO_VER} ]]; then
85 EPATCH_SUFFIX="patch" \
86 EPATCH_FORCE="yes" \
87 epatch "${WORKDIR}"/patches-gentoo
88 fi
89
90 # Drop .config and fix gcc-4.6
91 epatch "${FILESDIR}"/${PN/-pvgrub/}-4-fix_dotconfig-gcc.patch
92
93 if use efi; then
94 epatch "${FILESDIR}"/${PN}-4.2-efi.patch
95 export EFI_VENDOR="gentoo"
96 export EFI_MOUNTPOINT="boot"
97 fi
98
99 # if the user *really* wants to use their own custom-cflags, let them
100 if use custom-cflags; then
101 einfo "User wants their own CFLAGS - removing defaults"
102 # try and remove all the default custom-cflags
103 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
104 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
105 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
106 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
107 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
108 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
109 -i {} \; || die "failed to re-set custom-cflags"
110 fi
111
112 # not strictly necessary to fix this
113 sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
114
115 epatch_user
116 }
117
118 src_configure() {
119 use debug && myopt="${myopt} debug=y"
120 use pae && myopt="${myopt} pae=y"
121
122 if use custom-cflags; then
123 filter-flags -fPIE -fstack-protector
124 replace-flags -O3 -O2
125 else
126 unset CFLAGS
127 fi
128 }
129
130 src_compile() {
131 # Send raw LDFLAGS so that --as-needed works
132 emake CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
133 }
134
135 src_install() {
136 local myopt
137 use debug && myopt="${myopt} debug=y"
138 use pae && myopt="${myopt} pae=y"
139
140 # The 'make install' doesn't 'mkdir -p' the subdirs
141 if use efi; then
142 mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
143 fi
144
145 emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
146 }
147
148 pkg_postinst() {
149 elog "Official Xen Guide and the unoffical wiki page:"
150 elog " https://wiki.gentoo.org/wiki/Xen"
151 elog " http://en.gentoo-wiki.com/wiki/Xen/"
152
153 use pae && ewarn "This is a PAE build of Xen. It will *only* boot PAE kernels!"
154 use efi && einfo "The efi executable is installed in boot/efi/gentoo"
155 }

  ViewVC Help
Powered by ViewVC 1.1.20