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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Jul 10 10:14:07 2015 UTC (3 years ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
Stable for amd64, wrt bug #553664

(Portage version: 2.2.20/cvs/Linux x86_64, RepoMan options: --include-arches="amd64", signed Manifest commit with key 7194459F)

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

  ViewVC Help
Powered by ViewVC 1.1.20