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

Contents of /app-emulation/xen/xen-4.4.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat May 10 00:06:23 2014 UTC (4 years, 5 months ago) by dlan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
bump security patches, bug 508510, 508424, 509054, 509176

(Portage version: 2.2.8/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.0-r1.ebuild,v 1.1 2014/04/09 21:35:41 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=0
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 "${WORKDIR}"/patches-upstream
85 fi
86
87 # Gentoo's patchset
88 if [[ -n ${GENTOO_VER} ]]; then
89 EPATCH_SUFFIX="patch" \
90 EPATCH_FORCE="yes" \
91 epatch "${WORKDIR}"/patches-gentoo
92 fi
93
94 # Drop .config
95 sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
96
97 if use efi; then
98 epatch "${FILESDIR}"/${PN}-4.4-efi.patch
99 export EFI_VENDOR="gentoo"
100 export EFI_MOUNTPOINT="boot"
101 fi
102
103 # if the user *really* wants to use their own custom-cflags, let them
104 if use custom-cflags; then
105 einfo "User wants their own CFLAGS - removing defaults"
106 # try and remove all the default custom-cflags
107 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
108 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
109 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
110 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
111 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
112 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
113 -i {} \; || die "failed to re-set custom-cflags"
114 fi
115
116 # remove -Werror for gcc-4.6's sake
117 find "${S}" -name 'Makefile*' -o -name '*.mk' -o -name 'common.make' | \
118 xargs sed -i 's/ *-Werror */ /'
119 # not strictly necessary to fix this
120 sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
121
122 epatch_user
123 }
124
125 src_configure() {
126 use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
127
128 use debug && myopt="${myopt} debug=y"
129
130 if use custom-cflags; then
131 filter-flags -fPIE -fstack-protector
132 replace-flags -O3 -O2
133 else
134 unset CFLAGS
135 fi
136 }
137
138 src_compile() {
139 # Send raw LDFLAGS so that --as-needed works
140 emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
141 }
142
143 src_install() {
144 local myopt
145 use debug && myopt="${myopt} debug=y"
146
147 # The 'make install' doesn't 'mkdir -p' the subdirs
148 if use efi; then
149 mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
150 fi
151
152 emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
153 }
154
155 pkg_postinst() {
156 elog "Official Xen Guide and the unoffical wiki page:"
157 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
158 elog " http://en.gentoo-wiki.com/wiki/Xen/"
159
160 use efi && einfo "The efi executable is installed in boot/efi/gentoo"
161 }

  ViewVC Help
Powered by ViewVC 1.1.20