summaryrefslogtreecommitdiff
path: root/app-emulation/xen-tools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-17 17:51:45 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-17 17:51:45 +0100
commit420eeee727d39d869d864caddb04a80dafda7160 (patch)
tree87f15d7467082dd92fce78a6cc2f56fa8d0774af /app-emulation/xen-tools
parent0fdd4074ff3dc0c507a9867380a4f91250a0b610 (diff)
gentoo resync : 17.10.2017
Diffstat (limited to 'app-emulation/xen-tools')
-rw-r--r--app-emulation/xen-tools/Manifest4
-rw-r--r--app-emulation/xen-tools/files/xen-watchdog.initd6
-rw-r--r--app-emulation/xen-tools/files/xenstored.initd-r12
-rw-r--r--app-emulation/xen-tools/xen-tools-4.8.2-r2.ebuild466
4 files changed, 476 insertions, 2 deletions
diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
index 0c9ffea06992..f99791ec0059 100644
--- a/app-emulation/xen-tools/Manifest
+++ b/app-emulation/xen-tools/Manifest
@@ -1,6 +1,7 @@
AUX gentoo-patches.conf 3739 SHA256 5e883701f52cb91ed6dc56b4e211acf18b93d956cab6d27e7a0fee457b9d329c SHA512 4d1da5fd4cc8a756c254e9d9a562b42732940560026af36f65b79614bcc7881692c3ce9d69640978b00d8e985d77350c6cfd5364211e7d09d96ba0920882c7dc WHIRLPOOL 0921fc37779bc25fe4f198b7a795196e25410484b74fba2a49b8f37e0667fd39645869879b011c111a0a9032a3363d2c59362a09ecba5fab36214ff58c438491
AUX stubs-32.h 537 SHA256 4c903162da80cefd394404cb8cd9963a6ef6e3ad6c7adcbaa450a002d929bfc5 SHA512 55308dbedaa91909a2213940f7a7b574cabe6b5a3104761a2a6f28d6aed00164544488c00cbf9d66a9a370a14c6b6d3a00434efd3ff0228cc8e4d81af19c0e68 WHIRLPOOL 9c006e266bea6bb9d623e76011a4eac07c5fe4fdf76a041cc42a2289a7e9163988bad0fb2f458e300e45aabf9fb864ec764a496d7f89d58e57a506bac206a5f1
AUX xen-consoles.logrotate 63 SHA256 0da87a4b9094f934e3de937e8ef8d3afc752e76793aa3d730182d0241e118b19 SHA512 ab2105c75cfe01768aecd5bcbb56269d63666e8a44e42b6a83aee87df6c84ee2f9ab249171c21b2e09f8fec2cae8318f6e87d160989398a3e7dd68db8d52c426 WHIRLPOOL be108bf298202851de434af513ac8c03a533e7621623c2a7e8f26d498074b3eec81b85b2ae29ad2ec67f4fe9937c88bd78c5f5e260793e7e69ec964d4adb989e
+AUX xen-watchdog.initd 181 SHA256 ff6089e6c744a92108b835f4ce48838998133dddbbfd18b848c73be93ff44285 SHA512 5f6da91c0067b93f1b9f1a2f181caf34034896944ab26f5820e860336e3b3159a65e8a7f39ea273927d64d58a2fe4d918d2c3234f2b03ab0770e0c15d6dfe84b WHIRLPOOL 537b0cbd482bc6eb9ed1a90890365405368b62565c8a973ea8efe1a71072dea557dd1f40724beb0744617600de3f0a1d38f2ab73e61c873012b3b3c4609563d4
AUX xencommons.confd 109 SHA256 e19b950b1bb4103f9006a0c2648a8d4bc890e2c67417de2700b82fb456802640 SHA512 f0bbc9647cecc6cf806e3059960fbe39b23304d9ca0955fb261e1d320b9b9ce59e5b28cc4b5a9922295b31221f0cd8f0cccb405520e097a7b12dc6ddb3294c17 WHIRLPOOL a8b7df6f9a8515b9c3c845379a3aa4424490972d5f882e8779a30fd2d44b77cb66deaa5c1496125ea7bc82e06044a485e14e904ad5c9c79222c008fb6ccc4e74
AUX xencommons.initd 1451 SHA256 28def3e506480b66dea61d142db03959d7cd893177dff7f92ce9baa00a047699 SHA512 7cd2f2c8b45ce36bac158d7cddd1c33a20b46beb521f33584249338dcf9ac6efb32fd09bdbd67651cda6ffb6304b21043e29e79e62a61903884a8ebcaabcb4b8 WHIRLPOOL 2812689d04eb315767c557cd889c752150be80830582d9da046fb179f1209892d4085c37f42e7599759d8ecd36f0e2fe2bc136ea8ceff447ebff91195f884a3c
AUX xenconsoled.confd 44 SHA256 2a74be03eb74f6013242a4a5d721df6cb9b959b43c405de1e32813f52d749060 SHA512 30df69cc38d0bed26bc4d6e08a2b62cbdc654d5f663009a05cb3b83b3e3dc5e206362d3fd59abbb753ceb8d6d79eaa6e15d079bb8f4f35dc74667103faf4e85d WHIRLPOOL 503f7b48842724e69e7e4ae752d0570c339b7214b5a5fa1db51300e65470803bb383524f6de6c5c08849a961f628f6db7764e3eddcc19accbd209777a0f27d68
@@ -12,7 +13,7 @@ AUX xenqemudev.confd 156 SHA256 61c5ff72464c5098d9cad50e5dc94a090dd107b4831bb60a
AUX xenqemudev.initd 1828 SHA256 3e9d6c4575f6a8ca8f9c7dfd78a9ea4b016c6ab00e9a2f6483200a53e5696aab SHA512 6c391f52659117e9d1c8eb8ccd4a9886b207e009903c48f69e1c92c67a1365e64c6e6a02bbdbf3c844cca9c0cba01fa35c235fef0621ee16bfbe75489247c739 WHIRLPOOL 21e0d5b9715c71af378bb90916afc34d285acce19105a50bf21e45c4e581e3e690d9883a09022d588619aa480264b9bb384348645034d12c6ccd355349eeed5e
AUX xenstored.confd 42 SHA256 afcc14f014fe4ec478f85d230efefba9ffad024bf8c83b30074e8a3712cc7831 SHA512 0906cbcdc84935d07cf53bc4447a1f9a9dc4e4fb9fda9a7163f6982f1d8a3ada1f0650fcd254fb6f715a54f7971daf0a5e61c3de6db70dfd156156fd55b59fe4 WHIRLPOOL df46f3fde8b13c3427f445bcf08eb4c660f6000164a01e461cff85cf93ce1195009fc3b4457181788da8eef8dec9125b41ace233ec6f169919be64337a57ebb8
AUX xenstored.initd 1058 SHA256 6c6f62143b1c3b14c3c3cfc57fb3c86ba904cd83cdad467ff0e3525e370e2528 SHA512 195a7a8d50d28597d8f66416141d416c32095af5499d5978c6163996ea9cbbd6bfb343f7e0fe7a8835e39c8924906547cfc662e2ddd96ec571f47b3da79de090 WHIRLPOOL 9c617a23cb93f9697148390c8f3e728ad532ae3c799175cae1b33f6e6eab477753872f4427599df59821f73bd880e81873b6ec15cc3cc4a7843c82841072af26
-AUX xenstored.initd-r1 915 SHA256 186a0ee79bbd99f4fe54c52bec0515917b6c31f9c18cf670aa6163a5c221e64a SHA512 7d1a45defdcc328d9e77e5890633a394312a93ebb2c9d28b418565aeaf5ab10abcc57a62f61178f22cfc313241e6fe0e324fba5c1784d437b7ff6ed30f0db16b WHIRLPOOL d71643c5fa5843fbc803dedec169408632b37f31e4e0a3b7232fba25b1aa3803a732d60683403322f3b32138bbfd13fa6a145033d8228a92a24677d082975a26
+AUX xenstored.initd-r1 916 SHA256 9c566b35a8951a50ebf4cb260c1a98e35093c6f6318231061d0068abf4e52de0 SHA512 1404c9c454f5359389a2e9588317f10412dafdbdeb1de5da945c10f8e6efd09007e96d35b75d04a4c3d5c59baa9c3bbee4192240cacee128b0adf9066d3efc10 WHIRLPOOL 3df3b1a69fce7559f3f41bb776c77c02912024224c0e4ef6059996a9077c942430950d75a6e063034160edf6e449ff84dde76996428d6e756451a3c32122ce89
DIST ovmf-20151110.tar.bz2 27518370 SHA256 74199f6b5c6f756881323242742c396c52096db5f61700a4eb839343f9ab0604 SHA512 dda185af2fc0b9a8d5fc7e1e96db6aa31807782fe77d38491896164d125c30d2277db3d71a7dce7bbd569723b344b97dfebbc78ddddca0a095721f6b1ae3a1d3 WHIRLPOOL 145fb1c873cce96b81b269b44800987ca1b7350425b682fd5a5799648b0270c6c17bb337ad7e06650e6b66a9ac6eef8d9c9239f1478a687be4af187e60c3f3f5
DIST seabios-1.10.0.tar.gz 588213 SHA256 8976fc4c1ebcda66ac96689762247dfc99115a5f7acb3a7d4e18d18ff5de12a9 SHA512 f1b83ce37b59070b488e19f98c95ca9f413cf4969663331b631c3ccb884c90b2db793d32a779ef05cead538c2fd123be4b73391ad2fa20c900a1f14237178d8c WHIRLPOOL 77718eac01a59f94c3fa81195925ae09c19e11f80f107b3387e910408d88d3ffc93eaca3b73d6a52b67514538c0e020b0f4078db8277a5ee6361fd0d3ada8598
DIST seabios-1.8.2.tar.gz 538497 SHA256 f59479307fdae840de398b75aacb2333c8eba24a5964d68c77e32ca6c987ee61 SHA512 798d222d5f5725a805cde9e6000b5ce714d0551fd4a3c2642cc6e77b2bdab1a9e239939a358a23bbe0e00112f5ad70696c87d20b90655463c835541fc04e1a00 WHIRLPOOL 9cda0ad502a59dd718c543b759ac3fcf5acb4adee70c3da9bfea95ab188415acf6425827de77f45421ec3be8fd9e0c37fb486e62828217ba3e83f88d942a3f4a
@@ -29,6 +30,7 @@ DIST xen-security-patches-25.tar.xz 9208 SHA256 ceaa520d4d98ab7b6ce5b58c38049937
EBUILD xen-tools-4.7.2.ebuild 14072 SHA256 61ab7974b863a2791aaa188c5f5df408f115c21c7a1f770654a807ca45d33365 SHA512 2a8119fa5eaa93594379d51d039e0af86c11d4082cc9f723fb87beb4c7f04d6bf1b09da858ec5919e29e6d322771994589080f68dfd61f32dfa699bf852db0d4 WHIRLPOOL 8d22df2a0c065d0b959a1cb4f5d3242ac51a28f9c4d86e07b3b27a52d06c79b7c0efa0f2c32a8ac5e9d701a009b12a1a0a5d53c3f987e14819a79f004333a621
EBUILD xen-tools-4.7.3.ebuild 14050 SHA256 bc76a043677701c09d900c4661a6c0a280c542ee12511230f3e242a682208967 SHA512 9e7f809973bd7bd37a8761d22fed9704e94b1a9a41c346799d81066a64b0ee9ba02cb0e5687fccb7618088f548fe58644bee7f81b1a6d44e43c5755ae49bf154 WHIRLPOOL 10939d779ead31d040cdaf3d3d5894628405c2a6ef47e056ac5c5a19b3741cb35201a42da5c504fee45acf681bf040f30bd6e9599eb09101bf196bdd6d4f5daa
EBUILD xen-tools-4.8.2-r1.ebuild 14101 SHA256 5ec0ac7e080f65b1a251741450f6ab822e96fa58f23b60059fca638f4ed0b097 SHA512 f0ee35035973c31fb8ad151acf1dbd087817eb20a1391a3284d086f2b2aa1ca0b5d4c645aebf659f398a796311d4b7fea126b2b3c7881c64952b6ff165b50134 WHIRLPOOL 747cc55bde6436ce03b4ebf8a02e7902835dcc973291b580dd8e44b98f60ce6cd5c32a48aac23fb5891435b9bda9a7d46ffd1e6dd0dc8c2487f30a979b0df4f5
+EBUILD xen-tools-4.8.2-r2.ebuild 14129 SHA256 55436a876264fde1ea13af717dda2a7ee1ad60516659eeb0f508ce39130f32b3 SHA512 d8462922f0707c7059fe7b7b9910b087e3ea06f276203a3512970ad65e2b76a6bfac8d822463416ac49a29a52b43376eafcb9466ad11b22268be9f60162b2d37 WHIRLPOOL 6a91e9d3d5178af5b96491e46c357a7e63488e9268aed5fcc66089438143737d735b48d107ec762c985ce56e707696c49a4fb4241a542efc7bb5168ae7c5fcf5
EBUILD xen-tools-4.8.2.ebuild 13727 SHA256 0d4650499b9177eeb87a5b023a51dd497167c10ef6a3de74365256d597365e03 SHA512 b01cdfe60007b8310d34f1c9be7ea268831f4b333219b2c0fbbd7ea501bdf6ca5ba84cae202e8a25aa1da9137f889d08bf49e3820ea9f923e3c5035e8ecb97aa WHIRLPOOL 36dfcacd7eb9876e64961de292f638c142a1678fa9d0d2d580f7f51eef33a612cbf1ad3f92b56f2dc563b21d4b0d044a325b2364bd4dc286de4a615f5e90c49d
MISC ChangeLog 22964 SHA256 15c6bdb3723570f38291c42047455516934b7d0e29969a0b7ac0176309d09509 SHA512 29a5c27e3fc0dba37b6b54a7834e39e34d3056d999b0a0ac0278607d7ac7adf7a924b054b941390c06643fabf873d559d627c0a026f1c6352c0732289ebf6707 WHIRLPOOL 2ecd5711ccdb9823c04cc4ed68392f8d1743c7070f34dbfe9bb0c264651bdf51d65210b4879e303ac550caf1fbd9ec6c2913feaaf5cfb96dd14b40e04af02a05
MISC ChangeLog-2015 70841 SHA256 e2535b416e2777d7e80d7d96a388c50ab42fb18cd2dd242feb09e339726574ef SHA512 ea9f464a5cf37ce8e7872934f46794a23dec950d6de7d81610e3410356b9a9916dab7d6a7a114819ebe678517e60f53b3debb692383274c74e04adbb59368069 WHIRLPOOL fc0e6610406053b81d3d4258ca0f3117c552f3ab8a33ee282ba31aa69f8b07d196374c74b4f97a8f60422d53dae27fbd02e4cfea1940bc14b7b5ec995d825b07
diff --git a/app-emulation/xen-tools/files/xen-watchdog.initd b/app-emulation/xen-tools/files/xen-watchdog.initd
new file mode 100644
index 000000000000..6fbc54dfb2fa
--- /dev/null
+++ b/app-emulation/xen-tools/files/xen-watchdog.initd
@@ -0,0 +1,6 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/sbin/xenwatchdogd"
+command_args="30 15"
diff --git a/app-emulation/xen-tools/files/xenstored.initd-r1 b/app-emulation/xen-tools/files/xenstored.initd-r1
index 262535d68093..88d3ad7ba890 100644
--- a/app-emulation/xen-tools/files/xenstored.initd-r1
+++ b/app-emulation/xen-tools/files/xenstored.initd-r1
@@ -24,7 +24,7 @@ start() {
$XENSTORED_OPTS
until xenstore-exists / || $((15 < ++i))
do
- echo -n .
+ printf "."
sleep 1
done
einfo "Setting domain0 name record"
diff --git a/app-emulation/xen-tools/xen-tools-4.8.2-r2.ebuild b/app-emulation/xen-tools/xen-tools-4.8.2-r2.ebuild
new file mode 100644
index 000000000000..3de1759592f9
--- /dev/null
+++ b/app-emulation/xen-tools/xen-tools-4.8.2-r2.ebuild
@@ -0,0 +1,466 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='ncurses,xml,threads'
+
+inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs versionator
+
+MY_PV=${PV/_/-}
+MAJOR_V="$(get_version_component_range 1-2)"
+
+if [[ $PV == *9999 ]]; then
+ inherit git-r3
+ KEYWORDS=""
+ REPO="xen.git"
+ EGIT_REPO_URI="git://xenbits.xen.org/${REPO}"
+ S="${WORKDIR}/${REPO}"
+else
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+ UPSTREAM_VER=1
+ SECURITY_VER=
+ # xen-tools's gentoo patches tarball
+ GENTOO_VER=10
+ # xen-tools's gentoo patches version which apply to this specific ebuild
+ GENTOO_GPV=0
+ # xen-tools ovmf's patches
+ OVMF_VER=2
+
+ SEABIOS_VER=1.10.0
+ # OVMF upstream 52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d
+ OVMF_PV=20151110
+
+ [[ -n ${UPSTREAM_VER} ]] && \
+ UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
+ [[ -n ${SECURITY_VER} ]] && \
+ SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz"
+ [[ -n ${GENTOO_VER} ]] && \
+ GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz"
+ [[ -n ${OVMF_VER} ]] && \
+ OVMF_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz"
+
+ SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/xen-${MY_PV}.tar.gz
+ http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
+ https://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
+ ovmf? ( https://dev.gentoo.org/~dlan/distfiles/ovmf-${OVMF_PV}.tar.bz2
+ ${OVMF_PATCHSET_URI} )
+ ${UPSTREAM_PATCHSET_URI}
+ ${SECURITY_PATCHSET_URI}
+ ${GENTOO_PATCHSET_URI}"
+
+ S="${WORKDIR}/xen-${MY_PV}"
+fi
+
+DESCRIPTION="Xen tools including QEMU and xl"
+HOMEPAGE="https://www.xenproject.org"
+DOCS=( README docs/README.xen-bugtool )
+
+LICENSE="GPL-2"
+SLOT="0/${MAJOR_V}"
+# Inclusion of IUSE ocaml on stabalizing requires maintainer of ocaml to (get off his hands and) make
+# >=dev-lang/ocaml-4 stable
+# Masked in profiles/eapi-5-files instead
+IUSE="api custom-cflags debug doc flask hvm ocaml ovmf +pam pygrub python +qemu +qemu-traditional screen sdl static-libs system-qemu system-seabios"
+
+REQUIRED_USE="
+ ${PYTHON_REQUIRED_USE}
+ pygrub? ( python )
+ ovmf? ( hvm )
+ ^^ ( qemu system-qemu )"
+
+COMMON_DEPEND="
+ sys-apps/pciutils
+ dev-libs/lzo:2
+ dev-libs/glib:2
+ dev-libs/yajl
+ dev-libs/libaio
+ dev-libs/libgcrypt:0
+ sys-libs/zlib
+ ${PYTHON_DEPS}
+"
+
+DEPEND="${COMMON_DEPEND}
+ dev-python/lxml[${PYTHON_USEDEP}]
+ x86? ( sys-devel/dev86
+ sys-power/iasl )
+ pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
+ api? ( dev-libs/libxml2
+ net-misc/curl )
+ ovmf? (
+ !arm? ( !arm64? ( dev-lang/nasm ) )
+ $(python_gen_impl_dep sqlite)
+ )
+ !amd64? ( >=sys-apps/dtc-1.4.0 )
+ amd64? ( sys-devel/bin86
+ system-seabios? ( sys-firmware/seabios )
+ sys-firmware/ipxe
+ sys-devel/dev86
+ sys-power/iasl )
+ dev-lang/perl
+ app-misc/pax-utils
+ doc? (
+ app-text/pandoc
+ dev-python/markdown[${PYTHON_USEDEP}]
+ dev-texlive/texlive-latexextra
+ media-gfx/transfig
+ )
+ hvm? ( x11-proto/xproto
+ !net-libs/libiscsi )
+ qemu? (
+ app-arch/snappy:=
+ x11-libs/pixman
+ sdl? ( media-libs/libsdl[X] )
+ )
+ system-qemu? ( app-emulation/qemu[xen] )
+ ocaml? ( dev-ml/findlib
+ >=dev-lang/ocaml-4 )"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/iproute2[-minimal]
+ net-misc/bridge-utils
+ screen? (
+ app-misc/screen
+ app-admin/logrotate
+ )"
+
+# hvmloader is used to bootstrap a fully virtualized kernel
+# Approved by QA team in bug #144032
+QA_WX_LOAD="
+ usr/libexec/xen/boot/hvmloader
+ usr/share/qemu-xen/qemu/s390-ccw.img
+ usr/share/qemu-xen/qemu/u-boot.e500
+"
+
+QA_PREBUILT="
+ usr/libexec/xen/bin/ivshmem-client
+ usr/libexec/xen/bin/ivshmem-server
+ usr/libexec/xen/bin/qemu-img
+ usr/libexec/xen/bin/qemu-io
+ usr/libexec/xen/bin/qemu-nbd
+ usr/libexec/xen/bin/qemu-system-i386
+ usr/libexec/xen/bin/virtfs-proxy-helper
+ usr/libexec/xen/libexec/xen-bridge-helper
+ usr/share/qemu-xen/qemu/s390-ccw.img
+ usr/share/qemu-xen/qemu/u-boot.e500
+"
+
+RESTRICT="test"
+
+pkg_setup() {
+ python_setup
+ export "CONFIG_LOMOUNT=y"
+
+ #bug 522642, disable compile tools/tests
+ export "CONFIG_TESTS=n"
+
+ if [[ -z ${XEN_TARGET_ARCH} ]] ; then
+ if use x86 && use amd64; then
+ die "Confusion! Both x86 and amd64 are set in your use flags!"
+ elif use x86; then
+ export XEN_TARGET_ARCH="x86_32"
+ elif use amd64 ; then
+ export XEN_TARGET_ARCH="x86_64"
+ elif use arm; then
+ export XEN_TARGET_ARCH="arm32"
+ elif use arm64; then
+ export XEN_TARGET_ARCH="arm64"
+ else
+ die "Unsupported architecture!"
+ fi
+ fi
+}
+
+src_prepare() {
+ local i
+
+ # Upstream's patchset
+ if [[ -n ${UPSTREAM_VER} ]]; then
+ einfo "Try to apply Xen Upstream patch set"
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-p1" \
+ epatch "${WORKDIR}"/patches-upstream
+ fi
+
+ # Security patchset
+ if [[ -n ${SECURITY_VER} ]]; then
+ einfo "Try to apply Xen Security patch set"
+ # apply main xen patches
+ # Two parallel systems, both work side by side
+ # Over time they may concdense into one. This will suffice for now
+ EPATCH_SUFFIX="patch"
+ EPATCH_FORCE="yes"
+
+ source "${WORKDIR}"/patches-security/${PV}.conf || die
+
+ for i in ${XEN_SECURITY_MAIN}; do
+ epatch "${WORKDIR}"/patches-security/xen/$i
+ done
+
+ # apply qemu-xen/upstream patches
+ pushd "${S}"/tools/qemu-xen/ > /dev/null
+ for i in ${XEN_SECURITY_QEMUU}; do
+ epatch "${WORKDIR}"/patches-security/qemuu/$i
+ done
+ popd > /dev/null
+
+ # apply qemu-traditional patches
+ pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
+ for i in ${XEN_SECURITY_QEMUT}; do
+ epatch "${WORKDIR}"/patches-security/qemut/$i
+ done
+ popd > /dev/null
+ fi
+
+ # move before Gentoo patch, one patch should apply to seabios, to fix gcc-4.5.x build err
+ mv ../seabios-${SEABIOS_VER} tools/firmware/seabios-dir-remote || die
+ pushd tools/firmware/ > /dev/null
+ ln -s seabios-dir-remote seabios-dir || die
+ popd > /dev/null
+
+ # Gentoo's patchset
+ if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
+ einfo "Try to apply Gentoo specific patch set"
+ source "${FILESDIR}"/gentoo-patches.conf || die
+ _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
+ for i in ${!_gpv}; do
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-gentoo/$i
+ done
+ fi
+
+ # Ovmf's patchset
+ if use ovmf; then
+ if [[ -n ${OVMF_VER} ]];then
+ einfo "Try to apply Ovmf patch set"
+ pushd "${WORKDIR}"/ovmf-*/ > /dev/null
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-p1" \
+ epatch "${WORKDIR}"/patches-ovmf
+ popd > /dev/null
+ fi
+ mv ../ovmf-${OVMF_PV} tools/firmware/ovmf-dir-remote || die
+ fi
+
+ mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
+
+ # Fix building with gcc 7, Bug #634338
+ # https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=f49fa658b53580cf2ad354d2bf1796766cc11222
+ sed -e 's/name\[60\]/name\[100\]/g' \
+ -i tools/misc/xenlockprof.c || die
+
+ # Fix texi2html build error with new texi2html, qemu.doc.html
+ sed -i -e "/texi2html -monolithic/s/-number//" tools/qemu-xen-traditional/Makefile || die
+
+ use api || sed -e "/SUBDIRS-\$(LIBXENAPI_BINDINGS) += libxen/d" -i tools/Makefile || die
+ sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' \
+ -i tools/firmware/Makefile || die
+
+ # Drop .config, fixes to gcc-4.6
+ sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
+
+ # if the user *really* wants to use their own custom-cflags, let them
+ if use custom-cflags; then
+ einfo "User wants their own CFLAGS - removing defaults"
+
+ # try and remove all the default cflags
+ find "${S}" \( -name Makefile -o -name Rules.mk -o -name Config.mk \) \
+ -exec sed \
+ -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
+ -i {} + || die "failed to re-set custom-cflags"
+ else
+ unset CFLAGS
+ unset LDFLAGS
+ unset ASFLAGS
+ unset CPPFLAGS
+ fi
+
+ if ! use pygrub; then
+ sed -e '/^SUBDIRS-y += pygrub/d' -i tools/Makefile || die
+ fi
+
+ if ! use python; then
+ sed -e '/^SUBDIRS-y += python$/d' -i tools/Makefile || die
+ fi
+
+ if ! use hvm; then
+ sed -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' -i tools/Makefile || die
+ # Bug 351648
+ elif ! use x86 && ! has x86 $(get_all_abis); then
+ mkdir -p "${WORKDIR}"/extra-headers/gnu || die
+ touch "${WORKDIR}"/extra-headers/gnu/stubs-32.h || die
+ export CPATH="${WORKDIR}"/extra-headers
+ fi
+
+ if use qemu; then
+ if use sdl; then
+ sed -i -e "s:\$\$source/configure:\0 --enable-sdl:" \
+ tools/Makefile || die
+ else
+ sed -i -e "s:\${QEMU_ROOT\:\-\.}/configure:\0 --disable-sdl:" \
+ tools/qemu-xen-traditional/xen-setup || die
+ sed -i -e "s:\$\$source/configure:\0 --disable-sdl:" \
+ tools/Makefile || die
+ fi
+ else
+ # Don't bother with qemu, only needed for fully virtualised guests
+ sed -e "s:install-tools\: tools/qemu-xen-traditional-dir:install-tools\: :g" -i Makefile || die
+ fi
+
+ # Reset bash completion dir; Bug 472438
+ sed -e "s:^BASH_COMPLETION_DIR ?= \$(CONFIG_DIR)/bash_completion.d:BASH_COMPLETION_DIR ?= $(get_bashcompdir):" \
+ -i Config.mk || die
+ sed -i -e "/bash-completion/s/xl\.sh/xl/g" tools/libxl/Makefile || die
+
+ # xencommons, Bug #492332, sed lighter weight than patching
+ sed -e 's:\$QEMU_XEN -xen-domid:test -e "\$QEMU_XEN" \&\& &:' \
+ -i tools/hotplug/Linux/init.d/xencommons.in || die
+
+ # fix bashishm
+ sed -e '/Usage/s/\$//g' \
+ -i tools/hotplug/Linux/init.d/xendriverdomain.in || die
+
+ # respect multilib, usr/lib/libcacard.so.0.0.0
+ sed -e "/^libdir=/s/\/lib/\/$(get_libdir)/" \
+ -i tools/qemu-xen/configure || die
+
+ #bug 518136, don't build 32bit exactuable for nomultilib profile
+ if [[ "${ARCH}" == 'amd64' ]] && ! has_multilib_profile; then
+ sed -i -e "/x86_emulator/d" tools/tests/Makefile || die
+ fi
+
+ # uncomment lines in xl.conf
+ sed -e 's:^#autoballoon=:autoballoon=:' \
+ -e 's:^#lockfile=:lockfile=:' \
+ -e 's:^#vif.default.script=:vif.default.script=:' \
+ -i tools/examples/xl.conf || die
+
+ default
+}
+
+src_configure() {
+ local myconf="--prefix=${PREFIX}/usr \
+ --libdir=${PREFIX}/usr/$(get_libdir) \
+ --libexecdir=${PREFIX}/usr/libexec \
+ --localstatedir=${EPREFIX}/var \
+ --disable-werror \
+ --disable-xen \
+ --enable-tools \
+ --enable-docs \
+ $(use_enable pam) \
+ $(use_enable api xenapi) \
+ $(use_enable ovmf) \
+ $(use_enable ocaml ocamltools) \
+ --with-xenstored=$(usex ocaml 'oxenstored' 'xenstored') \
+ "
+
+ use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
+ use system-qemu && myconf+=" --with-system-qemu=/usr/bin/qemu-system-x86_64"
+ use amd64 && myconf+=" $(use_enable qemu-traditional)"
+ econf ${myconf}
+}
+
+src_compile() {
+ export VARTEXFONTS="${T}/fonts"
+ local myopt
+ use debug && myopt="${myopt} debug=y"
+
+ if test-flag-CC -fno-strict-overflow; then
+ append-flags -fno-strict-overflow
+ fi
+
+ emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
+
+ if use doc; then
+ emake -C docs build
+ else
+ emake -C docs man-pages
+ fi
+}
+
+src_install() {
+ # Override auto-detection in the build system, bug #382573
+ export INITD_DIR=/tmp/init.d
+ export CONFIG_LEAF_DIR=../tmp/default
+
+ # Let the build system compile installed Python modules.
+ local PYTHONDONTWRITEBYTECODE
+ export PYTHONDONTWRITEBYTECODE
+
+ emake DESTDIR="${ED}" DOCDIR="/usr/share/doc/${PF}" \
+ XEN_PYTHON_NATIVE_INSTALL=y install-tools
+
+ # Created at runtime
+ rm -rv "${ED%/}/var/run" || die
+
+ # Fix the remaining Python shebangs.
+ python_fix_shebang "${D}"
+
+ # Remove RedHat-specific stuff
+ rm -rf "${D}"tmp || die
+
+ emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
+ use doc && dodoc -r docs/{pdf,txt}
+ dodoc ${DOCS[@]}
+
+ newconfd "${FILESDIR}"/xendomains.confd xendomains
+ newconfd "${FILESDIR}"/xenstored.confd xenstored
+ newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
+ newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
+ newinitd "${FILESDIR}"/xenstored.initd-r1 xenstored
+ newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
+ newinitd "${FILESDIR}"/xencommons.initd xencommons
+ newconfd "${FILESDIR}"/xencommons.confd xencommons
+ newinitd "${FILESDIR}"/xenqemudev.initd xenqemudev
+ newconfd "${FILESDIR}"/xenqemudev.confd xenqemudev
+ newinitd "${FILESDIR}"/xen-watchdog.initd xen-watchdog
+
+ if use screen; then
+ cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains || die
+ cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/ || die
+ keepdir /var/log/xen-consoles
+ fi
+
+ # For -static-libs wrt Bug 384355
+ if ! use static-libs; then
+ rm -f "${D}"usr/$(get_libdir)/*.a "${D}"usr/$(get_libdir)/ocaml/*/*.a
+ fi
+
+ # for xendomains
+ keepdir /etc/xen/auto
+
+ # Remove files failing QA AFTER emake installs them, avoiding seeking absent files
+ find "${D}" \( -name openbios-sparc32 -o -name openbios-sparc64 \
+ -o -name openbios-ppc -o -name palcode-clipper \) -delete || die
+}
+
+pkg_postinst() {
+ elog "Official Xen Guide and the offical wiki page:"
+ elog "https://wiki.gentoo.org/wiki/Xen"
+ elog "https://wiki.xen.org/wiki/Main_Page"
+ elog ""
+ elog "Recommended to utilise the xencommons script to config sytem At boot"
+ elog "Add by use of rc-update on completion of the install"
+
+ if ! use hvm; then
+ echo
+ elog "HVM (VT-x and AMD-V) support has been disabled. If you need hvm"
+ elog "support enable the hvm use flag."
+ elog "An x86 or amd64 system is required to build HVM support."
+ fi
+
+ if use qemu; then
+ elog "The qemu-bridge-helper is renamed to the xen-bridge-helper in the in source"
+ elog "build of qemu. This allows for app-emulation/qemu to be emerged concurrently"
+ elog "with the qemu capable xen. It is up to the user to distinguish between and utilise"
+ elog "the qemu-bridge-helper and the xen-bridge-helper. File bugs of any issues that arise"
+ fi
+}