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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat May 17 14:08:19 2014 UTC (4 years, 4 months ago) by dlan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
tree clean old ebuilds

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

  ViewVC Help
Powered by ViewVC 1.1.20