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

Contents of /app-emulation/xen-pvgrub/xen-pvgrub-4.1.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Apr 24 09:49:47 2012 UTC (2 years, 6 months ago) by mgorny
Branch: MAIN
Changes since 1.2: +3 -3 lines
Update to use mirror://.

(Portage version: 2.2.0_alpha101/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-pvgrub/xen-pvgrub-4.1.2.ebuild,v 1.2 2011/11/07 17:40:42 alexxy Exp $
4
5 EAPI="2"
6
7 inherit flag-o-matic eutils multilib toolchain-funcs
8
9 XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
10 OCAML_URL=http://caml.inria.fr/pub/distrib
11 LIBPCI_URL=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
12 GRUB_URL=mirror://gnu-alpha/grub
13 SRC_URI="
14 http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
15 $GRUB_URL/grub-0.97.tar.gz
16 $XEN_EXTFILES_URL/zlib-1.2.3.tar.gz
17 $LIBPCI_URL/pciutils-2.2.9.tar.bz2
18 $XEN_EXTFILES_URL/lwip-1.3.0.tar.gz
19 $XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz
20 $OCAML_URL/ocaml-3.11
21 "
22
23 S="${WORKDIR}/xen-${PV}"
24
25 DESCRIPTION="allows to boot Xen domU kernels from a menu.lst laying inside guest filesystem"
26 HOMEPAGE="http://xen.org/"
27 LICENSE="GPL-2"
28 SLOT="0"
29 KEYWORDS="~amd64 ~x86"
30 IUSE="custom-cflags"
31
32 DEPEND="sys-devel/gettext
33 sys-devel/gcc"
34
35 RDEPEND=">=app-emulation/xen-${PV}"
36
37 src_prepare() {
38 # Drop .config
39 sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
40 # if the user *really* wants to use their own custom-cflags, let them
41 if use custom-cflags; then
42 einfo "User wants their own CFLAGS - removing defaults"
43 # try and remove all the default custom-cflags
44 find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
45 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
46 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
47 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
48 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
49 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
50 -i {} \;
51 fi
52
53 sed -i \
54 -e 's/WGET=.*/WGET=cp -t . /' \
55 -e "s;\$(XEN_EXTFILES_URL);${DISTDIR};" \
56 -e 's/$(LD)/$(LD) LDFLAGS=/' \
57 -e 's;install-grub: pv-grub;install-grub:;' \
58 "${S}"/stubdom/Makefile || die
59 # Fix gcc-4.6
60 sed -i \
61 -e "s:-Werror::g" \
62 -i tools/libxc/Makefile \
63 -i extras/mini-os/minios.mk || die
64
65 #Prevent internal downloading
66 cp $DISTDIR/zlib-1.2.3.tar.gz \
67 $DISTDIR/pciutils-2.2.9.tar.bz2 \
68 $DISTDIR/lwip-1.3.0.tar.gz \
69 $DISTDIR/ocaml-3.11 \
70 $DISTDIR/newlib-1.16.0.tar.gz \
71 $DISTDIR/grub-0.97.tar.gz \
72 ./stubdom/ || die "files not coped to stubdom"
73
74 einfo "files copied to stubdom"
75
76 sed -e 's:^\t$(WGET) $(LWIP_URL):#\t$(WGET) $(LWIP_URL):' \
77 -e 's:^\t$(WGET) $(NEWLIB_URL):#\t$(WGET) $(NEWLIB_URL):' \
78 -e 's:^\t$(WGET) $(ZLIB_URL):#\t$(WGET) $(ZLIB_URL):' \
79 -e 's:^\t$(WGET) $(LIBPCI_URL):#\t$(WGET) $(LIBPCI_URL):' \
80 -e 's:^\t$(WGET) $(OCAML_URL):#\t$(WGET) $(OCAML_URL):' \
81 -e 's:^\t$(WGET) $(GRUB_URL):#$(WGET) $(GRUB_URL):' \
82 -i stubdom/Makefile || die "stubdom/Makefile could not be adjusted"
83 }
84
85 src_compile() {
86 use custom-cflags || unset CFLAGS
87 if test-flag-CC -fno-strict-overflow; then
88 append-flags -fno-strict-overflow
89 fi
90
91 emake CC="$(tc-getCC)" LD="$(tc-getLD)" -C tools/include || die "prepare libelf headers failed"
92
93 if use x86; then
94 emake -j1 CC="$(tc-getCC)" LD="$(tc-getLD)" \
95 XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub || \
96 die "compile pv-grub_x86_32 failed"
97 fi
98 if use amd64; then
99 emake -j1 CC="$(tc-getCC)" LD="$(tc-getLD)" \
100 XEN_TARGET_ARCH="x86_64" -C stubdom pv-grub || \
101 die "compile pv-grub_x86_64 failed"
102 if use multilib; then
103 multilib_toolchain_setup x86
104 emake -j1 \
105 XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub || \
106 die "compile pv-grub_x86_32 failed"
107 fi
108 fi
109 }
110
111 src_install() {
112 if use x86; then
113 emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub || die "install pv-grub_x86_32 failed"
114 fi
115 if use amd64; then
116 emake XEN_TARGET_ARCH="x86_64" DESTDIR="${D}" -C stubdom install-grub || die "install pv-grub_x86_64 failed"
117 if use multilib; then
118 emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub || die "install pv-grub_x86_32 failed"
119 fi
120 fi
121 }
122
123 pkg_postinst() {
124 elog "Official Xen Guide and the unoffical wiki page:"
125 elog " http://www.gentoo.org/doc/en/xen-guide.xml"
126 elog " http://en.gentoo-wiki.com/wiki/Xen/"
127 }

  ViewVC Help
Powered by ViewVC 1.1.20