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

Contents of /app-emulation/xen/xen-4.4.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Dec 19 06:44:44 2014 UTC (3 years, 11 months ago) by dlan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
security bump, bug 532030; add 4.5.0_rc4 for testing, with keywords dropped to alter user

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

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

  ViewVC Help
Powered by ViewVC 1.1.20