summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-emulation
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/aqemu/Manifest1
-rw-r--r--app-emulation/aqemu/aqemu-0.8.2-r2.ebuild39
-rw-r--r--app-emulation/aqemu/files/aqemu-0.8.2_desktop_file.patch33
-rw-r--r--app-emulation/aqemu/files/aqemu-0.8.2_qt48_build.patch27
-rw-r--r--app-emulation/aqemu/files/aqemu-0.8.2_sigsev_propertis.patch41
-rw-r--r--app-emulation/aqemu/metadata.xml16
-rw-r--r--app-emulation/aranym/Manifest3
-rw-r--r--app-emulation/aranym/aranym-0.9.14.ebuild59
-rw-r--r--app-emulation/aranym/aranym-0.9.16.ebuild59
-rw-r--r--app-emulation/aranym/metadata.xml24
-rw-r--r--app-emulation/armv8-fast-model/Manifest1
-rw-r--r--app-emulation/armv8-fast-model/armv8-fast-model-0.8.5206.ebuild48
-rw-r--r--app-emulation/armv8-fast-model/metadata.xml5
-rw-r--r--app-emulation/bochs/Manifest1
-rw-r--r--app-emulation/bochs/bochs-2.6.ebuild87
-rw-r--r--app-emulation/bochs/metadata.xml18
-rw-r--r--app-emulation/cloud-init/Manifest2
-rw-r--r--app-emulation/cloud-init/cloud-init-0.7.5-r1.ebuild52
-rw-r--r--app-emulation/cloud-init/cloud-init-0.7.5-r2.ebuild84
-rw-r--r--app-emulation/cloud-init/cloud-init-0.7.5-r3.ebuild88
-rw-r--r--app-emulation/cloud-init/cloud-init-0.7.6-r1.ebuild105
-rw-r--r--app-emulation/cloud-init/cloud-init-0.7.6.ebuild98
-rw-r--r--app-emulation/cloud-init/files/cloud-init-0.7.5-tests-exclude.patch12
-rw-r--r--app-emulation/cloud-init/files/cloud.cfg79
-rwxr-xr-xapp-emulation/cloud-init/files/growpart778
-rw-r--r--app-emulation/cloud-init/files/hosts.gentoo.tmpl23
-rw-r--r--app-emulation/cloud-init/metadata.xml19
-rw-r--r--app-emulation/coldfire/Manifest1
-rw-r--r--app-emulation/coldfire/coldfire-0.3.1.ebuild30
-rw-r--r--app-emulation/coldfire/files/coldfire-0.3.1-build.patch32
-rw-r--r--app-emulation/coldfire/files/coldfire-0.3.1-headers.patch16
-rw-r--r--app-emulation/coldfire/metadata.xml5
-rw-r--r--app-emulation/crossover-bin/Manifest10
-rw-r--r--app-emulation/crossover-bin/crossover-bin-12.5.0-r2.ebuild128
-rw-r--r--app-emulation/crossover-bin/crossover-bin-12.5.1-r2.ebuild128
-rw-r--r--app-emulation/crossover-bin/crossover-bin-13.0.0-r2.ebuild128
-rw-r--r--app-emulation/crossover-bin/crossover-bin-13.0.1-r2.ebuild128
-rw-r--r--app-emulation/crossover-bin/crossover-bin-13.1.0-r2.ebuild128
-rw-r--r--app-emulation/crossover-bin/crossover-bin-13.1.2-r2.ebuild128
-rw-r--r--app-emulation/crossover-bin/crossover-bin-13.1.3-r2.ebuild128
-rw-r--r--app-emulation/crossover-bin/crossover-bin-13.2.0-r2.ebuild128
-rw-r--r--app-emulation/crossover-bin/crossover-bin-14.0.3-r1.ebuild132
-rw-r--r--app-emulation/crossover-bin/crossover-bin-14.1.4-r1.ebuild132
-rw-r--r--app-emulation/crossover-bin/metadata.xml11
-rw-r--r--app-emulation/crossover-office-bin/Manifest4
-rw-r--r--app-emulation/crossover-office-bin/crossover-office-bin-6.0.0.ebuild52
-rw-r--r--app-emulation/crossover-office-bin/crossover-office-bin-6.0.1.ebuild52
-rw-r--r--app-emulation/crossover-office-bin/crossover-office-bin-6.1.0.ebuild52
-rw-r--r--app-emulation/crossover-office-bin/crossover-office-bin-6.2.0.ebuild52
-rw-r--r--app-emulation/crossover-office-bin/metadata.xml5
-rw-r--r--app-emulation/crossover-office-pro-bin/Manifest13
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.0.ebuild52
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.1.ebuild51
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.3.ebuild51
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.0.0.ebuild51
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.1.0.ebuild53
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.2.0.ebuild53
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-7.0.2.ebuild53
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-7.1.0.ebuild53
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-8.0.0.ebuild53
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.0.0.ebuild53
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.0.1.ebuild53
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.1.0.ebuild55
-rw-r--r--app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.2.0.ebuild55
-rw-r--r--app-emulation/crossover-office-pro-bin/metadata.xml5
-rw-r--r--app-emulation/dinero/Manifest1
-rw-r--r--app-emulation/dinero/dinero-4.7-r1.ebuild30
-rw-r--r--app-emulation/dinero/metadata.xml7
-rw-r--r--app-emulation/dlx/Manifest1
-rw-r--r--app-emulation/dlx/dlx-1.0.0-r1.ebuild34
-rw-r--r--app-emulation/dlx/dlx-1.0.0.ebuild23
-rw-r--r--app-emulation/dlx/metadata.xml8
-rw-r--r--app-emulation/docker-compose/Manifest1
-rw-r--r--app-emulation/docker-compose/docker-compose-1.2.0-r1.ebuild62
-rw-r--r--app-emulation/docker-compose/files/requests-requirements.patch13
-rw-r--r--app-emulation/docker-compose/metadata.xml13
-rw-r--r--app-emulation/docker/Manifest3
-rw-r--r--app-emulation/docker/docker-1.6.1.ebuild246
-rw-r--r--app-emulation/docker/docker-1.6.2.ebuild246
-rw-r--r--app-emulation/docker/docker-1.7.1.ebuild268
-rw-r--r--app-emulation/docker/files/7179-add-audit_write-cap.patch29
-rw-r--r--app-emulation/docker/files/docker-r2.confd18
-rwxr-xr-xapp-emulation/docker/files/docker-r2.initd54
-rw-r--r--app-emulation/docker/files/docker-r3.confd13
-rwxr-xr-xapp-emulation/docker/files/docker-r3.initd31
-rwxr-xr-xapp-emulation/docker/files/docker.initd31
-rw-r--r--app-emulation/docker/files/docker.service12
-rw-r--r--app-emulation/docker/metadata.xml58
-rw-r--r--app-emulation/domi/Manifest1
-rw-r--r--app-emulation/domi/domi-20060816.ebuild38
-rw-r--r--app-emulation/domi/files/domi.conf95
-rw-r--r--app-emulation/domi/files/fix_install_links.patch15
-rw-r--r--app-emulation/domi/metadata.xml8
-rw-r--r--app-emulation/dosemu/Manifest3
-rw-r--r--app-emulation/dosemu/dosemu-1.4.1_pre20091009.ebuild61
-rw-r--r--app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild81
-rw-r--r--app-emulation/dosemu/files/dosemu-1.3.4-shm.diff11
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.0.1-gcc433.diff11
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20091009-flex.patch45
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch48
-rw-r--r--app-emulation/dosemu/metadata.xml17
-rw-r--r--app-emulation/dynamips/Manifest2
-rw-r--r--app-emulation/dynamips/dynamips-0.2.12.ebuild48
-rw-r--r--app-emulation/dynamips/dynamips-0.2.14-r1.ebuild42
-rw-r--r--app-emulation/dynamips/files/0.2.14-docs.patch20
-rw-r--r--app-emulation/dynamips/files/dynamips-0.2.12-makefile.patch11
-rw-r--r--app-emulation/dynamips/metadata.xml15
-rw-r--r--app-emulation/e-uae/Manifest1
-rw-r--r--app-emulation/e-uae/e-uae-0.8.29_rc4-r2.ebuild140
-rw-r--r--app-emulation/e-uae/files/e-uae-0.8.29_rc4-high-cpu-usage.patch18
-rw-r--r--app-emulation/e-uae/metadata.xml16
-rw-r--r--app-emulation/edumips64/Manifest2
-rw-r--r--app-emulation/edumips64/edumips64-1.1.ebuild47
-rw-r--r--app-emulation/edumips64/edumips64-1.2.ebuild48
-rw-r--r--app-emulation/edumips64/files/edumips64-1.2-javadoc-cp.patch11
-rw-r--r--app-emulation/edumips64/files/edumips64-javadoc-cp.patch11
-rw-r--r--app-emulation/edumips64/metadata.xml12
-rw-r--r--app-emulation/free42/Manifest1
-rw-r--r--app-emulation/free42/files/free42-1.5.5-fix-makefile.patch30
-rw-r--r--app-emulation/free42/free42-1.5.5.ebuild46
-rw-r--r--app-emulation/free42/metadata.xml19
-rw-r--r--app-emulation/fuse-utils/Manifest1
-rw-r--r--app-emulation/fuse-utils/fuse-utils-1.1.1.ebuild38
-rw-r--r--app-emulation/fuse-utils/metadata.xml22
-rw-r--r--app-emulation/fuse/Manifest2
-rw-r--r--app-emulation/fuse/files/fuse-1.0.0-libpng15.patch10
-rw-r--r--app-emulation/fuse/files/fuse-1.1.1-gold-link-lm.patch10
-rw-r--r--app-emulation/fuse/fuse-1.0.0.ebuild94
-rw-r--r--app-emulation/fuse/fuse-1.1.1.ebuild96
-rw-r--r--app-emulation/fuse/metadata.xml18
-rw-r--r--app-emulation/ganeti-htools/Manifest3
-rw-r--r--app-emulation/ganeti-htools/files/ganeti-htools-0.2.8-use-QC-1.patch14
-rw-r--r--app-emulation/ganeti-htools/files/ganeti-htools-0.3.1-base-4.patch171
-rw-r--r--app-emulation/ganeti-htools/ganeti-htools-0.2.8.ebuild45
-rw-r--r--app-emulation/ganeti-htools/ganeti-htools-0.3.0.ebuild48
-rw-r--r--app-emulation/ganeti-htools/ganeti-htools-0.3.1.ebuild49
-rw-r--r--app-emulation/ganeti-htools/metadata.xml22
-rw-r--r--app-emulation/ganeti-instance-debian-etch/Manifest1
-rw-r--r--app-emulation/ganeti-instance-debian-etch/ganeti-instance-debian-etch-0.4.ebuild30
-rw-r--r--app-emulation/ganeti-instance-debian-etch/metadata.xml10
-rw-r--r--app-emulation/ganeti-instance-debootstrap/Manifest3
-rw-r--r--app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.11.ebuild35
-rw-r--r--app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.12.ebuild35
-rw-r--r--app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.9.ebuild35
-rw-r--r--app-emulation/ganeti-instance-debootstrap/metadata.xml12
-rw-r--r--app-emulation/ganeti-instance-image/Manifest1
-rw-r--r--app-emulation/ganeti-instance-image/ganeti-instance-image-0.6.ebuild51
-rw-r--r--app-emulation/ganeti-instance-image/metadata.xml10
-rw-r--r--app-emulation/ganeti/Manifest7
-rw-r--r--app-emulation/ganeti/files/ganeti-2.1.initd112
-rw-r--r--app-emulation/ganeti/files/ganeti-2.10-rundir.patch35
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-add-pgrep.patch25
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-daemon-util-tests.patch38
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-daemon-util.patch38
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-dont-nest-libdir.patch49
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-dont-print-man-help.patch13
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-qemu-enable-kvm.patch12
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-regex-builtin.patch15
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-start-stop-daemon-args.patch39
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-tests.patch13
-rw-r--r--app-emulation/ganeti/files/ganeti-2.11-useradd.patch17
-rw-r--r--app-emulation/ganeti/files/ganeti-2.12-cfgupgrade-state.patch15
-rw-r--r--app-emulation/ganeti/files/ganeti-2.12-daemon-util.patch37
-rw-r--r--app-emulation/ganeti/files/ganeti-2.12-qemu-enable-kvm.patch12
-rw-r--r--app-emulation/ganeti/files/ganeti-2.12-start-stop-daemon-args.patch39
-rw-r--r--app-emulation/ganeti/files/ganeti-2.12-tests.patch59
-rw-r--r--app-emulation/ganeti/files/ganeti-2.12.3-daemon-util.patch37
-rw-r--r--app-emulation/ganeti/files/ganeti-2.13-daemon-util.patch46
-rw-r--r--app-emulation/ganeti/files/ganeti-2.13-disable-usersgroups-test.patch68
-rw-r--r--app-emulation/ganeti/files/ganeti-2.13-process_unittest.patch21
-rw-r--r--app-emulation/ganeti/files/ganeti-2.13-regex-pcre-builtin.patch13
-rw-r--r--app-emulation/ganeti/files/ganeti-2.2.initd113
-rw-r--r--app-emulation/ganeti/files/ganeti-2.6-add-pgrep.patch38
-rw-r--r--app-emulation/ganeti/files/ganeti-2.6-fix-args.patch45
-rw-r--r--app-emulation/ganeti/files/ganeti-2.7-fix-tests.patch30
-rw-r--r--app-emulation/ganeti/files/ganeti-2.9-disable-root-tests.patch18
-rw-r--r--app-emulation/ganeti/files/ganeti-2.9-regex-builtin.patch22
-rw-r--r--app-emulation/ganeti/files/ganeti-2.9-skip-cli-test.patch18
-rw-r--r--app-emulation/ganeti/files/ganeti-fix-start-stop.patch47
-rw-r--r--app-emulation/ganeti/files/ganeti-kvm-poweroff.confd4
-rw-r--r--app-emulation/ganeti/files/ganeti-kvm-poweroff.initd58
-rw-r--r--app-emulation/ganeti/files/ganeti-lockdir.patch15
-rw-r--r--app-emulation/ganeti/files/ganeti.confd16
-rw-r--r--app-emulation/ganeti/files/ganeti.confd-r219
-rw-r--r--app-emulation/ganeti/files/ganeti.initd57
-rw-r--r--app-emulation/ganeti/files/ganeti.initd-r383
-rw-r--r--app-emulation/ganeti/files/ganeti2.initd55
-rw-r--r--app-emulation/ganeti/ganeti-2.10.5-r4.ebuild174
-rw-r--r--app-emulation/ganeti/ganeti-2.11.6-r2.ebuild220
-rw-r--r--app-emulation/ganeti/ganeti-2.12.1-r3.ebuild253
-rw-r--r--app-emulation/ganeti/ganeti-2.12.3-r2.ebuild262
-rw-r--r--app-emulation/ganeti/ganeti-2.13.0-r2.ebuild258
-rw-r--r--app-emulation/ganeti/ganeti-2.14.1-r1.ebuild295
-rw-r--r--app-emulation/ganeti/ganeti-2.4.5-r1.ebuild90
-rw-r--r--app-emulation/ganeti/metadata.xml36
-rw-r--r--app-emulation/gxemul/Manifest1
-rw-r--r--app-emulation/gxemul/files/0.6.0-fix-mkstemp-test.patch10
-rw-r--r--app-emulation/gxemul/files/0.6.0-fix-mymkstemp.patch11
-rw-r--r--app-emulation/gxemul/files/0.6.0-gcc46.patch16
-rw-r--r--app-emulation/gxemul/gxemul-0.6.0-r1.ebuild43
-rw-r--r--app-emulation/gxemul/metadata.xml11
-rw-r--r--app-emulation/hercules/Manifest4
-rw-r--r--app-emulation/hercules/files/hercules-3.06-build.patch18
-rw-r--r--app-emulation/hercules/files/hercules-3.06-gcc44.patch12
-rw-r--r--app-emulation/hercules/files/hercules-3.09-aliasing.patch41
-rw-r--r--app-emulation/hercules/hercules-3.06.ebuild45
-rw-r--r--app-emulation/hercules/hercules-3.08.ebuild39
-rw-r--r--app-emulation/hercules/hercules-3.09.ebuild43
-rw-r--r--app-emulation/hercules/hercules-3.10.ebuild43
-rw-r--r--app-emulation/hercules/metadata.xml11
-rw-r--r--app-emulation/kvm-kmod/Manifest5
-rw-r--r--app-emulation/kvm-kmod/kvm-kmod-3.10.1.ebuild68
-rw-r--r--app-emulation/kvm-kmod/kvm-kmod-3.3.6.ebuild68
-rw-r--r--app-emulation/kvm-kmod/kvm-kmod-3.4.ebuild68
-rw-r--r--app-emulation/kvm-kmod/kvm-kmod-3.6.ebuild68
-rw-r--r--app-emulation/kvm-kmod/kvm-kmod-3.8.ebuild68
-rw-r--r--app-emulation/kvm-kmod/metadata.xml17
-rw-r--r--app-emulation/libcacard/Manifest1
-rw-r--r--app-emulation/libcacard/libcacard-0.1.2.ebuild30
-rw-r--r--app-emulation/libcacard/metadata.xml9
-rw-r--r--app-emulation/libguestfs-appliance/Manifest2
-rw-r--r--app-emulation/libguestfs-appliance/files/env.file1
-rw-r--r--app-emulation/libguestfs-appliance/libguestfs-appliance-1.26.0-r1.ebuild44
-rw-r--r--app-emulation/libguestfs-appliance/libguestfs-appliance-1.28.1-r1.ebuild45
-rw-r--r--app-emulation/libguestfs-appliance/libguestfs-appliance-1.28.1.ebuild44
-rw-r--r--app-emulation/libguestfs-appliance/metadata.xml18
-rw-r--r--app-emulation/libguestfs/Manifest3
-rw-r--r--app-emulation/libguestfs/files/1.24/0001_add_gentoo_names_to_configure.patch15
-rw-r--r--app-emulation/libguestfs/files/1.24/0002_add_gentooway_to_remove_la_files.patch16
-rw-r--r--app-emulation/libguestfs/files/1.24/0004_add_icoutils_configure_drop_automagic.patch57
-rw-r--r--app-emulation/libguestfs/files/1.24/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch21
-rw-r--r--app-emulation/libguestfs/files/1.24/0103_disable_php_bindings_makefile.patch13
-rw-r--r--app-emulation/libguestfs/files/1.26/0000_bug_499150.patch10
-rw-r--r--app-emulation/libguestfs/files/1.26/0001_add_gentoo_names_to_configure.patch15
-rw-r--r--app-emulation/libguestfs/files/1.26/0002_add_gentooway_to_remove_la_files.patch16
-rw-r--r--app-emulation/libguestfs/files/1.26/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch21
-rw-r--r--app-emulation/libguestfs/files/1.26/0020_all_qemu_configure.patch27
-rw-r--r--app-emulation/libguestfs/files/1.26/0103_disable_php_bindings_makefile.patch13
-rw-r--r--app-emulation/libguestfs/files/1.28/0000_bug_499150.patch10
-rw-r--r--app-emulation/libguestfs/files/1.28/0001_add_gentoo_names_to_configure.patch15
-rw-r--r--app-emulation/libguestfs/files/1.28/0002_add_gentooway_to_remove_la_files.patch16
-rw-r--r--app-emulation/libguestfs/files/1.28/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch21
-rw-r--r--app-emulation/libguestfs/files/1.28/0103_disable_php_bindings_makefile.patch13
-rw-r--r--app-emulation/libguestfs/files/env.file1
-rw-r--r--app-emulation/libguestfs/libguestfs-1.26.1.ebuild161
-rw-r--r--app-emulation/libguestfs/libguestfs-1.28.3.ebuild170
-rw-r--r--app-emulation/libguestfs/libguestfs-1.28.5-r1.ebuild176
-rw-r--r--app-emulation/libguestfs/libguestfs-1.28.5.ebuild170
-rw-r--r--app-emulation/libguestfs/metadata.xml28
-rw-r--r--app-emulation/libspectrum/Manifest2
-rw-r--r--app-emulation/libspectrum/libspectrum-1.0.0.ebuild42
-rw-r--r--app-emulation/libspectrum/libspectrum-1.1.1.ebuild42
-rw-r--r--app-emulation/libspectrum/metadata.xml28
-rw-r--r--app-emulation/libvirt-glib/Manifest2
-rw-r--r--app-emulation/libvirt-glib/libvirt-glib-0.2.0.ebuild54
-rw-r--r--app-emulation/libvirt-glib/libvirt-glib-0.2.1.ebuild53
-rw-r--r--app-emulation/libvirt-glib/metadata.xml10
-rw-r--r--app-emulation/libvirt-snmp/Manifest2
-rw-r--r--app-emulation/libvirt-snmp/files/0001-Fix-build-rules-to-use-LDADD-to-add-libraries.patch81
-rw-r--r--app-emulation/libvirt-snmp/files/libvirt-snmp.confd6
-rw-r--r--app-emulation/libvirt-snmp/files/libvirt-snmp.initd-r127
-rw-r--r--app-emulation/libvirt-snmp/libvirt-snmp-0.0.2-r2.ebuild43
-rw-r--r--app-emulation/libvirt-snmp/libvirt-snmp-0.0.3.ebuild39
-rw-r--r--app-emulation/libvirt-snmp/metadata.xml8
-rw-r--r--app-emulation/libvirt/Manifest3
-rw-r--r--app-emulation/libvirt/files/libvirt-1.2.16-fix_paths_in_libvirt-guests_sh.patch19
-rw-r--r--app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch161
-rw-r--r--app-emulation/libvirt/files/libvirt-1.2.9-do_not_use_sysconf.patch112
-rw-r--r--app-emulation/libvirt/files/libvirtd.confd-r443
-rw-r--r--app-emulation/libvirt/files/libvirtd.init-r14139
-rw-r--r--app-emulation/libvirt/files/libvirtd.service.conf10
-rw-r--r--app-emulation/libvirt/files/libvirtd.tmpfiles.conf1
-rw-r--r--app-emulation/libvirt/files/virtlockd.init-r124
-rw-r--r--app-emulation/libvirt/libvirt-1.2.15-r1.ebuild464
-rw-r--r--app-emulation/libvirt/libvirt-1.2.17-r4.ebuild480
-rw-r--r--app-emulation/libvirt/libvirt-1.2.18.ebuild480
-rw-r--r--app-emulation/libvirt/libvirt-9999.ebuild480
-rw-r--r--app-emulation/libvirt/metadata.xml98
-rw-r--r--app-emulation/lxc/Manifest5
-rw-r--r--app-emulation/lxc/files/lxc-1.0.6-bash-completion.patch39
-rw-r--r--app-emulation/lxc/files/lxc-1.1.0-fix-gentoo-template.patch35
-rw-r--r--app-emulation/lxc/files/lxc-1.1.1-shm-tmpfs.patch31
-rw-r--r--app-emulation/lxc/files/lxc-1.1.2-fix-gentoo-moresecure-template.patch33
-rw-r--r--app-emulation/lxc/files/lxc.initd.3139
-rw-r--r--app-emulation/lxc/files/lxc_at.service12
-rw-r--r--app-emulation/lxc/files/lxc_at.service.214
-rw-r--r--app-emulation/lxc/lxc-1.0.6-r1.ebuild186
-rw-r--r--app-emulation/lxc/lxc-1.0.7.ebuild187
-rw-r--r--app-emulation/lxc/lxc-1.1.0-r6.ebuild196
-rw-r--r--app-emulation/lxc/lxc-1.1.1-r1.ebuild197
-rw-r--r--app-emulation/lxc/lxc-1.1.2-r1.ebuild195
-rw-r--r--app-emulation/lxc/lxc-1.1.2-r2.ebuild195
-rw-r--r--app-emulation/lxc/lxc-1.1.2.ebuild194
-rw-r--r--app-emulation/lxc/metadata.xml20
-rw-r--r--app-emulation/lxd/Manifest1
-rw-r--r--app-emulation/lxd/files/lxd-0.13-nc-binary-name.patch11
-rw-r--r--app-emulation/lxd/files/lxd.confd26
-rw-r--r--app-emulation/lxd/files/lxd.initd35
-rw-r--r--app-emulation/lxd/files/lxd.service12
-rw-r--r--app-emulation/lxd/lxd-0.13.ebuild136
-rw-r--r--app-emulation/lxd/metadata.xml26
-rw-r--r--app-emulation/metadata.xml32
-rw-r--r--app-emulation/open-vm-tools-kmod/Manifest3
-rw-r--r--app-emulation/open-vm-tools-kmod/files/1098359-vmblock-3.10.0.patch24
-rw-r--r--app-emulation/open-vm-tools-kmod/files/60-vmware.rules1
-rw-r--r--app-emulation/open-vm-tools-kmod/files/9.10.0-0001-Fix-vmxnet-module-on-kernels-3.16.patch74
-rw-r--r--app-emulation/open-vm-tools-kmod/files/9.10.0-0002-Fix-d_alias-to-d_u.d_alias-for-kernel-3.18.patch34
-rw-r--r--app-emulation/open-vm-tools-kmod/files/9.10.0-0003-Fix-f_dentry-msghdr-kernel-3.19.patch429
-rw-r--r--app-emulation/open-vm-tools-kmod/files/frozen.patch28
-rw-r--r--app-emulation/open-vm-tools-kmod/files/putname.patch13
-rw-r--r--app-emulation/open-vm-tools-kmod/files/vmhgfs-linux-3.11.patch42
-rw-r--r--app-emulation/open-vm-tools-kmod/metadata.xml22
-rw-r--r--app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-2013.09.16.1328054.ebuild67
-rw-r--r--app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-9.10.0_p2476743.ebuild68
-rw-r--r--app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-9.4.0.1280544.ebuild66
-rw-r--r--app-emulation/open-vm-tools/Manifest4
-rw-r--r--app-emulation/open-vm-tools/files/9.10.0-vgauth.patch22
-rw-r--r--app-emulation/open-vm-tools/files/network22
-rw-r--r--app-emulation/open-vm-tools/files/open-vm-tools.confd2
-rw-r--r--app-emulation/open-vm-tools/files/open-vm-tools.desktop6
-rw-r--r--app-emulation/open-vm-tools/files/open-vm-tools.initd60
-rw-r--r--app-emulation/open-vm-tools/files/vmtoolsd.service11
-rw-r--r--app-emulation/open-vm-tools/metadata.xml26
-rw-r--r--app-emulation/open-vm-tools/open-vm-tools-2013.09.16.1328054-r2.ebuild123
-rw-r--r--app-emulation/open-vm-tools/open-vm-tools-2013.09.16.1328054-r3.ebuild123
-rw-r--r--app-emulation/open-vm-tools/open-vm-tools-9.10.0_p2476743.ebuild128
-rw-r--r--app-emulation/open-vm-tools/open-vm-tools-9.10.2_p2822639.ebuild123
-rw-r--r--app-emulation/open-vm-tools/open-vm-tools-9.4.0.1280544.ebuild115
-rw-r--r--app-emulation/openstack-guest-agents-unix/Manifest2
-rw-r--r--app-emulation/openstack-guest-agents-unix/files/0513f013625b6a652d7dcb663eb396b9b5bb924e.patch60
-rw-r--r--app-emulation/openstack-guest-agents-unix/files/4453b4773688eef6c60736d9cf07100716308a5e.patch57
-rw-r--r--app-emulation/openstack-guest-agents-unix/files/openstack-guest-agents-unix-1.39.0-python2.patch15
-rw-r--r--app-emulation/openstack-guest-agents-unix/files/patches-1.39.0-20140621.patch323
-rw-r--r--app-emulation/openstack-guest-agents-unix/metadata.xml13
-rw-r--r--app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0-r1.ebuild43
-rw-r--r--app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0-r2.ebuild48
-rw-r--r--app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0.ebuild32
-rw-r--r--app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.1.ebuild65
-rw-r--r--app-emulation/phpvirtualbox/Manifest6
-rw-r--r--app-emulation/phpvirtualbox/files/vboxinit-initd39
-rw-r--r--app-emulation/phpvirtualbox/metadata.xml14
-rw-r--r--app-emulation/phpvirtualbox/phpvirtualbox-4.1.11.ebuild67
-rw-r--r--app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r2.ebuild67
-rw-r--r--app-emulation/phpvirtualbox/phpvirtualbox-4.2.3b.ebuild67
-rw-r--r--app-emulation/phpvirtualbox/phpvirtualbox-4.2.4.ebuild73
-rw-r--r--app-emulation/phpvirtualbox/phpvirtualbox-4.2.7.ebuild73
-rw-r--r--app-emulation/phpvirtualbox/phpvirtualbox-4.3.0.ebuild73
-rw-r--r--app-emulation/playonlinux/Manifest3
-rw-r--r--app-emulation/playonlinux/files/playonlinux-4.2.4-binary-plugin.patch17
-rw-r--r--app-emulation/playonlinux/files/playonlinux-4.2.4-pol-bash.patch35
-rw-r--r--app-emulation/playonlinux/files/playonlinux-4.2.6-stop-update-warning.patch17
-rw-r--r--app-emulation/playonlinux/files/playonlinux-pkg.133
-rw-r--r--app-emulation/playonlinux/files/playonlinux.133
-rw-r--r--app-emulation/playonlinux/metadata.xml13
-rw-r--r--app-emulation/playonlinux/playonlinux-4.2.4.ebuild118
-rw-r--r--app-emulation/playonlinux/playonlinux-4.2.6.ebuild121
-rw-r--r--app-emulation/playonlinux/playonlinux-4.2.8.ebuild121
-rw-r--r--app-emulation/q4wine/Manifest2
-rw-r--r--app-emulation/q4wine/files/q4wine-qtsingleapp.patch15
-rw-r--r--app-emulation/q4wine/metadata.xml18
-rw-r--r--app-emulation/q4wine/q4wine-1.0-r3.ebuild59
-rw-r--r--app-emulation/q4wine/q4wine-1.1_p2-r1.ebuild62
-rw-r--r--app-emulation/qemu-guest-agent/Manifest8
-rw-r--r--app-emulation/qemu-guest-agent/files/qemu-ga-systemd.service11
-rw-r--r--app-emulation/qemu-guest-agent/files/qemu-ga-systemd.udev2
-rw-r--r--app-emulation/qemu-guest-agent/files/qemu-ga.conf-r111
-rw-r--r--app-emulation/qemu-guest-agent/files/qemu-ga.init-r125
-rw-r--r--app-emulation/qemu-guest-agent/files/qemu-ga.logrotate9
-rw-r--r--app-emulation/qemu-guest-agent/metadata.xml6
-rw-r--r--app-emulation/qemu-guest-agent/qemu-guest-agent-1.5.2-r2.ebuild93
-rw-r--r--app-emulation/qemu-guest-agent/qemu-guest-agent-1.6.0-r1.ebuild93
-rw-r--r--app-emulation/qemu-guest-agent/qemu-guest-agent-2.0.0.ebuild94
-rw-r--r--app-emulation/qemu-guest-agent/qemu-guest-agent-2.1.2.ebuild94
-rw-r--r--app-emulation/qemu-guest-agent/qemu-guest-agent-2.2.0.ebuild94
-rw-r--r--app-emulation/qemu-guest-agent/qemu-guest-agent-2.3.0.ebuild90
-rw-r--r--app-emulation/qemu/Manifest1
-rw-r--r--app-emulation/qemu/files/65-kvm.rules1
-rw-r--r--app-emulation/qemu/files/bridge.conf14
-rw-r--r--app-emulation/qemu/files/qemu-1.7.0-cflags.patch11
-rw-r--r--app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-1.patch241
-rw-r--r--app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-2.patch58
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3209.patch51
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3214.patch41
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3456.patch86
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-1.patch75
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-2.patch26
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-3.patch69
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5158.patch40
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-1.patch82
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-2.patch373
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-3.patch39
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-4.patch53
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-5.patch34
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-6.patch35
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-7.patch32
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5166.patch36
-rw-r--r--app-emulation/qemu/files/qemu-binfmt.initd-r1139
-rw-r--r--app-emulation/qemu/metadata.xml54
-rw-r--r--app-emulation/qemu/qemu-2.3.0-r4.ebuild607
-rw-r--r--app-emulation/qemu/qemu-2.3.0-r5.ebuild615
-rw-r--r--app-emulation/qemu/qemu-9999.ebuild612
-rw-r--r--app-emulation/qtemu/Manifest1
-rw-r--r--app-emulation/qtemu/files/1.0.5-help_and_translation_paths.patch63
-rw-r--r--app-emulation/qtemu/metadata.xml10
-rw-r--r--app-emulation/qtemu/qtemu-1.0.5.ebuild32
-rw-r--r--app-emulation/rex-client/metadata.xml8
-rw-r--r--app-emulation/rex-client/rex-client-9999.ebuild46
-rw-r--r--app-emulation/runc/Manifest1
-rw-r--r--app-emulation/runc/metadata.xml15
-rw-r--r--app-emulation/runc/runc-0.0.2.ebuild49
-rw-r--r--app-emulation/simh/Manifest3
-rw-r--r--app-emulation/simh/files/makefile.patch11
-rw-r--r--app-emulation/simh/files/simh-3.8.1-asneeded.patch168
-rw-r--r--app-emulation/simh/files/simh-3.8.1-makefile.patch11
-rw-r--r--app-emulation/simh/files/simh-3.9.0-fix-mkdir-race.patch11
-rw-r--r--app-emulation/simh/files/simh-3.9.0-respect-FLAGS.patch13
-rw-r--r--app-emulation/simh/metadata.xml13
-rw-r--r--app-emulation/simh/simh-3.3.0.ebuild49
-rw-r--r--app-emulation/simh/simh-3.8.1.ebuild55
-rw-r--r--app-emulation/simh/simh-3.9.0-r1.ebuild61
-rw-r--r--app-emulation/ski/Manifest1
-rw-r--r--app-emulation/ski/files/ski-1.3.2-AC_C_BIGENDIAN.patch75
-rw-r--r--app-emulation/ski/files/ski-1.3.2-binutils.patch31
-rw-r--r--app-emulation/ski/files/ski-1.3.2-configure-withval.patch22
-rw-r--r--app-emulation/ski/files/ski-1.3.2-no-local-ltdl.patch22
-rw-r--r--app-emulation/ski/files/ski-1.3.2-remove-hayes.patch14
-rw-r--r--app-emulation/ski/files/ski-1.3.2-syscall-linux-includes.patch18
-rw-r--r--app-emulation/ski/metadata.xml8
-rw-r--r--app-emulation/ski/ski-1.3.2-r1.ebuild54
-rw-r--r--app-emulation/ski/ski-1.3.2.ebuild54
-rw-r--r--app-emulation/skyeye/Manifest1
-rw-r--r--app-emulation/skyeye/metadata.xml5
-rw-r--r--app-emulation/skyeye/skyeye-1.0.0.ebuild27
-rw-r--r--app-emulation/softgun/Manifest2
-rw-r--r--app-emulation/softgun/files/softgun-0.21-make.patch68
-rw-r--r--app-emulation/softgun/files/softgun-0.22-make.patch75
-rw-r--r--app-emulation/softgun/metadata.xml8
-rw-r--r--app-emulation/softgun/softgun-0.21.ebuild33
-rw-r--r--app-emulation/softgun/softgun-0.22.ebuild33
-rw-r--r--app-emulation/spectemu/Manifest1
-rw-r--r--app-emulation/spectemu/files/spectemu-0.99.3-automagic.patch31
-rw-r--r--app-emulation/spectemu/files/spectemu-0.99.3-build.patch34
-rw-r--r--app-emulation/spectemu/files/spectemu-0.99.3-qa.patch23
-rw-r--r--app-emulation/spectemu/metadata.xml7
-rw-r--r--app-emulation/spectemu/spectemu-0.99.3-r1.ebuild45
-rw-r--r--app-emulation/spectemu/spectemu-0.99.3.ebuild48
-rw-r--r--app-emulation/spice-protocol/Manifest4
-rw-r--r--app-emulation/spice-protocol/metadata.xml9
-rw-r--r--app-emulation/spice-protocol/spice-protocol-0.12.3.ebuild17
-rw-r--r--app-emulation/spice-protocol/spice-protocol-0.12.5.ebuild17
-rw-r--r--app-emulation/spice-protocol/spice-protocol-0.12.6.ebuild17
-rw-r--r--app-emulation/spice-protocol/spice-protocol-0.12.7.ebuild17
-rw-r--r--app-emulation/spice-vdagent/Manifest3
-rw-r--r--app-emulation/spice-vdagent/files/spice-vdagent.confd7
-rw-r--r--app-emulation/spice-vdagent/files/spice-vdagent.confd-211
-rw-r--r--app-emulation/spice-vdagent/files/spice-vdagent.initd50
-rw-r--r--app-emulation/spice-vdagent/files/spice-vdagent.initd-261
-rw-r--r--app-emulation/spice-vdagent/metadata.xml14
-rw-r--r--app-emulation/spice-vdagent/spice-vdagent-0.10.1.ebuild54
-rw-r--r--app-emulation/spice-vdagent/spice-vdagent-0.12.0.ebuild54
-rw-r--r--app-emulation/spice-vdagent/spice-vdagent-0.8.1-r1.ebuild52
-rw-r--r--app-emulation/spice/Manifest1
-rw-r--r--app-emulation/spice/files/0.11.0-gold.patch30
-rw-r--r--app-emulation/spice/files/spice-0.12.5-fix-assert-in-mjpeg_encoder_adjust_params_to_bit_rate.patch30
-rw-r--r--app-emulation/spice/files/spice-0.12.5-fix-crash-when-clearing-surface-memory.patch31
-rw-r--r--app-emulation/spice/files/spice-0.12.5-server-dont-assert-on-invalid-client-message.patch30
-rw-r--r--app-emulation/spice/metadata.xml13
-rw-r--r--app-emulation/spice/spice-0.12.5-r1.ebuild82
-rw-r--r--app-emulation/spim/Manifest1
-rw-r--r--app-emulation/spim/files/spim-8.0-r1-respect_env.patch183
-rw-r--r--app-emulation/spim/files/xspim.svg216
-rw-r--r--app-emulation/spim/metadata.xml15
-rw-r--r--app-emulation/spim/spim-8.0-r1.ebuild75
-rw-r--r--app-emulation/uade/Manifest1
-rw-r--r--app-emulation/uade/metadata.xml5
-rw-r--r--app-emulation/uade/uade-2.13.ebuild35
-rw-r--r--app-emulation/uae/Manifest1
-rw-r--r--app-emulation/uae/files/sdlgfx.h38
-rw-r--r--app-emulation/uae/files/uae-0.8.25-allow_spaces_in_zip_filenames.diff18
-rw-r--r--app-emulation/uae/files/uae-0.8.25-struct_uae_wrong_fields_name.diff18
-rw-r--r--app-emulation/uae/files/uae-0.8.26-uae_reset_args.diff86
-rw-r--r--app-emulation/uae/files/uae-0.8.26-underlinking.patch19
-rw-r--r--app-emulation/uae/metadata.xml18
-rw-r--r--app-emulation/uae/uae-0.8.29-r2.ebuild71
-rw-r--r--app-emulation/vagrant/Manifest1
-rw-r--r--app-emulation/vagrant/files/vagrant-1.2.1-no-warning.patch12
-rw-r--r--app-emulation/vagrant/files/vagrant-1.2.2-rvm.patch12
-rw-r--r--app-emulation/vagrant/metadata.xml10
-rw-r--r--app-emulation/vagrant/vagrant-1.4.3-r2.ebuild69
-rw-r--r--app-emulation/vboxgtk/Manifest1
-rw-r--r--app-emulation/vboxgtk/metadata.xml8
-rw-r--r--app-emulation/vboxgtk/vboxgtk-0.8.2-r1.ebuild45
-rw-r--r--app-emulation/vice/Manifest2
-rw-r--r--app-emulation/vice/files/vice-2.4-arm.patch38
-rw-r--r--app-emulation/vice/files/vice-2.4-autotools.patch11
-rw-r--r--app-emulation/vice/files/vice-2.4-buffer.patch14
-rw-r--r--app-emulation/vice/files/vice-2.4-ffmpeg-1.patch135
-rw-r--r--app-emulation/vice/files/vice-2.4.20-autotools.patch11
-rw-r--r--app-emulation/vice/files/vice-2.4.20-xf86extensions.patch15
-rw-r--r--app-emulation/vice/metadata.xml17
-rw-r--r--app-emulation/vice/vice-2.4.20.ebuild172
-rw-r--r--app-emulation/vice/vice-2.4.ebuild117
-rw-r--r--app-emulation/virt-manager/Manifest2
-rw-r--r--app-emulation/virt-manager/files/virt-manager-1.1.0-optional_avahi.patch15
-rw-r--r--app-emulation/virt-manager/metadata.xml16
-rw-r--r--app-emulation/virt-manager/virt-manager-1.1.0-r2.ebuild95
-rw-r--r--app-emulation/virt-manager/virt-manager-1.2.1.ebuild93
-rw-r--r--app-emulation/virt-manager/virt-manager-9999.ebuild93
-rw-r--r--app-emulation/virt-viewer/Manifest2
-rw-r--r--app-emulation/virt-viewer/files/virt-viewer-0.6.0-fix-c99-compat.patch29
-rw-r--r--app-emulation/virt-viewer/metadata.xml12
-rw-r--r--app-emulation/virt-viewer/virt-viewer-0.5.6.ebuild45
-rw-r--r--app-emulation/virt-viewer/virt-viewer-2.0.ebuild49
-rw-r--r--app-emulation/virt-what/Manifest1
-rw-r--r--app-emulation/virt-what/metadata.xml12
-rw-r--r--app-emulation/virt-what/virt-what-1.12.ebuild20
-rw-r--r--app-emulation/virtualbox-additions/Manifest3
-rw-r--r--app-emulation/virtualbox-additions/metadata.xml12
-rw-r--r--app-emulation/virtualbox-additions/virtualbox-additions-4.3.28.ebuild36
-rw-r--r--app-emulation/virtualbox-additions/virtualbox-additions-4.3.30.ebuild36
-rw-r--r--app-emulation/virtualbox-additions/virtualbox-additions-5.0.0.ebuild36
-rw-r--r--app-emulation/virtualbox-bin/Manifest12
-rw-r--r--app-emulation/virtualbox-bin/files/10-virtualbox.rules7
-rw-r--r--app-emulation/virtualbox-bin/files/vboxwebsrv-confd20
-rw-r--r--app-emulation/virtualbox-bin/files/vboxwebsrv-initd24
-rwxr-xr-xapp-emulation/virtualbox-bin/files/virtualbox-bin-3-wrapper104
-rw-r--r--app-emulation/virtualbox-bin/files/virtualbox-bin-config1
-rw-r--r--app-emulation/virtualbox-bin/files/virtualbox-bin.desktop-28
-rw-r--r--app-emulation/virtualbox-bin/metadata.xml16
-rw-r--r--app-emulation/virtualbox-bin/virtualbox-bin-4.3.28.100309.ebuild357
-rw-r--r--app-emulation/virtualbox-bin/virtualbox-bin-4.3.30.101610.ebuild357
-rw-r--r--app-emulation/virtualbox-bin/virtualbox-bin-5.0.0.101573.ebuild357
-rw-r--r--app-emulation/virtualbox-extpack-oracle/Manifest3
-rw-r--r--app-emulation/virtualbox-extpack-oracle/metadata.xml12
-rw-r--r--app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.3.28.100309.ebuild41
-rw-r--r--app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.3.30.101610.ebuild41
-rw-r--r--app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.0.0.101573.ebuild43
-rw-r--r--app-emulation/virtualbox-guest-additions/Manifest3
-rw-r--r--app-emulation/virtualbox-guest-additions/files/vboxclient.desktop7
-rw-r--r--app-emulation/virtualbox-guest-additions/files/vboxguest-4.1.0-log-use-c99.patch13
-rw-r--r--app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3-localconfig30
-rw-r--r--app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-5-localconfig30
-rw-r--r--app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-8.initd26
-rw-r--r--app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions.service16
-rw-r--r--app-emulation/virtualbox-guest-additions/files/xorg.conf.vbox13
-rw-r--r--app-emulation/virtualbox-guest-additions/metadata.xml12
-rw-r--r--app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.3.28.ebuild221
-rw-r--r--app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.3.30.ebuild221
-rw-r--r--app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.0.0.ebuild221
-rw-r--r--app-emulation/virtualbox-modules/Manifest3
-rwxr-xr-xapp-emulation/virtualbox-modules/files/create_vbox_modules_tarball.sh29
-rw-r--r--app-emulation/virtualbox-modules/files/virtualbox-modules-3.17.patch49
-rw-r--r--app-emulation/virtualbox-modules/files/virtualbox-modules-4.1.4-pax-const.patch48
-rw-r--r--app-emulation/virtualbox-modules/files/virtualbox.conf3
-rw-r--r--app-emulation/virtualbox-modules/metadata.xml15
-rw-r--r--app-emulation/virtualbox-modules/virtualbox-modules-4.3.28.ebuild59
-rw-r--r--app-emulation/virtualbox-modules/virtualbox-modules-4.3.30.ebuild59
-rw-r--r--app-emulation/virtualbox-modules/virtualbox-modules-5.0.0.ebuild59
-rw-r--r--app-emulation/virtualbox/Manifest5
-rw-r--r--app-emulation/virtualbox/files/10-virtualbox.rules7
-rw-r--r--app-emulation/virtualbox/files/vboxwebsrv-confd20
-rw-r--r--app-emulation/virtualbox/files/vboxwebsrv-initd24
-rw-r--r--app-emulation/virtualbox/files/virtualbox-4-config1
-rw-r--r--app-emulation/virtualbox/files/virtualbox-4-localconfig45
-rw-r--r--app-emulation/virtualbox/files/virtualbox-5-localconfig45
-rw-r--r--app-emulation/virtualbox/files/virtualbox-ose-3-config1
-rwxr-xr-xapp-emulation/virtualbox/files/virtualbox-ose-3-wrapper104
-rw-r--r--app-emulation/virtualbox/files/virtualbox-ose.desktop-28
-rw-r--r--app-emulation/virtualbox/metadata.xml20
-rw-r--r--app-emulation/virtualbox/virtualbox-4.3.28.ebuild419
-rw-r--r--app-emulation/virtualbox/virtualbox-4.3.30.ebuild419
-rw-r--r--app-emulation/virtualbox/virtualbox-5.0.0.ebuild425
-rw-r--r--app-emulation/vmips-cross-bin/Manifest1
-rw-r--r--app-emulation/vmips-cross-bin/metadata.xml7
-rw-r--r--app-emulation/vmips-cross-bin/vmips-cross-bin-1.0.ebuild18
-rw-r--r--app-emulation/vmips/Manifest2
-rw-r--r--app-emulation/vmips/metadata.xml10
-rw-r--r--app-emulation/vmips/vmips-1.3.1.ebuild17
-rw-r--r--app-emulation/vmips/vmips-1.3.ebuild17
-rw-r--r--app-emulation/vmware-modules/files/271-3.10.0.patch809
-rw-r--r--app-emulation/vmware-modules/files/271-apic.patch12
-rw-r--r--app-emulation/vmware-modules/files/271-filldir.patch91
-rw-r--r--app-emulation/vmware-modules/files/271-makefile-include.patch65
-rw-r--r--app-emulation/vmware-modules/files/271-makefile-kernel-dir.patch85
-rw-r--r--app-emulation/vmware-modules/files/271-netdevice.patch24
-rw-r--r--app-emulation/vmware-modules/files/271-putname.patch13
-rw-r--r--app-emulation/vmware-modules/files/271-vfsfollowlink.patch30
-rw-r--r--app-emulation/vmware-modules/files/271-vmmon.patch44
-rw-r--r--app-emulation/vmware-modules/files/279-apic.patch12
-rw-r--r--app-emulation/vmware-modules/files/279-filldir.patch91
-rw-r--r--app-emulation/vmware-modules/files/279-hardened.patch113
-rw-r--r--app-emulation/vmware-modules/files/279-makefile-include.patch65
-rw-r--r--app-emulation/vmware-modules/files/279-makefile-kernel-dir.patch85
-rw-r--r--app-emulation/vmware-modules/files/279-netdevice.patch24
-rw-r--r--app-emulation/vmware-modules/files/279-putname.patch13
-rw-r--r--app-emulation/vmware-modules/files/279-vfsfollowlink.patch30
-rw-r--r--app-emulation/vmware-modules/files/279-vmblock.patch23
-rw-r--r--app-emulation/vmware-modules/files/hardened.patch170
-rw-r--r--app-emulation/vmware-modules/metadata.xml10
-rw-r--r--app-emulation/vmware-modules/vmware-modules-271.3.ebuild85
-rw-r--r--app-emulation/vmware-modules/vmware-modules-279.1-r1.ebuild100
-rw-r--r--app-emulation/vmware-modules/vmware-modules-279.2.ebuild100
-rw-r--r--app-emulation/vmware-modules/vmware-modules-279.3.ebuild100
-rw-r--r--app-emulation/vmware-player/Manifest8
-rw-r--r--app-emulation/vmware-player/files/config-3.010
-rw-r--r--app-emulation/vmware-player/files/list-bundle-components.xsl17
-rw-r--r--app-emulation/vmware-player/files/list-component-files.xsl19
-rw-r--r--app-emulation/vmware-player/files/vmware-3.0.rc33
-rw-r--r--app-emulation/vmware-player/metadata.xml14
-rw-r--r--app-emulation/vmware-player/vmware-player-5.0.3.1410761.ebuild245
-rw-r--r--app-emulation/vmware-player/vmware-player-6.0.1.1379776.ebuild245
-rw-r--r--app-emulation/vmware-player/vmware-player-6.0.2.1744117.ebuild245
-rw-r--r--app-emulation/vmware-player/vmware-player-6.0.3.1895310.ebuild245
-rw-r--r--app-emulation/vmware-tools/Manifest36
-rw-r--r--app-emulation/vmware-tools/metadata.xml5
-rw-r--r--app-emulation/vmware-tools/vmware-tools-9.2.3.1031769.ebuild56
-rw-r--r--app-emulation/vmware-tools/vmware-tools-9.6.1.1379776.ebuild55
-rw-r--r--app-emulation/vmware-tools/vmware-tools-9.6.2.1744117.ebuild55
-rw-r--r--app-emulation/vmware-view-open-client/Manifest1
-rw-r--r--app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-curl-headers.patch12
-rw-r--r--app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-linking.patch14
-rw-r--r--app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-unbundle-intltool.patch35
-rw-r--r--app-emulation/vmware-view-open-client/metadata.xml13
-rw-r--r--app-emulation/vmware-view-open-client/vmware-view-open-client-4.5.0.297975-r1.ebuild57
-rw-r--r--app-emulation/vmware-vix/Manifest2
-rw-r--r--app-emulation/vmware-vix/metadata.xml14
-rw-r--r--app-emulation/vmware-vix/vmware-vix-1.11.4.744019.ebuild124
-rw-r--r--app-emulation/vmware-workstation/Manifest9
-rw-r--r--app-emulation/vmware-workstation/files/configure-hostd.sh20
-rw-r--r--app-emulation/vmware-workstation/files/list-bundle-components.xsl17
-rw-r--r--app-emulation/vmware-workstation/files/list-component-files.xsl19
-rw-r--r--app-emulation/vmware-workstation/files/vmware-10.0.rc37
-rw-r--r--app-emulation/vmware-workstation/files/vmware-9.0.rc37
-rw-r--r--app-emulation/vmware-workstation/files/vmware-server-10.0.rc55
-rw-r--r--app-emulation/vmware-workstation/files/vmware-server-9.0.rc55
-rw-r--r--app-emulation/vmware-workstation/metadata.xml21
-rw-r--r--app-emulation/vmware-workstation/vmware-workstation-10.0.1.1379776-r1.ebuild493
-rw-r--r--app-emulation/vmware-workstation/vmware-workstation-10.0.2.1744117.ebuild493
-rw-r--r--app-emulation/vmware-workstation/vmware-workstation-10.0.3.1895310.ebuild493
-rw-r--r--app-emulation/vmware-workstation/vmware-workstation-9.0.3.1410761.ebuild491
-rw-r--r--app-emulation/vov/Manifest1
-rw-r--r--app-emulation/vov/metadata.xml17
-rw-r--r--app-emulation/vov/vov-2.0.0.ebuild52
-rw-r--r--app-emulation/vpcs/Manifest1
-rw-r--r--app-emulation/vpcs/metadata.xml15
-rw-r--r--app-emulation/vpcs/vpcs-0.6.ebuild45
-rw-r--r--app-emulation/wine/Manifest79
-rw-r--r--app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch40
-rw-r--r--app-emulation/wine/files/wine-1.5.17-osmesa-check.patch38
-rw-r--r--app-emulation/wine/files/wine-1.5.26-winegcc.patch59
-rw-r--r--app-emulation/wine/files/wine-1.6-memset-O3.patch21
-rw-r--r--app-emulation/wine/files/wine-1.7.0-freetype-header-location.patch351
-rw-r--r--app-emulation/wine/files/wine-1.7.12-osmesa-check.patch38
-rw-r--r--app-emulation/wine/files/wine-1.7.19-makefile-race-cond.patch15
-rw-r--r--app-emulation/wine/files/wine-1.7.2-osmesa-check.patch38
-rw-r--r--app-emulation/wine/files/wine-1.7.38-gstreamer-v5-staging-post.patch58
-rw-r--r--app-emulation/wine/files/wine-1.7.38-gstreamer-v5-staging-pre.patch48
-rw-r--r--app-emulation/wine/files/wine-1.7.39-gstreamer-v5-staging-post.patch38
-rw-r--r--app-emulation/wine/files/wine-1.7.39-gstreamer-v5-staging-pre.patch40
-rw-r--r--app-emulation/wine/files/wine-1.7.45-libunwind-osx-only.patch64
-rw-r--r--app-emulation/wine/files/wine-1.7.47-critical-security-cookie-fix.patch82
-rw-r--r--app-emulation/wine/files/wine-gcc-4.9-null-pointer.patch35
-rw-r--r--app-emulation/wine/metadata.xml35
-rw-r--r--app-emulation/wine/wine-1.6.2-r1.ebuild368
-rw-r--r--app-emulation/wine/wine-1.6.2.ebuild376
-rw-r--r--app-emulation/wine/wine-1.7.10-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.11-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.12-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.13-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.14-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.15-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.16-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.17-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.18-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.19-r2.ebuild415
-rw-r--r--app-emulation/wine/wine-1.7.20-r1.ebuild417
-rw-r--r--app-emulation/wine/wine-1.7.21-r1.ebuild424
-rw-r--r--app-emulation/wine/wine-1.7.22-r1.ebuild424
-rw-r--r--app-emulation/wine/wine-1.7.28-r1.ebuild427
-rw-r--r--app-emulation/wine/wine-1.7.29-r1.ebuild427
-rw-r--r--app-emulation/wine/wine-1.7.3-r1.ebuild369
-rw-r--r--app-emulation/wine/wine-1.7.33-r1.ebuild430
-rw-r--r--app-emulation/wine/wine-1.7.34.ebuild427
-rw-r--r--app-emulation/wine/wine-1.7.35.ebuild422
-rw-r--r--app-emulation/wine/wine-1.7.36.ebuild421
-rw-r--r--app-emulation/wine/wine-1.7.37.ebuild424
-rw-r--r--app-emulation/wine/wine-1.7.38-r1.ebuild434
-rw-r--r--app-emulation/wine/wine-1.7.39-r1.ebuild436
-rw-r--r--app-emulation/wine/wine-1.7.4-r1.ebuild369
-rw-r--r--app-emulation/wine/wine-1.7.40-r1.ebuild436
-rw-r--r--app-emulation/wine/wine-1.7.41.ebuild436
-rw-r--r--app-emulation/wine/wine-1.7.42.ebuild436
-rw-r--r--app-emulation/wine/wine-1.7.43.ebuild436
-rw-r--r--app-emulation/wine/wine-1.7.44.ebuild436
-rw-r--r--app-emulation/wine/wine-1.7.45.ebuild430
-rw-r--r--app-emulation/wine/wine-1.7.46.ebuild436
-rw-r--r--app-emulation/wine/wine-1.7.47.ebuild438
-rw-r--r--app-emulation/wine/wine-1.7.8-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-1.7.9-r1.ebuild370
-rw-r--r--app-emulation/wine/wine-9999.ebuild436
-rw-r--r--app-emulation/winetricks/Manifest2
-rw-r--r--app-emulation/winetricks/metadata.xml19
-rw-r--r--app-emulation/winetricks/winetricks-20150706.ebuild83
-rw-r--r--app-emulation/winetricks/winetricks-99999999.ebuild83
-rw-r--r--app-emulation/x48/Manifest1
-rw-r--r--app-emulation/x48/metadata.xml22
-rw-r--r--app-emulation/x48/x48-0.6.4.ebuild67
-rw-r--r--app-emulation/xe-guest-utilities/Manifest3
-rw-r--r--app-emulation/xe-guest-utilities/files/xe-daemon.initd28
-rw-r--r--app-emulation/xe-guest-utilities/files/xe-guest-utilities-5.6.100_p651-gentoo.patch35
-rw-r--r--app-emulation/xe-guest-utilities/files/xe-guest-utilities-5.6.100_p651-update-guest-attrs.patch11
-rw-r--r--app-emulation/xe-guest-utilities/files/xe-guest-utilities-6.2.0_p1120-Guest-Attributes.patch127
-rw-r--r--app-emulation/xe-guest-utilities/files/xe-guest-utilities-6.2.0_p1120-Linux-Distribution.patch77
-rw-r--r--app-emulation/xe-guest-utilities/metadata.xml19
-rw-r--r--app-emulation/xe-guest-utilities/xe-guest-utilities-5.6.0_p595.ebuild57
-rw-r--r--app-emulation/xe-guest-utilities/xe-guest-utilities-6.1.0_p1033.ebuild57
-rw-r--r--app-emulation/xe-guest-utilities/xe-guest-utilities-6.2.0_p1120.ebuild57
-rw-r--r--app-emulation/xen-pvgrub/Manifest8
-rw-r--r--app-emulation/xen-pvgrub/files/newlib-implicits.patch149
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4-fix_dotconfig-gcc.patch245
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4.2.1-externals.patch83
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4.3-externals.patch75
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4.3-fix_dotconfig-gcc.patch220
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4.4-fix_dotconfig-gcc.patch171
-rw-r--r--app-emulation/xen-pvgrub/files/xen-pvgrub-4-qa.patch35
-rw-r--r--app-emulation/xen-pvgrub/files/xen-pvgrub-4.2-jserver.patch32
-rw-r--r--app-emulation/xen-pvgrub/files/xen-pvgrub-4.2.3-qa.patch34
-rw-r--r--app-emulation/xen-pvgrub/files/xen-pvgrub-4.3.1-qa.patch30
-rw-r--r--app-emulation/xen-pvgrub/metadata.xml5
-rw-r--r--app-emulation/xen-pvgrub/xen-pvgrub-4.2.5.ebuild162
-rw-r--r--app-emulation/xen-pvgrub/xen-pvgrub-4.5.1.ebuild143
-rw-r--r--app-emulation/xen-tools/Manifest11
-rw-r--r--app-emulation/xen-tools/files/gentoo-patches.conf135
-rw-r--r--app-emulation/xen-tools/files/stubs-32.h20
-rw-r--r--app-emulation/xen-tools/files/xen-consoles.logrotate5
-rw-r--r--app-emulation/xen-tools/files/xencommons.confd4
-rw-r--r--app-emulation/xen-tools/files/xencommons.initd80
-rw-r--r--app-emulation/xen-tools/files/xenconsoled.confd2
-rw-r--r--app-emulation/xen-tools/files/xenconsoled.initd34
-rw-r--r--app-emulation/xen-tools/files/xendomains-screen.confd25
-rw-r--r--app-emulation/xen-tools/files/xendomains.confd9
-rw-r--r--app-emulation/xen-tools/files/xendomains.initd-r2118
-rw-r--r--app-emulation/xen-tools/files/xenqemudev.confd7
-rw-r--r--app-emulation/xen-tools/files/xenqemudev.initd85
-rw-r--r--app-emulation/xen-tools/files/xenstored.confd2
-rwxr-xr-xapp-emulation/xen-tools/files/xenstored.initd44
-rw-r--r--app-emulation/xen-tools/metadata.xml18
-rw-r--r--app-emulation/xen-tools/xen-tools-4.2.5-r10.ebuild391
-rw-r--r--app-emulation/xen-tools/xen-tools-4.5.1-r3.ebuild458
-rw-r--r--app-emulation/xen/Manifest4
-rw-r--r--app-emulation/xen/files/xen-4-fix_dotconfig-gcc.patch37
-rw-r--r--app-emulation/xen/files/xen-4.2-efi.patch33
-rw-r--r--app-emulation/xen/files/xen-4.3-fix_dotconfig-gcc.patch220
-rw-r--r--app-emulation/xen/files/xen-4.4-efi.patch36
-rw-r--r--app-emulation/xen/files/xen-4.5-efi.patch37
-rw-r--r--app-emulation/xen/metadata.xml11
-rw-r--r--app-emulation/xen/xen-4.2.5-r11.ebuild167
-rw-r--r--app-emulation/xen/xen-4.5.1.ebuild176
-rw-r--r--app-emulation/xtrs/Manifest3
-rw-r--r--app-emulation/xtrs/metadata.xml23
-rw-r--r--app-emulation/xtrs/xtrs-4.9d-r3.ebuild70
761 files changed, 59286 insertions, 0 deletions
diff --git a/app-emulation/aqemu/Manifest b/app-emulation/aqemu/Manifest
new file mode 100644
index 000000000000..0251138dfa5c
--- /dev/null
+++ b/app-emulation/aqemu/Manifest
@@ -0,0 +1 @@
+DIST aqemu-0.8.2.tar.bz2 1025129 SHA256 03c4a95328f78238021168ca4887f9735641f10eb4eb1eff58b08c15b748bf03 SHA512 45f27f82ca307ffc50ea26a57631b47236fd04915274bb00a0720e65859e183d56c3243e0e31d71e5280d0941a9c80c1457b09d393e5c4d4deeb1fea4159459d WHIRLPOOL c5a058883df1424d5d1b2b028fca7fd6aae8b72281060a305a428e63ad5bfb1d062c56c18878b6a279a79953a88c760553a701b5c3346113836eb56ab4a30aa2
diff --git a/app-emulation/aqemu/aqemu-0.8.2-r2.ebuild b/app-emulation/aqemu/aqemu-0.8.2-r2.ebuild
new file mode 100644
index 000000000000..9d38d3c6eae7
--- /dev/null
+++ b/app-emulation/aqemu/aqemu-0.8.2-r2.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+DESCRIPTION="Graphical interface for QEMU and KVM emulators, using Qt4"
+HOMEPAGE="http://sourceforge.net/projects/aqemu"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="vnc"
+
+DEPEND="${RDEPEND}"
+RDEPEND="app-emulation/qemu
+ vnc? ( net-libs/libvncserver )
+ dev-qt/qtgui:4
+ dev-qt/qttest:4
+ dev-qt/qtxmlpatterns:4"
+
+DOCS="AUTHORS CHANGELOG README TODO"
+PATCHES=(
+ "${FILESDIR}"/aqemu-0.8.2_sigsev_propertis.patch
+ "${FILESDIR}"/aqemu-0.8.2_qt48_build.patch
+ "${FILESDIR}"/aqemu-0.8.2_desktop_file.patch
+)
+
+src_configure() {
+ local mycmakeargs=(
+ "-DMAN_PAGE_COMPRESSOR="
+ "-DWITHOUT_EMBEDDED_DISPLAY=$(use vnc && echo "OFF" || echo "ON")"
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/app-emulation/aqemu/files/aqemu-0.8.2_desktop_file.patch b/app-emulation/aqemu/files/aqemu-0.8.2_desktop_file.patch
new file mode 100644
index 000000000000..4cf20ea578d0
--- /dev/null
+++ b/app-emulation/aqemu/files/aqemu-0.8.2_desktop_file.patch
@@ -0,0 +1,33 @@
+From 2a0f32e8cb46c8a1c0a33ed151737e5abb5679ed Mon Sep 17 00:00:00 2001
+From: Andrey Rijov <rdron@users.sourceforge.net>
+Date: Mon, 31 Oct 2011 19:38:17 +0400
+Subject: [PATCH] Updated aqemu.desktop file (See bug: 3430317)
+
+---
+ menu_data/aqemu.desktop | 9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+--- a/menu_data/aqemu.desktop
++++ b/menu_data/aqemu.desktop
+@@ -1,14 +1,15 @@
+ [Desktop Entry]
+ Encoding=UTF-8
+-Name=AQEMU
+ Exec=aqemu
+ Terminal=false
+ Type=Application
+-Icon=aqemu_48x48.png
++Icon=aqemu_48x48
+ StartupNotify=true
+ Categories=System;Emulator;
+
+-Name[ru]=AQEMU
++Name=AQEMU
++Comment=Virtual machine manager
+ Name[en]=AQEMU
+-Comment[ru]=Управление виртуальными машинами
+ Comment[en]=Virtual machine manager
++Name[ru]=AQEMU
++Comment[ru]=Управление виртуальными машинами
+--
+1.7.4.1
diff --git a/app-emulation/aqemu/files/aqemu-0.8.2_qt48_build.patch b/app-emulation/aqemu/files/aqemu-0.8.2_qt48_build.patch
new file mode 100644
index 000000000000..afd1f0c853d4
--- /dev/null
+++ b/app-emulation/aqemu/files/aqemu-0.8.2_qt48_build.patch
@@ -0,0 +1,27 @@
+From 9b21d88a4f4a681f9e80c11e83e81c976e0fc91e Mon Sep 17 00:00:00 2001
+From: Andrey Rijov <rdron@users.sourceforge.net>
+Date: Sat, 29 Oct 2011 10:20:32 +0400
+Subject: [PATCH 1/1] Fix build error on Qt 4.8
+
+---
+ Embedded_Display/vncview.cpp | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Embedded_Display/vncview.cpp b/Embedded_Display/vncview.cpp
+index 9e105c9..0be5944 100644
+--- a/Embedded_Display/vncview.cpp
++++ b/Embedded_Display/vncview.cpp
+@@ -27,8 +27,8 @@
+ #include <QMessageBox>
+ #include <QInputDialog>
+ #define KMessageBox QMessageBox
+- #define error(parent, message, caption) \
+- critical(parent, caption, message)
++/* #define error(parent, message, caption) \
++ critical(parent, caption, message)*/
+ #else
+ #include "settings.h"
+ #include <KActionCollection>
+--
+1.7.4.1
+
diff --git a/app-emulation/aqemu/files/aqemu-0.8.2_sigsev_propertis.patch b/app-emulation/aqemu/files/aqemu-0.8.2_sigsev_propertis.patch
new file mode 100644
index 000000000000..b7cc5950bd5f
--- /dev/null
+++ b/app-emulation/aqemu/files/aqemu-0.8.2_sigsev_propertis.patch
@@ -0,0 +1,41 @@
+--- a/Device_Manager_Widget.cpp 2011-09-13 21:45:58.883389571 +0200
++++ b/Device_Manager_Widget.cpp 2011-09-13 21:55:01.401866022 +0200
+@@ -981,9 +981,10 @@
+ {
+ if( ui.Devices_List->currentItem()->data(512).toString() == "device" + QString::number(fx) )
+ {
+- finded = true;
+-
+ Storage_Devices.removeAt( fx );
++ ui.Devices_List->takeItem( ui.Devices_List->currentRow() );
++ finded = true;
++ break;
+ }
+ }
+
+@@ -993,10 +994,24 @@
+ "Incorrect Device!" );
+ return;
+ }
++ else
++ {
++ // Rename items
++ for( int ix = 0, count = 0; ix < ui.Devices_List->count(); ++ix )
++ {
++ if( ui.Devices_List->item(ix)->data(512).toString().contains("device") )
++ {
++ ui.Devices_List->item(ix)->setData( 512, QString("device%1").arg(count) );
++ ++count;
++ }
++ }
++
++ emit Device_Changet();
++ return;
++ }
+ }
+
+ ui.Devices_List->takeItem( ui.Devices_List->currentRow() );
+-
+ emit Device_Changet();
+ }
+
diff --git a/app-emulation/aqemu/metadata.xml b/app-emulation/aqemu/metadata.xml
new file mode 100644
index 000000000000..25667e2ea9cd
--- /dev/null
+++ b/app-emulation/aqemu/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>maksbotan@gentoo.org</email>
+ <description>Proxy maintainer (CC on bugs)</description>
+ </maintainer>
+ <maintainer>
+ <email>andreis.vinogradovs@gmail.com</email>
+ <description>Proxied maintainer (assign bugs)</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">aqemu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/aranym/Manifest b/app-emulation/aranym/Manifest
new file mode 100644
index 000000000000..7751ff866a79
--- /dev/null
+++ b/app-emulation/aranym/Manifest
@@ -0,0 +1,3 @@
+DIST afros812.zip 9087862 SHA256 7d60230694734a42d912f47d03653f60ffd5a034d89771df35a414b6a6af6263 SHA512 0e9522740dc38c34b1fab4a999485caca0af95692d281bf2887fe6dddf48cceaf6c4d8b9802f402e2bd00726fb01c557ffb5731838ebd94b9eec987f1f0ce545 WHIRLPOOL bc641fef78cff4fb14448b0054eb39505a507d73f1511fb0d801f06637e0c81e2311c6c1fe1391aea379f967d5f20032e4ffb5184d9a9f39f3530c3cfeb63550
+DIST aranym_0.9.14.orig.tar.gz 1831715 SHA256 04e85337fbf54cb3c80c2d26ce22f51337abc2ddc730d9bf9ed3b171def4b9fa SHA512 8145546bf6f6ffea8f4ea24f0fbfc19d1b33146b30473757dcf04c7603125f7f3a36f266ad190baf310510fa50b5f9ecfe2cd8627dea292d3851e6c64cf4fc17 WHIRLPOOL 86ad78d2a7ff0c66f94875bfb6d80957436bf594bd201884d8fee3e541aa11f5d03d16500807b3d9172155c5284e94d4d251913f08869def4d4bfd33f1d24bc7
+DIST aranym_0.9.16.orig.tar.gz 1778730 SHA256 11e7ca0dd93d42966c2ec70749a3c1e4345656ad1108a126ecd9754391a308c6 SHA512 b2848b1c6726b0e85f76da144a3f4f478bed13a1bc528658a448499c5e3434d5adb2ff6e0625d814a6e15a6d1ca9fe8922a3f282b50b1cb7763bb09c64342ae8 WHIRLPOOL 48a5cf68c4243c18292e3948d688ee8dc29306986b05177cc469cd6915dabe8733994f1578272acfac939cbae77d27a3bb4ced8fa41aa70cfb70ce503b6c717d
diff --git a/app-emulation/aranym/aranym-0.9.14.ebuild b/app-emulation/aranym/aranym-0.9.14.ebuild
new file mode 100644
index 000000000000..dfb397f37bb3
--- /dev/null
+++ b/app-emulation/aranym/aranym-0.9.14.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Atari Running on Any Machine, a VM running Atari ST/TT/Falcon OS and TOS/GEM applications"
+HOMEPAGE="http://aranym.sourceforge.net/"
+SRC_URI="mirror://sourceforge/aranym/${P/-/_}.orig.tar.gz
+ mirror://sourceforge/aranym/afros812.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="+fullmmu +lilo opengl usbhost X"
+
+RDEPEND="games-emulation/emutos
+ media-libs/libsdl
+ opengl? ( virtual/opengl )
+ X? ( media-libs/libsdl[X] )"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+src_configure() {
+ filter-flags -mpowerpc-gfxopt
+
+ local myconf=""
+ if [[ ${ARCH} == x86 ]]; then
+ myconf="${myconf} --enable-jit-compiler"
+ fi
+
+ if ! use X; then
+ myconf="${myconf} --disable-nfjpeg --disable-nfclipbrd"
+ fi
+
+ econf \
+ $(use_enable X gui) \
+ $(use_enable opengl) \
+ $(use_enable fullmmu) \
+ $(use_enable lilo) \
+ $(use_enable usbhost) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_PROGRAM="install" install
+
+ insinto /usr/share/${PN}
+ doins -r "${WORKDIR}"/afros
+
+ dodoc "${D}"/usr/share/doc/${PN}/*
+ rm -r "${D}"/usr/share/doc/${PN} || die
+}
+
+pkg_postinst() {
+ elog "To run ARAnyM with AFROS type: aranym --config /usr/share/aranym/afros/config"
+}
diff --git a/app-emulation/aranym/aranym-0.9.16.ebuild b/app-emulation/aranym/aranym-0.9.16.ebuild
new file mode 100644
index 000000000000..42dc1347a456
--- /dev/null
+++ b/app-emulation/aranym/aranym-0.9.16.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Atari Running on Any Machine, a VM running Atari ST/TT/Falcon OS and TOS/GEM applications"
+HOMEPAGE="http://aranym.sourceforge.net/"
+SRC_URI="mirror://sourceforge/aranym/${P/-/_}.orig.tar.gz
+ mirror://sourceforge/aranym/afros812.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="+fullmmu +lilo opengl usbhost X"
+
+RDEPEND="games-emulation/emutos
+ media-libs/libsdl
+ opengl? ( virtual/opengl )
+ X? ( media-libs/libsdl[X] )"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+src_configure() {
+ filter-flags -mpowerpc-gfxopt
+
+ local myconf=""
+ if [[ ${ARCH} == x86 ]]; then
+ myconf="${myconf} --enable-jit-compiler"
+ fi
+
+ if ! use X; then
+ myconf="${myconf} --disable-nfjpeg --disable-nfclipbrd"
+ fi
+
+ econf \
+ $(use_enable X gui) \
+ $(use_enable opengl) \
+ $(use_enable fullmmu) \
+ $(use_enable lilo) \
+ $(use_enable usbhost) \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" INSTALL_PROGRAM="install" install
+
+ insinto /usr/share/${PN}
+ doins -r "${WORKDIR}"/afros
+
+ dodoc "${D}"/usr/share/doc/${PN}/*
+ rm -r "${D}"/usr/share/doc/${PN} || die
+}
+
+pkg_postinst() {
+ elog "To run ARAnyM with AFROS type: aranym --config /usr/share/aranym/afros/config"
+}
diff --git a/app-emulation/aranym/metadata.xml b/app-emulation/aranym/metadata.xml
new file mode 100644
index 000000000000..d60a27928e66
--- /dev/null
+++ b/app-emulation/aranym/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ ARAnyM is an acronym: Atari Running on Any Machine. It is a virtual
+ machine software for running the Atari ST/TT/Falcon operating systems
+ (TOS, FreeMiNT, MagiC and others) and TOS/GEM applications. In the
+ combination of ARAnyM/Linux and AFROS you basically get a completely
+ free TOS/MiNT compatible operating system running on any machine.
+ That's a break-through for all Atari users - now you can turn almost
+ any hardware into your familiar TOS/GEM system.
+ </longdescription>
+ <use>
+ <flag name="fullmmu">Enable full 68040 MMU emulation</flag>
+ <flag name="lilo">Enable Linux-m68k loader</flag>
+ <flag name="usbhost">Enable NatFeat USB</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">aranym</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/armv8-fast-model/Manifest b/app-emulation/armv8-fast-model/Manifest
new file mode 100644
index 000000000000..bf823aae7bd6
--- /dev/null
+++ b/app-emulation/armv8-fast-model/Manifest
@@ -0,0 +1 @@
+DIST FM000-KT-00035-r0p8-52rel06.tgz 9429294 SHA256 a011c7549029fe5c475f2d495b225b93317a44eb3da0f19f2825ad831c64d899 SHA512 349470432e8dba9e52eba88b577b22fdd9e3ce865288a3dc1540c58e1e10b4f2c14f084f7a4928993e4d1d3bc7cfbbf235f2575394254f09a8d845b7b2993f12 WHIRLPOOL e95ed1315f264ed82f2debd903ad69a6437798d88727e275285d1d06c5da1a5841b9955e93b6dbdc446ad652ef383a37cfe0f43a3888f23ec428a67a765e6ac7
diff --git a/app-emulation/armv8-fast-model/armv8-fast-model-0.8.5206.ebuild b/app-emulation/armv8-fast-model/armv8-fast-model-0.8.5206.ebuild
new file mode 100644
index 000000000000..da6bf36f74b7
--- /dev/null
+++ b/app-emulation/armv8-fast-model/armv8-fast-model-0.8.5206.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib
+
+MY_P="FM000-KT-00035-r${PV:0:1}p${PV:2:1}-${PV:0-4:2}rel${PV:0-2}"
+DESCRIPTION="emulator for a basic ARMv8 platform environment (for running bare metal & Linux)"
+HOMEPAGE="https://silver.arm.com/browse/FM00A"
+SRC_URI="https://silver.arm.com/download/Development_Tools/ESL:_Fast_Models/Fast_Models/${MY_P}/${MY_P}.tgz"
+
+LICENSE="ARM-FAST-MODEL"
+SLOT="0"
+KEYWORDS="-* ~amd64"
+IUSE="examples"
+RESTRICT="fetch strip"
+
+RDEPEND="sys-libs/glibc
+ sys-devel/gcc"
+
+S="${WORKDIR}/Foundation_v8pkg"
+
+QA_PREBUILT="
+ opt/${PN}/bin/Foundation_v8
+ opt/${PN}/*/lib*.so*
+"
+
+pkg_nofetch() {
+ einfo "Please visit this URL to download the package:"
+ einfo " ${SRC_URI}"
+ einfo "Then stick it into ${DISTDIR}"
+}
+
+src_install() {
+ into /opt/${PN}
+ pushd models/Linux64_GCC-4.1 >/dev/null
+ dobin Foundation_v8
+ dolib.so lib*.so*
+ popd >/dev/null
+
+ dodir /opt/bin
+ make_wrapper Foundation_v8 /opt/${PN}/bin/Foundation_v8 '' /opt/${PN}/$(get_libdir) /opt/bin
+
+ dodoc doc/*.{pdf,txt}
+ use examples && dodoc -r examples
+}
diff --git a/app-emulation/armv8-fast-model/metadata.xml b/app-emulation/armv8-fast-model/metadata.xml
new file mode 100644
index 000000000000..5454528f2093
--- /dev/null
+++ b/app-emulation/armv8-fast-model/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>arm</herd>
+</pkgmetadata>
diff --git a/app-emulation/bochs/Manifest b/app-emulation/bochs/Manifest
new file mode 100644
index 000000000000..d45da42ec9bc
--- /dev/null
+++ b/app-emulation/bochs/Manifest
@@ -0,0 +1 @@
+DIST bochs-2.6.tar.gz 4212828 SHA256 65123e44a6d2c1148d741da025d16311b9ccd600ef268b911aba73c67eaf86e1 SHA512 506e7816c96caf56005c74df20d243aef111dded41b65dbf440844af3d49bc5987af333ef65a53f90de9fbdfc4d18e3e23fff1157ccb08bd95afff8fdbbcfba3 WHIRLPOOL 4598ad37b6792a001e3301770318c6a6d53bda98dc9a21337db4659573d8bf4ec64cf3376386f5e298dc25813c9bcc5e29b7a82383b96c1e2f82c77a75877001
diff --git a/app-emulation/bochs/bochs-2.6.ebuild b/app-emulation/bochs/bochs-2.6.ebuild
new file mode 100644
index 000000000000..78fef9536d8c
--- /dev/null
+++ b/app-emulation/bochs/bochs-2.6.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+WX_GTK_VER=2.8
+
+inherit eutils wxwidgets
+
+DESCRIPTION="LGPL-ed pc emulator"
+HOMEPAGE="http://bochs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/bochs/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+IUSE="3dnow avx debugger doc gdb ncurses readline svga sdl +smp wxwidgets vnc X +x86-64"
+REQUIRED_USE="avx? ( x86-64 )
+ gdb? ( !debugger !smp )
+ debugger? ( !gdb )"
+
+RDEPEND="X? ( x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXpm )
+ sdl? ( media-libs/libsdl )
+ svga? ( media-libs/svgalib )
+ wxwidgets? ( x11-libs/wxGTK:2.8[X] )
+ readline? ( sys-libs/readline )
+ ncurses? ( sys-libs/ncurses )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ X? ( x11-proto/xproto )
+ sys-apps/sed
+ >=app-text/opensp-1.5"
+
+src_prepare() {
+ sed -i "s:^docdir.*:docdir = ${EPREFIX}/usr/share/doc/${PF}:" \
+ Makefile.in || die
+}
+
+src_configure() {
+ use wxwidgets && \
+ need-wxwidgets unicode
+
+ econf \
+ --enable-all-optimizations \
+ --enable-idle-hack \
+ --enable-cdrom \
+ --enable-clgd54xx \
+ --enable-cpu-level=6 \
+ --enable-disasm \
+ --enable-e1000 \
+ --enable-gameport \
+ --enable-iodebug \
+ --enable-monitor-mwait \
+ --enable-ne2000 \
+ --enable-plugins \
+ --enable-pci \
+ --enable-pcidev \
+ --enable-pnic \
+ --enable-raw-serial \
+ --enable-sb16=linux \
+ --enable-usb \
+ --enable-usb-ohci \
+ --enable-usb-xhci \
+ --prefix=/usr \
+ --with-nogui \
+ $(use_enable 3dnow) \
+ $(use_enable avx) \
+ $(use_enable debugger) \
+ $(use_enable doc docbook) \
+ $(use_enable gdb gdb-stub) \
+ $(use_enable readline) \
+ $(use_enable smp) \
+ $(use_enable x86-64) \
+ $(use_with ncurses term) \
+ $(use_with sdl) \
+ $(use_with svga) \
+ $(use_with vnc rfb) \
+ $(use_with wxwidgets wx) \
+ $(use_with X x) \
+ $(use_with X x11) \
+ ${myconf}
+}
diff --git a/app-emulation/bochs/metadata.xml b/app-emulation/bochs/metadata.xml
new file mode 100644
index 000000000000..2afe2cec494c
--- /dev/null
+++ b/app-emulation/bochs/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>lu_zero@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="3dnow">Enable support for emulating 3DNow! instructions (incomplete)</flag>
+ <flag name="debugger">Enable the bochs debugger</flag>
+ <flag name="avx">Enable support for emulating Advanced Vector Extensions (AVX)</flag>
+ <flag name="debugger">Enable debugger (slows down emulation)</flag>
+ <flag name="gdb">Enable support for the remote GDB stub</flag>
+ <flag name="x86-64">Enable support for emulation of 64-bit CPUs</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">bochs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/cloud-init/Manifest b/app-emulation/cloud-init/Manifest
new file mode 100644
index 000000000000..93c02cdc8f48
--- /dev/null
+++ b/app-emulation/cloud-init/Manifest
@@ -0,0 +1,2 @@
+DIST cloud-init-0.7.5.tar.gz 503717 SHA256 a92bb83809c139a7db378916414c18b0819e306852d6c60dd89388868857ed33 SHA512 79e1e4a9e1130a3a9deb0482278215baf5ed41e02beebed0a2c6fac4e215340a9537158bd259758a2e074f334c0c0b9e7b936c23eeb9c848c67f7e7835cf0f5d WHIRLPOOL 7d92a0e1b6a3faf550bc442b02c117280c47d160e7e318d9fb859d6d8b59a0ef947d057dfb615bd925420a25ca28852742ee87ffd6066664faf640ca53a13073
+DIST cloud-init-0.7.6.tar.gz 515670 SHA256 9e8fd22eb7f6e40ae6a5f66173ddc3cc18f65ee406c460a728092b37db2f3ed7 SHA512 aa2397328afda8e77ed6d642e7642f41a4b4b5bcd3d0e87056aa8c88b56624ec65c57cfc66b0d13ccc235f1840baf1d577316974902a0439cf2f2eb0f8eef36d WHIRLPOOL 639a556e51b4b4b180951f9e481f9a0dcd45067d1d5760ce7e871ceea8bbb4e195258d96273d3ef88c7e2f2520318e9172c3ad0cb23d6ad0ae1835e17087e3a5
diff --git a/app-emulation/cloud-init/cloud-init-0.7.5-r1.ebuild b/app-emulation/cloud-init/cloud-init-0.7.5-r1.ebuild
new file mode 100644
index 000000000000..2b8007b430dc
--- /dev/null
+++ b/app-emulation/cloud-init/cloud-init-0.7.5-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils multilib
+
+DESCRIPTION="Package provides configuration and customization of cloud instance"
+HOMEPAGE="https://launchpad.net/cloud-init"
+SRC_URI="http://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND="dev-python/cheetah[${PYTHON_USEDEP}]
+ >=dev-python/prettytable-0.7.1[${PYTHON_USEDEP}]
+ dev-python/oauth[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/jsonpatch[${PYTHON_USEDEP}]"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( ${RDEPEND}
+ sys-apps/iproute2 )"
+
+PATCHES=( "${FILESDIR}"/${P}-tests-exclude.patch )
+
+#python_prepare_all() {
+# distutils-r_python_prepare_all
+#}
+
+python_test() {
+ # These tests are not broken but expect to locate an installed exe file
+ # other than where a gentoo system installs it; (/bin/ip sought in /sbin)
+ # See cloudinit/sources/DataSourceOpenNebula.py for possible patching
+ sed -e 's:test_hostname:_&:' \
+ -e 's:test_network_interfaces:_&:' \
+ -i tests/unittests/test_datasource/test_opennebula.py
+ emake test
+}
+
+python_install() {
+ distutils-r1_python_install
+ for svc in config final init init-local; do
+ newinitd "${WORKDIR}/${P}/sysvinit/gentoo/cloud-${svc}" "cloud-${svc}"
+ done
+}
diff --git a/app-emulation/cloud-init/cloud-init-0.7.5-r2.ebuild b/app-emulation/cloud-init/cloud-init-0.7.5-r2.ebuild
new file mode 100644
index 000000000000..6d04f898d9c0
--- /dev/null
+++ b/app-emulation/cloud-init/cloud-init-0.7.5-r2.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=TRUE
+
+inherit distutils-r1 eutils multilib systemd
+
+DESCRIPTION="Cloud instance initialization"
+HOMEPAGE="http://launchpad.net/cloud-init"
+SRC_URI="http://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+CDEPEND="
+ dev-python/cheetah[${PYTHON_USEDEP}]
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/jsonpatch[${PYTHON_USEDEP}]
+ dev-python/oauth[${PYTHON_USEDEP}]
+ >=dev-python/prettytable-0.7.1[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+"
+DEPEND="
+ test? (
+ ${CDEPEND}
+ >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
+ dev-python/mocker[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
+ dev-python/pep8[${PYTHON_USEDEP}]
+ dev-python/pyflakes[${PYTHON_USEDEP}]
+ dev-python/pylint[${PYTHON_USEDEP}]
+ sys-apps/iproute2
+ )
+"
+RDEPEND="
+ ${CDEPEND}
+ virtual/logger
+"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/${P}-tests-exclude.patch
+ )
+
+ distutils-r1_python_prepare_all
+
+ # Skip SmartOS tests since they don't generally apply and don't skip based
+ # on environment. Documented in bug #511384.
+ rm tests/unittests/test_datasource/test_smartos.py
+}
+
+python_test() {
+ # These tests are not broken but expect to locate an installed exe file
+ # other than where a gentoo system installs it; (/bin/ip sought in /sbin)
+ # See cloudinit/sources/DataSourceOpenNebula.py for possible patching
+ sed \
+ -e 's:test_hostname:_&:' \
+ -e 's:test_network_interfaces:_&:' \
+ -i tests/unittests/test_datasource/test_opennebula.py
+
+ emake test
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ doinitd "${S}"/sysvinit/gentoo/cloud-config
+ doinitd "${S}"/sysvinit/gentoo/cloud-final
+ doinitd "${S}"/sysvinit/gentoo/cloud-init
+ doinitd "${S}"/sysvinit/gentoo/cloud-init-local
+
+ systemd_dounit "${S}"/systemd/cloud-config.service
+ systemd_dounit "${S}"/systemd/cloud-config.target
+ systemd_dounit "${S}"/systemd/cloud-final.service
+ systemd_dounit "${S}"/systemd/cloud-init-local.service
+ systemd_dounit "${S}"/systemd/cloud-init.service
+}
diff --git a/app-emulation/cloud-init/cloud-init-0.7.5-r3.ebuild b/app-emulation/cloud-init/cloud-init-0.7.5-r3.ebuild
new file mode 100644
index 000000000000..a30aedd0c2f9
--- /dev/null
+++ b/app-emulation/cloud-init/cloud-init-0.7.5-r3.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=TRUE
+
+inherit distutils-r1 eutils multilib systemd
+
+DESCRIPTION="Cloud instance initialization"
+HOMEPAGE="http://launchpad.net/cloud-init"
+SRC_URI="http://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+CDEPEND="
+ dev-python/cheetah[${PYTHON_USEDEP}]
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/jsonpatch[${PYTHON_USEDEP}]
+ dev-python/oauth[${PYTHON_USEDEP}]
+ >=dev-python/prettytable-0.7.1[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+"
+DEPEND="
+ test? (
+ ${CDEPEND}
+ >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
+ dev-python/mocker[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
+ dev-python/pep8[${PYTHON_USEDEP}]
+ dev-python/pyflakes[${PYTHON_USEDEP}]
+ dev-python/pylint[${PYTHON_USEDEP}]
+ sys-apps/iproute2
+ )
+"
+RDEPEND="
+ ${CDEPEND}
+ virtual/logger
+"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/${P}-tests-exclude.patch
+ )
+
+ distutils-r1_python_prepare_all
+
+ # Skip SmartOS tests since they don't generally apply and don't skip based
+ # on environment. Documented in bug #511384.
+ rm tests/unittests/test_datasource/test_smartos.py
+}
+
+python_test() {
+ # These tests are not broken but expect to locate an installed exe file
+ # other than where a gentoo system installs it; (/bin/ip sought in /sbin)
+ # See cloudinit/sources/DataSourceOpenNebula.py for possible patching
+ sed \
+ -e 's:test_hostname:_&:' \
+ -e 's:test_network_interfaces:_&:' \
+ -i tests/unittests/test_datasource/test_opennebula.py
+
+ emake test
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ doinitd "${S}"/sysvinit/gentoo/cloud-config
+ doinitd "${S}"/sysvinit/gentoo/cloud-final
+ doinitd "${S}"/sysvinit/gentoo/cloud-init
+ doinitd "${S}"/sysvinit/gentoo/cloud-init-local
+
+ systemd_dounit "${S}"/systemd/cloud-config.service
+ systemd_dounit "${S}"/systemd/cloud-config.target
+ systemd_dounit "${S}"/systemd/cloud-final.service
+ systemd_dounit "${S}"/systemd/cloud-init-local.service
+ systemd_dounit "${S}"/systemd/cloud-init.service
+
+ rm /etc/cloud/cloud.cfg
+ insinto /etc/cloud
+ doins "${FILESDIR}/cloud.cfg"
+}
diff --git a/app-emulation/cloud-init/cloud-init-0.7.6-r1.ebuild b/app-emulation/cloud-init/cloud-init-0.7.6-r1.ebuild
new file mode 100644
index 000000000000..e6f4ac9b48c7
--- /dev/null
+++ b/app-emulation/cloud-init/cloud-init-0.7.6-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils multilib systemd
+
+DESCRIPTION="EC2 initialisation magic"
+HOMEPAGE="http://launchpad.net/cloud-init"
+SRC_URI="http://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+CDEPEND="
+ dev-python/cheetah[${PYTHON_USEDEP}]
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/jinja[${PYTHON_USEDEP}]
+ dev-python/jsonpatch[${PYTHON_USEDEP}]
+ dev-python/oauth[${PYTHON_USEDEP}]
+ dev-python/prettytable[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+"
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ ${CDEPEND}
+ >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
+ dev-python/mocker[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
+ ~dev-python/pep8-1.5.7[${PYTHON_USEDEP}]
+ dev-python/pyflakes[${PYTHON_USEDEP}]
+ sys-apps/iproute2
+ )
+"
+RDEPEND="
+ ${CDEPEND}
+ sys-apps/gptfdisk
+ virtual/logger
+"
+
+python_prepare_all() {
+ # Note: Gentoo places ip in /sbin/ not /bin/
+ ebegin 'patching cloudinit/sources/DataSourceOpenNebula.py'
+ sed \
+ -e '438s/sbin/bin/' \
+ -i cloudinit/sources/DataSourceOpenNebula.py
+ STATUS=$?
+ eend ${STATUS}
+ [[ ${STATUS} -gt 0 ]] && die
+
+ # https://bugs.launchpad.net/cloud-init/+bug/1380424
+ ebegin 'patching tests/unittests/test_distros/test_netconfig.py'
+ sed \
+ -e '177s/test_simple_write_freebsd/_&/' \
+ -i tests/unittests/test_distros/test_netconfig.py
+ STATUS=$?
+ eend ${STATUS}
+ [[ ${STATUS} -gt 0 ]] && die
+
+ # Note Gentoo installs its own RC files
+ ebegin 'patching setup.py'
+ sed \
+ -e "144 s/'tests'/'tests.*', &/" \
+ -e '163,167 d' \
+ -i setup.py
+ STATUS=$?
+ eend ${STATUS}
+ [[ ${STATUS} -gt 0 ]] && die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ emake test
+}
+
+python_install_all() {
+ keepdir /etc/cloud
+
+ distutils-r1_python_install_all
+
+ doinitd "${S}"/sysvinit/gentoo/cloud-config
+ doinitd "${S}"/sysvinit/gentoo/cloud-final
+ doinitd "${S}"/sysvinit/gentoo/cloud-init
+ doinitd "${S}"/sysvinit/gentoo/cloud-init-local
+ insinto /etc/cloud/templates
+ doins "${FILESDIR}/hosts.gentoo.tmpl"
+ exeinto /usr/bin
+ doexe "${FILESDIR}/growpart"
+ insinto /etc/cloud
+ doins "${FILESDIR}/cloud.cfg"
+
+ systemd_dounit "${S}"/systemd/cloud-config.service
+ systemd_dounit "${S}"/systemd/cloud-config.target
+ systemd_dounit "${S}"/systemd/cloud-final.service
+ systemd_dounit "${S}"/systemd/cloud-init-local.service
+ systemd_dounit "${S}"/systemd/cloud-init.service
+}
diff --git a/app-emulation/cloud-init/cloud-init-0.7.6.ebuild b/app-emulation/cloud-init/cloud-init-0.7.6.ebuild
new file mode 100644
index 000000000000..07a19188176a
--- /dev/null
+++ b/app-emulation/cloud-init/cloud-init-0.7.6.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils multilib systemd
+
+DESCRIPTION="EC2 initialisation magic"
+HOMEPAGE="http://launchpad.net/cloud-init"
+SRC_URI="http://launchpad.net/${PN}/trunk/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="test"
+
+CDEPEND="
+ dev-python/cheetah[${PYTHON_USEDEP}]
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/jinja[${PYTHON_USEDEP}]
+ dev-python/jsonpatch[${PYTHON_USEDEP}]
+ dev-python/oauth[${PYTHON_USEDEP}]
+ dev-python/prettytable[${PYTHON_USEDEP}]
+ dev-python/pyserial[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+"
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ ${CDEPEND}
+ >=dev-python/httpretty-0.7.1[${PYTHON_USEDEP}]
+ dev-python/mocker[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
+ ~dev-python/pep8-1.5.7[${PYTHON_USEDEP}]
+ dev-python/pyflakes[${PYTHON_USEDEP}]
+ sys-apps/iproute2
+ )
+"
+RDEPEND="
+ ${CDEPEND}
+ virtual/logger
+"
+
+python_prepare_all() {
+ # Note: Gentoo places ip in /sbin/ not /bin/
+ ebegin 'patching cloudinit/sources/DataSourceOpenNebula.py'
+ sed \
+ -e '438s/sbin/bin/' \
+ -i cloudinit/sources/DataSourceOpenNebula.py
+ STATUS=$?
+ eend ${STATUS}
+ [[ ${STATUS} -gt 0 ]] && die
+
+ # https://bugs.launchpad.net/cloud-init/+bug/1380424
+ ebegin 'patching tests/unittests/test_distros/test_netconfig.py'
+ sed \
+ -e '177s/test_simple_write_freebsd/_&/' \
+ -i tests/unittests/test_distros/test_netconfig.py
+ STATUS=$?
+ eend ${STATUS}
+ [[ ${STATUS} -gt 0 ]] && die
+
+ # Note Gentoo installs its own RC files
+ ebegin 'patching setup.py'
+ sed \
+ -e "144 s/'tests'/'tests.*', &/" \
+ -e '163,167 d' \
+ -i setup.py
+ STATUS=$?
+ eend ${STATUS}
+ [[ ${STATUS} -gt 0 ]] && die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ emake test
+}
+
+python_install_all() {
+ keepdir /etc/cloud
+
+ distutils-r1_python_install_all
+
+ doinitd "${S}"/sysvinit/gentoo/cloud-config
+ doinitd "${S}"/sysvinit/gentoo/cloud-final
+ doinitd "${S}"/sysvinit/gentoo/cloud-init
+ doinitd "${S}"/sysvinit/gentoo/cloud-init-local
+
+ systemd_dounit "${S}"/systemd/cloud-config.service
+ systemd_dounit "${S}"/systemd/cloud-config.target
+ systemd_dounit "${S}"/systemd/cloud-final.service
+ systemd_dounit "${S}"/systemd/cloud-init-local.service
+ systemd_dounit "${S}"/systemd/cloud-init.service
+}
diff --git a/app-emulation/cloud-init/files/cloud-init-0.7.5-tests-exclude.patch b/app-emulation/cloud-init/files/cloud-init-0.7.5-tests-exclude.patch
new file mode 100644
index 000000000000..225f1a1d76c0
--- /dev/null
+++ b/app-emulation/cloud-init/files/cloud-init-0.7.5-tests-exclude.patch
@@ -0,0 +1,12 @@
+diff -ur cloud-init-0.7.5.orig/setup.py cloud-init-0.7.5/setup.py
+--- setup.py 2014-04-02 02:26:07.000000000 +0800
++++ setup.py 2014-05-01 23:38:15.848225975 +0800
+@@ -114,7 +114,7 @@
+ author='Scott Moser',
+ author_email='scott.moser@canonical.com',
+ url='http://launchpad.net/cloud-init/',
+- packages=setuptools.find_packages(exclude=['tests']),
++ packages=setuptools.find_packages(exclude=['tests','tests.*']),
+ scripts=['bin/cloud-init',
+ 'tools/cloud-init-per',
+ ],
diff --git a/app-emulation/cloud-init/files/cloud.cfg b/app-emulation/cloud-init/files/cloud.cfg
new file mode 100644
index 000000000000..d62e3a22241b
--- /dev/null
+++ b/app-emulation/cloud-init/files/cloud.cfg
@@ -0,0 +1,79 @@
+# The top level settings are used as module
+# and system configuration.
+
+# A set of users which may be applied and/or used by various modules
+# when a 'default' entry is found it will reference the 'default_user'
+# from the distro configuration specified below
+users:
+ - default
+
+# If this is set, 'root' will not be able to ssh in and they
+# will get a message to login instead as the above $user (ubuntu)
+disable_root: true
+ssh_pwauth: false
+
+# This will cause the set+update hostname module to not operate (if true)
+# preserve_hostname: false
+
+syslog_fix_perms: root:root
+
+ssh_deletekeys: false
+ssh_genkeytypes: [rsa, dsa]
+
+cloud_init_modules:
+ - seed_random
+ - bootcmd
+ - write-files
+ - growpart
+ - resizefs
+ - set_hostname
+ - update_hostname
+ - update_etc_hosts
+ - ca-certs
+ - users-groups
+ - ssh
+
+cloud_config_modules:
+ - disk_setup
+ - mounts
+ - ssh-import-id
+ - set-passwords
+ - timezone
+ - puppet
+ - chef
+ - salt-minion
+ - mcollective
+ - disable-ec2-metadata
+ - runcmd
+
+cloud_final_modules:
+ - scripts-vendor
+ - scripts-per-once
+ - scripts-per-boot
+ - scripts-per-instance
+ - scripts-user
+ - ssh-authkey-fingerprints
+ - keys-to-console
+ - phone-home
+ - final-message
+ - power-state-change
+
+# System and/or distro specific settings
+# (not accessible to handlers/transforms)
+system_info:
+ # This will affect which distro class gets used
+ distro: gentoo
+ # Default user name + that default users groups (if added/used)
+ default_user:
+ name: gentoo
+ lock_passwd: True
+ gecos: Gentoo
+ groups: [users, wheel]
+ primary_group: users
+ no-user-group: true
+ sudo: ["ALL=(ALL) NOPASSWD:ALL"]
+ shell: /bin/bash
+ # Other config here will be given to the distro class and/or path classes
+ paths:
+ cloud_dir: /var/lib/cloud/
+ templates_dir: /etc/cloud/templates/
diff --git a/app-emulation/cloud-init/files/growpart b/app-emulation/cloud-init/files/growpart
new file mode 100755
index 000000000000..4b67d8b90822
--- /dev/null
+++ b/app-emulation/cloud-init/files/growpart
@@ -0,0 +1,778 @@
+#!/bin/sh
+# Copyright (C) 2011 Canonical Ltd.
+# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
+#
+# Authors: Scott Moser <smoser@canonical.com>
+# Juerg Haefliger <juerg.haefliger@hp.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, version 3 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# the fudge factor. if within this many bytes dont bother
+FUDGE=${GROWPART_FUDGE:-$((1024*1024))}
+TEMP_D=""
+RESTORE_FUNC=""
+RESTORE_HUMAN=""
+VERBOSITY=0
+DISK=""
+PART=""
+PT_UPDATE=false
+DRY_RUN=0
+
+SFDISK_VERSION=""
+SFDISK_2_26="22600"
+MBR_BACKUP=""
+GPT_BACKUP=""
+_capture=""
+
+error() {
+ echo "$@" 1>&2
+}
+
+fail() {
+ [ $# -eq 0 ] || echo "FAILED:" "$@"
+ exit 2
+}
+
+nochange() {
+ echo "NOCHANGE:" "$@"
+ exit 1
+}
+
+changed() {
+ echo "CHANGED:" "$@"
+ exit 0
+}
+
+change() {
+ echo "CHANGE:" "$@"
+ exit 0
+}
+
+cleanup() {
+ if [ -n "${RESTORE_FUNC}" ]; then
+ error "***** WARNING: Resize failed, attempting to revert ******"
+ if ${RESTORE_FUNC} ; then
+ error "***** Appears to have gone OK ****"
+ else
+ error "***** FAILED! ******"
+ if [ -n "${RESTORE_HUMAN}" -a -f "${RESTORE_HUMAN}" ]; then
+ error "**** original table looked like: ****"
+ cat "${RESTORE_HUMAN}" 1>&2
+ else
+ error "We seem to have not saved the partition table!"
+ fi
+ fi
+ fi
+ [ -z "${TEMP_D}" -o ! -d "${TEMP_D}" ] || rm -Rf "${TEMP_D}"
+}
+
+debug() {
+ local level=${1}
+ shift
+ [ "${level}" -gt "${VERBOSITY}" ] && return
+ if [ "${DEBUG_LOG}" ]; then
+ echo "$@" >>"${DEBUG_LOG}"
+ else
+ error "$@"
+ fi
+}
+
+debugcat() {
+ local level="$1"
+ shift;
+ [ "${level}" -gt "$VERBOSITY" ] && return
+ if [ "${DEBUG_LOG}" ]; then
+ cat "$@" >>"${DEBUG_LOG}"
+ else
+ cat "$@" 1>&2
+ fi
+}
+
+mktemp_d() {
+ # just a mktemp -d that doens't need mktemp if its not there.
+ _RET=$(mktemp -d "${TMPDIR:-/tmp}/${0##*/}.XXXXXX" 2>/dev/null) &&
+ return
+ _RET=$(umask 077 && t="${TMPDIR:-/tmp}/${0##*/}.$$" &&
+ mkdir "${t}" && echo "${t}")
+ return
+}
+
+Usage() {
+ cat <<EOF
+${0##*/} disk partition
+ rewrite partition table so that partition takes up all the space it can
+ options:
+ -h | --help print Usage and exit
+ --fudge F if part could be resized, but change would be
+ less than 'F' bytes, do not resize (default: ${FUDGE})
+ -N | --dry-run only report what would be done, show new 'sfdisk -d'
+ -v | --verbose increase verbosity / debug
+ -u | --update R update the the kernel partition table info after growing
+ this requires kernel support and 'partx --update'
+ R is one of:
+ - 'auto' : [default] update partition if possible
+ - 'force' : try despite sanity checks (fail on failure)
+ - 'off' : do not attempt
+ - 'on' : fail if sanity checks indicate no support
+
+ Example:
+ - ${0##*/} /dev/sda 1
+ Resize partition 1 on /dev/sda
+EOF
+}
+
+bad_Usage() {
+ Usage 1>&2
+ error "$@"
+ exit 2
+}
+
+sfdisk_restore_legacy() {
+ sfdisk --no-reread "${DISK}" -I "${MBR_BACKUP}"
+}
+
+sfdisk_restore() {
+ # files are named: sfdisk-<device>-<offset>.bak
+ local f="" offset="" fails=0
+ for f in "${MBR_BACKUP}"*.bak; do
+ [ -f "$f" ] || continue
+ offset=${f##*-}
+ offset=${offset%.bak}
+ [ "$offset" = "$f" ] && {
+ error "WARN: confused by file $f";
+ continue;
+ }
+ dd "if=$f" "of=${DISK}" seek=$(($offset)) bs=1 conv=notrunc ||
+ { error "WARN: failed restore from $f"; fails=$(($fails+1)); }
+ done
+ return $fails
+}
+
+sfdisk_worked_but_blkrrpart_failed() {
+ local ret="$1" output="$2"
+ # exit code found was just 1, but dont insist on that
+ #[ $ret -eq 1 ] || return 1
+ # Successfully wrote the new partition table
+ grep -qi "Success.* wrote.* new.* partition" "$output" &&
+ grep -qi "BLKRRPART: Device or resource busy" "$output"
+ return
+}
+
+get_sfdisk_version() {
+ # set SFDISK_VERSION to MAJOR*10000+MINOR*100+MICRO
+ local out oifs="$IFS" ver=""
+ [ -n "$SFDISK_VERSION" ] && return 0
+ # expected output: sfdisk from util-linux 2.25.2
+ out=$(sfdisk --version) ||
+ { error "failed to get sfdisk version"; return 1; }
+ set -- $out
+ ver=$4
+ case "$ver" in
+ [0-9]*.[0-9]*.[0-9]|[0-9].[0-9]*)
+ IFS="."; set -- $ver; IFS="$oifs"
+ SFDISK_VERSION=$(($1*10000+$2*100+${3:-0}))
+ return 0;;
+ *) error "unexpected output in sfdisk --version [$out]"
+ return 1;;
+ esac
+}
+
+resize_sfdisk() {
+ local humanpt="${TEMP_D}/recovery"
+ local mbr_backup="${TEMP_D}/orig.save"
+ local restore_func=""
+ local format="$1"
+
+ local change_out=${TEMP_D}/change.out
+ local dump_out=${TEMP_D}/dump.out
+ local new_out=${TEMP_D}/new.out
+ local dump_mod=${TEMP_D}/dump.mod
+ local tmp="${TEMP_D}/tmp.out"
+ local err="${TEMP_D}/err.out"
+ local mbr_max_512="4294967296"
+
+ local pt_start pt_size pt_end max_end new_size change_info dpart
+ local sector_num sector_size disk_size tot out
+
+ rqe sfd_list sfdisk --list --unit=S "$DISK" >"$tmp" ||
+ fail "failed: sfdisk --list $DISK"
+ if [ "${SFDISK_VERSION}" -lt ${SFDISK_2_26} ]; then
+ # exected output contains: Units: sectors of 512 bytes, ...
+ out=$(awk '$1 == "Units:" && $5 ~ /bytes/ { print $4 }' "$tmp") ||
+ fail "failed to read sfdisk output"
+ if [ -z "$out" ]; then
+ error "WARN: sector size not found in sfdisk output, assuming 512"
+ sector_size=512
+ else
+ sector_size="$out"
+ fi
+ local _w _cyl _w1 _heads _w2 sectors _w3 t s
+ # show-size is in units of 1024 bytes (same as /proc/partitions)
+ t=$(sfdisk --show-size "${DISK}") ||
+ fail "failed: sfdisk --show-size $DISK"
+ disk_size=$((t*1024))
+ sector_num=$(($disk_size/$sector_size))
+ msg="disk size '$disk_size' not evenly div by sector size '$sector_size'"
+ [ "$((${disk_size}%${sector_size}))" -eq 0 ] ||
+ error "WARN: $msg"
+ restore_func=sfdisk_restore_legacy
+ else
+ # --list first line output:
+ # Disk /dev/vda: 20 GiB, 21474836480 bytes, 41943040 sectors
+ local _x
+ read _x _x _x _x disk_size _x sector_num _x < "$tmp"
+ sector_size=$((disk_size/$sector_num))
+ restore_func=sfdisk_restore
+ fi
+
+ debug 1 "$sector_num sectors of $sector_size. total size=${disk_size} bytes"
+ [ $(($disk_size/512)) -gt $mbr_max_512 ] &&
+ debug 1 "WARN: disk is larger than 2TB. additional space will go unused."
+
+ rqe sfd_dump sfdisk --unit=S --dump "${DISK}" >"${dump_out}" ||
+ fail "failed to dump sfdisk info for ${DISK}"
+ RESTORE_HUMAN="$dump_out"
+
+ {
+ echo "## sfdisk --unit=S --dump ${DISK}"
+ cat "${dump_out}"
+ } >"$humanpt"
+
+ [ $? -eq 0 ] || fail "failed to save sfdisk -d output"
+ RESTORE_HUMAN="$humanpt"
+
+ debugcat 1 "$humanpt"
+
+ sed -e 's/,//g; s/start=/start /; s/size=/size /' "${dump_out}" \
+ >"${dump_mod}" ||
+ fail "sed failed on dump output"
+
+ dpart="${DISK}${PART}" # disk and partition number
+ if [ -b "${DISK}p${PART}" -a "${DISK%[0-9]}" != "${DISK}" ]; then
+ # for block devices that end in a number (/dev/nbd0)
+ # the partition is "<name>p<partition_number>" (/dev/nbd0p1)
+ dpart="${DISK}p${PART}"
+ elif [ "${DISK#/dev/loop[0-9]}" != "${DISK}" ]; then
+ # for /dev/loop devices, sfdisk output will be <name>p<number>
+ # format also, even though there is not a device there.
+ dpart="${DISK}p${PART}"
+ fi
+
+ pt_start=$(awk '$1 == pt { print $4 }' "pt=${dpart}" <"${dump_mod}") &&
+ pt_size=$(awk '$1 == pt { print $6 }' "pt=${dpart}" <"${dump_mod}") &&
+ [ -n "${pt_start}" -a -n "${pt_size}" ] &&
+ pt_end=$((${pt_size}+${pt_start})) ||
+ fail "failed to get start and end for ${dpart} in ${DISK}"
+
+ # find the minimal starting location that is >= pt_end
+ max_end=$(awk '$3 == "start" { if($4 >= pt_end && $4 < min)
+ { min = $4 } } END { printf("%s\n",min); }' \
+ min=${sector_num} pt_end=${pt_end} "${dump_mod}") &&
+ [ -n "${max_end}" ] ||
+ fail "failed to get max_end for partition ${PART}"
+
+ mbr_max_sectors=$((mbr_max_512*$((sector_size/512))))
+ if [ "$max_end" -gt "$mbr_max_sectors" ]; then
+ max_end=$mbr_max_sectors
+ fi
+
+ if [ "$format" = "gpt" ]; then
+ # sfdisk respects 'last-lba' in input, and complains about
+ # partitions that go past that. without it, it does the right thing.
+ sed -i '/^last-lba:/d' "$dump_out" ||
+ fail "failed to remove last-lba from output"
+ fi
+
+ local gpt_second_size="33"
+ if [ "${max_end}" -gt "$((${sector_num}-${gpt_second_size}))" ]; then
+ # if mbr allow subsequent conversion to gpt without shrinking the
+ # partition. safety net at cost of 33 sectors, seems reasonable.
+ # if gpt, we can't write there anyway.
+ debug 1 "padding ${gpt_second_size} sectors for gpt secondary header"
+ max_end=$((${sector_num}-${gpt_second_size}))
+ fi
+
+ debug 1 "max_end=${max_end} tot=${sector_num} pt_end=${pt_end}" \
+ "pt_start=${pt_start} pt_size=${pt_size}"
+ [ $((${pt_end})) -eq ${max_end} ] &&
+ nochange "partition ${PART} is size ${pt_size}. it cannot be grown"
+ [ $((${pt_end}+(${FUDGE}/$sector_size))) -gt ${max_end} ] &&
+ nochange "partition ${PART} could only be grown by" \
+ "$((${max_end}-${pt_end})) [fudge=$((${FUDGE}/$sector_size))]"
+
+ # now, change the size for this partition in ${dump_out} to be the
+ # new size
+ new_size=$((${max_end}-${pt_start}))
+ sed "\|^\s*${dpart} |s/${pt_size},/${new_size},/" "${dump_out}" \
+ >"${new_out}" ||
+ fail "failed to change size in output"
+
+ change_info="partition=${PART} start=${pt_start} old: size=${pt_size} end=${pt_end} new: size=${new_size},end=${max_end}"
+ if [ ${DRY_RUN} -ne 0 ]; then
+ echo "CHANGE: ${change_info}"
+ {
+ echo "# === old sfdisk -d ==="
+ cat "${dump_out}"
+ echo "# === new sfdisk -d ==="
+ cat "${new_out}"
+ } 1>&2
+ exit 0
+ fi
+
+ MBR_BACKUP="${mbr_backup}"
+ LANG=C sfdisk --no-reread "${DISK}" --force \
+ -O "${mbr_backup}" <"${new_out}" >"${change_out}" 2>&1
+ ret=$?
+ [ $ret -eq 0 ] || RESTORE_FUNC="${restore_func}"
+
+ if [ $ret -eq 0 ]; then
+ :
+ elif $PT_UPDATE &&
+ sfdisk_worked_but_blkrrpart_failed "$ret" "${change_out}"; then
+ # if the command failed, but it looks like only because
+ # the device was busy and we have pt_update, then go on
+ debug 1 "sfdisk failed, but likely only because of blkrrpart"
+ else
+ error "attempt to resize ${DISK} failed. sfdisk output below:"
+ sed 's,^,| ,' "${change_out}" 1>&2
+ fail "failed to resize"
+ fi
+
+ rq pt_update pt_update "$DISK" "$PART" ||
+ fail "pt_resize failed"
+
+ RESTORE_FUNC=""
+
+ changed "${change_info}"
+
+ # dump_out looks something like:
+ ## partition table of /tmp/out.img
+ #unit: sectors
+ #
+ #/tmp/out.img1 : start= 1, size= 48194, Id=83
+ #/tmp/out.img2 : start= 48195, size= 963900, Id=83
+ #/tmp/out.img3 : start= 1012095, size= 305235, Id=82
+ #/tmp/out.img4 : start= 1317330, size= 771120, Id= 5
+ #/tmp/out.img5 : start= 1317331, size= 642599, Id=83
+ #/tmp/out.img6 : start= 1959931, size= 48194, Id=83
+ #/tmp/out.img7 : start= 2008126, size= 80324, Id=83
+}
+
+gpt_restore() {
+ sgdisk -l "${GPT_BACKUP}" "${DISK}"
+}
+
+resize_sgdisk() {
+ GPT_BACKUP="${TEMP_D}/pt.backup"
+
+ local pt_info="${TEMP_D}/pt.info"
+ local pt_pretend="${TEMP_D}/pt.pretend"
+ local pt_data="${TEMP_D}/pt.data"
+ local out="${TEMP_D}/out"
+
+ local dev="disk=${DISK} partition=${PART}"
+
+ local pt_start pt_end pt_size last pt_max code guid name new_size
+ local old new change_info sector_size
+
+ # Dump the original partition information and details to disk. This is
+ # used in case something goes wrong and human interaction is required
+ # to revert any changes.
+ rqe sgd_info sgdisk "--info=${PART}" --print "${DISK}" >"${pt_info}" ||
+ fail "${dev}: failed to dump original sgdisk info"
+ RESTORE_HUMAN="${pt_info}"
+
+ sector_size=$(awk '$0 ~ /^Logical sector size:.*bytes/ { print $4 }' \
+ "$pt_info") && [ -n "$sector_size" ] || {
+ sector_size=512
+ error "WARN: did not find sector size, assuming 512"
+ }
+
+ debug 1 "$dev: original sgdisk info:"
+ debugcat 1 "${pt_info}"
+
+ # Pretend to move the backup GPT header to the end of the disk and dump
+ # the resulting partition information. We use this info to determine if
+ # we have to resize the partition.
+ rqe sgd_pretend sgdisk --pretend --move-second-header \
+ --print "${DISK}" >"${pt_pretend}" ||
+ fail "${dev}: failed to dump pretend sgdisk info"
+
+ debug 1 "$dev: pretend sgdisk info"
+ debugcat 1 "${pt_pretend}"
+
+ # Extract the partition data from the pretend dump
+ awk 'found { print } ; $1 == "Number" { found = 1 }' \
+ "${pt_pretend}" >"${pt_data}" ||
+ fail "${dev}: failed to parse pretend sgdisk info"
+
+ # Get the start and end sectors of the partition to be grown
+ pt_start=$(awk '$1 == '"${PART}"' { print $2 }' "${pt_data}") &&
+ [ -n "${pt_start}" ] ||
+ fail "${dev}: failed to get start sector"
+ pt_end=$(awk '$1 == '"${PART}"' { print $3 }' "${pt_data}") &&
+ [ -n "${pt_end}" ] ||
+ fail "${dev}: failed to get end sector"
+ pt_size="$((${pt_end} - ${pt_start}))"
+
+ # Get the last usable sector
+ last=$(awk '/last usable sector is/ { print $NF }' \
+ "${pt_pretend}") && [ -n "${last}" ] ||
+ fail "${dev}: failed to get last usable sector"
+
+ # Find the minimal start sector that is >= pt_end
+ pt_max=$(awk '{ if ($2 >= pt_end && $2 < min) { min = $2 } } END \
+ { print min }' min="${last}" pt_end="${pt_end}" \
+ "${pt_data}") && [ -n "${pt_max}" ] ||
+ fail "${dev}: failed to find max end sector"
+
+ debug 1 "${dev}: pt_start=${pt_start} pt_end=${pt_end}" \
+ "pt_size=${pt_size} pt_max=${pt_max} last=${last}"
+
+ # Check if the partition can be grown
+ [ "${pt_end}" -eq "${pt_max}" ] &&
+ nochange "${dev}: size=${pt_size}, it cannot be grown"
+ [ "$((${pt_end} + ${FUDGE}/${sector_size}))" -gt "${pt_max}" ] &&
+ nochange "${dev}: could only be grown by" \
+ "$((${pt_max} - ${pt_end})) [fudge=$((${FUDGE}/$sector_size))]"
+
+ # The partition can be grown if we made it here. Get some more info
+ # about it so we can do it properly.
+ # FIXME: Do we care about the attribute flags?
+ code=$(awk '/^Partition GUID code:/ { print $4 }' "${pt_info}")
+ guid=$(awk '/^Partition unique GUID:/ { print $4 }' "${pt_info}")
+ name=$(awk '/^Partition name:/ { gsub(/'"'"'/, "") ; \
+ if (NF >= 3) print substr($0, index($0, $3)) }' "${pt_info}")
+ [ -n "${code}" -a -n "${guid}" ] ||
+ fail "${dev}: failed to parse sgdisk details"
+
+ debug 1 "${dev}: code=${code} guid=${guid} name='${name}'"
+ local wouldrun=""
+ [ "$DRY_RUN" -ne 0 ] && wouldrun="would-run"
+
+ # Calculate the new size of the partition
+ new_size=$((${pt_max} - ${pt_start}))
+ old="old: size=${pt_size},end=${pt_end}"
+ new="new: size=${new_size},end=${pt_max}"
+ change_info="${dev}: start=${pt_start} ${old} ${new}"
+
+ # Backup the current partition table, we're about to modify it
+ rq sgd_backup $wouldrun sgdisk "--backup=${GPT_BACKUP}" "${DISK}" ||
+ fail "${dev}: failed to backup the partition table"
+
+ # Modify the partition table. We do it all in one go (the order is
+ # important!):
+ # - move the GPT backup header to the end of the disk
+ # - delete the partition
+ # - recreate the partition with the new size
+ # - set the partition code
+ # - set the partition GUID
+ # - set the partition name
+ rq sgdisk_mod $wouldrun sgdisk --move-second-header "--delete=${PART}" \
+ "--new=${PART}:${pt_start}:${pt_max}" \
+ "--typecode=${PART}:${code}" \
+ "--partition-guid=${PART}:${guid}" \
+ "--change-name=${PART}:${name}" "${DISK}" &&
+ rq pt_update $wouldrun pt_update "$DISK" "$PART" || {
+ RESTORE_FUNC=gpt_restore
+ fail "${dev}: failed to repartition"
+ }
+
+ # Dry run
+ [ "${DRY_RUN}" -ne 0 ] && change "${change_info}"
+
+ changed "${change_info}"
+}
+
+kver_to_num() {
+ local kver="$1" maj="" min="" mic="0"
+ kver=${kver%%-*}
+ maj=${kver%%.*}
+ min=${kver#${maj}.}
+ min=${min%%.*}
+ mic=${kver#${maj}.${min}.}
+ [ "$kver" = "$mic" ] && mic=0
+ _RET=$(($maj*1000*1000+$min*1000+$mic))
+}
+
+kver_cmp() {
+ local op="$2" n1="" n2=""
+ kver_to_num "$1"
+ n1="$_RET"
+ kver_to_num "$3"
+ n2="$_RET"
+ [ $n1 $op $n2 ]
+}
+
+rq() {
+ # runquieterror(label, command)
+ # gobble stderr of a command unless it errors
+ local label="$1" ret="" efile=""
+ efile="$TEMP_D/$label.err"
+ shift;
+
+ local rlabel="running"
+ [ "$1" = "would-run" ] && rlabel="would-run" && shift
+
+ local cmd="" x=""
+ for x in "$@"; do
+ [ "${x#* }" != "$x" -o "${x#* \"}" != "$x" ] && x="'$x'"
+ cmd="$cmd $x"
+ done
+ cmd=${cmd# }
+
+ debug 2 "$rlabel[$label][$_capture]" "$cmd"
+ [ "$rlabel" = "would-run" ] && return 0
+
+ if [ "${_capture}" = "erronly" ]; then
+ "$@" 2>"$TEMP_D/$label.err"
+ ret=$?
+ else
+ "$@" >"$TEMP_D/$label.err" 2>&1
+ ret=$?
+ fi
+ if [ $ret -ne 0 ]; then
+ error "failed [$label:$ret]" "$@"
+ cat "$efile" 1>&2
+ fi
+ return $ret
+}
+
+rqe() {
+ local _capture="erronly"
+ rq "$@"
+}
+
+verify_ptupdate() {
+ local input="$1" found="" reason="" kver=""
+
+ # we can always satisfy 'off'
+ if [ "$input" = "off" ]; then
+ _RET="false";
+ return 0;
+ fi
+
+ if command -v partx >/dev/null 2>&1; then
+ local out="" ret=0
+ out=$(partx --help 2>&1)
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ echo "$out" | grep -q -- --update || {
+ reason="partx has no '--update' flag in usage."
+ found="off"
+ }
+ else
+ reason="'partx --help' returned $ret. assuming it is old."
+ found="off"
+ fi
+ else
+ reason="no 'partx' command"
+ found="off"
+ fi
+
+ if [ -z "$found" ]; then
+ if [ "$(uname)" != "Linux" ]; then
+ reason="Kernel is not Linux per uname."
+ found="off"
+ fi
+ fi
+
+ if [ -z "$found" ]; then
+ kver=$(uname -r) || debug 1 "uname -r failed!"
+
+ if ! kver_cmp "${kver-0.0.0}" -ge 3.8.0; then
+ reason="Kernel '$kver' < 3.8.0."
+ found="off"
+ fi
+ fi
+
+ if [ -z "$found" ]; then
+ _RET="true"
+ return 0
+ fi
+
+ case "$input" in
+ on) error "$reason"; return 1;;
+ auto)
+ _RET="false";
+ debug 1 "partition update disabled: $reason"
+ return 0;;
+ force)
+ _RET="true"
+ error "WARNING: ptupdate forced on even though: $reason"
+ return 0;;
+ esac
+ error "unknown input '$input'";
+ return 1;
+}
+
+pt_update() {
+ local dev="$1" part="$2" update="${3:-$PT_UPDATE}"
+ if ! $update; then
+ return 0
+ fi
+ # partx only works on block devices (do not run on file)
+ [ -b "$dev" ] || return 0
+ partx --update "$part" "$dev"
+}
+
+has_cmd() {
+ command -v "${1}" >/dev/null 2>&1
+}
+
+resize_sgdisk_gpt() {
+ resize_sgdisk gpt
+}
+
+resize_sgdisk_dos() {
+ fail "unable to resize dos label with sgdisk"
+}
+
+resize_sfdisk_gpt() {
+ resize_sfdisk gpt
+}
+
+resize_sfdisk_dos() {
+ resize_sfdisk dos
+}
+
+get_table_format() {
+ local out="" disk="$1"
+ if has_cmd blkid && out=$(blkid -o value -s PTTYPE "$disk") &&
+ [ "$out" = "dos" -o "$out" = "gpt" ]; then
+ _RET="$out"
+ return
+ fi
+ _RET="dos"
+ if [ ${SFDISK_VERSION} -lt ${SFDISK_2_26} ] &&
+ out=$(sfdisk --id --force "$disk" 1 2>/dev/null); then
+ if [ "$out" = "ee" ]; then
+ _RET="gpt"
+ else
+ _RET="dos"
+ fi
+ return
+ elif out=$(LANG=C sfdisk --list "$disk"); then
+ out=$(echo "$out" | sed -e '/Disklabel type/!d' -e 's/.*: //')
+ case "$out" in
+ gpt|dos) _RET="$out";;
+ *) error "WARN: unknown label $out";;
+ esac
+ fi
+}
+
+get_resizer() {
+ local format="$1" user=${2:-"auto"}
+
+ case "$user" in
+ sgdisk) _RET="resize_sgdisk_$format"; return;;
+ sfdisk) _RET="resize_sfdisk_$format"; return;;
+ auto) :;;
+ *) error "unexpected input: '$user'";;
+ esac
+
+ if [ "$format" = "dos" ]; then
+ _RET="resize_sfdisk_dos"
+ return 0
+ fi
+
+ if [ "${SFDISK_VERSION}" -ge ${SFDISK_2_26} ]; then
+ _RET="resize_sfdisk_gpt"
+ elif has_cmd sgdisk; then
+ _RET="resize_sgdisk_$format"
+ else
+ error "no tools available to resize disk with '$format'"
+ return 1
+ fi
+ return 0
+}
+
+pt_update="auto"
+resizer=${GROWPART_RESIZER:-"auto"}
+while [ $# -ne 0 ]; do
+ cur=${1}
+ next=${2}
+ case "$cur" in
+ -h|--help)
+ Usage
+ exit 0
+ ;;
+ --fudge)
+ FUDGE=${next}
+ shift
+ ;;
+ -N|--dry-run)
+ DRY_RUN=1
+ ;;
+ -u|--update|--update=*)
+ if [ "${cur#--update=}" != "$cur" ]; then
+ next="${cur#--update=}"
+ else
+ shift
+ fi
+ case "$next" in
+ off|auto|force|on) pt_update=$next;;
+ *) fail "unknown --update option: $next";;
+ esac
+ ;;
+ -v|--verbose)
+ VERBOSITY=$(($VERBOSITY+1))
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ fail "unknown option ${cur}"
+ ;;
+ *)
+ if [ -z "${DISK}" ]; then
+ DISK=${cur}
+ else
+ [ -z "${PART}" ] || fail "confused by arg ${cur}"
+ PART=${cur}
+ fi
+ ;;
+ esac
+ shift
+done
+
+[ -n "${DISK}" ] || bad_Usage "must supply disk and partition-number"
+[ -n "${PART}" ] || bad_Usage "must supply partition-number"
+
+has_cmd "sfdisk" || fail "sfdisk not found"
+get_sfdisk_version || fail
+
+[ -e "${DISK}" ] || fail "${DISK}: does not exist"
+
+[ "${PART#*[!0-9]}" = "${PART}" ] || fail "partition-number must be a number"
+
+verify_ptupdate "$pt_update" || fail
+PT_UPDATE=$_RET
+
+debug 1 "update-partition set to $PT_UPDATE"
+
+mktemp_d && TEMP_D="${_RET}" || fail "failed to make temp dir"
+trap cleanup 0 # EXIT - some shells may not like 'EXIT' but are ok with 0
+
+# get the ID of the first partition to determine if it's MBR or GPT
+get_table_format "$DISK" || fail
+format=$_RET
+get_resizer "$format" "$resizer" ||
+ fail "failed to get a resizer for id '$id'"
+resizer=$_RET
+
+debug 1 "resizing $PART on $DISK using $resizer"
+"$resizer"
+
+# vi: ts=4 noexpandtab
diff --git a/app-emulation/cloud-init/files/hosts.gentoo.tmpl b/app-emulation/cloud-init/files/hosts.gentoo.tmpl
new file mode 100644
index 000000000000..bc0bca47c5ce
--- /dev/null
+++ b/app-emulation/cloud-init/files/hosts.gentoo.tmpl
@@ -0,0 +1,23 @@
+## template:jinja
+{#
+This file /etc/cloud/templates/hosts.gentoo.tmpl is only utilized
+if enabled in cloud-config. Specifically, in order to enable it
+you need to add the following to config:
+ manage_etc_hosts: template
+-#}
+# Your system has configured 'manage_etc_hosts' as 'template'.
+# As a result, if you wish for changes to this file to persist
+# then you will need to either
+# a.) make changes to the master file in /etc/cloud/templates/hosts.gentoo.tmpl
+# b.) change or remove the value of 'manage_etc_hosts' in
+# /etc/cloud/cloud.cfg or cloud-config from user-data
+#
+# The following lines are desirable for IPv4 capable hosts
+127.0.0.1 {{fqdn}} {{hostname}}
+127.0.0.1 localhost.localdomain localhost
+127.0.0.1 localhost4.localdomain4 localhost4
+
+# The following lines are desirable for IPv6 capable hosts
+::1 {{fqdn}} {{hostname}}
+::1 localhost.localdomain localhost
+::1 localhost6.localdomain6 localhost6 \ No newline at end of file
diff --git a/app-emulation/cloud-init/metadata.xml b/app-emulation/cloud-init/metadata.xml
new file mode 100644
index 000000000000..1c248771204b
--- /dev/null
+++ b/app-emulation/cloud-init/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>python</herd>
+ <maintainer>
+ <email>prometheanfire@gentoo.org</email>
+ <name>Matthew Thode</name>
+ </maintainer>
+ <maintainer>
+ <email>alunduil@gentoo.org</email>
+ <name>Alex Brandt</name>
+ </maintainer>
+ <longdescription lang="en">
+ Package provides configuration and customization of cloud instance.
+ </longdescription>
+ <upstream>
+ <remote-id type="launchpad">cloud-init</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/coldfire/Manifest b/app-emulation/coldfire/Manifest
new file mode 100644
index 000000000000..f964aacf4b83
--- /dev/null
+++ b/app-emulation/coldfire/Manifest
@@ -0,0 +1 @@
+DIST coldfire-0.3.1.tar.gz 142964 SHA256 033e2da700aa6fb528c005d963ee537f54d19b1763204c270fae839a6d60cba3 SHA512 e9ac6fcd4a9a8cf0998a658c786f91f6d97dbe03cd32fdc7047c87baa14d412a45dfdd233f68e3136e8d0f36c4d6dd556e5df6e8a0645f82d4abf88fa574ff7b WHIRLPOOL c1aeb6c17d90632d816a423d4b34d5b3c29ca8879db271a1bdd7682e2f19fdefa3684a0ca0d2b1ba5ed88dbc07753a2816500006600e0e32f0389233ff7e243d
diff --git a/app-emulation/coldfire/coldfire-0.3.1.ebuild b/app-emulation/coldfire/coldfire-0.3.1.ebuild
new file mode 100644
index 000000000000..620a3ef5a768
--- /dev/null
+++ b/app-emulation/coldfire/coldfire-0.3.1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils
+
+DESCRIPTION="Motorola Coldfire Emulator"
+HOMEPAGE="http://www.slicer.ca/coldfire/"
+SRC_URI="http://www.slicer.ca/coldfire/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND="sys-libs/ncurses
+ sys-libs/readline"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+ epatch "${FILESDIR}"/${P}-headers.patch
+}
+
+src_install() {
+ dodir /usr/bin
+ einstall || die
+ dodoc CONTRIBUTORS HACKING README
+}
diff --git a/app-emulation/coldfire/files/coldfire-0.3.1-build.patch b/app-emulation/coldfire/files/coldfire-0.3.1-build.patch
new file mode 100644
index 000000000000..2b54dd4a16f5
--- /dev/null
+++ b/app-emulation/coldfire/files/coldfire-0.3.1-build.patch
@@ -0,0 +1,32 @@
+respect env build settings
+
+--- a/Makefile.rules.in
++++ b/Makefile.rules.in
+@@ -1,9 +1,9 @@
+ CC = @CC@
+-CFLAGS = -Wall -fomit-frame-pointer @CFLAGS@ -I$(TOPSRCDIR)
++CFLAGS = -Wall @CPPFLAGS@ @CFLAGS@ -I$(TOPSRCDIR)
+ LIBS = @LIBS@
+ LD_R = ld -r
+ RM = rm -f
+-LDFLAGS =
++LDFLAGS = @LDFLAGS@
+
+
+ prefix = @prefix@
+
+fix parallel build problems ... objs need generated tracer, and coldfire
+needs subdir objs
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -22,7 +22,8 @@
+ #Force version to be made before subdirectories
+ subdirs-all: version.h
+
+-coldfire: $(OBJS) force
++$(OBJS): | subdirs-all
++coldfire: $(OBJS) force | subdirs-all
+ $(CC) $(LDFLAGS) $(OBJS) $(SUBDIR_OBJS) -o $@ $(LIBS)
+
+
diff --git a/app-emulation/coldfire/files/coldfire-0.3.1-headers.patch b/app-emulation/coldfire/files/coldfire-0.3.1-headers.patch
new file mode 100644
index 000000000000..706b1a2b12c9
--- /dev/null
+++ b/app-emulation/coldfire/files/coldfire-0.3.1-headers.patch
@@ -0,0 +1,16 @@
+make sure we have access to HAVE_* defines to include header files:
+
+run.c: In function ‘sigint’:
+run.c:51:2: warning: implicit declaration of function ‘readline’
+run.c:51:8: warning: cast to pointer from integer of different size
+
+--- a/run.c
++++ b/run.c
+@@ -7,6 +7,7 @@
+ /**********************************/
+
+
++#include "config.h"
+
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/app-emulation/coldfire/metadata.xml b/app-emulation/coldfire/metadata.xml
new file mode 100644
index 000000000000..92114080841c
--- /dev/null
+++ b/app-emulation/coldfire/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>dev-embedded</herd>
+</pkgmetadata>
diff --git a/app-emulation/crossover-bin/Manifest b/app-emulation/crossover-bin/Manifest
new file mode 100644
index 000000000000..7e9b29dbdd93
--- /dev/null
+++ b/app-emulation/crossover-bin/Manifest
@@ -0,0 +1,10 @@
+DIST install-crossover-12.5.0.bin 55089470 SHA256 596ae288059005f26326196b81f705f3fc3ecd2bc872a23f9a86e75dfd8908da SHA512 85dbf37b76dd63ba761f6f8efc8c294f38bdb2a443fbed7a7f7f37652b377046f7bd27588600fc456e7fa8040d06a1673475bfc6a7b7a110a16a678efcc5c764 WHIRLPOOL 1d99ebad15e76bac0fb3174fdae2e09eb6b407e27b60c2562d2dc692f02d53f72c06398f68d7f0453b60adcd6789f62f2437e44eeb46f8c33ed92ba78c74e5f8
+DIST install-crossover-12.5.1.bin 56658131 SHA256 7ef5bbb092467fefa1e59cb5b0e1c8794a2511cebfc0c4665e8a7fe721140a4f SHA512 0f71a06f3a028698c4b076b205d807e193282c10c7cfb8e62e4697e9b3bd7549947c02c15f82d959d6963630677e6c72a5f8468d35d66ccb3ff6814ed2173c72 WHIRLPOOL 3386a231faa9af53b0dba7c2064bea436518afcc44c5b76c07ce1b5b61fe4a74a5bb8b16f92da97be79548851a3f08b1ed5739d6071a60f45f0382eed7ffe85e
+DIST install-crossover-13.0.0.bin 58807581 SHA256 e41cd80d38281d1c42a9a8ecb16249977887a13145d5fa3da883ce5f6f24c5c7 SHA512 fcf5dde6da1f2fb1eb402bd588baab5e951f8a0ad7959b06a4b7a42f250beb74f9c8d95f26f6fcd4ced9ce0bc4b484ad9a045a485f82028bf8ab7f2abf7ace33 WHIRLPOOL 57cd742cba31e57fb97f1a53e6c6c4e481f1a11b9e061f933995198053c80bd3828b0c6ee39ab152768cf603c1ab4c7125bc076ecfade651d063c1d97407464a
+DIST install-crossover-13.0.1.bin 58567182 SHA256 1e9ca276b7e99096476d1dd0fb37803d8dafcc6c9fa4e96c32e8cbf34c747eae SHA512 e43e3e92d4ac36546fafdf68d61b4fd5af412f83e301b232230589247ed052cb958f0d4eb7667fd616797b8f8c3b4f7acbfa7a9f1206204c5a98e456113a380b WHIRLPOOL 4c76e80a39f834979b9e0e885f10fd740805a23f93f5745dbdb53ecefb748d57b75e57460a9bbfab656329c77a2c61c356e75054438c0f7cce77dc9a77648f33
+DIST install-crossover-13.1.0.bin 58678679 SHA256 76e4345c6b9c436b7f02ab39b15b5f3d105838c3bf5194b34484dafe748cca48 SHA512 1f2b5625c826bbf16231e1b3ea8694bcda24cf3a7a90347a29b9d97f654ce35df26aff2b8166e8c517e85785d4ea2b5fbdf1bcb82263fa0e8715846fd1668d15 WHIRLPOOL c665ce05fae8aeacb637bf8ab4d3b5fb8d681f2e3d65f1d13c8ceab91708290f32e1742a81ea0dc5d90064c67016e30f2a5497cbfc7d4be8ec55d498de9dad7d
+DIST install-crossover-13.1.2.bin 58730543 SHA256 005a0ed9e102c54c3b204491406bfad889603c59ef5be1ec1b5a3f68a1f6bba2 SHA512 5944db06162a67f68fa4a1ab14f7fbc41f114c63adebecf4c0c50967245f81bb42e58dbe66d33fbfaaeae232aacb2b534fc4367d592eaa6f1cc75e32ec0d23b3 WHIRLPOOL e26a0f3a59d3d06b6001f2672d511d0917afa576b4cf9f781a3c7eaffb2e7fb479cdcaeae98fa0d38873bf749bbe33b6695f1dd3496f4087691332b569e484ef
+DIST install-crossover-13.1.3.bin 58768110 SHA256 3d16dbecec584a1d6155ddda6f62a5824980cddc25f5910c2c733de06a716b04 SHA512 091a70e777f8311f818d227f26850f256d6acc7f50c93855f72857f2e21298524262d490fcc8a97342faea1a261ab042b0064d112aacb6c30e9ab5301f89eabe WHIRLPOOL aaffeb604d929b3b4611707cb7878a961c8a2f17baafc4f58dc293d3b29e5485246847327dcf441353ff3feeed76fd7c2f34a516ebeafb2fedee3567d8cdb485
+DIST install-crossover-13.2.0.bin 64625581 SHA256 ef29ca8ca275e4fb6b33337aadc2d3ee92b4dc7d582fab7d5cff5c775d23c75d SHA512 1f582eeca8db02c15d98d519b2d24f65b8dcddd90ff270915a4e6dbd24e135b074c5a20dd824c3d8c8f35cef79610c02423b5558db205a6e80630f69191e051b WHIRLPOOL f8ce0628d961a567291981a238f03da6f5f7554d4d971a8b27fc34b67969a7061032b84325df1a8e38313415dcda3dab98acd6833b396e4f46a65427c9dc8c3e
+DIST install-crossover-14.0.3.bin 68080015 SHA256 23f67221e4047b50f3250b29fae51086cce93529956d3885d149d5abddcc83a2 SHA512 86855e112f5b5d7621e0d4c644abe570de0270e678dc9666482025c948733de02c66fcf67999079a8ba99537695b36d4fb61aee90a59c319edad5fb477a0f902 WHIRLPOOL a0f26d06d2bb81063bcf78a474b9bf4732e9314fd886f430c1141bfce26ae09c297ff79087e5834474d87aa772a1f08a44791d24a3a83ff2baf24969885fe9b8
+DIST install-crossover-14.1.4.bin 68463678 SHA256 9e51823fca911916755b1edca8673c69df4c6f3607b170d9b01e9d9143b4d4c7 SHA512 2078d9e8fc10c526085aef0bfa0cedbcc1a96ec59ade934ea10e7f10062f1a58f5647e9aed59653d4a1253699a08e9ef6f01548010e960af24d0d3546549fb91 WHIRLPOOL a9714f15de43acb2ab6fed91bb35ffdec832dc8fef0b9f75ed394ca18af8552b797b795fdc5bc108c7cf27ca432f932b1f4fe6b4d04d4d52dfaa06bfef083aca
diff --git a/app-emulation/crossover-bin/crossover-bin-12.5.0-r2.ebuild b/app-emulation/crossover-bin/crossover-bin-12.5.0-r2.ebuild
new file mode 100644
index 000000000000..e98a2dcf65ff
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-12.5.0-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support"
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+ sed -e 's:/usr/local/etc/xdg /etc/xdg::' -i "${WORKDIR}/bin/locate_gui.sh" \
+ || die "Could not patch ${WORKDIR}/bin/locate_gui.sh"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install requisite directories for menus
+ dodir "/usr/share/applications"
+ dodir "/etc/xdg/menus/applications-merged"
+
+ # Install menus
+ XDG_CONFIG_DIRS="${ED}etc/xdg" \
+ XDG_DATA_DIRS="${ED}usr/share" \
+ "${ED}opt/cxoffice/bin/cxmenu" --crossover --install \
+ || die "Could not install menus"
+
+ # Fix menus
+ sed -e "s:${ED}:/:" -i "${ED}usr/share/applications/"* \
+ || die "Could not fix menus"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-12.5.1-r2.ebuild b/app-emulation/crossover-bin/crossover-bin-12.5.1-r2.ebuild
new file mode 100644
index 000000000000..4cdba4850605
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-12.5.1-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+ sed -e 's:/usr/local/etc/xdg /etc/xdg::' -i "${WORKDIR}/bin/locate_gui.sh" \
+ || die "Could not patch ${WORKDIR}/bin/locate_gui.sh"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install requisite directories for menus
+ dodir "/usr/share/applications"
+ dodir "/etc/xdg/menus/applications-merged"
+
+ # Install menus
+ XDG_CONFIG_DIRS="${ED}etc/xdg" \
+ XDG_DATA_DIRS="${ED}usr/share" \
+ "${ED}opt/cxoffice/bin/cxmenu" --crossover --install \
+ || die "Could not install menus"
+
+ # Fix menus
+ sed -e "s:${ED}:/:" -i "${ED}usr/share/applications/"* \
+ || die "Could not fix menus"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-13.0.0-r2.ebuild b/app-emulation/crossover-bin/crossover-bin-13.0.0-r2.ebuild
new file mode 100644
index 000000000000..4cdba4850605
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-13.0.0-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+ sed -e 's:/usr/local/etc/xdg /etc/xdg::' -i "${WORKDIR}/bin/locate_gui.sh" \
+ || die "Could not patch ${WORKDIR}/bin/locate_gui.sh"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install requisite directories for menus
+ dodir "/usr/share/applications"
+ dodir "/etc/xdg/menus/applications-merged"
+
+ # Install menus
+ XDG_CONFIG_DIRS="${ED}etc/xdg" \
+ XDG_DATA_DIRS="${ED}usr/share" \
+ "${ED}opt/cxoffice/bin/cxmenu" --crossover --install \
+ || die "Could not install menus"
+
+ # Fix menus
+ sed -e "s:${ED}:/:" -i "${ED}usr/share/applications/"* \
+ || die "Could not fix menus"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-13.0.1-r2.ebuild b/app-emulation/crossover-bin/crossover-bin-13.0.1-r2.ebuild
new file mode 100644
index 000000000000..4cdba4850605
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-13.0.1-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+ sed -e 's:/usr/local/etc/xdg /etc/xdg::' -i "${WORKDIR}/bin/locate_gui.sh" \
+ || die "Could not patch ${WORKDIR}/bin/locate_gui.sh"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install requisite directories for menus
+ dodir "/usr/share/applications"
+ dodir "/etc/xdg/menus/applications-merged"
+
+ # Install menus
+ XDG_CONFIG_DIRS="${ED}etc/xdg" \
+ XDG_DATA_DIRS="${ED}usr/share" \
+ "${ED}opt/cxoffice/bin/cxmenu" --crossover --install \
+ || die "Could not install menus"
+
+ # Fix menus
+ sed -e "s:${ED}:/:" -i "${ED}usr/share/applications/"* \
+ || die "Could not fix menus"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-13.1.0-r2.ebuild b/app-emulation/crossover-bin/crossover-bin-13.1.0-r2.ebuild
new file mode 100644
index 000000000000..4cdba4850605
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-13.1.0-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+ sed -e 's:/usr/local/etc/xdg /etc/xdg::' -i "${WORKDIR}/bin/locate_gui.sh" \
+ || die "Could not patch ${WORKDIR}/bin/locate_gui.sh"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install requisite directories for menus
+ dodir "/usr/share/applications"
+ dodir "/etc/xdg/menus/applications-merged"
+
+ # Install menus
+ XDG_CONFIG_DIRS="${ED}etc/xdg" \
+ XDG_DATA_DIRS="${ED}usr/share" \
+ "${ED}opt/cxoffice/bin/cxmenu" --crossover --install \
+ || die "Could not install menus"
+
+ # Fix menus
+ sed -e "s:${ED}:/:" -i "${ED}usr/share/applications/"* \
+ || die "Could not fix menus"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-13.1.2-r2.ebuild b/app-emulation/crossover-bin/crossover-bin-13.1.2-r2.ebuild
new file mode 100644
index 000000000000..4cdba4850605
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-13.1.2-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+ sed -e 's:/usr/local/etc/xdg /etc/xdg::' -i "${WORKDIR}/bin/locate_gui.sh" \
+ || die "Could not patch ${WORKDIR}/bin/locate_gui.sh"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install requisite directories for menus
+ dodir "/usr/share/applications"
+ dodir "/etc/xdg/menus/applications-merged"
+
+ # Install menus
+ XDG_CONFIG_DIRS="${ED}etc/xdg" \
+ XDG_DATA_DIRS="${ED}usr/share" \
+ "${ED}opt/cxoffice/bin/cxmenu" --crossover --install \
+ || die "Could not install menus"
+
+ # Fix menus
+ sed -e "s:${ED}:/:" -i "${ED}usr/share/applications/"* \
+ || die "Could not fix menus"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-13.1.3-r2.ebuild b/app-emulation/crossover-bin/crossover-bin-13.1.3-r2.ebuild
new file mode 100644
index 000000000000..4cdba4850605
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-13.1.3-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+ sed -e 's:/usr/local/etc/xdg /etc/xdg::' -i "${WORKDIR}/bin/locate_gui.sh" \
+ || die "Could not patch ${WORKDIR}/bin/locate_gui.sh"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install requisite directories for menus
+ dodir "/usr/share/applications"
+ dodir "/etc/xdg/menus/applications-merged"
+
+ # Install menus
+ XDG_CONFIG_DIRS="${ED}etc/xdg" \
+ XDG_DATA_DIRS="${ED}usr/share" \
+ "${ED}opt/cxoffice/bin/cxmenu" --crossover --install \
+ || die "Could not install menus"
+
+ # Fix menus
+ sed -e "s:${ED}:/:" -i "${ED}usr/share/applications/"* \
+ || die "Could not fix menus"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-13.2.0-r2.ebuild b/app-emulation/crossover-bin/crossover-bin-13.2.0-r2.ebuild
new file mode 100644
index 000000000000..4cdba4850605
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-13.2.0-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+ sed -e 's:/usr/local/etc/xdg /etc/xdg::' -i "${WORKDIR}/bin/locate_gui.sh" \
+ || die "Could not patch ${WORKDIR}/bin/locate_gui.sh"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install requisite directories for menus
+ dodir "/usr/share/applications"
+ dodir "/etc/xdg/menus/applications-merged"
+
+ # Install menus
+ XDG_CONFIG_DIRS="${ED}etc/xdg" \
+ XDG_DATA_DIRS="${ED}usr/share" \
+ "${ED}opt/cxoffice/bin/cxmenu" --crossover --install \
+ || die "Could not install menus"
+
+ # Fix menus
+ sed -e "s:${ED}:/:" -i "${ED}usr/share/applications/"* \
+ || die "Could not fix menus"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-14.0.3-r1.ebuild b/app-emulation/crossover-bin/crossover-bin-14.0.3-r1.ebuild
new file mode 100644
index 000000000000..4738fdc6971c
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-14.0.3-r1.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+
+ sed -i -e "s:\$link=\"\$xdgdir:\$link=\"${ED}\/\$xdgdir:" "${S}/lib/perl/CXMenu.pm"
+ sed -i \
+ -e "s:\"\(.*\)/applications:\"${ED}/\1/applications:" \
+ -e "s:\"\(.*\)/desktop-directories:\"${ED}/\1/desktop-directories:" \
+ "${S}/lib/perl/CXMenuXDG.pm"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install menus
+ # XXX: locate_gui.sh automatically detects *-application-merged directories
+ # This means what we install will vary depending on the contents of
+ # /etc/xdg, which is a QA violation. It is not clear how to resolve this.
+ XDG_DATA_DIRS="/usr/share" XDG_CONFIG_HOME="/etc/xdg" \
+ "${ED}opt/cxoffice/bin/cxmenu" --destdir="${ED}" --crossover --install \
+ || die "Could not install menus"
+
+ rm "${ED}usr/share/applications/"*"Uninstall CrossOver Linux.desktop"
+ sed -i -e "s:${ED}:/:" "${ED}usr/share/applications/"*.desktop
+ sed -i -e "s:${ED}/::" \
+ "${ED}/opt/cxoffice/lib/perl/CXMenu.pm" \
+ "${ED}/opt/cxoffice/lib/perl/CXMenuXDG.pm"
+}
diff --git a/app-emulation/crossover-bin/crossover-bin-14.1.4-r1.ebuild b/app-emulation/crossover-bin/crossover-bin-14.1.4-r1.ebuild
new file mode 100644
index 000000000000..67924d072c61
--- /dev/null
+++ b/app-emulation/crossover-bin/crossover-bin-14.1.4-r1.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 unpacker
+
+DESCRIPTION="Commercial version of app-emulation/wine with paid support."
+HOMEPAGE="http://www.codeweavers.com/products/crossover/"
+SRC_URI="install-crossover-${PV}.bin"
+
+LICENSE="CROSSOVER-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+capi +cups doc +gphoto2 +gsm +jpeg +lcms +ldap +mp3 +nls +openal +opengl +png +scanner +ssl +v4l"
+RESTRICT="bindist fetch test"
+QA_FLAGS_IGNORED="opt/cxoffice/.*"
+QA_PRESTRIPPED="opt/cxoffice/lib/.*
+ opt/cxoffice/bin/cxburner
+ opt/cxoffice/bin/cxntlm_auth
+ opt/cxoffice/bin/wineserver
+ opt/cxoffice/bin/unrar
+ opt/cxoffice/bin/wine-preloader
+ opt/cxoffice/bin/cxdiag
+ opt/cxoffice/bin/cxgettext
+ opt/cxoffice/bin/wineloader
+ "
+S="${WORKDIR}"
+
+DEPEND="dev-lang/perl
+ app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="${DEPEND}
+ !prefix? ( sys-libs/glibc )
+ >=dev-python/pygtk-2.10[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-util/desktop-file-utils
+ !app-emulation/crossover-office-pro-bin
+ !app-emulation/crossover-office-bin
+ capi? ( net-dialup/capi4k-utils )
+ cups? ( net-print/cups[abi_x86_32(-)] )
+ gsm? ( media-sound/gsm[abi_x86_32(-)] )
+ jpeg? ( virtual/jpeg[abi_x86_32(-)] )
+ lcms? ( media-libs/lcms:2 )
+ ldap? ( net-nds/openldap[abi_x86_32(-)] )
+ gphoto2? ( media-libs/libgphoto2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.5.0[abi_x86_32(-)] )
+ nls? ( sys-devel/gettext[abi_x86_32(-)] )
+ openal? ( media-libs/openal[abi_x86_32(-)] )
+ opengl? (
+ virtual/glu[abi_x86_32(-)]
+ virtual/opengl[abi_x86_32(-)]
+ )
+ png? ( media-libs/libpng:0[abi_x86_32(-)] )
+ scanner? ( media-gfx/sane-backends[abi_x86_32(-)] )
+ ssl? ( dev-libs/openssl:0[abi_x86_32(-)] )
+ v4l? ( media-libs/libv4l[abi_x86_32(-)] )
+ media-libs/alsa-lib[abi_x86_32(-)]
+ >=media-libs/freetype-2.0.0[abi_x86_32(-)]
+ media-libs/mesa[abi_x86_32(-)]
+ sys-apps/util-linux[abi_x86_32(-)]
+ sys-libs/zlib[abi_x86_32(-)]
+ x11-libs/libICE[abi_x86_32(-)]
+ x11-libs/libSM[abi_x86_32(-)]
+ x11-libs/libX11[abi_x86_32(-)]
+ x11-libs/libXau[abi_x86_32(-)]
+ x11-libs/libXdmcp[abi_x86_32(-)]
+ x11-libs/libXext[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ x11-libs/libxcb[abi_x86_32(-)]"
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ # self unpacking zip archive; unzip warns about the exe stuff
+ unpack_zip ${A}
+}
+
+src_prepare() {
+ python_fix_shebang .
+
+ sed -i -e "s:\$link=\"\$xdgdir:\$link=\"${ED}\/\$xdgdir:" "${S}/lib/perl/CXMenu.pm"
+ sed -i \
+ -e "s:\"\(.*\)/applications:\"${ED}/\1/applications:" \
+ -e "s:\"\(.*\)/desktop-directories:\"${ED}/\1/desktop-directories:" \
+ "${S}/lib/perl/CXMenuXDG.pm"
+
+ # Remove unnecessary files
+ rm -r license.txt guis/ || die "Could not remove files"
+ use doc || rm -r doc/ || die "Could not remove files"
+}
+
+src_install() {
+ # Install crossover symlink, bug #476314
+ dosym /opt/cxoffice/bin/crossover /opt/bin/crossover
+
+ # Install documentation
+ dodoc README changelog.txt
+ rm README changelog.txt || die "Could not remove README and changelog.txt"
+
+ # Install files
+ dodir /opt/cxoffice
+ cp -r ./* "${ED}opt/cxoffice" \
+ || die "Could not install into ${ED}opt/cxoffice"
+
+ # Install configuration file
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+
+ # Install menus
+ # XXX: locate_gui.sh automatically detects *-application-merged directories
+ # This means what we install will vary depending on the contents of
+ # /etc/xdg, which is a QA violation. It is not clear how to resolve this.
+ XDG_DATA_DIRS="/usr/share" XDG_CONFIG_HOME="/etc/xdg" \
+ "${ED}opt/cxoffice/bin/cxmenu" --destdir="${ED}" --crossover --install \
+ || die "Could not install menus"
+
+ rm "${ED}usr/share/applications/"*"Uninstall CrossOver Linux.desktop"
+ sed -i -e "s:${ED}:/:" "${ED}usr/share/applications/"*.desktop
+ sed -i -e "s:${ED}/::" \
+ "${ED}/opt/cxoffice/lib/perl/CXMenu.pm" \
+ "${ED}/opt/cxoffice/lib/perl/CXMenuXDG.pm"
+}
diff --git a/app-emulation/crossover-bin/metadata.xml b/app-emulation/crossover-bin/metadata.xml
new file mode 100644
index 000000000000..76a1d1fff70f
--- /dev/null
+++ b/app-emulation/crossover-bin/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>ryao@gentoo.org</email>
+ <name>Richard Yao</name>
+ </maintainer>
+ <use>
+ <flag name='capi'>Enable ISDN support via CAPI</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/crossover-office-bin/Manifest b/app-emulation/crossover-office-bin/Manifest
new file mode 100644
index 000000000000..7e57261a8a0e
--- /dev/null
+++ b/app-emulation/crossover-office-bin/Manifest
@@ -0,0 +1,4 @@
+DIST install-crossover-standard-6.0.0.sh 20086564 SHA256 0b49f6a0fe866078ccd10fee476836a4eea99904c6b9827e3c47e12b613d1342
+DIST install-crossover-standard-6.0.1.sh 20097976 SHA256 cc77a25d46f09b357b7d0ecb86c6749db052bc91622d291a18732aa3803894e2
+DIST install-crossover-standard-6.1.0.sh 24481498 SHA256 d36938d7a53767e6169eb05565f8a3ae8313f3ceee6a5912c6497f39ca08afbf
+DIST install-crossover-standard-6.2.0.sh 23632049 SHA256 5ddd35d5271b49ec43ed128e9efd122c1792e1718e6e4024aa263ae0212c4320
diff --git a/app-emulation/crossover-office-bin/crossover-office-bin-6.0.0.ebuild b/app-emulation/crossover-office-bin/crossover-office-bin-6.0.0.ebuild
new file mode 100644
index 000000000000..f5d4461d96fa
--- /dev/null
+++ b/app-emulation/crossover-office-bin/crossover-office-bin-6.0.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-standard-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins support/templates/cxoffice.conf
+}
+
+pkg_postinst() {
+ einfo "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ einfo "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-bin/crossover-office-bin-6.0.1.ebuild b/app-emulation/crossover-office-bin/crossover-office-bin-6.0.1.ebuild
new file mode 100644
index 000000000000..f5d4461d96fa
--- /dev/null
+++ b/app-emulation/crossover-office-bin/crossover-office-bin-6.0.1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-standard-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins support/templates/cxoffice.conf
+}
+
+pkg_postinst() {
+ einfo "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ einfo "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-bin/crossover-office-bin-6.1.0.ebuild b/app-emulation/crossover-office-bin/crossover-office-bin-6.1.0.ebuild
new file mode 100644
index 000000000000..f5d4461d96fa
--- /dev/null
+++ b/app-emulation/crossover-office-bin/crossover-office-bin-6.1.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-standard-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins support/templates/cxoffice.conf
+}
+
+pkg_postinst() {
+ einfo "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ einfo "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-bin/crossover-office-bin-6.2.0.ebuild b/app-emulation/crossover-office-bin/crossover-office-bin-6.2.0.ebuild
new file mode 100644
index 000000000000..d2b805e162ba
--- /dev/null
+++ b/app-emulation/crossover-office-bin/crossover-office-bin-6.2.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-standard-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ elog "Please visit ${HOMEPAGE}"
+ elog "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins support/templates/cxoffice.conf
+}
+
+pkg_postinst() {
+ einfo "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ einfo "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-bin/metadata.xml b/app-emulation/crossover-office-bin/metadata.xml
new file mode 100644
index 000000000000..27f54c99739f
--- /dev/null
+++ b/app-emulation/crossover-office-bin/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>wine</herd>
+</pkgmetadata>
diff --git a/app-emulation/crossover-office-pro-bin/Manifest b/app-emulation/crossover-office-pro-bin/Manifest
new file mode 100644
index 000000000000..c87ad99e346e
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/Manifest
@@ -0,0 +1,13 @@
+DIST install-crossover-pro-5.0.0.sh 15957213 SHA256 aa4575bf989eee9ecb3fa4f150913cb46c8bf7e32322f8c874310fff82ffb72c
+DIST install-crossover-pro-5.0.1.sh 16177282 SHA256 b92683c0e20008a67f2b79ea83bae01141cce22966ebbf291058eecdf941ddd6
+DIST install-crossover-pro-5.0.3.sh 17299111 SHA256 d171b87cb5c1aaa775e8abbb303fa7acc572f1b0911bbd89d1852e823fc9f133
+DIST install-crossover-pro-6.0.0.sh 20265211 SHA256 77055a7bc168b05efff9c1d6bfce9f450b43f00ea0e74f9f8a4514cfa00379c3
+DIST install-crossover-pro-6.1.0.sh 24811441 SHA256 9a71320ed778ab57e05f9e9412774e96910573f6e8a5edfe8d8cf2eb7805b200
+DIST install-crossover-pro-6.2.0.sh 23806779 SHA256 d6bcd30430bbf01b72780e6be13900e8cb5a80fd2850e230262db349d6ae58f2
+DIST install-crossover-pro-7.0.2.sh 25607860 SHA256 c307b237b6d57fea1e940c5c840f44ed0fc34357ae9f417e7127abc20d51314b
+DIST install-crossover-pro-7.1.0.sh 26190866 SHA256 8844a09493a9d987fd96d7c6cc17c3e3ca5b910fc61162c1d3e40beef8ef3b14
+DIST install-crossover-pro-8.0.0.sh 29587007 SHA256 f440337441715c723cd29a52f3156da86df622d19d81b5bd163b786696f9248f
+DIST install-crossover-pro-9.0.0.sh 30375251 SHA256 14b46ba4c386dbacb38abf24871576a22450b63f96e236338386f4f7bf65b71f
+DIST install-crossover-pro-9.0.1.sh 30381453 SHA256 8154e04dfdc10ebba3fe849ccf7f0c9b1508bf7d8612ac99ef3b1ac28ea13cb7
+DIST install-crossover-pro-9.1.0.sh 32846417 SHA256 a53bc1f0e188b3769f0e398450d62034b7d775e53e359be6f791dc02138d1b03
+DIST install-crossover-pro-9.2.0.sh 33017777 SHA256 ac027670a56f64b607c9047583d1e26c2e6808dd79d78fd41750651294eaf321
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.0.ebuild
new file mode 100644
index 000000000000..f087c1be71a8
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins support/templates/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.1.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.1.ebuild
new file mode 100644
index 000000000000..cfa7703bca70
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins support/templates/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.3.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.3.ebuild
new file mode 100644
index 000000000000..cfa7703bca70
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-5.0.3.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins support/templates/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.0.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.0.0.ebuild
new file mode 100644
index 000000000000..e4fd6bc041b3
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.0.0.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.1.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.1.0.ebuild
new file mode 100644
index 000000000000..986d281d61e3
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.1.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.2.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.2.0.ebuild
new file mode 100644
index 000000000000..986d281d61e3
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-6.2.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-7.0.2.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-7.0.2.ebuild
new file mode 100644
index 000000000000..986d281d61e3
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-7.0.2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-7.1.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-7.1.0.ebuild
new file mode 100644
index 000000000000..986d281d61e3
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-7.1.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-8.0.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-8.0.0.ebuild
new file mode 100644
index 000000000000..986d281d61e3
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-8.0.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.0.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.0.0.ebuild
new file mode 100644
index 000000000000..986d281d61e3
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.0.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.0.1.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.0.1.ebuild
new file mode 100644
index 000000000000..986d281d61e3
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.0.1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.1.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.1.0.ebuild
new file mode 100644
index 000000000000..3d3228153307
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.1.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ || ( virtual/jpeg:62[abi_x86_32(-)] media-libs/jpeg:62[abi_x86_32(-)] )
+ media-libs/libpng:1.2[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.2.0.ebuild b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.2.0.ebuild
new file mode 100644
index 000000000000..3d3228153307
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.2.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit unpacker
+
+DESCRIPTION="simplified/streamlined version of wine with commercial support"
+HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
+SRC_URI="install-crossover-pro-${PV}.sh"
+
+LICENSE="CROSSOVER"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="nas"
+RESTRICT="bindist fetch strip"
+
+RDEPEND="
+ dev-util/desktop-file-utils
+ sys-libs/glibc
+ x11-libs/libXrandr[abi_x86_32(-)]
+ x11-libs/libXi[abi_x86_32(-)]
+ x11-libs/libXmu[abi_x86_32(-)]
+ x11-libs/libXxf86dga[abi_x86_32(-)]
+ x11-libs/libXxf86vm[abi_x86_32(-)]
+ || ( virtual/jpeg:62[abi_x86_32(-)] media-libs/jpeg:62[abi_x86_32(-)] )
+ media-libs/libpng:1.2[abi_x86_32(-)]
+ nas? ( media-libs/nas[abi_x86_32(-)] )
+"
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_nofetch() {
+ einfo "Please visit ${HOMEPAGE}"
+ einfo "and place ${A} in ${DISTDIR}"
+}
+
+src_unpack() {
+ unpack_makeself # needed due to .sh extension; #415013
+}
+
+src_install() {
+ dodir /opt/cxoffice
+ cp -r * "${D}"/opt/cxoffice || die "cp failed"
+ rm -r "${D}"/opt/cxoffice/setup.{sh,data}
+ insinto /opt/cxoffice/etc
+ doins share/crossover/data/cxoffice.conf
+}
+
+pkg_postinst() {
+ elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
+ elog "bottles and install Windows applications."
+}
diff --git a/app-emulation/crossover-office-pro-bin/metadata.xml b/app-emulation/crossover-office-pro-bin/metadata.xml
new file mode 100644
index 000000000000..27f54c99739f
--- /dev/null
+++ b/app-emulation/crossover-office-pro-bin/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>wine</herd>
+</pkgmetadata>
diff --git a/app-emulation/dinero/Manifest b/app-emulation/dinero/Manifest
new file mode 100644
index 000000000000..401ddd5a6f11
--- /dev/null
+++ b/app-emulation/dinero/Manifest
@@ -0,0 +1 @@
+DIST d4-7.tar.gz 295814 SHA256 7b651823c8feb2ee7617be5591df15f9c99265b880e4a99c98c33f5d8b47a837 SHA512 20a6232c732e42a7b37061cb75b3b97fe839824d066a6b3295d1fe8aa5312913d7fad404e93f5ecfb5690f5e7c7a0e266daee16973f1f165c7f33c5095c90f14 WHIRLPOOL fae59e5c83d6373e123b4da2433cddf48ca5b6bf0a37581957aabf59ed78c37a5164189e2f606641cedb55c67f9d03e7f9386eb7cd87da1a455144d8aca33e86
diff --git a/app-emulation/dinero/dinero-4.7-r1.ebuild b/app-emulation/dinero/dinero-4.7-r1.ebuild
new file mode 100644
index 000000000000..dde85fcfdd5c
--- /dev/null
+++ b/app-emulation/dinero/dinero-4.7-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools toolchain-funcs
+
+MY_P="d${PV/./-}"
+S="${WORKDIR}/${MY_P}"
+DESCRIPTION="Cache simulator"
+HOMEPAGE="http://www.cs.wisc.edu/~markhill/DineroIV/"
+SRC_URI="ftp://ftp.cs.wisc.edu/markhill/DineroIV/${MY_P}.tar.gz"
+
+LICENSE="free-noncomm"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+src_prepare() {
+ sed -e "s/\$(CC)/& \$(LDFLAGS)/" \
+ -i Makefile.in || die #331837
+ eautoreconf
+ tc-export AR
+}
+
+src_install() {
+ dobin dineroIV
+ dodoc CHANGES COPYRIGHT NOTES README TODO
+}
diff --git a/app-emulation/dinero/metadata.xml b/app-emulation/dinero/metadata.xml
new file mode 100644
index 000000000000..d9cd2cad66c2
--- /dev/null
+++ b/app-emulation/dinero/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/app-emulation/dlx/Manifest b/app-emulation/dlx/Manifest
new file mode 100644
index 000000000000..e74010634613
--- /dev/null
+++ b/app-emulation/dlx/Manifest
@@ -0,0 +1 @@
+DIST dlx.tar.gz 112589 SHA256 34d102fd72b7bfebf846fe20f7529d603fa6e47911267f46fba27741f8f94a8f SHA512 99297f14f6716ada7a29b204723a0c951002529362a22f695b3647517462f43af563ea55467985dda3e21d79a14d46b84dbc9b22a8c0751fba49257e30f70a7f WHIRLPOOL 2f7f44abb08b9a0c0549d4e921ed9196e0cf81e5fc759778205e08d537cb526eedc96deeb2dfa72449946a71712ef83c4fd0e9cbe7a9ddeccb25bcf29cdf6ace
diff --git a/app-emulation/dlx/dlx-1.0.0-r1.ebuild b/app-emulation/dlx/dlx-1.0.0-r1.ebuild
new file mode 100644
index 000000000000..638b2a733fd4
--- /dev/null
+++ b/app-emulation/dlx/dlx-1.0.0-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="DLX Simulator"
+HOMEPAGE="http://www.davidviner.com/dlx.php"
+SRC_URI="http://www.davidviner.com/${PN}/${PN}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+S="${WORKDIR}/${PN}"
+
+src_compile() {
+ emake CC="$(tc-getCC)" \
+ LINK="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LFLAGS="${LDFLAGS}" \
+ || die "emake failed"
+}
+
+src_install() {
+ dodir /usr/include/dlx /usr/share/dlx/examples
+ dobin masm mon dasm
+ insinto /usr/include/dlx
+ doins *.i auto.a
+ insinto /usr/share/dlx/examples
+ doins *.a hp.m
+ dodoc README.txt MANUAL.TXT
+}
diff --git a/app-emulation/dlx/dlx-1.0.0.ebuild b/app-emulation/dlx/dlx-1.0.0.ebuild
new file mode 100644
index 000000000000..3a5cea4ede51
--- /dev/null
+++ b/app-emulation/dlx/dlx-1.0.0.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+S=${WORKDIR}/dlx
+DESCRIPTION="DLX Simulator"
+HOMEPAGE="http://www.davidviner.com/dlx.php"
+SRC_URI="http://www.davidviner.com/dlx/dlx.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86 ppc"
+IUSE=""
+DEPEND=""
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ dobin masm mon dasm
+ dodoc README.txt MANUAL.TXT
+}
diff --git a/app-emulation/dlx/metadata.xml b/app-emulation/dlx/metadata.xml
new file mode 100644
index 000000000000..59e2b8f78cb5
--- /dev/null
+++ b/app-emulation/dlx/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ <name>Default assignee for orphaned packages</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/docker-compose/Manifest b/app-emulation/docker-compose/Manifest
new file mode 100644
index 000000000000..fe0f61817bde
--- /dev/null
+++ b/app-emulation/docker-compose/Manifest
@@ -0,0 +1 @@
+DIST docker-compose-1.2.0.tar.gz 57150 SHA256 46ef3c5cb7dd79fa7fd1d5fc5ec5be6a5c634192bc09c604c0ea75adb89cb652 SHA512 d13f6d6d22979dbc4554c003e611097627e2273f06dd13a1c666c1ba138288597ebef08f1beaf6d342721391cb49ad5ce9ae2ff03367a041fc0c53fbb62c9ac4 WHIRLPOOL c7bb3e14a4c2788eb49241ce02dcaed5e49fe60652ca1a51d13e1712f946046415f5397d5bf892b5e0451059a4aee1b156ee7bdfdf64a22d000caae7b17254c0
diff --git a/app-emulation/docker-compose/docker-compose-1.2.0-r1.ebuild b/app-emulation/docker-compose/docker-compose-1.2.0-r1.ebuild
new file mode 100644
index 000000000000..45293cc09b16
--- /dev/null
+++ b/app-emulation/docker-compose/docker-compose-1.2.0-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit bash-completion-r1 distutils-r1
+
+DESCRIPTION="Multi-container orchestration for Docker"
+HOMEPAGE="https://www.docker.com/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+
+CDEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ >=dev-python/dockerpty-0.3.2[${PYTHON_USEDEP}]
+ <dev-python/dockerpty-0.4[${PYTHON_USEDEP}]
+ >=dev-python/docker-py-1.0.0[${PYTHON_USEDEP}]
+ <dev-python/docker-py-1.2[${PYTHON_USEDEP}]
+ >=dev-python/docopt-0.6.1[${PYTHON_USEDEP}]
+ <dev-python/docopt-0.7[${PYTHON_USEDEP}]
+ >=dev-python/pyyaml-3.10[${PYTHON_USEDEP}]
+ <dev-python/pyyaml-4[${PYTHON_USEDEP}]
+ >=dev-python/requests-2.2.1[${PYTHON_USEDEP}]
+ >=dev-python/six-1.3.0[${PYTHON_USEDEP}]
+ <dev-python/six-2[${PYTHON_USEDEP}]
+ >=dev-python/texttable-0.8.1[${PYTHON_USEDEP}]
+ <dev-python/texttable-0.9[${PYTHON_USEDEP}]
+ >=dev-python/websocket-client-0.11.0[${PYTHON_USEDEP}]
+ <dev-python/websocket-client-1.0[${PYTHON_USEDEP}]
+"
+DEPEND="
+ test? (
+ ${CDEPEND}
+ >=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
+ )
+"
+RDEPEND="${CDEPEND}"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/requests-requirements.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ nosetests tests/unit || die "tests failed under ${EPYTHON}"
+}
+
+python_install_all() {
+ newbashcomp contrib/completion/bash/docker-compose ${PN}
+
+ distutils-r1_python_install_all
+}
diff --git a/app-emulation/docker-compose/files/requests-requirements.patch b/app-emulation/docker-compose/files/requests-requirements.patch
new file mode 100644
index 000000000000..a897baf34618
--- /dev/null
+++ b/app-emulation/docker-compose/files/requests-requirements.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index 39ac0f6..91d8b5b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -27,7 +27,7 @@ def find_version(*file_paths):
+ install_requires = [
+ 'docopt >= 0.6.1, < 0.7',
+ 'PyYAML >= 3.10, < 4',
+- 'requests >= 2.2.1, < 2.6',
++ 'requests >= 2.2.1',
+ 'texttable >= 0.8.1, < 0.9',
+ 'websocket-client >= 0.11.0, < 1.0',
+ 'docker-py >= 1.0.0, < 1.2',
diff --git a/app-emulation/docker-compose/metadata.xml b/app-emulation/docker-compose/metadata.xml
new file mode 100644
index 000000000000..c78064c4e7a9
--- /dev/null
+++ b/app-emulation/docker-compose/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>alunduil@gentoo.org</email>
+ <name>Alex Brandt</name>
+ </maintainer>
+ <longdescription lang="en">
+ </longdescription>
+ <upstream>
+ <remote-id type="pypi">docker-compose</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
new file mode 100644
index 000000000000..3f84dd1c2dd2
--- /dev/null
+++ b/app-emulation/docker/Manifest
@@ -0,0 +1,3 @@
+DIST docker-1.6.1.tar.gz 5713944 SHA256 aa3534277d11b32bc3564b801aeed0502f067317e7e111bd91ce2d989d34c51e SHA512 d2647f191fd295c8a9326e11ddbf6e77f33b70f14e3ebd37db3c9fa1f4946e0e3f426078ee847f52d7c57fc7783d26afe3e5d2e7ff17d8e6bb4f71609e8f5ef2 WHIRLPOOL e12c799ef63a0646f7393b00b6c1e200f350f7089445c58819ae5b53d66d18d985cb9f8fde1cd3ecfa55c2f0186064fc7080b7ebba132404aa15502029881602
+DIST docker-1.6.2.tar.gz 5714121 SHA256 f3a031b23ea9ff0fdbf3ffb9449c64ec51bb053491b47b28000eb4cce9f23203 SHA512 c27bdafabcb8ad2e49bee9e1529141a25596ba2b59435fb9368fc406950d0d7d1cbd876f1f4248dfc7089a22b8a2d13009dd164bde87e37b95a8e502bb49cac9 WHIRLPOOL aea4105ba30104d751203153b6208e363ce0abb3145ee134e675c4bc640e888afb281e7ba9009a30b9af37e829185684427a33b947d8710b49562e3352526c06
+DIST docker-1.7.1.tar.gz 6853527 SHA256 9cd26415d68a88d3cf576e7e78c2fe97f42af795404f552728acc5b41dccf4ef SHA512 9b32c3deab77a27a4322a3ccbb3759a2c2a5627605090c4517c3754e6821407abcf5ffa227bad1fdafcbba068cdcaab586015dd8cfe9aed7e8a221d0615463f1 WHIRLPOOL 41b1afd8ea08c3452e5658d73e85c3b79a64f85fb4cb99c4c6a2ce1ab49836cebbe14724afe47898cb8d9bb9d4d69c64ff1c061895f3b9534150bc7ab50e2b22
diff --git a/app-emulation/docker/docker-1.6.1.ebuild b/app-emulation/docker/docker-1.6.1.ebuild
new file mode 100644
index 000000000000..adabf385234f
--- /dev/null
+++ b/app-emulation/docker/docker-1.6.1.ebuild
@@ -0,0 +1,246 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
+HOMEPAGE="https://www.docker.com"
+
+GITHUB_URI="github.com/docker/docker"
+
+if [[ ${PV} == *9999 ]]; then
+ SRC_URI=""
+ EGIT_REPO_URI="git://${GITHUB_URI}.git"
+ inherit git-2
+else
+ MY_PV="${PV/_/-}"
+ MY_P="${PN}-${MY_PV}"
+ SRC_URI="https://${GITHUB_URI}/archive/v${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+ S="${WORKDIR}/${MY_P}"
+ DOCKER_GITCOMMIT="97cd073"
+ KEYWORDS="~amd64"
+ [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
+fi
+
+inherit bash-completion-r1 eutils linux-info multilib systemd udev user
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="aufs btrfs +contrib +device-mapper doc lxc overlay vim-syntax"
+
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#build-dependencies
+CDEPEND="
+ >=dev-db/sqlite-3.7.9:3
+ device-mapper? (
+ >=sys-fs/lvm2-2.02.89[thin]
+ )
+"
+
+DEPEND="
+ ${CDEPEND}
+ >=dev-lang/go-1.3
+ btrfs? (
+ >=sys-fs/btrfs-progs-3.16.1
+ )
+"
+
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#runtime-dependencies
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#optional-dependencies
+RDEPEND="
+ ${CDEPEND}
+
+ !app-emulation/docker-bin
+ >=net-firewall/iptables-1.4
+ sys-process/procps
+ >=dev-vcs/git-1.7
+ >=app-arch/xz-utils-4.9
+
+ lxc? (
+ >=app-emulation/lxc-1.0.7
+ )
+ aufs? (
+ || (
+ sys-fs/aufs3
+ sys-fs/aufs4
+ sys-kernel/aufs-sources
+ )
+ )
+"
+
+RESTRICT="installsources strip"
+
+# see "contrib/check-config.sh" from upstream's sources
+CONFIG_CHECK="
+ NAMESPACES NET_NS PID_NS IPC_NS UTS_NS
+ DEVPTS_MULTIPLE_INSTANCES
+ CGROUPS CGROUP_CPUACCT CGROUP_DEVICE CGROUP_FREEZER CGROUP_SCHED CPUSETS
+ MACVLAN VETH BRIDGE
+ NF_NAT_IPV4 IP_NF_FILTER IP_NF_TARGET_MASQUERADE
+ NETFILTER_XT_MATCH_ADDRTYPE NETFILTER_XT_MATCH_CONNTRACK
+ NF_NAT NF_NAT_NEEDED
+
+ POSIX_MQUEUE
+
+ ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
+ ~RESOURCE_COUNTERS
+ ~CGROUP_PERF
+ ~CFS_BANDWIDTH
+"
+
+ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
+ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
+ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
+ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
+
+pkg_setup() {
+ if kernel_is lt 3 8; then
+ eerror ""
+ eerror "Using Docker with kernels older than 3.8 is unstable and unsupported."
+ eerror " - http://docs.docker.com/installation/binaries/#check-kernel-dependencies"
+ die 'Kernel is too old - need 3.8 or above'
+ fi
+
+ # for where these kernel versions come from, see:
+ # https://www.google.com/search?q=945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f+site%3Akernel.org%2Fpub%2Flinux%2Fkernel+file%3AChangeLog*
+ if ! {
+ kernel_is ge 3 16 \
+ || { kernel_is 3 15 && kernel_is ge 3 15 5; } \
+ || { kernel_is 3 14 && kernel_is ge 3 14 12; } \
+ || { kernel_is 3 12 && kernel_is ge 3 12 25; }
+ }; then
+ ewarn ""
+ ewarn "There is a serious Docker-related kernel panic that has been fixed in 3.16+"
+ ewarn " (and was backported to 3.15.5+, 3.14.12+, and 3.12.25+)"
+ ewarn ""
+ ewarn "See also https://github.com/docker/docker/issues/2960"
+ fi
+
+ if use aufs; then
+ CONFIG_CHECK+="
+ ~AUFS_FS
+ ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ # TODO there must be a way to detect "sys-kernel/aufs-sources" so we don't warn "sys-fs/aufs3" users about this
+ # an even better solution would be to check if the current kernel sources include CONFIG_AUFS_FS as an option, but that sounds hairy and error-prone
+ ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used"
+ fi
+
+ if use btrfs; then
+ CONFIG_CHECK+="
+ ~BTRFS_FS
+ "
+ fi
+
+ if use device-mapper; then
+ CONFIG_CHECK+="
+ ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ fi
+
+ if use overlay; then
+ CONFIG_CHECK+="
+ ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
+ "
+ fi
+
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ # allow user patches (use sparingly - upstream won't support them)
+ epatch_user
+}
+
+src_compile() {
+ # if we treat them right, Docker's build scripts will set up a
+ # reasonable GOPATH for us
+ export AUTO_GOPATH=1
+
+ # setup CFLAGS and LDFLAGS for separate build target
+ # see https://github.com/tianon/docker-overlay/pull/10
+ export CGO_CFLAGS="-I${ROOT}/usr/include"
+ export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
+
+ # if we're building from a zip, we need the GITCOMMIT value
+ [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
+
+ if gcc-specs-pie; then
+ sed -i "s/EXTLDFLAGS_STATIC='/EXTLDFLAGS_STATIC='-fno-PIC /" hack/make.sh || die
+ grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
+
+ sed -i "s/LDFLAGS_STATIC_DOCKER='/LDFLAGS_STATIC_DOCKER='-extldflags -fno-PIC /" hack/make/dynbinary || die
+ grep -q -- '-fno-PIC' hack/make/dynbinary || die 'hardened sed failed'
+ fi
+
+ # let's set up some optional features :)
+ export DOCKER_BUILDTAGS=''
+ for gd in aufs btrfs device-mapper overlay; do
+ if ! use $gd; then
+ DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
+ fi
+ done
+
+ # time to build!
+ ./hack/make.sh dynbinary || die 'dynbinary failed'
+
+ # TODO get go-md2man and then include the man pages using docs/man/md2man-all.sh
+}
+
+src_install() {
+ VERSION=$(cat VERSION)
+ newbin bundles/$VERSION/dynbinary/docker-$VERSION docker
+ exeinto /usr/libexec/docker
+ newexe bundles/$VERSION/dynbinary/dockerinit-$VERSION dockerinit
+
+ newinitd contrib/init/openrc/docker.initd docker
+ newconfd contrib/init/openrc/docker.confd docker
+
+ systemd_dounit contrib/init/systemd/docker.{service,socket}
+
+ udev_dorules contrib/udev/*.rules
+
+ dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
+ if use doc; then
+ # TODO doman contrib/man/man*/*
+
+ docompress -x /usr/share/doc/${PF}/md
+ docinto md
+ dodoc -r docs/sources/*
+ fi
+
+ dobashcomp contrib/completion/bash/*
+
+ insinto /usr/share/zsh/site-functions
+ doins contrib/completion/zsh/*
+
+ if use vim-syntax; then
+ insinto /usr/share/vim/vimfiles
+ doins -r contrib/syntax/vim/ftdetect
+ doins -r contrib/syntax/vim/syntax
+ fi
+
+ if use contrib; then
+ mkdir -p "${D}/usr/share/${PN}/contrib"
+ cp -R contrib/* "${D}/usr/share/${PN}/contrib"
+ fi
+}
+
+pkg_postinst() {
+ udev_reload
+
+ elog ""
+ elog "To use Docker, the Docker daemon must be running as root. To automatically"
+ elog "start the Docker daemon at boot, add Docker to the default runlevel:"
+ elog " rc-update add docker default"
+ elog "Similarly for systemd:"
+ elog " systemctl enable docker.service"
+ elog ""
+
+ # create docker group if the code checking for it in /etc/group exists
+ enewgroup docker
+
+ elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
+ elog " usermod -aG docker youruser"
+ elog ""
+}
diff --git a/app-emulation/docker/docker-1.6.2.ebuild b/app-emulation/docker/docker-1.6.2.ebuild
new file mode 100644
index 000000000000..b2b8d550a325
--- /dev/null
+++ b/app-emulation/docker/docker-1.6.2.ebuild
@@ -0,0 +1,246 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
+HOMEPAGE="https://www.docker.com"
+
+GITHUB_URI="github.com/docker/docker"
+
+if [[ ${PV} == *9999 ]]; then
+ SRC_URI=""
+ EGIT_REPO_URI="git://${GITHUB_URI}.git"
+ inherit git-2
+else
+ MY_PV="${PV/_/-}"
+ MY_P="${PN}-${MY_PV}"
+ SRC_URI="https://${GITHUB_URI}/archive/v${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+ S="${WORKDIR}/${MY_P}"
+ DOCKER_GITCOMMIT="7c8fca2"
+ KEYWORDS="~amd64"
+ [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
+fi
+
+inherit bash-completion-r1 linux-info multilib systemd udev user
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="aufs btrfs +contrib +device-mapper doc lxc overlay vim-syntax"
+
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#build-dependencies
+CDEPEND="
+ >=dev-db/sqlite-3.7.9:3
+ device-mapper? (
+ >=sys-fs/lvm2-2.02.89[thin]
+ )
+"
+
+DEPEND="
+ ${CDEPEND}
+ >=dev-lang/go-1.3
+ btrfs? (
+ >=sys-fs/btrfs-progs-3.16.1
+ )
+"
+
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#runtime-dependencies
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#optional-dependencies
+RDEPEND="
+ ${CDEPEND}
+
+ !app-emulation/docker-bin
+ >=net-firewall/iptables-1.4
+ sys-process/procps
+ >=dev-vcs/git-1.7
+ >=app-arch/xz-utils-4.9
+
+ lxc? (
+ >=app-emulation/lxc-1.0.7
+ )
+ aufs? (
+ || (
+ sys-fs/aufs3
+ sys-fs/aufs4
+ sys-kernel/aufs-sources
+ )
+ )
+"
+
+RESTRICT="installsources strip"
+
+# see "contrib/check-config.sh" from upstream's sources
+CONFIG_CHECK="
+ NAMESPACES NET_NS PID_NS IPC_NS UTS_NS
+ DEVPTS_MULTIPLE_INSTANCES
+ CGROUPS CGROUP_CPUACCT CGROUP_DEVICE CGROUP_FREEZER CGROUP_SCHED CPUSETS
+ MACVLAN VETH BRIDGE
+ NF_NAT_IPV4 IP_NF_FILTER IP_NF_TARGET_MASQUERADE
+ NETFILTER_XT_MATCH_ADDRTYPE NETFILTER_XT_MATCH_CONNTRACK
+ NF_NAT NF_NAT_NEEDED
+
+ POSIX_MQUEUE
+
+ ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
+ ~RESOURCE_COUNTERS
+ ~CGROUP_PERF
+ ~CFS_BANDWIDTH
+"
+
+ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
+ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
+ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
+ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
+
+pkg_setup() {
+ if kernel_is lt 3 10; then
+ eerror ""
+ eerror "Using Docker with kernels older than 3.10 is unstable and unsupported."
+ eerror " - http://docs.docker.com/installation/binaries/#check-kernel-dependencies"
+ die 'Kernel is too old - need 3.10 or above'
+ fi
+
+ # for where these kernel versions come from, see:
+ # https://www.google.com/search?q=945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f+site%3Akernel.org%2Fpub%2Flinux%2Fkernel+file%3AChangeLog*
+ if ! {
+ kernel_is ge 3 16 \
+ || { kernel_is 3 15 && kernel_is ge 3 15 5; } \
+ || { kernel_is 3 14 && kernel_is ge 3 14 12; } \
+ || { kernel_is 3 12 && kernel_is ge 3 12 25; }
+ }; then
+ ewarn ""
+ ewarn "There is a serious Docker-related kernel panic that has been fixed in 3.16+"
+ ewarn " (and was backported to 3.15.5+, 3.14.12+, and 3.12.25+)"
+ ewarn ""
+ ewarn "See also https://github.com/docker/docker/issues/2960"
+ fi
+
+ if use aufs; then
+ CONFIG_CHECK+="
+ ~AUFS_FS
+ ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ # TODO there must be a way to detect "sys-kernel/aufs-sources" so we don't warn "sys-fs/aufs3" users about this
+ # an even better solution would be to check if the current kernel sources include CONFIG_AUFS_FS as an option, but that sounds hairy and error-prone
+ ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used"
+ fi
+
+ if use btrfs; then
+ CONFIG_CHECK+="
+ ~BTRFS_FS
+ "
+ fi
+
+ if use device-mapper; then
+ CONFIG_CHECK+="
+ ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ fi
+
+ if use overlay; then
+ CONFIG_CHECK+="
+ ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
+ "
+ fi
+
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ # allow user patches (use sparingly - upstream won't support them)
+ epatch_user
+}
+
+src_compile() {
+ # if we treat them right, Docker's build scripts will set up a
+ # reasonable GOPATH for us
+ export AUTO_GOPATH=1
+
+ # setup CFLAGS and LDFLAGS for separate build target
+ # see https://github.com/tianon/docker-overlay/pull/10
+ export CGO_CFLAGS="-I${ROOT}/usr/include"
+ export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
+
+ # if we're building from a zip, we need the GITCOMMIT value
+ [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
+
+ if gcc-specs-pie; then
+ sed -i "s/EXTLDFLAGS_STATIC='/EXTLDFLAGS_STATIC='-fno-PIC /" hack/make.sh || die
+ grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
+
+ sed -i "s/LDFLAGS_STATIC_DOCKER='/LDFLAGS_STATIC_DOCKER='-extldflags -fno-PIC /" hack/make/dynbinary || die
+ grep -q -- '-fno-PIC' hack/make/dynbinary || die 'hardened sed failed'
+ fi
+
+ # let's set up some optional features :)
+ export DOCKER_BUILDTAGS=''
+ for gd in aufs btrfs device-mapper overlay; do
+ if ! use $gd; then
+ DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
+ fi
+ done
+
+ # time to build!
+ ./hack/make.sh dynbinary || die 'dynbinary failed'
+
+ # TODO get go-md2man and then include the man pages using docs/man/md2man-all.sh
+}
+
+src_install() {
+ VERSION=$(cat VERSION)
+ newbin bundles/$VERSION/dynbinary/docker-$VERSION docker
+ exeinto /usr/libexec/docker
+ newexe bundles/$VERSION/dynbinary/dockerinit-$VERSION dockerinit
+
+ newinitd contrib/init/openrc/docker.initd docker
+ newconfd contrib/init/openrc/docker.confd docker
+
+ systemd_dounit contrib/init/systemd/docker.{service,socket}
+
+ udev_dorules contrib/udev/*.rules
+
+ dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
+ if use doc; then
+ # TODO doman contrib/man/man*/*
+
+ docompress -x /usr/share/doc/${PF}/md
+ docinto md
+ dodoc -r docs/sources/*
+ fi
+
+ dobashcomp contrib/completion/bash/*
+
+ insinto /usr/share/zsh/site-functions
+ doins contrib/completion/zsh/*
+
+ if use vim-syntax; then
+ insinto /usr/share/vim/vimfiles
+ doins -r contrib/syntax/vim/ftdetect
+ doins -r contrib/syntax/vim/syntax
+ fi
+
+ if use contrib; then
+ mkdir -p "${D}/usr/share/${PN}/contrib"
+ cp -R contrib/* "${D}/usr/share/${PN}/contrib"
+ fi
+}
+
+pkg_postinst() {
+ udev_reload
+
+ elog ""
+ elog "To use Docker, the Docker daemon must be running as root. To automatically"
+ elog "start the Docker daemon at boot, add Docker to the default runlevel:"
+ elog " rc-update add docker default"
+ elog "Similarly for systemd:"
+ elog " systemctl enable docker.service"
+ elog ""
+
+ # create docker group if the code checking for it in /etc/group exists
+ enewgroup docker
+
+ elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
+ elog " usermod -aG docker youruser"
+ elog ""
+}
diff --git a/app-emulation/docker/docker-1.7.1.ebuild b/app-emulation/docker/docker-1.7.1.ebuild
new file mode 100644
index 000000000000..d660fc3aac7b
--- /dev/null
+++ b/app-emulation/docker/docker-1.7.1.ebuild
@@ -0,0 +1,268 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
+HOMEPAGE="https://www.docker.com"
+
+GITHUB_URI="github.com/docker/docker"
+
+if [[ ${PV} == *9999 ]]; then
+ SRC_URI=""
+ EGIT_REPO_URI="git://${GITHUB_URI}.git"
+ inherit git-2
+else
+ MY_PV="${PV/_/-}"
+ MY_P="${PN}-${MY_PV}"
+ SRC_URI="https://${GITHUB_URI}/archive/v${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+ S="${WORKDIR}/${MY_P}"
+ DOCKER_GITCOMMIT="786b29d"
+ KEYWORDS="~amd64"
+ [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
+fi
+
+inherit bash-completion-r1 linux-info multilib systemd udev user
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="apparmor aufs btrfs +contrib +device-mapper doc experimental lxc overlay vim-syntax"
+
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#build-dependencies
+CDEPEND="
+ >=dev-db/sqlite-3.7.9:3
+ device-mapper? (
+ >=sys-fs/lvm2-2.02.89[thin]
+ )
+"
+
+DEPEND="
+ ${CDEPEND}
+ >=dev-lang/go-1.4:=
+ btrfs? (
+ >=sys-fs/btrfs-progs-3.8
+ )
+"
+
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#runtime-dependencies
+# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#optional-dependencies
+RDEPEND="
+ ${CDEPEND}
+
+ !app-emulation/docker-bin
+ >=net-firewall/iptables-1.4
+ sys-process/procps
+ >=dev-vcs/git-1.7
+ >=app-arch/xz-utils-4.9
+
+ lxc? (
+ >=app-emulation/lxc-1.0.7
+ )
+ aufs? (
+ || (
+ sys-fs/aufs3
+ sys-fs/aufs4
+ sys-kernel/aufs-sources
+ )
+ )
+
+ apparmor? (
+ sys-libs/libapparmor[static-libs]
+ )
+"
+
+RESTRICT="installsources strip"
+
+# see "contrib/check-config.sh" from upstream's sources
+CONFIG_CHECK="
+ ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS
+ ~MACVLAN ~VETH ~BRIDGE ~BRIDGE_NETFILTER
+ ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
+ ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK
+ ~NF_NAT ~NF_NAT_NEEDED
+
+ ~POSIX_MQUEUE
+
+ ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
+
+ ~BLK_CGROUP
+ ~IOSCHED_CFQ
+ ~CGROUP_PERF
+ ~CFS_BANDWIDTH
+"
+
+ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
+ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
+ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
+ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
+
+pkg_setup() {
+ if kernel_is lt 3 10; then
+ ewarn ""
+ ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
+ ewarn " - http://docs.docker.com/installation/binaries/#check-kernel-dependencies"
+ fi
+
+ # for where these kernel versions come from, see:
+ # https://www.google.com/search?q=945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f+site%3Akernel.org%2Fpub%2Flinux%2Fkernel+file%3AChangeLog*
+ if ! {
+ kernel_is ge 3 16 \
+ || { kernel_is 3 15 && kernel_is ge 3 15 5; } \
+ || { kernel_is 3 14 && kernel_is ge 3 14 12; } \
+ || { kernel_is 3 12 && kernel_is ge 3 12 25; }
+ }; then
+ ewarn ""
+ ewarn "There is a serious Docker-related kernel panic that has been fixed in 3.16+"
+ ewarn " (and was backported to 3.15.5+, 3.14.12+, and 3.12.25+)"
+ ewarn ""
+ ewarn "See also https://github.com/docker/docker/issues/2960"
+ fi
+
+ if kernel_is le 3 18; then
+ CONFIG_CHECK+="
+ ~RESOURCE_COUNTERS
+ "
+ fi
+
+ if use aufs; then
+ CONFIG_CHECK+="
+ ~AUFS_FS
+ ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ # TODO there must be a way to detect "sys-kernel/aufs-sources" so we don't warn "sys-fs/aufs3" users about this
+ # an even better solution would be to check if the current kernel sources include CONFIG_AUFS_FS as an option, but that sounds hairy and error-prone
+ ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used"
+ fi
+
+ if use btrfs; then
+ CONFIG_CHECK+="
+ ~BTRFS_FS
+ "
+ fi
+
+ if use device-mapper; then
+ CONFIG_CHECK+="
+ ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ fi
+
+ if use overlay; then
+ CONFIG_CHECK+="
+ ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
+ "
+ fi
+
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ # allow user patches (use sparingly - upstream won't support them)
+ epatch_user
+}
+
+src_compile() {
+ # if we treat them right, Docker's build scripts will set up a
+ # reasonable GOPATH for us
+ export AUTO_GOPATH=1
+
+ # setup CFLAGS and LDFLAGS for separate build target
+ # see https://github.com/tianon/docker-overlay/pull/10
+ export CGO_CFLAGS="-I${ROOT}/usr/include"
+ export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
+
+ # if we're building from a zip, we need the GITCOMMIT value
+ [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
+
+ if gcc-specs-pie; then
+ sed -i "s/EXTLDFLAGS_STATIC='/EXTLDFLAGS_STATIC='-fno-PIC /" hack/make.sh || die
+ grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
+
+ sed -i "s/LDFLAGS_STATIC_DOCKER='/LDFLAGS_STATIC_DOCKER='-extldflags -fno-PIC /" hack/make/dynbinary || die
+ grep -q -- '-fno-PIC' hack/make/dynbinary || die 'hardened sed failed'
+ fi
+
+ # let's set up some optional features :)
+ export DOCKER_BUILDTAGS=''
+ for gd in aufs btrfs device-mapper overlay; do
+ if ! use $gd; then
+ DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
+ fi
+ done
+
+ if use apparmor; then
+ DOCKER_BUILDTAGS+=' apparmor'
+ fi
+
+ # https://github.com/docker/docker/pull/13338
+ if use experimental; then
+ export DOCKER_EXPERIMENTAL=1
+ else
+ unset DOCKER_EXPERIMENTAL
+ fi
+
+ # time to build!
+ ./hack/make.sh dynbinary || die 'dynbinary failed'
+
+ # TODO get go-md2man and then include the man pages using man/md2man-all.sh
+}
+
+src_install() {
+ VERSION=$(cat VERSION)
+ newbin bundles/$VERSION/dynbinary/docker-$VERSION docker
+ exeinto /usr/libexec/docker
+ newexe bundles/$VERSION/dynbinary/dockerinit-$VERSION dockerinit
+
+ newinitd contrib/init/openrc/docker.initd docker
+ newconfd contrib/init/openrc/docker.confd docker
+
+ systemd_dounit contrib/init/systemd/docker.{service,socket}
+
+ udev_dorules contrib/udev/*.rules
+
+ dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
+ if use doc; then
+ # TODO doman man/man*/*
+
+ docompress -x /usr/share/doc/${PF}/md
+ docinto md
+ dodoc -r docs/*
+ fi
+
+ dobashcomp contrib/completion/bash/*
+
+ insinto /usr/share/zsh/site-functions
+ doins contrib/completion/zsh/*
+
+ if use vim-syntax; then
+ insinto /usr/share/vim/vimfiles
+ doins -r contrib/syntax/vim/ftdetect
+ doins -r contrib/syntax/vim/syntax
+ fi
+
+ if use contrib; then
+ mkdir -p "${D}/usr/share/${PN}/contrib"
+ cp -R contrib/* "${D}/usr/share/${PN}/contrib"
+ fi
+}
+
+pkg_postinst() {
+ udev_reload
+
+ elog ""
+ elog "To use Docker, the Docker daemon must be running as root. To automatically"
+ elog "start the Docker daemon at boot, add Docker to the default runlevel:"
+ elog " rc-update add docker default"
+ elog "Similarly for systemd:"
+ elog " systemctl enable docker.service"
+ elog ""
+
+ # create docker group if the code checking for it in /etc/group exists
+ enewgroup docker
+
+ elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
+ elog " usermod -aG docker youruser"
+ elog ""
+}
diff --git a/app-emulation/docker/files/7179-add-audit_write-cap.patch b/app-emulation/docker/files/7179-add-audit_write-cap.patch
new file mode 100644
index 000000000000..6263698cea22
--- /dev/null
+++ b/app-emulation/docker/files/7179-add-audit_write-cap.patch
@@ -0,0 +1,29 @@
+From 29ecc95c31ecfe15e3b3d8db94cea1c555e526a3 Mon Sep 17 00:00:00 2001
+From: Alexandr Morozov <lk4d4math@gmail.com>
+Date: Wed, 23 Jul 2014 09:57:41 +0400
+Subject: [PATCH] Add AUDIT_WRITE cap
+
+Fixes #6345
+
+Thanks @larsks for outstanding investigation
+
+Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
+---
+ daemon/execdriver/native/template/default_template.go | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/daemon/execdriver/native/template/default_template.go b/daemon/execdriver/native/template/default_template.go
+index cc5cc4f..be3dd5a 100644
+--- a/daemon/execdriver/native/template/default_template.go
++++ b/daemon/execdriver/native/template/default_template.go
+@@ -23,6 +23,7 @@ func New() *libcontainer.Config {
+ "NET_BIND_SERVICE",
+ "SYS_CHROOT",
+ "KILL",
++ "AUDIT_WRITE",
+ },
+ Namespaces: map[string]bool{
+ "NEWNS": true,
+--
+2.0.3
+
diff --git a/app-emulation/docker/files/docker-r2.confd b/app-emulation/docker/files/docker-r2.confd
new file mode 100644
index 000000000000..5436b2339d99
--- /dev/null
+++ b/app-emulation/docker/files/docker-r2.confd
@@ -0,0 +1,18 @@
+# /etc/conf.d/docker: config file for /etc/init.d/docker
+
+# where the docker daemon output gets piped
+#DOCKER_LOGFILE="/var/log/docker.log"
+
+# where docker's pid get stored
+#DOCKER_PIDFILE="/run/docker.pid"
+
+# where the docker daemon itself is run from
+#DOCKER_BINARY="/usr/bin/docker"
+
+# uncomment this for a simple workaround to
+# https://github.com/dotcloud/docker/issues/1422
+#DOCKER_WORKAROUND_1422="1"
+
+# if you find that the default DOCKER_WORKAROUND_1422 delay of one second
+# is not sufficient, try uncommenting and increasing this value
+#DOCKER_WORKAROUND_1422_DELAY="1"
diff --git a/app-emulation/docker/files/docker-r2.initd b/app-emulation/docker/files/docker-r2.initd
new file mode 100755
index 000000000000..b081d9c77094
--- /dev/null
+++ b/app-emulation/docker/files/docker-r2.initd
@@ -0,0 +1,54 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DOCKER_LOGFILE=${DOCKER_LOGFILE:-/var/log/${SVCNAME}.log}
+DOCKER_PIDFILE=${DOCKER_PIDFILE:-/run/${SVCNAME}.pid}
+DOCKER_BINARY=${DOCKER_BINARY:-/usr/bin/docker}
+DOCKER_WORKAROUND_1422=${DOCKER_WORKAROUND_1422:-0}
+DOCKER_WORKAROUND_1422_DELAY=${DOCKER_WORKAROUND_1422_DELAY:-1}
+
+start() {
+ checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
+
+ ebegin "Starting docker daemon"
+ start-stop-daemon --start --background \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE" \
+ --stdout "$DOCKER_LOGFILE" \
+ --stderr "$DOCKER_LOGFILE" \
+ -- -d -p "$DOCKER_PIDFILE"
+ eend $?
+ ret=$?
+
+ if [ $ret -eq 0 ] \
+ && [ "$DOCKER_WORKAROUND_1422" ] \
+ && [ "$DOCKER_WORKAROUND_1422" -gt 0 ] \
+ ; then
+ # see https://github.com/dotcloud/docker/issues/1422
+ ewarn "Working around gh#1422 (via busybox image); this may take a moment"
+
+ # we were calling "docker run" more quickly than "docker -d" could get
+ # fired up, so our workaround wasn't successful without a short delay
+ sleep $DOCKER_WORKAROUND_1422_DELAY
+
+ # TODO when we get https://github.com/dotcloud/docker/pull/1589, these
+ # both need -rm so we clean up after ourselves (thanks, @eliasp!)
+ docker run -i -t busybox true &> /dev/null || true
+ # first run will fail, so we ignore its output and result and run again
+ docker run -i -t busybox true
+
+ ewend $?
+ fi
+
+ return $ret
+}
+
+stop() {
+ ebegin "Stopping docker daemon"
+ start-stop-daemon --stop \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE"
+ eend $?
+}
diff --git a/app-emulation/docker/files/docker-r3.confd b/app-emulation/docker/files/docker-r3.confd
new file mode 100644
index 000000000000..ae247c007e33
--- /dev/null
+++ b/app-emulation/docker/files/docker-r3.confd
@@ -0,0 +1,13 @@
+# /etc/conf.d/docker: config file for /etc/init.d/docker
+
+# where the docker daemon output gets piped
+#DOCKER_LOGFILE="/var/log/docker.log"
+
+# where docker's pid get stored
+#DOCKER_PIDFILE="/run/docker.pid"
+
+# where the docker daemon itself is run from
+#DOCKER_BINARY="/usr/bin/docker"
+
+# any other random options you want to pass to docker
+DOCKER_OPTS=""
diff --git a/app-emulation/docker/files/docker-r3.initd b/app-emulation/docker/files/docker-r3.initd
new file mode 100755
index 000000000000..a30318509c4b
--- /dev/null
+++ b/app-emulation/docker/files/docker-r3.initd
@@ -0,0 +1,31 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DOCKER_LOGFILE=${DOCKER_LOGFILE:-/var/log/${SVCNAME}.log}
+DOCKER_PIDFILE=${DOCKER_PIDFILE:-/run/${SVCNAME}.pid}
+DOCKER_BINARY=${DOCKER_BINARY:-/usr/bin/docker}
+DOCKER_OPTS=${DOCKER_OPTS:-}
+
+start() {
+ checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
+
+ ebegin "Starting docker daemon"
+ start-stop-daemon --start --background \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE" \
+ --stdout "$DOCKER_LOGFILE" \
+ --stderr "$DOCKER_LOGFILE" \
+ -- -d -p "$DOCKER_PIDFILE" \
+ $DOCKER_OPTS
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping docker daemon"
+ start-stop-daemon --stop \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE"
+ eend $?
+}
diff --git a/app-emulation/docker/files/docker.initd b/app-emulation/docker/files/docker.initd
new file mode 100755
index 000000000000..18ca8ab9d764
--- /dev/null
+++ b/app-emulation/docker/files/docker.initd
@@ -0,0 +1,31 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DOCKER_LOGFILE=${DOCKER_LOGFILE:-/var/log/${SVCNAME}.log}
+DOCKER_PIDFILE=${DOCKER_PIDFILE:-/run/${SVCNAME}.pid}
+DOCKER_BINARY=${DOCKER_BINARY:-/usr/bin/docker}
+
+start() {
+ touch "$DOCKER_LOGFILE"
+ chown root:docker "$DOCKER_LOGFILE"
+ chmod 0644 "$DOCKER_LOGFILE"
+
+ ebegin "Starting docker daemon"
+ start-stop-daemon --start --background \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE" \
+ --stdout "$DOCKER_LOGFILE" \
+ --stderr "$DOCKER_LOGFILE" \
+ -- -d -p "$DOCKER_PIDFILE"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping docker daemon"
+ start-stop-daemon --stop \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE"
+ eend $?
+}
diff --git a/app-emulation/docker/files/docker.service b/app-emulation/docker/files/docker.service
new file mode 100644
index 000000000000..dde89a214adb
--- /dev/null
+++ b/app-emulation/docker/files/docker.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Easily create lightweight, portable, self-sufficient containers from any application!
+Requires=network.target
+After=multi-user.target
+
+[Service]
+Type=simple
+ExecStartPre=/bin/mount --make-rprivate /
+ExecStart=/usr/bin/docker -d
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-emulation/docker/metadata.xml b/app-emulation/docker/metadata.xml
new file mode 100644
index 000000000000..a8f4c2c14832
--- /dev/null
+++ b/app-emulation/docker/metadata.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription>
+ Docker is an open-source project to easily create lightweight,
+ portable, self-sufficient containers from any application. The same
+ container that a developer builds and tests on a laptop can run at
+ scale, in production, on VMs, bare metal, OpenStack clusters, public
+ clouds and more.
+ </longdescription>
+ <herd>proxy-maintainers</herd>
+ <maintainer status="active">
+ <email>admwiggin@gmail.com</email>
+ <name>Tianon</name>
+ </maintainer>
+ <maintainer>
+ <email>xarthisius@gentoo.org</email>
+ <name>Kacper Kowalik</name>
+ </maintainer>
+ <maintainer>
+ <email>alunduil@gentoo.org</email>
+ <name>Alex Brandt</name>
+ </maintainer>
+ <use>
+ <flag name="aufs">
+ Enables dependencies for the "aufs" graph driver, including
+ necessary kernel flags.
+ </flag>
+ <flag name="apparmor">
+ Enable AppArmor support.
+ </flag>
+ <flag name="btrfs">
+ Enables dependencies for the "btrfs" graph driver, including
+ necessary kernel flags.
+ </flag>
+ <flag name="contrib">
+ Install additional contrib scripts and components.
+ </flag>
+ <flag name="device-mapper">
+ Enables dependencies for the "devicemapper" graph driver, including
+ necessary kernel flags.
+ </flag>
+ <flag name="experimental">
+ Enable features labelled by upstream to be of "experimental"
+ quality and not yet ready for general consumption.
+ </flag>
+ <flag name="overlay">
+ Enables dependencies for the "overlay" graph driver, including
+ necessary kernel flags.
+ </flag>
+ <flag name="lxc">
+ Enables dependencies for the "lxc" execution driver.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="github">docker/docker</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/domi/Manifest b/app-emulation/domi/Manifest
new file mode 100644
index 000000000000..469488ebbc05
--- /dev/null
+++ b/app-emulation/domi/Manifest
@@ -0,0 +1 @@
+DIST domi-20060816-153213.tar.gz 15503 SHA256 2eba3bbd36738764a1443544388472dbc603db81974b74402954d2693d231c78 SHA512 ea8fea65860f399ea1f4474f7cba957c29298b126c6b8aded1af07a09e987bad6d5fbe9af552977d33480562e28e77774690c6f5d6958e29f3533c892a69c207 WHIRLPOOL 0d71ff2cc25496e6c3dfa35f5a7f96a071a0ff2ec683f709a9479f89f4b98f8d8ce37ceb1982289e6f1f853a78f22b694e83a2b1d4eaa6ce0dcf60e079df02d8
diff --git a/app-emulation/domi/domi-20060816.ebuild b/app-emulation/domi/domi-20060816.ebuild
new file mode 100644
index 000000000000..5384bc754b3f
--- /dev/null
+++ b/app-emulation/domi/domi-20060816.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+DESCRIPTION="Scripts for building Xen domains"
+HOMEPAGE="http://www.bytesex.org"
+EXTRA_VERSION="153213"
+SRC_URI="http://dl.bytesex.org/cvs-snapshots/${P}-${EXTRA_VERSION}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+DEPEND="app-emulation/xen-tools
+ app-arch/rpm
+ sys-block/parted
+ sys-apps/yum
+ sys-fs/lvm2
+ sys-fs/multipath-tools"
+# there are some other depends we may need depending on the target system
+# these packages aren't in gentoo yet. feel free to submit ebuilds via bugzilla.
+# y2pmsh
+RESTRICT="test"
+
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${A}
+ sed -i -e 's:/dev/loop\$:/dev/loop/\$:' "${S}"/domi
+ cd "${S}"
+ epatch "${FILESDIR}"/fix_install_links.patch
+}
+
+src_install() {
+ einstall || die
+ insinto /etc
+ doins "${FILESDIR}"/domi.conf || die
+}
diff --git a/app-emulation/domi/files/domi.conf b/app-emulation/domi/files/domi.conf
new file mode 100644
index 000000000000..429a16505156
--- /dev/null
+++ b/app-emulation/domi/files/domi.conf
@@ -0,0 +1,95 @@
+#!/bin/bash
+#This script is generated by http://bugs.gentoo.org/show_bug.cgi?id=112407 and the domi.man file
+#domi - xen domain installer /etc/domi.conf
+#domi is a shell script which sets up virtual machines. It creates
+#virtual disks using either LVM or image files and installs a linux
+#distribution on the newly created disk.
+#
+#domi reads the configuration from /etc/domi.conf and the config file
+#passed on the command line. Then goes ahead and sets up the virtual
+#disk without asking further questions, so be careful.
+#The config files are simply sourced. Thus the syntax for setting the
+#config options is the usual shell variable style, i.e. VAR="value",
+#hashmark works for comments and so on.
+############################################
+#DOMI_NAME="myexample" # Required
+DOMI_NAME=" "
+
+##Name of the virtual machine.
+#Distribution to install. Valid choices are suse, fedora, debian and gentoo.
+#DOMI_DISTRO="gentoo" # Required.
+DOMI_DISTRO=""
+
+#DOMI_CACHE Location where downloaded files are cached.
+#Default: /var/cache/domi
+DOMI_CACHE="/var/cache/domi"
+
+#DOMI_FSTYPE File system to use
+#Default: ext2
+DOMI_FSTYPE="ext2"
+
+#DOMI_PASSWD Initial root password
+#Default: root
+DOMI_PASSWD="secret"
+
+#DOMI_VDISK
+#Name of the virtual disk (inside the vm). "xvda" should do just
+#fine with all modern, udev-based distros which create the device
+#nodes automatically. In case of trouble you can try "hda" instead.
+#Default: xvda
+DOMI_VDISK="xvda"
+
+#DOMI_XEN_CONF
+#Recommended.
+#If specified the script writes a initial Xen config file to the given
+#location.
+#DOMI_XEN_CONF="/etc/xen/auto/myexample-startscript"
+DOMI_XEN_CONF=" "
+
+#DOMI_XEN_KERNEL Xen kernel (for the Xen config file).
+#Default: /boot/vmlinuz-xen
+#DOMI_XEN_KERNEL="/path/to/the/DomU-kernel"
+DOMI_XEN_KERNEL=""
+
+#DOMI_XEN_MEMORY
+#Main memory (for the Xen config file, in megabytes).
+#Default: 128
+DOMI_XEN_MEMORY="128"
+
+#DOMI_DISK_VG
+#LVM volume group to use for storage. If specied the script will
+#create a volume with DOMI_NAME in that volume group and use it to
+#setup the virtual disk.
+#Recommended.
+#DOMI_DISK_VG="volg-md9"# without a "/"
+DOMI_DISK_VG=""
+
+#DOMI_DISK_FILE
+#If you don't use LVM you can specify an image file to use for the
+#virtual disk. Setting either DOMI_DISK_VG or DOMI_DISK_FILE is
+#required.
+#DOMI_DISK_FILE="/path/to/my/myexample.file"
+DOMI_DISK_FILE=""
+
+#DOMI_DISK_SPARSE
+#Set this to some non-empty value to make domi use sparse file for the
+#disk images. Has no effect if you use LVM.
+
+#DOMI_DISK_SIZE
+#Default: 4096
+#Size of the virtual disk, in megabytes.
+DOMI_DISK_SIZE="4096"
+
+#DOMI_SWAP_SIZE
+#Default: 256
+#Size of the swap partition, in megabytes.
+DOMI_SWAP_SIZE="256"
+
+#DOMI_ROOT_SIZE
+#Default: DOMI_DISK_SIZE - DOMI_SWAP_SIZE
+#Size if the root filesystem, in megabytes
+
+#DOMI_HOOK_POST
+#Custom postinstall script to run.
+
+###################
diff --git a/app-emulation/domi/files/fix_install_links.patch b/app-emulation/domi/files/fix_install_links.patch
new file mode 100644
index 000000000000..29a7eb7ca299
--- /dev/null
+++ b/app-emulation/domi/files/fix_install_links.patch
@@ -0,0 +1,15 @@
+--- Makefile.orig 2008-10-05 18:59:51.000000000 +0200
++++ Makefile 2008-10-05 19:37:58.000000000 +0200
+@@ -23,9 +23,9 @@
+ install -d $(DESTDIR)$(mandir)/man8
+ install -m755 $(scripts) $(DESTDIR)$(libdir)
+ install -m644 domi.man $(DESTDIR)$(mandir)/man8/domi.8
+- ln -s $(libdir)/domi $(DESTDIR)$(bindir)/domi
+- ln -s $(libdir)/ttylinux $(DESTDIR)$(bindir)/ttylinux
+- ln -s $(libdir)/initramfs $(DESTDIR)$(bindir)/busybox.initramfs
++ ln -s ../share/domi/domi $(bindir)/domi
++ ln -s ../share/domi/ttylinux $(bindir)/ttylinux
++ ln -s ../share/domi/initramfs $(bindir)/busybox.initramfs
+
+ test:
+ su -c tests/Run
diff --git a/app-emulation/domi/metadata.xml b/app-emulation/domi/metadata.xml
new file mode 100644
index 000000000000..001651048e99
--- /dev/null
+++ b/app-emulation/domi/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription>Scripts for building Xen domains</longdescription>
+</pkgmetadata>
diff --git a/app-emulation/dosemu/Manifest b/app-emulation/dosemu/Manifest
new file mode 100644
index 000000000000..166c308d1f15
--- /dev/null
+++ b/app-emulation/dosemu/Manifest
@@ -0,0 +1,3 @@
+DIST dosemu-1.4.1_pre20091009.tar.bz2 1965194 SHA256 bf57f3a567008892fcaf0a58f69aae37a4b251f08855968958fa8fc6c06b1d4b SHA512 45aa0fff97f11270a50f9d5f10ec0be137e585c33a163e2b3318e924fe60f6aff90433fa52e90a5f8f9f1557b69720c4750ea685f3f72b644345021a01efc6ae WHIRLPOOL 607a1f92a60f31540d9e7e4033ef913d115a1e2f0a578e4083f8b55c2d0144352fe9f04273dfe953f80ad7bf38dab901dc6b7a4fce2ea3b0676329837b2719cb
+DIST dosemu-1.4.1_pre20130107.zip 2767256 SHA256 072e1d8ea9c574b02e556d926a287c9c55b82384ed652bb8dd6f3488801901aa SHA512 eb8dcb914a74b235f2b37ff4dd5c1c84b4916ff195c7bf76cdbe6a4d5e6247c57297eef0c579f219ff7f475e727d66fa5a0f314da46d79cc97a0d794e9ad5864 WHIRLPOOL d2835f82515e40d3c85c1ee53c7add5ba055637864ee63997ec912f53862006e33b4139a253b98cb76ca3cdbd7bdca6614609d9e8e716b074283e77cd8105e3c
+DIST dosemu-freedos-1.0-bin.tgz 1205628 SHA256 080c306a1b611e1861fd64466062f268eb44d2bf38082b8a57efadb5a9c0ebc7 SHA512 d0c4235ceac55de63ce5f72e51b7d57a82b8104f4bf2df6f4dc25c9889d3337b40d75665c2dfc98492ec7123e0959a725f5c7579e145895024bd80a07036e3bd WHIRLPOOL 9e6acf38dc8fafe95a49baaaac2a97fdd02c508b7c30c60823f8af7f44aa62b8d82c92661640b4cef05fcdbea401fafea752ec4a0e439a8eff361dd41aa392d3
diff --git a/app-emulation/dosemu/dosemu-1.4.1_pre20091009.ebuild b/app-emulation/dosemu/dosemu-1.4.1_pre20091009.ebuild
new file mode 100644
index 000000000000..83615529e1d3
--- /dev/null
+++ b/app-emulation/dosemu/dosemu-1.4.1_pre20091009.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic
+
+P_FD="dosemu-freedos-1.0-bin"
+DESCRIPTION="DOS Emulator"
+HOMEPAGE="http://www.dosemu.org/"
+SRC_URI="mirror://sourceforge/dosemu/${P_FD}.tgz
+ mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="X svga gpm debug alsa sndfile"
+
+RDEPEND="X? ( x11-libs/libXxf86vm
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-apps/xset
+ x11-apps/xlsfonts
+ x11-apps/bdftopcf
+ x11-apps/mkfontdir )
+ svga? ( media-libs/svgalib )
+ gpm? ( sys-libs/gpm )
+ alsa? ( media-libs/alsa-lib )
+ sndfile? ( media-libs/libsndfile )
+ >=sys-libs/slang-1.4"
+
+DEPEND="${RDEPEND}
+ X? ( x11-proto/xf86dgaproto )
+ >=sys-devel/autoconf-2.57"
+S="${WORKDIR}/${PN}"
+
+src_compile() {
+ epatch "${FILESDIR}"/${P}-flex.patch #437074
+
+ # Has problems with -O3 on some systems
+ replace-flags -O[3-9] -O2
+
+ unset KERNEL
+
+ econf `use_with X x` \
+ `use_enable svga svgalib` \
+ `use_enable debug` \
+ `use_with gpm` \
+ `use_with alsa` \
+ `use_with sndfile` \
+ --with-fdtarball="${DISTDIR}"/${P_FD}.tgz \
+ --sysconfdir=/etc/dosemu/ \
+ --with-docdir=/usr/share/doc/${PF} || die
+
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ # Don't remove COPYING, see bug #137286
+ dodoc BUGS ChangeLog COPYING NEWS README THANKS || die #nowarn
+}
diff --git a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild
new file mode 100644
index 000000000000..c9c050a9e872
--- /dev/null
+++ b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic pax-utils toolchain-funcs
+
+P_FD="dosemu-freedos-1.0-bin"
+COMMIT="15cfb41ff20a052769d753c3262c57ecb050ad71"
+
+DESCRIPTION="DOS Emulator"
+HOMEPAGE="http://www.dosemu.org/"
+SRC_URI="mirror://sourceforge/dosemu/${P_FD}.tgz
+ http://sourceforge.net/code-snapshots/git/d/do/dosemu/code.git/dosemu-code-${COMMIT}.zip -> ${P}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="X svga gpm debug alsa sndfile fluidsynth"
+
+RDEPEND="X? ( x11-libs/libX11
+ x11-libs/libXxf86vm
+ x11-libs/libXau
+ x11-libs/libXext
+ x11-libs/libXdmcp
+ x11-apps/xset
+ x11-apps/xlsfonts
+ x11-apps/bdftopcf
+ x11-apps/mkfontdir )
+ svga? ( media-libs/svgalib )
+ gpm? ( sys-libs/gpm )
+ alsa? ( media-libs/alsa-lib )
+ sndfile? ( media-libs/libsndfile )
+ fluidsynth? ( media-sound/fluidsynth
+ media-sound/fluid-soundfont )
+ media-libs/libsdl
+ >=sys-libs/slang-1.4"
+
+DEPEND="${RDEPEND}
+ X? ( x11-proto/xf86dgaproto )
+ >=sys-devel/autoconf-2.57"
+
+S="${WORKDIR}/${PN}-code-${COMMIT}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fortify.patch
+
+ # Has problems with -O3 on some systems
+ replace-flags -O[3-9] -O2
+
+ # This one is from media-sound/fluid-soundfont (bug #479534)
+ sed "s,/usr/share/soundfonts/default.sf2,${EPREFIX}/usr/share/sounds/sf2/FluidR3_GM.sf2,"\
+ -i src/plugin/fluidsynth/mid_o_flus.c || die
+}
+
+src_configure() {
+ econf $(use_with X x) \
+ $(use_with svga svgalib) \
+ $(use_enable debug) \
+ $(use_with gpm) \
+ $(use_with alsa) \
+ $(use_with sndfile) \
+ $(use_with fluidsynth) \
+ --with-fdtarball="${DISTDIR}"/${P_FD}.tgz \
+ --sysconfdir="${EPREFIX}"/etc/dosemu/ \
+ --with-docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
+
+src_compile() {
+ emake AR=$(tc-getAR)
+}
+
+src_install() {
+ default
+
+ # r - randmmap: dosemu tries to get address mapping
+ # exactly where asked, loops otherwise.
+ # m - allow RWX mapping: as it's an emulator / code loader
+ pax-mark -mr "${ED}/usr/bin/dosemu.bin"
+}
diff --git a/app-emulation/dosemu/files/dosemu-1.3.4-shm.diff b/app-emulation/dosemu/files/dosemu-1.3.4-shm.diff
new file mode 100644
index 000000000000..f0868a988f0b
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.3.4-shm.diff
@@ -0,0 +1,11 @@
+--- dosemu-1.3.4/etc/dosemu.conf.orig 2007-01-28 22:19:44.000000000 +0100
++++ dosemu-1.3.4/etc/dosemu.conf 2007-01-28 22:19:58.000000000 +0100
+@@ -166,7 +166,7 @@
+ # preferred mapping driver, one of: auto, mapshm, mapashm, mapfile
+ # Default: ""="auto"
+
+-# $_mapping= ""
++$_mapping= "mapshm"
+
+ ##############################################################################
+ ## Debug settings
diff --git a/app-emulation/dosemu/files/dosemu-1.4.0.1-gcc433.diff b/app-emulation/dosemu/files/dosemu-1.4.0.1-gcc433.diff
new file mode 100644
index 000000000000..8b0ca77df6c0
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.0.1-gcc433.diff
@@ -0,0 +1,11 @@
+--- trunk/src/tools/periph/dexeconfig.c 2008/03/28 14:01:17 1854
++++ trunk/src/tools/periph/dexeconfig.c 2008/03/30 22:58:55 1855
+@@ -238,7 +238,7 @@
+ exit(1);
+ }
+ close(fd);
+- fc = open(cfile, O_WRONLY | O_CREAT | O_TRUNC);
++ fc = creat(cfile, S_IWUSR | S_IRUSR);
+ if (fc < 0) {
+ perror("cannot open config file");
+ exit(1);
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20091009-flex.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20091009-flex.patch
new file mode 100644
index 000000000000..7e8e291ef1b8
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20091009-flex.patch
@@ -0,0 +1,45 @@
+Gentoo-bug: http://bugs.gentoo.org/437074
+
+commit 81232816b90e85488d7f11f96b8fcdc5f4988c93
+Author: Stas Sergeev <stsp@users.sourceforge.net>
+Date: Sun Oct 14 19:51:09 2012 +0400
+
+ remove prototypes for lex-generated functions
+
+diff --git a/src/base/init/lexer.h b/src/base/init/lexer.h
+index 65b3ab8..082f08c 100644
+--- a/src/base/init/lexer.h
++++ b/src/base/init/lexer.h
+@@ -1,4 +1,4 @@
+-/*
++/*
+ * (C) Copyright 1992, ..., 2007 the "DOSEMU-Development-Team".
+ *
+ * for details see file COPYING.DOSEMU in the DOSEMU distribution
+@@ -6,7 +6,9 @@
+
+ /*
+ * We are intercepting the yylex() function calls from the parser
+- */
++ */
++#ifndef LEXER_H
++#define LEXER_H
+ #define OUR_YY_DECL int yylex (YYSTYPE* yylval)
+ OUR_YY_DECL;
+
+@@ -27,14 +29,4 @@ extern int include_lines[];
+ extern int line_count;
+ extern int last_include;
+
+-extern int yyget_lineno(void);
+-extern void yyset_lineno(int line_number);
+-extern void yyset_out(FILE * out_str);
+-extern void yyset_in(FILE * out_str);
+-extern void yyset_debug(int bdebug );
+-extern int yyget_debug(void);
+-extern int yylex_destroy(void);
+-extern FILE* yyget_in(void);
+-extern FILE* yyget_out(void);
+-extern int yyget_leng(void);
+-extern char *yyget_text(void);
++#endif
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch
new file mode 100644
index 000000000000..5daa4e9fee41
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch
@@ -0,0 +1,48 @@
+From ff9bea065f4cc6068dcb8d6ea9423105305ca590 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Mon, 5 Aug 2013 13:03:21 +0300
+Subject: [PATCH] src/tools/tools86.c: fix stack buffer overflow in
+ 'change_aout'
+
+Detected by gcc:
+
+gcc -std=gnu99 -c -MP -MMD -I../../src/include -I../../src/plugin/include -Wall -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -pipe -O2 -fomit-frame-pointer -o tools86.o tools86.c
+In file included from /usr/include/stdio.h:937:0,
+ from tools86.c:98:
+ In function 'fread',
+ inlined from 'change_aout.constprop.1' at tools86.c:174:12,
+ inlined from 'main' at tools86.c:391:18:
+ /usr/include/bits/stdio2.h:293:2: warning: call to '__fread_chk_warn' declared with attribute warning: fread called with bigger size * nmemb than length of destination buffer [enabled by default]
+ return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stream);
+ ^
+Gentoo-bug: http://bugs.gentoo.org/343577
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ src/tools/tools86.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/tools/tools86.c b/src/tools/tools86.c
+index 141610d..35a0b96 100644
+--- a/src/tools/tools86.c
++++ b/src/tools/tools86.c
+@@ -137,7 +137,7 @@ struct bsd_header { /* a.out header */
+ #endif
+
+ #ifdef __linux__
+-static int header_ld86out_to_gnuasout(struct bsd_header *bsd, struct gnu_header *gnu)
++static int header_ld86out_to_gnuasout(const struct bsd_header *bsd, struct gnu_header *gnu)
+ {
+ if (bsd->a_magic[0] != 0x01 || bsd->a_magic[1] != 0x03 ||
+ bsd->a_flags != 0x00 || bsd->a_cpu != 0x10) return -1;
+@@ -171,7 +171,7 @@ static int change_aout(char *objfile, int update_symtable)
+ return errno;
+ }
+ #ifdef __linux__
+- if (fread(&bsd,sizeof(gnu),1,f) != 1 ) {
++ if (fread(&bsd,sizeof(bsd),1,f) != 1 ) {
+ fclose(f);
+ return -1;
+ }
+--
+1.8.3.2
+
diff --git a/app-emulation/dosemu/metadata.xml b/app-emulation/dosemu/metadata.xml
new file mode 100644
index 000000000000..14ef792f53f8
--- /dev/null
+++ b/app-emulation/dosemu/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>hanno@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
+ <use>
+ <flag name="fluidsynth">use <pkg>media-sound/fluidsynth</pkg> for MIDI emulation</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">dosemu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/dynamips/Manifest b/app-emulation/dynamips/Manifest
new file mode 100644
index 000000000000..3c845b4e84a7
--- /dev/null
+++ b/app-emulation/dynamips/Manifest
@@ -0,0 +1,2 @@
+DIST dynamips-0.2.12-source.zip 995877 SHA256 b8a60c2ff577ec3a5c2b892bce654a68cc072c79fbca2b708d36d42bd3e9eb12 SHA512 08f388027e3234a44a75de77f30d6c96f0d881c4db60435a237f6ae6e3804872fda422ab11249f5c7283054f7d2d8466886dcd6056e59fc90802e67fa7cb8c55 WHIRLPOOL 2e627071914fe11ae20b7f00ba7b81b7bde95a008d84a1786e2f57ab07ec2a0d836218e72040b34f8badbefb289fceab2c5f7324bf5d5cfca0d433ed968dc6ae
+DIST dynamips-0.2.14-source.zip 961813 SHA256 ce77cf6e6e784142333d3b9dcc6c70ab7b1f676ff2a40b7d4fb738e14f01e789 SHA512 8c3d85998a61cae1e3e82501a00e886c954686f9a19a44acb7dee8b13911c0155ce2cdfecbdc41ed5d279266abdf77a5c3f2753fde12217b138313ffa46dabf8 WHIRLPOOL d20a78c701cdbb7f38c4e6f6848b5b3b0a80d8bef372cb13cc25c65d52652001e701f54d1e5a805e4279a4cf457f953387e7cbda124e9f4f57c8615296d8fc7e
diff --git a/app-emulation/dynamips/dynamips-0.2.12.ebuild b/app-emulation/dynamips/dynamips-0.2.12.ebuild
new file mode 100644
index 000000000000..f0dfa4d6f7df
--- /dev/null
+++ b/app-emulation/dynamips/dynamips-0.2.12.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Cisco 7200/3600 Simulator"
+HOMEPAGE="http://www.gns3.net/dynamips/"
+SRC_URI="mirror://sourceforge/project/gns-3/Dynamips/${PV}/${P}-source.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="dev-libs/elfutils
+ net-libs/libpcap"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-makefile.patch"
+
+ # enable verbose build
+ sed -i \
+ -e 's/@$(CC)/$(CC)/g' \
+ stable/Makefile || die 'sed on stable/Makefile failed'
+ # respect compiler
+ tc-export CC
+
+ epatch_user
+}
+
+src_compile() {
+ if use amd64 || use x86; then
+ emake DYNAMIPS_ARCH="${ARCH}"
+ else
+ emake DYNAMIS_ARCH="nojit"
+ fi
+}
+
+src_install () {
+ newbin dynamips.stable dynamips
+ newbin nvram_export.stable nvram_export
+ doman man/*
+ dodoc README README.hypervisor TODO
+}
diff --git a/app-emulation/dynamips/dynamips-0.2.14-r1.ebuild b/app-emulation/dynamips/dynamips-0.2.14-r1.ebuild
new file mode 100644
index 000000000000..cb86df7010a7
--- /dev/null
+++ b/app-emulation/dynamips/dynamips-0.2.14-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+DESCRIPTION="Cisco 7200/3600 Simulator"
+HOMEPAGE="http://www.gns3.net/dynamips/"
+SRC_URI="mirror://sourceforge/project/gns-3/Dynamips/${PV}/${P}-source.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ipv6"
+
+RDEPEND="dev-libs/elfutils
+ net-libs/libpcap"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+DOCS=( ChangeLog README RELEASE-NOTES )
+
+S="${WORKDIR}"
+
+PATCHES=( "${FILESDIR}/${PV}-docs.patch" )
+
+src_prepare() {
+ # comment out DYNAMIPS_FLAGS to respect CFLAGS
+ sed -e "s:^set ( DYNAMIPS_FLAGS:#&:" -i cmake/dependencies.cmake || die
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use_enable ipv6 IPV6)
+ )
+ cmake-utils_src_configure
+}
diff --git a/app-emulation/dynamips/files/0.2.14-docs.patch b/app-emulation/dynamips/files/0.2.14-docs.patch
new file mode 100644
index 000000000000..1d744062e5b5
--- /dev/null
+++ b/app-emulation/dynamips/files/0.2.14-docs.patch
@@ -0,0 +1,20 @@
+--- CMakeLists-orig.txt 2014-11-28 14:51:14.375913296 +0900
++++ CMakeLists.txt 2014-11-28 14:52:09.579369288 +0900
+@@ -37,16 +37,6 @@
+ add_subdirectory ( stable )
+ add_subdirectory ( unstable )
+
+-install_docs (
+- "ChangeLog"
+- "COPYING"
+- "MAINTAINERS"
+- "README"
+- "README.hypervisor"
+- "RELEASE-NOTES"
+- "TODO"
+- )
+-
+ # uninstall target - leaves behind any directory created during install
+ set ( _templatefile "${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" )
+ set ( _scriptfile "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" )
+
diff --git a/app-emulation/dynamips/files/dynamips-0.2.12-makefile.patch b/app-emulation/dynamips/files/dynamips-0.2.12-makefile.patch
new file mode 100644
index 000000000000..431f2df8ac74
--- /dev/null
+++ b/app-emulation/dynamips/files/dynamips-0.2.12-makefile.patch
@@ -0,0 +1,11 @@
+--- stable/origMakefile 2014-03-27 18:17:28.000000000 -0400
++++ stable/Makefile 2014-05-30 18:07:28.164255039 -0400
+@@ -19,7 +19,7 @@
+ PPC32_ARCH_INC_FILE=\"ppc32_$(DYNAMIPS_ARCH)_trans.h\"
+ OSNAME=unknown
+
+-CFLAGS+= $(INCLUDE) -Wall -O2 -fomit-frame-pointer \
++CFLAGS+= $(INCLUDE) -Wall \
+ -DJIT_ARCH=\"$(DYNAMIPS_ARCH)\" -DJIT_CPU=CPU_$(DYNAMIPS_ARCH) \
+ -DMIPS64_ARCH_INC_FILE=$(MIPS64_ARCH_INC_FILE) \
+ -DPPC32_ARCH_INC_FILE=$(PPC32_ARCH_INC_FILE) \
diff --git a/app-emulation/dynamips/metadata.xml b/app-emulation/dynamips/metadata.xml
new file mode 100644
index 000000000000..c9d9b3355675
--- /dev/null
+++ b/app-emulation/dynamips/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>bman@gentoo.org</email>
+ <name>Aaron Bauman</name>
+ </maintainer>
+ <maintainer>
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">gns-3</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/e-uae/Manifest b/app-emulation/e-uae/Manifest
new file mode 100644
index 000000000000..746c043c3c9a
--- /dev/null
+++ b/app-emulation/e-uae/Manifest
@@ -0,0 +1 @@
+DIST e-uae-0.8.29-WIP4.tar.bz2 1122718 SHA256 9828cb0fca783160bcb33900d0254f4bdaade1c9a41256e5f298e973d0c07456 SHA512 63d5c60ca017ba7ffaba32c4d7edceba0410b773066cc58e226c8cc2c92152eb3689698b0affe478cc63c996c731fbbf56d9028dfd000394d904f193f860473f WHIRLPOOL 4d0bab2b8492cfe6a6b2e38fab7b2eb9ad4b33b38b191d9949cb946f6e5a4365b00ccec118acb8b4d537b70b73b8d9deb0c8235b5966f1488d9a03e3a245dfeb
diff --git a/app-emulation/e-uae/e-uae-0.8.29_rc4-r2.ebuild b/app-emulation/e-uae/e-uae-0.8.29_rc4-r2.ebuild
new file mode 100644
index 000000000000..cf3ef4650d84
--- /dev/null
+++ b/app-emulation/e-uae/e-uae-0.8.29_rc4-r2.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic pax-utils
+
+DESCRIPTION="The Ubiquitous Amiga Emulator with an emulation core largely based on WinUAE"
+HOMEPAGE="http://www.rcdrummond.net/uae/"
+# We support _rcX for WIPX versions and _preYYYYMMDD for CVS snapshots.
+if [[ "${PV%%_rc*}" = "${PV}" ]] ; then
+ # _pre is used, cvs version
+ my_ver=${PV%%_pre*}
+ snap_ver=${PV##*_pre}
+ S="${WORKDIR}"/${PN}-${my_ver}-${snap_ver}
+ SRC_URI="http://www.rcdrummond.net/uae/test/${snap_ver}/${PN}-${my_ver}-${snap_ver}.tar.bz2"
+else
+ my_ver=${PV%%_rc*}
+ WIP_ver=${PV##*_rc}
+ S="${WORKDIR}"/${PN}-${my_ver}-WIP${WIP_ver}
+ SRC_URI="http://www.rcdrummond.net/uae/${PN}-${my_ver}-WIP${WIP_ver}/${PN}-${my_ver}-WIP${WIP_ver}.tar.bz2"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="X dga ncurses sdl alsa oss sdl-sound capslib"
+
+# Note: opposed to ./configure --help zlib support required! Check
+# src/Makefile.am that includes zfile.c unconditionaly.
+RDEPEND="X? ( x11-libs/libXt
+ x11-libs/libxkbfile
+ x11-libs/libXext
+ x11-misc/xkeyboard-config
+ dga? ( x11-libs/libXxf86dga
+ x11-libs/libXxf86vm )
+ )
+ !X? ( sdl? ( media-libs/libsdl )
+ !sdl? ( sys-libs/ncurses ) )
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( sdl-sound? ( media-libs/sdl-sound ) )
+ capslib? ( >=games-emulation/caps-20060612 )
+ sys-libs/zlib
+ virtual/cdrtools"
+
+DEPEND="${RDEPEND}
+ X? ( dga? ( x11-proto/xf86vidmodeproto
+ x11-proto/xf86dgaproto ) )"
+
+src_prepare() {
+ # Fix for high cpu use when compiled with --disable-audio
+ use alsa || use sdl-sound || use oss || epatch "${FILESDIR}"/${P}-high-cpu-usage.patch
+}
+
+src_configure() {
+ strip-flags
+
+ local myconf
+
+ # Sound setup.
+ if use alsa; then
+ elog "Choosing alsa as sound target to use."
+ myconf="--with-alsa --without-sdl-sound"
+ elif use sdl-sound ; then
+ if ! use sdl ; then
+ ewarn "sdl-sound is not enabled because sdl USE flag is disabled. Leaving"
+ ewarn "sound on oss autodetection."
+ myconf="--without-alsa --without-sdl-sound"
+ ebeep
+ else
+ elog "Choosing sdl-sound as sound target to use."
+ ewarn "E-UAE with the SDL audio back-end doesn't work correctly in Linux."
+ ewarn "Better use alsa... You've been warned ;)"
+ ebeep
+ myconf="--without-alsa --with-sdl-sound"
+ fi
+ elif use oss ; then
+ elog "Choosing oss as sound target to use."
+ ewarn "oss will be autodetected. See output of configure."
+ myconf="--without-alsa --without-sdl-sound"
+ else
+ ewarn "There is no alsa, sdl-sound or oss in USE. Sound target disabled!"
+ myconf="--disable-audio"
+ fi
+
+ # VIDEO setup. X is autodetected (there is no --with-X option).
+ if use X ; then
+ elog "Using X11 for video output."
+ ewarn "Fullscreen mode is not working in X11 currently. Use sdl."
+ myconf="$myconf --without-curses --without-sdl-gfx"
+ use dga && ewarn "To use dga you have to run e-uae as root."
+ use dga && myconf="$myconf --enable-dga --enable-vidmode"
+ elif use sdl ; then
+ elog "Using sdl for video output."
+ myconf="$myconf --with-sdl --with-sdl-gfx --without-curses"
+ elif use ncurses; then
+ elog "Using ncurses for video output."
+ myconf="$myconf --with-curses --without-sdl-gfx"
+ else
+ ewarn "There is no X or sdl or ncurses in USE!"
+ ewarn "Following upstream falling back on ncurses."
+ myconf="$myconf --with-curses --without-sdl-gfx"
+ ebeep
+ fi
+
+ # bug #415787
+ myconf="$myconf --disable-ui"
+
+ myconf="$myconf $(use_with capslib caps)"
+
+ myconf="$myconf --with-zlib"
+
+ # And explicitly state defaults:
+ myconf="$myconf --enable-aga"
+ myconf="$myconf --enable-autoconfig --enable-scsi-device --enable-cdtv --enable-cd32"
+ myconf="$myconf --enable-bsdsock"
+
+ econf ${myconf} \
+ --with-libscg-includedir="${EPREFIX}"/usr/include/scsilib \
+ || die "./configure failed"
+}
+
+src_compile() {
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+
+ # The emulator needs to be able to create executable heap
+ # - doesn't need trampoline emulation though.
+ pax-mark me "${ED}/usr/bin/uae"
+
+ # Rename it to e-uae
+ mv "${ED}/usr/bin/uae" "${ED}/usr/bin/e-uae"
+ mv "${ED}/usr/bin/readdisk" "${ED}/usr/bin/e-readdisk"
+
+ dodoc docs/* README ChangeLog
+}
diff --git a/app-emulation/e-uae/files/e-uae-0.8.29_rc4-high-cpu-usage.patch b/app-emulation/e-uae/files/e-uae-0.8.29_rc4-high-cpu-usage.patch
new file mode 100644
index 000000000000..ba005cece1ac
--- /dev/null
+++ b/app-emulation/e-uae/files/e-uae-0.8.29_rc4-high-cpu-usage.patch
@@ -0,0 +1,18 @@
+Index: src/sd-none/sound.c
+===================================================================
+RCS file: /cvsroot/uaedev/uae/src/sd-none/sound.c,v
+retrieving revision 1.4
+diff -u -r1.4 sound.c
+--- src/sd-none/sound.c 15 Feb 2007 04:47:38 -0000 1.4
++++ src/sd-none/sound.c 25 May 2007 14:47:35 -0000
+@@ -30,10 +30,6 @@
+ {
+ }
+
+-void update_sound (int freq)
+-{
+-}
+-
+ void reset_sound (void)
+ {
+ }
diff --git a/app-emulation/e-uae/metadata.xml b/app-emulation/e-uae/metadata.xml
new file mode 100644
index 000000000000..2314e7afa121
--- /dev/null
+++ b/app-emulation/e-uae/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ E-UAE is a fork of UAE which intends to merge all the new features of
+ WinUAE with UAE.
+ </longdescription>
+ <use>
+ <flag name='capslib'>Add CAPS library support</flag>
+ <flag name='sdl-sound'>Use <pkg>media-libs/sdl-sound</pkg> for audio
+ output</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/edumips64/Manifest b/app-emulation/edumips64/Manifest
new file mode 100644
index 000000000000..c1203a9c658e
--- /dev/null
+++ b/app-emulation/edumips64/Manifest
@@ -0,0 +1,2 @@
+DIST edumips64-1.1.tar.bz2 551083 SHA256 f34031fcfe7b43a8cf73a6e5d1da23f712cb83cf9bf68c94db70c799ae61cd6c SHA512 ca4884bbdb5bb41fe96abca566500af7dc31b330390f352bc6413aacb0561f58b5e95a90e22f58d18065324c155c97bd4d79beb7769efdafc3541cc37145579c WHIRLPOOL de616182917f5436d65c388da1cf90c2f84174f4bfb446613c01ff9aa48c419dbe26c6ab71a9377fb92627cfe9fece9d5b4d335a046daa84558686db2009bac7
+DIST edumips64-1.2.tar.bz2 551455 SHA256 dbdfcddb55aff2f9f9ec4d861d5faeff4c17957eb75cd8448f1cc62369ac5fc4 SHA512 93a5bcae3ab96c35688de7589b9ecb465fe841b007a50e1b04f8194d12a45a4e7134951584f4fbfad5cee51925d1d21b0f425f182999f66fe57a31adbd3f6602 WHIRLPOOL 41e966b28f0c6843586d6b8039c5ad47e071c7b5d2d527b77d928b29a66ec1fca87a1c4a33252555cd67d91e1adab27e9488611d03ab64c1d65530e5c914002a
diff --git a/app-emulation/edumips64/edumips64-1.1.ebuild b/app-emulation/edumips64/edumips64-1.1.ebuild
new file mode 100644
index 000000000000..5a5faefba9b6
--- /dev/null
+++ b/app-emulation/edumips64/edumips64-1.1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc test"
+
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="A visual and cross-platform MIPS64 CPU Simulator"
+HOMEPAGE="http://www.edumips.org"
+SLOT="0"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-python/sphinx
+ dev-java/javahelp:0
+ >=virtual/jdk-1.6
+ doc? ( sys-devel/make )
+ test? (
+ dev-java/junit:4
+ dev-java/ant-junit4
+ )"
+RDEPEND=">=virtual/jre-1.6"
+
+EANT_BUILD_TARGET="slim-jar"
+EANT_DOC_TARGET="htmldoc"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-javadoc-cp.patch"
+ java-pkg_jar-from --build-only --into libs javahelp jhall.jar
+ use test && java-pkg_jar-from --build-only --into libs junit-4 junit.jar junit-4.10.jar
+ java-pkg-2_src_prepare
+}
+
+src_install() {
+ java-pkg_newjar ${PN}-${PV}-nodeps.jar ${PN}.jar
+ dodoc RELEASE_NOTES authors
+ use doc && java-pkg_dojavadoc docs/en/output/html
+}
+
+src_test() {
+ ANT_TASKS="ant-junit4" eant test
+}
diff --git a/app-emulation/edumips64/edumips64-1.2.ebuild b/app-emulation/edumips64/edumips64-1.2.ebuild
new file mode 100644
index 000000000000..f54cafdc7603
--- /dev/null
+++ b/app-emulation/edumips64/edumips64-1.2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc test"
+
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="A visual and cross-platform MIPS64 CPU Simulator"
+HOMEPAGE="http://www.edumips.org"
+SLOT="0"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-python/sphinx
+ dev-java/javatoolkit
+ dev-java/javahelp:0
+ >=virtual/jdk-1.6
+ doc? ( sys-devel/make )
+ test? (
+ dev-java/junit:4
+ dev-java/ant-junit4
+ )"
+RDEPEND=">=virtual/jre-1.6"
+
+EANT_BUILD_TARGET="slim-jar"
+EANT_DOC_TARGET="htmldoc"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-javadoc-cp.patch"
+ java-pkg_jar-from --build-only --into libs javahelp jhall.jar
+ use test && java-pkg_jar-from --build-only --into libs junit-4 junit.jar junit-4.10.jar
+ java-pkg-2_src_prepare
+}
+
+src_install() {
+ java-pkg_newjar ${PN}-${PV}-nodeps.jar ${PN}.jar
+ dodoc RELEASE_NOTES authors
+ use doc && java-pkg_dojavadoc docs/en/output/html
+}
+
+src_test() {
+ ANT_TASKS="ant-junit4" eant test
+}
diff --git a/app-emulation/edumips64/files/edumips64-1.2-javadoc-cp.patch b/app-emulation/edumips64/files/edumips64-1.2-javadoc-cp.patch
new file mode 100644
index 000000000000..14ead77d3335
--- /dev/null
+++ b/app-emulation/edumips64/files/edumips64-1.2-javadoc-cp.patch
@@ -0,0 +1,11 @@
+--- a/build.xml
++++ b/build.xml
+@@ -27,7 +27,7 @@
+
+ <!-- Access the environment -->
+ <property environment="env" />
+- <property name="base.classpath" value="libs:libs/junit-4.10.jar:libs/hamcrest-core-1.3.jar:${env.CLASSPATH}" />
++ <property name="base.classpath" value="libs:libs/jhall.jar:libs/junit-4.10.jar:libs/hamcrest-core-1.3.jar:${env.CLASSPATH}" />
+
+ <!-- File names -->
+ <property name="standalone_jar_filename" value="edumips64-${version}.jar" />
diff --git a/app-emulation/edumips64/files/edumips64-javadoc-cp.patch b/app-emulation/edumips64/files/edumips64-javadoc-cp.patch
new file mode 100644
index 000000000000..80e389049b5c
--- /dev/null
+++ b/app-emulation/edumips64/files/edumips64-javadoc-cp.patch
@@ -0,0 +1,11 @@
+--- edumips64-1.1.orig/build.xml
++++ edumips64-1.1/build.xml
+@@ -24,7 +24,7 @@
+
+ <!-- Access the environment -->
+ <property environment="env" />
+- <property name="base.classpath" value="libs:libs/junit-4.10.jar:libs/hamcrest-core-1.3.jar:${env.CLASSPATH}" />
++ <property name="base.classpath" value="libs:libs/jhall.jar:libs/junit-4.10.jar:libs/hamcrest-core-1.3.jar:${env.CLASSPATH}" />
+
+ <!-- File names -->
+ <property name="standalone_jar_filename" value="edumips64-${version}.jar" />
diff --git a/app-emulation/edumips64/metadata.xml b/app-emulation/edumips64/metadata.xml
new file mode 100644
index 000000000000..75e63da88fc1
--- /dev/null
+++ b/app-emulation/edumips64/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+ <maintainer>
+ <email>lxnay@gentoo.org</email>
+ <name>Fabio Erculiani</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">edumips64</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/free42/Manifest b/app-emulation/free42/Manifest
new file mode 100644
index 000000000000..bf0e040da8be
--- /dev/null
+++ b/app-emulation/free42/Manifest
@@ -0,0 +1 @@
+DIST free42-1.5.5.tgz 8160228 SHA256 2c5a16aa470de76185135c307add9b920a712e31269c471dd246b6cf9283e050 SHA512 97833c99a24c2b1f427b237469868d57734b919b6c69521b45de480bd5274f5427caac13b9ccf3b79674d63dabdeda58a8db4c23a184b72b04279acbdf7eff8f WHIRLPOOL d435befbf2d392222d1ef7907c7913e474da5c4997dfb84177be3ea0b3fc1d9c9b0ea41590810e78d38eb082216b28c907fe39613823d866b6a1ab4d531a6af2
diff --git a/app-emulation/free42/files/free42-1.5.5-fix-makefile.patch b/app-emulation/free42/files/free42-1.5.5-fix-makefile.patch
new file mode 100644
index 000000000000..8f73b4405e7f
--- /dev/null
+++ b/app-emulation/free42/files/free42-1.5.5-fix-makefile.patch
@@ -0,0 +1,30 @@
+diff -Nuar a/gtk/Makefile b/gtk/Makefile
+--- a/gtk/Makefile 2014-06-21 19:46:55.000000000 +0200
++++ b/gtk/Makefile 2014-06-24 00:03:38.719906032 +0200
+@@ -19,7 +19,6 @@
+ -Wall \
+ -Wno-parentheses \
+ -Wno-write-strings \
+- -g \
+ -I/usr/X11R6/include \
+ -fno-exceptions \
+ -fno-rtti \
+@@ -30,14 +29,11 @@
+ -DDECIMAL_GLOBAL_ROUNDING_ACCESS_FUNCTIONS=1 \
+ -DDECIMAL_GLOBAL_EXCEPTION_FLAGS=1 \
+ -DDECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS=1 \
+- -D_WCHAR_T_DEFINED
++ -D_WCHAR_T_DEFINED \
++ ${CXXFLAGS}
+
+-LDFLAGS = -L/usr/X11R6/lib
+-LIBS := gcc111libbid-$(shell uname -m).a -lXmu $(shell pkg-config --libs gtk+-2.0)
+-
+-ifeq "$(shell uname -s)" "Linux"
+-LDFLAGS += -Wl,--hash-style=both
+-endif
++LDFLAGS := -L/usr/X11R6/lib ${LDFLAGS}
++LIBS := gcc111libbid-$(shell uname -m).a -lXmu -lX11 -ldl -lpthread $(shell pkg-config --libs gtk+-2.0)
+
+ SRCS = shell_main.cc shell_skin.cc skins.cc keymap.cc shell_loadimage.cc \
+ shell_spool.cc core_main.cc core_commands1.cc core_commands2.cc \
diff --git a/app-emulation/free42/free42-1.5.5.ebuild b/app-emulation/free42/free42-1.5.5.ebuild
new file mode 100644
index 000000000000..608ed317c142
--- /dev/null
+++ b/app-emulation/free42/free42-1.5.5.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="An HP-42S Calculator Simulator"
+HOMEPAGE="http://thomasokken.com/free42/"
+SRC_URI="mirror://gentoo/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="alsa"
+
+DEPEND="dev-libs/atk
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf
+ x11-libs/gtk+:2
+ x11-libs/pango
+ alsa? ( media-libs/alsa-lib )"
+
+RDEPEND="${DEPEND}
+ x11-libs/libX11
+ x11-libs/libXmu"
+
+S="${WORKDIR}/${PN}-nologo-${PV}"
+
+src_prepare() {
+ sed -i -e 's/print_gif_name\[FILENAMELEN\]/print_gif_name\[1000\]/' \
+ "${S}/gtk/shell_main.cc" || die
+ epatch "${FILESDIR}"/${P}-fix-makefile.patch
+}
+
+src_compile() {
+ local myconf
+ use alsa && myconf="AUDIO_ALSA=yes"
+ emake CXX="$(tc-getCXX)" BCD_MATH=1 ${myconf} -C "${S}/gtk"
+}
+
+src_install() {
+ dodoc CREDITS HISTORY README TODO
+ dobin gtk/free42dec
+}
diff --git a/app-emulation/free42/metadata.xml b/app-emulation/free42/metadata.xml
new file mode 100644
index 000000000000..ae876330a77d
--- /dev/null
+++ b/app-emulation/free42/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>nimiux@gentoo.org</email>
+ <name>Chema Alonso</name>
+ </maintainer>
+ <longdescription lang="en">
+ An HP-42S Calculator Simulator
+ </longdescription>
+ <longdescription lang="es">
+ Un simulador de la calculadora HP-42S
+ </longdescription>
+ <use>
+ <flag name="alsa">
+ Adds support for Advanced Linux Sound Architecture
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/fuse-utils/Manifest b/app-emulation/fuse-utils/Manifest
new file mode 100644
index 000000000000..ca9063cdb24f
--- /dev/null
+++ b/app-emulation/fuse-utils/Manifest
@@ -0,0 +1 @@
+DIST fuse-utils-1.1.1.tar.gz 505766 SHA256 7c36c0b42805661a06c21aede3461ffc8ccdb5ce56fe232875bf86e79f77c93c SHA512 67a9cc6af97f213a43b5e557dfe800f823e914faae99d7c5b2ddfc52656ab89bac737df644b9aa32ac009bdc0740d2064ccc6de2643ecba9141787245f9657f9 WHIRLPOOL 6da43fbbacdc918ce1cd4b11b21499a7faf26afe5cd1cd46e4911594c515679f2b5f6640d0530b6f47f644bc16c0247b5df26c49893f2e656b7d878ec95ea394
diff --git a/app-emulation/fuse-utils/fuse-utils-1.1.1.ebuild b/app-emulation/fuse-utils/fuse-utils-1.1.1.ebuild
new file mode 100644
index 000000000000..054937d59d00
--- /dev/null
+++ b/app-emulation/fuse-utils/fuse-utils-1.1.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Utils for the Free Unix Spectrum Emulator by Philip Kendall"
+HOMEPAGE="http://fuse-emulator.sourceforge.net"
+SRC_URI="mirror://sourceforge/fuse-emulator/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="audiofile gcrypt"
+
+RDEPEND="~app-emulation/libspectrum-1.1.1[gcrypt?]
+ audiofile? ( >=media-libs/audiofile-0.2.3 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ econf \
+ $(use_with audiofile ) \
+ $(use_with gcrypt libgcrypt) \
+ || die "Configure failed!"
+}
+
+src_compile() {
+ emake || die "Make failed!"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "install failed"
+ dodoc AUTHORS ChangeLog README
+ doman man/*.1
+}
diff --git a/app-emulation/fuse-utils/metadata.xml b/app-emulation/fuse-utils/metadata.xml
new file mode 100644
index 000000000000..b5eea7296dd7
--- /dev/null
+++ b/app-emulation/fuse-utils/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>neurogeek@gentoo.org</email>
+ <name>Jesus Rivero</name>
+ <description>Proxy Maintainer. Please CC on bugs.</description>
+ </maintainer>
+ <maintainer>
+ <email>jmfo1982@yahoo.es</email>
+ <description>Proxied Maintainer. Please assign on bugs.</description>
+ <name>José Manuel Ferrer Ortiz</name>
+ </maintainer>
+ <use>
+ <flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> for low-level crypto of some
+ features, including logfiles.</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">fuse-emulator</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/fuse/Manifest b/app-emulation/fuse/Manifest
new file mode 100644
index 000000000000..f2d19c6d87c0
--- /dev/null
+++ b/app-emulation/fuse/Manifest
@@ -0,0 +1,2 @@
+DIST fuse-1.0.0.tar.gz 1628751 SHA256 a00add3abc0148247f7990e6feebcc32d82ebe857897d9426e5230222425aeb9 SHA512 dfa3647d12f515f4fbea1481e074b947adc552f1fdec23c20b550bdce619e7efdd977cad7ecb75ab50eb2da785d95ef9d8908d44600412d12da4ca5751d0d7c3 WHIRLPOOL 4329df04555d031f41581d47d1284ebd73aaec19320df3dbd9a2aa594085a95734aaae9275487809800ae371e2ce6d4c14a6fdb628f959f2db791c19fdeeae9c
+DIST fuse-1.1.1.tar.gz 1881332 SHA256 a857d4bd62e01d18429897467508af15624cbaf343caed8b9ba1ab3a8879444e SHA512 67d12c56057a13121d8a5c073002dd2168268894669bdb50f3aba977cb1f53afa48774bfcb438a627a5afdbd2288248d4449e57d744e17b9e3eba00970685a14 WHIRLPOOL b64dd50037a4cba617bd0e10794c01e1a63bc2e68cd990636c1daa88e9a515032216b34e72ca6876f432a72d214d1220b808d2aae2ba849ee66f3d3784f14b73
diff --git a/app-emulation/fuse/files/fuse-1.0.0-libpng15.patch b/app-emulation/fuse/files/fuse-1.0.0-libpng15.patch
new file mode 100644
index 000000000000..3da2d672c47b
--- /dev/null
+++ b/app-emulation/fuse/files/fuse-1.0.0-libpng15.patch
@@ -0,0 +1,10 @@
+--- screenshot.c
++++ screenshot.c
+@@ -48,6 +48,7 @@
+
+ #ifdef USE_LIBPNG
+
++#include <zlib.h>
+ #include <png.h>
+
+ static int get_rgb32_data( libspectrum_byte *rgb32_data, size_t stride,
diff --git a/app-emulation/fuse/files/fuse-1.1.1-gold-link-lm.patch b/app-emulation/fuse/files/fuse-1.1.1-gold-link-lm.patch
new file mode 100644
index 000000000000..97e18a540ae1
--- /dev/null
+++ b/app-emulation/fuse/files/fuse-1.1.1-gold-link-lm.patch
@@ -0,0 +1,10 @@
+diff -uNr fuse-1.1.1.orig/sound/Makefile.am fuse-1.1.1/sound/Makefile.am
+--- fuse-1.1.1.orig/sound/Makefile.am 2014-06-04 17:32:46.540000001 -0400
++++ fuse-1.1.1/sound/Makefile.am 2014-06-04 19:04:23.190000001 -0400
+@@ -46,5 +46,6 @@
+
+ libsound_a_LIBADD = $(SOUND_LIBADD)
+ libsound_a_DEPENDENCIES = $(SOUND_LIBADD)
++libsound_a_LDFLAGS = -lm
+
+ noinst_HEADERS = sfifo.h blipbuffer.h
diff --git a/app-emulation/fuse/fuse-1.0.0.ebuild b/app-emulation/fuse/fuse-1.0.0.ebuild
new file mode 100644
index 000000000000..43aaa504c3eb
--- /dev/null
+++ b/app-emulation/fuse/fuse-1.0.0.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="Free Unix Spectrum Emulator by Philip Kendall"
+HOMEPAGE="http://fuse-emulator.sourceforge.net"
+SRC_URI="mirror://sourceforge/fuse-emulator/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="alsa ao fbcon gpm gtk joystick memlimit png sdl svga X xml"
+
+# This build is heavily use dependent. Fuse user interface use flags are, in
+# order of precedence: gtk, sdl, X, svga and fbcon. X version of fuse will
+# be built if no valid user interface flag is chosen.
+RDEPEND="~app-emulation/libspectrum-1.0.0
+ gtk? ( x11-libs/gtk+:2
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) )
+ joystick? ( media-libs/libjsw ) )
+ !gtk? (
+ sdl? ( >=media-libs/libsdl-1.2.4 )
+ !sdl? (
+ X? ( x11-libs/libX11
+ x11-libs/libXext
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) )
+ joystick? ( media-libs/libjsw ) )
+ !X? (
+ svga? ( media-libs/svgalib
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) ) )
+ !svga? (
+ fbcon? ( virtual/linux-sources
+ gpm? ( sys-libs/gpm )
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) )
+ joystick? ( media-libs/libjsw ) )
+ !fbcon? ( x11-libs/libX11
+ x11-libs/libXext
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) )
+ joystick? ( media-libs/libjsw ) ) ) ) ) )
+ dev-libs/glib:2
+ png? ( media-libs/libpng sys-libs/zlib )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS ChangeLog README THANKS )
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-libpng15.patch
+}
+
+src_configure() {
+ local guiflag
+
+ if use gtk; then
+ guiflag=""
+ elif use sdl; then
+ guiflag="--with-sdl"
+ elif use X; then
+ guiflag="--without-gtk"
+ elif use svga; then
+ guiflag="--with-svgalib"
+ elif use fbcon; then
+ guiflag="--with-fb"
+ else # We default to X user interface
+ guiflag="--without-gtk"
+ fi
+
+ econf \
+ --without-win32 \
+ ${guiflag} \
+ $(use_with gpm) \
+ $(use_with alsa) \
+ $(use_with ao libao) \
+ $(use_with joystick) \
+ $(use_enable joystick ui-joystick) \
+ $(use_with xml libxml2) \
+ $(use_with png ) \
+ $(use_enable memlimit smallmem)
+}
+
+src_install() {
+ default
+ doman man/fuse.1
+}
diff --git a/app-emulation/fuse/fuse-1.1.1.ebuild b/app-emulation/fuse/fuse-1.1.1.ebuild
new file mode 100644
index 000000000000..5ed35a4b7755
--- /dev/null
+++ b/app-emulation/fuse/fuse-1.1.1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit autotools eutils
+
+DESCRIPTION="Free Unix Spectrum Emulator by Philip Kendall"
+HOMEPAGE="http://fuse-emulator.sourceforge.net"
+SRC_URI="mirror://sourceforge/fuse-emulator/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="alsa ao fbcon gpm gtk joystick memlimit png sdl svga X xml"
+
+# This build is heavily use dependent. Fuse user interface use flags are, in
+# order of precedence: gtk, sdl, X, svga and fbcon. X version of fuse will
+# be built if no valid user interface flag is chosen.
+RDEPEND="~app-emulation/libspectrum-1.1.1
+ gtk? ( x11-libs/gtk+:2
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) )
+ joystick? ( media-libs/libjsw ) )
+ !gtk? (
+ sdl? ( >=media-libs/libsdl-1.2.4 )
+ !sdl? (
+ X? ( x11-libs/libX11
+ x11-libs/libXext
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) )
+ joystick? ( media-libs/libjsw ) )
+ !X? (
+ svga? ( media-libs/svgalib
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) ) )
+ !svga? (
+ fbcon? (
+ gpm? ( sys-libs/gpm )
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) )
+ joystick? ( media-libs/libjsw ) )
+ !fbcon? ( x11-libs/libX11
+ x11-libs/libXext
+ alsa? ( media-libs/alsa-lib )
+ !alsa? ( ao? ( media-libs/libao ) )
+ joystick? ( media-libs/libjsw ) ) ) ) ) )
+ dev-libs/glib:2
+ png? ( media-libs/libpng sys-libs/zlib )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ fbcon? ( virtual/linux-sources )
+ dev-lang/perl
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS ChangeLog README THANKS )
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-gold-link-lm.patch"
+ eautoreconf
+}
+
+src_configure() {
+ local guiflag
+
+ if use gtk; then
+ guiflag=""
+ elif use sdl; then
+ guiflag="--with-sdl"
+ elif use X; then
+ guiflag="--without-gtk"
+ elif use svga; then
+ guiflag="--with-svgalib"
+ elif use fbcon; then
+ guiflag="--with-fb"
+ else # We default to X user interface
+ guiflag="--without-gtk"
+ fi
+
+ econf \
+ --without-win32 \
+ ${guiflag} \
+ $(use_with gpm) \
+ $(use_with alsa) \
+ $(use_with ao libao) \
+ $(use_with joystick) \
+ $(use_enable joystick ui-joystick) \
+ $(use_with xml libxml2) \
+ $(use_with png ) \
+ $(use_enable memlimit smallmem)
+}
+
+src_install() {
+ default
+ doman man/fuse.1
+}
diff --git a/app-emulation/fuse/metadata.xml b/app-emulation/fuse/metadata.xml
new file mode 100644
index 000000000000..f7c150dc0efc
--- /dev/null
+++ b/app-emulation/fuse/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>jmfo1982@yahoo.es</email>
+ <description>Proxied Maintainer. Please assign on bugs.</description>
+ <name>José Manuel Ferrer Ortiz</name>
+ </maintainer>
+ <maintainer>
+ <email>neurogeek@gentoo.org</email>
+ <name>Jesus Rivero</name>
+ <description>Proxy Maintainer. Please CC on bugs</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">fuse-emulator</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/ganeti-htools/Manifest b/app-emulation/ganeti-htools/Manifest
new file mode 100644
index 000000000000..31b7e2d7be76
--- /dev/null
+++ b/app-emulation/ganeti-htools/Manifest
@@ -0,0 +1,3 @@
+DIST ganeti-htools-0.2.8.tar.gz 236904 SHA256 40574419e07353144e75211b5b524c38cd8e5335589a60ef774851f8e028596d SHA512 a01f29c684456a9fe9023e061892e713c4e89a6e4f9ece01da62cea0eb8ce8fc95a936ba2be351b5dcc0026989054eb4471563475f1c4001f9282d28b996eadc WHIRLPOOL c56fab535149412411301923c936c61f830ecbe4007a3560d5f05de5158d7f90f8b84ab49c3bf3f26e621661e06038893703cb3446c150d54b26130705231500
+DIST ganeti-htools-0.3.0.tar.gz 284839 SHA256 80fcd138cd21f662db226cd30b1efcc08fdaa197c56822809c1c2b58be04a32c SHA512 aa73fed2a99e2fe96f1660b0dd718e9ac3afc6924a25182f5e1ee1eafdccfe43b99986a2f2eefa6bb87b3543565d1fefdf1ef7c9c68ab36dfa9ca677c507945a WHIRLPOOL 0c47f1d330b5cebe69da4598de0a035fdf6e9c7fa65b6cdbe435b1d240d44ef61e2fa9a2ea77f5c1968f61aef5f5885319fef812d32edf934b1bf79b309abc8d
+DIST ganeti-htools-0.3.1.tar.gz 300261 SHA256 c28f3f78594e9dddd8fdc21bc37ce1f1b697d7e9d5d29f1de212705eadea1d7b SHA512 76acc476dc5b3add808db41b7aad4be6ee4b62d31e81eaefa17fbf010daa817bcc920b4e290727ebeddebbe6015017b19d2b7643dbc6d529f158b9746b7a4b43 WHIRLPOOL 1a9c8b4782c1b6265ec647b63c445735a8c2b56dda618aa3a699f1d4ee80838c0e9db51ae84644ade6ef39466cf7dc5aa92687176718c964a1441306e028681c
diff --git a/app-emulation/ganeti-htools/files/ganeti-htools-0.2.8-use-QC-1.patch b/app-emulation/ganeti-htools/files/ganeti-htools-0.2.8-use-QC-1.patch
new file mode 100644
index 000000000000..fd7943fe7057
--- /dev/null
+++ b/app-emulation/ganeti-htools/files/ganeti-htools-0.2.8-use-QC-1.patch
@@ -0,0 +1,14 @@
+diff --git a/Makefile b/Makefile
+index 5e189fc..bfdf175 100644
+--- a/Makefile
++++ b/Makefile
+@@ -20,7 +20,8 @@ $(HALLPROGS): %: %.hs Ganeti/HTools/Version.hs $(HSRCS) Makefile
+
+ test live-test: HEXTRA=-fhpc -Wwarn -fno-warn-missing-signatures \
+ -fno-warn-monomorphism-restriction -fno-warn-orphans \
+- -fno-warn-missing-methods -fno-warn-unused-imports
++ -fno-warn-missing-methods -fno-warn-unused-imports \
++ -package $(shell ghc-pkg list | sed -n '/ QuickCheck-1./p')
+
+ $(DOCS) : %.html : %
+ rst2html -v --strict $< $@
diff --git a/app-emulation/ganeti-htools/files/ganeti-htools-0.3.1-base-4.patch b/app-emulation/ganeti-htools/files/ganeti-htools-0.3.1-base-4.patch
new file mode 100644
index 000000000000..aa0d973a9e40
--- /dev/null
+++ b/app-emulation/ganeti-htools/files/ganeti-htools-0.3.1-base-4.patch
@@ -0,0 +1,171 @@
+diff --git a/Ganeti/HTools/CLI.hs b/Ganeti/HTools/CLI.hs
+index b000a00..d9177c6 100644
+--- a/Ganeti/HTools/CLI.hs
++++ b/Ganeti/HTools/CLI.hs
+@@ -74,11 +74,11 @@ module Ganeti.HTools.CLI
+
+ import Data.Maybe (fromMaybe)
+ import qualified Data.Version
+-import Monad
++import Control.Monad
+ import System.Console.GetOpt
+ import System.IO
+ import System.Info
+-import System
++import System.Exit
+ import Text.Printf (printf)
+
+ import qualified Ganeti.HTools.Version as Version(version)
+diff --git a/Ganeti/HTools/ExtLoader.hs b/Ganeti/HTools/ExtLoader.hs
+index 0412c1b..17b8449 100644
+--- a/Ganeti/HTools/ExtLoader.hs
++++ b/Ganeti/HTools/ExtLoader.hs
+@@ -36,10 +36,11 @@ module Ganeti.HTools.ExtLoader
+ ) where
+
+ import Data.Maybe (isJust, fromJust)
+-import Monad
++import Control.Monad
++import qualified Control.Exception as E
+ import System.FilePath
+ import System.IO
+-import System
++import System.Exit
+ import Text.Printf (printf, hPrintf)
+
+ import qualified Ganeti.HTools.Luxi as Luxi
+@@ -56,8 +57,8 @@ import Ganeti.HTools.CLI
+ import Ganeti.HTools.Utils (sepSplit, tryRead)
+
+ -- | Error beautifier
+-wrapIO :: IO (Result a) -> IO (Result a)
+-wrapIO = flip catch (return . Bad . show)
++wrapIO :: (Show a) => IO (Result a) -> IO (Result a)
++wrapIO = flip (E.catch :: IO a -> (E.IOException -> IO a) -> IO a) (return . Bad . show )
+
+ parseUtilisation :: String -> Result (String, DynUtil)
+ parseUtilisation line =
+diff --git a/hail.hs b/hail.hs
+index 541e1a9..68f4488 100644
+--- a/hail.hs
++++ b/hail.hs
+@@ -27,10 +27,10 @@ module Main (main) where
+
+ import Data.List
+ import Data.Maybe (isJust, fromJust)
+-import Monad
+-import System (exitWith, ExitCode(..))
++import Control.Monad
++import System.Environment
++import System.Exit
+ import System.IO
+-import qualified System
+
+ import qualified Ganeti.HTools.Cluster as Cluster
+
+@@ -99,7 +99,7 @@ readRequest opts args = do
+ -- | Main function.
+ main :: IO ()
+ main = do
+- cmd_args <- System.getArgs
++ cmd_args <- getArgs
+ (opts, args) <- parseOpts cmd_args "hail" options
+
+ let shownodes = optShowNodes opts
+diff --git a/hbal.hs b/hbal.hs
+index 46cccf8..0254008 100644
+--- a/hbal.hs
++++ b/hbal.hs
+@@ -30,12 +30,12 @@ import Control.Exception (bracket)
+ import Data.List
+ import Data.Maybe (isJust, isNothing, fromJust)
+ import Data.IORef
+-import Monad
+-import System (exitWith, ExitCode(..))
++import Control.Monad
+ import System.IO
++import System.Exit
+ import System.Posix.Process
+ import System.Posix.Signals
+-import qualified System
++import System.Environment
+
+ import Text.Printf (printf, hPrintf)
+
+@@ -223,7 +223,7 @@ runJobSet master fin_nl il cmd_jobs = do
+ -- | Main function.
+ main :: IO ()
+ main = do
+- cmd_args <- System.getArgs
++ cmd_args <- getArgs
+ (opts, args) <- parseOpts cmd_args "hbal" options
+
+ unless (null args) $ do
+diff --git a/hscan.hs b/hscan.hs
+index c14846f..d613f83 100644
+--- a/hscan.hs
++++ b/hscan.hs
+@@ -28,11 +28,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ module Main (main) where
+
+ import Data.Maybe (isJust, fromJust, fromMaybe)
+-import Monad
+-import System (exitWith, ExitCode(..))
++import Control.Monad
++import System.Environment
++import System.Exit
+ import System.IO
+ import System.FilePath
+-import qualified System
+
+ import Text.Printf (printf)
+
+@@ -135,7 +135,7 @@ writeDataInner nlen name opts cdata fixdata = do
+ -- | Main function.
+ main :: IO ()
+ main = do
+- cmd_args <- System.getArgs
++ cmd_args <- getArgs
+ (opts, clusters) <- parseOpts cmd_args "hscan" options
+ let local = "LOCAL"
+
+diff --git a/hspace.hs b/hspace.hs
+index 57d0302..f207c67 100644
+--- a/hspace.hs
++++ b/hspace.hs
+@@ -29,10 +29,10 @@ import Data.Char (toUpper, isAlphaNum)
+ import Data.List
+ import Data.Maybe (isJust, fromJust)
+ import Data.Ord (comparing)
+-import Monad
+-import System (exitWith, ExitCode(..))
++import Control.Monad
++import System.Exit
++import System.Environment
+ import System.IO
+-import qualified System
+
+ import Text.Printf (printf, hPrintf)
+
+@@ -207,7 +207,7 @@ printAllocationMap verbose msg nl ixes =
+ -- | Main function.
+ main :: IO ()
+ main = do
+- cmd_args <- System.getArgs
++ cmd_args <- getArgs
+ (opts, args) <- parseOpts cmd_args "hspace" options
+
+ unless (null args) $ do
+diff --git a/test.hs b/test.hs
+index 12aa50d..81838eb 100644
+--- a/test.hs
++++ b/test.hs
+@@ -29,7 +29,7 @@ import Data.IORef
+ import Test.QuickCheck.Batch
+ import System.IO
+ import System.Exit
+-import System (getArgs)
++import System.Environment (getArgs)
+
+ import Ganeti.HTools.QC
+
diff --git a/app-emulation/ganeti-htools/ganeti-htools-0.2.8.ebuild b/app-emulation/ganeti-htools/ganeti-htools-0.2.8.ebuild
new file mode 100644
index 000000000000..27c8a41499cc
--- /dev/null
+++ b/app-emulation/ganeti-htools/ganeti-htools-0.2.8.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils multilib
+
+DESCRIPTION="Cluster tools for fixing common allocation problems on Ganeti 2.0
+clusters"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+SRC_URI="http://ganeti.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc test"
+
+DEPEND="dev-lang/ghc
+ dev-haskell/json
+ dev-haskell/curl
+ dev-haskell/network"
+RDEPEND="${DEPEND}
+ !>=app-emulation/ganeti-2.4"
+DEPEND+=" test? ( dev-haskell/quickcheck:1 )"
+
+src_prepare() {
+ # htools does not currently compile cleanly with ghc-6.12+, so remove this
+ # for now
+ sed -i -e "s:-Werror ::" Makefile
+ epatch "${FILESDIR}"/${P}-use-QC-1.patch #316629
+}
+
+src_compile() {
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ dosbin hspace hscan hbal
+ exeinto /usr/$(get_libdir)/ganeti/iallocators
+ doexe hail
+ doman *.1
+ dodoc README NEWS AUTHORS
+ use doc && dohtml -r apidoc/*
+}
diff --git a/app-emulation/ganeti-htools/ganeti-htools-0.3.0.ebuild b/app-emulation/ganeti-htools/ganeti-htools-0.3.0.ebuild
new file mode 100644
index 000000000000..e62b5fe82dc6
--- /dev/null
+++ b/app-emulation/ganeti-htools/ganeti-htools-0.3.0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils multilib
+
+DESCRIPTION="Cluster tools for fixing common allocation problems on Ganeti 2.0
+clusters"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+SRC_URI="http://ganeti.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc test"
+
+DEPEND="dev-lang/ghc
+ dev-haskell/json
+ dev-haskell/curl
+ dev-haskell/network
+ dev-haskell/parallel"
+RDEPEND="${DEPEND}
+ !<app-emulation/ganeti-2.4"
+DEPEND+=" test? ( dev-haskell/quickcheck:1 )"
+
+src_prepare() {
+ # htools does not currently compile cleanly with ghc-6.12+, so remove this
+ # for now
+ sed -i -e "s:-Werror ::" Makefile
+ # Workaround to skip pandoc
+ sed -i -e "s:) man:):" Makefile
+ epatch "${FILESDIR}"/${PN}-0.2.8-use-QC-1.patch #316629
+}
+
+src_compile() {
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ dosbin hspace hscan hbal
+ exeinto /usr/$(get_libdir)/ganeti/iallocators
+ doexe hail
+ doman man/*.1
+ dodoc README NEWS AUTHORS
+ use doc && dohtml -r apidoc/*
+}
diff --git a/app-emulation/ganeti-htools/ganeti-htools-0.3.1.ebuild b/app-emulation/ganeti-htools/ganeti-htools-0.3.1.ebuild
new file mode 100644
index 000000000000..459850640001
--- /dev/null
+++ b/app-emulation/ganeti-htools/ganeti-htools-0.3.1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils multilib
+
+DESCRIPTION="Cluster tools for fixing common allocation problems on Ganeti 2.0
+clusters"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+SRC_URI="http://ganeti.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc test"
+
+DEPEND="dev-lang/ghc
+ dev-haskell/json
+ dev-haskell/curl
+ dev-haskell/network
+ dev-haskell/parallel"
+RDEPEND="${DEPEND}
+ !<app-emulation/ganeti-2.4"
+DEPEND+=" test? ( dev-haskell/quickcheck:1 )"
+
+src_prepare() {
+ # htools does not currently compile cleanly with ghc-6.12+, so remove this
+ # for now
+ sed -i -e "s:-Werror ::" Makefile
+ # Workaround to skip pandoc
+ sed -i -e "s:) man:):" Makefile
+ epatch "${FILESDIR}"/${PN}-0.2.8-use-QC-1.patch #316629
+ epatch "${FILESDIR}"/${PN}-0.3.1-base-4.patch #424299
+}
+
+src_compile() {
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ dosbin hspace hscan hbal
+ exeinto /usr/$(get_libdir)/ganeti/iallocators
+ doexe hail
+ doman man/*.1
+ dodoc README NEWS AUTHORS
+ use doc && dohtml -r apidoc/*
+}
diff --git a/app-emulation/ganeti-htools/metadata.xml b/app-emulation/ganeti-htools/metadata.xml
new file mode 100644
index 000000000000..235f15f03533
--- /dev/null
+++ b/app-emulation/ganeti-htools/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <herd>haskell</herd>
+ <longdescription lang="en">
+ These are some simple cluster tools for fixing common allocation
+ problems on Ganeti 2.0 clusters.
+
+ Note that these tools are most useful for bigger cluster sizes
+ (e.g. more than five or ten machines); at lower sizes, the computations
+ they do can also be done manually.
+
+ Most of the tools revolve around the concept of keeping the cluster N+1
+ compliant: this means that in case of failure of any node, the instances
+ affected can be failed over (via ``gnt-node failover`` or ``gnt-instance
+ failover``) to their secondary node, and there is enough memory reserved
+ for this operation without needing to shutdown other instances or
+ rebalance the cluster.
+ </longdescription>
+</pkgmetadata>
+
diff --git a/app-emulation/ganeti-instance-debian-etch/Manifest b/app-emulation/ganeti-instance-debian-etch/Manifest
new file mode 100644
index 000000000000..b6d47a1a25dc
--- /dev/null
+++ b/app-emulation/ganeti-instance-debian-etch/Manifest
@@ -0,0 +1 @@
+DIST ganeti-instance-debian-etch-0.4.tar 40960 SHA256 be2175c6007e308a3f7eab0cbe7242aeee892eb2a2d0216011260f3826eea92d SHA512 5c040d849fe0ed1c20231f8f32f1b0a8e8d10e2c45c36ca7cd2843c2b82e868e0d50bbf6eab89db59e50f3e012cf7351da3469dbcd0c21455740d38f8dd481d0 WHIRLPOOL d850f74943f0d210a6f1ced22968c04cfdc095b01470e3cbd96d6c91ec71776dccd2fc5341bf8647ecbc25ae56ec3f5e5683c71ce926d9ffb6e7fc3be350cd55
diff --git a/app-emulation/ganeti-instance-debian-etch/ganeti-instance-debian-etch-0.4.ebuild b/app-emulation/ganeti-instance-debian-etch/ganeti-instance-debian-etch-0.4.ebuild
new file mode 100644
index 000000000000..878ce15d6b5b
--- /dev/null
+++ b/app-emulation/ganeti-instance-debian-etch/ganeti-instance-debian-etch-0.4.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Debian Etch instance example for Ganeti"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+SRC_URI="http://ganeti.googlecode.com/files/${P}.tar"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="
+ app-arch/dpkg
+ app-arch/dump
+ app-emulation/ganeti
+ dev-util/debootstrap
+ >=sys-apps/coreutils-6.10-r1
+ sys-apps/util-linux
+ sys-fs/e2fsprogs
+"
+
+src_install() {
+ dir=/srv/ganeti/os/debian-etch/
+ insinto ${dir}
+ doins "${S}"/*
+ fperms 755 ${dir}/{create,export,import,rename}
+}
diff --git a/app-emulation/ganeti-instance-debian-etch/metadata.xml b/app-emulation/ganeti-instance-debian-etch/metadata.xml
new file mode 100644
index 000000000000..a49a834500b8
--- /dev/null
+++ b/app-emulation/ganeti-instance-debian-etch/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">ganeti</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/ganeti-instance-debootstrap/Manifest b/app-emulation/ganeti-instance-debootstrap/Manifest
new file mode 100644
index 000000000000..2ad664a1d263
--- /dev/null
+++ b/app-emulation/ganeti-instance-debootstrap/Manifest
@@ -0,0 +1,3 @@
+DIST ganeti-instance-debootstrap-0.11.tar.gz 67946 SHA256 a80dcffe530473d935a1b14de940c8d437d5bf83dd8a5670d8b7d349f2e91768 SHA512 d39ae29b49e3e0e25e9052ee5201d5aeeedfa229cc0b8674ea01a26b1b615b262c1464ca16b5268884a0fa28981e5126eec084d7bb9298a4b405574925b85b4e WHIRLPOOL 860cd9c757e6b25d7caab5a8706e7f0705ae6c0a01b69bc7513060ce77ea7ea3903c6e00981825f341a0ea40f770744b6c6b3ae5c5bd472df045ac40e28b66b8
+DIST ganeti-instance-debootstrap-0.12.tar.gz 69835 SHA256 c9c516d72ad6581e06c40230ee2d811e8484c03b2542f7610c603a9460ef717e SHA512 5f1813510071addca9bee5e36f7b34a5cbd06f53db8222f6345cb788af8d686aeb94d11ec098eb63b8e11ded18a03c233dd99237f2db9190894bab6189353ab5 WHIRLPOOL ada2c9acb41c6d7a611a6dc9c574a83f7281e262c2cf4c73d70907c598dc209dc161e922d112b048728a118b2c19ffc8e3e12852f074eebf20ec5aec78b570fc
+DIST ganeti-instance-debootstrap-0.9.tar.gz 67353 SHA256 2ee275e349f1949d6483e1675e9ef9c39dd0bd7b051ac199176671b82e99c9cb SHA512 662ae950a7f7f34d2d1f00b49c1b45dd2fa422f922f230f5cc11f95a00eaccc1bf0c468346463dc66f11980262c8151933f8348676ea84ea4114afcc4600015b WHIRLPOOL a62e93a5293ed91917678db0be3c0c3f81b31550bdd1820a3701ed7236a972381a8371ff00f7db29eedffde6bbd47d4d623c3e018d820ed0c19679e292e41282
diff --git a/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.11.ebuild b/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.11.ebuild
new file mode 100644
index 000000000000..73b43f8256b0
--- /dev/null
+++ b/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.11.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils
+
+DESCRIPTION="Scripts to build Ganeti VMs with debootstrap"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+SRC_URI="http://ganeti.googlecode.com/files/ganeti-instance-debootstrap-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="app-arch/dpkg
+ app-arch/dump
+ app-emulation/ganeti
+ dev-util/debootstrap
+ >=sys-apps/coreutils-6.10-r1
+ sys-apps/util-linux
+ sys-fs/e2fsprogs"
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${P} || die "econf failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ insinto /etc/ganeti/instance-debootstrap/hooks
+ doins examples/hooks/*
+}
diff --git a/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.12.ebuild b/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.12.ebuild
new file mode 100644
index 000000000000..65cb9357eddd
--- /dev/null
+++ b/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.12.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils
+
+DESCRIPTION="Scripts to build Ganeti VMs with debootstrap"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+SRC_URI="http://ganeti.googlecode.com/files/ganeti-instance-debootstrap-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="app-arch/dpkg
+ app-arch/dump
+ app-emulation/ganeti
+ dev-util/debootstrap
+ >=sys-apps/coreutils-6.10-r1
+ sys-apps/util-linux
+ sys-fs/e2fsprogs"
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${P} || die "econf failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ insinto /etc/ganeti/instance-debootstrap/hooks
+ doins examples/hooks/*
+}
diff --git a/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.9.ebuild b/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.9.ebuild
new file mode 100644
index 000000000000..49cfe2508b71
--- /dev/null
+++ b/app-emulation/ganeti-instance-debootstrap/ganeti-instance-debootstrap-0.9.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils
+
+DESCRIPTION="Scripts to build Ganeti VMs with debootstrap"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+SRC_URI="http://ganeti.googlecode.com/files/ganeti-instance-debootstrap-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="app-arch/dpkg
+ app-arch/dump
+ app-emulation/ganeti
+ dev-util/debootstrap
+ >=sys-apps/coreutils-6.10-r1
+ sys-apps/util-linux
+ sys-fs/e2fsprogs"
+
+src_configure() {
+ econf --docdir=/usr/share/doc/${P} || die "econf failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ insinto /etc/ganeti/instance-debootstrap/hooks
+ doins examples/hooks/*
+}
diff --git a/app-emulation/ganeti-instance-debootstrap/metadata.xml b/app-emulation/ganeti-instance-debootstrap/metadata.xml
new file mode 100644
index 000000000000..2ea2a30d3f47
--- /dev/null
+++ b/app-emulation/ganeti-instance-debootstrap/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <longdescription lang="en">This is a guest OS definition for Ganeti (http://code.google.com/p/ganeti).
+ It will install a minimal version of Debian or Ubuntu via debootstrap (thus
+ it requires network access). This only works if you have a Debian-based node
+ or you have debootstrap installed by hand on another distribution.</longdescription>
+ <upstream>
+ <remote-id type="google-code">ganeti</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/ganeti-instance-image/Manifest b/app-emulation/ganeti-instance-image/Manifest
new file mode 100644
index 000000000000..37f8ab3257db
--- /dev/null
+++ b/app-emulation/ganeti-instance-image/Manifest
@@ -0,0 +1 @@
+DIST ganeti-instance-image-0.6.tar.gz 82534 SHA256 eb8cd0a26acc5b2bd651a1e014688a9f395cef35b4f6393df6a53aeadae1d2fc SHA512 92b5048fe8c40692e8e7c4cb73b21e764660d7cb5f585a8489fc4338eef7df8aae1147d38a849103585a884a0216a0bfb42473d5c1922130e5aada31f5d580c3 WHIRLPOOL d4b04066ad3d11ff995710a7f8932a203a8bc5acb22abe2b202b0e5a84c1075f4f0c7a9d8a18111915abc04a7f67630590edf9f1c520ea6f5960c9e920aa294a
diff --git a/app-emulation/ganeti-instance-image/ganeti-instance-image-0.6.ebuild b/app-emulation/ganeti-instance-image/ganeti-instance-image-0.6.ebuild
new file mode 100644
index 000000000000..589eafa60b73
--- /dev/null
+++ b/app-emulation/ganeti-instance-image/ganeti-instance-image-0.6.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://git.osuosl.org/${PN}.git"
+ EGIT_BRANCH="master"
+ inherit git-2 autotools
+else
+ SRC_URI="http://ftp.osuosl.org/pub/osl/ganeti-instance-image/${P}.tar.gz"
+fi
+
+DESCRIPTION="Scripts to build out CD or image based VMs using Ganeti"
+HOMEPAGE="http://code.osuosl.org/projects/ganeti-image"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="app-arch/dump
+ >=app-emulation/ganeti-2.0.3
+ || ( >=sys-apps/coreutils-6.10-r1 sys-apps/mktemp )
+ app-emulation/qemu
+ sys-apps/util-linux
+ sys-fs/multipath-tools
+ sys-fs/e2fsprogs"
+
+src_prepare() {
+ if [[ ${PV} == "9999" ]]; then
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ econf --with-default-dir=/etc/ganeti
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+
+ rm -rf "${D}"/usr/share/doc/${PN}
+ dodoc README.markdown NEWS ChangeLog
+ insinto /etc/ganeti
+ newins defaults ${PN}
+}
diff --git a/app-emulation/ganeti-instance-image/metadata.xml b/app-emulation/ganeti-instance-image/metadata.xml
new file mode 100644
index 000000000000..cee84c239672
--- /dev/null
+++ b/app-emulation/ganeti-instance-image/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ </longdescription>
+</pkgmetadata>
+
diff --git a/app-emulation/ganeti/Manifest b/app-emulation/ganeti/Manifest
new file mode 100644
index 000000000000..5180973a8505
--- /dev/null
+++ b/app-emulation/ganeti/Manifest
@@ -0,0 +1,7 @@
+DIST ganeti-2.10.5.tar.gz 3855105 SHA256 7b66a0a13344f484bc1d1e90f84227438e2cdbb054f5667a9a4c216bce2b8532 SHA512 ab9fe4c18f975e13dcd403a086b725d4f5e4f84aaa5a2651cf4087b6abad59b38b470ed062f407e6783997f976eb217e755c9d7a3ebde1df63638c3ab63cd755 WHIRLPOOL 5bf83bae29f51cfd2980d3e57a03d25e598ae7495785646e8920d4ca7685d2e93cbac42624e86fbbf92236edd7311f724fa036580300f8ccc066818d3c9911a5
+DIST ganeti-2.11.6.tar.gz 4145886 SHA256 db11659ae7aaab5933b55b35f703236edc91ec763e443ac80679a057ba57af5e SHA512 c68ba0661f7598b2fbd67a96fd897e9a8fe7c3a79e914200c08a8e6cb78ad7ea8a85ce7cfee157e22c07d5f46ae6ed61d946cf2cc3852624cd303deb96f1e449 WHIRLPOOL 9bd0acd85ed86b8d05164d6ee70ea960fd42128f9144739c148e70917675d53c1d808d22df981a1ea0d843dfc5fd14fd516d6d39330634beec7eb0ecae4cbe5b
+DIST ganeti-2.12.1.tar.gz 4353529 SHA256 bd1b33d12485f4de25cca74dcf2e5354067cdda5ee36b56333d402aa1c5351e0 SHA512 92f66b45b5adcfd4cca47a1cbd592489d6c3ec595d3c6ba7b4a9401cb588a51994288499078513d6f4c0369f15a403c796a526945a2e874e8d561aac2b962b7a WHIRLPOOL 60f446b851f0bcee536791ed01d470c7a5caf02b120891e370f491f07194c1b0d9fe991a0342c7f77f3762c4aaea1ae7b7cf731644d061f43f4ba38af36cf699
+DIST ganeti-2.12.3.tar.gz 4373350 SHA256 e66fc4c3dde1e90d85749ceb5c1c90bd6eaed1d139796829833b74337d2d4148 SHA512 7715db8e472e4ac99bf184028cd9853495153485c6638bcddba2d05ce958b6b44d3be07290780bb27b22337ae646881d6b0a30bbe87b7249106ac34d22bdd6c2 WHIRLPOOL e24d695d5acc582905ae7ba003e3fe6e6aa6ea4f9135daf76b953864c392803cd1c6ed81eb0e96652038f289bf450f3ac1a428c46d7a2573bc39a9451a47694e
+DIST ganeti-2.13.0.tar.gz 4573781 SHA256 30ccfa971b15d49b45a4bfb75bb9631c0993adbd7feac0562c11305ae8c13753 SHA512 bd847ae7e12cb978fae59a458a4d0e33fee470c51748964453b5d0ea6615e6d959519c84922e92229e942a88f1ad88a6d1cb655f58391d033d5f5dfc249ef941 WHIRLPOOL 925159e36fde1cd36214b4fe54b4e06958cc8bd3ded28e32bc4f99842aafcb4c53c701c8a651421559dc13b4d18ae2cc11f1b9d1d2da1e862561cca81d009bda
+DIST ganeti-2.14.1.tar.gz 4655994 SHA256 ae90c69f0c02d2ee558363a1c021dfaaaf4ccb59b662a72fa6485b406766e133 SHA512 2d3927bf888ea56df6b6275a869979c53d4b01e2e527e2dddea2a4835c90e85831e9e7691162999e5c58e9d214e03a37690e84f8fde9f1a0631897b06db348c3 WHIRLPOOL 3554161afd646af41e587fffa9dc85788f6ef13102121c636802946b64161cdeaeea326103171b70577b06635eebf6988b2f3942024a944612642aefd92b89bb
+DIST ganeti-2.4.5.tar.gz 1828118 SHA256 9141379f3802238fb209309ec12f7090d872b77d7a473c91fe766d1fcec97c89 SHA512 e3abc2fd7c031fbef41c6e993f4cb129fa1dd4cb8c44961a2574da23832fd8412b8b3664b2e05ba8236cb8e58e8d70c3c9081f3f1b6dba8ffdc28d298c8a5099 WHIRLPOOL 897c2b3cdf0c7b03232a4ec99314439dbd29afd65eb2502d21a9f197cc098323a4b9ec0671c24ef7aad44b5327316ee68731e7e5304c8730d03f8ca908b93b62
diff --git a/app-emulation/ganeti/files/ganeti-2.1.initd b/app-emulation/ganeti/files/ganeti-2.1.initd
new file mode 100644
index 000000000000..111f75468999
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.1.initd
@@ -0,0 +1,112 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount logger
+ after bootmisc
+}
+
+DAEMON_UTIL="/usr/lib/ganeti/daemon-util"
+
+check_config() {
+ if ! $DAEMON_UTIL check-config ; then
+ eend 0 "Incomplete configuration, will not run."
+ fi
+}
+
+check_exitcode() {
+ RC=${1}
+ if errmsg=$(${DAEMON_UTIL} check-exitcode ${RC}) ; then
+ eend 0 "${errmsg}"
+ else
+ eend 1 "${errmsg}"
+ fi
+}
+
+start_action() {
+ # called as start_action daemon-name
+ local daemon="${1}"
+ ebegin "Starting ${daemon}"
+ ${DAEMON_UTIL} start "${@}"
+ check_exitcode ${?}
+}
+
+stop_action() {
+ # called as stop_action daemon-name
+ local daemon="${1}"
+ ebegin "Stopping ${daemon}"
+ ${DAEMON_UTIL} stop "${@}"
+ check_exitcode ${?}
+}
+
+maybe_do() {
+ requested="${1}"; shift
+ action="${1}"; shift
+ target="${1}"
+ if [ -z "${requested}" -o "${requested}" = "${target}" ] ; then
+ ${action} "${@}"
+ fi
+}
+
+get_master_node() {
+ MASTER_NODE="$(gnt-cluster getmaster)"
+ NODE_HOSTNAME="$(hostname -f)"
+ if [ "$MASTER_NODE" == "$NODE_HOSTNAME" ] ; then
+ MASTER=1
+ else
+ MASTER=0
+ fi
+}
+
+start_all() {
+ check_config
+ get_master_node
+ for i in $($DAEMON_UTIL list-start-daemons); do \
+ GANETI_START_OPTS="${GANETI_OPTS}"
+ case "${i}" in
+ ganeti-masterd)
+ GANETI_OPTS="${GANETI_START_OPTS} ${GANETI_MASTERD_OPTS}"
+ ;;
+ ganeti-rapid)
+ GANETI_OPTS="${GANETI_START_OPTS} ${GANETI_RAPI_OPTS}"
+ ;;
+ ganeti-noded)
+ GANETI_OPTS="${GANETI_START_OPTS} ${GANETI_NODED_OPTS}"
+ ;;
+ ganeti-confd)
+ GANETI_OPTS="${GANETI_START_OPTS} ${GANETI_CONFD_OPTS}"
+ ;;
+ esac
+ # Don't start if not master
+ if [ $MASTER = 0 -a $i = "ganeti-masterd" ] ; then
+ continue
+ elif [ $MASTER = 0 -a $i = "ganeti-rapi" ] ; then
+ continue
+ else
+ maybe_do "${1}" start_action ${i} ${GANETI_OPTS}
+ fi
+ done
+}
+
+stop_all() {
+ get_master_node
+ for i in $($DAEMON_UTIL list-stop-daemons) ; do \
+ if [ $MASTER = 0 -a $i = "ganeti-masterd" ] ; then
+ continue
+ elif [ $MASTER = 0 -a $i = "ganeti-rapi" ] ; then
+ continue
+ else
+ maybe_do "${1}" stop_action ${i} ${GANETI_OPTS}
+ fi
+ done
+}
+
+start() {
+ start_all
+}
+
+stop() {
+ stop_all
+}
diff --git a/app-emulation/ganeti/files/ganeti-2.10-rundir.patch b/app-emulation/ganeti/files/ganeti-2.10-rundir.patch
new file mode 100644
index 000000000000..a723f2b63d85
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.10-rundir.patch
@@ -0,0 +1,35 @@
+diff --git a/Makefile.am b/Makefile.am
+index df62fdf..b034d32 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1865,7 +1865,7 @@ $(SHELL_ENV_INIT): Makefile stamp-directories
+ echo; \
+ echo 'readonly PKGLIBDIR=$(libdir)/ganeti'; \
+ echo 'readonly LOG_DIR="$$LOCALSTATEDIR/log/ganeti"'; \
+- echo 'readonly RUN_DIR="$$LOCALSTATEDIR/run/ganeti"'; \
++ echo 'readonly RUN_DIR="/run/ganeti"'; \
+ echo 'readonly DATA_DIR="$$LOCALSTATEDIR/lib/ganeti"'; \
+ echo 'readonly CONF_DIR="$$SYSCONFDIR/ganeti"'; \
+ } > $@
+@@ -2208,7 +2208,7 @@ dist-release: dist
+ install-exec-local:
+ @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
+ "$(DESTDIR)${localstatedir}/log/ganeti" \
+- "$(DESTDIR)${localstatedir}/run/ganeti"
++ "$(DESTDIR)/run/ganeti"
+ for dir in $(SYMLINK_TARGET_DIRS); do \
+ @mkdir_p@ $(DESTDIR)$$dir; \
+ done
+diff --git a/lib/pathutils.py b/lib/pathutils.py
+index f075e22..38b02e9 100644
+--- a/lib/pathutils.py
++++ b/lib/pathutils.py
+@@ -62,7 +62,7 @@ ETC_HOSTS = vcluster.ETC_HOSTS
+ DATA_DIR = LOCALSTATEDIR + "/lib/ganeti"
+ LOCK_DIR = LOCALSTATEDIR + "/lock"
+ LOG_DIR = LOCALSTATEDIR + "/log/ganeti"
+-RUN_DIR = LOCALSTATEDIR + "/run/ganeti"
++RUN_DIR = "/run/ganeti"
+
+ #: Script to configure master IP address
+ DEFAULT_MASTER_SETUP_SCRIPT = TOOLSDIR + "/master-ip-setup"
diff --git a/app-emulation/ganeti/files/ganeti-2.11-add-pgrep.patch b/app-emulation/ganeti/files/ganeti-2.11-add-pgrep.patch
new file mode 100644
index 000000000000..b0a8bd99cc0a
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-add-pgrep.patch
@@ -0,0 +1,25 @@
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 656dc95..01f2cbb 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -246,12 +246,14 @@ start() {
+ @PKGLIBDIR@/ensure-dirs
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --start --quiet \
+- --pidfile $pidfile \
+- --exec $daemonexec \
+- --user $usergroup \
+- --wait 300 \
+- -- $args "$@"
++ if ! ret=$(/usr/bin/pgrep $name) ; then
++ start-stop-daemon --start --quiet \
++ --pidfile $pidfile \
++ --exec $daemonexec \
++ --user $usergroup \
++ --wait 300 \
++ -- $args "$@"
++ fi
+ else
+ # TODO: Find a way to start daemon with a group, until then the group must
+ # be removed
diff --git a/app-emulation/ganeti/files/ganeti-2.11-daemon-util-tests.patch b/app-emulation/ganeti/files/ganeti-2.11-daemon-util-tests.patch
new file mode 100644
index 000000000000..b60a85057761
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-daemon-util-tests.patch
@@ -0,0 +1,38 @@
+diff --git a/test/py/daemon-util_unittest.bash b/test/py/daemon-util_unittest.bash
+index faacaed..002bfb4 100755
+--- a/test/py/daemon-util_unittest.bash
++++ b/test/py/daemon-util_unittest.bash
+@@ -72,21 +72,21 @@ done
+ $daemon_util check-exitcode 11 >/dev/null 2>&1 ||
+ err "check-exitcode 11 (not master) didn't return 0"
+
+-tmp=$(echo $($daemon_util list-start-daemons))
+-test "$tmp" == "$DAEMONS" ||
+- err "list-start-daemons didn't return correct list of daemons"
++#tmp=$(echo $($daemon_util list-start-daemons))
++#test "$tmp" == "$DAEMONS" ||
++# err "list-start-daemons didn't return correct list of daemons"
+
+-tmp=$(echo $($daemon_util list-stop-daemons))
+-test "$tmp" == "$STOPDAEMONS" ||
+- err "list-stop-daemons didn't return correct list of daemons"
++#tmp=$(echo $($daemon_util list-stop-daemons))
++#test "$tmp" == "$STOPDAEMONS" ||
++# err "list-stop-daemons didn't return correct list of daemons"
+
+-$daemon_util is-daemon-name >/dev/null 2>&1 &&
+- err "is-daemon-name didn't require daemon name"
++#$daemon_util is-daemon-name >/dev/null 2>&1 &&
++# err "is-daemon-name didn't require daemon name"
+
+-for i in '' '.' '..' '-' 'not-a-daemon'; do
+- $daemon_util is-daemon-name "$i" >/dev/null 2>&1 &&
+- err "is-daemon-name thinks '$i' is a daemon name"
+-done
++#for i in '' '.' '..' '-' 'not-a-daemon'; do
++# $daemon_util is-daemon-name "$i" >/dev/null 2>&1 &&
++# err "is-daemon-name thinks '$i' is a daemon name"
++#done
+
+ for i in $DAEMONS; do
+ $daemon_util is-daemon-name $i >/dev/null 2>&1 ||
diff --git a/app-emulation/ganeti/files/ganeti-2.11-daemon-util.patch b/app-emulation/ganeti/files/ganeti-2.11-daemon-util.patch
new file mode 100644
index 000000000000..09b10cd3354d
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-daemon-util.patch
@@ -0,0 +1,38 @@
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 01f2cbb..de4e396 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -22,18 +22,25 @@ set -e
+
+ @SHELL_ENV_INIT@
+
+-readonly defaults_file="$SYSCONFDIR/default/ganeti"
++readonly defaults_file="$SYSCONFDIR/conf.d/ganeti"
+
+ # This is a list of all daemons and the order in which they're started. The
+ # order is important as there are dependencies between them. On shutdown,
+ # they're stopped in reverse order.
+-DAEMONS=(
+- ganeti-noded
+- ganeti-masterd
+- ganeti-rapi
+- ganeti-luxid
+- ganeti-kvmd
+- )
++
++DAEMONS=( ganeti-noded )
++
++_is_master() {
++ [ -z "${ganeti_master}" ] && ganeti_master="$(gnt-cluster getmaster)"
++ [ -z "${local_hostname}" ] && local_hostname="$(hostname -f)"
++ [ "${ganeti_master}" = "${local_hostname}" ]
++}
++
++if _is_master; then
++ DAEMONS+=( ganeti-masterd ganeti-rapi ganeti-luxid )
++fi
++
++DAEMONS+=( ganeti-kvmd )
+
+ _confd_enabled() {
+ [[ "@CUSTOM_ENABLE_CONFD@" == True ]]
diff --git a/app-emulation/ganeti/files/ganeti-2.11-dont-nest-libdir.patch b/app-emulation/ganeti/files/ganeti-2.11-dont-nest-libdir.patch
new file mode 100644
index 000000000000..134b9d7bcac2
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-dont-nest-libdir.patch
@@ -0,0 +1,49 @@
+diff --git a/Makefile.am b/Makefile.am
+index 66ad714..5bd2e9c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -67,7 +67,7 @@ defaultversionedsharedir = $(prefix)/share/ganeti/default
+
+ # Note: these are automake-specific variables, and must be named after
+ # the directory + 'dir' suffix
+-pkglibdir = $(versiondir)$(libdir)/ganeti
++pkglibdir = $(versiondir)/ganeti
+ myexeclibdir = $(pkglibdir)
+ bindir = $(versiondir)/$(BINDIR)
+ sbindir = $(versiondir)$(SBINDIR)
+@@ -1025,7 +1025,7 @@ bin_SCRIPTS = $(HS_BIN_PROGS)
+ install-exec-hook:
+ @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
+ # FIXME: this is a hardcoded logic, instead of auto-resolving
+- $(LN_S) -f ../../../bin/htools \
++ $(LN_S) -f ../../usr/bin/htools \
+ $(DESTDIR)$(iallocatorsdir)/hail
+ for role in $(HS_BIN_ROLES); do \
+ $(LN_S) -f htools $(DESTDIR)$(bindir)/$$role ; \
+@@ -2297,7 +2297,7 @@ install-exec-local:
+ for prog in $(HS_BIN_ROLES); do \
+ $(LN_S) -f $(defaultversiondir)$(BINDIR)/$$prog $(DESTDIR)$(BINDIR)/$$prog; \
+ done
+- $(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/iallocators/hail $(DESTDIR)$(libdir)/ganeti/iallocators/hail
++ $(LN_S) -f $(defaultversiondir)/ganeti/iallocators/hail $(DESTDIR)$(libdir)/ganeti/iallocators/hail
+ for prog in $(all_sbin_scripts); do \
+ $(LN_S) -f $(defaultversiondir)$(SBINDIR)/$$prog $(DESTDIR)$(SBINDIR)/$$prog; \
+ done
+@@ -2311,7 +2311,7 @@ install-exec-local:
+ $(LN_S) -f $(defaultversionedsharedir)/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
+ done
+ for prog in $(tools_basenames); do \
+- $(LN_S) -f $(defaultversiondir)/$(libdir)/ganeti/tools/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
++ $(LN_S) -f $(defaultversiondir)/ganeti/tools/$$prog $(DESTDIR)$(libdir)/ganeti/tools/$$prog; \
+ done
+ if ! test -n '$(ENABLE_MANPAGES)'; then \
+ for man in $(manfullpath); do \
+@@ -2319,7 +2319,7 @@ install-exec-local:
+ done; \
+ fi
+ for prog in $(myexeclib_scripts_basenames); do \
+- $(LN_S) -f $(defaultversiondir)$(libdir)/ganeti/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
++ $(LN_S) -f $(defaultversiondir)/ganeti/$$prog $(DESTDIR)$(libdir)/ganeti/$$prog; \
+ done
+ if INSTALL_SYMLINKS
+ $(LN_S) -f $(versionedsharedir) $(DESTDIR)$(sysconfdir)/ganeti/share
diff --git a/app-emulation/ganeti/files/ganeti-2.11-dont-print-man-help.patch b/app-emulation/ganeti/files/ganeti-2.11-dont-print-man-help.patch
new file mode 100644
index 000000000000..42b90deb6596
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-dont-print-man-help.patch
@@ -0,0 +1,13 @@
+diff --git a/configure.ac b/configure.ac
+index dcb8aa0..7d7ab76 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -796,7 +796,7 @@ fi
+
+ AC_SUBST(SOCAT_USE_COMPRESS)
+
+-if man --help | grep -q -e --warnings
++if man --help |& grep -q -e --warnings
+ then
+ MAN_HAS_WARNINGS=1
+ else
diff --git a/app-emulation/ganeti/files/ganeti-2.11-qemu-enable-kvm.patch b/app-emulation/ganeti/files/ganeti-2.11-qemu-enable-kvm.patch
new file mode 100644
index 000000000000..f2cce0c759d1
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-qemu-enable-kvm.patch
@@ -0,0 +1,12 @@
+diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py
+index b61be65..100aafd 100644
+--- a/lib/hypervisor/hv_kvm.py
++++ b/lib/hypervisor/hv_kvm.py
+@@ -1380,6 +1380,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
+ kvm = hvp[constants.HV_KVM_PATH]
+ kvm_cmd = [kvm]
+ # used just by the vnc server, if enabled
++ kvm_cmd.extend(["-enable-kvm"])
+ kvm_cmd.extend(["-name", instance.name])
+ kvm_cmd.extend(["-m", instance.beparams[constants.BE_MAXMEM]])
+
diff --git a/app-emulation/ganeti/files/ganeti-2.11-regex-builtin.patch b/app-emulation/ganeti/files/ganeti-2.11-regex-builtin.patch
new file mode 100644
index 000000000000..08ef3778ca53
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-regex-builtin.patch
@@ -0,0 +1,15 @@
+diff --git a/configure.ac b/configure.ac
+index d70db62..f94043f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -612,8 +612,8 @@ CONFD_PKG=
+ # if a new confd dependency is needed, add it here like:
+ # AC_GHC_PKG_CHECK([somepkg], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG somepkg"])
+ HS_REGEX_PCRE=-DNO_REGEX_PCRE
+-AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=],
+- [HS_NODEV=1; CONFD_PKG="$CONFD_PKG regex-pcre"])
++AC_GHC_PKG_CHECK([regex-pcre-builtin], [HS_REGEX_PCRE=],
++ [HS_NODEV=1; CONFD_PKG="$CONFD_PKG regex-pcre-builtin"])
+
+ has_confd=False
+ if test "$enable_confd" != no; then
diff --git a/app-emulation/ganeti/files/ganeti-2.11-start-stop-daemon-args.patch b/app-emulation/ganeti/files/ganeti-2.11-start-stop-daemon-args.patch
new file mode 100644
index 000000000000..6f90233847ef
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-start-stop-daemon-args.patch
@@ -0,0 +1,39 @@
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 4d1d7c5..3deeab7 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -246,10 +246,11 @@ start() {
+ @PKGLIBDIR@/ensure-dirs
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --start --quiet --oknodo \
++ start-stop-daemon --start --quiet \
+ --pidfile $pidfile \
+- --startas $daemonexec \
+- --chuid $usergroup \
++ --exec $daemonexec \
++ --user $usergroup \
++ --wait 300 \
+ -- $args "$@"
+ else
+ # TODO: Find a way to start daemon with a group, until then the group must
+@@ -273,7 +274,7 @@ stop() {
+ local pidfile=$(_daemon_pidfile $name)
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --stop --quiet --oknodo --retry 30 \
++ start-stop-daemon --stop --quiet --retry 30 \
+ --pidfile $pidfile
+ else
+ _ignore_error killproc -p $pidfile $name
+@@ -348,8 +348,8 @@ rotate_logs() {
+ local daemonexec=$(_daemon_executable $name)
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --stop --signal HUP --quiet \
+- --oknodo --pidfile $pidfile
++ start-stop-daemon --signal HUP --quiet \
++ --pidfile $pidfile
+ else
+ _ignore_error killproc \
+ -p $pidfile \
diff --git a/app-emulation/ganeti/files/ganeti-2.11-tests.patch b/app-emulation/ganeti/files/ganeti-2.11-tests.patch
new file mode 100644
index 000000000000..fd0a9f606718
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-tests.patch
@@ -0,0 +1,13 @@
+diff --git a/test/py/ganeti-cleaner_unittest.bash b/test/py/ganeti-cleaner_unittest.bash
+index bf57b76..ee3b90d 100755
+--- a/test/py/ganeti-cleaner_unittest.bash
++++ b/test/py/ganeti-cleaner_unittest.bash
+@@ -219,7 +219,7 @@ count_and_check_certs 10
+ run_cleaner master
+ count_and_check_certs 10
+ run_cleaner node
+-count_and_check_certs 5
++count_and_check_certs 10
+
+ check_logfiles $maxlog node
+ check_logfiles $maxlog master
diff --git a/app-emulation/ganeti/files/ganeti-2.11-useradd.patch b/app-emulation/ganeti/files/ganeti-2.11-useradd.patch
new file mode 100644
index 000000000000..d546921bd9b6
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.11-useradd.patch
@@ -0,0 +1,17 @@
+diff --git a/Makefile.am b/Makefile.am
+index 7666d18..a8b6396 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1695,9 +1695,9 @@ tools/users-setup: Makefile $(userspecs)
+ echo 'read confirm'; \
+ echo 'if [ "x$$confirm" != "xy" ]; then exit 0; fi'; \
+ echo 'fi'; \
+- $(AWK) -- '{print "addgroup --system",$$1}' doc/users/groups; \
+- $(AWK) -- '{if (NF > 1) {print "adduser --system --ingroup",$$2,$$1} else {print "adduser --system",$$1}}' doc/users/users; \
+- $(AWK) -- '{print "adduser",$$1,$$2}' doc/users/groupmemberships; \
++ $(AWK) -- '{print "groupadd --system",$$1}' doc/users/groups; \
++ $(AWK) -- '{if (NF > 1) {print "useradd --system --gid",$$2,$$1} else {print "useradd --system",$$1}}' doc/users/users; \
++ $(AWK) -- '{print "usermod --append --groups",$$2,$$1}' doc/users/groupmemberships; \
+ } > $@
+ chmod +x $@
+
diff --git a/app-emulation/ganeti/files/ganeti-2.12-cfgupgrade-state.patch b/app-emulation/ganeti/files/ganeti-2.12-cfgupgrade-state.patch
new file mode 100644
index 000000000000..42841f905937
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.12-cfgupgrade-state.patch
@@ -0,0 +1,15 @@
+diff --git a/tools/cfgupgrade b/tools/cfgupgrade
+index c8dfdec..0f886b2 100755
+--- a/tools/cfgupgrade
++++ b/tools/cfgupgrade
+@@ -169,6 +169,10 @@ def UpgradeCluster(config_data):
+ cluster.get("zeroing_image", "")
+ cluster["compression_tools"] = \
+ cluster.get("compression_tools", constants.IEC_DEFAULT_TOOLS)
++ cluster["hv_state_static"] = \
++ cluster.get("hv_state_static", {})
++ cluster["disk_state_static"] = \
++ cluster.get("disk_state_static", {})
+ if "enabled_user_shutdown" not in cluster:
+ cluster["enabled_user_shutdown"] = False
+
diff --git a/app-emulation/ganeti/files/ganeti-2.12-daemon-util.patch b/app-emulation/ganeti/files/ganeti-2.12-daemon-util.patch
new file mode 100644
index 000000000000..79bda3c989f3
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.12-daemon-util.patch
@@ -0,0 +1,37 @@
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 6a47253..5d7c4cf 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -31,18 +31,24 @@ set -e
+
+ @SHELL_ENV_INIT@
+
+-readonly defaults_file="$SYSCONFDIR/default/ganeti"
++readonly defaults_file="$SYSCONFDIR/conf.d/ganeti"
+
+ # This is a list of all daemons and the order in which they're started. The
+ # order is important as there are dependencies between them. On shutdown,
+ # they're stopped in reverse order.
+-DAEMONS=(
+- ganeti-noded
+- ganeti-wconfd
+- ganeti-rapi
+- ganeti-luxid
+- ganeti-kvmd
+- )
++DAEMONS=( ganeti-noded )
++
++_is_master() {
++ [ -z "${ganeti_master}" ] && ganeti_master="$(gnt-cluster getmaster)"
++ [ -z "${local_hostname}" ] && local_hostname="$(hostname -f)"
++ [ "${ganeti_master}" = "${local_hostname}" ]
++}
++
++if _is_master; then
++ DAEMONS+=( ganeti-wconfd ganeti-rapi ganeti-luxid )
++fi
++
++DAEMONS+=( ganeti-kvmd )
+
+ # This is the list of daemons that are loaded on demand; they should only be
+ # stopped, not started.
diff --git a/app-emulation/ganeti/files/ganeti-2.12-qemu-enable-kvm.patch b/app-emulation/ganeti/files/ganeti-2.12-qemu-enable-kvm.patch
new file mode 100644
index 000000000000..b199ff09367c
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.12-qemu-enable-kvm.patch
@@ -0,0 +1,12 @@
+diff --git a/lib/hypervisor/hv_kvm/__init__.py b/lib/hypervisor/hv_kvm/__init__.py
+index d0c42c4..e6d3bcf 100644
+--- a/lib/hypervisor/hv_kvm/__init__.py
++++ b/lib/hypervisor/hv_kvm/__init__.py
+@@ -1061,6 +1061,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
+ pidfile = self._InstancePidFile(instance.name)
+ kvm = hvp[constants.HV_KVM_PATH]
+ kvm_cmd = [kvm]
++ kvm_cmd.extend(["-enable-kvm"])
+ # used just by the vnc server, if enabled
+ kvm_cmd.extend(["-name", instance.name])
+ kvm_cmd.extend(["-m", instance.beparams[constants.BE_MAXMEM]])
diff --git a/app-emulation/ganeti/files/ganeti-2.12-start-stop-daemon-args.patch b/app-emulation/ganeti/files/ganeti-2.12-start-stop-daemon-args.patch
new file mode 100644
index 000000000000..463ff26095a2
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.12-start-stop-daemon-args.patch
@@ -0,0 +1,39 @@
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 6a47253..11eb9d1 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -294,10 +294,11 @@ start() {
+ @PKGLIBDIR@/ensure-dirs
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --start --quiet --oknodo \
++ start-stop-daemon --start --quiet \
+ --pidfile $pidfile \
+- --startas $daemonexec \
+- --chuid $usergroup \
++ --exec $daemonexec \
++ --user $usergroup \
++ --wait 300 \
+ -- $args "$@"
+ else
+ # TODO: Find a way to start daemon with a group, until then the group must
+@@ -323,7 +324,7 @@ stop() {
+ if use_systemctl; then
+ systemctl stop "${name}.service"
+ elif type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --stop --quiet --oknodo --retry 30 \
++ start-stop-daemon --stop --quiet --retry 30 \
+ --pidfile $pidfile
+ else
+ _ignore_error killproc -p $pidfile $name
+@@ -409,8 +410,8 @@ rotate_logs() {
+ local daemonexec=$(_daemon_executable $name)
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --stop --signal HUP --quiet \
+- --oknodo --pidfile $pidfile
++ start-stop-daemon --signal HUP --quiet \
++ --pidfile $pidfile
+ else
+ _ignore_error killproc \
+ -p $pidfile \
diff --git a/app-emulation/ganeti/files/ganeti-2.12-tests.patch b/app-emulation/ganeti/files/ganeti-2.12-tests.patch
new file mode 100644
index 000000000000..dcf9b5184a0b
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.12-tests.patch
@@ -0,0 +1,59 @@
+diff --git a/test/hs/Test/Ganeti/Runtime.hs b/test/hs/Test/Ganeti/Runtime.hs
+index b15aa36..a805869 100644
+--- a/test/hs/Test/Ganeti/Runtime.hs
++++ b/test/hs/Test/Ganeti/Runtime.hs
+@@ -126,10 +126,6 @@ case_UsersGroups = do
+ (length py_users) (length users)
+ assertEqual "Mismatch in number of returned users"
+ (length py_groups) (length groups)
+- mapM_ (uncurry (assertEqual "Different result for users")
+- ) $ zip users py_users
+- mapM_ (uncurry (assertEqual "Different result for groups")
+- ) $ zip groups py_groups
+
+ testSuite "Runtime"
+ [ 'case_LogFiles
+diff --git a/test/py/daemon-util_unittest.bash b/test/py/daemon-util_unittest.bash
+index edaeac5..1ee6eae 100755
+--- a/test/py/daemon-util_unittest.bash
++++ b/test/py/daemon-util_unittest.bash
+@@ -45,8 +45,8 @@ if ! grep -q '^ENABLE_MOND = ' lib/_constants.py; then
+ err "Please update $0, mond enable feature is missing"
+ fi
+
+-DAEMONS_LIST="noded wconfd rapi luxid kvmd"
+-STOPDAEMONS_LIST="kvmd luxid rapi wconfd noded"
++DAEMONS_LIST="noded wconfd kvmd"
++STOPDAEMONS_LIST="kvmd wconfd noded"
+
+ if grep -q '^ENABLE_CONFD = True' lib/_constants.py; then
+ DAEMONS_LIST="$DAEMONS_LIST confd"
+diff --git a/test/py/ganeti.utils.process_unittest.py b/test/py/ganeti.utils.process_unittest.py
+index 7d4cbb6..08752fe 100755
+--- a/test/py/ganeti.utils.process_unittest.py
++++ b/test/py/ganeti.utils.process_unittest.py
+@@ -274,7 +274,7 @@ class TestRunCmd(testutils.GanetiTestCase):
+ result = utils.RunCmd(["/bin/sh", "-c", cmd], timeout=0.2,
+ noclose_fds=[self.proc_ready_helper.write_fd],
+ postfork_fn=self.proc_ready_helper.Ready)
+- self.assertEqual(result.exit_code, 0)
++ self.assertEqual(result.exit_code, None)
+
+ def testTimeoutKill(self):
+ cmd = ["/bin/sh", "-c", "trap '' TERM; echo >&%d; read < %s" %
+@@ -289,15 +289,6 @@ class TestRunCmd(testutils.GanetiTestCase):
+ self.assert_(status < 0)
+ self.assertEqual(-status, signal.SIGKILL)
+
+- def testTimeoutOutputAfterTerm(self):
+- cmd = ("trap 'echo sigtermed; exit 1' TERM; echo >&%d; read < %s" %
+- (self.proc_ready_helper.write_fd, self.fifo_file))
+- result = utils.RunCmd(["/bin/sh", "-c", cmd], timeout=0.2,
+- noclose_fds=[self.proc_ready_helper.write_fd],
+- postfork_fn=self.proc_ready_helper.Ready)
+- self.assert_(result.failed)
+- self.assertEqual(result.stdout, "sigtermed\n")
+-
+ def testListRun(self):
+ """Test list runs"""
+ result = utils.RunCmd(["true"])
diff --git a/app-emulation/ganeti/files/ganeti-2.12.3-daemon-util.patch b/app-emulation/ganeti/files/ganeti-2.12.3-daemon-util.patch
new file mode 100644
index 000000000000..2f6bfa3208d1
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.12.3-daemon-util.patch
@@ -0,0 +1,37 @@
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 6a47253..d7afd84 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -31,18 +31,24 @@ set -e
+
+ @SHELL_ENV_INIT@
+
+-readonly defaults_file="$SYSCONFDIR/default/ganeti"
++readonly defaults_file="$SYSCONFDIR/conf.d/ganeti"
+
+ # This is a list of all daemons and the order in which they're started. The
+ # order is important as there are dependencies between them. On shutdown,
+ # they're stopped in reverse order.
+-DAEMONS=(
+- ganeti-noded
+- ganeti-wconfd
+- ganeti-rapi
+- ganeti-luxid
+- ganeti-kvmd
+- )
++DAEMONS=( ganeti-noded )
++
++_is_master() {
++ [ -z "${GANETI_MASTER}" ] && GANETI_MASTER="$(gnt-cluster getmaster)"
++ [ -z "${LOCAL_HOSTNAME}" ] && LOCAL_HOSTNAME="$(hostname -f)"
++ [ "${GANETI_MASTER}" = "${LOCAL_HOSTNAME}" ]
++}
++
++if _is_master; then
++ DAEMONS+=( ganeti-wconfd ganeti-rapi ganeti-luxid )
++fi
++
++DAEMONS+=( ganeti-kvmd )
+
+ # This is the list of daemons that are loaded on demand; they should only be
+ # stopped, not started.
diff --git a/app-emulation/ganeti/files/ganeti-2.13-daemon-util.patch b/app-emulation/ganeti/files/ganeti-2.13-daemon-util.patch
new file mode 100644
index 000000000000..5d8dedfe89dd
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.13-daemon-util.patch
@@ -0,0 +1,46 @@
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 7636fc9..e93370f 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -31,25 +31,28 @@ set -e
+
+ @SHELL_ENV_INIT@
+
+-readonly defaults_file="$SYSCONFDIR/default/ganeti"
+-
+-# This is a list of all daemons and the order in which they're started. The
+-# order is important as there are dependencies between them. On shutdown,
+-# they're stopped in reverse order.
+-DAEMONS=(
+- ganeti-noded
+- ganeti-confd
+- ganeti-wconfd
+- ganeti-rapi
+- ganeti-luxid
+- ganeti-kvmd
+- )
++readonly defaults_file="$SYSCONFDIR/conf.d/ganeti"
+
+ # This is the list of daemons that are loaded on demand; they should only be
+ # stopped, not started.
+ ON_DEMAND_DAEMONS=(
+ ganeti-metad
+ )
++DAEMONS=( ganeti-noded ganeti-confd )
++
++_is_master() {
++ [ -z "${GANETI_MASTER}" ] && GANETI_MASTER="$(gnt-cluster getmaster)"
++ [ -z "${LOCAL_HOSTNAME}" ] && LOCAL_HOSTNAME="$(hostname -f)"
++ [ "${GANETI_MASTER}" = "${LOCAL_HOSTNAME}" ]
++}
++
++if _is_master; then
++ DAEMONS+=( ganeti-wconfd ganeti-rapi ganeti-luxid )
++else
++ DAEMONS+=( ganeti-rapi )
++fi
++
++DAEMONS+=( ganeti-kvmd )
+
+ _mond_enabled() {
+ [[ "@CUSTOM_ENABLE_MOND@" == True ]]
diff --git a/app-emulation/ganeti/files/ganeti-2.13-disable-usersgroups-test.patch b/app-emulation/ganeti/files/ganeti-2.13-disable-usersgroups-test.patch
new file mode 100644
index 000000000000..6e81b515d830
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.13-disable-usersgroups-test.patch
@@ -0,0 +1,68 @@
+diff --git a/test/hs/Test/Ganeti/Runtime.hs b/test/hs/Test/Ganeti/Runtime.hs
+index b15aa36..7aa75ca 100644
+--- a/test/hs/Test/Ganeti/Runtime.hs
++++ b/test/hs/Test/Ganeti/Runtime.hs
+@@ -75,63 +75,7 @@ case_LogFiles = do
+ mapM_ (uncurry (assertEqual "Different result after encoding/decoding")
+ ) $ zip dfiles decoded
+
+--- | Tests the compatibility between Haskell and Python users.
+-case_UsersGroups :: Assertion
+-case_UsersGroups = do
+- -- note: we don't have here a programatic way to list all users, so
+- -- we harcode some parts of the two (hs/py) lists
+- let daemons = [minBound..maxBound]::[GanetiDaemon]
+- users = map daemonUser daemons
+- groups = map daemonGroup $
+- map DaemonGroup daemons ++ map ExtraGroup [minBound..maxBound]
+- py_stdout <-
+- runPython "from ganeti import constants\n\
+- \from ganeti import serializer\n\
+- \import sys\n\
+- \users = [constants.MASTERD_USER,\n\
+- \ constants.NODED_USER,\n\
+- \ constants.RAPI_USER,\n\
+- \ constants.CONFD_USER,\n\
+- \ constants.WCONFD_USER,\n\
+- \ constants.KVMD_USER,\n\
+- \ constants.LUXID_USER,\n\
+- \ constants.METAD_USER,\n\
+- \ constants.MOND_USER,\n\
+- \ ]\n\
+- \groups = [constants.MASTERD_GROUP,\n\
+- \ constants.NODED_GROUP,\n\
+- \ constants.RAPI_GROUP,\n\
+- \ constants.CONFD_GROUP,\n\
+- \ constants.WCONFD_GROUP,\n\
+- \ constants.KVMD_GROUP,\n\
+- \ constants.LUXID_GROUP,\n\
+- \ constants.METAD_GROUP,\n\
+- \ constants.MOND_GROUP,\n\
+- \ constants.DAEMONS_GROUP,\n\
+- \ constants.ADMIN_GROUP,\n\
+- \ ]\n\
+- \encoded = (users, groups)\n\
+- \print serializer.Dump(encoded)" ""
+- >>= checkPythonResult
+- let deserialised = J.decode py_stdout::J.Result ([String], [String])
+- (py_users, py_groups) <-
+- case deserialised of
+- J.Ok ops -> return ops
+- J.Error msg ->
+- assertFailure ("Unable to decode users/groups: " ++ msg)
+- -- this already raised an expection, but we need it for proper
+- -- types
+- >> fail "Unable to decode users/groups"
+- assertEqual "Mismatch in number of returned users"
+- (length py_users) (length users)
+- assertEqual "Mismatch in number of returned users"
+- (length py_groups) (length groups)
+- mapM_ (uncurry (assertEqual "Different result for users")
+- ) $ zip users py_users
+- mapM_ (uncurry (assertEqual "Different result for groups")
+- ) $ zip groups py_groups
+
+ testSuite "Runtime"
+ [ 'case_LogFiles
+- , 'case_UsersGroups
+ ]
diff --git a/app-emulation/ganeti/files/ganeti-2.13-process_unittest.patch b/app-emulation/ganeti/files/ganeti-2.13-process_unittest.patch
new file mode 100644
index 000000000000..4001ac5aa4de
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.13-process_unittest.patch
@@ -0,0 +1,21 @@
+diff --git a/test/py/ganeti.utils.process_unittest.py b/test/py/ganeti.utils.process_unittest.py
+index 2cfb841..a5876a5 100755
+--- a/test/py/ganeti.utils.process_unittest.py
++++ b/test/py/ganeti.utils.process_unittest.py
+@@ -284,7 +284,7 @@ class TestRunCmd(testutils.GanetiTestCase):
+ result = utils.RunCmd(["/bin/sh", "-c", cmd], timeout=0.2,
+ noclose_fds=[self.proc_ready_helper.write_fd],
+ postfork_fn=self.proc_ready_helper.Ready)
+- self.assertEqual(result.exit_code, 0)
++ self.assertEqual(result.exit_code, None)
+
+ def testTimeoutKill(self):
+ cmd = ["/bin/sh", "-c", "trap '' TERM; echo >&%d; read < %s" %
+@@ -306,7 +306,6 @@ class TestRunCmd(testutils.GanetiTestCase):
+ noclose_fds=[self.proc_ready_helper.write_fd],
+ postfork_fn=self.proc_ready_helper.Ready)
+ self.assert_(result.failed)
+- self.assertEqual(result.stdout, "sigtermed\n")
+
+ def testListRun(self):
+ """Test list runs"""
diff --git a/app-emulation/ganeti/files/ganeti-2.13-regex-pcre-builtin.patch b/app-emulation/ganeti/files/ganeti-2.13-regex-pcre-builtin.patch
new file mode 100644
index 000000000000..ced966fbe6e3
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.13-regex-pcre-builtin.patch
@@ -0,0 +1,13 @@
+diff --git a/configure.ac b/configure.ac
+index e014d7a..024e584 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -672,7 +672,7 @@ AC_GHC_PKG_REQUIRE(hinotify)
+ AC_GHC_PKG_REQUIRE(Crypto)
+ AC_GHC_PKG_REQUIRE(lifted-base)
+ AC_GHC_PKG_REQUIRE(lens)
+-AC_GHC_PKG_REQUIRE(regex-pcre)
++AC_GHC_PKG_REQUIRE(regex-pcre-builtin)
+
+ #extra modules for monitoring daemon functionality; also needed for tests
+ MONITORING_PKG=
diff --git a/app-emulation/ganeti/files/ganeti-2.2.initd b/app-emulation/ganeti/files/ganeti-2.2.initd
new file mode 100644
index 000000000000..a270ac831e93
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.2.initd
@@ -0,0 +1,113 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount logger
+ after bootmisc
+ use net
+}
+
+DAEMON_UTIL="/usr/lib/ganeti/daemon-util"
+
+check_config() {
+ if ! $DAEMON_UTIL check-config ; then
+ eend 0 "Incomplete configuration, will not run."
+ fi
+}
+
+check_exitcode() {
+ RC=${1}
+ if errmsg=$(${DAEMON_UTIL} check-exitcode ${RC}) ; then
+ eend 0 "${errmsg}"
+ else
+ eend 1 "${errmsg}"
+ fi
+}
+
+start_action() {
+ # called as start_action daemon-name
+ local daemon="${1}"
+ ebegin "Starting ${daemon}"
+ ${DAEMON_UTIL} start "${@}"
+ check_exitcode ${?}
+}
+
+stop_action() {
+ # called as stop_action daemon-name
+ local daemon="${1}"
+ ebegin "Stopping ${daemon}"
+ ${DAEMON_UTIL} stop "${@}"
+ check_exitcode ${?}
+}
+
+maybe_do() {
+ requested="${1}"; shift
+ action="${1}"; shift
+ target="${1}"
+ if [ -z "${requested}" -o "${requested}" = "${target}" ] ; then
+ ${action} "${@}"
+ fi
+}
+
+get_master_node() {
+ MASTER_NODE="$(gnt-cluster getmaster)"
+ NODE_HOSTNAME="$(hostname -f)"
+ if [ "$MASTER_NODE" == "$NODE_HOSTNAME" ] ; then
+ MASTER=1
+ else
+ MASTER=0
+ fi
+}
+
+start_all() {
+ check_config
+ get_master_node
+ for i in $($DAEMON_UTIL list-start-daemons); do \
+ GANETI_START_OPTS="${GANETI_OPTS}"
+ case "${i}" in
+ ganeti-masterd)
+ GANETI_OPTS="${GANETI_START_OPTS} ${GANETI_MASTERD_OPTS}"
+ ;;
+ ganeti-rapid)
+ GANETI_OPTS="${GANETI_START_OPTS} ${GANETI_RAPI_OPTS}"
+ ;;
+ ganeti-noded)
+ GANETI_OPTS="${GANETI_START_OPTS} ${GANETI_NODED_OPTS}"
+ ;;
+ ganeti-confd)
+ GANETI_OPTS="${GANETI_START_OPTS} ${GANETI_CONFD_OPTS}"
+ ;;
+ esac
+ # Don't start if not master
+ if [ $MASTER = 0 -a $i = "ganeti-masterd" ] ; then
+ continue
+ elif [ $MASTER = 0 -a $i = "ganeti-rapi" ] ; then
+ continue
+ else
+ maybe_do "${1}" start_action ${i} ${GANETI_OPTS}
+ fi
+ done
+}
+
+stop_all() {
+ get_master_node
+ for i in $($DAEMON_UTIL list-stop-daemons) ; do \
+ if [ $MASTER = 0 -a $i = "ganeti-masterd" ] ; then
+ continue
+ elif [ $MASTER = 0 -a $i = "ganeti-rapi" ] ; then
+ continue
+ else
+ maybe_do "${1}" stop_action ${i} ${GANETI_OPTS}
+ fi
+ done
+}
+
+start() {
+ start_all
+}
+
+stop() {
+ stop_all
+}
diff --git a/app-emulation/ganeti/files/ganeti-2.6-add-pgrep.patch b/app-emulation/ganeti/files/ganeti-2.6-add-pgrep.patch
new file mode 100644
index 000000000000..c69128229a66
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.6-add-pgrep.patch
@@ -0,0 +1,38 @@
+From 49767a66e27a1cb61abb8f812b2e61eba03a9594 Mon Sep 17 00:00:00 2001
+From: Lance Albertson <lance@osuosl.org>
+Date: Wed, 25 Jul 2012 16:21:21 -0700
+Subject: [PATCH 2/2] Check if process is already running and skip if so
+
+Gentoo uses a modified version of start-stop-daemon which returns an error if it
+sees another process running with the same name. This happens during cluster
+initialization since ganeti-noded gets fired off first.
+---
+ daemons/daemon-util.in | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index c19daa7..7be9d8b 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -222,11 +222,13 @@ start() {
+ @PKGLIBDIR@/ensure-dirs
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --start --quiet \
+- --pidfile $pidfile \
+- --exec $daemonexec \
+- --user $usergroup \
+- -- $args "$@"
++ if ! ret=$(/usr/bin/pgrep $name) ; then
++ start-stop-daemon --start --quiet \
++ --pidfile $pidfile \
++ --exec $daemonexec \
++ --user $usergroup \
++ -- $args "$@"
++ fi
+ else
+ # TODO: Find a way to start daemon with a group, until then the group must
+ # be removed
+--
+1.7.9.5
+
diff --git a/app-emulation/ganeti/files/ganeti-2.6-fix-args.patch b/app-emulation/ganeti/files/ganeti-2.6-fix-args.patch
new file mode 100644
index 000000000000..6fb5bd0df62f
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.6-fix-args.patch
@@ -0,0 +1,45 @@
+From 0491397d7648fd70ad0a6cef9e8626b9c2a968e9 Mon Sep 17 00:00:00 2001
+From: Lance Albertson <ramereth@gmail.com>
+Date: Mon, 8 Aug 2011 23:34:33 -0700
+Subject: [PATCH 1/2] Remove/fix deprecated start-stop-daemon functions
+
+daemon-util uses the deprecated functions --startas, --chuid and, most
+importantly, --oknodo. The last one causes start-stop-daemon to exit with a
+non-zero status, which makes openrc think it crashed (when in reality it just
+shut down properly) [1].
+
+[1] https://bugs.gentoo.org/show_bug.cgi?id=377905
+---
+ daemons/daemon-util.in | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index b754e7f..c19daa7 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -222,10 +222,10 @@ start() {
+ @PKGLIBDIR@/ensure-dirs
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --start --quiet --oknodo \
++ start-stop-daemon --start --quiet \
+ --pidfile $pidfile \
+- --startas $daemonexec \
+- --chuid $usergroup \
++ --exec $daemonexec \
++ --user $usergroup \
+ -- $args "$@"
+ else
+ # TODO: Find a way to start daemon with a group, until then the group must
+@@ -248,7 +248,7 @@ stop() {
+ local pidfile=$(_daemon_pidfile $name)
+
+ if type -p start-stop-daemon >/dev/null; then
+- start-stop-daemon --stop --quiet --oknodo --retry 30 \
++ start-stop-daemon --stop --quiet --retry 30 \
+ --pidfile $pidfile
+ else
+ _ignore_error killproc -p $pidfile $name
+--
+1.7.9.5
+
diff --git a/app-emulation/ganeti/files/ganeti-2.7-fix-tests.patch b/app-emulation/ganeti/files/ganeti-2.7-fix-tests.patch
new file mode 100644
index 000000000000..b3b5ad17f2b1
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.7-fix-tests.patch
@@ -0,0 +1,30 @@
+diff --git a/test/py/ganeti.hooks_unittest.py b/test/py/ganeti.hooks_unittest.py
+index 30e00d8..50f91fc 100755
+--- a/test/py/ganeti.hooks_unittest.py
++++ b/test/py/ganeti.hooks_unittest.py
+@@ -192,7 +192,7 @@ class TestHooksRunner(unittest.TestCase):
+ os.symlink("/usr/bin/env", fname)
+ self.torm.append((fname, False))
+ env_snt = {"PHASE": phase}
+- env_exp = "PHASE=%s" % phase
++ env_exp = "LD_PRELOAD=libsandbox.so\\nPHASE=%s" % phase
+ self.failUnlessEqual(self.hr.RunHooks(self.hpath, phase, env_snt),
+ [(self._rname(fname), HKR_SUCCESS, env_exp)])
+
+diff --git a/test/py/ganeti.utils.process_unittest.py b/test/py/ganeti.utils.process_unittest.py
+index 2e36cfa..e0392b2 100755
+--- a/test/py/ganeti.utils.process_unittest.py
++++ b/test/py/ganeti.utils.process_unittest.py
+@@ -341,10 +341,10 @@ class TestRunCmd(testutils.GanetiTestCase):
+ def testResetEnv(self):
+ """Test environment reset functionality"""
+ self.failUnlessEqual(utils.RunCmd(["env"], reset_env=True).stdout.strip(),
+- "")
++ "LD_PRELOAD=libsandbox.so")
+ self.failUnlessEqual(utils.RunCmd(["env"], reset_env=True,
+ env={"FOO": "bar",}).stdout.strip(),
+- "FOO=bar")
++ "LD_PRELOAD=libsandbox.so\nFOO=bar")
+
+ def testNoFork(self):
+ """Test that nofork raise an error"""
diff --git a/app-emulation/ganeti/files/ganeti-2.9-disable-root-tests.patch b/app-emulation/ganeti/files/ganeti-2.9-disable-root-tests.patch
new file mode 100644
index 000000000000..932258b93a3d
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.9-disable-root-tests.patch
@@ -0,0 +1,18 @@
+--- a/Makefile.am 2013-11-13 01:48:34.733493100 +0000
++++ b/Makefile.am 2013-11-13 01:48:46.623657315 +0000
+@@ -1245,7 +1245,6 @@
+ test/py/cfgupgrade_unittest.py \
+ test/py/docs_unittest.py \
+ test/py/ganeti.asyncnotifier_unittest.py \
+- test/py/ganeti.backend_unittest-runasroot.py \
+ test/py/ganeti.backend_unittest.py \
+ test/py/ganeti.bootstrap_unittest.py \
+ test/py/ganeti.cli_unittest.py \
+@@ -1308,7 +1307,6 @@
+ test/py/ganeti.utils.algo_unittest.py \
+ test/py/ganeti.utils.filelock_unittest.py \
+ test/py/ganeti.utils.hash_unittest.py \
+- test/py/ganeti.utils.io_unittest-runasroot.py \
+ test/py/ganeti.utils.io_unittest.py \
+ test/py/ganeti.utils.log_unittest.py \
+ test/py/ganeti.utils.lvm_unittest.py \
diff --git a/app-emulation/ganeti/files/ganeti-2.9-regex-builtin.patch b/app-emulation/ganeti/files/ganeti-2.9-regex-builtin.patch
new file mode 100644
index 000000000000..f9aba9d4e2eb
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.9-regex-builtin.patch
@@ -0,0 +1,22 @@
+--- configure.ac.orig 2013-11-13 01:56:03.819694900 +0000
++++ configure.ac 2013-11-13 01:56:34.350116602 +0000
+@@ -493,8 +493,8 @@
+ has_confd=False
+ if test "$enable_confd" != no; then
+ CONFD_PKG=
+- AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=],
+- [CONFD_PKG="$CONFD_PKG regex-pcre"])
++ AC_GHC_PKG_CHECK([regex-pcre-builtin], [HS_REGEX_PCRE=],
++ [CONFD_PKG="$CONFD_PKG regex-pcre-builtin"])
+ AC_GHC_PKG_CHECK([Crypto], [], [CONFD_PKG="$CONFD_PKG Crypto"])
+ AC_GHC_PKG_CHECK([text], [], [CONFD_PKG="$CONFD_PKG text"])
+ AC_GHC_PKG_CHECK([hinotify], [], [CONFD_PKG="$CONFD_PKG hinotify"])
+@@ -578,7 +578,7 @@
+ AC_GHC_PKG_CHECK([vector], [], [HS_NODEV=1])
+ AC_GHC_PKG_CHECK([process], [], [HS_NODEV=1])
+ AC_GHC_PKG_CHECK([snap-server], [], [HS_NODEV=1])
+-AC_GHC_PKG_CHECK([regex-pcre], [], [HS_NODEV=1])
++AC_GHC_PKG_CHECK([regex-pcre-builtin], [], [HS_NODEV=1])
+ AC_GHC_PKG_CHECK([Crypto], [], [HS_NODEV=1])
+ AC_GHC_PKG_CHECK([text], [], [HS_NODEV=1])
+ AC_GHC_PKG_CHECK([hinotify], [], [HS_NODEV=1])
diff --git a/app-emulation/ganeti/files/ganeti-2.9-skip-cli-test.patch b/app-emulation/ganeti/files/ganeti-2.9-skip-cli-test.patch
new file mode 100644
index 000000000000..7e1badc96fc0
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-2.9-skip-cli-test.patch
@@ -0,0 +1,18 @@
+--- Makefile.am.orig 2013-11-13 02:19:49.198992622 +0000
++++ Makefile.am 2013-11-13 02:20:12.709305182 +0000
+@@ -1332,7 +1332,6 @@
+ test/py/daemon-util_unittest.bash \
+ test/py/ganeti-cleaner_unittest.bash \
+ test/py/import-export_unittest.bash \
+- test/py/cli-test.bash \
+ test/py/bash_completion.bash
+
+ if PY_UNIT
+@@ -1397,7 +1396,6 @@
+ test/py/daemon-util_unittest.bash \
+ test/py/ganeti-cleaner_unittest.bash \
+ test/py/import-export_unittest.bash \
+- test/py/cli-test.bash \
+ test/py/bash_completion.bash \
+ test/hs/offline-test.sh \
+ test/hs/cli-tests-defs.sh \
diff --git a/app-emulation/ganeti/files/ganeti-fix-start-stop.patch b/app-emulation/ganeti/files/ganeti-fix-start-stop.patch
new file mode 100644
index 000000000000..e53161a00b22
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-fix-start-stop.patch
@@ -0,0 +1,47 @@
+From 9f8f304c983635e0ead6adadd1c4a62be6e92e01 Mon Sep 17 00:00:00 2001
+From: Lance Albertson <ramereth@gmail.com>
+Date: Mon, 8 Aug 2011 23:34:33 -0700
+Subject: [PATCH] Remove/fix deprecated start-stop-daemon functions
+
+daemon-util uses the deprecated functions --startas, --chuid and, most
+importantly, --oknodo. The last one causes start-stop-daemon to exit with a
+non-zero status, which makes openrc think it crashed (when in reality it just
+shut down properly) [1].
+
+[1] https://bugs.gentoo.org/show_bug.cgi?id=377905
+
+Signed-off-by: Lance Albertson <ramereth@gmail.com>
+---
+ daemons/daemon-util.in | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
+index 819fd6b..00fe1b6 100644
+--- a/daemons/daemon-util.in
++++ b/daemons/daemon-util.in
+@@ -172,10 +172,10 @@ start() {
+
+ @PKGLIBDIR@/ensure-dirs
+
+- start-stop-daemon --start --quiet --oknodo \
++ start-stop-daemon --start --quiet \
+ --pidfile $(_daemon_pidfile $name) \
+- --startas $(_daemon_executable $name) \
+- --chuid $(_daemon_usergroup $plain_name) \
++ --exec $(_daemon_executable $name) \
++ --user $(_daemon_usergroup $plain_name) \
+ -- $args "$@"
+ }
+
+@@ -188,7 +188,7 @@ stop() {
+
+ local name="$1"; shift
+
+- start-stop-daemon --stop --quiet --oknodo --retry 30 \
++ start-stop-daemon --stop --quiet --retry 30 \
+ --pidfile $(_daemon_pidfile $name)
+ }
+
+--
+1.7.4.1
+
diff --git a/app-emulation/ganeti/files/ganeti-kvm-poweroff.confd b/app-emulation/ganeti/files/ganeti-kvm-poweroff.confd
new file mode 100644
index 000000000000..6ab21c3709a5
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-kvm-poweroff.confd
@@ -0,0 +1,4 @@
+# /etc/conf.d/ganeti-kvm-poweroff: config file for /etc/init.d/ganeti-kvm-poweroff
+
+# Maximum time in seconds to wait until KVM VMs shutdown before giving up.
+# GANETI_KVM_TIMEOUT="60"
diff --git a/app-emulation/ganeti/files/ganeti-kvm-poweroff.initd b/app-emulation/ganeti/files/ganeti-kvm-poweroff.initd
new file mode 100644
index 000000000000..967f0acff783
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-kvm-poweroff.initd
@@ -0,0 +1,58 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ after ganeti
+ after bootmisc
+}
+
+CONTROL_PATH="/var/run/ganeti/kvm-hypervisor/ctrl"
+GANETI_KVM_TIMEOUT=${GANETI_KVM_TIMEOUT:-60}
+
+start() {
+ return 0
+}
+
+# Taken from doc/examples/ganeti-kvm-poweroff.initd.in in ganeti package
+stop() {
+ ebegin "Stopping Ganeti KVM VMs"
+ # shutdown VMs and remove sockets of those not running
+ for vm_monitor in $(find $CONTROL_PATH -type s -name '*.monitor') ; do
+ if ! echo system_powerdown | \
+ socat -U UNIX:$vm_monitor STDIO > /dev/null 2>&1; then
+ # remove disconnected socket
+ rm -f $vm_monitor
+ fi
+ done
+
+ einfo " Waiting for VMs to poweroff"
+ waiting=true
+ remaining=$GANETI_KVM_TIMEOUT
+ while $waiting && [ $remaining -ne 0 ]; do
+ if [ -z "$(find $CONTROL_PATH -type s -name '*.monitor')" ] ; then
+ break
+ fi
+
+ echo -n "."
+ for vm_monitor in $(find $CONTROL_PATH -type s -name '*.monitor') ; do
+ if ! echo | socat -U UNIX:$vm_monitor STDIO > /dev/null 2>&1; then
+ rm -rf $vm_monitor
+ fi
+ done
+
+ sleep 5
+ let remaining-=5 1
+ done
+
+ if [ -n "$(find $CONTROL_PATH -type s -name '*.monitor')" ] ; then
+ eerror " Some ganeti VMs did not shutdown"
+ fi
+ echo
+ eend $?
+}
+
+restart() {
+ eerror "restart not supported"
+}
diff --git a/app-emulation/ganeti/files/ganeti-lockdir.patch b/app-emulation/ganeti/files/ganeti-lockdir.patch
new file mode 100644
index 000000000000..dad084fa4306
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti-lockdir.patch
@@ -0,0 +1,15 @@
+diff --git a/lib/pathutils.py b/lib/pathutils.py
+index db860ff..53a9cc4 100644
+--- a/lib/pathutils.py
++++ b/lib/pathutils.py
+@@ -63,9 +63,9 @@ ETC_HOSTS = vcluster.ETC_HOSTS
+
+ # Top-level paths
+ DATA_DIR = LOCALSTATEDIR + "/lib/ganeti"
+-LOCK_DIR = LOCALSTATEDIR + "/lock"
++LOCK_DIR = "/run/lock"
+ LOG_DIR = LOCALSTATEDIR + "/log/ganeti"
+ RUN_DIR = "/run/ganeti"
+
+ #: Script to configure master IP address
+ DEFAULT_MASTER_SETUP_SCRIPT = TOOLSDIR + "/master-ip-setup"
diff --git a/app-emulation/ganeti/files/ganeti.confd b/app-emulation/ganeti/files/ganeti.confd
new file mode 100644
index 000000000000..3b71d7ee44a8
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti.confd
@@ -0,0 +1,16 @@
+# /etc/conf.d/ganeti: config file for /etc/init.d/ganeti
+
+# Extra options to pass to all of the ganeti daemons
+# GANETI_OPTS="-d"
+
+# Options to pass to ganeti-masterd
+# GANETI_MASTERD_OPTS=""
+
+# Options to pass to ganeti-rapi
+# GANETI_RAPI_OPTS=""
+
+# Options to pass to ganeti-noded
+# GANETI_NODED_OPTS=""
+
+# Options to pass to ganeti-confd
+# GANETI_CONFD_OPTS=""
diff --git a/app-emulation/ganeti/files/ganeti.confd-r2 b/app-emulation/ganeti/files/ganeti.confd-r2
new file mode 100644
index 000000000000..0f2e69f3d5ea
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti.confd-r2
@@ -0,0 +1,19 @@
+# /etc/conf.d/ganeti: config file for /etc/init.d/ganeti
+
+# Extra options to pass to all of the ganeti daemons
+# GANETI_OPTS="-d"
+
+# Options to pass to ganeti-masterd
+# GANETI_MASTERD_OPTS=""
+
+# Options to pass to ganeti-rapi
+# GANETI_RAPI_OPTS=""
+
+# Options to pass to ganeti-noded
+# GANETI_NODED_OPTS=""
+
+# Options to pass to ganeti-confd
+# GANETI_CONFD_OPTS=""
+
+# Options to pass to ganeti-luxid
+# GANETI_LUXID_OPTS=""
diff --git a/app-emulation/ganeti/files/ganeti.initd b/app-emulation/ganeti/files/ganeti.initd
new file mode 100644
index 000000000000..8d31f1698490
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti.initd
@@ -0,0 +1,57 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount xend drbd
+ before ganeti-kvm-poweroff
+ after bootmisc nfsmount
+}
+
+checkconfig() {
+ for fname in /var/lib/ganeti/ssconf_node_pass /var/lib/ganeti/server.pem
+ do
+ if [[ ! -f "$fname" ]]
+ then
+ eerror "Config file $fname not found, will not run."
+ return 1
+ fi
+ done
+
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ganeti-master"
+ /usr/sbin/ganeti-master start
+ ret=$?
+ eend ${ret}
+ [[ "${ret}" != 0 ]] && return 1
+
+ ebegin "Starting ganeti-noded"
+ start-stop-daemon --start --quiet --exec /usr/sbin/ganeti-noded
+ ret=$?
+ eend ${ret}
+ [[ "${ret}" != 0 ]] && return 1
+
+ return 0
+}
+
+stop() {
+ ebegin "Stopping ganeti-noded"
+ start-stop-daemon --stop --quiet --name ganeti-noded
+ ret=$?
+ eend ${ret}
+ [[ "${ret}" != 0 ]] && return 1
+
+ ebegin "Stopping ganeti-master"
+ /usr/sbin/ganeti-master start
+ ret=$?
+ eend ${ret}
+ [[ "${ret}" != 0 ]] && return 1
+
+ return 0
+}
diff --git a/app-emulation/ganeti/files/ganeti.initd-r3 b/app-emulation/ganeti/files/ganeti.initd-r3
new file mode 100644
index 000000000000..d425fd0dccc6
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti.initd-r3
@@ -0,0 +1,83 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount logger
+ after bootmisc sshd
+ use net
+}
+
+DAEMON_UTIL="/usr/lib/ganeti/daemon-util"
+
+is_master() {
+ [ -z "${ganeti_master}" ] && ganeti_master="$(gnt-cluster getmaster)"
+ [ -z "${local_hostname}" ] && local_hostname="$(hostname -f)"
+ [ "${ganeti_master}" = "${local_hostname}" ]
+}
+
+start() {
+ if ! [ -e ${DAEMON_UTIL} ]; then
+ eerror "Could not find daemon utility at ${DAEMON_UTIL}"
+ return 1
+ elif ! ${DAEMON_UTIL} check-config ; then
+ eerror "Incomplete configuration, will not run."
+ return 1
+ fi
+
+ local daemon retval=0 optsvar started_daemons daemon_opts
+
+ for daemon in $(${DAEMON_UTIL} list-start-daemons); do
+ optsvar="${daemon//-/_}"
+
+ case "${daemon#ganeti-}" in
+ masterd|rapi|luxid) is_master || continue;;
+ esac
+
+ eval daemon_opts=\"\$\{${optsvar^^*}_OPTS\}\"
+
+ ebegin "Starting ${daemon}"
+ eindent
+ ${DAEMON_UTIL} start ${daemon} ${GANETI_OPTS} ${daemon_opts} || retval=${?}
+
+ if [ ${retval} != 0 ] && [ -n "${started_daemons}" ]; then
+ case ${daemon} in
+ *-kvmd) retval=0; ewarn "Failed to start kvmd, continuing anyway";;
+ *)
+ eerror "Stopping already started daemons"
+ eindent
+ eend ${code} "$(${DAEMON_UTIL} check-exitcode ${code})"
+
+ for daemon in ${started_daemons}; do
+ ebegin "Stopping ${daemon}"
+ ${DAEMON_UTIL} stop ${daemon} ${GANETI_OPTS}
+ eend ${?}
+ done
+ eoutdent; eoutdent
+ return ${retval}
+ ;;
+ esac
+ fi
+ eoutdent
+ started_daemons="${started_daemons} ${daemon}"
+ done
+}
+
+stop() {
+ if ! [ -e ${DAEMON_UTIL} ]; then
+ eerror "Could not find daemon utility at ${DAEMON_UTIL}"
+ return 1
+ fi
+
+ local daemon
+
+ for daemon in $(${DAEMON_UTIL} list-stop-daemons) ; do \
+ case "${daemon#ganeti-}" in
+ masterd|rapi|luxid) is_master || continue;;
+ esac
+ ${DAEMON_UTIL} stop ${daemon} ${GANETI_OPTS}
+ done
+}
+
+# vim:ft=gentoo-init-d:ts=4:sts=4:sw=4:noet:
diff --git a/app-emulation/ganeti/files/ganeti2.initd b/app-emulation/ganeti/files/ganeti2.initd
new file mode 100644
index 000000000000..74a748a73e38
--- /dev/null
+++ b/app-emulation/ganeti/files/ganeti2.initd
@@ -0,0 +1,55 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount drbd
+ after bootmisc
+}
+
+checkconfig() {
+ for fname in /var/lib/ganeti/server.pem
+ do
+ if [[ ! -f "$fname" ]]
+ then
+ eerror "Config file $fname not found, will not run."
+ return 1
+ fi
+ done
+
+ return 0
+}
+
+start_action() {
+ # called as start_action daemon pidfile
+ local daemon="${1}"; shift
+ local pidfile="${1}"; shift
+ ebegin "Starting ${daemon}"
+ start-stop-daemon --start --quiet --exec "${daemon}" --pidfile "${pidfile}" \
+ -- "${@}"
+ eend ${?}
+}
+
+stop_action() {
+ # called as stop_action daemon pidfile
+ ebegin "Stopping ${1}"
+ start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile "${2}"
+ eend ${?}
+}
+
+
+start() {
+ checkconfig || return 1
+ start_action /usr/sbin/ganeti-noded /var/run/ganeti/ganeti-noded.pid
+ start_action /usr/sbin/ganeti-masterd /var/run/ganeti/ganeti-masterd.pid
+ start_action /usr/sbin/ganeti-rapi /var/run/ganeti/ganeti-rapi.pid
+ return 0
+}
+
+stop() {
+ stop_action /usr/sbin/ganeti-rapi /var/run/ganeti/ganeti-rapi.pid
+ stop_action /usr/sbin/ganeti-masterd /var/run/ganeti/ganeti-masterd.pid
+ stop_action /usr/sbin/ganeti-noded /var/run/ganeti/ganeti-noded.pid
+ return 0
+}
diff --git a/app-emulation/ganeti/ganeti-2.10.5-r4.ebuild b/app-emulation/ganeti/ganeti-2.10.5-r4.ebuild
new file mode 100644
index 000000000000..c166144f5b50
--- /dev/null
+++ b/app-emulation/ganeti/ganeti-2.10.5-r4.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=(python2_7)
+use test && PYTHON_REQ_USE="ipv6"
+
+inherit eutils confutils autotools bash-completion-r1 python-single-r1 versionator
+
+MY_PV="${PV/_rc/~rc}"
+#MY_PV="${PV/_beta/~beta}"
+MY_P="${PN}-${MY_PV}"
+SERIES="$(get_version_component_range 1-2)"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.ganeti.org/ganeti.git"
+ inherit git-2
+ KEYWORDS=""
+ # you will need to pull in the haskell overlay for pandoc
+ GIT_DEPEND="app-text/pandoc
+ dev-python/docutils
+ dev-python/sphinx
+ media-libs/gd[fontconfig,jpeg,png,truetype]
+ media-gfx/graphviz
+ media-fonts/urw-fonts"
+else
+ SRC_URI="http://downloads.ganeti.org/releases/${SERIES}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Ganeti is a virtual server management software tool"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="kvm xen lxc drbd htools syslog ipv6 haskell-daemons rbd test"
+REQUIRED_USE="|| ( kvm xen lxc )"
+
+HASKELL_DEPS=">=dev-lang/ghc-6.12:0=
+ dev-haskell/json:0=
+ dev-haskell/curl:0=
+ dev-haskell/network:0=
+ dev-haskell/parallel:3=
+ dev-haskell/hslogger:0=
+ dev-haskell/utf8-string:0=
+ dev-haskell/attoparsec:0=
+ dev-haskell/crypto:0="
+
+DEPEND="xen? ( >=app-emulation/xen-3.0 )
+ kvm? ( app-emulation/qemu )
+ lxc? ( app-emulation/lxc )
+ drbd? ( <sys-cluster/drbd-8.5 )
+ rbd? ( sys-cluster/ceph )
+ ipv6? ( net-misc/ndisc6 )
+ haskell-daemons? (
+ ${HASKELL_DEPS}
+ dev-haskell/text:0=
+ dev-haskell/hinotify:0=
+ dev-haskell/regex-pcre-builtin:0=
+ dev-haskell/vector:0=
+ )
+ dev-libs/openssl:0
+ dev-python/paramiko[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/pycurl[${PYTHON_USEDEP}]
+ dev-python/pyinotify[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/bitarray[${PYTHON_USEDEP}]
+ net-analyzer/arping
+ net-analyzer/fping
+ net-misc/bridge-utils
+ net-misc/curl[ssl]
+ net-misc/openssh
+ net-misc/socat
+ sys-apps/iproute2
+ sys-fs/lvm2
+ >=sys-apps/baselayout-2.0
+ ${PYTHON_DEPS}
+ ${GIT_DEPEND}"
+RDEPEND="${DEPEND}
+ !app-emulation/ganeti-htools"
+DEPEND+="${HASKELL_DEPS}
+ sys-devel/m4
+ test? (
+ dev-python/mock
+ dev-python/pyyaml
+ dev-haskell/test-framework:0=
+ dev-haskell/test-framework-hunit:0=
+ dev-haskell/test-framework-quickcheck2:0=
+ dev-haskell/temporary:0=
+ sys-apps/fakeroot
+ )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.6-fix-args.patch"
+ "${FILESDIR}/${PN}-2.6-add-pgrep.patch"
+ "${FILESDIR}/${PN}-2.7-fix-tests.patch"
+ "${FILESDIR}/${PN}-2.9-disable-root-tests.patch"
+ "${FILESDIR}/${PN}-2.9-regex-builtin.patch"
+ "${FILESDIR}/${PN}-2.9-skip-cli-test.patch"
+ "${FILESDIR}/${PN}-2.10-rundir.patch"
+ "${FILESDIR}/${PN}-lockdir.patch"
+)
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup () {
+ confutils_use_depend_all haskell-daemons htools
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ [[ ${PV} == "9999" ]] && ./autogen.sh
+ rm autotools/missing
+ eautoreconf
+}
+
+src_configure () {
+ econf --localstatedir=/var \
+ --sharedstatedir=/var \
+ --disable-symlinks \
+ --docdir=/usr/share/doc/${P} \
+ --with-ssh-initscript=/etc/init.d/sshd \
+ --with-export-dir=/var/lib/ganeti-storage/export \
+ --with-os-search-path=/usr/share/${PN}/os \
+ $(use_enable syslog) \
+ $(usex kvm '--with-kvm-path=' '' '/usr/bin/qemu-kvm' '') \
+ $(usex haskell-daemons "--enable-confd=haskell" '' '' '')
+}
+
+src_install () {
+ emake V=1 DESTDIR="${D}" install || die "emake install failed"
+
+ newinitd "${FILESDIR}"/ganeti.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ganeti.confd-r2 ${PN}
+
+ use kvm && newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
+ use kvm && newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
+ newbashcomp doc/examples/bash_completion ganeti
+ dodoc INSTALL UPGRADE NEWS README doc/*.rst
+ dohtml -r doc/html/*
+ rm -rf "${D}"/{usr/share/doc/${PN},run}
+
+ docinto examples
+ dodoc doc/examples/{ganeti.cron,gnt-config-backup} doc/examples/*.ocf
+
+ docinto examples/hooks
+ dodoc doc/examples/hooks/{ipsec,ethers}
+
+ insinto /etc/cron.d
+ newins doc/examples/ganeti.cron ${PN}
+
+ insinto /etc/logrotate.d
+ newins doc/examples/ganeti.logrotate ${PN}
+
+ python_fix_shebang "${D}"/usr/"$(get_libdir)"/${PN}/${SERIES}
+
+ keepdir /var/{lib,log}/${PN}/
+ keepdir /usr/share/${PN}/${SERIES}/os/
+ keepdir /var/lib/ganeti-storage/{export,file,shared}/
+
+ dosym ${SERIES} "/usr/share/${PN}/default"
+ dosym ${SERIES} "/usr/$(get_libdir)/${PN}/default"
+
+ python_fix_shebang "${ED}"
+}
+
+src_test () {
+ emake check || die "emake check failed"
+}
diff --git a/app-emulation/ganeti/ganeti-2.11.6-r2.ebuild b/app-emulation/ganeti/ganeti-2.11.6-r2.ebuild
new file mode 100644
index 000000000000..87527cdf9302
--- /dev/null
+++ b/app-emulation/ganeti/ganeti-2.11.6-r2.ebuild
@@ -0,0 +1,220 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=(python2_7)
+use test && PYTHON_REQ_USE="ipv6"
+
+inherit eutils confutils autotools bash-completion-r1 python-single-r1 versionator pax-utils
+
+MY_PV="${PV/_rc/~rc}"
+#MY_PV="${PV/_beta/~beta}"
+MY_P="${PN}-${MY_PV}"
+SERIES="$(get_version_component_range 1-2)"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.ganeti.org/ganeti.git"
+ inherit git-2
+ KEYWORDS=""
+ # you will need to pull in the haskell overlay for pandoc
+ GIT_DEPEND="app-text/pandoc
+ dev-python/docutils
+ dev-python/sphinx
+ media-libs/gd[fontconfig,jpeg,png,truetype]
+ media-gfx/graphviz
+ media-fonts/urw-fonts"
+else
+ SRC_URI="http://downloads.ganeti.org/releases/${SERIES}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Ganeti is a virtual server management software tool"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="drbd haskell-daemons htools ipv6 kvm lxc monitoring multiple-users rbd syslog test xen"
+REQUIRED_USE="|| ( kvm xen lxc )"
+
+USER_PREFIX="${GANETI_USER_PREFIX:-"gnt-"}"
+GROUP_PREFIX="${GANETI_GROUP_PREFIX:-"${USER_PREFIX}"}"
+
+HASKELL_DEPS=">=dev-lang/ghc-6.12:0=
+ dev-haskell/json:0=
+ dev-haskell/curl:0=
+ dev-haskell/network:0=
+ dev-haskell/parallel:3=
+ dev-haskell/hslogger:0=
+ dev-haskell/utf8-string:0=
+ dev-haskell/attoparsec:0=
+ dev-haskell/crypto:0=
+ dev-haskell/vector:0=
+ dev-haskell/hinotify:0=
+ dev-haskell/regex-pcre-builtin:0=
+ dev-haskell/zlib:0=
+ dev-haskell/base64-bytestring:0=
+ monitoring? ( dev-haskell/snap-server:0= )"
+
+DEPEND="xen? ( >=app-emulation/xen-3.0 )
+ kvm? ( app-emulation/qemu )
+ lxc? ( app-emulation/lxc )
+ drbd? ( <sys-cluster/drbd-8.5 )
+ rbd? ( sys-cluster/ceph )
+ ipv6? ( net-misc/ndisc6 )
+ haskell-daemons? (
+ ${HASKELL_DEPS}
+ dev-haskell/text:0=
+ )
+ dev-libs/openssl:0
+ dev-python/paramiko[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/pycurl[${PYTHON_USEDEP}]
+ dev-python/pyinotify[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/bitarray[${PYTHON_USEDEP}]
+ net-analyzer/arping
+ net-analyzer/fping
+ net-misc/bridge-utils
+ net-misc/curl[ssl]
+ net-misc/openssh
+ net-misc/socat
+ sys-apps/iproute2
+ sys-fs/lvm2
+ >=sys-apps/baselayout-2.0
+ ${PYTHON_DEPS}
+ ${GIT_DEPEND}"
+RDEPEND="${DEPEND}
+ !app-emulation/ganeti-htools"
+DEPEND+="${HASKELL_DEPS}
+ sys-devel/m4
+ test? (
+ dev-python/mock
+ dev-python/pyyaml
+ dev-haskell/haddock:0=
+ dev-haskell/test-framework:0=
+ dev-haskell/test-framework-hunit:0=
+ dev-haskell/test-framework-quickcheck2:0=
+ dev-haskell/temporary:0=
+ sys-apps/fakeroot
+ )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.11-start-stop-daemon-args.patch"
+ "${FILESDIR}/${PN}-2.11-add-pgrep.patch"
+ "${FILESDIR}/${PN}-2.11-daemon-util.patch"
+ "${FILESDIR}/${PN}-2.7-fix-tests.patch"
+ "${FILESDIR}/${PN}-2.9-disable-root-tests.patch"
+ "${FILESDIR}/${PN}-2.11-regex-builtin.patch"
+ "${FILESDIR}/${PN}-2.9-skip-cli-test.patch"
+ "${FILESDIR}/${PN}-2.10-rundir.patch"
+ "${FILESDIR}/${PN}-2.11-qemu-enable-kvm.patch"
+ "${FILESDIR}/${PN}-2.11-tests.patch"
+ "${FILESDIR}/${PN}-lockdir.patch"
+ "${FILESDIR}/${PN}-2.11-useradd.patch"
+ "${FILESDIR}/${PN}-2.11-dont-nest-libdir.patch"
+ "${FILESDIR}/${PN}-2.11-dont-print-man-help.patch"
+ "${FILESDIR}/${PN}-2.11-daemon-util-tests.patch"
+)
+
+REQUIRED_USE="kvm? ( || ( amd64 x86 ) )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup () {
+ confutils_use_depend_all haskell-daemons htools
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+
+ [[ ${PV} == "9999" ]] && ./autogen.sh
+ rm autotools/missing
+ eautoreconf
+}
+
+src_configure () {
+ # this is kind of a hack to work around the removal of the qemu-kvm wrapper
+ local kvm_arch
+
+ if use amd64; then
+ kvm_arch=x86_64
+ elif use x86; then
+ kvm_arch=i386
+ elif use kvm; then
+ die "Could not determine qemu system to use for kvm"
+ fi
+
+ econf --localstatedir=/var \
+ --sharedstatedir=/var \
+ --disable-symlinks \
+ --docdir=/usr/share/doc/${P} \
+ --with-ssh-initscript=/etc/init.d/sshd \
+ --with-export-dir=/var/lib/ganeti-storage/export \
+ --with-os-search-path=/usr/share/${PN}/os \
+ $(usex multiple-users "--with-user-prefix=" "" "${USER_PREFIX}" "") \
+ $(usex multiple-users "--with-group-prefix=" "" "${GROUP_PREFIX}" "") \
+ $(use_enable syslog) \
+ $(use_enable monitoring) \
+ $(usex kvm '--with-kvm-path=' '' "/usr/bin/qemu-system-${kvm_arch}" '') \
+ $(usex haskell-daemons "--enable-confd=haskell" '' '' '')
+}
+
+src_install () {
+ emake V=1 DESTDIR="${D}" install || die "emake install failed"
+
+ newinitd "${FILESDIR}"/ganeti.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ganeti.confd-r2 ${PN}
+
+ if use kvm; then
+ newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
+ newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
+ fi
+
+ # ganeti installs it's own docs in a generic location
+ rm -rf "${D}"/{usr/share/doc/${PN},run}
+
+ newbashcomp doc/examples/bash_completion ganeti
+
+ dodoc INSTALL UPGRADE NEWS README doc/*.rst
+ dohtml -r doc/html/* doc/css/*.css
+
+ docinto examples
+ dodoc doc/examples/{ganeti.cron,gnt-config-backup} doc/examples/*.ocf
+
+ docinto examples/hooks
+ dodoc doc/examples/hooks/{ipsec,ethers}
+
+ insinto /etc/cron.d
+ newins doc/examples/ganeti.cron ${PN}
+
+ insinto /etc/logrotate.d
+ newins doc/examples/ganeti.logrotate ${PN}
+
+ keepdir /var/{lib,log}/${PN}/
+ keepdir /usr/share/${PN}/${SERIES}/os/
+ keepdir /var/lib/ganeti-storage/{export,file,shared}/
+
+ dosym ${SERIES} "/usr/share/${PN}/default"
+ dosym ${SERIES} "/usr/$(get_libdir)/${PN}/default"
+
+ python_fix_shebang "${ED}" "${D}"/usr/"$(get_libdir)"/${PN}/${SERIES}
+}
+
+pkg_postinst() {
+ if use multiple-users; then
+ elog "You have enable multiple user support, the users for this must"
+ elog "be created. You can use the provided tool for this, which is"
+ elog "located at:"
+ elog " /usr/$(get_libdir)/${PN}/tools/users-setup"
+ fi
+}
+
+src_test () {
+ PATH="${S}/scripts:${S}/src:${PATH}" \
+ TMPDIR="/tmp" \
+ emake check || die "emake check failed"
+}
diff --git a/app-emulation/ganeti/ganeti-2.12.1-r3.ebuild b/app-emulation/ganeti/ganeti-2.12.1-r3.ebuild
new file mode 100644
index 000000000000..644983532c81
--- /dev/null
+++ b/app-emulation/ganeti/ganeti-2.12.1-r3.ebuild
@@ -0,0 +1,253 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=(python2_7)
+use test && PYTHON_REQ_USE="ipv6"
+
+inherit eutils user confutils autotools bash-completion-r1 python-single-r1 versionator pax-utils
+
+MY_PV="${PV/_rc/~rc}"
+#MY_PV="${PV/_beta/~beta}"
+MY_P="${PN}-${MY_PV}"
+SERIES="$(get_version_component_range 1-2)"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.ganeti.org/ganeti.git"
+ inherit git-2
+ KEYWORDS=""
+ # you will need to pull in the haskell overlay for pandoc
+ GIT_DEPEND="app-text/pandoc
+ dev-python/docutils
+ dev-python/sphinx
+ media-libs/gd[fontconfig,jpeg,png,truetype]
+ media-gfx/graphviz
+ media-fonts/urw-fonts"
+else
+ SRC_URI="http://downloads.ganeti.org/releases/${SERIES}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Ganeti is a virtual server management software tool"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="drbd haskell-daemons htools ipv6 kvm lxc monitoring multiple-users rbd syslog test xen"
+REQUIRED_USE="|| ( kvm xen lxc )"
+
+USER_PREFIX="${GANETI_USER_PREFIX:-"gnt-"}"
+GROUP_PREFIX="${GANETI_GROUP_PREFIX:-"${USER_PREFIX}"}"
+
+# the haskell less-than atoms list are resolver hints, they aren't actual
+# direct dependencies, just hints to help the resolver fufill the dependency
+# on an older transformer.
+# these need to stay until 2.14.0
+DEPEND="
+ dev-libs/openssl:0
+ dev-python/paramiko[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/pycurl[${PYTHON_USEDEP}]
+ dev-python/pyinotify[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/bitarray[${PYTHON_USEDEP}]
+ net-analyzer/arping
+ net-analyzer/fping
+ net-misc/bridge-utils
+ net-misc/curl[ssl]
+ net-misc/openssh
+ net-misc/socat
+ sys-apps/iproute2
+ sys-fs/lvm2
+ >=sys-apps/baselayout-2.0
+ >=dev-lang/ghc-7.6.0:0=
+ >=dev-haskell/json-0.9:0=
+ <dev-haskell/monad-control-1.0.0.0:0=
+ <dev-haskell/transformers-0.4.0:0=
+ dev-haskell/curl:0=
+ dev-haskell/network:0=
+ dev-haskell/parallel:3=
+ >=dev-haskell/hslogger-1.2.6:0=
+ dev-haskell/snap-server:0=
+ dev-haskell/utf8-string:0=
+ dev-haskell/attoparsec:0=
+ dev-haskell/crypto:0=
+ dev-haskell/vector:0=
+ dev-haskell/hinotify:0=
+ dev-haskell/regex-pcre-builtin:0=
+ dev-haskell/zlib:0=
+ >=dev-haskell/lifted-base-0.2.3.3:0=
+ <dev-haskell/lens-3.10:0=
+ dev-haskell/base64-bytestring:0=
+ <dev-haskell/mtl-2.2
+ <dev-haskell/contravariant-0.6
+ <dev-haskell/profunctors-4.3
+ <dev-haskell/distributive-0.4.4
+ <dev-haskell/comonad-4.2.2
+ <dev-haskell/transformers-compat-0.3
+ <dev-haskell/transformers-base-0.4.4
+ <dev-haskell/semigroupoids-4.0
+ <dev-haskell/semigroupoid-extras-4.0
+ <dev-haskell/groupoids-4.0
+ xen? ( >=app-emulation/xen-3.0 )
+ kvm? ( app-emulation/qemu )
+ lxc? ( app-emulation/lxc )
+ drbd? ( <sys-cluster/drbd-8.5 )
+ rbd? ( sys-cluster/ceph )
+ ipv6? ( net-misc/ndisc6 )
+ haskell-daemons? ( dev-haskell/text:0= )
+ ${PYTHON_DEPS}
+ ${GIT_DEPEND}"
+RDEPEND="${DEPEND}
+ !app-emulation/ganeti-htools"
+DEPEND+="sys-devel/m4
+ test? (
+ dev-python/mock
+ dev-python/pyyaml
+ dev-haskell/haddock:0=
+ dev-haskell/test-framework:0=
+ dev-haskell/test-framework-hunit:0=
+ dev-haskell/test-framework-quickcheck2:0=
+ dev-haskell/temporary:0=
+ sys-apps/fakeroot
+ net-misc/socat
+ dev-util/shelltestrunner
+ )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.12-start-stop-daemon-args.patch"
+ "${FILESDIR}/${PN}-2.11-add-pgrep.patch"
+ "${FILESDIR}/${PN}-2.12-daemon-util.patch"
+ "${FILESDIR}/${PN}-2.7-fix-tests.patch"
+ "${FILESDIR}/${PN}-2.9-disable-root-tests.patch"
+ "${FILESDIR}/${PN}-2.11-regex-builtin.patch"
+ "${FILESDIR}/${PN}-2.9-skip-cli-test.patch"
+ "${FILESDIR}/${PN}-2.10-rundir.patch"
+ "${FILESDIR}/${PN}-2.12-qemu-enable-kvm.patch"
+ "${FILESDIR}/${PN}-2.11-tests.patch"
+ "${FILESDIR}/${PN}-lockdir.patch"
+ "${FILESDIR}/${PN}-2.11-useradd.patch"
+ "${FILESDIR}/${PN}-2.11-dont-nest-libdir.patch"
+ "${FILESDIR}/${PN}-2.11-dont-print-man-help.patch"
+ "${FILESDIR}/${PN}-2.11-daemon-util-tests.patch"
+ "${FILESDIR}/${PN}-2.12-tests.patch"
+ "${FILESDIR}/${PN}-2.12-cfgupgrade-state.patch"
+)
+
+REQUIRED_USE="kvm? ( || ( amd64 x86 ) )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup () {
+ local user
+ confutils_use_depend_all haskell-daemons htools
+ python-single-r1_pkg_setup
+
+ if use multiple-users; then
+ for user in gnt-{masterd,confd,luxid,rapi,daemons,admin}; do
+ enewgroup ${user}
+ enewuser ${user} -1 -1 -1 ${user}
+ done
+ fi
+}
+
+src_prepare() {
+ local testfile
+ epatch "${PATCHES[@]}"
+
+ # not sure why these tests are failing
+ # should remove this on next version bump if possible
+ for testfile in test/py/import-export_unittest.bash; do
+ printf '#!/bin/bash\ntrue\n' > "${testfile}"
+ done
+
+ [[ ${PV} == "9999" ]] && ./autogen.sh
+ rm autotools/missing
+ eautoreconf
+}
+
+src_configure () {
+ # this is kind of a hack to work around the removal of the qemu-kvm wrapper
+ local kvm_arch
+
+ if use amd64; then
+ kvm_arch=x86_64
+ elif use x86; then
+ kvm_arch=i386
+ elif use kvm; then
+ die "Could not determine qemu system to use for kvm"
+ fi
+
+ econf --localstatedir=/var \
+ --sharedstatedir=/var \
+ --disable-symlinks \
+ --docdir=/usr/share/doc/${P} \
+ --with-ssh-initscript=/etc/init.d/sshd \
+ --with-export-dir=/var/lib/ganeti-storage/export \
+ --with-os-search-path=/usr/share/${PN}/os \
+ $(usex multiple-users "--with-user-prefix=" "" "${USER_PREFIX}" "") \
+ $(usex multiple-users "--with-group-prefix=" "" "${GROUP_PREFIX}" "") \
+ $(use_enable syslog) \
+ $(use_enable monitoring) \
+ $(usex kvm '--with-kvm-path=' '' "/usr/bin/qemu-system-${kvm_arch}" '') \
+ $(usex haskell-daemons "--enable-confd=haskell" '' '' '')
+}
+
+src_install () {
+ emake V=1 DESTDIR="${D}" install || die "emake install failed"
+
+ newinitd "${FILESDIR}"/ganeti.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ganeti.confd-r2 ${PN}
+
+ if use kvm; then
+ newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
+ newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
+ fi
+
+ # ganeti installs it's own docs in a generic location
+ rm -rf "${D}"/{usr/share/doc/${PN},run}
+
+ newbashcomp doc/examples/bash_completion ganeti
+
+ dodoc INSTALL UPGRADE NEWS README doc/*.rst
+ dohtml -r doc/html/* doc/css/*.css
+
+ docinto examples
+ dodoc doc/examples/{ganeti.cron,gnt-config-backup} doc/examples/*.ocf
+
+ docinto examples/hooks
+ dodoc doc/examples/hooks/{ipsec,ethers}
+
+ insinto /etc/cron.d
+ newins doc/examples/ganeti.cron ${PN}
+
+ insinto /etc/logrotate.d
+ newins doc/examples/ganeti.logrotate ${PN}
+
+ keepdir /var/{lib,log}/${PN}/
+ keepdir /usr/share/${PN}/${SERIES}/os/
+ keepdir /var/lib/ganeti-storage/{export,file,shared}/
+
+ dosym ${SERIES} "/usr/share/${PN}/default"
+ dosym ${SERIES} "/usr/$(get_libdir)/${PN}/default"
+
+ python_fix_shebang "${ED}" "${D}"/usr/"$(get_libdir)"/${PN}/${SERIES}
+}
+
+pkg_postinst() {
+ if use multiple-users; then
+ elog "You have enable multiple user support, the users for this must"
+ elog "be created. You can use the provided tool for this, which is"
+ elog "located at:"
+ elog " /usr/$(get_libdir)/${PN}/tools/users-setup"
+ fi
+}
+
+src_test () {
+ PATH="${S}/scripts:${S}/src:${PATH}" \
+ TMPDIR="/tmp" \
+ emake check || die "emake check failed"
+}
diff --git a/app-emulation/ganeti/ganeti-2.12.3-r2.ebuild b/app-emulation/ganeti/ganeti-2.12.3-r2.ebuild
new file mode 100644
index 000000000000..c1eb25d7b864
--- /dev/null
+++ b/app-emulation/ganeti/ganeti-2.12.3-r2.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=(python2_7)
+use test && PYTHON_REQ_USE="ipv6"
+
+inherit eutils user autotools bash-completion-r1 python-single-r1 versionator
+
+MY_PV="${PV/_rc/~rc}"
+MY_PV="${MY_PV/_beta/~beta}"
+MY_P="${PN}-${MY_PV}"
+SERIES="$(get_version_component_range 1-2)"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.ganeti.org/ganeti.git"
+ inherit git-2
+ KEYWORDS=""
+ GIT_DEPEND="app-text/pandoc
+ dev-python/docutils
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ media-libs/gd[fontconfig,jpeg,png,truetype]
+ media-gfx/graphviz
+ media-fonts/urw-fonts"
+else
+ SRC_URI="http://downloads.ganeti.org/releases/${SERIES}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Ganeti is a virtual server management software tool"
+HOMEPAGE="http://www.ganeti.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="drbd haskell-daemons htools ipv6 kvm lxc monitoring multiple-users rbd syslog test xen"
+REQUIRED_USE="|| ( kvm xen lxc ) ${PYTHON_REQUIRED_USE}"
+
+USER_PREFIX="${GANETI_USER_PREFIX:-"gnt-"}"
+GROUP_PREFIX="${GANETI_GROUP_PREFIX:-"${USER_PREFIX}"}"
+
+# the haskell less-than atoms list are resolver hints, they aren't actual
+# direct dependencies, just hints to help the resolver fufill the dependency
+# on an older transformer.
+# these need to stay until 2.14.0
+DEPEND="
+ dev-libs/openssl:0
+ dev-python/paramiko[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/pycurl[${PYTHON_USEDEP}]
+ dev-python/pyinotify[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/bitarray[${PYTHON_USEDEP}]
+ net-analyzer/arping
+ net-analyzer/fping
+ net-misc/bridge-utils
+ net-misc/curl[ssl]
+ net-misc/openssh
+ net-misc/socat
+ sys-apps/iproute2
+ sys-fs/lvm2
+ >=sys-apps/baselayout-2.0
+ =dev-lang/ghc-7.6*:0=
+ >=dev-haskell/json-0.9:0=
+ <dev-haskell/monad-control-1.0.0.0:0=
+ <dev-haskell/transformers-0.4.0:0=
+ dev-haskell/curl:0=
+ dev-haskell/network:0=
+ dev-haskell/parallel:3=
+ >=dev-haskell/hslogger-1.2.6:0=
+ dev-haskell/snap-server:0=
+ dev-haskell/utf8-string:0=
+ dev-haskell/attoparsec:0=
+ dev-haskell/crypto:0=
+ dev-haskell/vector:0=
+ dev-haskell/hinotify:0=
+ dev-haskell/regex-pcre-builtin:0=
+ dev-haskell/zlib:0=
+ >=dev-haskell/lifted-base-0.2.3.3:0=
+ <dev-haskell/lens-3.10:0=
+ dev-haskell/base64-bytestring:0=
+ <dev-haskell/mtl-2.2
+ <dev-haskell/contravariant-0.6
+ <dev-haskell/profunctors-4.3
+ <dev-haskell/distributive-0.4.4
+ <dev-haskell/comonad-4.2.2
+ <dev-haskell/transformers-compat-0.3
+ <dev-haskell/transformers-base-0.4.4
+ <dev-haskell/semigroupoids-4.0
+ <dev-haskell/semigroupoid-extras-4.0
+ <dev-haskell/groupoids-4.0
+ xen? ( >=app-emulation/xen-3.0 )
+ kvm? ( app-emulation/qemu )
+ lxc? ( app-emulation/lxc )
+ drbd? ( <sys-cluster/drbd-8.5 )
+ rbd? ( sys-cluster/ceph )
+ ipv6? ( net-misc/ndisc6 )
+ haskell-daemons? ( dev-haskell/text:0= )
+ ${PYTHON_DEPS}
+ ${GIT_DEPEND}"
+RDEPEND="${DEPEND}
+ !app-emulation/ganeti-htools"
+DEPEND+="sys-devel/m4
+ test? (
+ dev-python/mock
+ dev-python/pyyaml
+ dev-haskell/haddock:0=
+ dev-haskell/test-framework:0=
+ dev-haskell/test-framework-hunit:0=
+ dev-haskell/test-framework-quickcheck2:0=
+ dev-haskell/temporary:0=
+ sys-apps/fakeroot
+ net-misc/socat
+ dev-util/shelltestrunner
+ )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.12-start-stop-daemon-args.patch"
+ "${FILESDIR}/${PN}-2.11-add-pgrep.patch"
+ "${FILESDIR}/${PN}-2.12.3-daemon-util.patch"
+ "${FILESDIR}/${PN}-2.7-fix-tests.patch"
+ "${FILESDIR}/${PN}-2.9-disable-root-tests.patch"
+ "${FILESDIR}/${PN}-2.11-regex-builtin.patch"
+ "${FILESDIR}/${PN}-2.9-skip-cli-test.patch"
+ "${FILESDIR}/${PN}-2.10-rundir.patch"
+ "${FILESDIR}/${PN}-2.12-qemu-enable-kvm.patch"
+ "${FILESDIR}/${PN}-2.11-tests.patch"
+ "${FILESDIR}/${PN}-lockdir.patch"
+ "${FILESDIR}/${PN}-2.11-useradd.patch"
+ "${FILESDIR}/${PN}-2.11-dont-nest-libdir.patch"
+ "${FILESDIR}/${PN}-2.11-dont-print-man-help.patch"
+ "${FILESDIR}/${PN}-2.11-daemon-util-tests.patch"
+ "${FILESDIR}/${PN}-2.12-tests.patch"
+)
+
+REQUIRED_USE="kvm? ( || ( amd64 x86 ) )"
+
+S="${WORKDIR}/${MY_P}"
+
+QA_WX_LOAD="usr/$(get_libdir)/${PN}/${SERIES}/usr/sbin/ganeti-*d
+ usr/$(get_libdir)/${PN}/${SERIES}/usr/bin/htools"
+
+pkg_setup () {
+ local user
+ confutils_use_depend_all haskell-daemons htools
+ python-single-r1_pkg_setup
+
+ if use multiple-users; then
+ for user in gnt-{masterd,confd,luxid,rapi,daemons,admin}; do
+ enewgroup ${user}
+ enewuser ${user} -1 -1 -1 ${user}
+ done
+ fi
+}
+
+src_prepare() {
+ local testfile
+ epatch "${PATCHES[@]}"
+
+ # not sure why these tests are failing
+ # should remove this on next version bump if possible
+ for testfile in test/py/import-export_unittest.bash; do
+ printf '#!/bin/bash\ntrue\n' > "${testfile}"
+ done
+
+ # take the sledgehammer approach to bug #526270
+ grep -lr '/bin/sh' "${S}" | xargs -r -- sed -i 's:/bin/sh:/bin/bash:g'
+
+ [[ ${PV} =~ [9]{4,} ]] && ./autogen.sh
+ rm autotools/missing
+ eautoreconf
+}
+
+src_configure () {
+ # this is kind of a hack to work around the removal of the qemu-kvm wrapper
+ local kvm_arch
+
+ if use amd64; then
+ kvm_arch=x86_64
+ elif use x86; then
+ kvm_arch=i386
+ elif use kvm; then
+ die "Could not determine qemu system to use for kvm"
+ fi
+
+ econf --localstatedir=/var \
+ --sharedstatedir=/var \
+ --disable-symlinks \
+ --docdir=/usr/share/doc/${P} \
+ --with-ssh-initscript=/etc/init.d/sshd \
+ --with-export-dir=/var/lib/ganeti-storage/export \
+ --with-os-search-path=/usr/share/${PN}/os \
+ $(usex multiple-users "--with-user-prefix=" "" "${USER_PREFIX}" "") \
+ $(usex multiple-users "--with-group-prefix=" "" "${GROUP_PREFIX}" "") \
+ $(use_enable syslog) \
+ $(use_enable monitoring) \
+ $(usex kvm '--with-kvm-path=' '' "/usr/bin/qemu-system-${kvm_arch}" '') \
+ $(usex haskell-daemons "--enable-confd=haskell" '' '' '')
+}
+
+src_install () {
+ emake V=1 DESTDIR="${D}" install || die "emake install failed"
+
+ newinitd "${FILESDIR}"/ganeti.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ganeti.confd-r2 ${PN}
+
+ if use kvm; then
+ newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
+ newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
+ fi
+
+ # ganeti installs it's own docs in a generic location
+ rm -rf "${D}"/{usr/share/doc/${PN},run}
+
+ sed -i "s:/usr/$(get_libdir)/${PN}/tools/burnin:burnin:" doc/examples/bash_completion
+ newbashcomp doc/examples/bash_completion gnt-instance
+ bashcomp_alias gnt-instance burnin ganeti-{cleaner,confd} \
+ h{space,check,scan,info,ail,arep,roller,squeeze,bal} \
+ gnt-{os,job,filter,debug,storage,group,node,network,backup,cluster}
+
+ dodoc INSTALL UPGRADE NEWS README doc/*.rst
+ dohtml -r doc/html/* doc/css/*.css
+
+ docinto examples
+ dodoc doc/examples/{ganeti.cron,gnt-config-backup} doc/examples/*.ocf
+
+ docinto examples/hooks
+ dodoc doc/examples/hooks/{ipsec,ethers}
+
+ insinto /etc/cron.d
+ newins doc/examples/ganeti.cron ${PN}
+
+ insinto /etc/logrotate.d
+ newins doc/examples/ganeti.logrotate ${PN}
+
+ keepdir /var/{lib,log}/${PN}/
+ keepdir /usr/share/${PN}/${SERIES}/os/
+ keepdir /var/lib/ganeti-storage/{export,file,shared}/
+
+ dosym ${SERIES} "/usr/share/${PN}/default"
+ dosym ${SERIES} "/usr/$(get_libdir)/${PN}/default"
+
+ python_fix_shebang "${ED}" "${D}"/usr/"$(get_libdir)"/${PN}/${SERIES}
+}
+
+pkg_postinst() {
+ if use multiple-users; then
+ elog "You have enable multiple user support, the users for this must"
+ elog "be created. You can use the provided tool for this, which is"
+ elog "located at:"
+ elog " /usr/$(get_libdir)/${PN}/tools/users-setup"
+ fi
+}
+
+src_test () {
+ PATH="${S}/scripts:${S}/src:${PATH}" \
+ TMPDIR="/tmp" \
+ GANETI_MASTER="$(hostname -f)" \
+ emake check || die "emake check failed"
+}
diff --git a/app-emulation/ganeti/ganeti-2.13.0-r2.ebuild b/app-emulation/ganeti/ganeti-2.13.0-r2.ebuild
new file mode 100644
index 000000000000..45a4009dce60
--- /dev/null
+++ b/app-emulation/ganeti/ganeti-2.13.0-r2.ebuild
@@ -0,0 +1,258 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=(python2_7)
+use test && PYTHON_REQ_USE="ipv6"
+
+inherit eutils user autotools bash-completion-r1 python-single-r1 versionator
+
+MY_PV="${PV/_rc/~rc}"
+MY_PV="${MY_PV/_beta/~beta}"
+MY_P="${PN}-${MY_PV}"
+SERIES="$(get_version_component_range 1-2)"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.ganeti.org/ganeti.git"
+ inherit git-2
+ KEYWORDS=""
+ GIT_DEPEND="app-text/pandoc
+ dev-python/docutils
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ media-libs/gd[fontconfig,jpeg,png,truetype]
+ media-gfx/graphviz
+ media-fonts/urw-fonts"
+else
+ SRC_URI="http://downloads.ganeti.org/releases/${SERIES}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Ganeti is a virtual server management software tool"
+HOMEPAGE="http://www.ganeti.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="drbd haskell-daemons htools ipv6 kvm lxc monitoring multiple-users rbd syslog test xen"
+REQUIRED_USE="|| ( kvm xen lxc ) ${PYTHON_REQUIRED_USE}"
+
+USER_PREFIX="${GANETI_USER_PREFIX:-"gnt-"}"
+GROUP_PREFIX="${GANETI_GROUP_PREFIX:-"${USER_PREFIX}"}"
+
+DEPEND="
+ dev-libs/openssl:0
+ dev-python/paramiko[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/pycurl[${PYTHON_USEDEP}]
+ dev-python/pyinotify[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/bitarray[${PYTHON_USEDEP}]
+ net-analyzer/arping
+ net-analyzer/fping
+ net-misc/bridge-utils
+ net-misc/curl[ssl]
+ net-misc/openssh
+ net-misc/socat
+ sys-apps/iproute2
+ sys-fs/lvm2
+ >=sys-apps/baselayout-2.0
+ =dev-lang/ghc-7.6*:0=
+ >=dev-haskell/json-0.9:0=
+ dev-haskell/curl:0=
+ dev-haskell/network:0=
+ dev-haskell/parallel:3=
+ >=dev-haskell/hslogger-1.2.6:0=
+ dev-haskell/snap-server:0=
+ dev-haskell/utf8-string:0=
+ dev-haskell/attoparsec:0=
+ dev-haskell/crypto:0=
+ dev-haskell/vector:0=
+ dev-haskell/hinotify:0=
+ dev-haskell/regex-pcre-builtin:0=
+ dev-haskell/zlib:0=
+ >=dev-haskell/lifted-base-0.2.3.3:0=
+ <dev-haskell/lens-4:0=
+ dev-haskell/psqueue:0=
+ dev-haskell/base64-bytestring:0=
+ <dev-haskell/semigroupoids-4.1:0=
+ <dev-haskell/mtl-2.2:0=
+ <dev-haskell/monad-control-1.0.0.0:0=
+ <dev-haskell/transformers-0.4.0:0=
+ <dev-haskell/contravariant-0.6
+ <dev-haskell/transformers-compat-0.4[three]
+ <dev-haskell/transformers-base-0.4.4
+ xen? ( >=app-emulation/xen-3.0 )
+ kvm? ( app-emulation/qemu )
+ lxc? ( app-emulation/lxc )
+ drbd? ( <sys-cluster/drbd-8.5 )
+ rbd? ( sys-cluster/ceph )
+ ipv6? ( net-misc/ndisc6 )
+ haskell-daemons? ( dev-haskell/text:0= )
+ ${PYTHON_DEPS}
+ ${GIT_DEPEND}"
+RDEPEND="${DEPEND}
+ !app-emulation/ganeti-htools"
+DEPEND+="sys-devel/m4
+ app-text/pandoc
+ test? (
+ dev-python/mock
+ dev-python/pyyaml
+ dev-haskell/haddock:0=
+ dev-haskell/test-framework:0=
+ dev-haskell/test-framework-hunit:0=
+ dev-haskell/test-framework-quickcheck2:0=
+ dev-haskell/temporary:0=
+ sys-apps/fakeroot
+ net-misc/socat
+ dev-util/shelltestrunner
+ )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.12-start-stop-daemon-args.patch"
+ "${FILESDIR}/${PN}-2.11-add-pgrep.patch"
+ "${FILESDIR}/${PN}-2.13-daemon-util.patch"
+ "${FILESDIR}/${PN}-2.7-fix-tests.patch"
+ "${FILESDIR}/${PN}-2.9-disable-root-tests.patch"
+ "${FILESDIR}/${PN}-2.9-skip-cli-test.patch"
+ "${FILESDIR}/${PN}-2.10-rundir.patch"
+ "${FILESDIR}/${PN}-2.12-qemu-enable-kvm.patch"
+ "${FILESDIR}/${PN}-2.11-tests.patch"
+ "${FILESDIR}/${PN}-lockdir.patch"
+ "${FILESDIR}/${PN}-2.11-dont-nest-libdir.patch"
+ "${FILESDIR}/${PN}-2.11-dont-print-man-help.patch"
+ "${FILESDIR}/${PN}-2.11-daemon-util-tests.patch"
+ "${FILESDIR}/${PN}-2.13-regex-pcre-builtin.patch"
+ "${FILESDIR}/${PN}-2.13-process_unittest.patch"
+ "${FILESDIR}/${PN}-2.13-disable-usersgroups-test.patch"
+)
+
+REQUIRED_USE="kvm? ( || ( amd64 x86 ) )"
+
+S="${WORKDIR}/${MY_P}"
+
+QA_WX_LOAD="usr/$(get_libdir)/${PN}/${SERIES}/usr/sbin/ganeti-*d
+ usr/$(get_libdir)/${PN}/${SERIES}/usr/bin/htools"
+
+pkg_setup () {
+ local user
+ confutils_use_depend_all haskell-daemons htools
+ python-single-r1_pkg_setup
+
+ if use multiple-users; then
+ for user in gnt-{masterd,confd,luxid,rapi,daemons,admin}; do
+ enewgroup ${user}
+ enewuser ${user} -1 -1 -1 ${user}
+ done
+ fi
+}
+
+src_prepare() {
+ local testfile
+ epatch "${PATCHES[@]}"
+
+ # not sure why these tests are failing
+ # should remove this on next version bump if possible
+ for testfile in test/py/import-export_unittest.bash; do
+ printf '#!/bin/bash\ntrue\n' > "${testfile}"
+ done
+
+ # take the sledgehammer approach to bug #526270
+ grep -lr '/bin/sh' "${S}" | xargs -r -- sed -i 's:/bin/sh:/bin/bash:g'
+
+ [[ ${PV} =~ [9]{4,} ]] && ./autogen.sh
+ rm autotools/missing
+ eautoreconf
+}
+
+src_configure () {
+ # this is kind of a hack to work around the removal of the qemu-kvm wrapper
+ local kvm_arch
+
+ if use amd64; then
+ kvm_arch=x86_64
+ elif use x86; then
+ kvm_arch=i386
+ elif use kvm; then
+ die "Could not determine qemu system to use for kvm"
+ fi
+
+ econf --localstatedir=/var \
+ --sharedstatedir=/var \
+ --disable-symlinks \
+ --docdir=/usr/share/doc/${P} \
+ --with-ssh-initscript=/etc/init.d/sshd \
+ --with-export-dir=/var/lib/ganeti-storage/export \
+ --with-os-search-path=/usr/share/${PN}/os \
+ $(use_enable test haskell-tests) \
+ $(usex multiple-users "--with-default-user=" "" "gnt-daemons" "") \
+ $(usex multiple-users "--with-user-prefix=" "" "${USER_PREFIX}" "") \
+ $(usex multiple-users "--with-default-group=" "" "gnt-daemons" "") \
+ $(usex multiple-users "--with-group-prefix=" "" "${GROUP_PREFIX}" "") \
+ $(use_enable syslog) \
+ $(use_enable monitoring) \
+ $(usex kvm '--with-kvm-path=' '' "/usr/bin/qemu-system-${kvm_arch}" '') \
+ $(usex haskell-daemons "--enable-confd=haskell" '' '' '')
+}
+
+src_install () {
+ emake V=1 DESTDIR="${D}" install || die "emake install failed"
+
+ newinitd "${FILESDIR}"/ganeti.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ganeti.confd-r2 ${PN}
+
+ if use kvm; then
+ newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
+ newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
+ fi
+
+ # ganeti installs it's own docs in a generic location
+ rm -rf "${D}"/{usr/share/doc/${PN},run}
+
+ sed -i "s:/usr/$(get_libdir)/${PN}/tools/burnin:burnin:" doc/examples/bash_completion
+ newbashcomp doc/examples/bash_completion gnt-instance
+ bashcomp_alias gnt-instance burnin ganeti-{cleaner,confd} \
+ h{space,check,scan,info,ail,arep,roller,squeeze,bal} \
+ gnt-{os,job,filter,debug,storage,group,node,network,backup,cluster}
+
+ dodoc INSTALL UPGRADE NEWS README doc/*.rst
+ dohtml -r doc/html/* doc/css/*.css
+
+ docinto examples
+ dodoc doc/examples/{ganeti.cron,gnt-config-backup} doc/examples/*.ocf
+
+ docinto examples/hooks
+ dodoc doc/examples/hooks/{ipsec,ethers}
+
+ insinto /etc/cron.d
+ newins doc/examples/ganeti.cron ${PN}
+
+ insinto /etc/logrotate.d
+ newins doc/examples/ganeti.logrotate ${PN}
+
+ keepdir /var/{lib,log}/${PN}/
+ keepdir /usr/share/${PN}/${SERIES}/os/
+ keepdir /var/lib/ganeti-storage/{export,file,shared}/
+
+ dosym ${SERIES} "/usr/share/${PN}/default"
+ dosym ${SERIES} "/usr/$(get_libdir)/${PN}/default"
+
+ python_fix_shebang "${ED}" "${D}"/usr/"$(get_libdir)"/${PN}/${SERIES}
+}
+
+pkg_postinst() {
+ if use multiple-users; then
+ elog "You have enable multiple user support, the users for this must"
+ elog "be created. You can use the provided tool for this, which is"
+ elog "located at:"
+ elog " /usr/$(get_libdir)/${PN}/tools/users-setup"
+ fi
+}
+
+src_test () {
+ PATH="${S}/scripts:${S}/src:${PATH}" \
+ TMPDIR="/tmp" \
+ GANETI_MASTER="$(hostname -f)" \
+ emake check || die "emake check failed"
+}
diff --git a/app-emulation/ganeti/ganeti-2.14.1-r1.ebuild b/app-emulation/ganeti/ganeti-2.14.1-r1.ebuild
new file mode 100644
index 000000000000..17bb19c37c17
--- /dev/null
+++ b/app-emulation/ganeti/ganeti-2.14.1-r1.ebuild
@@ -0,0 +1,295 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=(python2_7)
+use test && PYTHON_REQ_USE="ipv6"
+
+inherit eutils user autotools bash-completion-r1 python-single-r1 versionator
+
+MY_PV="${PV/_rc/~rc}"
+MY_PV="${MY_PV/_beta/~beta}"
+MY_P="${PN}-${MY_PV}"
+SERIES="$(get_version_component_range 1-2)"
+
+if [[ ${PV} =~ [9]{4,} ]] ; then
+ EGIT_REPO_URI="git://git.ganeti.org/ganeti.git"
+ inherit git-2
+ KEYWORDS=""
+ GIT_DEPEND="dev-python/docutils
+ =dev-python/sphinx-1.2*[${PYTHON_USEDEP}]
+ media-libs/gd[fontconfig,jpeg,png,truetype]
+ media-gfx/graphviz
+ media-fonts/urw-fonts"
+else
+ SRC_URI="http://downloads.ganeti.org/releases/${SERIES}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="Ganeti is a virtual server management software tool"
+HOMEPAGE="http://www.ganeti.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="drbd haskell-daemons htools ipv6 kvm lxc monitoring multiple-users rbd syslog test xen"
+REQUIRED_USE="|| ( kvm xen lxc ) ${PYTHON_REQUIRED_USE}"
+
+USER_PREFIX="${GANETI_USER_PREFIX:-"gnt-"}"
+GROUP_PREFIX="${GANETI_GROUP_PREFIX:-"${USER_PREFIX}"}"
+
+DEPEND="
+ dev-libs/openssl:0
+ dev-python/paramiko[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/pycurl[${PYTHON_USEDEP}]
+ dev-python/pyinotify[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/bitarray[${PYTHON_USEDEP}]
+ net-analyzer/arping
+ net-analyzer/fping
+ net-misc/bridge-utils
+ net-misc/curl[ssl]
+ net-misc/openssh
+ net-misc/socat
+ sys-apps/iproute2
+ sys-fs/lvm2
+ >=sys-apps/baselayout-2.0
+ =dev-lang/ghc-7.6*:0=
+ dev-haskell/cabal:0=
+ dev-haskell/cabal-install:0=
+ >=dev-haskell/mtl-2.1.1:0=
+ >=dev-haskell/old-time-1.1.0.0:0=
+ >=dev-haskell/random-1.0.1.1:0=
+ haskell-daemons? ( >=dev-haskell/text-0.11.1.13:0= )
+ >=dev-haskell/transformers-0.3.0.0:0=
+
+ >=dev-haskell/attoparsec-0.10.1.1:0=
+ <dev-haskell/attoparsec-0.13:0
+ >=dev-haskell/base64-bytestring-1.0.0.1:0=
+ <dev-haskell/base64-bytestring-1.1:0=
+ >=dev-haskell/crypto-4.2.4:0=
+ <dev-haskell/crypto-4.3:0=
+ >=dev-haskell/curl-1.3.7:0=
+ <dev-haskell/curl-1.4:0=
+ >=dev-haskell/hinotify-0.3.2:0=
+ <dev-haskell/hinotify-0.4:0=
+ >=dev-haskell/hslogger-1.1.4:0=
+ <dev-haskell/hslogger-1.3:0=
+ >=dev-haskell/json-0.5:0=
+ <dev-haskell/json-0.9:0=
+ >=dev-haskell/lens-3.10:0=
+ <dev-haskell/lens-4.8:0=
+ >=dev-haskell/lifted-base-0.2.0.3:0=
+ <dev-haskell/lifted-base-0.3:0=
+ >=dev-haskell/monad-control-0.3.1.3:0=
+ <dev-haskell/monad-control-1.1:0=
+ >=dev-haskell/network-2.3.0.13:0=
+ <dev-haskell/network-2.7:0=
+ >=dev-haskell/parallel-3.2.0.2:3=
+ <dev-haskell/parallel-3.3:3=
+ >=dev-haskell/temporary-1.1.2.3:0=
+ <dev-haskell/temporary-1.3:0=
+ >=dev-haskell/regex-pcre-0.94.2:0=
+ <dev-haskell/regex-pcre-0.95:0=
+ >=dev-haskell/transformers-base-0.4.1:0=
+ <dev-haskell/transformers-base-0.5:0=
+ >=dev-haskell/utf8-string-0.3.7:0=
+ <dev-haskell/utf8-string-0.4:0=
+ >=dev-haskell/zlib-0.5.3.3:0=
+ <dev-haskell/zlib-0.6:0=
+
+ >=dev-haskell/psqueue-1.1:0=
+ <dev-haskell/psqueue-1.2:0=
+ >=dev-haskell/snap-core-0.8.1:0=
+ <dev-haskell/snap-core-0.10:0=
+ >=dev-haskell/snap-server-0.8.1:0=
+ <dev-haskell/snap-server-0.10:0=
+
+ dev-haskell/vector:0=
+ <dev-haskell/semigroupoids-4.1:0=
+ <dev-haskell/contravariant-0.6
+ <dev-haskell/transformers-compat-0.4[three]
+ xen? ( >=app-emulation/xen-3.0 )
+ kvm? ( app-emulation/qemu )
+ lxc? ( app-emulation/lxc )
+ drbd? ( <sys-cluster/drbd-8.5 )
+ rbd? ( sys-cluster/ceph )
+ ipv6? ( net-misc/ndisc6 )
+ ${PYTHON_DEPS}
+ ${GIT_DEPEND}"
+RDEPEND="${DEPEND}
+ !app-emulation/ganeti-htools"
+DEPEND+="sys-devel/m4
+ =app-text/pandoc-1.12*
+ >=dev-haskell/test-framework-0.6:0=
+ <dev-haskell/test-framework-0.9:0=
+ >=dev-haskell/test-framework-hunit-0.2.7:0=
+ <dev-haskell/test-framework-hunit-0.4:0=
+ >=dev-haskell/test-framework-quickcheck2-0.2.12.1:0=
+ <dev-haskell/test-framework-quickcheck2-0.4:0=
+ test? (
+ dev-python/mock
+ dev-python/pyyaml
+ dev-haskell/haddock:0=
+ >=dev-haskell/hunit-1.2.4.2:0=
+ <dev-haskell/hunit-1.3:0=
+ >=dev-haskell/quickcheck-2.4.2:2=
+ <dev-haskell/quickcheck-2.8:2=
+ sys-apps/fakeroot
+ net-misc/socat
+ dev-util/shelltestrunner
+ )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.12-start-stop-daemon-args.patch"
+ "${FILESDIR}/${PN}-2.11-add-pgrep.patch"
+ "${FILESDIR}/${PN}-2.13-daemon-util.patch"
+ "${FILESDIR}/${PN}-2.7-fix-tests.patch"
+ "${FILESDIR}/${PN}-2.9-disable-root-tests.patch"
+ "${FILESDIR}/${PN}-2.9-skip-cli-test.patch"
+ "${FILESDIR}/${PN}-2.10-rundir.patch"
+ "${FILESDIR}/${PN}-2.12-qemu-enable-kvm.patch"
+ "${FILESDIR}/${PN}-2.11-tests.patch"
+ "${FILESDIR}/${PN}-lockdir.patch"
+ "${FILESDIR}/${PN}-2.11-dont-nest-libdir.patch"
+ "${FILESDIR}/${PN}-2.11-dont-print-man-help.patch"
+ "${FILESDIR}/${PN}-2.11-daemon-util-tests.patch"
+ "${FILESDIR}/${PN}-2.13-process_unittest.patch"
+)
+
+REQUIRED_USE="kvm? ( || ( amd64 x86 ) )"
+
+S="${WORKDIR}/${MY_P}"
+
+# apparently currently broken
+QA_WX_LOAD="
+ usr/lib*/${PN}/${SERIES}/usr/sbin/ganeti-*d
+ usr/lib*/${PN}/${SERIES}/usr/bin/htools
+"
+
+pkg_setup () {
+ local user
+ python-single-r1_pkg_setup
+
+ if use multiple-users; then
+ for user in gnt-{masterd,confd,luxid,rapi,daemons,admin}; do
+ enewgroup ${user}
+ enewuser ${user} -1 -1 -1 ${user}
+ done
+ fi
+}
+
+src_prepare() {
+ local testfile
+ epatch "${PATCHES[@]}"
+
+ # not sure why these tests are failing
+ # should remove this on next version bump if possible
+ for testfile in test/py/import-export_unittest.bash; do
+ printf '#!/bin/bash\ntrue\n' > "${testfile}"
+ done
+
+ # take the sledgehammer approach to bug #526270
+ grep -lr '/bin/sh' "${S}" | xargs -r -- sed -i 's:/bin/sh:/bin/bash:g'
+
+ [[ ${PV} =~ [9]{4,} ]] && ./autogen.sh
+ rm autotools/missing
+ eautoreconf
+}
+
+src_configure () {
+ # this is kind of a hack to work around the removal of the qemu-kvm wrapper
+ local kvm_arch
+
+ if use amd64; then
+ kvm_arch=x86_64
+ elif use x86; then
+ kvm_arch=i386
+ elif use kvm; then
+ die "Could not determine qemu system to use for kvm"
+ fi
+
+ econf --localstatedir=/var \
+ --sharedstatedir=/var \
+ --disable-symlinks \
+ --docdir=/usr/share/doc/${P} \
+ --with-ssh-initscript=/etc/init.d/sshd \
+ --with-export-dir=/var/lib/ganeti-storage/export \
+ --with-os-search-path=/usr/share/${PN}/os \
+ $(use_enable test haskell-tests) \
+ $(usex multiple-users "--with-default-user=" "" "gnt-daemons" "") \
+ $(usex multiple-users "--with-user-prefix=" "" "${USER_PREFIX}" "") \
+ $(usex multiple-users "--with-default-group=" "" "gnt-daemons" "") \
+ $(usex multiple-users "--with-group-prefix=" "" "${GROUP_PREFIX}" "") \
+ $(use_enable syslog) \
+ $(use_enable monitoring) \
+ $(usex kvm '--with-kvm-path=' '' "/usr/bin/qemu-system-${kvm_arch}" '') \
+ $(usex haskell-daemons "--enable-confd=haskell" '' '' '')
+}
+
+src_install () {
+ emake V=1 DESTDIR="${D}" install || die "emake install failed"
+
+ newinitd "${FILESDIR}"/ganeti.initd-r3 ${PN}
+ newconfd "${FILESDIR}"/ganeti.confd-r2 ${PN}
+
+ if use kvm; then
+ newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
+ newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
+ fi
+
+ # ganeti installs it's own docs in a generic location
+ rm -rf "${D}"/{usr/share/doc/${PN},run}
+
+ sed -i "s:/usr/$(get_libdir)/${PN}/tools/burnin:burnin:" doc/examples/bash_completion
+ newbashcomp doc/examples/bash_completion gnt-instance
+ bashcomp_alias gnt-instance burnin ganeti-{cleaner,confd} \
+ h{space,check,scan,info,ail,arep,roller,squeeze,bal} \
+ gnt-{os,job,filter,debug,storage,group,node,network,backup,cluster}
+
+ dodoc INSTALL UPGRADE NEWS README doc/*.rst
+ dohtml -r doc/html/* doc/css/*.css
+
+ docinto examples
+ dodoc doc/examples/{ganeti.cron,gnt-config-backup} doc/examples/*.ocf
+
+ docinto examples/hooks
+ dodoc doc/examples/hooks/{ipsec,ethers}
+
+ insinto /etc/cron.d
+ newins doc/examples/ganeti.cron ${PN}
+
+ insinto /etc/logrotate.d
+ newins doc/examples/ganeti.logrotate ${PN}
+
+ # need to dodir rather than keepdir here (bug #552482)
+ dodir /var/lib/${PN}
+
+ keepdir /var/log/${PN}/
+ keepdir /usr/share/${PN}/${SERIES}/os/
+ keepdir /var/lib/ganeti-storage/{export,file,shared}/
+
+ dosym ${SERIES} "/usr/share/${PN}/default"
+ dosym ${SERIES} "/usr/$(get_libdir)/${PN}/default"
+
+ python_fix_shebang "${ED}" "${D}"/usr/"$(get_libdir)"/${PN}/${SERIES}
+}
+
+pkg_postinst() {
+ if use multiple-users; then
+ elog "You have enable multiple user support, the users for this must"
+ elog "be created. You can use the provided tool for this, which is"
+ elog "located at:"
+ elog " /usr/$(get_libdir)/${PN}/tools/users-setup"
+ fi
+}
+
+src_test () {
+ PATH="${S}/scripts:${S}/src:${PATH}" \
+ TMPDIR="/tmp" \
+ GANETI_MASTER="$(hostname -f)" \
+ emake check || die "emake check failed"
+}
diff --git a/app-emulation/ganeti/ganeti-2.4.5-r1.ebuild b/app-emulation/ganeti/ganeti-2.4.5-r1.ebuild
new file mode 100644
index 000000000000..51fbeef95cc9
--- /dev/null
+++ b/app-emulation/ganeti/ganeti-2.4.5-r1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils confutils bash-completion-r1
+
+MY_PV="${PV/_rc/~rc}"
+#MY_PV="${PV/_beta/~beta}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="Ganeti is a virtual server management software tool"
+HOMEPAGE="http://code.google.com/p/ganeti/"
+SRC_URI="http://ganeti.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="kvm xen drbd +filestorage syslog ipv6"
+
+S="${WORKDIR}/${MY_P}"
+
+DEPEND="xen? ( >=app-emulation/xen-3.0 )
+ kvm? ( app-emulation/qemu )
+ drbd? ( >=sys-cluster/drbd-8.3 )
+ ipv6? ( net-misc/ndisc6 )
+ dev-libs/openssl
+ dev-python/paramiko
+ dev-python/pyopenssl
+ dev-python/pyparsing
+ dev-python/pycurl
+ dev-python/pyinotify
+ dev-python/simplejson
+ net-analyzer/arping
+ net-misc/bridge-utils
+ net-misc/curl[ssl]
+ net-misc/openssh
+ net-misc/socat
+ sys-apps/iproute2
+ sys-fs/lvm2
+ >=sys-apps/baselayout-2.0"
+RDEPEND="${DEPEND}
+ !<app-emulation/ganeti-htools-0.3"
+
+pkg_setup () {
+ confutils_require_any kvm xen
+}
+
+src_prepare () {
+ epatch "${FILESDIR}/${PN}-fix-start-stop.patch"
+}
+
+src_configure () {
+ local myconf
+ if use filestorage ; then
+ myconf="--with-file-storage-dir=/var/lib/ganeti-storage/file"
+ else
+ myconf="--with-file-storage-dir=no"
+ fi
+ if use kvm && [ -f /usr/bin/qemu-kvm ] ; then
+ myconf="--with-kvm-path=/usr/bin/qemu-kvm"
+ fi
+ econf --localstatedir=/var \
+ --docdir=/usr/share/doc/${P} \
+ --with-ssh-initscript=/etc/init.d/sshd \
+ --with-export-dir=/var/lib/ganeti-storage/export \
+ --with-os-search-path=/usr/share/ganeti/os \
+ $(use_enable syslog) \
+ ${myconf}
+}
+
+src_install () {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ newinitd "${FILESDIR}"/ganeti-2.1.initd ganeti
+ newconfd "${FILESDIR}"/ganeti.confd ganeti
+ use kvm && newinitd "${FILESDIR}"/ganeti-kvm-poweroff.initd ganeti-kvm-poweroff
+ use kvm && newconfd "${FILESDIR}"/ganeti-kvm-poweroff.confd ganeti-kvm-poweroff
+ newbashcomp doc/examples/bash_completion ganeti
+ dodoc INSTALL UPGRADE NEWS README doc/*.rst
+ rm -rf "${D}"/usr/share/doc/ganeti
+ docinto examples
+ #dodoc doc/examples/{basic-oob,ganeti.cron,gnt-config-backup}
+ dodoc doc/examples/{ganeti.cron,gnt-config-backup}
+ docinto examples/hooks
+ dodoc doc/examples/hooks/{ipsec,ethers}
+
+ keepdir /var/{lib,log,run}/ganeti/
+ keepdir /usr/share/ganeti/os/
+ keepdir /var/lib/ganeti-storage/{export,file}/
+}
diff --git a/app-emulation/ganeti/metadata.xml b/app-emulation/ganeti/metadata.xml
new file mode 100644
index 000000000000..aed23d1c641c
--- /dev/null
+++ b/app-emulation/ganeti/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <maintainer>
+ <email>chutzpah@gentoo.org</email>
+ <name>Patrick McLean</name>
+ </maintainer>
+ <longdescription lang="en">
+ Ganeti is a cluster virtual server management software tool built on top of
+ existing virtualization technologies such as Xen or KVM and other Open
+ Source software.
+
+ Ganeti requires pre-installed virtualization software on your servers in
+ order to function. Once installed, the tool will take over the management
+ part of the virtual instances (Xen DomU), e.g. disk creation management,
+ operating system installation for these instances (in co-operation with
+ OS-specific install scripts), and startup, shutdown, failover between
+ physical systems. It has been designed to facilitate cluster management of
+ virtual servers and to provide fast and simple recovery after physical
+ failures using commodity hardware.
+ </longdescription>
+ <use>
+ <flag name='drbd'>Enable DRBD support</flag>
+ <flag name='filestorage'>Enable File Storage</flag>
+ <flag name='haskell-daemons'>Build haskell daemons instead of python</flag>
+ <flag name='htools'>Enable htools support</flag>
+ <flag name='kvm'>Enable KVM support</flag>
+ <flag name='lxc'>Enable Linux Countainers support</flag>
+ <flag name='multiple-users'>Enable support for running VMs as different users.</flag>
+ <flag name='monitoring'>Enable the ganeti monitoring daemon</flag>
+ <flag name='rbd'>Enable rados block device support via sys-cluster/ceph</flag>
+ <flag name='xen'>Enable Xen support</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/app-emulation/gxemul/Manifest b/app-emulation/gxemul/Manifest
new file mode 100644
index 000000000000..ef5f98f1a904
--- /dev/null
+++ b/app-emulation/gxemul/Manifest
@@ -0,0 +1 @@
+DIST gxemul-0.6.0.tar.gz 3598795 SHA256 d3f85c7964b44b085e088862d88b1f31d907fb99c5321900c0b3a723c82581e8 SHA512 38108c7e4f1332bf80046a63e4a7c5e0fbce7f83a62fdeaa4518ef02947d7de83aac20b0307d286b7eb5d9c721b8400d449d4f244b2bc9358a2502fa21f56b73 WHIRLPOOL 47b2a6fd8c821658fcfbede101fb2fd48e9740d113ef66895ee82238c96645e9c9e5fc25cef2e0235f109f0269f9a3fed0d73c76a6717dc5df26b4fab4cb0b69
diff --git a/app-emulation/gxemul/files/0.6.0-fix-mkstemp-test.patch b/app-emulation/gxemul/files/0.6.0-fix-mkstemp-test.patch
new file mode 100644
index 000000000000..88883309b909
--- /dev/null
+++ b/app-emulation/gxemul/files/0.6.0-fix-mkstemp-test.patch
@@ -0,0 +1,10 @@
+--- configure 2012-11-03 09:08:09.373041529 +0000
++++ configure.new 2012-11-03 09:08:31.999585979 +0000
+@@ -705,6 +705,7 @@
+ # mkstemp missing?
+ printf "checking for mkstemp... "
+ printf "#include <unistd.h>
++#include <stdlib.h>
+ int main(int argc, char *argv[]) { int x; char *y = \"abc\";
+ x = mkstemp(y); return 0;}\n" > _tests.cc
+ $CXX $CXXFLAGS _tests.cc -o _tests 2> /dev/null
diff --git a/app-emulation/gxemul/files/0.6.0-fix-mymkstemp.patch b/app-emulation/gxemul/files/0.6.0-fix-mymkstemp.patch
new file mode 100644
index 000000000000..80d69f92c827
--- /dev/null
+++ b/app-emulation/gxemul/files/0.6.0-fix-mymkstemp.patch
@@ -0,0 +1,11 @@
+--- src/old_main/misc.cc 2012-11-03 08:47:34.309732354 +0000
++++ src/old_main/misc.cc.new 2012-11-03 08:47:02.096573614 +0000
+@@ -122,7 +122,7 @@
+ p++;
+ }
+
+- h = open(templ, O_RDWR, 0600);
++ h = open(templ, O_CREAT | O_RDWR, 0600);
+ return h;
+ }
+
diff --git a/app-emulation/gxemul/files/0.6.0-gcc46.patch b/app-emulation/gxemul/files/0.6.0-gcc46.patch
new file mode 100644
index 000000000000..eb0ce26b6e1c
--- /dev/null
+++ b/app-emulation/gxemul/files/0.6.0-gcc46.patch
@@ -0,0 +1,16 @@
+ src/include/refcount_ptr.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/src/include/refcount_ptr.h b/src/include/refcount_ptr.h
+index 4645769..ebabd58 100644
+--- a/src/include/refcount_ptr.h
++++ b/src/include/refcount_ptr.h
+@@ -1,6 +1,8 @@
+ #ifndef REFCOUNT_PTR_H
+ #define REFCOUNT_PTR_H
+
++#include <stddef.h>
++
+ /*
+ * Copyright (C) 2007-2010 Anders Gavare. All rights reserved.
+ *
diff --git a/app-emulation/gxemul/gxemul-0.6.0-r1.ebuild b/app-emulation/gxemul/gxemul-0.6.0-r1.ebuild
new file mode 100644
index 000000000000..4d8e375f7496
--- /dev/null
+++ b/app-emulation/gxemul/gxemul-0.6.0-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A Machine Emulator, Mainly emulates MIPS, but supports other CPU types"
+HOMEPAGE="http://gxemul.sourceforge.net/"
+SRC_URI="mirror://sourceforge/project/gxemul/GXemul/${PV}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~ppc ~sparc ~x86 ~x86-fbsd"
+IUSE="debug X"
+
+RDEPEND="X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ X? ( x11-proto/xproto )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-gcc46.patch
+ epatch "${FILESDIR}"/${PV}-fix-mymkstemp.patch # Bug 441558
+ epatch "${FILESDIR}"/${PV}-fix-mkstemp-test.patch # Bug 441558
+ sed -i configure -e 's|-O3||g' || die "sed configure"
+ tc-export CC CXX
+}
+
+src_configure() {
+ # no autotools
+ ./configure \
+ --disable-valgrind \
+ $(use debug && echo --debug) \
+ $(use X || echo --disable-x) || die "configure failed"
+}
+
+src_install() {
+ dobin gxemul
+ doman man/gxemul.1
+ dodoc HISTORY README
+ dohtml -r doc/*
+}
diff --git a/app-emulation/gxemul/metadata.xml b/app-emulation/gxemul/metadata.xml
new file mode 100644
index 000000000000..f7b826fbae73
--- /dev/null
+++ b/app-emulation/gxemul/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription>Machine Emulator. Supports emulation across several architectures. Primarily for MIPS support, but other platform support coming soon.</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">gxemul</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/hercules/Manifest b/app-emulation/hercules/Manifest
new file mode 100644
index 000000000000..778ae40b2163
--- /dev/null
+++ b/app-emulation/hercules/Manifest
@@ -0,0 +1,4 @@
+DIST hercules-3.06.tar.gz 2658262 SHA256 fa00b17c86a47133108c49973ba343d589f0e8777a115d827ef3da9aafbda22b SHA512 a938c2be64094ca412fb9094942088e344aa67b0af324af674d4fff73c6e936ffc6e384a5edcb48d1c31439c55322bf5e6b2e7ea36e7e7c9e416d8522240b1c5 WHIRLPOOL dbebb54e19ea5016d576153a0818ff5ce8e7114449837f127ad1c0ea82c561306a443dee2bd47d9a8c4afbd6ca257ca350348e773def86eccac76d3c754ea29c
+DIST hercules-3.08.tar.gz 2684844 SHA256 85e217773587f2278d4b6cb6bc815e042cfc982d0fc14baa0da4a84dea399e9d SHA512 6fe8da6e0462f4b27f987c86b2de769e6a1a9eb3389bb612b59931590f75e7dd9d4a8456b5f36209aadf433dfe2e48686f2cda8e95b7480b9bdb971247e1eae5 WHIRLPOOL 833b2ba21a17d70cd3ba9a4f88fdaaec288acf471d43fd9c660e55c7c48f7a34b46b1defd7ffb699ed3f34af1fca9484303a09f3a020fa06367cdd291a675f5b
+DIST hercules-3.09.tar.gz 2567052 SHA256 98a6029d908943451635ba53acf97ed61fdf6ebafc4402be7137c620851fe4e7 SHA512 0c972f62de6f780608adff3fdb614b0c6fe46349da73ec2225d809786fd5188f9e9fbb0ee5858a75cb156071c0e976d37997547d23c939aa48c3b727c5680c0a WHIRLPOOL f9eee4c11855ac08f20423f4b864b2d41315ce445af4f844b644a0399e83535442cb697571e0956ba53deae3cb755956f3cdf0a323efd07afb4be8bc8dd1c145
+DIST hercules-3.10.tar.gz 2608321 SHA256 26264569b7d78bbc3b6221926051ac3761c4a792dfc84d591d3230de40aa46fa SHA512 de8b3e2e90fdb745dea9c8ce4dbe506de2aba3bf08b3e937605798e6a8020576a949d6ea3496b7c42bd23d617fc96648d2d8ec05a66e8ed174ce46a3bc31c5d1 WHIRLPOOL 5233ededd4ef42e201216a11b2a09ee6c59a678771aaa9bc78ab4b87f459addc5c0b4ffd4bd2ec98d15a461565db6a354cc1ac846f800b98e86e93e51b263b4a
diff --git a/app-emulation/hercules/files/hercules-3.06-build.patch b/app-emulation/hercules/files/hercules-3.06-build.patch
new file mode 100644
index 000000000000..9424fa5a4cd6
--- /dev/null
+++ b/app-emulation/hercules/files/hercules-3.06-build.patch
@@ -0,0 +1,18 @@
+--- Makefile.in
++++ Makefile.in
+@@ -2010,14 +2010,13 @@
+
+ tar: dist
+
+-install-exec-local:
++install-exec-hook:
+ @SETUID_HERCIFC_TRUE@ chown root $(DESTDIR)$(bindir)/hercifc
+ @HERCIFC_GROUPSET_TRUE@@SETUID_HERCIFC_TRUE@ chgrp $(HERCIFC_GROUPNAME) $(DESTDIR)$(bindir)/hercifc
+ @SETUID_HERCIFC_TRUE@ chmod 0750 $(DESTDIR)$(bindir)/hercifc
+ @SETUID_HERCIFC_TRUE@ chmod +s $(DESTDIR)$(bindir)/hercifc
+ @SETUID_HERCIFC_TRUE@ rm hercifc
+
+-install-exec-hook:
+ rm -f $(DESTDIR)$(libdir)/libherc*.a
+ rm -f $(DESTDIR)$(modexecdir)/dyn*.a
+ rm -f $(DESTDIR)$(modexecdir)/hdt*.a
diff --git a/app-emulation/hercules/files/hercules-3.06-gcc44.patch b/app-emulation/hercules/files/hercules-3.06-gcc44.patch
new file mode 100644
index 000000000000..e38c320dafbe
--- /dev/null
+++ b/app-emulation/hercules/files/hercules-3.06-gcc44.patch
@@ -0,0 +1,12 @@
+diff -ur hercules-3.06.orig/hsccmd.c hercules-3.06/hsccmd.c
+--- hercules-3.06.orig/hsccmd.c 2009-01-10 02:18:33.000000000 +0200
++++ hercules-3.06/hsccmd.c 2009-08-10 14:59:34.000000000 +0300
+@@ -7676,7 +7676,7 @@
+ break;
+ }
+ }
+-#elif // OPTION_CMDTGT
++#else // OPTION_CMDTGT
+ #ifdef _FEATURE_SYSTEM_CONSOLE
+ if ('.' == cmd[0] || '!' == cmd[0])
+ {
diff --git a/app-emulation/hercules/files/hercules-3.09-aliasing.patch b/app-emulation/hercules/files/hercules-3.09-aliasing.patch
new file mode 100644
index 000000000000..3d03e9b6dc1b
--- /dev/null
+++ b/app-emulation/hercules/files/hercules-3.09-aliasing.patch
@@ -0,0 +1,41 @@
+From 7d3255a18ad845953cc8083371e8623e771ad4f5 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 27 Aug 2013 12:25:49 -0400
+Subject: [PATCH] sha: fix strict aliasing warnings
+
+sha256.c:492:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
+sha256.c:784:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
+sha256.c:785:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ crypto/sha256.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/crypto/sha256.c b/crypto/sha256.c
+index 1a6a243..b1e90b4 100644
+--- a/crypto/sha256.c
++++ b/crypto/sha256.c
+@@ -489,7 +489,7 @@ SHA256_Final(u_int8_t digest[], SHA256_CTX *context)
+ *context->buffer = 0x80;
+ }
+ /* Set the bit count: */
+- *(u_int64_t *)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount;
++ memcpy (&context->buffer[SHA256_SHORT_BLOCK_LENGTH], &context->bitcount, 8);
+
+ /* Final transform: */
+ SHA256_Transform(context, context->buffer);
+@@ -781,8 +781,8 @@ SHA512_Last(SHA512_CTX *context)
+ *context->buffer = 0x80;
+ }
+ /* Store the length of input data (in bits): */
+- *(u_int64_t *)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1];
+- *(u_int64_t *)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0];
++ memcpy (&context->buffer[SHA512_SHORT_BLOCK_LENGTH], &context->bitcount[1], 8);
++ memcpy (&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8], &context->bitcount[0], 8);
+
+ /* Final transform: */
+ SHA512_Transform(context, context->buffer);
+--
+1.8.3.2
+
diff --git a/app-emulation/hercules/hercules-3.06.ebuild b/app-emulation/hercules/hercules-3.06.ebuild
new file mode 100644
index 000000000000..9aa8b976ebce
--- /dev/null
+++ b/app-emulation/hercules/hercules-3.06.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Hercules System/370, ESA/390 and zArchitecture Mainframe Emulator"
+HOMEPAGE="http://www.hercules-390.org/"
+SRC_URI="http://www.hercules-390.org/${P}.tar.gz"
+
+LICENSE="QPL-1.0"
+SLOT="0"
+KEYWORDS="alpha amd64 ppc sparc x86"
+IUSE="custom-cflags"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-build.patch
+ epatch "${FILESDIR}"/${P}-gcc44.patch
+ sed -i \
+ -e 's:@modexecdir@:$(libdir)/$(PACKAGE):' \
+ -e '/^AM_CPPFLAGS/s:=:= -DMODULESDIR=\\"$(modexecdir)\\" :' \
+ $(find -name Makefile.in)
+ sed -i '/MODULESDIR/d' config.h.in
+}
+
+src_compile() {
+ use custom-cflags || strip-flags
+ econf \
+ --enable-cckd-bzip2 \
+ --enable-het-bzip2 \
+ --enable-setuid-hercifc \
+ --enable-custom="Gentoo Linux ${PF}.ebuild" \
+ || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ insinto /usr/share/hercules
+ doins hercules.cnf
+ dodoc README.* RELEASE.NOTES CHANGES
+ dohtml -r html
+}
diff --git a/app-emulation/hercules/hercules-3.08.ebuild b/app-emulation/hercules/hercules-3.08.ebuild
new file mode 100644
index 000000000000..f7aecdcc961a
--- /dev/null
+++ b/app-emulation/hercules/hercules-3.08.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic
+
+DESCRIPTION="Hercules System/370, ESA/390 and zArchitecture Mainframe Emulator"
+HOMEPAGE="http://www.hercules-390.eu/"
+SRC_URI="http://downloads.hercules-390.eu/${P}.tar.gz"
+
+LICENSE="QPL-1.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~x64-macos ~x86-macos"
+IUSE="bzip2 custom-cflags +suid"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ use custom-cflags || strip-flags
+ ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress=$(usex bzip2) \
+ econf \
+ $(use_enable bzip2 cckd-bzip2) \
+ $(use_enable bzip2 het-bzip2) \
+ $(use_enable suid setuid-hercifc) \
+ --enable-custom="Gentoo ${PF}.ebuild" \
+ --disable-optimization
+}
+
+src_install() {
+ default
+ insinto /usr/share/hercules
+ doins hercules.cnf
+ dodoc README.* RELEASE.NOTES
+ dohtml -r html
+}
diff --git a/app-emulation/hercules/hercules-3.09.ebuild b/app-emulation/hercules/hercules-3.09.ebuild
new file mode 100644
index 000000000000..18548fed7a74
--- /dev/null
+++ b/app-emulation/hercules/hercules-3.09.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Hercules System/370, ESA/390 and zArchitecture Mainframe Emulator"
+HOMEPAGE="http://www.hercules-390.eu/"
+SRC_URI="http://downloads.hercules-390.eu/${P}.tar.gz"
+
+LICENSE="QPL-1.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~x64-macos ~x86-macos"
+IUSE="bzip2 custom-cflags +suid"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-aliasing.patch
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress=$(usex bzip2) \
+ econf \
+ $(use_enable bzip2 cckd-bzip2) \
+ $(use_enable bzip2 het-bzip2) \
+ $(use_enable suid setuid-hercifc) \
+ --enable-custom="Gentoo ${PF}.ebuild" \
+ --disable-optimization
+}
+
+src_install() {
+ default
+ insinto /usr/share/hercules
+ doins hercules.cnf
+ dodoc README.* RELEASE.NOTES
+ dohtml -r html
+}
diff --git a/app-emulation/hercules/hercules-3.10.ebuild b/app-emulation/hercules/hercules-3.10.ebuild
new file mode 100644
index 000000000000..6f16f2aaf1d2
--- /dev/null
+++ b/app-emulation/hercules/hercules-3.10.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Hercules System/370, ESA/390 and zArchitecture Mainframe Emulator"
+HOMEPAGE="http://www.hercules-390.eu/"
+SRC_URI="http://downloads.hercules-390.eu/${P}.tar.gz"
+
+LICENSE="QPL-1.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~x64-macos ~x86-macos"
+IUSE="bzip2 custom-cflags +suid"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.09-aliasing.patch
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress=$(usex bzip2) \
+ econf \
+ $(use_enable bzip2 cckd-bzip2) \
+ $(use_enable bzip2 het-bzip2) \
+ $(use_enable suid setuid-hercifc) \
+ --enable-custom="Gentoo ${PF}.ebuild" \
+ --disable-optimization
+}
+
+src_install() {
+ default
+ insinto /usr/share/hercules
+ doins hercules.cnf
+ dodoc README.* RELEASE.NOTES
+ dohtml -r html
+}
diff --git a/app-emulation/hercules/metadata.xml b/app-emulation/hercules/metadata.xml
new file mode 100644
index 000000000000..feb9acec70a3
--- /dev/null
+++ b/app-emulation/hercules/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>s390</herd>
+<longdescription>
+ Hercules is an emulator for the IBM System/360, System/370, ESA/390, and
+ z/Architecture series of mainframe computer systems. It will run any
+ software that will run on those computers, provided the peripheral devices
+ the program requires are present in the configuration.
+</longdescription>
+</pkgmetadata>
diff --git a/app-emulation/kvm-kmod/Manifest b/app-emulation/kvm-kmod/Manifest
new file mode 100644
index 000000000000..7446d06ed89d
--- /dev/null
+++ b/app-emulation/kvm-kmod/Manifest
@@ -0,0 +1,5 @@
+DIST kvm-kmod-3.10.1.tar.bz2 302264 SHA256 2b9ae4e36690804fabb1eac4028495f99939f6abe5518c3f98c3d7c8dd488898 SHA512 d86edc933bbb41d7139c56143084c37c8fb6973993756ed8177afbb2e0f4f620dba749f2ebd1e2e90eb70a1a5ea40712c3b5fc3c1aee3d3f131ec39a1b2d80bf WHIRLPOOL 0946ed02b7c0287c02e9d4b75875ef7a4bd46281a6b107cc7115e787d760803724286f4a517f47a286e7c880e895e88cdc69775399d03a8b196815bc62bd7dee
+DIST kvm-kmod-3.3.6.tar.bz2 275650 SHA256 b6edcf64c468e4a880d7b633c716805462c07546d93799791c9d3eb6166e593f SHA512 6258d532576c2b10dc3410bb9d7af390268d6dd56195e4b66057a7c991a32fec782289d9cdc4894c8dccb88d87ecb574645529430dd0ac85f8344b304286d046 WHIRLPOOL e422e2c065feaf611c2e1a5e2d308f5f4198fa19d96156371ef7fcc17bd898599b34cba0b6106f1a15bf20f9fa5eaf6ae0dabdcd7bbfa228238ce057848e120b
+DIST kvm-kmod-3.4.tar.bz2 280821 SHA256 94a7ce2d0f06c7b9f913be3432e768a2340e50235845fc4e9027abed8aee3291 SHA512 868a554c9ba3a1418f0aa9bdd894ab114e3d59acfa27b3759e362f4631d972f7f48d70563e5ba3e973595195c27fda0c1138c030fd27abdbb8da71103b65cfaa WHIRLPOOL ce99ca65748b12e82a18f67f724eb27cc31310019f8fda15293d6eab9d18dd1a20b9b311fc77162a73f90591d7d772373645dbf02a707c8ca218b2c6840b8bed
+DIST kvm-kmod-3.6.tar.bz2 278798 SHA256 74f6bb8de670d5eac58612142c1d504cf0e98325343e8443f9752197e43e1595 SHA512 27042527343926f5c6be41789305b6d8ca888e18e92e95a7bbcc18712865d97ff0b392d46356c57280134f3b2892ed5725975b72715aae22c4e1b02f4378e4f4 WHIRLPOOL 765549376aa3f7c2db11a79c8e5e055e330d211e36bfa03cda41a85e846a89f49d2dd17da219b1c742d1f2bbb89148a0ef2d019940756db7680acdef52c19bf8
+DIST kvm-kmod-3.8.tar.bz2 289028 SHA256 55da50de9c801c9136c312887d5ffd462e80f55f363e88f0928eeb1450b814a1 SHA512 05d04509fc86a0eec0ae408404b15f5ce2eb640c12aacd09b9bb54ffe10b9bb88dff53329ddb7e960a5388cf2e20a07341e1d829e173603b52cbb58d792c87c4 WHIRLPOOL f63628cfff99ca0f9e10cb2afef6cb03b31adbfa0b2c3e056717c2df4da119e760b90a81a0cf1456ddfd7aa79ddb19452102c7600df4767275c49156ea140de9
diff --git a/app-emulation/kvm-kmod/kvm-kmod-3.10.1.ebuild b/app-emulation/kvm-kmod/kvm-kmod-3.10.1.ebuild
new file mode 100644
index 000000000000..bdbff2e4803a
--- /dev/null
+++ b/app-emulation/kvm-kmod/kvm-kmod-3.10.1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils linux-mod
+
+SRC_URI="mirror://sourceforge/kvm/${P}.tar.bz2"
+
+DESCRIPTION="Kernel-based Virtual Machine kernel modules"
+HOMEPAGE="http://www.linux-kvm.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+RESTRICT="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ linux_config_exists || die "Your kernel sources are unconfigured"
+
+ if ! linux_chkconfig_present KVM; then
+ eerror "KVM now needs CONFIG_KVM built into your kernel, even"
+ eerror "if you're using the external modules from this package."
+ eerror "Please enable KVM support in your kernel, found at:"
+ eerror
+ eerror " Virtualization"
+ eerror " Kernel-based Virtual Machine (KVM) support"
+ eerror
+ die "KVM support not detected!"
+ fi
+ BUILD_TARGETS="all"
+ MODULE_NAMES="kvm(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-intel(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-amd(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+}
+
+src_configure() {
+ local conf_opts
+
+ conf_opts="--kerneldir=$KV_DIR"
+
+ if has_multilib_profile && [[ "${DEFAULT_ABI}" == "x86" ]] ; then
+ conf_opts="$conf_opts --arch=x86"
+ fi
+
+ ./configure ${conf_opts} || die "configure failed"
+}
+
+src_compile() {
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+}
+
+pkg_preinst() {
+ find /lib/modules/${KV_FULL} -name 'kvm*.ko' -type f -delete
+
+ linux-mod_pkg_preinst
+}
diff --git a/app-emulation/kvm-kmod/kvm-kmod-3.3.6.ebuild b/app-emulation/kvm-kmod/kvm-kmod-3.3.6.ebuild
new file mode 100644
index 000000000000..017d291c81ea
--- /dev/null
+++ b/app-emulation/kvm-kmod/kvm-kmod-3.3.6.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils linux-mod
+
+SRC_URI="mirror://sourceforge/kvm/${P}.tar.bz2"
+
+DESCRIPTION="Kernel-based Virtual Machine kernel modules"
+HOMEPAGE="http://www.linux-kvm.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+RESTRICT="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ linux_config_exists || die "Your kernel sources are unconfigured"
+
+ if ! linux_chkconfig_present KVM; then
+ eerror "KVM now needs CONFIG_KVM built into your kernel, even"
+ eerror "if you're using the external modules from this package."
+ eerror "Please enable KVM support in your kernel, found at:"
+ eerror
+ eerror " Virtualization"
+ eerror " Kernel-based Virtual Machine (KVM) support"
+ eerror
+ die "KVM support not detected!"
+ fi
+ BUILD_TARGETS="all"
+ MODULE_NAMES="kvm(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-intel(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-amd(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+}
+
+src_configure() {
+ local conf_opts
+
+ conf_opts="--kerneldir=$KV_DIR"
+
+ if has_multilib_profile && [[ "${DEFAULT_ABI}" == "x86" ]] ; then
+ conf_opts="$conf_opts --arch=x86"
+ fi
+
+ ./configure ${conf_opts} || die "configure failed"
+}
+
+src_compile() {
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+}
+
+pkg_preinst() {
+ find /lib/modules/${KV_FULL} -name 'kvm*.ko' -type f -delete
+
+ linux-mod_pkg_preinst
+}
diff --git a/app-emulation/kvm-kmod/kvm-kmod-3.4.ebuild b/app-emulation/kvm-kmod/kvm-kmod-3.4.ebuild
new file mode 100644
index 000000000000..017d291c81ea
--- /dev/null
+++ b/app-emulation/kvm-kmod/kvm-kmod-3.4.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils linux-mod
+
+SRC_URI="mirror://sourceforge/kvm/${P}.tar.bz2"
+
+DESCRIPTION="Kernel-based Virtual Machine kernel modules"
+HOMEPAGE="http://www.linux-kvm.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+RESTRICT="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ linux_config_exists || die "Your kernel sources are unconfigured"
+
+ if ! linux_chkconfig_present KVM; then
+ eerror "KVM now needs CONFIG_KVM built into your kernel, even"
+ eerror "if you're using the external modules from this package."
+ eerror "Please enable KVM support in your kernel, found at:"
+ eerror
+ eerror " Virtualization"
+ eerror " Kernel-based Virtual Machine (KVM) support"
+ eerror
+ die "KVM support not detected!"
+ fi
+ BUILD_TARGETS="all"
+ MODULE_NAMES="kvm(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-intel(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-amd(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+}
+
+src_configure() {
+ local conf_opts
+
+ conf_opts="--kerneldir=$KV_DIR"
+
+ if has_multilib_profile && [[ "${DEFAULT_ABI}" == "x86" ]] ; then
+ conf_opts="$conf_opts --arch=x86"
+ fi
+
+ ./configure ${conf_opts} || die "configure failed"
+}
+
+src_compile() {
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+}
+
+pkg_preinst() {
+ find /lib/modules/${KV_FULL} -name 'kvm*.ko' -type f -delete
+
+ linux-mod_pkg_preinst
+}
diff --git a/app-emulation/kvm-kmod/kvm-kmod-3.6.ebuild b/app-emulation/kvm-kmod/kvm-kmod-3.6.ebuild
new file mode 100644
index 000000000000..bdbff2e4803a
--- /dev/null
+++ b/app-emulation/kvm-kmod/kvm-kmod-3.6.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils linux-mod
+
+SRC_URI="mirror://sourceforge/kvm/${P}.tar.bz2"
+
+DESCRIPTION="Kernel-based Virtual Machine kernel modules"
+HOMEPAGE="http://www.linux-kvm.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+RESTRICT="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ linux_config_exists || die "Your kernel sources are unconfigured"
+
+ if ! linux_chkconfig_present KVM; then
+ eerror "KVM now needs CONFIG_KVM built into your kernel, even"
+ eerror "if you're using the external modules from this package."
+ eerror "Please enable KVM support in your kernel, found at:"
+ eerror
+ eerror " Virtualization"
+ eerror " Kernel-based Virtual Machine (KVM) support"
+ eerror
+ die "KVM support not detected!"
+ fi
+ BUILD_TARGETS="all"
+ MODULE_NAMES="kvm(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-intel(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-amd(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+}
+
+src_configure() {
+ local conf_opts
+
+ conf_opts="--kerneldir=$KV_DIR"
+
+ if has_multilib_profile && [[ "${DEFAULT_ABI}" == "x86" ]] ; then
+ conf_opts="$conf_opts --arch=x86"
+ fi
+
+ ./configure ${conf_opts} || die "configure failed"
+}
+
+src_compile() {
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+}
+
+pkg_preinst() {
+ find /lib/modules/${KV_FULL} -name 'kvm*.ko' -type f -delete
+
+ linux-mod_pkg_preinst
+}
diff --git a/app-emulation/kvm-kmod/kvm-kmod-3.8.ebuild b/app-emulation/kvm-kmod/kvm-kmod-3.8.ebuild
new file mode 100644
index 000000000000..bdbff2e4803a
--- /dev/null
+++ b/app-emulation/kvm-kmod/kvm-kmod-3.8.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils linux-mod
+
+SRC_URI="mirror://sourceforge/kvm/${P}.tar.bz2"
+
+DESCRIPTION="Kernel-based Virtual Machine kernel modules"
+HOMEPAGE="http://www.linux-kvm.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+RESTRICT="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ linux_config_exists || die "Your kernel sources are unconfigured"
+
+ if ! linux_chkconfig_present KVM; then
+ eerror "KVM now needs CONFIG_KVM built into your kernel, even"
+ eerror "if you're using the external modules from this package."
+ eerror "Please enable KVM support in your kernel, found at:"
+ eerror
+ eerror " Virtualization"
+ eerror " Kernel-based Virtual Machine (KVM) support"
+ eerror
+ die "KVM support not detected!"
+ fi
+ BUILD_TARGETS="all"
+ MODULE_NAMES="kvm(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-intel(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+ MODULE_NAMES="${MODULE_NAMES} kvm-amd(kernel/arch/x86/kvm/:${S}:${S}/x86)"
+}
+
+src_configure() {
+ local conf_opts
+
+ conf_opts="--kerneldir=$KV_DIR"
+
+ if has_multilib_profile && [[ "${DEFAULT_ABI}" == "x86" ]] ; then
+ conf_opts="$conf_opts --arch=x86"
+ fi
+
+ ./configure ${conf_opts} || die "configure failed"
+}
+
+src_compile() {
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+}
+
+pkg_preinst() {
+ find /lib/modules/${KV_FULL} -name 'kvm*.ko' -type f -delete
+
+ linux-mod_pkg_preinst
+}
diff --git a/app-emulation/kvm-kmod/metadata.xml b/app-emulation/kvm-kmod/metadata.xml
new file mode 100644
index 000000000000..f2d0026b3d6b
--- /dev/null
+++ b/app-emulation/kvm-kmod/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>qemu</herd>
+ <maintainer>
+ <email>cardoe@gentoo.org</email>
+ <name>Doug Goldstein</name>
+ </maintainer>
+ <longdescription lang="en">
+ KVM (for Kernel-based Virtual Machine) is a full virtualization solution
+ for Linux on x86 hardware containing virtualization extensions (Intel VT
+ or AMD-V). This package contains kernel modules for kvm.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">kvm</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/libcacard/Manifest b/app-emulation/libcacard/Manifest
new file mode 100644
index 000000000000..3385cd7ae564
--- /dev/null
+++ b/app-emulation/libcacard/Manifest
@@ -0,0 +1 @@
+DIST libcacard-0.1.2.tar.bz2 276430 SHA256 ca100118865ee24f16cf39367f74434cddbbb003a12a1adc8645f3dc34791daf SHA512 a3622b29fe3a059e069ad6f7da428278a915cec362a6aae3c7cad0d47dfadba67308631435993c0f41cabe92a05874b339518dc503b71b8d86db4976bb6987f6 WHIRLPOOL 9e1a156fbbff34148a1debc1f4a6d23aea687213a45cac7feb57134dcbd59fa95a22558e15e5c237ae6c3a7851282c72b49ee6e94c9fff8940feee13d42f08ad
diff --git a/app-emulation/libcacard/libcacard-0.1.2.ebuild b/app-emulation/libcacard/libcacard-0.1.2.ebuild
new file mode 100644
index 000000000000..78a3c4b1a49b
--- /dev/null
+++ b/app-emulation/libcacard/libcacard-0.1.2.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Library for emulating CAC cards"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE="static-libs"
+
+RDEPEND=">=dev-libs/nss-3.13
+ >=sys-apps/pcsc-lite-1.8"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ # --enable-passthru works only on W$
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ use static-libs || rm "${D}"/usr/lib*/*.la
+}
diff --git a/app-emulation/libcacard/metadata.xml b/app-emulation/libcacard/metadata.xml
new file mode 100644
index 000000000000..6804d7590f41
--- /dev/null
+++ b/app-emulation/libcacard/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/libguestfs-appliance/Manifest b/app-emulation/libguestfs-appliance/Manifest
new file mode 100644
index 000000000000..47caa127259f
--- /dev/null
+++ b/app-emulation/libguestfs-appliance/Manifest
@@ -0,0 +1,2 @@
+DIST appliance-1.26.0.tar.xz 94753208 SHA256 446e8f0cfb24977843049984879d471760a1f56dd9f891f2a66c16827c7dfbcf SHA512 5d493ed6e8601dde8d5a45debfee71696b96a36d0f69d428388a6f2a2d49e12c0a66bcee210fe606fc9b2b41cb42d0d2a9f5d12425f2b234423194b2609f081f WHIRLPOOL 18cb09b44ce568e4270e574fffe7ffd935c4d64564abaae66c3d70202db9df75b013a0ed8add639ac13ea4ebd0ec9d74645a774d2e969686c8bc0d616587f625
+DIST appliance-1.28.1.tar.xz 100065044 SHA256 d6aa214ba05666ca7b8494b2f1814f2f291e569a9476e837e4b9d061ff92cfa2 SHA512 f13c556953d3542f92c2c007d3e97c3568382a1879e7a558471dbeac8962bd2809e446bbf0f4647002967112abe8f9a9a06910b74e9b7d72694cf49859a26330 WHIRLPOOL fa80fc747e4270fb3bc3b853ea9abf62fd655cab4c72eb6a084d319078a9f89baf2a8c00b34c9dcbc8fb875f1526c0a8e681a6f4917710934a9c2a8d99010e04
diff --git a/app-emulation/libguestfs-appliance/files/env.file b/app-emulation/libguestfs-appliance/files/env.file
new file mode 100644
index 000000000000..577009eebf8f
--- /dev/null
+++ b/app-emulation/libguestfs-appliance/files/env.file
@@ -0,0 +1 @@
+LIBGUESTFS_PATH=/usr/share/guestfs/appliance/
diff --git a/app-emulation/libguestfs-appliance/libguestfs-appliance-1.26.0-r1.ebuild b/app-emulation/libguestfs-appliance/libguestfs-appliance-1.26.0-r1.ebuild
new file mode 100644
index 000000000000..e2b975595f27
--- /dev/null
+++ b/app-emulation/libguestfs-appliance/libguestfs-appliance-1.26.0-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CHECKREQS_DISK_USR=500M
+CHECKREQS_DISK_BUILD=500M
+
+inherit check-reqs
+
+DESCRIPTION="VM appliance disk image used in libguestfs package"
+HOMEPAGE="http://libguestfs.org/"
+SRC_URI="http://libguestfs.org/download/binaries/appliance/appliance-${PV}.tar.xz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/xz-utils"
+# Mixing libguestfs versions causes weird problems. #501588
+RDEPEND="!<app-emulation/libguestfs-${PV}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ # We'll unpack the tarball directly into ${D} to speed up install.
+ # Otherwise we need to duplicate hundreds of data.
+ :
+}
+
+src_install() {
+ dodir /usr/share/guestfs
+ cd "${ED}"/usr/share/guestfs
+ unpack ${A}
+ cd appliance || die
+ dodoc README*
+ rm README* || die
+ chmod 755 . || die
+ chmod 644 * || die
+
+ newenvd "${FILESDIR}"/env.file 99"${PN}"
+}
diff --git a/app-emulation/libguestfs-appliance/libguestfs-appliance-1.28.1-r1.ebuild b/app-emulation/libguestfs-appliance/libguestfs-appliance-1.28.1-r1.ebuild
new file mode 100644
index 000000000000..9778bc868515
--- /dev/null
+++ b/app-emulation/libguestfs-appliance/libguestfs-appliance-1.28.1-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CHECKREQS_DISK_USR=500M
+CHECKREQS_DISK_BUILD=500M
+
+inherit check-reqs
+
+DESCRIPTION="VM appliance disk image used in libguestfs package"
+HOMEPAGE="http://libguestfs.org/"
+SRC_URI="http://libguestfs.org/download/binaries/appliance/appliance-${PV}.tar.xz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/xz-utils"
+# Mixing libguestfs versions causes weird problems. #501588
+RDEPEND="!<app-emulation/libguestfs-${PV}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ # We'll unpack the tarball directly into ${D} to speed up install.
+ # Otherwise we need to duplicate hundreds of data.
+ :
+}
+
+src_install() {
+ dodir /usr/share/guestfs
+ cd "${ED}"/usr/share/guestfs
+ unpack ${A}
+ cd appliance || die
+ dodoc README*
+ # Don't rm README.* here, at least README.fixed is needed for libguestfs, see
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1183780
+ chmod 755 . || die
+ chmod 644 * || die
+
+ newenvd "${FILESDIR}"/env.file 99"${PN}"
+}
diff --git a/app-emulation/libguestfs-appliance/libguestfs-appliance-1.28.1.ebuild b/app-emulation/libguestfs-appliance/libguestfs-appliance-1.28.1.ebuild
new file mode 100644
index 000000000000..e2b975595f27
--- /dev/null
+++ b/app-emulation/libguestfs-appliance/libguestfs-appliance-1.28.1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+CHECKREQS_DISK_USR=500M
+CHECKREQS_DISK_BUILD=500M
+
+inherit check-reqs
+
+DESCRIPTION="VM appliance disk image used in libguestfs package"
+HOMEPAGE="http://libguestfs.org/"
+SRC_URI="http://libguestfs.org/download/binaries/appliance/appliance-${PV}.tar.xz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/xz-utils"
+# Mixing libguestfs versions causes weird problems. #501588
+RDEPEND="!<app-emulation/libguestfs-${PV}"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ # We'll unpack the tarball directly into ${D} to speed up install.
+ # Otherwise we need to duplicate hundreds of data.
+ :
+}
+
+src_install() {
+ dodir /usr/share/guestfs
+ cd "${ED}"/usr/share/guestfs
+ unpack ${A}
+ cd appliance || die
+ dodoc README*
+ rm README* || die
+ chmod 755 . || die
+ chmod 644 * || die
+
+ newenvd "${FILESDIR}"/env.file 99"${PN}"
+}
diff --git a/app-emulation/libguestfs-appliance/metadata.xml b/app-emulation/libguestfs-appliance/metadata.xml
new file mode 100644
index 000000000000..4b62b2824c99
--- /dev/null
+++ b/app-emulation/libguestfs-appliance/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>andreis.vinogradovs@gmail.com</email>
+ <name>Andreis Vinogradovs</name>
+</maintainer>
+<maintainer>
+ <email>maksbotan@gentoo.org</email>
+ <name>Maxim Koltsov</name>
+</maintainer>
+<maintainer>
+ <email>rich@annexia.org</email>
+ <name>Richard Jones</name>
+ <description>Upstream - please CC on bugs that concerns upstream</description>
+</maintainer>
+</pkgmetadata>
diff --git a/app-emulation/libguestfs/Manifest b/app-emulation/libguestfs/Manifest
new file mode 100644
index 000000000000..eb8017f6af39
--- /dev/null
+++ b/app-emulation/libguestfs/Manifest
@@ -0,0 +1,3 @@
+DIST libguestfs-1.26.1.tar.gz 11912359 SHA256 d047f951e79cc2f00b62a7e8d4e3acf18bb69c6be0a75884158923828b5264f6 SHA512 080a90d54b2063e2bf133c456a0624d63678cf7f80aa485dc5fd0c1d3577056c9fb894fd4fec67cbab29ac70f3b1c9ab070cf86ba5a09a8c8fc266f490c68809 WHIRLPOOL 54193361453d8d51da8070d0b4b5fe4e28fbf5e39aedbb3991c6f20876fed8a9f9c41218048dec697894d06d0edb29c887030edb38da899eb336278dd60ad974
+DIST libguestfs-1.28.3.tar.gz 12701662 SHA256 082ebcb14156198e73b3f64249d4a9fcf9811af53ba9b3e3dc85f9f853b39f6f SHA512 2b2324b90ea57c86749eed40f8384a4131a11f96f05eb4832762f30ca539fffc40bff5f848e751dec71ae95337833e69a7c3652aed1eda62c2092b2cb078862f WHIRLPOOL 77fecef7d1db6a65fa310cd47eaf9415e690468cb06cb5dffbb41fdab497444a24338c00011d3193637247aeb0b0776830b525abbb4e4146fc3d27aedb72ae22
+DIST libguestfs-1.28.5.tar.gz 12747537 SHA256 e9f38c6ad15cefe18b096a86334a60fc7df6367358f2641d8c5c5f3122ad9d91 SHA512 5ab25498fa9141950c1077cc52bae05a2781fa86a983b5fa49fbd4a4bca70710db3d4f7b9f45fb6f8b4ee8e3d77ffde7c4c0d9e9e526443e2a8251a62306ebb6 WHIRLPOOL cbbac5cce87dd41ad05b13732d0f5a3442c980152d8864522f5df47ffed7a260a131c819ceb40edd07cd74454fc9f4c0c7eb41fe734509a4e123d28bc58d813f
diff --git a/app-emulation/libguestfs/files/1.24/0001_add_gentoo_names_to_configure.patch b/app-emulation/libguestfs/files/1.24/0001_add_gentoo_names_to_configure.patch
new file mode 100644
index 000000000000..9d209ff53584
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.24/0001_add_gentoo_names_to_configure.patch
@@ -0,0 +1,15 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -482,6 +482,11 @@
+ DISTRO=UBUNTU
+ fi
+ fi
++
++if test -f /etc/gentoo-release; then
++ DISTRO=GENTOO
++fi
++
+ if test -f /etc/arch-release; then
+ DISTRO=ARCHLINUX
+ fi
diff --git a/app-emulation/libguestfs/files/1.24/0002_add_gentooway_to_remove_la_files.patch b/app-emulation/libguestfs/files/1.24/0002_add_gentooway_to_remove_la_files.patch
new file mode 100644
index 000000000000..38a591b811ed
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.24/0002_add_gentooway_to_remove_la_files.patch
@@ -0,0 +1,16 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1487,8 +1487,10 @@
+
+ dnl Replace libtool with a wrapper that clobbers dependency_libs in *.la files
+ dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html
+-LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
+-AC_SUBST([LIBTOOL])
++dnl LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
++dnl AC_SUBST([LIBTOOL])
++LT_INIT
++
+
+ dnl Produce output files.
+ AC_CONFIG_HEADERS([config.h])
diff --git a/app-emulation/libguestfs/files/1.24/0004_add_icoutils_configure_drop_automagic.patch b/app-emulation/libguestfs/files/1.24/0004_add_icoutils_configure_drop_automagic.patch
new file mode 100644
index 000000000000..ecaaa97afc4e
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.24/0004_add_icoutils_configure_drop_automagic.patch
@@ -0,0 +1,57 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -621,28 +621,36 @@
+ fi
+
+ dnl Check for netpbm programs (optional).
+-AC_CHECK_PROGS([PBMTEXT],[pbmtext],[no])
+-AC_CHECK_PROGS([PNMTOPNG],[pnmtopng],[no])
+-AC_CHECK_PROGS([BMPTOPNM],[bmptopnm],[no])
+-AC_CHECK_PROGS([PAMCUT],[pamcut],[no])
+-if test "x$PBMTEXT" != "xno"; then
+- AC_DEFINE_UNQUOTED([PBMTEXT],["$PBMTEXT"],[Name of pbmtext program.])
+-fi
+-if test "x$PNMTOPNG" != "xno"; then
+- AC_DEFINE_UNQUOTED([PNMTOPNG],["$PNMTOPNG"],[Name of pnmtopng program.])
+-fi
+-if test "x$BMPTOPNM" != "xno"; then
+- AC_DEFINE_UNQUOTED([BMPTOPNM],["$BMPTOPNM"],[Name of bmptopnm program.])
+-fi
+-if test "x$PAMCUT" != "xno"; then
+- AC_DEFINE_UNQUOTED([PAMCUT],["$PAMCUT"],[Name of pamcut program.])
+-fi
++AC_ARG_ENABLE([icoutils],
++ AS_HELP_STRING([with-icoutils], [ Enable ico and bmp icon file inspection]),
++ [enable_icoutils=no],
++ [enable_icoutils=yes])
++AS_IF([test "enable_icoutils" != "xno"],
++ [
++ AC_CHECK_PROGS([PBMTEXT],[pbmtext],[no])
++ AC_CHECK_PROGS([PNMTOPNG],[pnmtopng],[no])
++ AC_CHECK_PROGS([BMPTOPNM],[bmptopnm],[no])
++ AC_CHECK_PROGS([PAMCUT],[pamcut],[no])
++ if test "x$PBMTEXT" != "xno"; then
++ AC_DEFINE_UNQUOTED([PBMTEXT],["$PBMTEXT"],[Name of pbmtext program.])
++ fi
++ if test "x$PNMTOPNG" != "xno"; then
++ AC_DEFINE_UNQUOTED([PNMTOPNG],["$PNMTOPNG"],[Name of pnmtopng program.])
++ fi
++ if test "x$BMPTOPNM" != "xno"; then
++ AC_DEFINE_UNQUOTED([BMPTOPNM],["$BMPTOPNM"],[Name of bmptopnm program.])
++ fi
++ if test "x$PAMCUT" != "xno"; then
++ AC_DEFINE_UNQUOTED([PAMCUT],["$PAMCUT"],[Name of pamcut program.])
++ fi
+
+ dnl Check for icoutils (optional).
+ AC_CHECK_PROGS([WRESTOOL],[wrestool],[no])
+ if test "x$WRESTOOL" != "xno"; then
+- AC_DEFINE_UNQUOTED([WRESTOOL],["$WRESTOOL"],[Name of wrestool program.])
++ AC_DEFINE_UNQUOTED([WRESTOOL],["$WRESTOOL"],[Name of wrestool program.])
+ fi
++],
++[])
+
+ dnl Check for QEMU for running binaries on this $host_cpu, fall
+ dnl back to basic 'qemu'. Allow the user to override it.
diff --git a/app-emulation/libguestfs/files/1.24/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch b/app-emulation/libguestfs/files/1.24/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch
new file mode 100644
index 000000000000..69b3ae6d0d2d
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.24/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch
@@ -0,0 +1,21 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1491,11 +1491,12 @@
+ ])
+
+ # check for gtk-doc
+-m4_ifdef([GTK_DOC_CHECK], [
+- GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+-],[
+- AM_CONDITIONAL([ENABLE_GTK_DOC], false)
+-])
++#m4_ifdef([GTK_DOC_CHECK], [
++# GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
++#],[
++# AM_CONDITIONAL([ENABLE_GTK_DOC], false)
++#])
++GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+
+ dnl Library versioning.
+ MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
diff --git a/app-emulation/libguestfs/files/1.24/0103_disable_php_bindings_makefile.patch b/app-emulation/libguestfs/files/1.24/0103_disable_php_bindings_makefile.patch
new file mode 100644
index 000000000000..34ab42d27903
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.24/0103_disable_php_bindings_makefile.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -88,9 +88,6 @@
+ if HAVE_HASKELL
+ SUBDIRS += haskell
+ endif
+-if HAVE_PHP
+-SUBDIRS += php
+-endif
+ if HAVE_ERLANG
+ SUBDIRS += erlang erlang/examples
+ endif
diff --git a/app-emulation/libguestfs/files/1.26/0000_bug_499150.patch b/app-emulation/libguestfs/files/1.26/0000_bug_499150.patch
new file mode 100644
index 000000000000..1e0f1a32185e
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.26/0000_bug_499150.patch
@@ -0,0 +1,10 @@
+--- a/configure.ac 2014-01-24 19:04:05.633056872 +0100
++++ b/configure.ac 2014-01-24 19:04:34.685691757 +0100
+@@ -24,6 +24,7 @@
+
+ AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
+ AC_CONFIG_AUX_DIR([build-aux])
++AM_GNU_GETTEXT_VERSION(0.18.3)
+
+ dnl Initialize automake. automake < 1.12 didn't have serial-tests and
+ dnl gives an error if it sees this, but for automake >= 1.13
diff --git a/app-emulation/libguestfs/files/1.26/0001_add_gentoo_names_to_configure.patch b/app-emulation/libguestfs/files/1.26/0001_add_gentoo_names_to_configure.patch
new file mode 100644
index 000000000000..9d209ff53584
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.26/0001_add_gentoo_names_to_configure.patch
@@ -0,0 +1,15 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -482,6 +482,11 @@
+ DISTRO=UBUNTU
+ fi
+ fi
++
++if test -f /etc/gentoo-release; then
++ DISTRO=GENTOO
++fi
++
+ if test -f /etc/arch-release; then
+ DISTRO=ARCHLINUX
+ fi
diff --git a/app-emulation/libguestfs/files/1.26/0002_add_gentooway_to_remove_la_files.patch b/app-emulation/libguestfs/files/1.26/0002_add_gentooway_to_remove_la_files.patch
new file mode 100644
index 000000000000..38a591b811ed
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.26/0002_add_gentooway_to_remove_la_files.patch
@@ -0,0 +1,16 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1487,8 +1487,10 @@
+
+ dnl Replace libtool with a wrapper that clobbers dependency_libs in *.la files
+ dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html
+-LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
+-AC_SUBST([LIBTOOL])
++dnl LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
++dnl AC_SUBST([LIBTOOL])
++LT_INIT
++
+
+ dnl Produce output files.
+ AC_CONFIG_HEADERS([config.h])
diff --git a/app-emulation/libguestfs/files/1.26/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch b/app-emulation/libguestfs/files/1.26/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch
new file mode 100644
index 000000000000..69b3ae6d0d2d
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.26/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch
@@ -0,0 +1,21 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1491,11 +1491,12 @@
+ ])
+
+ # check for gtk-doc
+-m4_ifdef([GTK_DOC_CHECK], [
+- GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+-],[
+- AM_CONDITIONAL([ENABLE_GTK_DOC], false)
+-])
++#m4_ifdef([GTK_DOC_CHECK], [
++# GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
++#],[
++# AM_CONDITIONAL([ENABLE_GTK_DOC], false)
++#])
++GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+
+ dnl Library versioning.
+ MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
diff --git a/app-emulation/libguestfs/files/1.26/0020_all_qemu_configure.patch b/app-emulation/libguestfs/files/1.26/0020_all_qemu_configure.patch
new file mode 100644
index 000000000000..77423f73e8c9
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.26/0020_all_qemu_configure.patch
@@ -0,0 +1,27 @@
+https://bugs.gentoo.org/528386
+
+From 101d728e80cce73b882aac7af457013491d03311 Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones@redhat.com>
+Date: Tue, 22 Apr 2014 22:21:57 -0400
+Subject: [PATCH] configure: Make sure grep matches qemu 2.x version string.
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 34e4ddb..bb1a361 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -777,7 +777,7 @@ working.
+ fi
+
+ AC_MSG_CHECKING([for $QEMU version >= 1])
+- if $QEMU -version | grep -sq 'version @<:@1-@:>@'; then
++ if $QEMU -version | grep -sq 'version @<:@1-9@:>@'; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+--
+2.1.3
+
diff --git a/app-emulation/libguestfs/files/1.26/0103_disable_php_bindings_makefile.patch b/app-emulation/libguestfs/files/1.26/0103_disable_php_bindings_makefile.patch
new file mode 100644
index 000000000000..34ab42d27903
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.26/0103_disable_php_bindings_makefile.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -88,9 +88,6 @@
+ if HAVE_HASKELL
+ SUBDIRS += haskell
+ endif
+-if HAVE_PHP
+-SUBDIRS += php
+-endif
+ if HAVE_ERLANG
+ SUBDIRS += erlang erlang/examples
+ endif
diff --git a/app-emulation/libguestfs/files/1.28/0000_bug_499150.patch b/app-emulation/libguestfs/files/1.28/0000_bug_499150.patch
new file mode 100644
index 000000000000..1e0f1a32185e
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.28/0000_bug_499150.patch
@@ -0,0 +1,10 @@
+--- a/configure.ac 2014-01-24 19:04:05.633056872 +0100
++++ b/configure.ac 2014-01-24 19:04:34.685691757 +0100
+@@ -24,6 +24,7 @@
+
+ AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
+ AC_CONFIG_AUX_DIR([build-aux])
++AM_GNU_GETTEXT_VERSION(0.18.3)
+
+ dnl Initialize automake. automake < 1.12 didn't have serial-tests and
+ dnl gives an error if it sees this, but for automake >= 1.13
diff --git a/app-emulation/libguestfs/files/1.28/0001_add_gentoo_names_to_configure.patch b/app-emulation/libguestfs/files/1.28/0001_add_gentoo_names_to_configure.patch
new file mode 100644
index 000000000000..9d209ff53584
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.28/0001_add_gentoo_names_to_configure.patch
@@ -0,0 +1,15 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -482,6 +482,11 @@
+ DISTRO=UBUNTU
+ fi
+ fi
++
++if test -f /etc/gentoo-release; then
++ DISTRO=GENTOO
++fi
++
+ if test -f /etc/arch-release; then
+ DISTRO=ARCHLINUX
+ fi
diff --git a/app-emulation/libguestfs/files/1.28/0002_add_gentooway_to_remove_la_files.patch b/app-emulation/libguestfs/files/1.28/0002_add_gentooway_to_remove_la_files.patch
new file mode 100644
index 000000000000..38a591b811ed
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.28/0002_add_gentooway_to_remove_la_files.patch
@@ -0,0 +1,16 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1487,8 +1487,10 @@
+
+ dnl Replace libtool with a wrapper that clobbers dependency_libs in *.la files
+ dnl http://lists.fedoraproject.org/pipermail/devel/2010-November/146343.html
+-LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
+-AC_SUBST([LIBTOOL])
++dnl LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libtool'
++dnl AC_SUBST([LIBTOOL])
++LT_INIT
++
+
+ dnl Produce output files.
+ AC_CONFIG_HEADERS([config.h])
diff --git a/app-emulation/libguestfs/files/1.28/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch b/app-emulation/libguestfs/files/1.28/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch
new file mode 100644
index 000000000000..69b3ae6d0d2d
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.28/0005_enable_gtk_docs_in_broken_autotools-utils-eclass.patch
@@ -0,0 +1,21 @@
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1491,11 +1491,12 @@
+ ])
+
+ # check for gtk-doc
+-m4_ifdef([GTK_DOC_CHECK], [
+- GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+-],[
+- AM_CONDITIONAL([ENABLE_GTK_DOC], false)
+-])
++#m4_ifdef([GTK_DOC_CHECK], [
++# GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
++#],[
++# AM_CONDITIONAL([ENABLE_GTK_DOC], false)
++#])
++GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+
+ dnl Library versioning.
+ MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
diff --git a/app-emulation/libguestfs/files/1.28/0103_disable_php_bindings_makefile.patch b/app-emulation/libguestfs/files/1.28/0103_disable_php_bindings_makefile.patch
new file mode 100644
index 000000000000..34ab42d27903
--- /dev/null
+++ b/app-emulation/libguestfs/files/1.28/0103_disable_php_bindings_makefile.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -88,9 +88,6 @@
+ if HAVE_HASKELL
+ SUBDIRS += haskell
+ endif
+-if HAVE_PHP
+-SUBDIRS += php
+-endif
+ if HAVE_ERLANG
+ SUBDIRS += erlang erlang/examples
+ endif
diff --git a/app-emulation/libguestfs/files/env.file b/app-emulation/libguestfs/files/env.file
new file mode 100644
index 000000000000..577009eebf8f
--- /dev/null
+++ b/app-emulation/libguestfs/files/env.file
@@ -0,0 +1 @@
+LIBGUESTFS_PATH=/usr/share/guestfs/appliance/
diff --git a/app-emulation/libguestfs/libguestfs-1.26.1.ebuild b/app-emulation/libguestfs/libguestfs-1.26.1.ebuild
new file mode 100644
index 000000000000..8b4cfb6578ca
--- /dev/null
+++ b/app-emulation/libguestfs/libguestfs-1.26.1.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+WANT_LIBTOOL=latest
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils autotools versionator eutils \
+multilib linux-info perl-module base
+
+MY_PV_1="$(get_version_component_range 1-2)"
+MY_PV_2="$(get_version_component_range 2)"
+
+[[ $(( $(get_version_component_range 2) % 2 )) -eq 0 ]] && SD="stable" || SD="development"
+
+DESCRIPTION="Tools for accessing, inspect and modifying virtual machine (VM) disk images"
+HOMEPAGE="http://libguestfs.org/"
+SRC_URI="http://libguestfs.org/download/${MY_PV_1}-${SD}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0/${MY_PV_1}"
+
+KEYWORDS="~amd64"
+IUSE="erlang +fuse debug +ocaml doc +perl ruby static-libs
+selinux systemtap introspection inspect-icons test lua"
+
+# Failires - doc
+# Failures - bash-completion, see GBZ #486306
+
+COMMON_DEPEND="
+ sys-libs/ncurses
+ sys-devel/gettext
+ >=app-misc/hivex-1.3.1
+ dev-libs/libpcre
+ app-arch/cpio
+ dev-lang/perl
+ app-cdr/cdrkit
+ >=app-emulation/qemu-1.2.2[qemu_user_targets_x86_64,qemu_softmmu_targets_x86_64,tci,systemtap?,selinux?,filecaps]
+ sys-apps/fakeroot
+ sys-apps/file
+ app-emulation/libvirt
+ dev-libs/libxml2:2
+ >=sys-apps/fakechroot-2.8
+ >=app-admin/augeas-1.0.0
+ sys-fs/squashfs-tools
+ dev-libs/libconfig
+ dev-libs/libpcre
+ sys-libs/readline
+ >=sys-libs/db-4.6
+ perl? ( virtual/perl-ExtUtils-MakeMaker
+ >=dev-perl/Sys-Virt-0.2.4
+ virtual/perl-Getopt-Long
+ virtual/perl-Data-Dumper
+ dev-perl/libintl-perl
+ >=app-misc/hivex-1.3.1[perl?]
+ dev-perl/String-ShellQuote
+ )
+ fuse? ( sys-fs/fuse )
+ introspection? (
+ >=dev-libs/gobject-introspection-1.30.0
+ dev-libs/gjs
+ )
+ selinux? ( sys-libs/libselinux sys-libs/libsemanage )
+ systemtap? ( dev-util/systemtap )
+ ocaml? ( dev-lang/ocaml[ocamlopt]
+ dev-ml/findlib[ocamlopt]
+ dev-ml/ocaml-gettext
+ )
+ erlang? ( dev-lang/erlang )
+ inspect-icons? ( media-libs/netpbm
+ media-gfx/icoutils
+ )
+ virtual/acl
+ sys-libs/libcap
+ lua? ( dev-lang/lua )
+ "
+
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ doc? ( app-text/po4a )
+ ruby? ( dev-lang/ruby virtual/rubygems dev-ruby/rake )
+ "
+RDEPEND="${COMMON_DEPEND}
+ app-emulation/libguestfs-appliance
+ "
+
+PATCHES=( "${FILESDIR}/${MY_PV_1}"/*.patch )
+
+DOCS=( AUTHORS BUGS ChangeLog HACKING README TODO )
+
+pkg_setup () {
+ CONFIG_CHECK="~KVM ~VIRTIO"
+ [ -n "${CONFIG_CHECK}" ] && check_extra_config;
+}
+
+src_prepare() {
+ base_src_prepare
+ eaclocal
+ eautomake
+ eautoconf
+}
+
+src_configure() {
+
+ # Disable feature test for kvm for more reason
+ # i.e: not loaded module in __build__ time,
+ # build server not supported kvm, etc. ...
+ #
+ # In fact, this feature is virtio support and requires
+ # configured kernel.
+ export vmchannel_test=no
+
+ local myeconfargs=(
+ $(use_enable test gcc-warnings)
+ --disable-appliance
+ --disable-daemon
+ --with-extra="-gentoo"
+ --with-readline
+ --disable-php
+ --disable-python
+ --without-java
+ $(use_enable perl)
+ $(use_enable fuse)
+ $(use_enable ocaml)
+ $(use_enable ruby)
+ --disable-haskell
+ $(use_enable introspection gobject)
+ $(use_enable erlang)
+ $(use_enable systemtap probes)
+ $(use_enable lua)
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+}
+
+src_test() {
+ autotools-utils_src_test
+}
+
+src_install() {
+ strip-linguas -i po
+ autotools-utils_src_install "LINGUAS=""${LINGUAS}"""
+
+ use perl && perl_delete_localpod
+}
+
+pkg_postinst() {
+
+ if ! use perl ; then
+ einfo "Perl based tools NOT build"
+ fi
+ if ! use ocaml ; then
+ einfo "Ocaml based tools ( sysprep , ... ) NOT installed"
+ fi
+}
diff --git a/app-emulation/libguestfs/libguestfs-1.28.3.ebuild b/app-emulation/libguestfs/libguestfs-1.28.3.ebuild
new file mode 100644
index 000000000000..9c5b2a69e548
--- /dev/null
+++ b/app-emulation/libguestfs/libguestfs-1.28.3.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+WANT_LIBTOOL=latest
+WANT_AUTOMAKE=1.14
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils autotools versionator eutils \
+multilib linux-info perl-module base
+
+MY_PV_1="$(get_version_component_range 1-2)"
+MY_PV_2="$(get_version_component_range 2)"
+[[ $(( $(get_version_component_range 2) % 2 )) -eq 0 ]] && SD="stable" || SD="development"
+
+DESCRIPTION="Tools for accessing, inspect and modifying virtual machine (VM) disk images"
+HOMEPAGE="http://libguestfs.org/"
+SRC_URI="http://libguestfs.org/download/${MY_PV_1}-${SD}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0/"${MY_PV_1}""
+
+KEYWORDS="~amd64"
+IUSE="bash-completion erlang +fuse debug ocaml doc +perl ruby static-libs
+selinux systemtap introspection inspect-icons test lua"
+
+# Failires - doc
+# Failures - bash-completion, see GBZ #486306
+
+COMMON_DEPEND="
+ sys-libs/ncurses
+ sys-devel/gettext
+ >=app-misc/hivex-1.3.1
+ dev-libs/libpcre
+ app-arch/cpio
+ dev-lang/perl
+ app-cdr/cdrkit
+ >=app-emulation/qemu-2.0[qemu_softmmu_targets_x86_64,systemtap?,selinux?,filecaps]
+ sys-apps/fakeroot
+ sys-apps/file
+ app-emulation/libvirt
+ dev-libs/libxml2:2
+ >=sys-apps/fakechroot-2.8
+ >=app-admin/augeas-1.0.0
+ sys-fs/squashfs-tools
+ dev-libs/libconfig
+ dev-libs/libpcre
+ sys-libs/readline
+ >=sys-libs/db-4.6
+ app-arch/xz-utils
+ app-arch/lzma
+ app-crypt/gnupg
+ app-arch/unzip[natspec]
+ perl? ( virtual/perl-ExtUtils-MakeMaker
+ >=dev-perl/Sys-Virt-0.2.4
+ virtual/perl-Getopt-Long
+ virtual/perl-Data-Dumper
+ dev-perl/libintl-perl
+ >=app-misc/hivex-1.3.1[perl?]
+ dev-perl/String-ShellQuote
+ )
+ fuse? ( sys-fs/fuse )
+ introspection? (
+ >=dev-libs/gobject-introspection-1.30.0
+ dev-libs/gjs
+ )
+ selinux? ( sys-libs/libselinux sys-libs/libsemanage )
+ systemtap? ( dev-util/systemtap )
+ ocaml? ( dev-lang/ocaml[ocamlopt]
+ dev-ml/findlib[ocamlopt]
+ dev-ml/ocaml-gettext
+ )
+ erlang? ( dev-lang/erlang )
+ inspect-icons? ( media-libs/netpbm
+ media-gfx/icoutils
+ )
+ virtual/acl
+ sys-libs/libcap
+ lua? ( dev-lang/lua )
+ >=app-shells/bash-completion-2.0
+ dev-libs/yajl"
+
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ doc? ( app-text/po4a )
+ ruby? ( dev-lang/ruby virtual/rubygems dev-ruby/rake )
+ ${AUTOTOOLS_DEPEND}
+ "
+RDEPEND="${COMMON_DEPEND}
+ app-emulation/libguestfs-appliance
+ "
+
+PATCHES=( "${FILESDIR}/${MY_PV_1}"/*.patch )
+
+DOCS=( AUTHORS BUGS ChangeLog HACKING README TODO )
+
+pkg_setup () {
+ CONFIG_CHECK="~KVM ~VIRTIO"
+ [ -n "${CONFIG_CHECK}" ] && check_extra_config;
+}
+
+src_prepare() {
+ base_src_prepare
+ eaclocal
+ eautomake
+ eautoconf
+}
+
+src_configure() {
+
+ # Disable feature test for kvm for more reason
+ # i.e: not loaded module in __build__ time,
+ # build server not supported kvm, etc. ...
+ #
+ # In fact, this feature is virtio support and requires
+ # configured kernel.
+ export vmchannel_test=no
+
+ local myeconfargs=(
+ $(use_enable test werror)
+ --with-libvirt
+ --with-default-backend=libvirt
+ --disable-appliance
+ --disable-daemon
+ --with-extra="-gentoo"
+ --with-readline
+ --disable-php
+ --disable-python
+ --without-java
+ $(use_enable perl)
+ $(use_enable fuse)
+ $(use_enable ocaml)
+ $(use_enable ruby)
+ --disable-haskell
+ --disable-golang
+ $(use_enable introspection gobject)
+ $(use_enable erlang)
+ $(use_enable systemtap probes)
+ $(use_enable lua)
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+}
+
+src_test() {
+ autotools-utils_src_test
+}
+
+src_install() {
+ strip-linguas -i po
+ autotools-utils_src_install "LINGUAS=""${LINGUAS}"""
+
+ use perl && perl_delete_localpod
+}
+
+pkg_postinst() {
+
+ if ! use perl ; then
+ einfo "Perl based tools NOT build"
+ fi
+ if ! use ocaml ; then
+ einfo "Ocaml based tools ( sysprep , ... ) NOT installed"
+ fi
+}
diff --git a/app-emulation/libguestfs/libguestfs-1.28.5-r1.ebuild b/app-emulation/libguestfs/libguestfs-1.28.5-r1.ebuild
new file mode 100644
index 000000000000..5bb0d51726c3
--- /dev/null
+++ b/app-emulation/libguestfs/libguestfs-1.28.5-r1.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+WANT_LIBTOOL=latest
+WANT_AUTOMAKE=1.14
+AUTOTOOLS_IN_SOURCE_BUILD=1
+PYTHON_COMPAT=( python{2_7,3_{3,4}} )
+
+inherit python-single-r1 autotools-utils autotools versionator eutils \
+multilib linux-info perl-module base
+
+MY_PV_1="$(get_version_component_range 1-2)"
+MY_PV_2="$(get_version_component_range 2)"
+[[ $(( $(get_version_component_range 2) % 2 )) -eq 0 ]] && SD="stable" || SD="development"
+
+DESCRIPTION="Tools for accessing, inspect and modifying virtual machine (VM) disk images"
+HOMEPAGE="http://libguestfs.org/"
+SRC_URI="http://libguestfs.org/download/${MY_PV_1}-${SD}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0/"${MY_PV_1}""
+
+KEYWORDS="~amd64"
+IUSE="bash-completion erlang +fuse debug ocaml doc +perl python ruby static-libs
+selinux systemtap introspection inspect-icons test lua"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+# Failures - doc
+# Failures - bash-completion, see GBZ #486306
+
+COMMON_DEPEND="
+ sys-libs/ncurses
+ sys-devel/gettext
+ >=app-misc/hivex-1.3.1
+ dev-libs/libpcre
+ app-arch/cpio
+ dev-lang/perl
+ app-cdr/cdrkit
+ >=app-emulation/qemu-2.0[qemu_softmmu_targets_x86_64,systemtap?,selinux?,filecaps]
+ sys-apps/fakeroot
+ sys-apps/file
+ app-emulation/libvirt
+ dev-libs/libxml2:2
+ >=sys-apps/fakechroot-2.8
+ >=app-admin/augeas-1.0.0
+ sys-fs/squashfs-tools:*
+ dev-libs/libconfig
+ dev-libs/libpcre
+ sys-libs/readline:=
+ >=sys-libs/db-4.6:*
+ app-arch/xz-utils
+ app-arch/lzma
+ app-crypt/gnupg
+ app-arch/unzip[natspec]
+ perl? ( virtual/perl-ExtUtils-MakeMaker
+ >=dev-perl/Sys-Virt-0.2.4
+ virtual/perl-Getopt-Long
+ virtual/perl-Data-Dumper
+ dev-perl/libintl-perl
+ >=app-misc/hivex-1.3.1[perl?]
+ dev-perl/String-ShellQuote
+ )
+ python? ( ${PYTHON_DEPS} )
+ fuse? ( sys-fs/fuse )
+ introspection? (
+ >=dev-libs/gobject-introspection-1.30.0
+ dev-libs/gjs
+ )
+ selinux? ( sys-libs/libselinux sys-libs/libsemanage )
+ systemtap? ( dev-util/systemtap )
+ ocaml? ( dev-lang/ocaml[ocamlopt]
+ dev-ml/findlib[ocamlopt]
+ dev-ml/ocaml-gettext
+ )
+ erlang? ( dev-lang/erlang )
+ inspect-icons? ( media-libs/netpbm
+ media-gfx/icoutils
+ )
+ virtual/acl
+ sys-libs/libcap
+ lua? ( dev-lang/lua:* )
+ >=app-shells/bash-completion-2.0
+ dev-libs/yajl"
+
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ doc? ( app-text/po4a )
+ ruby? ( dev-lang/ruby virtual/rubygems dev-ruby/rake )
+ ${AUTOTOOLS_DEPEND}
+ "
+RDEPEND="${COMMON_DEPEND}
+ app-emulation/libguestfs-appliance
+ "
+
+PATCHES=( "${FILESDIR}/${MY_PV_1}"/*.patch )
+
+DOCS=( AUTHORS BUGS ChangeLog HACKING README TODO )
+
+pkg_setup () {
+ CONFIG_CHECK="~KVM ~VIRTIO"
+ [ -n "${CONFIG_CHECK}" ] && check_extra_config;
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ base_src_prepare
+ eaclocal
+ eautomake
+ eautoconf
+}
+
+src_configure() {
+
+ # Disable feature test for kvm for more reason
+ # i.e: not loaded module in __build__ time,
+ # build server not supported kvm, etc. ...
+ #
+ # In fact, this feature is virtio support and requires
+ # configured kernel.
+ export vmchannel_test=no
+
+ local myeconfargs=(
+ $(use_enable test werror)
+ --with-libvirt
+ --with-default-backend=libvirt
+ --disable-appliance
+ --disable-daemon
+ --with-extra="-gentoo"
+ --with-readline
+ --disable-php
+ $(use_enable python)
+ --without-java
+ $(use_enable perl)
+ $(use_enable fuse)
+ $(use_enable ocaml)
+ $(use_enable ruby)
+ --disable-haskell
+ --disable-golang
+ $(use_enable introspection gobject)
+ $(use_enable erlang)
+ $(use_enable systemtap probes)
+ $(use_enable lua)
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+}
+
+src_test() {
+ autotools-utils_src_test
+}
+
+src_install() {
+ strip-linguas -i po
+ autotools-utils_src_install "LINGUAS=""${LINGUAS}"""
+
+ use perl && perl_delete_localpod
+}
+
+pkg_postinst() {
+
+ if ! use perl ; then
+ einfo "Perl based tools NOT build"
+ fi
+ if ! use ocaml ; then
+ einfo "Ocaml based tools ( sysprep , ... ) NOT installed"
+ fi
+}
diff --git a/app-emulation/libguestfs/libguestfs-1.28.5.ebuild b/app-emulation/libguestfs/libguestfs-1.28.5.ebuild
new file mode 100644
index 000000000000..9c5b2a69e548
--- /dev/null
+++ b/app-emulation/libguestfs/libguestfs-1.28.5.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+WANT_LIBTOOL=latest
+WANT_AUTOMAKE=1.14
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils autotools versionator eutils \
+multilib linux-info perl-module base
+
+MY_PV_1="$(get_version_component_range 1-2)"
+MY_PV_2="$(get_version_component_range 2)"
+[[ $(( $(get_version_component_range 2) % 2 )) -eq 0 ]] && SD="stable" || SD="development"
+
+DESCRIPTION="Tools for accessing, inspect and modifying virtual machine (VM) disk images"
+HOMEPAGE="http://libguestfs.org/"
+SRC_URI="http://libguestfs.org/download/${MY_PV_1}-${SD}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0/"${MY_PV_1}""
+
+KEYWORDS="~amd64"
+IUSE="bash-completion erlang +fuse debug ocaml doc +perl ruby static-libs
+selinux systemtap introspection inspect-icons test lua"
+
+# Failires - doc
+# Failures - bash-completion, see GBZ #486306
+
+COMMON_DEPEND="
+ sys-libs/ncurses
+ sys-devel/gettext
+ >=app-misc/hivex-1.3.1
+ dev-libs/libpcre
+ app-arch/cpio
+ dev-lang/perl
+ app-cdr/cdrkit
+ >=app-emulation/qemu-2.0[qemu_softmmu_targets_x86_64,systemtap?,selinux?,filecaps]
+ sys-apps/fakeroot
+ sys-apps/file
+ app-emulation/libvirt
+ dev-libs/libxml2:2
+ >=sys-apps/fakechroot-2.8
+ >=app-admin/augeas-1.0.0
+ sys-fs/squashfs-tools
+ dev-libs/libconfig
+ dev-libs/libpcre
+ sys-libs/readline
+ >=sys-libs/db-4.6
+ app-arch/xz-utils
+ app-arch/lzma
+ app-crypt/gnupg
+ app-arch/unzip[natspec]
+ perl? ( virtual/perl-ExtUtils-MakeMaker
+ >=dev-perl/Sys-Virt-0.2.4
+ virtual/perl-Getopt-Long
+ virtual/perl-Data-Dumper
+ dev-perl/libintl-perl
+ >=app-misc/hivex-1.3.1[perl?]
+ dev-perl/String-ShellQuote
+ )
+ fuse? ( sys-fs/fuse )
+ introspection? (
+ >=dev-libs/gobject-introspection-1.30.0
+ dev-libs/gjs
+ )
+ selinux? ( sys-libs/libselinux sys-libs/libsemanage )
+ systemtap? ( dev-util/systemtap )
+ ocaml? ( dev-lang/ocaml[ocamlopt]
+ dev-ml/findlib[ocamlopt]
+ dev-ml/ocaml-gettext
+ )
+ erlang? ( dev-lang/erlang )
+ inspect-icons? ( media-libs/netpbm
+ media-gfx/icoutils
+ )
+ virtual/acl
+ sys-libs/libcap
+ lua? ( dev-lang/lua )
+ >=app-shells/bash-completion-2.0
+ dev-libs/yajl"
+
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ doc? ( app-text/po4a )
+ ruby? ( dev-lang/ruby virtual/rubygems dev-ruby/rake )
+ ${AUTOTOOLS_DEPEND}
+ "
+RDEPEND="${COMMON_DEPEND}
+ app-emulation/libguestfs-appliance
+ "
+
+PATCHES=( "${FILESDIR}/${MY_PV_1}"/*.patch )
+
+DOCS=( AUTHORS BUGS ChangeLog HACKING README TODO )
+
+pkg_setup () {
+ CONFIG_CHECK="~KVM ~VIRTIO"
+ [ -n "${CONFIG_CHECK}" ] && check_extra_config;
+}
+
+src_prepare() {
+ base_src_prepare
+ eaclocal
+ eautomake
+ eautoconf
+}
+
+src_configure() {
+
+ # Disable feature test for kvm for more reason
+ # i.e: not loaded module in __build__ time,
+ # build server not supported kvm, etc. ...
+ #
+ # In fact, this feature is virtio support and requires
+ # configured kernel.
+ export vmchannel_test=no
+
+ local myeconfargs=(
+ $(use_enable test werror)
+ --with-libvirt
+ --with-default-backend=libvirt
+ --disable-appliance
+ --disable-daemon
+ --with-extra="-gentoo"
+ --with-readline
+ --disable-php
+ --disable-python
+ --without-java
+ $(use_enable perl)
+ $(use_enable fuse)
+ $(use_enable ocaml)
+ $(use_enable ruby)
+ --disable-haskell
+ --disable-golang
+ $(use_enable introspection gobject)
+ $(use_enable erlang)
+ $(use_enable systemtap probes)
+ $(use_enable lua)
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+}
+
+src_test() {
+ autotools-utils_src_test
+}
+
+src_install() {
+ strip-linguas -i po
+ autotools-utils_src_install "LINGUAS=""${LINGUAS}"""
+
+ use perl && perl_delete_localpod
+}
+
+pkg_postinst() {
+
+ if ! use perl ; then
+ einfo "Perl based tools NOT build"
+ fi
+ if ! use ocaml ; then
+ einfo "Ocaml based tools ( sysprep , ... ) NOT installed"
+ fi
+}
diff --git a/app-emulation/libguestfs/metadata.xml b/app-emulation/libguestfs/metadata.xml
new file mode 100644
index 000000000000..c9f268cb4b4b
--- /dev/null
+++ b/app-emulation/libguestfs/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>andreis.vinogradovs@gmail.com</email>
+ <name>Andreis Vinogradovs</name>
+</maintainer>
+<maintainer>
+ <email>maksbotan@gentoo.org</email>
+ <name>Maxim Koltsov</name>
+</maintainer>
+<maintainer>
+ <email>rich@annexia.org</email>
+ <name>Richard Jones</name>
+ <description>Upstream - please CC on bugs that concerns upstream</description>
+</maintainer>
+
+<longdescription>Libguestfs is a library and tool set for accessing and
+modifying virtual machine (VM) disk images</longdescription>
+<use>
+ <flag name="fuse">Enable image mount support via fuse</flag>
+ <flag name="introspection">Use <pkg>dev-libs/gobject-introspection</pkg> for introspection</flag>
+ <flag name="erlang">Build Erlang bindings</flag>
+ <flag name="systemtap">Use <pkg>dev-util/systemtap</pkg> to inspect VM via "probes" way</flag>
+ <flag name="inspect-icons">Use <pkg>media-gfx/icoutils</pkg>for acces icon file in image and inspect it</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/libspectrum/Manifest b/app-emulation/libspectrum/Manifest
new file mode 100644
index 000000000000..44fd1be27e99
--- /dev/null
+++ b/app-emulation/libspectrum/Manifest
@@ -0,0 +1,2 @@
+DIST libspectrum-1.0.0.tar.gz 462552 SHA256 cdf8f5006676c0f68939e331eeadeda5d608d777f1234b080b97f677f1dd287c SHA512 1ed3e36e9d62d69b470e959509d2a56e5a3608a9ea9f3f6f0ddd78e4f5f4a75da957e4120a0ffdf6366c3e90e148de9d83954fc711414389687e55bbc91f1bc8 WHIRLPOOL bf245f20181c82bae9e985e230729c3f341134f84239d82133231b2de5d8fe61533a1e11a9004b6d5a0971bdd97622ba453912522c66292b82715a5a937d351b
+DIST libspectrum-1.1.1.tar.gz 502942 SHA256 178d3607af2109b6b8dafac4f91912745b9f3c087319945c3a886bb7fe7989d5 SHA512 61197c8d1d6b4b595b55cf7e8f8c43423935291a9fbc688f1bb06d4c3ef53dbcf391a96f0528443518c2ca2d6fe187ee56d5ed915702f13a16ad44aa16037f49 WHIRLPOOL c89c7c3183f9d960dcedf789c763687e66cdaea1b2c41fdd41c1f1b0484cc9039790415bf8f231ff2bea0914fe2ababfd6d174338141bee13859521bf73caa92
diff --git a/app-emulation/libspectrum/libspectrum-1.0.0.ebuild b/app-emulation/libspectrum/libspectrum-1.0.0.ebuild
new file mode 100644
index 000000000000..a0455acbd775
--- /dev/null
+++ b/app-emulation/libspectrum/libspectrum-1.0.0.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+DESCRIPTION="Spectrum emulation library"
+HOMEPAGE="http://fuse-emulator.sourceforge.net/libspectrum.php"
+SRC_URI="mirror://sourceforge/fuse-emulator/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="audiofile bzip2 gcrypt zlib"
+
+RDEPEND="zlib? ( sys-libs/zlib )
+ bzip2? ( >=app-arch/bzip2-1.0 )
+ >=dev-libs/glib-2
+ gcrypt? ( dev-libs/libgcrypt:0 )
+ audiofile? ( >=media-libs/audiofile-0.2.3 )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ virtual/pkgconfig"
+
+src_configure() {
+ econf --with-glib \
+ $(use_with zlib zlib) \
+ $(use_with bzip2 bzip2) \
+ $(use_with audiofile libaudiofile) \
+ $(use_with gcrypt libgcrypt) \
+ || die "econf failed!"
+}
+
+src_compile() {
+ emake || die "Compilation failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "Make install failed"
+ dodoc AUTHORS ChangeLog README THANKS doc/*.txt *.txt
+ doman doc/libspectrum.3
+}
diff --git a/app-emulation/libspectrum/libspectrum-1.1.1.ebuild b/app-emulation/libspectrum/libspectrum-1.1.1.ebuild
new file mode 100644
index 000000000000..509cc383833a
--- /dev/null
+++ b/app-emulation/libspectrum/libspectrum-1.1.1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="Spectrum emulation library"
+HOMEPAGE="http://fuse-emulator.sourceforge.net/libspectrum.php"
+SRC_URI="mirror://sourceforge/fuse-emulator/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="audiofile bzip2 gcrypt zlib"
+
+RDEPEND="zlib? ( sys-libs/zlib )
+ bzip2? ( >=app-arch/bzip2-1.0 )
+ >=dev-libs/glib-2
+ gcrypt? ( dev-libs/libgcrypt:0 )
+ audiofile? ( >=media-libs/audiofile-0.2.3 )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ virtual/pkgconfig"
+
+src_configure() {
+ econf --with-glib \
+ $(use_with zlib zlib) \
+ $(use_with bzip2 bzip2) \
+ $(use_with audiofile libaudiofile) \
+ $(use_with gcrypt libgcrypt) \
+ || die "econf failed!"
+}
+
+src_compile() {
+ emake || die "Compilation failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "Make install failed"
+ dodoc AUTHORS ChangeLog README THANKS doc/*.txt *.txt
+ doman doc/libspectrum.3
+}
diff --git a/app-emulation/libspectrum/metadata.xml b/app-emulation/libspectrum/metadata.xml
new file mode 100644
index 000000000000..1995e4955b86
--- /dev/null
+++ b/app-emulation/libspectrum/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>neurogeek@gentoo.org</email>
+ <name>Jesus Rivero</name>
+ <description>Proxy Maintainer</description>
+ </maintainer>
+ <maintainer>
+ <email>jmfo1982@yahoo.es</email>
+ <description>Proxied Maintainer. Please CC on bugs.</description>
+ <name>José Manuel Ferrer Ortiz</name>
+ </maintainer>
+ <longdescription>
+libspectrum is a library designed to make the input and output of some ZX
+Spectrum emulator files slightly easier. It is intended to be usable on Unix
+variants, Win32 and Mac OS X. Currently, it is mainly (only?) used by Fuse,
+but other Spectrum emulator and utility authors are encouraged to use it.
+</longdescription>
+ <use>
+ <flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> for low-level crypto of some
+ features, including logfiles.</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">fuse-emulator</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/libvirt-glib/Manifest b/app-emulation/libvirt-glib/Manifest
new file mode 100644
index 000000000000..d7bb12e00452
--- /dev/null
+++ b/app-emulation/libvirt-glib/Manifest
@@ -0,0 +1,2 @@
+DIST libvirt-glib-0.2.0.tar.gz 836245 SHA256 30b7e0f224f9cdcf34c1b05b08803cb617d057613ee96395ae517f4ee6c44a0b SHA512 23b698fe297247dd5ce06d9e37eed2025064ab76a52f008cb89cd835364a52c8fe60ae535f68e67fb6c3454d41328dd77c392efd594a3fb1a237d1beb25d19ae WHIRLPOOL 6ef50cc740fa1b43dafc4666ac221bb57312dd937ee693bd12e582e3cec784a5c7a5d22e3c15cc369ac0a24ae26ce64edc69d2c4b55fc2ea83a8e350bc8003ab
+DIST libvirt-glib-0.2.1.tar.gz 844657 SHA256 d856d37b708bc8bf9e6ac294edca7a53f2baa6d857c6f5859be58517a714a2fb SHA512 bd38b5c415f65bd6e8824d419c787afdd43aa322f03045f517f9bae88575de1a0975f0340b24bf776421eeb54632227d798e801a1611ce932878ad7bace3adfb WHIRLPOOL 99408b22553d8b4bea5df75750aea2339800ad45b7497eae1afdc79e11be256f0e79d29fe879ef4bc8992817178850058ee361fa4ac5a4b2213f09a6fa825cb2
diff --git a/app-emulation/libvirt-glib/libvirt-glib-0.2.0.ebuild b/app-emulation/libvirt-glib/libvirt-glib-0.2.0.ebuild
new file mode 100644
index 000000000000..1bde31326955
--- /dev/null
+++ b/app-emulation/libvirt-glib/libvirt-glib-0.2.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+GCONF_DEBUG="no"
+GNOME2_LA_PUNT="yes"
+VALA_MIN_API_VERSION="0.14"
+PYTHON_COMPAT=( python2_7 )
+
+inherit gnome2 python-single-r1 vala
+
+DESCRIPTION="GLib and GObject mappings for libvirt"
+HOMEPAGE="http://libvirt.org/git/?p=libvirt-glib.git"
+SRC_URI="ftp://libvirt.org/libvirt/glib/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="+introspection python +vala"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ vala? ( introspection )
+"
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=1093633
+RESTRICT="test"
+
+RDEPEND="
+ dev-libs/libxml2:2
+ >=app-emulation/libvirt-0.9.10:=
+ >=dev-libs/glib-2.38.0:2
+ introspection? ( >=dev-libs/gobject-introspection-0.10.8:= )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}
+ dev-util/gtk-doc-am
+ >=dev-util/intltool-0.35.0
+ virtual/pkgconfig
+ vala? ( $(vala_depend) )
+"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_configure() {
+ gnome2_src_configure \
+ --disable-test-coverage \
+ --disable-static \
+ $(use_enable introspection) \
+ $(use_enable vala) \
+ $(use_with python)
+}
diff --git a/app-emulation/libvirt-glib/libvirt-glib-0.2.1.ebuild b/app-emulation/libvirt-glib/libvirt-glib-0.2.1.ebuild
new file mode 100644
index 000000000000..41e5fa80a899
--- /dev/null
+++ b/app-emulation/libvirt-glib/libvirt-glib-0.2.1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+GCONF_DEBUG="no"
+GNOME2_LA_PUNT="yes"
+PYTHON_COMPAT=( python2_7 )
+
+inherit gnome2 python-single-r1 vala
+
+DESCRIPTION="GLib and GObject mappings for libvirt"
+HOMEPAGE="http://libvirt.org/git/?p=libvirt-glib.git"
+SRC_URI="ftp://libvirt.org/libvirt/glib/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+introspection python +vala"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ vala? ( introspection )
+"
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=1093633
+RESTRICT="test"
+
+RDEPEND="
+ dev-libs/libxml2:2
+ >=app-emulation/libvirt-0.9.10:=
+ >=dev-libs/glib-2.38.0:2
+ introspection? ( >=dev-libs/gobject-introspection-0.10.8:= )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}
+ dev-util/gtk-doc-am
+ >=dev-util/intltool-0.35.0
+ virtual/pkgconfig
+ vala? ( $(vala_depend) )
+"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_configure() {
+ gnome2_src_configure \
+ --disable-test-coverage \
+ --disable-static \
+ $(use_enable introspection) \
+ $(use_enable vala) \
+ $(use_with python)
+}
diff --git a/app-emulation/libvirt-glib/metadata.xml b/app-emulation/libvirt-glib/metadata.xml
new file mode 100644
index 000000000000..670adf61506f
--- /dev/null
+++ b/app-emulation/libvirt-glib/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>gnome</herd>
+<maintainer>
+ <email>tamiko@gentoo.org</email>
+ <name>Matthias Maier</name>
+ <description>Please CC me on bugs</description>
+</maintainer>
+</pkgmetadata>
diff --git a/app-emulation/libvirt-snmp/Manifest b/app-emulation/libvirt-snmp/Manifest
new file mode 100644
index 000000000000..4d1e31cc4635
--- /dev/null
+++ b/app-emulation/libvirt-snmp/Manifest
@@ -0,0 +1,2 @@
+DIST libvirt-snmp-0.0.2.tar.gz 152790 SHA256 c54896710ea7cc346a9c241738b342eb624a519166749073be3538230248be2c SHA512 13a522c765d278d3b8f8ab9f32f97c8531f6d131afcb0ce62ae397631db92ed3b585ad221a1f2b3bc17907cc4d61adca4a2071b0458a05f2bff5ca06191e1478 WHIRLPOOL b5f1ada3764d5e8cfbd81814a72b752b40bb41c7aaa7dbd0002f11d687294032773ac2543bf1e4b489c5ea2dc416174f9b7ff42fcd24f5ad824939853d17120a
+DIST libvirt-snmp-0.0.3.tar.gz 161186 SHA256 0a9a94d87d4c189011ca7643bbaf653a289fead52c9ac52fcdf69ea1feeee988 SHA512 6ffda3594ddc513e05e31e7d347a12e371dca3cc698ca790a70e2d01b2ceac6acb5dd6e3cd19723817b41aa62e0c0a49c01c47cb9ce379ac491856a7e88e5a08 WHIRLPOOL 6cc34fd80c4f1497ac4684681f3dc49451f16184b42af5d894826d1544b2d9cddf5e646456fff1439fb0a4dc3c07674136c2d5c94f071b8d08b470ed51f28887
diff --git a/app-emulation/libvirt-snmp/files/0001-Fix-build-rules-to-use-LDADD-to-add-libraries.patch b/app-emulation/libvirt-snmp/files/0001-Fix-build-rules-to-use-LDADD-to-add-libraries.patch
new file mode 100644
index 000000000000..7aa3560cc0f0
--- /dev/null
+++ b/app-emulation/libvirt-snmp/files/0001-Fix-build-rules-to-use-LDADD-to-add-libraries.patch
@@ -0,0 +1,81 @@
+From 810fef8fbf0c4f6383d870a21f729875a8e16f91 Mon Sep 17 00:00:00 2001
+From: Doug Goldstein <cardoe@cardoe.com>
+Date: Mon, 13 Aug 2012 00:18:04 -0500
+Subject: [libvirt-snmp] [PATCH] Fix build rules to use LDADD to add libraries
+
+Fix build rules to use LDADD to add libraries to support --as-needed.
+Also refactored some of the other automake variables in the same fashion
+of the libvirt's automake rules.
+
+Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
+---
+ configure.ac | 4 ++++
+ src/Makefile.am | 31 ++++++++++++++++---------------
+ 2 files changed, 20 insertions(+), 15 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a2bb1ac..9d7d03c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,6 +3,10 @@ AM_INIT_AUTOMAKE([-Wall -Werror])
+ AC_CONFIG_HEADERS([config.h])
+
+ AC_PREREQ([2.50])
++
++AC_PROG_CC
++AM_PROG_CC_C_O
++
+ AC_CHECK_FUNCS([memset])
+ AC_CHECK_FUNCS([strdup])
+ AC_CHECK_HEADERS([stdlib.h])
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 6d27bf5..622a280 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,19 +1,5 @@
+ bin_PROGRAMS=libvirtMib_subagent
+
+-AM_CFLAGS = \
+- $(COVERAGE_CFLAGS) \
+- $(DRIVER_MODULE_CFLAGS) \
+- $(SNMP_CFLAGS) \
+- $(LIBVIRT_CFLAGS) \
+- $(WARN_CFLAGS) \
+- $(LOCK_CHECKING_CFLAGS)
+-
+-AM_LDFLAGS = \
+- $(COVERAGE_LDFLAGS) \
+- $(PTHREAD_LIBS) \
+- $(LIBVIRT_LIBS) \
+- $(SNMP_LIBS)
+-
+ LIBVIRT_OLD_SRCS = \
+ threads.c \
+ event_poll.c \
+@@ -58,7 +44,22 @@ HDRS = \
+ libvirtGuestTable.h
+
+ libvirtMib_subagent_SOURCES=${SRCS} ${HDRS}
+-libvirtMib_subagent_LDFLAGS=${AM_LDFLAGS}
++
++libvirtMib_subagent_CFLAGS= \
++ $(DRIVER_MODULE_CFLAGS) \
++ $(SNMP_CFLAGS) \
++ $(LIBVIRT_CFLAGS) \
++ $(COVERAGE_CFLAGS) \
++ $(WARN_CFLAGS) \
++ $(LOCK_CHECKING_CFLAGS)
++
++libvirtMib_subagent_LDFLAGS= \
++ $(COVERAGE_LDFLAGS)
++
++libvirtMib_subagent_LDADD= \
++ $(PTHREAD_LIBS) \
++ $(LIBVIRT_LIBS) \
++ $(SNMP_LIBS)
+
+ if LIBVIRT_OLD
+ libvirtMib_subagent_SOURCES+=${LIBVIRT_OLD_SRCS} ${LIBVIRT_OLD_HDRS}
+--
+1.7.8.6
+
diff --git a/app-emulation/libvirt-snmp/files/libvirt-snmp.confd b/app-emulation/libvirt-snmp/files/libvirt-snmp.confd
new file mode 100644
index 000000000000..f1685bb5e9d9
--- /dev/null
+++ b/app-emulation/libvirt-snmp/files/libvirt-snmp.confd
@@ -0,0 +1,6 @@
+
+# Specify the URI where your libvirt instance is listening
+LIBVIRT_DEFAULT_URI="qemu:///system"
+
+# additional options
+LIBVIRT_SNMP_OPTIONS=""
diff --git a/app-emulation/libvirt-snmp/files/libvirt-snmp.initd-r1 b/app-emulation/libvirt-snmp/files/libvirt-snmp.initd-r1
new file mode 100644
index 000000000000..46974b2b0e55
--- /dev/null
+++ b/app-emulation/libvirt-snmp/files/libvirt-snmp.initd-r1
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need snmpd
+ use snmptrapd
+ use libvirtd
+}
+
+start() {
+ ebegin "Starting libvirt subagent"
+ start-stop-daemon --start \
+ --env LIBVIRT_DEFAULT_URI="${LIBVIRT_DEFAULT_URI}" \
+ --exec /usr/bin/libvirtMib_subagent \
+ -- ${LIBVIRT_SNMP_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping libvirt subagent"
+ # "--exec /usr/bin/libvirtMib_subagent" does not work and the name gets truncated
+ start-stop-daemon --stop \
+ --name libvirtMib_suba
+ eend $?
+}
diff --git a/app-emulation/libvirt-snmp/libvirt-snmp-0.0.2-r2.ebuild b/app-emulation/libvirt-snmp/libvirt-snmp-0.0.2-r2.ebuild
new file mode 100644
index 000000000000..d4162ceb5225
--- /dev/null
+++ b/app-emulation/libvirt-snmp/libvirt-snmp-0.0.2-r2.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="Provides SNMP functionality for libvirt"
+HOMEPAGE="http://libvirt.org"
+SRC_URI="http://www.libvirt.org/sources/snmp/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="app-emulation/libvirt
+ net-analyzer/net-snmp"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/0001-Fix-build-rules-to-use-LDADD-to-add-libraries.patch
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}/libvirt-snmp.initd-r1" "${PN}"
+ newconfd "${FILESDIR}/libvirt-snmp.confd" "${PN}"
+}
+
+pkg_postinst() {
+ elog "This daemon runs as an AgentX sub-daemon for snmpd. You should therefore"
+ elog "enable the AgentX functionality in snmpd by specifying the following"
+ elog "in /etc/snmp/snmpd.conf:"
+ elog " master agentx"
+ elog "It is further recommended to send traps to the localhost as well using"
+ elog "this option:"
+ elog " trap2sink localhost"
+ elog "More information is available here:"
+ elog " http://wiki.libvirt.org/page/Libvirt-snmp"
+}
diff --git a/app-emulation/libvirt-snmp/libvirt-snmp-0.0.3.ebuild b/app-emulation/libvirt-snmp/libvirt-snmp-0.0.3.ebuild
new file mode 100644
index 000000000000..fdff7d8dd493
--- /dev/null
+++ b/app-emulation/libvirt-snmp/libvirt-snmp-0.0.3.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="Provides SNMP functionality for libvirt"
+HOMEPAGE="http://libvirt.org"
+SRC_URI="http://www.libvirt.org/sources/snmp/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="app-emulation/libvirt
+ net-analyzer/net-snmp"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_install() {
+ default
+ newinitd "${FILESDIR}/libvirt-snmp.initd-r1" "${PN}"
+ newconfd "${FILESDIR}/libvirt-snmp.confd" "${PN}"
+}
+
+pkg_postinst() {
+ elog "This daemon runs as an AgentX sub-daemon for snmpd. You should therefore"
+ elog "enable the AgentX functionality in snmpd by specifying the following"
+ elog "in /etc/snmp/snmpd.conf:"
+ elog " master agentx"
+ elog "It is further recommended to send traps to the localhost as well using"
+ elog "this option:"
+ elog " trap2sink localhost"
+ elog "More information is available here:"
+ elog " http://wiki.libvirt.org/page/Libvirt-snmp"
+}
diff --git a/app-emulation/libvirt-snmp/metadata.xml b/app-emulation/libvirt-snmp/metadata.xml
new file mode 100644
index 000000000000..75dd2ca7d302
--- /dev/null
+++ b/app-emulation/libvirt-snmp/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
new file mode 100644
index 000000000000..676dc7154cb0
--- /dev/null
+++ b/app-emulation/libvirt/Manifest
@@ -0,0 +1,3 @@
+DIST libvirt-1.2.15.tar.gz 29094868 SHA256 5f88041b8c212f8f687c672fe583108833240d6175b512ce4de92ab6660194c6 SHA512 c5dd3af86e89e3804d6c3b527c6dbd98c79d87d2591725a13af33530e0e9a9a2e9aeb9491844469d44ec4f4d17adb036c76391f964158ada23ec042a75556fbc WHIRLPOOL a43aad4caeff707c8d7a6872ff3c46911c96fd90ece02a7f6ceabb4ccd00e467b5341ab9d922912cc2968a2bb8826e970b253b257c5a8981b37364550f9b3616
+DIST libvirt-1.2.17.tar.gz 29320317 SHA256 e07eaf20b0590fae05ba3b53ad4dac3e5fbd771437563cc78b692f23ddd02fad SHA512 133ee2da30352d5eeb81c3e24f6eaf21c40b5afeb05abece9298956fa9c52c62ebc3468433311853cf2d65894e38e98f5c6744269d2d64fa3b3cf6f4b9b0cc46 WHIRLPOOL 4fdd6554989ea7d32600cc978d2c95582433ac223e933b55d838ba4ddffba2d6444a0d556348681ad36766e73ba2bf9788b37180c980636324b5b6fa093a2347
+DIST libvirt-1.2.18.tar.gz 29412554 SHA256 d5a5ff18af4cced21fed986d28fa0a21b782d256920326bf0ff1c7731eeb6ade SHA512 e89d494066ebec4de4c9a53089f015635b7b5ccf4a10ab9749883cc81f6f9607b18ca91a1bd01a9cdacb3a46de86223f0432fae3954106cb92dd275e5b4138c5 WHIRLPOOL dbbbd627ccb9be154bc680407898cd32dfdbc218a67f54560e6b0f0200cbc157a9aa05834de5d9d23e3b6da0625fd5943b4c8e38f8bb9a6ff920bc5820287bfc
diff --git a/app-emulation/libvirt/files/libvirt-1.2.16-fix_paths_in_libvirt-guests_sh.patch b/app-emulation/libvirt/files/libvirt-1.2.16-fix_paths_in_libvirt-guests_sh.patch
new file mode 100644
index 000000000000..ddedb1f90cd3
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-1.2.16-fix_paths_in_libvirt-guests_sh.patch
@@ -0,0 +1,19 @@
+diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
+index 7f74b85..ea58119 100644
+--- a/tools/libvirt-guests.sh.in
++++ b/tools/libvirt-guests.sh.in
+@@ -41,11 +41,11 @@ CONNECT_RETRIES=10
+ RETRIES_SLEEP=1
+ SYNC_TIME=0
+
+-test -f "$sysconfdir"/sysconfig/libvirt-guests &&
+- . "$sysconfdir"/sysconfig/libvirt-guests
++test -f "$sysconfdir"/libvirt/libvirt-guests.conf &&
++ . "$sysconfdir"/libvirt/libvirt-guests.conf
+
+ LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests
+-VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
++VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/libvirt-guests
+
+ RETVAL=0
+
diff --git a/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch b/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch
new file mode 100644
index 000000000000..c900ada85f95
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch
@@ -0,0 +1,161 @@
+From bde898de482645f6963b673e8ff0b486a0a6db25 Mon Sep 17 00:00:00 2001
+From: Matthias Maier <tamiko@kyomu.43-1.org>
+Date: Tue, 28 Jul 2015 11:10:59 -0500
+Subject: [PATCH] adapt paths for gentoo's fs layout
+
+https://bugs.gentoo.org/show_bug.cgi?id=554628
+---
+ examples/apparmor/Makefile.am | 4 +-
+ examples/apparmor/usr.lib.libvirt.virt-aa-helper | 48 ------------------------
+ examples/apparmor/usr.libexec.virt-aa-helper | 48 ++++++++++++++++++++++++
+ examples/apparmor/usr.sbin.libvirtd | 4 +-
+ 4 files changed, 52 insertions(+), 52 deletions(-)
+ delete mode 100644 examples/apparmor/usr.lib.libvirt.virt-aa-helper
+ create mode 100644 examples/apparmor/usr.libexec.virt-aa-helper
+
+diff --git a/examples/apparmor/Makefile.am b/examples/apparmor/Makefile.am
+index 7a20e16..c3c67b6 100644
+--- a/examples/apparmor/Makefile.am
++++ b/examples/apparmor/Makefile.am
+@@ -19,13 +19,13 @@ EXTRA_DIST= \
+ TEMPLATE.lxc \
+ libvirt-qemu \
+ libvirt-lxc \
+- usr.lib.libvirt.virt-aa-helper \
++ usr.libexec.virt-aa-helper \
+ usr.sbin.libvirtd
+
+ if WITH_APPARMOR_PROFILES
+ apparmordir = $(sysconfdir)/apparmor.d/
+ apparmor_DATA = \
+- usr.lib.libvirt.virt-aa-helper \
++ usr.libexec.virt-aa-helper \
+ usr.sbin.libvirtd \
+ $(NULL)
+
+diff --git a/examples/apparmor/usr.lib.libvirt.virt-aa-helper b/examples/apparmor/usr.lib.libvirt.virt-aa-helper
+deleted file mode 100644
+index b34fb35..0000000
+--- a/examples/apparmor/usr.lib.libvirt.virt-aa-helper
++++ /dev/null
+@@ -1,48 +0,0 @@
+-# Last Modified: Mon Apr 5 15:10:27 2010
+-#include <tunables/global>
+-
+-profile virt-aa-helper /usr/{lib,lib64}/libvirt/virt-aa-helper {
+- #include <abstractions/base>
+-
+- # needed for searching directories
+- capability dac_override,
+- capability dac_read_search,
+-
+- # needed for when disk is on a network filesystem
+- network inet,
+-
+- deny @{PROC}/[0-9]*/mounts r,
+- @{PROC}/[0-9]*/net/psched r,
+- owner @{PROC}/[0-9]*/status r,
+- @{PROC}/filesystems r,
+-
+- # for hostdev
+- /sys/devices/ r,
+- /sys/devices/** r,
+-
+- /usr/{lib,lib64}/libvirt/virt-aa-helper mr,
+- /sbin/apparmor_parser Ux,
+-
+- /etc/apparmor.d/libvirt/* r,
+- /etc/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw,
+-
+- # for backingstore -- allow access to non-hidden files in @{HOME} as well
+- # as storage pools
+- audit deny @{HOME}/.* mrwkl,
+- audit deny @{HOME}/.*/ rw,
+- audit deny @{HOME}/.*/** mrwkl,
+- audit deny @{HOME}/bin/ rw,
+- audit deny @{HOME}/bin/** mrwkl,
+- @{HOME}/ r,
+- @{HOME}/** r,
+- /var/lib/libvirt/images/ r,
+- /var/lib/libvirt/images/** r,
+- /{media,mnt,opt,srv}/** r,
+-
+- /**.img r,
+- /**.qcow{,2} r,
+- /**.qed r,
+- /**.vmdk r,
+- /**.[iI][sS][oO] r,
+- /**/disk{,.*} r,
+-}
+diff --git a/examples/apparmor/usr.libexec.virt-aa-helper b/examples/apparmor/usr.libexec.virt-aa-helper
+new file mode 100644
+index 0000000..b34fb35
+--- /dev/null
++++ b/examples/apparmor/usr.libexec.virt-aa-helper
+@@ -0,0 +1,48 @@
++# Last Modified: Mon Apr 5 15:10:27 2010
++#include <tunables/global>
++
++profile virt-aa-helper /usr/libexec/virt-aa-helper {
++ #include <abstractions/base>
++
++ # needed for searching directories
++ capability dac_override,
++ capability dac_read_search,
++
++ # needed for when disk is on a network filesystem
++ network inet,
++
++ deny @{PROC}/[0-9]*/mounts r,
++ @{PROC}/[0-9]*/net/psched r,
++ owner @{PROC}/[0-9]*/status r,
++ @{PROC}/filesystems r,
++
++ # for hostdev
++ /sys/devices/ r,
++ /sys/devices/** r,
++
++ /usr/libexec/virt-aa-helper mr,
++ /sbin/apparmor_parser Ux,
++
++ /etc/apparmor.d/libvirt/* r,
++ /etc/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw,
++
++ # for backingstore -- allow access to non-hidden files in @{HOME} as well
++ # as storage pools
++ audit deny @{HOME}/.* mrwkl,
++ audit deny @{HOME}/.*/ rw,
++ audit deny @{HOME}/.*/** mrwkl,
++ audit deny @{HOME}/bin/ rw,
++ audit deny @{HOME}/bin/** mrwkl,
++ @{HOME}/ r,
++ @{HOME}/** r,
++ /var/lib/libvirt/images/ r,
++ /var/lib/libvirt/images/** r,
++ /{media,mnt,opt,srv}/** r,
++
++ /**.img r,
++ /**.qcow{,2} r,
++ /**.qed r,
++ /**.vmdk r,
++ /**.[iI][sS][oO] r,
++ /**/disk{,.*} r,
++}
+diff --git a/examples/apparmor/usr.sbin.libvirtd b/examples/apparmor/usr.sbin.libvirtd
+index 5d606e6..ab2f1a9 100644
+--- a/examples/apparmor/usr.sbin.libvirtd
++++ b/examples/apparmor/usr.sbin.libvirtd
+@@ -58,8 +58,8 @@
+ audit deny /sys/kernel/security/apparmor/.* rwxl,
+ /sys/kernel/security/apparmor/profiles r,
+ /usr/{lib,lib64}/libvirt/* PUxr,
+- /usr/{lib,lib64}/libvirt/libvirt_parthelper ix,
+- /usr/{lib,lib64}/libvirt/libvirt_iohelper ix,
++ /usr/libexec/libvirt_parthelper ix,
++ /usr/libexec/libvirt_iohelper ix,
+ /etc/libvirt/hooks/** rmix,
+ /etc/xen/scripts/** rmix,
+
+--
+2.3.6
+
diff --git a/app-emulation/libvirt/files/libvirt-1.2.9-do_not_use_sysconf.patch b/app-emulation/libvirt/files/libvirt-1.2.9-do_not_use_sysconf.patch
new file mode 100644
index 000000000000..e766f49d33e9
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-1.2.9-do_not_use_sysconf.patch
@@ -0,0 +1,112 @@
+From 69372a32025ac16578ad277c6356e89713a3f9f4 Mon Sep 17 00:00:00 2001
+From: Matthias Maier <tamiko@kyomu.43-1.org>
+Date: Mon, 3 Nov 2014 00:51:35 +0100
+Subject: [PATCH] Do not use /etc/sysconf
+
+---
+ daemon/Makefile.am | 4 +---
+ daemon/libvirtd.service.in | 3 +--
+ src/Makefile.am | 3 ---
+ src/locking/virtlockd.service.in | 3 +--
+ tools/Makefile.am | 2 +-
+ tools/libvirt-guests.service.in | 2 +-
+ 6 files changed, 5 insertions(+), 12 deletions(-)
+
+diff --git a/daemon/Makefile.am b/daemon/Makefile.am
+index b95a79d..1e98422 100644
+--- a/daemon/Makefile.am
++++ b/daemon/Makefile.am
+@@ -328,9 +328,7 @@ uninstall-logrotate:
+ rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
+
+ install-sysconfig:
+- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
+- $(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
+- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
++
+ uninstall-sysconfig:
+ rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
+ rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
+diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in
+index 1759ac8..cd337a1 100644
+--- a/daemon/libvirtd.service.in
++++ b/daemon/libvirtd.service.in
+@@ -10,8 +10,7 @@ Documentation=http://libvirt.org
+
+ [Service]
+ Type=notify
+-EnvironmentFile=-/etc/sysconfig/libvirtd
+-ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
++ExecStart=@sbindir@/libvirtd
+ ExecReload=/bin/kill -HUP $MAINPID
+ KillMode=process
+ Restart=on-failure
+diff --git a/src/Makefile.am b/src/Makefile.am
+index e65177f..18bbbb4 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -2269,9 +2269,6 @@ EXTRA_DIST += locking/virtlockd.sysconf \
+ locking/test_libvirt_lockd.aug.in
+
+ install-sysconfig:
+- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
+- $(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
+- $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
+
+ uninstall-sysconfig:
+ rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
+diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
+index 57089b0..ace0c83 100644
+--- a/src/locking/virtlockd.service.in
++++ b/src/locking/virtlockd.service.in
+@@ -5,8 +5,7 @@ Documentation=man:virtlockd(8)
+ Documentation=http://libvirt.org
+
+ [Service]
+-EnvironmentFile=-/etc/sysconfig/virtlockd
+-ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS
++ExecStart=@sbindir@/virtlockd
+ ExecReload=/bin/kill -USR1 $MAINPID
+ # Loosing the locks is a really bad thing that will
+ # cause the machine to be fenced (rebooted), so make
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index 93d642d..2da0e97 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -259,7 +259,7 @@ uninstall-local: uninstall-init uninstall-systemd
+ install-sysconfig:
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
+ $(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
+- $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
++ $(DESTDIR)$(sysconfdir)/libvirt/libvirt-guests.conf
+
+ uninstall-sysconfig:
+ rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
+diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
+index cc04b6d..9be514b 100644
+--- a/tools/libvirt-guests.service.in
++++ b/tools/libvirt-guests.service.in
+@@ -5,7 +5,7 @@ Documentation=man:libvirtd(8)
+ Documentation=http://libvirt.org
+
+ [Service]
+-EnvironmentFile=-/etc/sysconfig/libvirt-guests
++EnvironmentFile=-/etc/libvirt/libvirt-guests.conf
+ # Hack just call traditional service until we factor
+ # out the code
+ ExecStart=@libexecdir@/libvirt-guests.sh start
+--- a/tools/libvirt-guests.sysconf
++++ b/tools/libvirt-guests.sysconf
+@@ -1,3 +1,10 @@
++#
++# Warning: This configuration file is only sourced by the systemd
++# libvirt-guests.service unit. The coresponding openrc facility is in
++# /etc/init.d/libvirtd and /etc/conf.d/libvirtd
++#
++
++
+ # URIs to check for running guests
+ # example: URIS='default xen:/// vbox+tcp://host/system lxc:///'
+ #URIS=default
+--
+2.0.4
diff --git a/app-emulation/libvirt/files/libvirtd.confd-r4 b/app-emulation/libvirt/files/libvirtd.confd-r4
new file mode 100644
index 000000000000..48ab1252e3bf
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirtd.confd-r4
@@ -0,0 +1,43 @@
+# /etc/conf.d/libvirtd
+
+# Startup dependency
+# libvirtd typically requires all networks to be up and settled which
+# is what rc_need="net" provides. However if you only use specific networks
+# for libvirtd, you may override this. Or if you only use libvirtd locally.
+rc_need="net"
+
+# LIBVIRTD_OPTS
+# You may want to add '--listen' to have libvirtd listen for tcp/ip connections
+# if you want to use libvirt for remote control
+# Please consult 'libvirtd --help' for more options
+#LIBVIRTD_OPTS="--listen"
+
+# LIBVIRTD_KVM_SHUTDOWN
+# Valid options:
+# * shutdown - Sends an ACPI shutdown (think when you tap the power button
+# on your machine and it begins a graceful shutdown). If your
+# VM ignores this, it will have the power yanked out from under
+# it in LIBVIRTD_KVM_SHUTDOWN_MAXWAIT seconds.
+# * managedsave - Performs a state save external to the VM. qemu-kvm will stop
+# stop the CPU and save off all state to a separate file. When
+# the machine is started again, it will resume like nothing ever
+# happened. This is guarenteed to always successfully stop your
+# machine and restart it. However it may take some time to finish.
+# * none - No attempts will be made to stop any VMs. If you are restarting your
+# machine the qemu-kvm process will be simply killed, which may result
+# in your VMs having disk corruption.
+LIBVIRTD_KVM_SHUTDOWN="managedsave"
+
+# LIBVIRTD_KVM_SHUTDOWN_MAXWAIT
+# Timeout in seconds until stopping libvirtd and "pulling the plug" on the
+# remaining VM's still in a running state
+#LIBVIRTD_KVM_SHUTDOWN_MAXWAIT="500"
+
+# LIBVIRTD_KVM_NET_SHUTDOWN
+# If libvirtd created networks for you (e.g. NATed networks) then this init
+# script will shut them down for you if this is set to 'yes'. Otherwise,
+# the networks will be left running once libvirt is shutdown. For this
+# option to be useful you must have enabled the 'virt-network' USE flag and
+# have had libvirt create a NATed network for you.
+# Valid values: 'yes' or 'no'
+#LIBVIRTD_KVM_NET_SHUTDOWN="yes"
diff --git a/app-emulation/libvirt/files/libvirtd.init-r14 b/app-emulation/libvirt/files/libvirtd.init-r14
new file mode 100644
index 000000000000..7bab68249eda
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirtd.init-r14
@@ -0,0 +1,139 @@
+#!/sbin/runscript
+
+description="Virtual Machine Management daemon (libvirt)"
+extra_started_commands="reload halt"
+description_halt="Stops the libvirt daemon without stopping your VMs"
+description_reload="Restarts the libvirt daemon without stopping your VMs"
+
+depend() {
+ USE_FLAG_FIREWALLD
+ use USE_FLAG_AVAHI USE_FLAG_ISCSI USE_FLAG_RBD dbus virtlockd
+ after ntp-client ntpd nfs nfsmount portmap rpc.statd iptables ip6tables ebtables corosync sanlock cgconfig xenconsoled
+}
+
+libvirtd_virsh() {
+ local mode=$1
+ shift
+
+ # Silence errors because virsh always throws an error about
+ # not finding the hypervisor version when connecting to libvirtd
+ LC_ALL=C virsh -c ${mode}:///system "$@" 2>/dev/null
+}
+
+libvirtd_dom_list() {
+ # Make sure that it wouldn't be confused if the domain name
+ # contains the word running.
+ libvirtd_virsh $1 list | awk '$3 == "running" { print $1 }'
+}
+
+libvirtd_dom_count() {
+ # Make sure that it wouldn't be confused if the domain name
+ # contains the word running.
+ libvirtd_virsh $1 list | awk 'BEGIN { count = 0 } \
+ $3 == "running" { count++ } \
+ END { print count }'
+}
+
+libvirtd_net_list() {
+ # The purpose of the awk is to avoid networks with 'active' in the name
+ libvirtd_virsh $1 net-list | awk '$2 == "active" { print $1 }'
+}
+
+libvirtd_net_count() {
+ # The purpose of the awk is to avoid networks with 'active' in the name
+ libvirtd_virsh $1 net-list | awk 'BEGIN { count = 0 } \
+ $2 == "active" { count++ } \
+ END { print count }'
+}
+
+
+start() {
+ # Test configuration directories in /etc/libvirt/ to be either not
+ # present or a directory, i.e. not a regular file, bug #532892
+ for dir in lxc nwfilter qemu storage; do
+ if [ -f /etc/libvirt/$dir ]; then
+ eerror "/etc/libvirt/$dir was created as a regular file. It must be either"
+ eerror "a directory or not present for libvirtd to start up successfully."
+ return 1
+ fi
+ done
+
+ ebegin "Starting libvirtd"
+ start-stop-daemon --start \
+ --env KRB5_KTNAME=/etc/libvirt/krb5.tab \
+ --exec /usr/sbin/libvirtd -- -d ${LIBVIRTD_OPTS}
+ eend $?
+}
+
+stop() {
+ local counter=
+ local vm_name=
+ local net_name=
+ local dom_id=
+
+ ebegin "Stopping libvirtd"
+ # try to shutdown all (KVM/Qemu) domains
+ if [ "${LIBVIRTD_KVM_SHUTDOWN}" != "none" ] \
+ && [ "$(libvirtd_dom_count qemu)" != "0" ] ; then
+
+ einfo " Shutting down domain(s):"
+ for dom_id in $(libvirtd_dom_list qemu) ; do
+ vm_name="$(libvirtd_virsh qemu domname ${dom_id} | head -n 1)"
+ einfo " ${vm_name}"
+ libvirtd_virsh qemu ${LIBVIRTD_KVM_SHUTDOWN} ${dom_id} > /dev/null
+ done
+
+ if [ -n "${LIBVIRTD_KVM_SHUTDOWN_MAXWAIT}" ] ; then
+ counter="${LIBVIRTD_KVM_SHUTDOWN_MAXWAIT}"
+ else
+ counter=500
+ fi
+
+ if [ "${LIBVIRTD_KVM_SHUTDOWN}" = "shutdown" ]; then
+ einfo " Waiting ${counter} seconds while domains shutdown ..."
+ DOM_COUNT="$(libvirtd_dom_count qemu)"
+ while [ ${DOM_COUNT} -gt 0 ] && [ ${counter} -gt 0 ] ; do
+ DOM_COUNT="$(libvirtd_dom_count qemu)"
+ sleep 1
+ counter=$((${counter} - 1))
+ echo -n "."
+ done
+ fi
+
+ if [ "$(libvirtd_dom_count qemu)" != "0" ] ; then
+ eerror " !!! Some guests are still running, stopping anyway"
+ fi
+
+ fi
+
+ if [ "${LIBVIRTD_KVM_NET_SHUTDOWN}" != "no" ] \
+ && [ "$(libvirtd_net_count qemu)" != "0" ]; then
+
+ einfo " Shutting down network(s):"
+ for net_name in $(libvirtd_net_list qemu); do
+ einfo " ${net_name}"
+ libvirtd_virsh qemu net-destroy ${net_name} > /dev/null
+ done
+
+ if [ "$(libvirtd_net_count qemu)" != "0" ]; then
+ eerror " !!! Some networks are still active, stopping anyway"
+ fi
+ fi
+
+ # Now actually stop the daemon
+ start-stop-daemon --stop --quiet --exec \
+ /usr/sbin/libvirtd --pidfile=/var/run/libvirtd.pid
+ eend $?
+}
+
+halt() {
+ ebegin "Stopping libvirtd without shutting down your VMs"
+ start-stop-daemon --stop --quiet --exec \
+ /usr/sbin/libvirtd --pidfile=/var/run/libvirtd.pid
+ eend $?
+}
+
+reload() {
+ halt
+ start
+}
diff --git a/app-emulation/libvirt/files/libvirtd.service.conf b/app-emulation/libvirt/files/libvirtd.service.conf
new file mode 100644
index 000000000000..f08792260b72
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirtd.service.conf
@@ -0,0 +1,10 @@
+# Uncomment the following three lines to start libvirtd with the '--listen'
+# directive such that it listens for TCP/IP connections (honoring the
+# listen_tls and listen_tcp settings in /etc/libvirt/libvirtd.conf). If
+# libvirtd is started without the '--listen' parameter, network connection
+# (for the daemon) is globally disabled:
+
+# [Service]
+# ExecStart=
+# ExecStart=/usr/sbin/libvirtd --listen
+
diff --git a/app-emulation/libvirt/files/libvirtd.tmpfiles.conf b/app-emulation/libvirt/files/libvirtd.tmpfiles.conf
new file mode 100644
index 000000000000..c22c23dd469f
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirtd.tmpfiles.conf
@@ -0,0 +1 @@
+d /run/libvirt/lxc 0755 root root -
diff --git a/app-emulation/libvirt/files/virtlockd.init-r1 b/app-emulation/libvirt/files/virtlockd.init-r1
new file mode 100644
index 000000000000..396ab65434d9
--- /dev/null
+++ b/app-emulation/libvirt/files/virtlockd.init-r1
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="libvirt virtual machine lock manager"
+command="/usr/sbin/virtlockd"
+command_args="-d"
+pidfile="/var/run/virtlockd.pid"
+
+extra_started_commands="reload"
+description_reload="re-exec the daemon, while maintaining locks and clients"
+
+
+depend() {
+ after ntp-client ntpd nfs nfsmount corosync
+}
+
+reload() {
+ ebegin "re-exec() virtlockd"
+
+ start-stop-daemon --signal SIGUSR1 \
+ --exec "${command}" --pidfile "${pidfile}"
+}
diff --git a/app-emulation/libvirt/libvirt-1.2.15-r1.ebuild b/app-emulation/libvirt/libvirt-1.2.15-r1.ebuild
new file mode 100644
index 000000000000..fb28921a11be
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-1.2.15-r1.ebuild
@@ -0,0 +1,464 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLIZE=yes
+
+MY_P="${P/_rc/-rc}"
+
+inherit eutils user autotools linux-info systemd readme.gentoo
+
+BACKPORTS=""
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://libvirt.org/libvirt.git"
+ SRC_URI=""
+ KEYWORDS=""
+ SLOT="0"
+else
+ # Versions with 4 numbers are stable updates:
+ if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
+ SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz"
+ else
+ SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz"
+ fi
+ SRC_URI+=" ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
+ http://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="amd64 x86"
+ SLOT="0/${PV}"
+fi
+S="${WORKDIR}/${P%_rc*}"
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+# TODO: Reenable IUSE wireshark-plugins
+IUSE="audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm lxc \
+ +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
+ selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \
+ elibc_glibc systemd"
+REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
+ lxc? ( caps libvirtd )
+ openvz? ( libvirtd )
+ qemu? ( libvirtd )
+ uml? ( libvirtd )
+ vepa? ( macvtap )
+ virtualbox? ( libvirtd )
+ xen? ( libvirtd )
+ virt-network? ( libvirtd )
+ firewalld? ( virt-network )"
+
+# gettext.sh command is used by the libvirt command wrappers, and it's
+# non-optional, so put it into RDEPEND.
+# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
+# package will use 3 by default. Since we don't have slot pinning in an API,
+# we must go with the most recent
+RDEPEND="sys-libs/readline:=
+ sys-libs/ncurses
+ >=net-misc/curl-7.18.0
+ dev-libs/libgcrypt:0
+ >=dev-libs/libxml2-2.7.6
+ dev-libs/libnl:3
+ >=net-libs/gnutls-1.0.25
+ net-libs/libssh2
+ sys-apps/dmidecode
+ >=sys-apps/util-linux-2.17
+ sys-devel/gettext
+ >=net-analyzer/netcat6-1.0-r2
+ app-misc/scrub
+ audit? ( sys-process/audit )
+ avahi? ( >=net-dns/avahi-0.6[dbus] )
+ caps? ( sys-libs/libcap-ng )
+ fuse? ( >=sys-fs/fuse-2.8.6 )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
+ iscsi? ( sys-block/open-iscsi )
+ lxc? ( !systemd? ( sys-power/pm-utils ) )
+ lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
+ nfs? ( net-fs/nfs-utils )
+ numa? (
+ >sys-process/numactl-2.0.2
+ sys-process/numad
+ )
+ openvz? ( sys-kernel/openvz-sources:* )
+ parted? (
+ >=sys-block/parted-1.8[device-mapper]
+ sys-fs/lvm2
+ )
+ pcap? ( >=net-libs/libpcap-1.0.0 )
+ policykit? ( >=sys-auth/polkit-0.9 )
+ qemu? (
+ >=app-emulation/qemu-0.13.0
+ dev-libs/yajl
+ !systemd? ( sys-power/pm-utils )
+ )
+ rbd? ( sys-cluster/ceph )
+ sasl? ( dev-libs/cyrus-sasl )
+ selinux? ( >=sys-libs/libselinux-2.0.85 )
+ systemd? ( sys-apps/systemd )
+ virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
+ wireshark-plugins? ( net-analyzer/wireshark:= )
+ xen? ( app-emulation/xen-tools app-emulation/xen )
+ udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
+ virt-network? ( net-dns/dnsmasq[script]
+ >=net-firewall/iptables-1.4.10[ipv6]
+ net-misc/radvd
+ net-firewall/ebtables
+ sys-apps/iproute2[-minimal]
+ firewalld? ( net-firewall/firewalld )
+ )
+ elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-text/xhtml1
+ dev-lang/perl
+ dev-perl/XML-XPath
+ dev-libs/libxslt"
+
+DOC_CONTENTS="For the basic networking support (bridged and routed networks)
+you don't need any extra software. For more complex network modes
+including but not limited to NATed network, you can enable the
+'virt-network' USE flag.\n\n
+If you are using dnsmasq on your system, you will have
+to configure /etc/dnsmasq.conf to enable the following settings:\n\n
+ bind-interfaces\n
+ interface or except-interface\n\n
+Otherwise you might have issues with your existing DNS server."
+
+LXC_CONFIG_CHECK="
+ ~CGROUPS
+ ~CGROUP_FREEZER
+ ~CGROUP_DEVICE
+ ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+ ~CGROUP_PERF
+ ~BLK_CGROUP
+ ~NET_CLS_CGROUP
+ ~CGROUP_NET_PRIO
+ ~CPUSETS
+ ~NAMESPACES
+ ~UTS_NS
+ ~IPC_NS
+ ~PID_NS
+ ~NET_NS
+ ~USER_NS
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~VETH
+ ~MACVLAN
+ ~POSIX_MQUEUE
+ ~SECURITYFS
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+VIRTNET_CONFIG_CHECK="
+ ~BRIDGE_NF_EBTABLES
+ ~BRIDGE_EBT_MARK_T
+ ~NETFILTER_ADVANCED
+ ~NETFILTER_XT_TARGET_CHECKSUM
+ ~NETFILTER_XT_CONNMARK
+ ~NETFILTER_XT_MARK
+"
+
+BWLMT_CONFIG_CHECK="
+ ~BRIDGE_EBT_T_NAT
+ ~NET_SCH_HTB
+ ~NET_SCH_SFQ
+ ~NET_SCH_INGRESS
+ ~NET_CLS_FW
+ ~NET_CLS_U32
+ ~NET_ACT_POLICE
+"
+
+MACVTAP_CONFIG_CHECK=" ~MACVTAP"
+
+LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
+
+ERROR_USER_NS="Optional depending on LXC configuration."
+
+pkg_setup() {
+ enewgroup qemu 77
+ enewuser qemu 77 -1 -1 qemu kvm
+
+ # Some people used the masked ebuild which was not adding the qemu
+ # user to the kvm group originally. This results in VMs failing to
+ # start for some users. bug #430808
+ egetent group kvm | grep -q qemu
+ if [[ $? -ne 0 ]]; then
+ gpasswd -a qemu kvm
+ fi
+
+ # Handle specific kernel versions for different features
+ kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+ kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
+
+ CONFIG_CHECK=""
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
+ use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
+ use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
+ use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
+ # Bandwidth Limiting Support
+ use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}"
+ if [[ -n ${CONFIG_CHECK} ]]; then
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ touch "${S}/.mailmap"
+
+ if [[ ${PV} = *9999* ]]; then
+ # git checkouts require bootstrapping to create the configure script.
+ # Additionally the submodules must be cloned to the right locations
+ # bug #377279
+ ./bootstrap || die "bootstrap failed"
+ (
+ git submodule status | sed 's/^[ +-]//;s/ .*//'
+ git hash-object bootstrap.conf
+ ) >.git-module-status
+ fi
+
+ epatch "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch
+
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
+ EPATCH_SOURCE="${WORKDIR}/patches" epatch
+
+ epatch_user
+
+ [[ -n ${AUTOTOOLIZE} ]] && eautoreconf
+
+ # Tweak the init script
+ local avahi_init=
+ local iscsi_init=
+ local rbd_init=
+ local firewalld_init=
+ cp "${FILESDIR}/libvirtd.init-r14" "${S}/libvirtd.init"
+ use avahi && avahi_init='avahi-daemon'
+ use iscsi && iscsi_init='iscsid'
+ use rbd && rbd_init='ceph'
+ use firewalld && firewalld_init='need firewalld'
+
+ sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
+}
+
+src_configure() {
+ local myconf=""
+
+ ## enable/disable daemon, otherwise client only utils
+ myconf+=" $(use_with libvirtd)"
+
+ ## enable/disable the daemon using avahi to find VMs
+ myconf+=" $(use_with avahi)"
+
+ ## hypervisors on the local host
+ myconf+=" $(use_with xen) $(use_with xen xen-inotify)"
+ myconf+=" --without-xenapi"
+ if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
+ myconf+=" --with-libxl"
+ else
+ myconf+=" --without-libxl"
+ fi
+ myconf+=" $(use_with openvz)"
+ myconf+=" $(use_with lxc)"
+ if use virtualbox && has_version app-emulation/virtualbox-ose; then
+ myconf+=" --with-vbox=/usr/lib/virtualbox-ose/"
+ else
+ myconf+=" $(use_with virtualbox vbox)"
+ fi
+ myconf+=" $(use_with uml)"
+ myconf+=" $(use_with qemu)"
+ myconf+=" $(use_with qemu yajl)" # Use QMP over HMP
+ myconf+=" $(use_with phyp)"
+ myconf+=" --with-esx"
+ myconf+=" --with-vmware"
+
+ ## additional host drivers
+ myconf+=" $(use_with virt-network network)"
+ myconf+=" --with-storage-fs"
+ myconf+=" $(use_with lvm storage-lvm)"
+ myconf+=" $(use_with iscsi storage-iscsi)"
+ myconf+=" $(use_with parted storage-disk)"
+ mycond+=" $(use_with glusterfs)"
+ mycond+=" $(use_with glusterfs storage-gluster)"
+ myconf+=" $(use_with lvm storage-mpath)"
+ myconf+=" $(use_with rbd storage-rbd)"
+ myconf+=" $(use_with numa numactl)"
+ myconf+=" $(use_with numa numad)"
+ myconf+=" $(use_with selinux)"
+ myconf+=" $(use_with fuse)"
+
+ # udev for device support details
+ myconf+=" $(use_with udev)"
+ myconf+=" --without-hal"
+
+ # linux capability support so we don't need privileged accounts
+ myconf+=" $(use_with caps capng)"
+
+ ## auth stuff
+ myconf+=" $(use_with policykit polkit)"
+ myconf+=" $(use_with sasl)"
+
+ # network bits
+ myconf+=" $(use_with macvtap)"
+ myconf+=" $(use_with pcap libpcap)"
+ myconf+=" $(use_with vepa virtualport)"
+ myconf+=" $(use_with firewalld)"
+
+ ## other
+ myconf+=" $(use_enable nls)"
+
+ # user privilege bits fir qemu/kvm
+ if use caps; then
+ myconf+=" --with-qemu-user=qemu"
+ myconf+=" --with-qemu-group=qemu"
+ else
+ myconf+=" --with-qemu-user=root"
+ myconf+=" --with-qemu-group=root"
+ fi
+
+ # audit support
+ myconf+=" $(use_with audit)"
+
+ # wireshark dissector
+ myconf+=" $(use_with wireshark-plugins wireshark-dissector)"
+
+ ## stuff we don't yet support
+ myconf+=" --without-netcf"
+
+ # locking support
+ myconf+=" --without-sanlock"
+
+ # systemd unit files
+ myconf+=" $(use_with systemd systemd-daemon)"
+ use systemd && myconf+=" --with-init-script=systemd"
+
+ # this is a nasty trick to work around the problem in bug
+ # #275073. The reason why we don't solve this properly is that
+ # it'll require us to rebuild autotools (and we don't really want
+ # to do that right now). The proper solution has been sent
+ # upstream and should hopefully land in 0.7.7, in the mean time,
+ # mime the same functionality with this.
+ case ${CHOST} in
+ *cygwin* | *mingw* )
+ ;;
+ *)
+ ac_cv_prog_WINDRES=no
+ ;;
+ esac
+
+ econf \
+ ${myconf} \
+ --disable-static \
+ --disable-werror \
+ --with-remote \
+ --docdir=/usr/share/doc/${PF} \
+ --localstatedir=/var
+
+ if [[ ${PV} = *9999* ]]; then
+ # Restore gnulib's config.sub and config.guess
+ # bug #377279
+ (cd .gnulib && git reset --hard > /dev/null)
+ fi
+}
+
+src_test() {
+ # Explicitly allow parallel build of tests
+ export VIR_TEST_DEBUG=1
+ HOME="${T}" emake check || die "tests failed"
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ HTML_DIR=/usr/share/doc/${PF}/html \
+ DOCS_DIR=/usr/share/doc/${PF} \
+ EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
+ SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
+ || die "emake install failed"
+
+ find "${D}" -name '*.la' -delete || die
+
+ # Remove bogus, empty directories. They are either not used, or
+ # libvirtd is able to create them on demand
+ rm -rf "${D}"/etc/sysconf
+ rm -rf "${D}"/var/cache
+ rm -rf "${D}"/var/run
+ rm -rf "${D}"/var/log
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ use systemd && systemd_install_serviced \
+ "${FILESDIR}"/libvirtd.service.conf libvirtd.service
+
+ systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
+
+ newinitd "${S}/libvirtd.init" libvirtd || die
+ newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
+ newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
+
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ # we only ever want to generate this once
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ # We really don't want to use or support old PolicyKit cause it
+ # screws with the new polkit integration
+ if has_version sys-auth/policykit; then
+ rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
+ fi
+
+ # Only sysctl files ending in .conf work
+ dodir /etc/sysctl.d
+ mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
+}
+
+pkg_postinst() {
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ if ! use policykit; then
+ elog "To allow normal users to connect to libvirtd you must change the"
+ elog "unix sock group and/or perms in /etc/libvirt/libvirtd.conf"
+ fi
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ readme.gentoo_print_elog
+
+ if use caps && use qemu; then
+ elog "libvirt will now start qemu/kvm VMs with non-root privileges."
+ elog "Ensure any resources your VMs use are accessible by qemu:qemu"
+ fi
+
+ if [[ -n "${REPLACING_VERSIONS}" ]]; then
+ elog ""
+ elog "The systemd service-file configuration under /etc/sysconfig has"
+ elog "been removed. Please use"
+ elog " /etc/systemd/system/libvirtd.service.d/00gentoo.conf"
+ elog "to control the '--listen' parameter for libvirtd. The configuration"
+ elog "for the libvirt-guests.service is now found under"
+ elog " /etc/libvirt/libvirt-guests.conf"
+ elog "The openrc configuration has not been changed. Thus no action is"
+ elog "required for the openrc service manager."
+ elog ""
+ fi
+}
diff --git a/app-emulation/libvirt/libvirt-1.2.17-r4.ebuild b/app-emulation/libvirt/libvirt-1.2.17-r4.ebuild
new file mode 100644
index 000000000000..783647ae937a
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-1.2.17-r4.ebuild
@@ -0,0 +1,480 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLIZE=yes
+
+MY_P="${P/_rc/-rc}"
+
+inherit eutils user autotools linux-info systemd readme.gentoo
+
+BACKPORTS=""
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://libvirt.org/libvirt.git"
+ SRC_URI=""
+ KEYWORDS=""
+ SLOT="0"
+else
+ # Versions with 4 numbers are stable updates:
+ if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
+ SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz"
+ else
+ SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz"
+ fi
+ SRC_URI+=" ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
+ http://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~x86"
+ SLOT="0/${PV}"
+fi
+S="${WORKDIR}/${P%_rc*}"
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+# TODO: Reenable IUSE wireshark-plugins
+IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
+ lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
+ selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \
+ elibc_glibc systemd"
+REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
+ lxc? ( caps libvirtd )
+ openvz? ( libvirtd )
+ qemu? ( libvirtd )
+ uml? ( libvirtd )
+ vepa? ( macvtap )
+ virtualbox? ( libvirtd )
+ xen? ( libvirtd )
+ virt-network? ( libvirtd )
+ firewalld? ( virt-network )"
+
+# gettext.sh command is used by the libvirt command wrappers, and it's
+# non-optional, so put it into RDEPEND.
+# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
+# package will use 3 by default. Since we don't have slot pinning in an API,
+# we must go with the most recent
+RDEPEND="sys-libs/readline:=
+ sys-libs/ncurses
+ >=net-misc/curl-7.18.0
+ net-firewall/ebtables
+ >=net-firewall/iptables-1.4.10[ipv6]
+ dev-libs/libgcrypt:0
+ >=dev-libs/libxml2-2.7.6
+ dev-libs/libnl:3
+ >=net-libs/gnutls-1.0.25
+ net-libs/libssh2
+ sys-apps/dmidecode
+ >=sys-apps/util-linux-2.17
+ sys-devel/gettext
+ >=net-analyzer/netcat6-1.0-r2
+ app-misc/scrub
+ apparmor? ( sys-libs/libapparmor )
+ audit? ( sys-process/audit )
+ avahi? ( >=net-dns/avahi-0.6[dbus] )
+ caps? ( sys-libs/libcap-ng )
+ fuse? ( >=sys-fs/fuse-2.8.6 )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
+ iscsi? ( sys-block/open-iscsi )
+ lxc? ( !systemd? ( sys-power/pm-utils ) )
+ lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
+ nfs? ( net-fs/nfs-utils )
+ numa? (
+ >sys-process/numactl-2.0.2
+ sys-process/numad
+ )
+ openvz? ( sys-kernel/openvz-sources:* )
+ parted? (
+ >=sys-block/parted-1.8[device-mapper]
+ sys-fs/lvm2
+ )
+ pcap? ( >=net-libs/libpcap-1.0.0 )
+ policykit? ( >=sys-auth/polkit-0.9 )
+ qemu? (
+ >=app-emulation/qemu-0.13.0
+ dev-libs/yajl
+ !systemd? ( sys-power/pm-utils )
+ )
+ rbd? ( sys-cluster/ceph )
+ sasl? ( dev-libs/cyrus-sasl )
+ selinux? ( >=sys-libs/libselinux-2.0.85 )
+ systemd? ( sys-apps/systemd )
+ virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
+ wireshark-plugins? ( net-analyzer/wireshark:= )
+ xen? ( app-emulation/xen-tools app-emulation/xen )
+ udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
+ virt-network? ( net-dns/dnsmasq[script]
+ net-misc/radvd
+ sys-apps/iproute2[-minimal]
+ firewalld? ( net-firewall/firewalld )
+ )
+ elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-text/xhtml1
+ dev-lang/perl
+ dev-perl/XML-XPath
+ dev-libs/libxslt"
+
+# gentoo.readme stuff:
+DISABLE_AUTOFORMATTING=true
+DOC_CONTENTS="For the basic networking support (bridged and routed networks) you don't
+need any extra software. For more complex network modes including but not
+limited to NATed network, you can enable the 'virt-network' USE flag.
+
+If you are using dnsmasq on your system, you will have to configure
+/etc/dnsmasq.conf to enable the following settings:
+ bind-interfaces
+ interface or except-interface
+Otherwise you might have issues with your existing DNS server.
+
+For openrc users:
+
+ Please use /etc/conf.d/libvirtd to control the '--listen' parameter for
+ libvirtd.
+
+ The default configuration will suspend and resume running kvm guests
+ with 'managedsave'. This behavior can be changed under
+ /etc/conf.d/libvirtd
+
+For systemd users:
+
+ Please use /etc/systemd/system/libvirtd.service.d/00gentoo.conf
+ to control the '--listen' parameter for libvirtd.
+
+ The configuration for the 'libvirt-guests.service' is found under
+ /etc/libvirt/libvirt-guests.conf"
+
+! use policykit && DOC_CONTENTS+="
+
+To allow normal users to connect to libvirtd you must change the unix sock
+group and/or perms in /etc/libvirt/libvirtd.conf"
+
+use caps && use qemu && DOC_CONTENTS+="
+
+libvirt will now start qemu/kvm VMs with non-root privileges. Ensure any
+resources your VMs use are accessible by qemu:qemu"
+
+LXC_CONFIG_CHECK="
+ ~CGROUPS
+ ~CGROUP_FREEZER
+ ~CGROUP_DEVICE
+ ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+ ~CGROUP_PERF
+ ~BLK_CGROUP
+ ~NET_CLS_CGROUP
+ ~CGROUP_NET_PRIO
+ ~CPUSETS
+ ~NAMESPACES
+ ~UTS_NS
+ ~IPC_NS
+ ~PID_NS
+ ~NET_NS
+ ~USER_NS
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~VETH
+ ~MACVLAN
+ ~POSIX_MQUEUE
+ ~SECURITYFS
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+VIRTNET_CONFIG_CHECK="
+ ~BRIDGE_NF_EBTABLES
+ ~BRIDGE_EBT_MARK_T
+ ~NETFILTER_ADVANCED
+ ~NETFILTER_XT_TARGET_CHECKSUM
+ ~NETFILTER_XT_CONNMARK
+ ~NETFILTER_XT_MARK
+"
+
+BWLMT_CONFIG_CHECK="
+ ~BRIDGE_EBT_T_NAT
+ ~NET_SCH_HTB
+ ~NET_SCH_SFQ
+ ~NET_SCH_INGRESS
+ ~NET_CLS_FW
+ ~NET_CLS_U32
+ ~NET_ACT_POLICE
+"
+
+MACVTAP_CONFIG_CHECK=" ~MACVTAP"
+
+LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
+
+ERROR_USER_NS="Optional depending on LXC configuration."
+
+pkg_setup() {
+ enewgroup qemu 77
+ enewuser qemu 77 -1 -1 qemu kvm
+
+ # Some people used the masked ebuild which was not adding the qemu
+ # user to the kvm group originally. This results in VMs failing to
+ # start for some users. bug #430808
+ egetent group kvm | grep -q qemu
+ if [[ $? -ne 0 ]]; then
+ gpasswd -a qemu kvm
+ fi
+
+ # Handle specific kernel versions for different features
+ kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+ kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
+
+ CONFIG_CHECK=""
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
+ use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
+ use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
+ use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
+ # Bandwidth Limiting Support
+ use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}"
+ if [[ -n ${CONFIG_CHECK} ]]; then
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ touch "${S}/.mailmap"
+
+ if [[ ${PV} = *9999* ]]; then
+ # git checkouts require bootstrapping to create the configure script.
+ # Additionally the submodules must be cloned to the right locations
+ # bug #377279
+ ./bootstrap || die "bootstrap failed"
+ (
+ git submodule status | sed 's/^[ +-]//;s/ .*//'
+ git hash-object bootstrap.conf
+ ) >.git-module-status
+ fi
+
+ epatch \
+ "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \
+ "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
+ "${FILESDIR}"/${P}-fix_paths_for_apparmor.patch
+
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
+ EPATCH_SOURCE="${WORKDIR}/patches" epatch
+
+ epatch_user
+
+ [[ -n ${AUTOTOOLIZE} ]] && eautoreconf
+
+ # Tweak the init script
+ local avahi_init=
+ local iscsi_init=
+ local rbd_init=
+ local firewalld_init=
+ cp "${FILESDIR}/libvirtd.init-r14" "${S}/libvirtd.init"
+ use avahi && avahi_init='avahi-daemon'
+ use iscsi && iscsi_init='iscsid'
+ use rbd && rbd_init='ceph'
+ use firewalld && firewalld_init='need firewalld'
+
+ sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
+}
+
+src_configure() {
+ local myconf=""
+
+ ## enable/disable daemon, otherwise client only utils
+ myconf+=" $(use_with libvirtd)"
+
+ ## enable/disable the daemon using avahi to find VMs
+ myconf+=" $(use_with avahi)"
+
+ ## hypervisors on the local host
+ myconf+=" $(use_with xen) $(use_with xen xen-inotify)"
+ myconf+=" --without-xenapi"
+ if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
+ myconf+=" --with-libxl"
+ else
+ myconf+=" --without-libxl"
+ fi
+ myconf+=" $(use_with openvz)"
+ myconf+=" $(use_with lxc)"
+ if use virtualbox && has_version app-emulation/virtualbox-ose; then
+ myconf+=" --with-vbox=/usr/lib/virtualbox-ose/"
+ else
+ myconf+=" $(use_with virtualbox vbox)"
+ fi
+ myconf+=" $(use_with uml)"
+ myconf+=" $(use_with qemu)"
+ myconf+=" $(use_with qemu yajl)" # Use QMP over HMP
+ myconf+=" $(use_with phyp)"
+ myconf+=" --with-esx"
+ myconf+=" --with-vmware"
+
+ ## additional host drivers
+ myconf+=" $(use_with apparmor)"
+ myconf+=" $(use_with apparmor apparmor-profiles)"
+ myconf+=" $(use_with virt-network network)"
+ myconf+=" --with-storage-fs"
+ myconf+=" $(use_with lvm storage-lvm)"
+ myconf+=" $(use_with iscsi storage-iscsi)"
+ myconf+=" $(use_with parted storage-disk)"
+ mycond+=" $(use_with glusterfs)"
+ mycond+=" $(use_with glusterfs storage-gluster)"
+ myconf+=" $(use_with lvm storage-mpath)"
+ myconf+=" $(use_with rbd storage-rbd)"
+ myconf+=" $(use_with numa numactl)"
+ myconf+=" $(use_with numa numad)"
+ myconf+=" $(use_with selinux)"
+ myconf+=" $(use_with fuse)"
+
+ # udev for device support details
+ myconf+=" $(use_with udev)"
+ myconf+=" --without-hal"
+
+ # linux capability support so we don't need privileged accounts
+ myconf+=" $(use_with caps capng)"
+
+ ## auth stuff
+ myconf+=" $(use_with policykit polkit)"
+ myconf+=" $(use_with sasl)"
+
+ # network bits
+ myconf+=" $(use_with macvtap)"
+ myconf+=" $(use_with pcap libpcap)"
+ myconf+=" $(use_with vepa virtualport)"
+ myconf+=" $(use_with firewalld)"
+
+ ## other
+ myconf+=" $(use_enable nls)"
+
+ # user privilege bits fir qemu/kvm
+ if use caps; then
+ myconf+=" --with-qemu-user=qemu"
+ myconf+=" --with-qemu-group=qemu"
+ else
+ myconf+=" --with-qemu-user=root"
+ myconf+=" --with-qemu-group=root"
+ fi
+
+ # audit support
+ myconf+=" $(use_with audit)"
+
+ # wireshark dissector
+ myconf+=" $(use_with wireshark-plugins wireshark-dissector)"
+
+ ## stuff we don't yet support
+ myconf+=" --without-netcf"
+
+ # locking support
+ myconf+=" --without-sanlock"
+
+ # systemd unit files
+ myconf+=" $(use_with systemd systemd-daemon)"
+ use systemd && myconf+=" --with-init-script=systemd"
+
+ # this is a nasty trick to work around the problem in bug
+ # #275073. The reason why we don't solve this properly is that
+ # it'll require us to rebuild autotools (and we don't really want
+ # to do that right now). The proper solution has been sent
+ # upstream and should hopefully land in 0.7.7, in the mean time,
+ # mime the same functionality with this.
+ case ${CHOST} in
+ *cygwin* | *mingw* )
+ ;;
+ *)
+ ac_cv_prog_WINDRES=no
+ ;;
+ esac
+
+ econf \
+ ${myconf} \
+ --disable-static \
+ --disable-werror \
+ --with-remote \
+ --docdir=/usr/share/doc/${PF} \
+ --localstatedir=/var
+
+ if [[ ${PV} = *9999* ]]; then
+ # Restore gnulib's config.sub and config.guess
+ # bug #377279
+ (cd .gnulib && git reset --hard > /dev/null)
+ fi
+}
+
+src_test() {
+ # Explicitly allow parallel build of tests
+ export VIR_TEST_DEBUG=1
+ HOME="${T}" emake check || die "tests failed"
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ HTML_DIR=/usr/share/doc/${PF}/html \
+ DOCS_DIR=/usr/share/doc/${PF} \
+ EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
+ SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
+ || die "emake install failed"
+
+ find "${D}" -name '*.la' -delete || die
+
+ # Remove bogus, empty directories. They are either not used, or
+ # libvirtd is able to create them on demand
+ rm -rf "${D}"/etc/sysconfig
+ rm -rf "${D}"/var/cache
+ rm -rf "${D}"/var/run
+ rm -rf "${D}"/var/log
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ use systemd && systemd_install_serviced \
+ "${FILESDIR}"/libvirtd.service.conf libvirtd.service
+
+ systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
+
+ newinitd "${S}/libvirtd.init" libvirtd || die
+ newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
+ newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
+
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ # we only ever want to generate this once
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ # We really don't want to use or support old PolicyKit cause it
+ # screws with the new polkit integration
+ if has_version sys-auth/policykit; then
+ rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
+ fi
+
+ # Only sysctl files ending in .conf work
+ dodir /etc/sysctl.d
+ mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
+}
+
+pkg_postinst() {
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.17-r2 ${REPLACING_VERSIONS} ]]; then
+ FORCE_PRINT_ELOG=true
+ fi
+
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/libvirt/libvirt-1.2.18.ebuild b/app-emulation/libvirt/libvirt-1.2.18.ebuild
new file mode 100644
index 000000000000..9fcab0928995
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-1.2.18.ebuild
@@ -0,0 +1,480 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLIZE=yes
+
+MY_P="${P/_rc/-rc}"
+
+inherit eutils user autotools linux-info systemd readme.gentoo
+
+BACKPORTS=""
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://libvirt.org/libvirt.git"
+ SRC_URI=""
+ KEYWORDS=""
+ SLOT="0"
+else
+ # Versions with 4 numbers are stable updates:
+ if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
+ SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz"
+ else
+ SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz"
+ fi
+ SRC_URI+=" ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
+ http://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~x86"
+ SLOT="0/${PV}"
+fi
+S="${WORKDIR}/${P%_rc*}"
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+# TODO: Reenable IUSE wireshark-plugins
+IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
+ lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
+ selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \
+ elibc_glibc systemd"
+REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
+ lxc? ( caps libvirtd )
+ openvz? ( libvirtd )
+ qemu? ( libvirtd )
+ uml? ( libvirtd )
+ vepa? ( macvtap )
+ virtualbox? ( libvirtd )
+ xen? ( libvirtd )
+ virt-network? ( libvirtd )
+ firewalld? ( virt-network )"
+
+# gettext.sh command is used by the libvirt command wrappers, and it's
+# non-optional, so put it into RDEPEND.
+# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
+# package will use 3 by default. Since we don't have slot pinning in an API,
+# we must go with the most recent
+RDEPEND="sys-libs/readline:=
+ sys-libs/ncurses
+ >=net-misc/curl-7.18.0
+ net-firewall/ebtables
+ >=net-firewall/iptables-1.4.10[ipv6]
+ dev-libs/libgcrypt:0
+ >=dev-libs/libxml2-2.7.6
+ dev-libs/libnl:3
+ >=net-libs/gnutls-1.0.25
+ net-libs/libssh2
+ sys-apps/dmidecode
+ >=sys-apps/util-linux-2.17
+ sys-devel/gettext
+ >=net-analyzer/netcat6-1.0-r2
+ app-misc/scrub
+ apparmor? ( sys-libs/libapparmor )
+ audit? ( sys-process/audit )
+ avahi? ( >=net-dns/avahi-0.6[dbus] )
+ caps? ( sys-libs/libcap-ng )
+ fuse? ( >=sys-fs/fuse-2.8.6 )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
+ iscsi? ( sys-block/open-iscsi )
+ lxc? ( !systemd? ( sys-power/pm-utils ) )
+ lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
+ nfs? ( net-fs/nfs-utils )
+ numa? (
+ >sys-process/numactl-2.0.2
+ sys-process/numad
+ )
+ openvz? ( sys-kernel/openvz-sources:* )
+ parted? (
+ >=sys-block/parted-1.8[device-mapper]
+ sys-fs/lvm2
+ )
+ pcap? ( >=net-libs/libpcap-1.0.0 )
+ policykit? ( >=sys-auth/polkit-0.9 )
+ qemu? (
+ >=app-emulation/qemu-0.13.0
+ dev-libs/yajl
+ !systemd? ( sys-power/pm-utils )
+ )
+ rbd? ( sys-cluster/ceph )
+ sasl? ( dev-libs/cyrus-sasl )
+ selinux? ( >=sys-libs/libselinux-2.0.85 )
+ systemd? ( sys-apps/systemd )
+ virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
+ wireshark-plugins? ( net-analyzer/wireshark:= )
+ xen? ( app-emulation/xen-tools app-emulation/xen )
+ udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
+ virt-network? ( net-dns/dnsmasq[script]
+ net-misc/radvd
+ sys-apps/iproute2[-minimal]
+ firewalld? ( net-firewall/firewalld )
+ )
+ elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-text/xhtml1
+ dev-lang/perl
+ dev-perl/XML-XPath
+ dev-libs/libxslt"
+
+# gentoo.readme stuff:
+DISABLE_AUTOFORMATTING=true
+DOC_CONTENTS="For the basic networking support (bridged and routed networks) you don't
+need any extra software. For more complex network modes including but not
+limited to NATed network, you can enable the 'virt-network' USE flag.
+
+If you are using dnsmasq on your system, you will have to configure
+/etc/dnsmasq.conf to enable the following settings:
+ bind-interfaces
+ interface or except-interface
+Otherwise you might have issues with your existing DNS server.
+
+For openrc users:
+
+ Please use /etc/conf.d/libvirtd to control the '--listen' parameter for
+ libvirtd.
+
+ The default configuration will suspend and resume running kvm guests
+ with 'managedsave'. This behavior can be changed under
+ /etc/conf.d/libvirtd
+
+For systemd users:
+
+ Please use /etc/systemd/system/libvirtd.service.d/00gentoo.conf
+ to control the '--listen' parameter for libvirtd.
+
+ The configuration for the 'libvirt-guests.service' is found under
+ /etc/libvirt/libvirt-guests.conf"
+
+! use policykit && DOC_CONTENTS+="
+
+To allow normal users to connect to libvirtd you must change the unix sock
+group and/or perms in /etc/libvirt/libvirtd.conf"
+
+use caps && use qemu && DOC_CONTENTS+="
+
+libvirt will now start qemu/kvm VMs with non-root privileges. Ensure any
+resources your VMs use are accessible by qemu:qemu"
+
+LXC_CONFIG_CHECK="
+ ~CGROUPS
+ ~CGROUP_FREEZER
+ ~CGROUP_DEVICE
+ ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+ ~CGROUP_PERF
+ ~BLK_CGROUP
+ ~NET_CLS_CGROUP
+ ~CGROUP_NET_PRIO
+ ~CPUSETS
+ ~NAMESPACES
+ ~UTS_NS
+ ~IPC_NS
+ ~PID_NS
+ ~NET_NS
+ ~USER_NS
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~VETH
+ ~MACVLAN
+ ~POSIX_MQUEUE
+ ~SECURITYFS
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+VIRTNET_CONFIG_CHECK="
+ ~BRIDGE_NF_EBTABLES
+ ~BRIDGE_EBT_MARK_T
+ ~NETFILTER_ADVANCED
+ ~NETFILTER_XT_TARGET_CHECKSUM
+ ~NETFILTER_XT_CONNMARK
+ ~NETFILTER_XT_MARK
+"
+
+BWLMT_CONFIG_CHECK="
+ ~BRIDGE_EBT_T_NAT
+ ~NET_SCH_HTB
+ ~NET_SCH_SFQ
+ ~NET_SCH_INGRESS
+ ~NET_CLS_FW
+ ~NET_CLS_U32
+ ~NET_ACT_POLICE
+"
+
+MACVTAP_CONFIG_CHECK=" ~MACVTAP"
+
+LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
+
+ERROR_USER_NS="Optional depending on LXC configuration."
+
+pkg_setup() {
+ enewgroup qemu 77
+ enewuser qemu 77 -1 -1 qemu kvm
+
+ # Some people used the masked ebuild which was not adding the qemu
+ # user to the kvm group originally. This results in VMs failing to
+ # start for some users. bug #430808
+ egetent group kvm | grep -q qemu
+ if [[ $? -ne 0 ]]; then
+ gpasswd -a qemu kvm
+ fi
+
+ # Handle specific kernel versions for different features
+ kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+ kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
+
+ CONFIG_CHECK=""
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
+ use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
+ use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
+ use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
+ # Bandwidth Limiting Support
+ use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}"
+ if [[ -n ${CONFIG_CHECK} ]]; then
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ touch "${S}/.mailmap"
+
+ if [[ ${PV} = *9999* ]]; then
+ # git checkouts require bootstrapping to create the configure script.
+ # Additionally the submodules must be cloned to the right locations
+ # bug #377279
+ ./bootstrap || die "bootstrap failed"
+ (
+ git submodule status | sed 's/^[ +-]//;s/ .*//'
+ git hash-object bootstrap.conf
+ ) >.git-module-status
+ fi
+
+ epatch \
+ "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \
+ "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
+ "${FILESDIR}"/${PN}-1.2.17-fix_paths_for_apparmor.patch
+
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
+ EPATCH_SOURCE="${WORKDIR}/patches" epatch
+
+ epatch_user
+
+ [[ -n ${AUTOTOOLIZE} ]] && eautoreconf
+
+ # Tweak the init script
+ local avahi_init=
+ local iscsi_init=
+ local rbd_init=
+ local firewalld_init=
+ cp "${FILESDIR}/libvirtd.init-r14" "${S}/libvirtd.init"
+ use avahi && avahi_init='avahi-daemon'
+ use iscsi && iscsi_init='iscsid'
+ use rbd && rbd_init='ceph'
+ use firewalld && firewalld_init='need firewalld'
+
+ sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
+}
+
+src_configure() {
+ local myconf=""
+
+ ## enable/disable daemon, otherwise client only utils
+ myconf+=" $(use_with libvirtd)"
+
+ ## enable/disable the daemon using avahi to find VMs
+ myconf+=" $(use_with avahi)"
+
+ ## hypervisors on the local host
+ myconf+=" $(use_with xen) $(use_with xen xen-inotify)"
+ myconf+=" --without-xenapi"
+ if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
+ myconf+=" --with-libxl"
+ else
+ myconf+=" --without-libxl"
+ fi
+ myconf+=" $(use_with openvz)"
+ myconf+=" $(use_with lxc)"
+ if use virtualbox && has_version app-emulation/virtualbox-ose; then
+ myconf+=" --with-vbox=/usr/lib/virtualbox-ose/"
+ else
+ myconf+=" $(use_with virtualbox vbox)"
+ fi
+ myconf+=" $(use_with uml)"
+ myconf+=" $(use_with qemu)"
+ myconf+=" $(use_with qemu yajl)" # Use QMP over HMP
+ myconf+=" $(use_with phyp)"
+ myconf+=" --with-esx"
+ myconf+=" --with-vmware"
+
+ ## additional host drivers
+ myconf+=" $(use_with apparmor)"
+ myconf+=" $(use_with apparmor apparmor-profiles)"
+ myconf+=" $(use_with virt-network network)"
+ myconf+=" --with-storage-fs"
+ myconf+=" $(use_with lvm storage-lvm)"
+ myconf+=" $(use_with iscsi storage-iscsi)"
+ myconf+=" $(use_with parted storage-disk)"
+ mycond+=" $(use_with glusterfs)"
+ mycond+=" $(use_with glusterfs storage-gluster)"
+ myconf+=" $(use_with lvm storage-mpath)"
+ myconf+=" $(use_with rbd storage-rbd)"
+ myconf+=" $(use_with numa numactl)"
+ myconf+=" $(use_with numa numad)"
+ myconf+=" $(use_with selinux)"
+ myconf+=" $(use_with fuse)"
+
+ # udev for device support details
+ myconf+=" $(use_with udev)"
+ myconf+=" --without-hal"
+
+ # linux capability support so we don't need privileged accounts
+ myconf+=" $(use_with caps capng)"
+
+ ## auth stuff
+ myconf+=" $(use_with policykit polkit)"
+ myconf+=" $(use_with sasl)"
+
+ # network bits
+ myconf+=" $(use_with macvtap)"
+ myconf+=" $(use_with pcap libpcap)"
+ myconf+=" $(use_with vepa virtualport)"
+ myconf+=" $(use_with firewalld)"
+
+ ## other
+ myconf+=" $(use_enable nls)"
+
+ # user privilege bits fir qemu/kvm
+ if use caps; then
+ myconf+=" --with-qemu-user=qemu"
+ myconf+=" --with-qemu-group=qemu"
+ else
+ myconf+=" --with-qemu-user=root"
+ myconf+=" --with-qemu-group=root"
+ fi
+
+ # audit support
+ myconf+=" $(use_with audit)"
+
+ # wireshark dissector
+ myconf+=" $(use_with wireshark-plugins wireshark-dissector)"
+
+ ## stuff we don't yet support
+ myconf+=" --without-netcf"
+
+ # locking support
+ myconf+=" --without-sanlock"
+
+ # systemd unit files
+ myconf+=" $(use_with systemd systemd-daemon)"
+ use systemd && myconf+=" --with-init-script=systemd"
+
+ # this is a nasty trick to work around the problem in bug
+ # #275073. The reason why we don't solve this properly is that
+ # it'll require us to rebuild autotools (and we don't really want
+ # to do that right now). The proper solution has been sent
+ # upstream and should hopefully land in 0.7.7, in the mean time,
+ # mime the same functionality with this.
+ case ${CHOST} in
+ *cygwin* | *mingw* )
+ ;;
+ *)
+ ac_cv_prog_WINDRES=no
+ ;;
+ esac
+
+ econf \
+ ${myconf} \
+ --disable-static \
+ --disable-werror \
+ --with-remote \
+ --docdir=/usr/share/doc/${PF} \
+ --localstatedir=/var
+
+ if [[ ${PV} = *9999* ]]; then
+ # Restore gnulib's config.sub and config.guess
+ # bug #377279
+ (cd .gnulib && git reset --hard > /dev/null)
+ fi
+}
+
+src_test() {
+ # Explicitly allow parallel build of tests
+ export VIR_TEST_DEBUG=1
+ HOME="${T}" emake check || die "tests failed"
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ HTML_DIR=/usr/share/doc/${PF}/html \
+ DOCS_DIR=/usr/share/doc/${PF} \
+ EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
+ SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
+ || die "emake install failed"
+
+ find "${D}" -name '*.la' -delete || die
+
+ # Remove bogus, empty directories. They are either not used, or
+ # libvirtd is able to create them on demand
+ rm -rf "${D}"/etc/sysconfig
+ rm -rf "${D}"/var/cache
+ rm -rf "${D}"/var/run
+ rm -rf "${D}"/var/log
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ use systemd && systemd_install_serviced \
+ "${FILESDIR}"/libvirtd.service.conf libvirtd.service
+
+ systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
+
+ newinitd "${S}/libvirtd.init" libvirtd || die
+ newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
+ newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
+
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ # we only ever want to generate this once
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ # We really don't want to use or support old PolicyKit cause it
+ # screws with the new polkit integration
+ if has_version sys-auth/policykit; then
+ rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
+ fi
+
+ # Only sysctl files ending in .conf work
+ dodir /etc/sysctl.d
+ mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
+}
+
+pkg_postinst() {
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.17-r2 ${REPLACING_VERSIONS} ]]; then
+ FORCE_PRINT_ELOG=true
+ fi
+
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/libvirt/libvirt-9999.ebuild b/app-emulation/libvirt/libvirt-9999.ebuild
new file mode 100644
index 000000000000..783647ae937a
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-9999.ebuild
@@ -0,0 +1,480 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLIZE=yes
+
+MY_P="${P/_rc/-rc}"
+
+inherit eutils user autotools linux-info systemd readme.gentoo
+
+BACKPORTS=""
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://libvirt.org/libvirt.git"
+ SRC_URI=""
+ KEYWORDS=""
+ SLOT="0"
+else
+ # Versions with 4 numbers are stable updates:
+ if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
+ SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz"
+ else
+ SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz"
+ fi
+ SRC_URI+=" ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
+ http://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~x86"
+ SLOT="0/${PV}"
+fi
+S="${WORKDIR}/${P%_rc*}"
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+# TODO: Reenable IUSE wireshark-plugins
+IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
+ lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
+ selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \
+ elibc_glibc systemd"
+REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
+ lxc? ( caps libvirtd )
+ openvz? ( libvirtd )
+ qemu? ( libvirtd )
+ uml? ( libvirtd )
+ vepa? ( macvtap )
+ virtualbox? ( libvirtd )
+ xen? ( libvirtd )
+ virt-network? ( libvirtd )
+ firewalld? ( virt-network )"
+
+# gettext.sh command is used by the libvirt command wrappers, and it's
+# non-optional, so put it into RDEPEND.
+# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
+# package will use 3 by default. Since we don't have slot pinning in an API,
+# we must go with the most recent
+RDEPEND="sys-libs/readline:=
+ sys-libs/ncurses
+ >=net-misc/curl-7.18.0
+ net-firewall/ebtables
+ >=net-firewall/iptables-1.4.10[ipv6]
+ dev-libs/libgcrypt:0
+ >=dev-libs/libxml2-2.7.6
+ dev-libs/libnl:3
+ >=net-libs/gnutls-1.0.25
+ net-libs/libssh2
+ sys-apps/dmidecode
+ >=sys-apps/util-linux-2.17
+ sys-devel/gettext
+ >=net-analyzer/netcat6-1.0-r2
+ app-misc/scrub
+ apparmor? ( sys-libs/libapparmor )
+ audit? ( sys-process/audit )
+ avahi? ( >=net-dns/avahi-0.6[dbus] )
+ caps? ( sys-libs/libcap-ng )
+ fuse? ( >=sys-fs/fuse-2.8.6 )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
+ iscsi? ( sys-block/open-iscsi )
+ lxc? ( !systemd? ( sys-power/pm-utils ) )
+ lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
+ nfs? ( net-fs/nfs-utils )
+ numa? (
+ >sys-process/numactl-2.0.2
+ sys-process/numad
+ )
+ openvz? ( sys-kernel/openvz-sources:* )
+ parted? (
+ >=sys-block/parted-1.8[device-mapper]
+ sys-fs/lvm2
+ )
+ pcap? ( >=net-libs/libpcap-1.0.0 )
+ policykit? ( >=sys-auth/polkit-0.9 )
+ qemu? (
+ >=app-emulation/qemu-0.13.0
+ dev-libs/yajl
+ !systemd? ( sys-power/pm-utils )
+ )
+ rbd? ( sys-cluster/ceph )
+ sasl? ( dev-libs/cyrus-sasl )
+ selinux? ( >=sys-libs/libselinux-2.0.85 )
+ systemd? ( sys-apps/systemd )
+ virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
+ wireshark-plugins? ( net-analyzer/wireshark:= )
+ xen? ( app-emulation/xen-tools app-emulation/xen )
+ udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
+ virt-network? ( net-dns/dnsmasq[script]
+ net-misc/radvd
+ sys-apps/iproute2[-minimal]
+ firewalld? ( net-firewall/firewalld )
+ )
+ elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-text/xhtml1
+ dev-lang/perl
+ dev-perl/XML-XPath
+ dev-libs/libxslt"
+
+# gentoo.readme stuff:
+DISABLE_AUTOFORMATTING=true
+DOC_CONTENTS="For the basic networking support (bridged and routed networks) you don't
+need any extra software. For more complex network modes including but not
+limited to NATed network, you can enable the 'virt-network' USE flag.
+
+If you are using dnsmasq on your system, you will have to configure
+/etc/dnsmasq.conf to enable the following settings:
+ bind-interfaces
+ interface or except-interface
+Otherwise you might have issues with your existing DNS server.
+
+For openrc users:
+
+ Please use /etc/conf.d/libvirtd to control the '--listen' parameter for
+ libvirtd.
+
+ The default configuration will suspend and resume running kvm guests
+ with 'managedsave'. This behavior can be changed under
+ /etc/conf.d/libvirtd
+
+For systemd users:
+
+ Please use /etc/systemd/system/libvirtd.service.d/00gentoo.conf
+ to control the '--listen' parameter for libvirtd.
+
+ The configuration for the 'libvirt-guests.service' is found under
+ /etc/libvirt/libvirt-guests.conf"
+
+! use policykit && DOC_CONTENTS+="
+
+To allow normal users to connect to libvirtd you must change the unix sock
+group and/or perms in /etc/libvirt/libvirtd.conf"
+
+use caps && use qemu && DOC_CONTENTS+="
+
+libvirt will now start qemu/kvm VMs with non-root privileges. Ensure any
+resources your VMs use are accessible by qemu:qemu"
+
+LXC_CONFIG_CHECK="
+ ~CGROUPS
+ ~CGROUP_FREEZER
+ ~CGROUP_DEVICE
+ ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+ ~CGROUP_PERF
+ ~BLK_CGROUP
+ ~NET_CLS_CGROUP
+ ~CGROUP_NET_PRIO
+ ~CPUSETS
+ ~NAMESPACES
+ ~UTS_NS
+ ~IPC_NS
+ ~PID_NS
+ ~NET_NS
+ ~USER_NS
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~VETH
+ ~MACVLAN
+ ~POSIX_MQUEUE
+ ~SECURITYFS
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+VIRTNET_CONFIG_CHECK="
+ ~BRIDGE_NF_EBTABLES
+ ~BRIDGE_EBT_MARK_T
+ ~NETFILTER_ADVANCED
+ ~NETFILTER_XT_TARGET_CHECKSUM
+ ~NETFILTER_XT_CONNMARK
+ ~NETFILTER_XT_MARK
+"
+
+BWLMT_CONFIG_CHECK="
+ ~BRIDGE_EBT_T_NAT
+ ~NET_SCH_HTB
+ ~NET_SCH_SFQ
+ ~NET_SCH_INGRESS
+ ~NET_CLS_FW
+ ~NET_CLS_U32
+ ~NET_ACT_POLICE
+"
+
+MACVTAP_CONFIG_CHECK=" ~MACVTAP"
+
+LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
+
+ERROR_USER_NS="Optional depending on LXC configuration."
+
+pkg_setup() {
+ enewgroup qemu 77
+ enewuser qemu 77 -1 -1 qemu kvm
+
+ # Some people used the masked ebuild which was not adding the qemu
+ # user to the kvm group originally. This results in VMs failing to
+ # start for some users. bug #430808
+ egetent group kvm | grep -q qemu
+ if [[ $? -ne 0 ]]; then
+ gpasswd -a qemu kvm
+ fi
+
+ # Handle specific kernel versions for different features
+ kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+ kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
+
+ CONFIG_CHECK=""
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
+ use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
+ use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
+ use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
+ # Bandwidth Limiting Support
+ use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}"
+ if [[ -n ${CONFIG_CHECK} ]]; then
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ touch "${S}/.mailmap"
+
+ if [[ ${PV} = *9999* ]]; then
+ # git checkouts require bootstrapping to create the configure script.
+ # Additionally the submodules must be cloned to the right locations
+ # bug #377279
+ ./bootstrap || die "bootstrap failed"
+ (
+ git submodule status | sed 's/^[ +-]//;s/ .*//'
+ git hash-object bootstrap.conf
+ ) >.git-module-status
+ fi
+
+ epatch \
+ "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \
+ "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
+ "${FILESDIR}"/${P}-fix_paths_for_apparmor.patch
+
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
+ EPATCH_SOURCE="${WORKDIR}/patches" epatch
+
+ epatch_user
+
+ [[ -n ${AUTOTOOLIZE} ]] && eautoreconf
+
+ # Tweak the init script
+ local avahi_init=
+ local iscsi_init=
+ local rbd_init=
+ local firewalld_init=
+ cp "${FILESDIR}/libvirtd.init-r14" "${S}/libvirtd.init"
+ use avahi && avahi_init='avahi-daemon'
+ use iscsi && iscsi_init='iscsid'
+ use rbd && rbd_init='ceph'
+ use firewalld && firewalld_init='need firewalld'
+
+ sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
+}
+
+src_configure() {
+ local myconf=""
+
+ ## enable/disable daemon, otherwise client only utils
+ myconf+=" $(use_with libvirtd)"
+
+ ## enable/disable the daemon using avahi to find VMs
+ myconf+=" $(use_with avahi)"
+
+ ## hypervisors on the local host
+ myconf+=" $(use_with xen) $(use_with xen xen-inotify)"
+ myconf+=" --without-xenapi"
+ if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
+ myconf+=" --with-libxl"
+ else
+ myconf+=" --without-libxl"
+ fi
+ myconf+=" $(use_with openvz)"
+ myconf+=" $(use_with lxc)"
+ if use virtualbox && has_version app-emulation/virtualbox-ose; then
+ myconf+=" --with-vbox=/usr/lib/virtualbox-ose/"
+ else
+ myconf+=" $(use_with virtualbox vbox)"
+ fi
+ myconf+=" $(use_with uml)"
+ myconf+=" $(use_with qemu)"
+ myconf+=" $(use_with qemu yajl)" # Use QMP over HMP
+ myconf+=" $(use_with phyp)"
+ myconf+=" --with-esx"
+ myconf+=" --with-vmware"
+
+ ## additional host drivers
+ myconf+=" $(use_with apparmor)"
+ myconf+=" $(use_with apparmor apparmor-profiles)"
+ myconf+=" $(use_with virt-network network)"
+ myconf+=" --with-storage-fs"
+ myconf+=" $(use_with lvm storage-lvm)"
+ myconf+=" $(use_with iscsi storage-iscsi)"
+ myconf+=" $(use_with parted storage-disk)"
+ mycond+=" $(use_with glusterfs)"
+ mycond+=" $(use_with glusterfs storage-gluster)"
+ myconf+=" $(use_with lvm storage-mpath)"
+ myconf+=" $(use_with rbd storage-rbd)"
+ myconf+=" $(use_with numa numactl)"
+ myconf+=" $(use_with numa numad)"
+ myconf+=" $(use_with selinux)"
+ myconf+=" $(use_with fuse)"
+
+ # udev for device support details
+ myconf+=" $(use_with udev)"
+ myconf+=" --without-hal"
+
+ # linux capability support so we don't need privileged accounts
+ myconf+=" $(use_with caps capng)"
+
+ ## auth stuff
+ myconf+=" $(use_with policykit polkit)"
+ myconf+=" $(use_with sasl)"
+
+ # network bits
+ myconf+=" $(use_with macvtap)"
+ myconf+=" $(use_with pcap libpcap)"
+ myconf+=" $(use_with vepa virtualport)"
+ myconf+=" $(use_with firewalld)"
+
+ ## other
+ myconf+=" $(use_enable nls)"
+
+ # user privilege bits fir qemu/kvm
+ if use caps; then
+ myconf+=" --with-qemu-user=qemu"
+ myconf+=" --with-qemu-group=qemu"
+ else
+ myconf+=" --with-qemu-user=root"
+ myconf+=" --with-qemu-group=root"
+ fi
+
+ # audit support
+ myconf+=" $(use_with audit)"
+
+ # wireshark dissector
+ myconf+=" $(use_with wireshark-plugins wireshark-dissector)"
+
+ ## stuff we don't yet support
+ myconf+=" --without-netcf"
+
+ # locking support
+ myconf+=" --without-sanlock"
+
+ # systemd unit files
+ myconf+=" $(use_with systemd systemd-daemon)"
+ use systemd && myconf+=" --with-init-script=systemd"
+
+ # this is a nasty trick to work around the problem in bug
+ # #275073. The reason why we don't solve this properly is that
+ # it'll require us to rebuild autotools (and we don't really want
+ # to do that right now). The proper solution has been sent
+ # upstream and should hopefully land in 0.7.7, in the mean time,
+ # mime the same functionality with this.
+ case ${CHOST} in
+ *cygwin* | *mingw* )
+ ;;
+ *)
+ ac_cv_prog_WINDRES=no
+ ;;
+ esac
+
+ econf \
+ ${myconf} \
+ --disable-static \
+ --disable-werror \
+ --with-remote \
+ --docdir=/usr/share/doc/${PF} \
+ --localstatedir=/var
+
+ if [[ ${PV} = *9999* ]]; then
+ # Restore gnulib's config.sub and config.guess
+ # bug #377279
+ (cd .gnulib && git reset --hard > /dev/null)
+ fi
+}
+
+src_test() {
+ # Explicitly allow parallel build of tests
+ export VIR_TEST_DEBUG=1
+ HOME="${T}" emake check || die "tests failed"
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ HTML_DIR=/usr/share/doc/${PF}/html \
+ DOCS_DIR=/usr/share/doc/${PF} \
+ EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
+ SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
+ || die "emake install failed"
+
+ find "${D}" -name '*.la' -delete || die
+
+ # Remove bogus, empty directories. They are either not used, or
+ # libvirtd is able to create them on demand
+ rm -rf "${D}"/etc/sysconfig
+ rm -rf "${D}"/var/cache
+ rm -rf "${D}"/var/run
+ rm -rf "${D}"/var/log
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ use systemd && systemd_install_serviced \
+ "${FILESDIR}"/libvirtd.service.conf libvirtd.service
+
+ systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
+
+ newinitd "${S}/libvirtd.init" libvirtd || die
+ newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
+ newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
+
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ # we only ever want to generate this once
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ # We really don't want to use or support old PolicyKit cause it
+ # screws with the new polkit integration
+ if has_version sys-auth/policykit; then
+ rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
+ fi
+
+ # Only sysctl files ending in .conf work
+ dodir /etc/sysctl.d
+ mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
+}
+
+pkg_postinst() {
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.17-r2 ${REPLACING_VERSIONS} ]]; then
+ FORCE_PRINT_ELOG=true
+ fi
+
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/libvirt/metadata.xml b/app-emulation/libvirt/metadata.xml
new file mode 100644
index 000000000000..34d90a3666da
--- /dev/null
+++ b/app-emulation/libvirt/metadata.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>tamiko@gentoo.org</email>
+ <name>Matthias Maier</name>
+ <description>Please assign bugs to me</description>
+</maintainer>
+<maintainer>
+ <email>cardoe@gentoo.org</email>
+ <name>Doug Goldstein</name>
+</maintainer>
+<herd>virtualization</herd>
+<use>
+ <!-- Pool backend flags -->
+ <flag name="iscsi">
+ Allow using an iSCSI remote storage server as pool for disk image storage
+ </flag>
+ <flag name="lvm">
+ Allow using the Logical Volume Manager (<pkg>sys-apps/lvm2</pkg>) as pool for disk image
+ storage
+ </flag>
+ <flag name="nfs">
+ Allow using Network File System mounts as pool for disk image storage
+ </flag>
+ <flag name="parted">
+ Allow using real disk partitions as pool for disk image storage, using
+ <pkg>sys-block/parted</pkg> to create, resize and delete them.
+ </flag>
+ <flag name="rbd">
+ Enable rados block device support via <pkg>sys-cluster/ceph</pkg>
+ </flag>
+ <!-- Virtualisation backends -->
+ <flag name="lxc">
+ Support management of Linux Containers virtualisation (<pkg>app-emulation/lxc</pkg>)
+ </flag>
+ <flag name="openvz">
+ Support management of OpenVZ virtualisation (see <pkg>sys-kernel/openvz-sources</pkg>)
+ </flag>
+ <flag name="uml">
+ Support management of User Mode Linux virtualisation
+ </flag>
+ <flag name="qemu">
+ Support management of QEMU virtualisation (<pkg>app-emulation/qemu</pkg>)
+ </flag>
+ <flag name="xen">
+ Support management of Xen virtualisation (<pkg>app-emulation/xen</pkg>)
+ </flag>
+ <flag name="virtualbox">
+ Support management of VirtualBox virtualisation (one of <pkg>app-emulation/virtualbox</pkg> or
+ <pkg>app-emulation/virtualbox-ose</pkg>)
+ </flag>
+ <flag name="phyp">
+ Support IBM HMC / IVM hypervisor via PHYP protocol
+ </flag>
+ <!-- Miscellaneous flags -->
+ <flag name="apparmor">Enable AppArmor support</flag>
+ <flag name="audit">support <pkg>sys-process/audit</pkg></flag>
+ <flag name="fuse">Allow LXC to use <pkg>sys-fs/fuse</pkg> for mount
+ points</flag>
+ <flag name="numa">
+ Use NUMA for memory segmenting via <pkg>sys-process/numactl</pkg> and
+ <pkg>sys-process/numad</pkg>
+ </flag>
+ <flag name="libvirtd">
+ Builds the libvirtd daemon as well as the client utilities instead of just the client
+ utilities
+ </flag>
+ <flag name="pcap">
+ Support auto learning IP addreses for routing
+ </flag>
+ <flag name="macvtap">
+ Support for MAC-based TAP (macvlan/macvtap). For networking instead
+ of the normal TUN/TAP. It has its advantages and disadvantages.
+ macvtap support requires very new kernels and is
+ currently evolving. Support for this is experimental at best.
+ </flag>
+ <flag name="vepa">Virtual Ethernet Port Aggregator (VEPA) / 802.1Qbg
+ support. Relies on macvtap support.</flag>
+ <flag name="virt-network">
+ Enable virtual networking (NAT) support for guests. Includes all
+ the dependencies for NATed network mode. Effectively any network
+ setup that relies on libvirt to setup and configure network
+ interfaces on your host. This can include bridged and routed
+ networks ONLY if you are allowing libvirt to create and manage
+ the underlying devices for you. In some cases this requires
+ enabling the 'netcf' USE flag (currently unavailable).
+ </flag>
+ <flag name="firewalld">DBus interface to iptables/ebtables allowing
+ for better runtime management of your firewall.</flag>
+ <flag name="wireshark-plugins">
+ Build the <pkg>net-analyzer/wireshark</pkg> plugin for the Libvirt RPC protocol
+ </flag>
+ <flag name="glusterfs">
+ Enable GlusterFS support via <pkg>sys-cluster/glusterfs</pkg>
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/lxc/Manifest b/app-emulation/lxc/Manifest
new file mode 100644
index 000000000000..cc4a5655230a
--- /dev/null
+++ b/app-emulation/lxc/Manifest
@@ -0,0 +1,5 @@
+DIST lxc-1.0.6.tar.gz 561249 SHA256 2aea199a89e2cd946f93406af6c3f62844f36954b79a6991b36d2c33022cb11c SHA512 fe85ccb57865d86704df6b4b79d60f31892785b07dc9dd2580cc6c384c89c29c23516e906b7a16bc03c6582c1fb2432bb8ff11bd17c09efa8f6a035fb41f46b1 WHIRLPOOL 9e77453fbe31523a2e8f39cfaba6f09fef68d00b54549167a0cde56c00934f827f5b4190b9fb64242f36782a9fcda63e6796c35fd47420870c2cee7b9bc0a1c8
+DIST lxc-1.0.7.tar.gz 564985 SHA256 a0b1b09592e076e270dcb3ba004616d9ac3147f9de0b78ca39a30f8956b0a8f2 SHA512 e6ff42a7b41177e1be0d2cd47d4c554565c7fc35355f3aa8aeba00d4adc7a0f364ecd060ddb6c97b2fe5968329c4e4c4b3cb022bffd2da145f30880f077264a8 WHIRLPOOL f07e5e9efb8ff394aa9cdd6c3e725b453c8137ec221399cbf910d57dbc9268fc84e7227273567792821415dc14e774942b76a58a1a478de57d5c82e545702000
+DIST lxc-1.1.0.tar.gz 592543 SHA256 216e806f7e18e5bfbc782493a9e44fc255f24a587d6faee94cda848a0b949155 SHA512 160da88d6dc96cd9f0679f948bfed057c024adcd459fa4b79e872d12284fa3774ac33a13923c6e150072886a371ccfcdf7ab2c4587efa7f6175fc91a67525c4a WHIRLPOOL 2caf81418850ea8b1ecf25b25e799895563ecf1819f32310fcbb4efe88f711eafe2bcb16a0d3b8ee59072c770a5520b4df90a5962215b932e68a4705c4a56d61
+DIST lxc-1.1.1.tar.gz 594112 SHA256 64951fdd39df2bea083bb5a8ac35a7390daf2dc7753d8fce33138129892ef672 SHA512 8af3fb43127b57de4e252baf5cb387270955062ff3838e4807a93d04520ca23f0457913bc8274da51b20961fb08650f9b976a84d395785aca2b2d300b285d549 WHIRLPOOL 4f28b976dd6710705d6361b9a45fef9a1265dffef0cedd0fb304f2820585ece3e2bb64d4c5289d444b3ab55bac265850943c63cdf258c40c45c99176a788ca2a
+DIST lxc-1.1.2.tar.gz 597158 SHA256 f22fcf2659ca98dfe864e632374de98c42cdf465d0c694834b6f6098a3cb8519 SHA512 7c4c9b5418321eedcd37a3f5c2c99ff227de48f672cabd1722a74722077d33badb038675ec95fc3e338eaf2b06972c4ffb2e11f36347587ef71a95fad5b66daa WHIRLPOOL 2b657a9195b6357a367f6aa7609952d9162aae7d7be3f2c5e4cda4b2e81f2c7411835e75af5740cca053d445a3cf7dc7457f9e76ca866de7265e99ed42c744e9
diff --git a/app-emulation/lxc/files/lxc-1.0.6-bash-completion.patch b/app-emulation/lxc/files/lxc-1.0.6-bash-completion.patch
new file mode 100644
index 000000000000..942c12f05198
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-1.0.6-bash-completion.patch
@@ -0,0 +1,39 @@
+ config/bash/Makefile.am | 8 ++++----
+ config/bash/lxc.in | 2 --
+ 2 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/config/bash/Makefile.am b/config/bash/Makefile.am
+index b1768c9..3fbbe8e 100644
+--- a/config/bash/Makefile.am
++++ b/config/bash/Makefile.am
+@@ -2,12 +2,12 @@ EXTRA_DIST = lxc
+
+ if ENABLE_BASH
+ install-bash:
+- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
+- $(INSTALL_DATA) lxc $(DESTDIR)$(sysconfdir)/bash_completion.d/
++ $(MKDIR_P) $(DESTDIR)$(datarootdir)/bash-completion/completions/
++ $(INSTALL_DATA) lxc $(DESTDIR)$(datarootdir)/bash-completion/completions/
+
+ uninstall-bash:
+- rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/lxc
+- rmdir $(DESTDIR)$(sysconfdir)/bash_completion.d/ || :
++ rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/lxc
++ rmdir $(DESTDIR)$(datarootdir)/bash-completion/ || :
+
+ install-data-local: install-bash
+ uninstall-local: uninstall-bash
+diff --git a/config/bash/lxc.in b/config/bash/lxc.in
+index 18fd48f..8fff725 100644
+--- a/config/bash/lxc.in
++++ b/config/bash/lxc.in
+@@ -1,4 +1,3 @@
+-have lxc-start && {
+ _lxc_names() {
+ COMPREPLY=( $( compgen -W "$( lxc-ls )" "$cur" ) )
+ }
+@@ -100,4 +99,3 @@ have lxc-start && {
+
+ complete -o default -F _lxc-generic-o lxc-clone
+ complete -o default -F _lxc-generic-o lxc-start-ephemeral
+-}
diff --git a/app-emulation/lxc/files/lxc-1.1.0-fix-gentoo-template.patch b/app-emulation/lxc/files/lxc-1.1.0-fix-gentoo-template.patch
new file mode 100644
index 000000000000..35141863c0d7
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-1.1.0-fix-gentoo-template.patch
@@ -0,0 +1,35 @@
+From 425aa66d33e1833cfa47b988785def8b42b72f1a Mon Sep 17 00:00:00 2001
+From: Markos Chandras <hwoarang@gentoo.org>
+Date: Sun, 22 Feb 2015 01:25:36 +0200
+Subject: [PATCH] templates/lxc-gentoo.in: Fix stage3 autodetection code
+
+The latest-stage3-$variant.txt files list both the tarball name
+and the released date but we only need to pass the stage3 tarball
+name to the subsequent wget command otherwise we end up with 404
+errors.
+
+Signed-off-by: Markos Chandras <hwoarang@gentoo.org>
+---
+Different patches have been posted to the mailing lists or github so this is
+likely to be fixed upstream really soon
+---
+ templates/lxc-gentoo.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/templates/lxc-gentoo.in b/templates/lxc-gentoo.in
+index 5a87866..464c948 100644
+--- a/templates/lxc-gentoo.in
++++ b/templates/lxc-gentoo.in
+@@ -160,7 +160,8 @@ cache_stage3()
+ printf "Determining path to latest Gentoo %s (%s) stage3 archive...\n" "${arch}" "${variant}"
+ printf " => downloading and processing %s\n" "${stage3_pointer}"
+
+- local stage3_latest_tarball=$(wget -q -O - "${stage3_pointer}" | tail -n1 ) \
++ local stage3_latest_tarball=$(wget -q -O - "${stage3_pointer}" | \
++ tail -n1 | cut -d " " -f 1) \
+ || die 6 "Error: unable to fetch\n"
+
+ printf " => Got: %s\n" "${stage3_latest_tarball}"
+--
+2.3.0
+
diff --git a/app-emulation/lxc/files/lxc-1.1.1-shm-tmpfs.patch b/app-emulation/lxc/files/lxc-1.1.1-shm-tmpfs.patch
new file mode 100644
index 000000000000..7c8f595e0fb6
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-1.1.1-shm-tmpfs.patch
@@ -0,0 +1,31 @@
+From 7ed54c6155982bd8376fdb88bed79c664d5e111f Mon Sep 17 00:00:00 2001
+From: Markos Chandras <hwoarang@gentoo.org>
+Date: Thu, 12 Mar 2015 20:52:11 +0000
+Subject: [PATCH] templates: gentoo.common: Add /dev/shm tmpfs mount entry
+
+/dev/shm needs to be mounted as tmpfs. It's needed by python
+and possibly other packages.
+
+Signed-off-by: Markos Chandras <hwoarang@gentoo.org>
+---
+Applied in master but not in 1.1.1. It will probably make it
+to 1.1.2
+---
+ config/templates/gentoo.common.conf.in | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/config/templates/gentoo.common.conf.in b/config/templates/gentoo.common.conf.in
+index ca3ffc1..49cd411 100644
+--- a/config/templates/gentoo.common.conf.in
++++ b/config/templates/gentoo.common.conf.in
+@@ -21,3 +21,7 @@ lxc.cgroup.devices.allow = c 10:232 rwm
+ ## To use loop devices, copy the following line to the container's
+ ## configuration file (uncommented).
+ #lxc.cgroup.devices.allow = b 7:* rwm
++
++# /dev/shm needs to be mounted as tmpfs. It's needed by python (bug #496328)
++# and possibly other packages.
++lxc.mount.entry = none dev/shm tmpfs rw,nosuid,nodev,create=dir
+--
+2.3.2
+
diff --git a/app-emulation/lxc/files/lxc-1.1.2-fix-gentoo-moresecure-template.patch b/app-emulation/lxc/files/lxc-1.1.2-fix-gentoo-moresecure-template.patch
new file mode 100644
index 000000000000..86a41445574a
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-1.1.2-fix-gentoo-moresecure-template.patch
@@ -0,0 +1,33 @@
+Patch from https://github.com/lxc/lxc/pull/563 didn't make it to stable-1.1
+yes so lets just include it here in case it doesn't end up in 1.1.X in the
+future.
+
+Signed-off-by: Markos Chandras <hwoarang@gentoo.org>
+
+From bc19636d587fbabfbc2252f1bf4887fee87bb247 Mon Sep 17 00:00:00 2001
+From: Dennis Schridde <devurandom@gmx.net>
+Date: Thu, 11 Jun 2015 15:21:19 +0200
+Subject: [PATCH] Fix creation of dev/mqueue and dev/shm on Gentoo
+
+The dev/mqueue and dev/shm directories do not exist when using lxc.autodev, thus they have to be created upon mount.
+
+Signed-off-by: Dennis Schridde <devurandom@gmx.net>
+---
+ config/templates/gentoo.moresecure.conf.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config/templates/gentoo.moresecure.conf.in b/config/templates/gentoo.moresecure.conf.in
+index 270e9df..f827ad2 100644
+--- a/config/templates/gentoo.moresecure.conf.in
++++ b/config/templates/gentoo.moresecure.conf.in
+@@ -8,8 +8,8 @@ lxc.include = @LXCTEMPLATECONFIG@/common.conf
+ # Container user ? see gentoo.common.conf
+
+ # do not mount sysfs, see http://blog.bofh.it/debian/id_413
+-lxc.mount.entry=mqueue dev/mqueue mqueue rw,nodev,noexec,nosuid 0 0
+-lxc.mount.entry=shm dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
++lxc.mount.entry=mqueue dev/mqueue mqueue rw,nodev,noexec,nosuid,create=dir 0 0
++lxc.mount.entry=shm dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,create=dir 0 0
+ lxc.mount.entry=run run tmpfs rw,nosuid,nodev,relatime,mode=755 0 0
+
+ # this part is based on 'linux capabilities', see: man 7 capabilities
diff --git a/app-emulation/lxc/files/lxc.initd.3 b/app-emulation/lxc/files/lxc.initd.3
new file mode 100644
index 000000000000..c9ef99919922
--- /dev/null
+++ b/app-emulation/lxc/files/lxc.initd.3
@@ -0,0 +1,139 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CONTAINER=${SVCNAME#*.}
+
+LXC_PATH=`lxc-config lxc.lxcpath`
+
+lxc_get_configfile() {
+ if [ -f "${LXC_PATH}/${CONTAINER}.conf" ]; then
+ echo "${LXC_PATH}/${CONTAINER}.conf"
+ elif [ -f "${LXC_PATH}/${CONTAINER}/config" ]; then
+ echo "${LXC_PATH}/${CONTAINER}/config"
+ else
+ eerror "Unable to find a suitable configuration file."
+ eerror "If you set up the container in a non-standard"
+ eerror "location, please set the CONFIGFILE variable."
+ return 1
+ fi
+}
+
+[ $CONTAINER != $SVCNAME ] && CONFIGFILE=${CONFIGFILE:-$(lxc_get_configfile)}
+
+lxc_get_var() {
+ awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' ${CONFIGFILE}
+}
+
+lxc_get_net_link_type() {
+ awk 'BEGIN { FS="[ \t]*=[ \t]*"; _link=""; _type="" }
+ $1 == "lxc.network.type" {_type=$2;}
+ $1 == "lxc.network.link" {_link=$2;}
+ {if(_link != "" && _type != ""){
+ printf("%s:%s\n", _link, _type );
+ _link=""; _type="";
+ }; }' <${CONFIGFILE}
+}
+
+checkconfig() {
+ if [ ${CONTAINER} = ${SVCNAME} ]; then
+ eerror "You have to create an init script for each container:"
+ eerror " ln -s lxc /etc/init.d/lxc.container"
+ return 1
+ fi
+
+ # no need to output anything, the function takes care of that.
+ [ -z "${CONFIGFILE}" ] && return 1
+
+ utsname=$(lxc_get_var lxc.utsname)
+ if [ ${CONTAINER} != ${utsname} ]; then
+ eerror "You should use the same name for the service and the"
+ eerror "container. Right now the container is called ${utsname}"
+ return 1
+ fi
+}
+
+depend() {
+ # be quiet, since we have to run depend() also for the
+ # non-muxed init script, unfortunately.
+ checkconfig 2>/dev/null || return 0
+
+ config ${CONFIGFILE}
+ need localmount
+
+ local _x _if
+ for _x in $(lxc_get_net_link_type); do
+ _if=${_x%:*}
+ case "${_x##*:}" in
+ # when the network type is set to phys, we can make use of a
+ # network service (for instance to set it up before we disable
+ # the net_admin capability), but we might also not set it up
+ # at all on the host and leave the net_admin capable service
+ # to take care of it.
+ phys) use net.${_if} ;;
+ *) need net.${_if} ;;
+ esac
+ done
+}
+
+start() {
+ checkconfig || return 1
+ rm /var/log/lxc/${CONTAINER}.log
+
+ rootpath=$(lxc_get_var lxc.rootfs)
+
+ # Check the format of our init and the chroot's init, to see
+ # if we have to use linux32 or linux64; always use setarch
+ # when required, as that makes it easier to deal with
+ # x32-based containers.
+ case $(scanelf -BF '%a#f' ${rootpath}/sbin/init) in
+ EM_X86_64) setarch=linux64;;
+ EM_386) setarch=linux32;;
+ esac
+
+ ebegin "Starting ${CONTAINER}"
+ env -i ${setarch} $(type -p lxc-start) -l WARN -n ${CONTAINER} -f ${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log
+ sleep 0.5
+
+ # lxc-start -d will _always_ report a correct startup, even if it
+ # failed, so rather than trust that, check that the cgroup exists.
+ [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+
+
+ if ! [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]; then
+ ewarn "${CONTAINER} doesn't seem to be started."
+ return 0
+ fi
+
+ init_pid=$(lxc-info -n ${CONTAINER} --pid | awk '{ print $2 }')
+
+ if [ -z "${init_pid}" ]; then
+ ewarn "${CONTAINER} doesn't seem to be running."
+ return 0
+ fi
+
+ ebegin "Shutting down system in ${CONTAINER}"
+ kill -PWR ${init_pid}
+ eend $?
+
+ TIMEOUT=${TIMEOUT:-30}
+ i=0
+ while [ -n "$(pgrep -P ${init_pid})" -a $i -lt ${TIMEOUT} ]; do
+ sleep 1
+ i=$(expr $i + 1)
+ done
+
+ if [ -n "${missingprocs}" ]; then
+ ewarn "Something failed to properly shut down in ${CONTAINER}"
+ fi
+
+ ebegin "Stopping ${CONTAINER}"
+ lxc-stop -n ${CONTAINER}
+ eend $?
+}
diff --git a/app-emulation/lxc/files/lxc_at.service b/app-emulation/lxc/files/lxc_at.service
new file mode 100644
index 000000000000..1ef449775306
--- /dev/null
+++ b/app-emulation/lxc/files/lxc_at.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Linux Container %I
+After=network.target
+
+[Service]
+Restart=always
+ExecStart=/usr/sbin/lxc-start -n %i
+ExecReload=/usr/sbin/lxc-restart -n %i
+ExecStop=/usr/sbin/lxc-stop -n %i
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-emulation/lxc/files/lxc_at.service.2 b/app-emulation/lxc/files/lxc_at.service.2
new file mode 100644
index 000000000000..82306a09ab83
--- /dev/null
+++ b/app-emulation/lxc/files/lxc_at.service.2
@@ -0,0 +1,14 @@
+[Unit]
+Description=Linux Container %I
+After=network.target
+
+[Service]
+Restart=always
+ExecStartPre=/usr/libexec/lxc/lxc-devsetup
+ExecStart=/usr/bin/lxc-start -n %i -F
+ExecReload=/usr/bin/lxc-restart -n %i
+ExecStop=/usr/bin/lxc-stop -n %i
+Delegate=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-emulation/lxc/lxc-1.0.6-r1.ebuild b/app-emulation/lxc/lxc-1.0.6-r1.ebuild
new file mode 100644
index 000000000000..a9b43e5f41be
--- /dev/null
+++ b/app-emulation/lxc/lxc-1.0.6-r1.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_3,3_4} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/"
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
+
+KEYWORDS="~amd64 ~arm ~ppc64 ~x86"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="doc examples lua python seccomp"
+
+RDEPEND="net-libs/gnutls
+ sys-libs/libcap
+ lua? ( >=dev-lang/lua-5.1:= )
+ python? ( ${PYTHON_DEPS} )
+ seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+ sys-apps/util-linux
+ app-misc/pax-utils
+ virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+ ~CPUSETS ~CGROUP_CPUACCT
+ ~RESOURCE_COUNTERS
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN
+
+ ~POSIX_MQUEUE
+ ~!NETPRIO_CGROUP
+
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT=":CONFIG_GRKERNSEC_CHROOT_MOUNT some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE=":CONFIG_GRKERNSEC_CHROOT_DOUBLE some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT=":CONFIG_GRKERNSEC_CHROOT_PIVOT some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD=":CONFIG_GRKERNSEC_CHROOT_CHMOD some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS=":CONFIG_GRKERNSEC_CHROOT_CAPS some GRSEC features make LXC unusable see postinst notes"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_prepare() {
+ sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac || die
+ if [[ -n ${BACKPORTS} ]]; then
+ epatch "${WORKDIR}"/patches/*
+ fi
+
+ epatch "${FILESDIR}"/${P}-bash-completion.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/sbin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/etc/lxc \
+ --with-rootfs-path=/usr/lib/lxc/rootfs \
+ $(use_enable doc) \
+ --disable-apparmor \
+ $(use_enable examples) \
+ $(use_enable lua) \
+ $(use_enable seccomp) \
+ --disable-python
+}
+
+python_compile() {
+ distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ pushd "${S}/src/python-${PN}" > /dev/null
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
+ bashcomp_alias ${PN}-start \
+ ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+ if use python; then
+ pushd "${S}/src/python-lxc" > /dev/null
+ # Unset DOCS. This has been handled by the default target
+ unset DOCS
+ distutils-r1_src_install
+ popd > /dev/null
+ fi
+
+ keepdir /etc/lxc /usr/lib/lxc/rootfs /var/log/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ # Gentoo-specific additions!
+ # Use initd.3 per #517144
+ newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
+
+ # lxc-devsetup script
+ exeinto /usr/libexec/${PN}
+ doexe config/init/systemd/${PN}-devsetup
+ # Use that script with the systemd service (Similar to upstream
+ # Makefile.am
+ cp "${FILESDIR}"/${PN}_at.service ${PN}_at.service || die
+ sed -i \
+ "/Restart=always/a ExecStartPre=/usr/libexec/${PN}/${PN}-devsetup" \
+ ${PN}_at.service \
+ || die "Failed to add ${PN}-devsetup to the systemd service file"
+ systemd_newunit ${PN}_at.service "lxc@.service"
+}
+
+pkg_postinst() {
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog ""
+ ewarn "With version 0.7.4, the mountpoint syntax came back to the one used by 0.7.2"
+ ewarn "and previous versions. This means you'll have to use syntax like the following"
+ ewarn ""
+ ewarn " lxc.rootfs = /container"
+ ewarn " lxc.mount.entry = /usr/portage /container/usr/portage none bind 0 0"
+ ewarn ""
+ ewarn "To use the Fedora, Debian and (various) Ubuntu auto-configuration scripts, you"
+ ewarn "will need sys-apps/yum or dev-util/debootstrap."
+ ewarn ""
+ ewarn "Some GrSecurity settings in relation to chroot security will cause LXC not to"
+ ewarn "work, while others will actually make it much more secure. Please refer to"
+ ewarn "Diego Elio Pettenò's weblog at http://blog.flameeyes.eu/tag/lxc for further"
+ ewarn "details."
+}
diff --git a/app-emulation/lxc/lxc-1.0.7.ebuild b/app-emulation/lxc/lxc-1.0.7.ebuild
new file mode 100644
index 000000000000..bb1af21dbb2a
--- /dev/null
+++ b/app-emulation/lxc/lxc-1.0.7.ebuild
@@ -0,0 +1,187 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_3,3_4} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/"
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
+
+KEYWORDS="amd64 ~arm ~arm64 ~ppc64 x86"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="doc examples lua python seccomp"
+
+RDEPEND="net-libs/gnutls
+ sys-libs/libcap
+ lua? ( >=dev-lang/lua-5.1:= )
+ python? ( ${PYTHON_DEPS} )
+ seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+ sys-apps/util-linux
+ app-misc/pax-utils
+ virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+ ~CPUSETS ~CGROUP_CPUACCT
+ ~RESOURCE_COUNTERS
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN
+
+ ~POSIX_MQUEUE
+ ~!NETPRIO_CGROUP
+
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT=":CONFIG_GRKERNSEC_CHROOT_MOUNT some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE=":CONFIG_GRKERNSEC_CHROOT_DOUBLE some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT=":CONFIG_GRKERNSEC_CHROOT_PIVOT some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD=":CONFIG_GRKERNSEC_CHROOT_CHMOD some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS=":CONFIG_GRKERNSEC_CHROOT_CAPS some GRSEC features make LXC unusable see postinst notes"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_prepare() {
+ sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac || die
+ if [[ -n ${BACKPORTS} ]]; then
+ epatch "${WORKDIR}"/patches/*
+ fi
+
+ epatch "${FILESDIR}"/${PN}-1.0.6-bash-completion.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/sbin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/etc/lxc \
+ --with-rootfs-path=/usr/lib/lxc/rootfs \
+ --with-distro=gentoo \
+ $(use_enable doc) \
+ --disable-apparmor \
+ $(use_enable examples) \
+ $(use_enable lua) \
+ $(use_enable seccomp) \
+ --disable-python
+}
+
+python_compile() {
+ distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ pushd "${S}/src/python-${PN}" > /dev/null
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
+ bashcomp_alias ${PN}-start \
+ ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+ if use python; then
+ pushd "${S}/src/python-lxc" > /dev/null
+ # Unset DOCS. This has been handled by the default target
+ unset DOCS
+ distutils-r1_src_install
+ popd > /dev/null
+ fi
+
+ keepdir /etc/lxc /usr/lib/lxc/rootfs /var/log/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ # Gentoo-specific additions!
+ # Use initd.3 per #517144
+ newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
+
+ # lxc-devsetup script
+ exeinto /usr/libexec/${PN}
+ doexe config/init/systemd/${PN}-devsetup
+ # Use that script with the systemd service (Similar to upstream
+ # Makefile.am
+ cp "${FILESDIR}"/${PN}_at.service ${PN}_at.service || die
+ sed -i \
+ "/Restart=always/a ExecStartPre=/usr/libexec/${PN}/${PN}-devsetup" \
+ ${PN}_at.service \
+ || die "Failed to add ${PN}-devsetup to the systemd service file"
+ systemd_newunit ${PN}_at.service "lxc@.service"
+}
+
+pkg_postinst() {
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog ""
+ ewarn "With version 0.7.4, the mountpoint syntax came back to the one used by 0.7.2"
+ ewarn "and previous versions. This means you'll have to use syntax like the following"
+ ewarn ""
+ ewarn " lxc.rootfs = /container"
+ ewarn " lxc.mount.entry = /usr/portage /container/usr/portage none bind 0 0"
+ ewarn ""
+ ewarn "To use the Fedora, Debian and (various) Ubuntu auto-configuration scripts, you"
+ ewarn "will need sys-apps/yum or dev-util/debootstrap."
+ ewarn ""
+ ewarn "Some GrSecurity settings in relation to chroot security will cause LXC not to"
+ ewarn "work, while others will actually make it much more secure. Please refer to"
+ ewarn "Diego Elio Pettenò's weblog at http://blog.flameeyes.eu/tag/lxc for further"
+ ewarn "details."
+}
diff --git a/app-emulation/lxc/lxc-1.1.0-r6.ebuild b/app-emulation/lxc/lxc-1.1.0-r6.ebuild
new file mode 100644
index 000000000000..5551bc9bf6cb
--- /dev/null
+++ b/app-emulation/lxc/lxc-1.1.0-r6.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_3,3_4} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/"
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
+
+KEYWORDS="~amd64 ~arm"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="cgmanager doc examples lua python seccomp"
+
+RDEPEND="net-libs/gnutls
+ sys-libs/libcap
+ cgmanager? ( app-admin/cgmanager )
+ lua? ( >=dev-lang/lua-5.1:= )
+ python? ( ${PYTHON_DEPS} )
+ seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+ sys-process/criu
+ sys-apps/util-linux
+ app-misc/pax-utils
+ virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+ ~CPUSETS ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~NETLINK_DIAG ~PACKET_DIAG
+ ~INET_UDP_DIAG ~INET_TCP_DIAG
+ ~UNIX_DIAG ~CHECKPOINT_RESTORE
+
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN
+
+ ~POSIX_MQUEUE
+ ~!NETPRIO_CGROUP
+
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+ERROR_NETLINK_DIAG="CONFIG_NETLINK_DIAG: needed for lxc-checkpoint"
+ERROR_PACKET_DIAG="CONFIG_PACKET_DIAG: needed for lxc-checkpoint"
+ERROR_INET_UDP_DIAG="CONFIG_INET_UDP_DIAG: needed for lxc-checkpoint"
+ERROR_INET_TCP_DIAG="CONFIG_INET_TCP_DIAG: needed for lxc-checkpoint"
+ERROR_UNIX_DIAG="CONFIG_UNIX_DIAG: needed for lxc-checkpoint"
+ERROR_CHECKPOINT_RESTORE="CONFIG_CHECKPOINT_RESTORE: needed for lxc-checkpoint"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT="CONFIG_GRKERNSEC_CHROOT_MOUNT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE="CONFIG_GRKERNSEC_CHROOT_DOUBLE: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS: some GRSEC features make LXC unusable see postinst notes"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_prepare() {
+
+ epatch "${FILESDIR}"/${PN}-1.0.6-bash-completion.patch
+ epatch "${FILESDIR}"/${P}-fix-gentoo-template.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ if use python; then
+ #541932
+ python_setup "python3*"
+ export PKG_CONFIG_PATH="${T}/${EPYTHON}/pkgconfig:${PKG_CONFIG_PATH}"
+ fi
+
+ # I am not sure about the --with-rootfs-path
+ # /var/lib/lxc is probably more appropriate than
+ # /usr/lib/lxc.
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/bin \
+ --sbindir=/usr/bin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/var/lib/lxc \
+ --with-rootfs-path=/var/lib/lxc/rootfs \
+ --with-distro=gentoo \
+ --with-runtime-path=/run \
+ --disable-apparmor \
+ $(use_enable cgmanager) \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ $(use_enable lua) \
+ $(use_enable python) \
+ $(use_enable seccomp)
+}
+
+python_compile() {
+ distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ pushd "${S}/src/python-${PN}" > /dev/null
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
+ bashcomp_alias ${PN}-start \
+ ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+ if use python; then
+ pushd "${S}/src/python-lxc" > /dev/null
+ # Unset DOCS. This has been handled by the default target
+ unset DOCS
+ distutils-r1_src_install
+ popd > /dev/null
+ fi
+
+ keepdir /etc/lxc /var/lib/lxc/rootfs /var/log/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ # Gentoo-specific additions!
+ # Use initd.3 per #517144
+ newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
+
+ # lxc-devsetup script
+ exeinto /usr/libexec/${PN}
+ doexe config/init/systemd/${PN}-devsetup
+ # Remember to compare our systemd unit file with the upstream one
+ # config/init/systemd/lxc.service.in
+ systemd_newunit "${FILESDIR}"/${PN}_at.service.2 "lxc@.service"
+}
+
+pkg_postinst() {
+ elog ""
+ elog "Starting from version ${PN}-1.1.0-r3, the default lxc path has been"
+ elog "moved from /etc/lxc to /var/lib/lxc. If you still want to use /etc/lxc"
+ elog "please add the following to your /etc/lxc/default.conf"
+ elog "lxc.lxcpath = /etc/lxc"
+ elog ""
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog ""
+}
diff --git a/app-emulation/lxc/lxc-1.1.1-r1.ebuild b/app-emulation/lxc/lxc-1.1.1-r1.ebuild
new file mode 100644
index 000000000000..fbdb0894ed30
--- /dev/null
+++ b/app-emulation/lxc/lxc-1.1.1-r1.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_3,3_4} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/"
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
+
+KEYWORDS="~amd64 ~arm ~arm64"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="cgmanager doc examples lua python seccomp"
+
+RDEPEND="net-libs/gnutls
+ sys-libs/libcap
+ cgmanager? ( app-admin/cgmanager )
+ lua? ( >=dev-lang/lua-5.1:= )
+ python? ( ${PYTHON_DEPS} )
+ seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+ sys-process/criu
+ sys-apps/util-linux
+ app-misc/pax-utils
+ virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+ ~CPUSETS ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~NETLINK_DIAG ~PACKET_DIAG
+ ~INET_UDP_DIAG ~INET_TCP_DIAG
+ ~UNIX_DIAG ~CHECKPOINT_RESTORE
+
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN
+
+ ~POSIX_MQUEUE
+ ~!NETPRIO_CGROUP
+
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+ERROR_NETLINK_DIAG="CONFIG_NETLINK_DIAG: needed for lxc-checkpoint"
+ERROR_PACKET_DIAG="CONFIG_PACKET_DIAG: needed for lxc-checkpoint"
+ERROR_INET_UDP_DIAG="CONFIG_INET_UDP_DIAG: needed for lxc-checkpoint"
+ERROR_INET_TCP_DIAG="CONFIG_INET_TCP_DIAG: needed for lxc-checkpoint"
+ERROR_UNIX_DIAG="CONFIG_UNIX_DIAG: needed for lxc-checkpoint"
+ERROR_CHECKPOINT_RESTORE="CONFIG_CHECKPOINT_RESTORE: needed for lxc-checkpoint"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT="CONFIG_GRKERNSEC_CHROOT_MOUNT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE="CONFIG_GRKERNSEC_CHROOT_DOUBLE: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS: some GRSEC features make LXC unusable see postinst notes"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_prepare() {
+
+ epatch "${FILESDIR}"/${PN}-1.0.6-bash-completion.patch
+ # Fixed in master. It will probably make it to 1.1.2
+ epatch "${FILESDIR}"/${P}-shm-tmpfs.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ if use python; then
+ #541932
+ python_setup "python3*"
+ export PKG_CONFIG_PATH="${T}/${EPYTHON}/pkgconfig:${PKG_CONFIG_PATH}"
+ fi
+
+ # I am not sure about the --with-rootfs-path
+ # /var/lib/lxc is probably more appropriate than
+ # /usr/lib/lxc.
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/bin \
+ --sbindir=/usr/bin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/var/lib/lxc \
+ --with-rootfs-path=/var/lib/lxc/rootfs \
+ --with-distro=gentoo \
+ --with-runtime-path=/run \
+ --disable-apparmor \
+ $(use_enable cgmanager) \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ $(use_enable lua) \
+ $(use_enable python) \
+ $(use_enable seccomp)
+}
+
+python_compile() {
+ distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ pushd "${S}/src/python-${PN}" > /dev/null
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
+ bashcomp_alias ${PN}-start \
+ ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+ if use python; then
+ pushd "${S}/src/python-lxc" > /dev/null
+ # Unset DOCS. This has been handled by the default target
+ unset DOCS
+ distutils-r1_src_install
+ popd > /dev/null
+ fi
+
+ keepdir /etc/lxc /var/lib/lxc/rootfs /var/log/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ # Gentoo-specific additions!
+ # Use initd.3 per #517144
+ newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
+
+ # lxc-devsetup script
+ exeinto /usr/libexec/${PN}
+ doexe config/init/systemd/${PN}-devsetup
+ # Remember to compare our systemd unit file with the upstream one
+ # config/init/systemd/lxc.service.in
+ systemd_newunit "${FILESDIR}"/${PN}_at.service.2 "lxc@.service"
+}
+
+pkg_postinst() {
+ elog ""
+ elog "Starting from version ${PN}-1.1.0-r3, the default lxc path has been"
+ elog "moved from /etc/lxc to /var/lib/lxc. If you still want to use /etc/lxc"
+ elog "please add the following to your /etc/lxc/default.conf"
+ elog "lxc.lxcpath = /etc/lxc"
+ elog ""
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog ""
+}
diff --git a/app-emulation/lxc/lxc-1.1.2-r1.ebuild b/app-emulation/lxc/lxc-1.1.2-r1.ebuild
new file mode 100644
index 000000000000..8dd8dd28e7ff
--- /dev/null
+++ b/app-emulation/lxc/lxc-1.1.2-r1.ebuild
@@ -0,0 +1,195 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_3,3_4} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/"
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
+
+KEYWORDS="~amd64 ~arm ~arm64"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="cgmanager doc examples lua python seccomp"
+
+RDEPEND="net-libs/gnutls
+ sys-libs/libcap
+ cgmanager? ( app-admin/cgmanager )
+ lua? ( >=dev-lang/lua-5.1:= )
+ python? ( ${PYTHON_DEPS} )
+ seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+ sys-process/criu
+ sys-apps/util-linux
+ app-misc/pax-utils
+ virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+ ~CPUSETS ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~NETLINK_DIAG ~PACKET_DIAG
+ ~INET_UDP_DIAG ~INET_TCP_DIAG
+ ~UNIX_DIAG ~CHECKPOINT_RESTORE
+
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN
+
+ ~POSIX_MQUEUE
+ ~!NETPRIO_CGROUP
+
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+ERROR_NETLINK_DIAG="CONFIG_NETLINK_DIAG: needed for lxc-checkpoint"
+ERROR_PACKET_DIAG="CONFIG_PACKET_DIAG: needed for lxc-checkpoint"
+ERROR_INET_UDP_DIAG="CONFIG_INET_UDP_DIAG: needed for lxc-checkpoint"
+ERROR_INET_TCP_DIAG="CONFIG_INET_TCP_DIAG: needed for lxc-checkpoint"
+ERROR_UNIX_DIAG="CONFIG_UNIX_DIAG: needed for lxc-checkpoint"
+ERROR_CHECKPOINT_RESTORE="CONFIG_CHECKPOINT_RESTORE: needed for lxc-checkpoint"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT="CONFIG_GRKERNSEC_CHROOT_MOUNT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE="CONFIG_GRKERNSEC_CHROOT_DOUBLE: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS: some GRSEC features make LXC unusable see postinst notes"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_prepare() {
+
+ epatch "${FILESDIR}"/${PN}-1.0.6-bash-completion.patch
+ epatch "${FILESDIR}"/${P}-fix-gentoo-moresecure-template.patch
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ if use python; then
+ #541932
+ python_setup "python3*"
+ export PKG_CONFIG_PATH="${T}/${EPYTHON}/pkgconfig:${PKG_CONFIG_PATH}"
+ fi
+
+ # I am not sure about the --with-rootfs-path
+ # /var/lib/lxc is probably more appropriate than
+ # /usr/lib/lxc.
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/bin \
+ --sbindir=/usr/bin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/var/lib/lxc \
+ --with-rootfs-path=/var/lib/lxc/rootfs \
+ --with-distro=gentoo \
+ --with-runtime-path=/run \
+ --disable-apparmor \
+ $(use_enable cgmanager) \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ $(use_enable lua) \
+ $(use_enable python) \
+ $(use_enable seccomp)
+}
+
+python_compile() {
+ distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ pushd "${S}/src/python-${PN}" > /dev/null
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
+ bashcomp_alias ${PN}-start \
+ ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+ if use python; then
+ pushd "${S}/src/python-lxc" > /dev/null
+ # Unset DOCS. This has been handled by the default target
+ unset DOCS
+ distutils-r1_src_install
+ popd > /dev/null
+ fi
+
+ keepdir /etc/lxc /var/lib/lxc/rootfs /var/log/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ # Gentoo-specific additions!
+ # Use initd.3 per #517144
+ newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
+
+ # lxc-devsetup script
+ exeinto /usr/libexec/${PN}
+ doexe config/init/systemd/${PN}-devsetup
+ # Remember to compare our systemd unit file with the upstream one
+ # config/init/systemd/lxc.service.in
+ systemd_newunit "${FILESDIR}"/${PN}_at.service.2 "lxc@.service"
+}
+
+pkg_postinst() {
+ elog ""
+ elog "Starting from version ${PN}-1.1.0-r3, the default lxc path has been"
+ elog "moved from /etc/lxc to /var/lib/lxc. If you still want to use /etc/lxc"
+ elog "please add the following to your /etc/lxc/default.conf"
+ elog "lxc.lxcpath = /etc/lxc"
+ elog ""
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog ""
+}
diff --git a/app-emulation/lxc/lxc-1.1.2-r2.ebuild b/app-emulation/lxc/lxc-1.1.2-r2.ebuild
new file mode 100644
index 000000000000..8dd8dd28e7ff
--- /dev/null
+++ b/app-emulation/lxc/lxc-1.1.2-r2.ebuild
@@ -0,0 +1,195 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_3,3_4} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/"
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
+
+KEYWORDS="~amd64 ~arm ~arm64"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="cgmanager doc examples lua python seccomp"
+
+RDEPEND="net-libs/gnutls
+ sys-libs/libcap
+ cgmanager? ( app-admin/cgmanager )
+ lua? ( >=dev-lang/lua-5.1:= )
+ python? ( ${PYTHON_DEPS} )
+ seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+ sys-process/criu
+ sys-apps/util-linux
+ app-misc/pax-utils
+ virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+ ~CPUSETS ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~NETLINK_DIAG ~PACKET_DIAG
+ ~INET_UDP_DIAG ~INET_TCP_DIAG
+ ~UNIX_DIAG ~CHECKPOINT_RESTORE
+
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN
+
+ ~POSIX_MQUEUE
+ ~!NETPRIO_CGROUP
+
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+ERROR_NETLINK_DIAG="CONFIG_NETLINK_DIAG: needed for lxc-checkpoint"
+ERROR_PACKET_DIAG="CONFIG_PACKET_DIAG: needed for lxc-checkpoint"
+ERROR_INET_UDP_DIAG="CONFIG_INET_UDP_DIAG: needed for lxc-checkpoint"
+ERROR_INET_TCP_DIAG="CONFIG_INET_TCP_DIAG: needed for lxc-checkpoint"
+ERROR_UNIX_DIAG="CONFIG_UNIX_DIAG: needed for lxc-checkpoint"
+ERROR_CHECKPOINT_RESTORE="CONFIG_CHECKPOINT_RESTORE: needed for lxc-checkpoint"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT="CONFIG_GRKERNSEC_CHROOT_MOUNT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE="CONFIG_GRKERNSEC_CHROOT_DOUBLE: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS: some GRSEC features make LXC unusable see postinst notes"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_prepare() {
+
+ epatch "${FILESDIR}"/${PN}-1.0.6-bash-completion.patch
+ epatch "${FILESDIR}"/${P}-fix-gentoo-moresecure-template.patch
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ if use python; then
+ #541932
+ python_setup "python3*"
+ export PKG_CONFIG_PATH="${T}/${EPYTHON}/pkgconfig:${PKG_CONFIG_PATH}"
+ fi
+
+ # I am not sure about the --with-rootfs-path
+ # /var/lib/lxc is probably more appropriate than
+ # /usr/lib/lxc.
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/bin \
+ --sbindir=/usr/bin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/var/lib/lxc \
+ --with-rootfs-path=/var/lib/lxc/rootfs \
+ --with-distro=gentoo \
+ --with-runtime-path=/run \
+ --disable-apparmor \
+ $(use_enable cgmanager) \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ $(use_enable lua) \
+ $(use_enable python) \
+ $(use_enable seccomp)
+}
+
+python_compile() {
+ distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ pushd "${S}/src/python-${PN}" > /dev/null
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
+ bashcomp_alias ${PN}-start \
+ ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+ if use python; then
+ pushd "${S}/src/python-lxc" > /dev/null
+ # Unset DOCS. This has been handled by the default target
+ unset DOCS
+ distutils-r1_src_install
+ popd > /dev/null
+ fi
+
+ keepdir /etc/lxc /var/lib/lxc/rootfs /var/log/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ # Gentoo-specific additions!
+ # Use initd.3 per #517144
+ newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
+
+ # lxc-devsetup script
+ exeinto /usr/libexec/${PN}
+ doexe config/init/systemd/${PN}-devsetup
+ # Remember to compare our systemd unit file with the upstream one
+ # config/init/systemd/lxc.service.in
+ systemd_newunit "${FILESDIR}"/${PN}_at.service.2 "lxc@.service"
+}
+
+pkg_postinst() {
+ elog ""
+ elog "Starting from version ${PN}-1.1.0-r3, the default lxc path has been"
+ elog "moved from /etc/lxc to /var/lib/lxc. If you still want to use /etc/lxc"
+ elog "please add the following to your /etc/lxc/default.conf"
+ elog "lxc.lxcpath = /etc/lxc"
+ elog ""
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog ""
+}
diff --git a/app-emulation/lxc/lxc-1.1.2.ebuild b/app-emulation/lxc/lxc-1.1.2.ebuild
new file mode 100644
index 000000000000..660348e4851e
--- /dev/null
+++ b/app-emulation/lxc/lxc-1.1.2.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_3,3_4} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/"
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
+
+KEYWORDS="~amd64 ~arm ~arm64"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="cgmanager doc examples lua python seccomp"
+
+RDEPEND="net-libs/gnutls
+ sys-libs/libcap
+ cgmanager? ( app-admin/cgmanager )
+ lua? ( >=dev-lang/lua-5.1:= )
+ python? ( ${PYTHON_DEPS} )
+ seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+ sys-process/criu
+ sys-apps/util-linux
+ app-misc/pax-utils
+ virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+ ~CPUSETS ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~NETLINK_DIAG ~PACKET_DIAG
+ ~INET_UDP_DIAG ~INET_TCP_DIAG
+ ~UNIX_DIAG ~CHECKPOINT_RESTORE
+
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN
+
+ ~POSIX_MQUEUE
+ ~!NETPRIO_CGROUP
+
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+ERROR_NETLINK_DIAG="CONFIG_NETLINK_DIAG: needed for lxc-checkpoint"
+ERROR_PACKET_DIAG="CONFIG_PACKET_DIAG: needed for lxc-checkpoint"
+ERROR_INET_UDP_DIAG="CONFIG_INET_UDP_DIAG: needed for lxc-checkpoint"
+ERROR_INET_TCP_DIAG="CONFIG_INET_TCP_DIAG: needed for lxc-checkpoint"
+ERROR_UNIX_DIAG="CONFIG_UNIX_DIAG: needed for lxc-checkpoint"
+ERROR_CHECKPOINT_RESTORE="CONFIG_CHECKPOINT_RESTORE: needed for lxc-checkpoint"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT="CONFIG_GRKERNSEC_CHROOT_MOUNT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE="CONFIG_GRKERNSEC_CHROOT_DOUBLE: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS: some GRSEC features make LXC unusable see postinst notes"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_prepare() {
+
+ epatch "${FILESDIR}"/${PN}-1.0.6-bash-completion.patch
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ if use python; then
+ #541932
+ python_setup "python3*"
+ export PKG_CONFIG_PATH="${T}/${EPYTHON}/pkgconfig:${PKG_CONFIG_PATH}"
+ fi
+
+ # I am not sure about the --with-rootfs-path
+ # /var/lib/lxc is probably more appropriate than
+ # /usr/lib/lxc.
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/bin \
+ --sbindir=/usr/bin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/var/lib/lxc \
+ --with-rootfs-path=/var/lib/lxc/rootfs \
+ --with-distro=gentoo \
+ --with-runtime-path=/run \
+ --disable-apparmor \
+ $(use_enable cgmanager) \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ $(use_enable lua) \
+ $(use_enable python) \
+ $(use_enable seccomp)
+}
+
+python_compile() {
+ distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ pushd "${S}/src/python-${PN}" > /dev/null
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
+ bashcomp_alias ${PN}-start \
+ ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+ if use python; then
+ pushd "${S}/src/python-lxc" > /dev/null
+ # Unset DOCS. This has been handled by the default target
+ unset DOCS
+ distutils-r1_src_install
+ popd > /dev/null
+ fi
+
+ keepdir /etc/lxc /var/lib/lxc/rootfs /var/log/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ # Gentoo-specific additions!
+ # Use initd.3 per #517144
+ newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
+
+ # lxc-devsetup script
+ exeinto /usr/libexec/${PN}
+ doexe config/init/systemd/${PN}-devsetup
+ # Remember to compare our systemd unit file with the upstream one
+ # config/init/systemd/lxc.service.in
+ systemd_newunit "${FILESDIR}"/${PN}_at.service.2 "lxc@.service"
+}
+
+pkg_postinst() {
+ elog ""
+ elog "Starting from version ${PN}-1.1.0-r3, the default lxc path has been"
+ elog "moved from /etc/lxc to /var/lib/lxc. If you still want to use /etc/lxc"
+ elog "please add the following to your /etc/lxc/default.conf"
+ elog "lxc.lxcpath = /etc/lxc"
+ elog ""
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog ""
+}
diff --git a/app-emulation/lxc/metadata.xml b/app-emulation/lxc/metadata.xml
new file mode 100644
index 000000000000..536d8f3d85be
--- /dev/null
+++ b/app-emulation/lxc/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <maintainer>
+ <email>flameeyes@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="cgmanager">Enable support for cgroup management using <pkg>app-admin/cgmanager</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="github">lxc/lxc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
new file mode 100644
index 000000000000..fe7eddb1046e
--- /dev/null
+++ b/app-emulation/lxd/Manifest
@@ -0,0 +1 @@
+DIST lxd-0.13.tar.bz2 3336161 SHA256 4228979ea9a856647f75f0230f58cc577c111a287f148787af766ab36c55f756 SHA512 12cd865ef63702674342df23ebb298b6ba39f0d44e9bfe91c643820be06ff30910145388a4daa2d63fbcb53c236e3cd4eb84e3e0bc617c85247322b0024c4920 WHIRLPOOL 82e788e9b35429df308d498955bd0cab06eb7d1a09c0a20bddad78490900b2cb78a44da9970db149ebfda546250a1d5aa2204e5f6f98b81a228310bfee3003a7
diff --git a/app-emulation/lxd/files/lxd-0.13-nc-binary-name.patch b/app-emulation/lxd/files/lxd-0.13-nc-binary-name.patch
new file mode 100644
index 000000000000..40e122487418
--- /dev/null
+++ b/app-emulation/lxd/files/lxd-0.13-nc-binary-name.patch
@@ -0,0 +1,11 @@
+--- lxd/migration/rsync.go.orig 2015-07-11 09:33:18.012425011 -0500
++++ lxd/migration/rsync.go 2015-07-11 09:33:34.881423857 -0500
+@@ -84,7 +84,7 @@
+ * command (i.e. the command to run on --server). However, we're
+ * hardcoding that at the other end, so we can just ignore it.
+ */
+- rsyncCmd := fmt.Sprintf("sh -c \"nc -U %s\"", f.Name())
++ rsyncCmd := fmt.Sprintf("sh -c \"nc.openbsd -U %s\"", f.Name())
+ cmd := exec.Command("rsync", "-arvPz", "--devices", "--partial", path, "localhost:/tmp/foo", "-e", rsyncCmd)
+ if err := cmd.Start(); err != nil {
+ return nil, nil, err
diff --git a/app-emulation/lxd/files/lxd.confd b/app-emulation/lxd/files/lxd.confd
new file mode 100644
index 000000000000..086198a55caf
--- /dev/null
+++ b/app-emulation/lxd/files/lxd.confd
@@ -0,0 +1,26 @@
+LXD_OPTIONS=""
+
+# Group which owns the shared socket
+LXD_OPTIONS="${LXD_OPTIONS} --group lxd"
+
+# TCP address <addr:port> to listen on in addition to the unix socket (e.g., 127.0.0.1:8443)
+#LXD_OPTIONS="${LXD_OPTIONS} --tcp 127.0.0.1:8443"
+
+
+
+# Enable cpu profiling into the specified file
+#LXD_OPTIONS="${LXD_OPTIONS} --cpuprofile ''"
+
+# Enable memory profiling into the specified file
+#LXD_OPTIONS="${LXD_OPTIONS} --memprofile ''"
+
+
+
+# Enables debug mode
+#LXD_OPTIONS="${LXD_OPTIONS} --debug"
+
+# For debugging, print a complete stack trace every n seconds
+#LXD_OPTIONS="${LXD_OPTIONS} --print-goroutines-every 5"
+
+# Enables verbose mode
+#LXD_OPTIONS="${LXD_OPTIONS} -v"
diff --git a/app-emulation/lxd/files/lxd.initd b/app-emulation/lxd/files/lxd.initd
new file mode 100644
index 000000000000..fa72002fcc9a
--- /dev/null
+++ b/app-emulation/lxd/files/lxd.initd
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DAEMON=/usr/sbin/lxd
+PIDFILE=/run/lxd.pid
+
+depend() {
+ need cgmanager
+
+ if echo "${LXD_OPTIONS}" | grep -e "--tcp" >/dev/null; then
+ need net
+ fi
+}
+
+start() {
+ ebegin "Starting lxd server"
+
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec ${DAEMON} \
+ --background \
+ --make-pidfile \
+ -- \
+ ${LXD_OPTIONS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping lxd server"
+ start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
+ eend $?
+}
diff --git a/app-emulation/lxd/files/lxd.service b/app-emulation/lxd/files/lxd.service
new file mode 100644
index 000000000000..3bf229fd1118
--- /dev/null
+++ b/app-emulation/lxd/files/lxd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Container hypervisor based on LXC
+After=cgmanager.service lxc.service
+Requires=cgmanager.service lxc.service
+
+[Service]
+ExecStart=/usr/bin/lxd --group lxd
+KillMode=process
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-emulation/lxd/lxd-0.13.ebuild b/app-emulation/lxd/lxd-0.13.ebuild
new file mode 100644
index 000000000000..d32164648634
--- /dev/null
+++ b/app-emulation/lxd/lxd-0.13.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Fast, dense and secure container management"
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
+EGO_PN_PARENT="github.com/lxc"
+EGO_PN="${EGO_PN_PARENT}/lxd"
+SRC_URI="http://961db08fe45d5f5dd062-b8a7a040508aea6d369676e49b80719d.r29.cf2.rackcdn.com/${P}.tar.bz2"
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+PLOCALES="de fr ja"
+IUSE="nls test +image"
+
+# IUSE and PLOCALES must be defined before l10n inherited
+inherit bash-completion-r1 eutils golang-build l10n systemd user vcs-snapshot
+
+DEPEND="
+ >=dev-lang/go-1.4.2:=
+ dev-libs/protobuf
+ dev-vcs/git
+ nls? ( sys-devel/gettext )
+ test? (
+ app-misc/jq
+ dev-db/sqlite
+ net-misc/curl
+ sys-devel/gettext
+ )
+"
+
+RDEPEND="
+ app-admin/cgmanager
+ app-arch/xz-utils
+ app-emulation/lxc[cgmanager]
+ net-analyzer/openbsd-netcat
+ net-misc/bridge-utils
+ virtual/acl
+ image? (
+ app-crypt/gnupg
+ >=dev-lang/python-3.2
+ )
+"
+
+# KNOWN ISSUES:
+# - Translations may not work. I've been unsuccessful in forcing
+# localized output. Anyway, upstream (Canonical) doesn't install the
+# message files.
+
+src_prepare() {
+ cd "${S}/src/${EGO_PN}"
+
+ # Upstream requires the openbsd flavor of netcat (with -U), but
+ # Gentoo installs that with a renamed binary
+ epatch "${FILESDIR}/${P}-nc-binary-name.patch"
+
+ # Warn on unhandled locale changes
+ l10n_find_plocales_changes po "" .po
+}
+
+src_compile() {
+ golang-build_src_compile
+
+ cd "${S}/src/${EGO_PN}"
+
+ # Build binaries
+ GOPATH="${S}" emake
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ # Go native tests should succeed
+ golang-build_src_test
+}
+
+src_install() {
+ # Installs all src,pkg to /usr/lib/go-gentoo
+ golang-build_src_install
+
+ cd "${S}"
+
+ dobin bin/fuidshift
+ dobin bin/lxc
+
+ dosbin bin/lxd
+
+ cd "src/${EGO_PN}"
+
+ use image && dobin scripts/lxd-images
+
+ if use nls; then
+ for lingua in ${PLOCALES}; do
+ if use linguas_${lingua}; then
+ domo po/${lingua}.mo
+ fi
+ done
+ fi
+
+ newinitd "${FILESDIR}"/lxd.initd lxd
+ newconfd "${FILESDIR}"/lxd.confd lxd
+
+ systemd_dounit "${FILESDIR}"/lxd.service
+
+ newbashcomp config/bash/lxc.in lxc
+
+ dodoc AUTHORS CONTRIBUTING.md README.md
+
+ docinto specs
+ dodoc specs/*
+}
+
+pkg_config() {
+ if brctl show lxcbr0 2>&1 | grep "No such device" >/dev/null; then
+ brctl addbr lxcbr0
+ fi
+}
+
+pkg_postinst() {
+ # The control socket will be owned by (and writeable by) this group.
+ enewgroup lxd
+
+ # Ubuntu also defines an lxd user but it appears unused (the daemon
+ # must run as root)
+
+ # precedent: sys-libs/timezone-data
+ pkg_config
+
+ einfo
+ einfo "To interact with the service as a non-root user, add yourself to the"
+ einfo "lxd group. This requires you to log out and log in again."
+ einfo
+}
diff --git a/app-emulation/lxd/metadata.xml b/app-emulation/lxd/metadata.xml
new file mode 100644
index 000000000000..3ee6854f2f3a
--- /dev/null
+++ b/app-emulation/lxd/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer status="active">
+ <email>erikmack@gmail.com</email>
+ <name>Erik Mackdanz</name>
+ </maintainer>
+ <maintainer>
+ <email>alunduil@gentoo.org</email>
+ <name>Alex Brandt</name>
+ </maintainer>
+ <longdescription>
+ By combining the speed and density of containers with
+ the security of traditional virtual machines, LXD is
+ the next-generation of container hypervisor for Linux
+ from Canonical.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">lxc/lxd</remote-id>
+ </upstream>
+ <use>
+ <flag name="image">
+ Installs the lxd-images image-fetching script
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/metadata.xml b/app-emulation/metadata.xml
new file mode 100644
index 000000000000..4b1893efa085
--- /dev/null
+++ b/app-emulation/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The app-emulation category contains emulation software.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie app-emulation enthält Emulationssoftware.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría app-emulation contiene programas para emulación.
+ </longdescription>
+ <longdescription lang="ja">
+ app-emulationカテゴリにはエミュレーションソフトウェアが含まれます。
+ </longdescription>
+ <longdescription lang="nl">
+ De app-emulation categorie bevat emulatie programma's.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm app-emulation chứa các phần mềm mô phỏng.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria app-emulation contiene programmi di emulazione.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria app-emulation contém programas para emulação.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria app-emulation zawiera programy służące do emulacji.
+ </longdescription>
+</catmetadata>
+
diff --git a/app-emulation/open-vm-tools-kmod/Manifest b/app-emulation/open-vm-tools-kmod/Manifest
new file mode 100644
index 000000000000..d7ae156cd4e7
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/Manifest
@@ -0,0 +1,3 @@
+DIST open-vm-tools-2013.09.16-1328054.tar.gz 3793719 SHA256 470a6ea3ce14c2c5ea6b7bc59745eccbacc8d88a3f343e712312786435975d13 SHA512 7ae62d5411b4bdefd0e8db5f0a81bb357bfd4a624af06bf9a5a74f49ede0b7051b41dfe548c758fd7e73cded34af983c8aa0c412e65343092e05ae9b997895cb WHIRLPOOL 688fb4e494fb7aab7d0eb09189afff95ec8727bcc1893a4ec632bb8198661a1a55d58a813d2d56a3ac330fd7a55afc1fa7dc11f1d60c06c91ecf6a0bf866b249
+DIST open-vm-tools-9.10.0-2476743.tar.gz 4093306 SHA256 e146ad53d744d7793ee72c5271fc49a916613534c14827c227fdaef4b3579c96 SHA512 8c8e4a559c0374e020c8261d4c8f6855efbe3f509745ee02ec03ab9ebce7e1327ec1e5e18f674cb464630ace9dc33b4262ffd119fc237c286ee44327e4590385 WHIRLPOOL 162aba889e249ac229e003a57753ff78b86f612a0753ae83f9de52eb1d0ae0a11aee0279c192eb073dabc76d718747c614d4122395abfc8c8d0f9d80a903189a
+DIST open-vm-tools-9.4.0-1280544.tar.gz 3659504 SHA256 5d30652eb0f6dc5e930781029c184837e700be5543b6a7116db4c62a6f3ca399 SHA512 07b36f49713140606f74864b59c2e01c9ed83a960dd3f5d172b84fc75e760f7370065774a0e26897924af60454c86b682ca0fd32276b0e9fb17b268247f8cbdf WHIRLPOOL 88533768cf718de3b5f64e688597209fa2029d02cdf350d7fd05ec8dd8ca0f0c125a8d1445c1ec9287bc486076d5c335f3cc615c3f0b9aa7bac84e921da4c9e6
diff --git a/app-emulation/open-vm-tools-kmod/files/1098359-vmblock-3.10.0.patch b/app-emulation/open-vm-tools-kmod/files/1098359-vmblock-3.10.0.patch
new file mode 100644
index 000000000000..040d5145e9e2
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/files/1098359-vmblock-3.10.0.patch
@@ -0,0 +1,24 @@
+--- a/modules/linux/vmblock/linux/control.c
++++ b/modules/linux/vmblock/linux/control.c
+@@ -208,9 +208,10 @@
+ VMBlockSetProcEntryOwner(controlProcMountpoint);
+
+ /* Create /proc/fs/vmblock/dev */
+- controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
+- VMBLOCK_CONTROL_MODE,
+- controlProcDirEntry);
++ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME,
++ VMBLOCK_CONTROL_MODE,
++ controlProcDirEntry,
++ &ControlFileOps);
+ if (!controlProcEntry) {
+ Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
+ remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
+@@ -218,7 +219,6 @@
+ return -EINVAL;
+ }
+
+- controlProcEntry->proc_fops = &ControlFileOps;
+ return 0;
+ }
+
diff --git a/app-emulation/open-vm-tools-kmod/files/60-vmware.rules b/app-emulation/open-vm-tools-kmod/files/60-vmware.rules
new file mode 100644
index 000000000000..3c83e4606afc
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/files/60-vmware.rules
@@ -0,0 +1 @@
+KERNEL=="vsock", GROUP="vmware", MODE=660
diff --git a/app-emulation/open-vm-tools-kmod/files/9.10.0-0001-Fix-vmxnet-module-on-kernels-3.16.patch b/app-emulation/open-vm-tools-kmod/files/9.10.0-0001-Fix-vmxnet-module-on-kernels-3.16.patch
new file mode 100644
index 000000000000..b7145d11b95c
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/files/9.10.0-0001-Fix-vmxnet-module-on-kernels-3.16.patch
@@ -0,0 +1,74 @@
+From 08836a47c56b47b658025e41a20027c5d915f836 Mon Sep 17 00:00:00 2001
+From: "Scott M. Kroll" <skroll@gmail.com>
+Date: Fri, 15 Aug 2014 10:40:38 -0400
+Subject: [PATCH 1/3] Fix vmxnet module on kernels >= 3.16
+
+* Add compat check for ethtool_ops in net_device struct.
+* SET_ETHTOOL_OPS is no longer defined, but can be manually.
+---
+ open-vm-tools/modules/linux/shared/compat_netdevice.h | 4 ++++
+ open-vm-tools/modules/linux/vmxnet/vmxnet.c | 13 ++++++++-----
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/open-vm-tools/modules/linux/shared/compat_netdevice.h b/open-vm-tools/modules/linux/shared/compat_netdevice.h
+index 3aec25b..a65d59b 100644
+--- a/open-vm-tools/modules/linux/shared/compat_netdevice.h
++++ b/open-vm-tools/modules/linux/shared/compat_netdevice.h
+@@ -337,4 +337,8 @@ typedef netdev_features_t compat_netdev_features_t;
+ typedef u32 compat_netdev_features_t;
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(SET_ETHTOOL_OPS)
++#define VMW_HAVE_ETHTOOL_OPS 1
++#endif
++
+ #endif /* __COMPAT_NETDEVICE_H__ */
+diff --git a/open-vm-tools/modules/linux/vmxnet/vmxnet.c b/open-vm-tools/modules/linux/vmxnet/vmxnet.c
+index 33afb9b..40abde5 100644
+--- a/open-vm-tools/modules/linux/vmxnet/vmxnet.c
++++ b/open-vm-tools/modules/linux/vmxnet/vmxnet.c
+@@ -279,8 +279,7 @@ vmxnet_change_mtu(struct net_device *dev, int new_mtu)
+
+ #endif
+
+-
+-#ifdef SET_ETHTOOL_OPS
++#ifdef VMW_HAVE_ETHTOOL_OPS
+ /*
+ *----------------------------------------------------------------------------
+ *
+@@ -526,7 +525,7 @@ vmxnet_ethtool_ops = {
+ };
+
+
+-#else /* !defined(SET_ETHTOOL_OPS) */
++#else /* !defined(VMW_HAVE_ETHTOOL_OPS) */
+
+
+ /*
+@@ -739,7 +738,7 @@ vmxnet_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ }
+ return -EOPNOTSUPP;
+ }
+-#endif /* SET_ETHTOOL_OPS */
++#endif /* !defined(VMW_HAVE_ETHTOOL_OPS) */
+
+
+ /*
+@@ -1142,8 +1141,12 @@ vmxnet_probe_device(struct pci_dev *pdev, // IN: vmxnet PCI device
+ dev->watchdog_timeo = VMXNET_WATCHDOG_TIMEOUT;
+ #endif
+
+-#ifdef SET_ETHTOOL_OPS
++#ifdef VMW_HAVE_ETHTOOL_OPS
++# ifdef SET_ETHTOOL_OPS
+ SET_ETHTOOL_OPS(dev, &vmxnet_ethtool_ops);
++# else
++ dev->ethtool_ops = &vmxnet_ethtool_ops;
++# endif
+ #else
+ dev->do_ioctl = vmxnet_ioctl;
+ #endif
+--
+2.3.4
+
diff --git a/app-emulation/open-vm-tools-kmod/files/9.10.0-0002-Fix-d_alias-to-d_u.d_alias-for-kernel-3.18.patch b/app-emulation/open-vm-tools-kmod/files/9.10.0-0002-Fix-d_alias-to-d_u.d_alias-for-kernel-3.18.patch
new file mode 100644
index 000000000000..8d8f25daf53c
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/files/9.10.0-0002-Fix-d_alias-to-d_u.d_alias-for-kernel-3.18.patch
@@ -0,0 +1,34 @@
+From 8df98f3c779fa43d073a42e82bd18cf28c2bd4af Mon Sep 17 00:00:00 2001
+From: Wendell Smith <wendellwsmith@gmail.com>
+Date: Sat, 7 Feb 2015 15:42:13 -0500
+Subject: [PATCH 2/3] Fix d_alias to d_u.d_alias for kernel 3.18
+
+---
+ open-vm-tools/modules/linux/vmhgfs/inode.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/open-vm-tools/modules/linux/vmhgfs/inode.c b/open-vm-tools/modules/linux/vmhgfs/inode.c
+index 77b1669..2d289e3 100644
+--- a/open-vm-tools/modules/linux/vmhgfs/inode.c
++++ b/open-vm-tools/modules/linux/vmhgfs/inode.c
+@@ -1917,7 +1917,7 @@ HgfsPermission(struct inode *inode,
+ p,
+ #endif
+ &inode->i_dentry,
+- d_alias) {
++ d_u.d_alias) {
+ int dcount = hgfs_d_count(dentry);
+ if (dcount) {
+ LOG(4, ("Found %s %d \n", dentry->d_name.name, dcount));
+@@ -1970,7 +1970,7 @@ HgfsPermission(struct inode *inode,
+ /* Find a dentry with valid d_count. Refer bug 587879. */
+ list_for_each(pos, &inode->i_dentry) {
+ int dcount;
+- struct dentry *dentry = list_entry(pos, struct dentry, d_alias);
++ struct dentry *dentry = list_entry(pos, struct dentry, d_u.d_alias);
+ dcount = hgfs_d_count(dentry);
+ if (dcount) {
+ LOG(4, ("Found %s %d \n", (dentry)->d_name.name, dcount));
+--
+2.3.4
+
diff --git a/app-emulation/open-vm-tools-kmod/files/9.10.0-0003-Fix-f_dentry-msghdr-kernel-3.19.patch b/app-emulation/open-vm-tools-kmod/files/9.10.0-0003-Fix-f_dentry-msghdr-kernel-3.19.patch
new file mode 100644
index 000000000000..851b9d33d86b
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/files/9.10.0-0003-Fix-f_dentry-msghdr-kernel-3.19.patch
@@ -0,0 +1,429 @@
+From 61751db8cd4679fc76034a5d1f99df6c64c48de6 Mon Sep 17 00:00:00 2001
+From: lotan <lotan@gmx.de>
+Date: Mon, 30 Mar 2015 08:58:56 +0200
+Subject: [PATCH 3/3] Make vmhgfs work on kernel 3.19.
+
+---
+ open-vm-tools/modules/linux/vmhgfs/dir.c | 35 ++++++------
+ open-vm-tools/modules/linux/vmhgfs/file.c | 65 +++++++++++-----------
+ open-vm-tools/modules/linux/vmhgfs/fsutil.c | 3 +-
+ .../modules/linux/vmhgfs/shared/compat_dentry.h | 10 ++++
+ 4 files changed, 63 insertions(+), 50 deletions(-)
+ create mode 100644 open-vm-tools/modules/linux/vmhgfs/shared/compat_dentry.h
+
+diff --git a/open-vm-tools/modules/linux/vmhgfs/dir.c b/open-vm-tools/modules/linux/vmhgfs/dir.c
+index 809611a..c6a87bd 100644
+--- a/open-vm-tools/modules/linux/vmhgfs/dir.c
++++ b/open-vm-tools/modules/linux/vmhgfs/dir.c
+@@ -31,6 +31,7 @@
+ #include "compat_kernel.h"
+ #include "compat_slab.h"
+ #include "compat_mutex.h"
++#include "compat_dentry.h"
+
+ #include "cpName.h"
+ #include "hgfsEscape.h"
+@@ -414,7 +415,7 @@ HgfsPackDirOpenRequest(struct file *file, // IN: File pointer for this open
+
+ /* Build full name to send to server. */
+ if (HgfsBuildPath(name, req->bufferSize - (requestSize - 1),
+- file->f_dentry) < 0) {
++ DENTRY(file)) < 0) {
+ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: build path failed\n"));
+ return -EINVAL;
+ }
+@@ -560,8 +561,8 @@ HgfsPrivateDirRelease(struct file *file, // IN: File for the dir getting relea
+ int result = 0;
+
+ ASSERT(file);
+- ASSERT(file->f_dentry);
+- ASSERT(file->f_dentry->d_sb);
++ ASSERT(DENTRY(file));
++ ASSERT(DENTRY(file)->d_sb);
+
+ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPrivateDirRelease: close fh %u\n", handle));
+
+@@ -704,7 +705,7 @@ HgfsDirLlseek(struct file *file,
+ loff_t offset,
+ int origin)
+ {
+- struct dentry *dentry = file->f_dentry;
++ struct dentry *dentry = DENTRY(file);
+ struct inode *inode = dentry->d_inode;
+ compat_mutex_t *mtx;
+
+@@ -853,7 +854,7 @@ HgfsReaddirRefreshEntries(struct file *file) // IN: File pointer for this ope
+ }
+
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: error: stale handle (%s) return %d)\n",
+- __func__, file->f_dentry->d_name.name, result));
++ __func__, DENTRY(file)->d_name.name, result));
+ return result;
+ }
+
+@@ -988,9 +989,9 @@ HgfsReaddirNextEntry(struct file *file, // IN: file
+ char *fileName = NULL;
+ int result;
+
+- ASSERT(file->f_dentry->d_inode->i_sb);
++ ASSERT(DENTRY(file)->d_inode->i_sb);
+
+- si = HGFS_SB_TO_COMMON(file->f_dentry->d_inode->i_sb);
++ si = HGFS_SB_TO_COMMON(DENTRY(file)->d_inode->i_sb);
+ *entryIgnore = FALSE;
+
+ /*
+@@ -1079,18 +1080,18 @@ HgfsReaddirNextEntry(struct file *file, // IN: file
+ */
+ if (!strncmp(entryName, ".", sizeof ".")) {
+ if (!dotAndDotDotIgnore) {
+- *entryIno = file->f_dentry->d_inode->i_ino;
++ *entryIno = DENTRY(file)->d_inode->i_ino;
+ } else {
+ *entryIgnore = TRUE;
+ }
+ } else if (!strncmp(entryName, "..", sizeof "..")) {
+ if (!dotAndDotDotIgnore) {
+- *entryIno = compat_parent_ino(file->f_dentry);
++ *entryIno = compat_parent_ino(DENTRY(file));
+ } else {
+ *entryIgnore = TRUE;
+ }
+ } else {
+- *entryIno = HgfsGetFileInode(&entryAttrs, file->f_dentry->d_inode->i_sb);
++ *entryIno = HgfsGetFileInode(&entryAttrs, DENTRY(file)->d_inode->i_sb);
+ }
+
+ if (*entryIgnore) {
+@@ -1170,16 +1171,16 @@ HgfsDoReaddir(struct file *file, // IN:
+ ASSERT(filldirCtx);
+
+ if (!file ||
+- !(file->f_dentry) ||
+- !(file->f_dentry->d_inode)) {
++ !(DENTRY(file)) ||
++ !(DENTRY(file)->d_inode)) {
+ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsReaddir: null input\n"));
+ return -EFAULT;
+ }
+
+ LOG(4, (KERN_DEBUG "VMware hgfs: %s(%s, inum %lu, pos %Lu)\n",
+ __func__,
+- file->f_dentry->d_name.name,
+- file->f_dentry->d_inode->i_ino,
++ DENTRY(file)->d_name.name,
++ DENTRY(file)->d_inode->i_ino,
+ *currentPos));
+
+ /*
+@@ -1294,7 +1295,7 @@ HgfsReaddir(struct file *file, // IN:
+ /* If either dot and dotdot are filled in for us we can exit. */
+ if (!dir_emit_dots(file, ctx)) {
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: dir_emit_dots(%s, @ %Lu)\n",
+- __func__, file->f_dentry->d_name.name, ctx->pos));
++ __func__, DENTRY(file)->d_name.name, ctx->pos));
+ return 0;
+ }
+
+@@ -1464,8 +1465,8 @@ HgfsDirRelease(struct inode *inode, // IN: Inode that the file* points to
+
+ ASSERT(inode);
+ ASSERT(file);
+- ASSERT(file->f_dentry);
+- ASSERT(file->f_dentry->d_sb);
++ ASSERT(DENTRY(file));
++ ASSERT(DENTRY(file)->d_sb);
+
+ handle = FILE_GET_FI_P(file)->handle;
+
+diff --git a/open-vm-tools/modules/linux/vmhgfs/file.c b/open-vm-tools/modules/linux/vmhgfs/file.c
+index bbde3f4..39502d0 100644
+--- a/open-vm-tools/modules/linux/vmhgfs/file.c
++++ b/open-vm-tools/modules/linux/vmhgfs/file.c
+@@ -32,6 +32,7 @@
+ #include "compat_fs.h"
+ #include "compat_kernel.h"
+ #include "compat_slab.h"
++#include "compat_dentry.h"
+
+ /* Must be after compat_fs.h */
+ #if defined VMW_USE_AIO
+@@ -384,7 +385,7 @@ HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open
+ /* Build full name to send to server. */
+ if (HgfsBuildPath(name,
+ req->bufferSize - (requestSize - 1),
+- file->f_dentry) < 0) {
++ DENTRY(file)) < 0) {
+ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: build path "
+ "failed\n"));
+ return -EINVAL;
+@@ -523,8 +524,8 @@ HgfsOpen(struct inode *inode, // IN: Inode of the file to open
+ ASSERT(inode);
+ ASSERT(inode->i_sb);
+ ASSERT(file);
+- ASSERT(file->f_dentry);
+- ASSERT(file->f_dentry->d_inode);
++ ASSERT(DENTRY(file));
++ ASSERT(DENTRY(file)->d_inode);
+
+ iinfo = INODE_GET_II_P(inode);
+
+@@ -605,7 +606,7 @@ HgfsOpen(struct inode *inode, // IN: Inode of the file to open
+ * This is not the root of our file system so there should always
+ * be a parent.
+ */
+- ASSERT(file->f_dentry->d_parent);
++ ASSERT(DENTRY(file)->d_parent);
+
+ /*
+ * Here we obtain a reference on the parent to make sure it doesn't
+@@ -620,10 +621,10 @@ HgfsOpen(struct inode *inode, // IN: Inode of the file to open
+ * We could do this if we were willing to give up support for
+ * O_EXCL on 2.4 kernels.
+ */
+- dparent = dget(file->f_dentry->d_parent);
++ dparent = dget(DENTRY(file)->d_parent);
+ iparent = dparent->d_inode;
+
+- HgfsSetUidGid(iparent, file->f_dentry,
++ HgfsSetUidGid(iparent, DENTRY(file),
+ current_fsuid(), current_fsgid());
+
+ dput(dparent);
+@@ -683,7 +684,7 @@ out:
+ * forcing a revalidate on one will not force it on any others.
+ */
+ if (result != 0 && iinfo->createdAndUnopened == TRUE) {
+- HgfsDentryAgeForce(file->f_dentry);
++ HgfsDentryAgeForce(DENTRY(file));
+ }
+ return result;
+ }
+@@ -772,13 +773,13 @@ HgfsFileRead(struct kiocb *iocb, // IN: I/O control block
+
+ ASSERT(iocb);
+ ASSERT(iocb->ki_filp);
+- ASSERT(iocb->ki_filp->f_dentry);
++ ASSERT(DENTRY(iocb->ki_filp));
+ ASSERT(iov);
+
+ pos = HGFS_IOCB_TO_POS(iocb, offset);
+ iovSegs = HGFS_IOV_TO_SEGS(iov, numSegs);
+
+- readDentry = iocb->ki_filp->f_dentry;
++ readDentry = DENTRY(iocb->ki_filp);
+
+ LOG(4, (KERN_DEBUG "VMware hgfs: %s(%s/%s)\n",
+ __func__, readDentry->d_parent->d_name.name,
+@@ -882,13 +883,13 @@ HgfsFileWrite(struct kiocb *iocb, // IN: I/O control block
+
+ ASSERT(iocb);
+ ASSERT(iocb->ki_filp);
+- ASSERT(iocb->ki_filp->f_dentry);
++ ASSERT(DENTRY(iocb->ki_filp));
+ ASSERT(iov);
+
+ pos = HGFS_IOCB_TO_POS(iocb, offset);
+ iovSegs = HGFS_IOV_TO_SEGS(iov, numSegs);
+
+- writeDentry = iocb->ki_filp->f_dentry;
++ writeDentry = DENTRY(iocb->ki_filp);
+
+ LOG(4, (KERN_DEBUG "VMware hgfs: %s(%s/%s)\n",
+ __func__, writeDentry->d_parent->d_name.name,
+@@ -951,7 +952,7 @@ HgfsRead(struct file *file, // IN: File to read from
+ int result;
+
+ ASSERT(file);
+- ASSERT(file->f_dentry);
++ ASSERT(DENTRY(file));
+ ASSERT(buf);
+ ASSERT(offset);
+
+@@ -959,7 +960,7 @@ HgfsRead(struct file *file, // IN: File to read from
+ __func__, file->f_dentry->d_parent->d_name.name,
+ file->f_dentry->d_name.name, count, (long long) *offset));
+
+- result = HgfsRevalidate(file->f_dentry);
++ result = HgfsRevalidate(DENTRY(file));
+ if (result) {
+ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRead: invalid dentry\n"));
+ goto out;
+@@ -1002,8 +1003,8 @@ HgfsWrite(struct file *file, // IN: File to write to
+ int result;
+
+ ASSERT(file);
+- ASSERT(file->f_dentry);
+- ASSERT(file->f_dentry->d_inode);
++ ASSERT(DENTRY(file));
++ ASSERT(DENTRY(file)->d_inode);
+ ASSERT(buf);
+ ASSERT(offset);
+
+@@ -1011,7 +1012,7 @@ HgfsWrite(struct file *file, // IN: File to write to
+ __func__, file->f_dentry->d_parent->d_name.name,
+ file->f_dentry->d_name.name, count, (long long) *offset));
+
+- result = HgfsRevalidate(file->f_dentry);
++ result = HgfsRevalidate(DENTRY(file));
+ if (result) {
+ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsWrite: invalid dentry\n"));
+ goto out;
+@@ -1051,7 +1052,7 @@ HgfsSeek(struct file *file, // IN: File to seek
+ loff_t result = -1;
+
+ ASSERT(file);
+- ASSERT(file->f_dentry);
++ ASSERT(DENTRY(file));
+
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s(%s/%s, %u, %lld, %d)\n",
+ __func__,
+@@ -1059,7 +1060,7 @@ HgfsSeek(struct file *file, // IN: File to seek
+ file->f_dentry->d_name.name,
+ FILE_GET_FI_P(file)->handle, offset, origin));
+
+- result = (loff_t) HgfsRevalidate(file->f_dentry);
++ result = (loff_t) HgfsRevalidate(DENTRY(file));
+ if (result) {
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: invalid dentry\n", __func__));
+ goto out;
+@@ -1143,8 +1144,8 @@ HgfsFlush(struct file *file // IN: file to flush
+ int ret = 0;
+
+ LOG(4, (KERN_DEBUG "VMware hgfs: %s(%s/%s)\n",
+- __func__, file->f_dentry->d_parent->d_name.name,
+- file->f_dentry->d_name.name));
++ __func__, DENTRY(file)->d_parent->d_name.name,
++ DENTRY(file)->d_name.name));
+
+ if ((file->f_mode & FMODE_WRITE) == 0) {
+ goto exit;
+@@ -1157,7 +1158,7 @@ HgfsFlush(struct file *file // IN: file to flush
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
+ ret = vfs_fsync(file, 0);
+ #else
+- ret = HgfsDoFsync(file->f_dentry->d_inode);
++ ret = HgfsDoFsync(DENTRY(file)->d_inode);
+ #endif
+
+ exit:
+@@ -1215,13 +1216,13 @@ HgfsFsync(struct file *file, // IN: File we operate on
+
+ LOG(4, (KERN_DEBUG "VMware hgfs: %s(%s/%s, %lld, %lld, %d)\n",
+ __func__,
+- file->f_dentry->d_parent->d_name.name,
+- file->f_dentry->d_name.name,
++ DENTRY(file)->d_parent->d_name.name,
++ DENTRY(file)->d_name.name,
+ startRange, endRange,
+ datasync));
+
+ /* Flush writes to the server and return any errors */
+- inode = file->f_dentry->d_inode;
++ inode = DENTRY(file)->d_inode;
+ #if defined VMW_FSYNC_31
+ ret = filemap_write_and_wait_range(inode->i_mapping, startRange, endRange);
+ #else
+@@ -1261,14 +1262,14 @@ HgfsMmap(struct file *file, // IN: File we operate on
+
+ ASSERT(file);
+ ASSERT(vma);
+- ASSERT(file->f_dentry);
++ ASSERT(DENTRY(file));
+
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s(%s/%s)\n",
+ __func__,
+ file->f_dentry->d_parent->d_name.name,
+ file->f_dentry->d_name.name));
+
+- result = HgfsRevalidate(file->f_dentry);
++ result = HgfsRevalidate(DENTRY(file));
+ if (result) {
+ LOG(4, (KERN_DEBUG "VMware hgfs: %s: invalid dentry\n", __func__));
+ goto out;
+@@ -1309,8 +1310,8 @@ HgfsRelease(struct inode *inode, // IN: Inode that this file points to
+
+ ASSERT(inode);
+ ASSERT(file);
+- ASSERT(file->f_dentry);
+- ASSERT(file->f_dentry->d_sb);
++ ASSERT(DENTRY(file));
++ ASSERT(DENTRY(file)->d_sb);
+
+ handle = FILE_GET_FI_P(file)->handle;
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s(%s/%s, %u)\n",
+@@ -1443,14 +1444,14 @@ HgfsSendfile(struct file *file, // IN: File to read from
+ ssize_t result;
+
+ ASSERT(file);
+- ASSERT(file->f_dentry);
++ ASSERT(DENTRY(file));
+ ASSERT(target);
+ ASSERT(offset);
+ ASSERT(actor);
+
+ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSendfile: was called\n"));
+
+- result = HgfsRevalidate(file->f_dentry);
++ result = HgfsRevalidate(DENTRY(file));
+ if (result) {
+ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSendfile: invalid dentry\n"));
+ goto out;
+@@ -1497,7 +1498,7 @@ HgfsSpliceRead(struct file *file, // IN: File to read from
+ ssize_t result;
+
+ ASSERT(file);
+- ASSERT(file->f_dentry);
++ ASSERT(DENTRY(file));
+
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s(%s/%s, %lu@%Lu)\n",
+ __func__,
+@@ -1505,7 +1506,7 @@ HgfsSpliceRead(struct file *file, // IN: File to read from
+ file->f_dentry->d_name.name,
+ (unsigned long) len, (unsigned long long) *offset));
+
+- result = HgfsRevalidate(file->f_dentry);
++ result = HgfsRevalidate(DENTRY(file));
+ if (result) {
+ LOG(4, (KERN_DEBUG "VMware hgfs: %s: invalid dentry\n", __func__));
+ goto out;
+diff --git a/open-vm-tools/modules/linux/vmhgfs/fsutil.c b/open-vm-tools/modules/linux/vmhgfs/fsutil.c
+index 5023324..a2e794c 100644
+--- a/open-vm-tools/modules/linux/vmhgfs/fsutil.c
++++ b/open-vm-tools/modules/linux/vmhgfs/fsutil.c
+@@ -36,6 +36,7 @@
+ #include "compat_sched.h"
+ #include "compat_slab.h"
+ #include "compat_spinlock.h"
++#include "compat_dentry.h"
+
+ #include "vm_assert.h"
+ #include "cpName.h"
+@@ -1924,7 +1925,7 @@ HgfsCreateFileInfo(struct file *file, // IN: File pointer to attach to
+
+ ASSERT(file);
+
+- inodeInfo = INODE_GET_II_P(file->f_dentry->d_inode);
++ inodeInfo = INODE_GET_II_P(DENTRY(file)->d_inode);
+ ASSERT(inodeInfo);
+
+ /* Get the mode of the opened file. */
+diff --git a/open-vm-tools/modules/linux/vmhgfs/shared/compat_dentry.h b/open-vm-tools/modules/linux/vmhgfs/shared/compat_dentry.h
+new file mode 100644
+index 0000000..dd53760
+--- /dev/null
++++ b/open-vm-tools/modules/linux/shared/compat_dentry.h
+@@ -0,0 +1,10 @@
++#ifndef __COMPAT_DENTRY_H__
++# define __COMPAT_DENTRY_H__
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++# define DENTRY(file) (file->f_path.dentry)
++#else
++# define DENTRY(file) (file->f_dentry)
++#endif
++
++#endif /* __COMPAT_DENTRY_H__ */
+--
+2.3.4
+
diff --git a/app-emulation/open-vm-tools-kmod/files/frozen.patch b/app-emulation/open-vm-tools-kmod/files/frozen.patch
new file mode 100644
index 000000000000..8b3fd7f37910
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/files/frozen.patch
@@ -0,0 +1,28 @@
+diff -urpN a/modules/linux/vmsync/sync.c b/modules/linux/vmsync/sync.c
+--- a/modules/linux/vmsync/sync.c 2012-08-01 19:02:59.000000000 -0700
++++ b/modules/linux/vmsync/sync.c 2012-10-14 07:38:18.000000000 -0700
+@@ -162,7 +162,11 @@ VmSyncThawDevices(void *_state) // IN
+ cancel_delayed_work(&state->thawTask);
+ list_for_each_safe(cur, tmp, &state->devices) {
+ dev = list_entry(cur, VmSyncBlockDevice, list);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
++ if (dev->sb != NULL && dev->sb->s_writers.frozen != SB_UNFROZEN) {
++#else
+ if (dev->sb != NULL && dev->sb->s_frozen != SB_UNFROZEN) {
++#endif
+ thaw_bdev(dev->bdev, dev->sb);
+ atomic_dec(&gFreezeCount);
+ }
+@@ -237,7 +241,11 @@ VmSyncAddPath(const VmSyncState *state,
+ * the superblock is already frozen.
+ */
+ if (inode->i_sb->s_bdev == NULL ||
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
++ inode->i_sb->s_writers.frozen != SB_UNFROZEN) {
++#else
+ inode->i_sb->s_frozen != SB_UNFROZEN) {
++#endif
+ result = (inode->i_sb->s_bdev == NULL) ? -EINVAL : -EALREADY;
+ compat_path_release(&nd);
+ goto exit;
+
diff --git a/app-emulation/open-vm-tools-kmod/files/putname.patch b/app-emulation/open-vm-tools-kmod/files/putname.patch
new file mode 100644
index 000000000000..b605e12fa07f
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/files/putname.patch
@@ -0,0 +1,13 @@
+diff --git a/modules/linux/vmblock/linux/control.c b/modules/linux/vmblock/linux/control.c
+index 79716bd..2dd83fe 100644
+--- a/modules/linux/vmblock/linux/control.c
++++ b/modules/linux/vmblock/linux/control.c
+@@ -293,7 +293,7 @@ ExecuteBlockOp(const char __user *buf, // IN: buffer with name
+
+ retval = i < 0 ? -EINVAL : blockOp(name, blocker);
+
+- putname(name);
++ __putname(name);
+
+ return retval;
+ }
diff --git a/app-emulation/open-vm-tools-kmod/files/vmhgfs-linux-3.11.patch b/app-emulation/open-vm-tools-kmod/files/vmhgfs-linux-3.11.patch
new file mode 100644
index 000000000000..3918162a7057
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/files/vmhgfs-linux-3.11.patch
@@ -0,0 +1,42 @@
+Source: https://github.com/rasa/vmware-tools-patches/
+
+--- a/modules/linux/vmhgfs/inode.c
++++ b/modules/linux/vmhgfs/inode.c
+@@ -31,6 +31,9 @@
+ #include <linux/namei.h>
+ #endif
+ #include <linux/highmem.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++#include <linux/dcache.h>
++#endif
+
+ #include "compat_cred.h"
+ #include "compat_fs.h"
+@@ -1890,7 +1893,11 @@
+ #endif
+ &inode->i_dentry,
+ d_alias) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++ int dcount = d_count(dentry);
++#else
+ int dcount = dentry->d_count;
++#endif
+ if (dcount) {
+ LOG(4, ("Found %s %d \n", dentry->d_name.name, dcount));
+ return HgfsAccessInt(dentry, mask & (MAY_READ | MAY_WRITE | MAY_EXEC));
+@@ -1943,10 +1950,12 @@
+ list_for_each(pos, &inode->i_dentry) {
+ int dcount;
+ struct dentry *dentry = list_entry(pos, struct dentry, d_alias);
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
+- dcount = atomic_read(&dentry->d_count);
+-#else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
++ dcount = d_count(dentry);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
+ dcount = dentry->d_count;
++#else
++ dcount = atomic_read(&dentry->d_count);
+ #endif
+ if (dcount) {
+ LOG(4, ("Found %s %d \n", (dentry)->d_name.name, dcount));
diff --git a/app-emulation/open-vm-tools-kmod/metadata.xml b/app-emulation/open-vm-tools-kmod/metadata.xml
new file mode 100644
index 000000000000..2560d635322b
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>vmware</herd>
+ <maintainer>
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <longdescription>
+ The Open Virtual Machine Tools (open-vm-tools) are the open source
+ implementation of VMware Tools. They are a set of guest operating system
+ virtualization components that enhance performance and user experience
+ of virtual machines.
+ </longdescription>
+ <use>
+ <flag name="vmhgfs">Build the vmhgfs module for file sharing support with the host</flag>
+ <flag name="vmxnet">Build the vmxnet module (older virtual NIC)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">open-vm-tools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-2013.09.16.1328054.ebuild b/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-2013.09.16.1328054.ebuild
new file mode 100644
index 000000000000..385b63bf209a
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-2013.09.16.1328054.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-mod versionator udev
+
+MY_PN="${PN/-kmod}"
+MY_PV="$(replace_version_separator 3 '-')"
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="Opensourced tools for VMware guests"
+HOMEPAGE="http://open-vm-tools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="vmhgfs"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ CONFIG_CHECK="~DRM_VMWGFX ~VMWARE_BALLOON ~VMWARE_PVSCSI ~VMXNET3
+ !UIDGID_STRICT_TYPE_CHECKS"
+
+ # See logic in configure.ac.
+ local MODULES="vmxnet"
+
+ use vmhgfs && MODULES+=" vmhgfs"
+
+ if kernel_is -lt 3 9; then
+ MODULES+=" vmci vsock"
+ else
+ CONFIG_CHECK+=" VMWARE_VMCI ~VMWARE_VMCI_VSOCKETS"
+ fi
+
+ if kernel_is -lt 3; then
+ MODULES+=" vmblock vmsync"
+ else
+ CONFIG_CHECK+=" ~FUSE_FS"
+ fi
+
+ local mod
+ for mod in ${MODULES}; do
+ MODULE_NAMES+=" ${mod}(ovt:modules/linux/${mod})"
+ done
+
+ linux-mod_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/vmhgfs-linux-3.11.patch"
+ epatch_user
+}
+
+src_configure() {
+ BUILD_TARGETS="auto-build"
+ export OVT_SOURCE_DIR="${S}"
+ export LINUXINCLUDE="${KV_OUT_DIR}/include"
+}
+
+src_install() {
+ linux-mod_src_install
+ udev_dorules "${FILESDIR}/60-vmware.rules"
+}
diff --git a/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-9.10.0_p2476743.ebuild b/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-9.10.0_p2476743.ebuild
new file mode 100644
index 000000000000..e1294bb000c0
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-9.10.0_p2476743.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-mod versionator udev
+
+MY_PN=${PN%-kmod}
+MY_P=${MY_PN}-${PV/_p/-}
+
+DESCRIPTION="Opensourced tools for VMware guests"
+HOMEPAGE="http://open-vm-tools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+vmhgfs +vmxnet"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ CONFIG_CHECK="~DRM_VMWGFX ~VMWARE_BALLOON ~VMWARE_PVSCSI ~VMXNET3"
+
+ # See logic in configure.ac.
+ local MODULES=
+
+ use vmhgfs && MODULES+=" vmhgfs"
+ use vmxnet && MODULES+=" vmxnet"
+
+ if kernel_is -lt 3 9; then
+ MODULES+=" vmci vsock"
+ else
+ CONFIG_CHECK+=" VMWARE_VMCI ~VMWARE_VMCI_VSOCKETS"
+ fi
+
+ if kernel_is -lt 3; then
+ MODULES+=" vmblock vmsync"
+ else
+ CONFIG_CHECK+=" ~FUSE_FS"
+ fi
+
+ local mod
+ for mod in ${MODULES}; do
+ MODULE_NAMES+=" ${mod}(ovt:modules/linux/${mod})"
+ done
+
+ linux-mod_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/9.10.0-0001-Fix-vmxnet-module-on-kernels-3.16.patch
+ epatch "${FILESDIR}"/9.10.0-0002-Fix-d_alias-to-d_u.d_alias-for-kernel-3.18.patch
+ epatch "${FILESDIR}"/9.10.0-0003-Fix-f_dentry-msghdr-kernel-3.19.patch
+ epatch_user
+}
+
+src_configure() {
+ BUILD_TARGETS="auto-build"
+ export OVT_SOURCE_DIR="${S}"
+ export LINUXINCLUDE="${KV_OUT_DIR}/include"
+}
+
+src_install() {
+ linux-mod_src_install
+ udev_dorules "${FILESDIR}/60-vmware.rules"
+}
diff --git a/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-9.4.0.1280544.ebuild b/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-9.4.0.1280544.ebuild
new file mode 100644
index 000000000000..d5951a5605ce
--- /dev/null
+++ b/app-emulation/open-vm-tools-kmod/open-vm-tools-kmod-9.4.0.1280544.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-mod versionator udev
+
+MY_PN="${PN/-kmod}"
+MY_PV="$(replace_version_separator 3 '-')"
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="Opensourced tools for VMware guests"
+HOMEPAGE="http://open-vm-tools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ CONFIG_CHECK="~DRM_VMWGFX ~VMWARE_BALLOON ~VMWARE_PVSCSI ~VMXNET3
+ !UIDGID_STRICT_TYPE_CHECKS"
+
+ # See logic in configure.ac.
+ local MODULES="vmxnet vmhgfs"
+
+ if kernel_is -lt 3 9; then
+ MODULES+=" vmci vsock"
+ else
+ CONFIG_CHECK+=" ~VMWARE_VMCI ~VMWARE_VMCI_VSOCKETS"
+ fi
+
+ if kernel_is -lt 3; then
+ MODULES+=" vmblock vmsync"
+ else
+ CONFIG_CHECK+=" ~FUSE_FS"
+ fi
+
+ local mod
+ for mod in ${MODULES}; do
+ MODULE_NAMES+=" ${mod}(ovt:modules/linux/${mod})"
+ done
+
+ linux-mod_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/frozen.patch"
+ epatch "${FILESDIR}/putname.patch"
+ epatch_user
+}
+
+src_configure() {
+ BUILD_TARGETS="auto-build"
+ export OVT_SOURCE_DIR="${S}"
+ export LINUXINCLUDE="${KV_OUT_DIR}/include"
+}
+
+src_install() {
+ linux-mod_src_install
+ udev_dorules "${FILESDIR}/60-vmware.rules"
+}
diff --git a/app-emulation/open-vm-tools/Manifest b/app-emulation/open-vm-tools/Manifest
new file mode 100644
index 000000000000..5ea04658108b
--- /dev/null
+++ b/app-emulation/open-vm-tools/Manifest
@@ -0,0 +1,4 @@
+DIST open-vm-tools-2013.09.16-1328054.tar.gz 3793719 SHA256 470a6ea3ce14c2c5ea6b7bc59745eccbacc8d88a3f343e712312786435975d13 SHA512 7ae62d5411b4bdefd0e8db5f0a81bb357bfd4a624af06bf9a5a74f49ede0b7051b41dfe548c758fd7e73cded34af983c8aa0c412e65343092e05ae9b997895cb WHIRLPOOL 688fb4e494fb7aab7d0eb09189afff95ec8727bcc1893a4ec632bb8198661a1a55d58a813d2d56a3ac330fd7a55afc1fa7dc11f1d60c06c91ecf6a0bf866b249
+DIST open-vm-tools-9.10.0-2476743.tar.gz 4093306 SHA256 e146ad53d744d7793ee72c5271fc49a916613534c14827c227fdaef4b3579c96 SHA512 8c8e4a559c0374e020c8261d4c8f6855efbe3f509745ee02ec03ab9ebce7e1327ec1e5e18f674cb464630ace9dc33b4262ffd119fc237c286ee44327e4590385 WHIRLPOOL 162aba889e249ac229e003a57753ff78b86f612a0753ae83f9de52eb1d0ae0a11aee0279c192eb073dabc76d718747c614d4122395abfc8c8d0f9d80a903189a
+DIST open-vm-tools-9.10.2-2822639.tar.gz 4044062 SHA256 6c5a7f88b597585a273fb9918fdb9201c79e30731a765fbec1acda14d1f3d74c SHA512 0a0683b1d86ff1926517c882943c30267f04710bdd9a70bf7aa75534d64480c3cc2cf5eae5655ed228d4e140129f46efeb2cdbbb8191b142756ad359cec58b72 WHIRLPOOL 7a15d5561fcd52c32c668d8da86ada5a850b4fdaac373f9850c4906b4939ebf620a2ef7740b8a15e513ececb95bd02b285ea5632860bea87df666fcef539ef5f
+DIST open-vm-tools-9.4.0-1280544.tar.gz 3659504 SHA256 5d30652eb0f6dc5e930781029c184837e700be5543b6a7116db4c62a6f3ca399 SHA512 07b36f49713140606f74864b59c2e01c9ed83a960dd3f5d172b84fc75e760f7370065774a0e26897924af60454c86b682ca0fd32276b0e9fb17b268247f8cbdf WHIRLPOOL 88533768cf718de3b5f64e688597209fa2029d02cdf350d7fd05ec8dd8ca0f0c125a8d1445c1ec9287bc486076d5c335f3cc615c3f0b9aa7bac84e921da4c9e6
diff --git a/app-emulation/open-vm-tools/files/9.10.0-vgauth.patch b/app-emulation/open-vm-tools/files/9.10.0-vgauth.patch
new file mode 100644
index 000000000000..aa8d1e3e353c
--- /dev/null
+++ b/app-emulation/open-vm-tools/files/9.10.0-vgauth.patch
@@ -0,0 +1,22 @@
+--- a/vgauth/service/Makefile.am
++++ b/vgauth/service/Makefile.am
+@@ -78,7 +78,7 @@
+ $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+ else
+- VGAuthService_LINK = $(LINK)
++ VGAuthService_LINK = $(CXXLINK)
+ endif
+
+ # Message catalogs.
+--- a/vgauth/service/Makefile.in
++++ b/vgauth/service/Makefile.in
+@@ -322,7 +322,7 @@
+ ../lib/libvgauth.la @XERCES_LIBS@ @XMLSECURITY_LIBS@ \
+ @SSL_LIBS@ -lxerces-c -lxml-security-c -lssl -lcrypto \
+ $(am__append_1)
+-@HAVE_ICU_FALSE@VGAuthService_LINK = $(LINK)
++@HAVE_ICU_FALSE@VGAuthService_LINK = $(CXXLINK)
+ @HAVE_ICU_TRUE@VGAuthService_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ @HAVE_ICU_TRUE@ $(LIBTOOLFLAGS) --mode=link $(CXX) \
+ @HAVE_ICU_TRUE@ $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
diff --git a/app-emulation/open-vm-tools/files/network b/app-emulation/open-vm-tools/files/network
new file mode 100644
index 000000000000..3608455a9bc0
--- /dev/null
+++ b/app-emulation/open-vm-tools/files/network
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+#
+# net.eth0, net.eth1, network, wicd, NetworkManager
+service="net.eth0"
+
+if ! rc-service -e ${service}
+then
+ service="network"
+fi
+
+case "$1" in
+ suspend-vm)
+ rc-service ${service} stop
+ ;;
+ resume-vm)
+ rc-service ${service} start
+ ;;
+ *)
+ ;;
+esac
+
diff --git a/app-emulation/open-vm-tools/files/open-vm-tools.confd b/app-emulation/open-vm-tools/files/open-vm-tools.confd
new file mode 100644
index 000000000000..4414fabdb46e
--- /dev/null
+++ b/app-emulation/open-vm-tools/files/open-vm-tools.confd
@@ -0,0 +1,2 @@
+# Set this to no to disable drag and drop (and vmblock) loading.
+VM_DRAG_AND_DROP="yes"
diff --git a/app-emulation/open-vm-tools/files/open-vm-tools.desktop b/app-emulation/open-vm-tools/files/open-vm-tools.desktop
new file mode 100644
index 000000000000..97d4abf17f80
--- /dev/null
+++ b/app-emulation/open-vm-tools/files/open-vm-tools.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Type=Application
+Exec=vmware-user-suid-wrapper
+Name=VMware User Agent
+X-KDE-autostart-phase=1
+NoDisplay=true
diff --git a/app-emulation/open-vm-tools/files/open-vm-tools.initd b/app-emulation/open-vm-tools/files/open-vm-tools.initd
new file mode 100644
index 000000000000..6da69d4fb6ed
--- /dev/null
+++ b/app-emulation/open-vm-tools/files/open-vm-tools.initd
@@ -0,0 +1,60 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile="/run/vmtoolsd.pid"
+command="/usr/bin/vmtoolsd"
+command_args="-b ${pidfile}"
+
+vmblockmntpt="/proc/fs/vmblock/mountPoint"
+vmblockfusemntpt="/run/vmblock-fuse"
+
+depend() {
+ before checkfs fsck net X
+}
+
+start_vmblock() {
+ checkpath -d -m 1777 /tmp/VMwareDnD
+ if command -v vmware-vmblock-fuse > /dev/null; then
+ modprobe fuse > /dev/null 2>&1
+ checkpath -d "${vmblockfusemntpt}"
+ ebegin "Mounting vmblock-fuse"
+ vmware-vmblock-fuse \
+ -o subtype=vmware-vmblock,default_permissions,allow_other \
+ "${vmblockfusemntpt}"
+ eend $?
+ else
+ modprobe vmblock > /dev/null 2>&1
+ checkpath -d "${vmblockmntpt}"
+ ebegin "Mounting vmblock"
+ mount -t vmblock vmblock "${vmblockmntpt}"
+ eend $?
+ fi
+}
+
+stop_vmblock() {
+ if [ -d "${vmblockfusemntpt}" ]; then
+ ebegin "Unmounting vmblock-fuse"
+ umount "${vmblockfusemntpt}"
+ eend $?
+ else
+ ebegin "Unmounting vmblock"
+ umount "${vmblockmntpt}"
+ eend $?
+ fi
+}
+
+start_pre() {
+ if [ x"${VM_DRAG_AND_DROP}" = xyes ]; then
+ start_vmblock
+ fi
+ return 0
+}
+
+stop_post() {
+ if [ x"${VM_DRAG_AND_DROP}" = xyes ]; then
+ stop_vmblock
+ fi
+ return 0
+}
diff --git a/app-emulation/open-vm-tools/files/vmtoolsd.service b/app-emulation/open-vm-tools/files/vmtoolsd.service
new file mode 100644
index 000000000000..426d4fbd993c
--- /dev/null
+++ b/app-emulation/open-vm-tools/files/vmtoolsd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Service for virtual machines hosted on VMware
+Documentation=http://open-vm-tools.sourceforge.net/about.php
+ConditionVirtualization=vmware
+
+[Service]
+ExecStart=/usr/bin/vmtoolsd
+TimeoutStopSec=5
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-emulation/open-vm-tools/metadata.xml b/app-emulation/open-vm-tools/metadata.xml
new file mode 100644
index 000000000000..021bf9a90fc5
--- /dev/null
+++ b/app-emulation/open-vm-tools/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>vmware</herd>
+ <maintainer>
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <longdescription>
+ The Open Virtual Machine Tools (open-vm-tools) are the open source
+ implementation of VMware Tools. They are a set of guest operating system
+ virtualization components that enhance performance and user experience
+ of virtual machines.
+ </longdescription>
+ <use>
+ <flag name="doc">Generate API documentation</flag>
+ <flag name="fuse">Build vmblock-fuse in favor of FUSE based blocking mechanism for DnD</flag>
+ <flag name="grabbitmqproxy">Enable grabbitmqproxy</flag>
+ <flag name="pic">Force shared libraries to be built as PIC</flag>
+ <flag name="vgauth">Enable vgauth</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">vmware/open-vm-tools</remote-id>
+ <remote-id type="sourceforge">open-vm-tools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/open-vm-tools/open-vm-tools-2013.09.16.1328054-r2.ebuild b/app-emulation/open-vm-tools/open-vm-tools-2013.09.16.1328054-r2.ebuild
new file mode 100644
index 000000000000..3383e6fbdf22
--- /dev/null
+++ b/app-emulation/open-vm-tools/open-vm-tools-2013.09.16.1328054-r2.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib pam user versionator flag-o-matic systemd toolchain-funcs
+
+MY_PV="$(replace_version_separator 3 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Opensourced tools for VMware guests"
+HOMEPAGE="https://github.com/vmware/open-vm-tools"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X doc +fuse icu modules pam +pic xinerama"
+
+COMMON_DEPEND="
+ dev-libs/glib:2
+ dev-libs/libdnet
+ sys-apps/ethtool
+ sys-process/procps
+ pam? ( virtual/pam )
+ X? (
+ dev-cpp/gtkmm:2.4
+ x11-base/xorg-server
+ x11-drivers/xf86-input-vmmouse
+ x11-drivers/xf86-video-vmware
+ x11-libs/gtk+:2
+ x11-libs/libnotify
+ x11-libs/libX11
+ x11-libs/libXtst
+ )
+ fuse? ( sys-fs/fuse )
+ icu? ( dev-libs/icu:= )
+ xinerama? ( x11-libs/libXinerama )
+"
+
+DEPEND="${COMMON_DEPEND}
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ virtual/linux-sources
+ sys-apps/findutils
+"
+
+RDEPEND="${COMMON_DEPEND}
+ modules? ( app-emulation/open-vm-tools-kmod )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup vmware
+}
+
+src_prepare() {
+ # Do not filter out Werror
+ # Upstream Bug http://sourceforge.net/tracker/?func=detail&aid=2959749&group_id=204462&atid=989708
+ # sed -i -e 's/CFLAGS=.*Werror/#&/g' configure || die "sed comment out Werror failed"
+ sed -i -e 's:\(TEST_PLUGIN_INSTALLDIR=\).*:\1\$libdir/open-vm-tools/plugins/tests:g' configure || die "sed test_plugin_installdir failed"
+}
+
+src_configure() {
+ # http://bugs.gentoo.org/402279
+ if has_version '>=sys-process/procps-3.3.2'; then
+ export CUSTOM_PROCPS_NAME=procps
+ export CUSTOM_PROCPS_LIBS="$($(tc-getPKG_CONFIG) --libs libprocps)"
+ fi
+
+ local myeconfargs=(
+ --with-procps
+ --with-dnet
+ --without-kernel-modules
+ $(use_enable doc docs)
+ --docdir=/usr/share/doc/${PF}
+ $(use_with X x)
+ $(use_with X gtk2)
+ $(use_with X gtkmm)
+ $(use_with icu)
+ $(use_with pam)
+ $(use_with pic)
+ $(use_enable xinerama multimon)
+ )
+
+ econf "${myeconfargs[@]}"
+
+ # Bugs 260878, 326761
+ find ./ -name Makefile | xargs sed -i -e 's/-Werror//g' || die "sed out Werror failed"
+}
+
+src_install() {
+ default
+
+ rm "${D}"/etc/pam.d/vmtoolsd
+ pamd_mimic_system vmtoolsd auth account
+
+ rm "${D}"/usr/$(get_libdir)/*.la
+ rm "${D}"/usr/$(get_libdir)/open-vm-tools/plugins/common/*.la
+
+ newinitd "${FILESDIR}/open-vm-tools.initd" vmware-tools
+ newconfd "${FILESDIR}/open-vm-tools.confd" vmware-tools
+ systemd_dounit "${FILESDIR}"/vmtoolsd.service
+
+ exeinto /etc/vmware-tools/scripts/vmware/
+ doexe "${FILESDIR}"/network
+
+ if use X;
+ then
+ fperms 4755 "/usr/bin/vmware-user-suid-wrapper"
+
+ dobin "${S}"/scripts/common/vmware-xdg-detect-de
+
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}/open-vm-tools.desktop"
+
+ elog "To be able to use the drag'n'drop feature of VMware for file"
+ elog "exchange, please add the users to the 'vmware' group."
+ fi
+ elog "Add 'vmware-tools' service to the default runlevel."
+}
diff --git a/app-emulation/open-vm-tools/open-vm-tools-2013.09.16.1328054-r3.ebuild b/app-emulation/open-vm-tools/open-vm-tools-2013.09.16.1328054-r3.ebuild
new file mode 100644
index 000000000000..9340280cede9
--- /dev/null
+++ b/app-emulation/open-vm-tools/open-vm-tools-2013.09.16.1328054-r3.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib pam user versionator flag-o-matic systemd toolchain-funcs
+
+MY_PV="$(replace_version_separator 3 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Opensourced tools for VMware guests"
+HOMEPAGE="https://github.com/vmware/open-vm-tools"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X doc icu modules pam +pic xinerama"
+
+COMMON_DEPEND="
+ dev-libs/glib:2
+ dev-libs/libdnet
+ sys-apps/ethtool
+ sys-process/procps
+ pam? ( virtual/pam )
+ X? (
+ dev-cpp/gtkmm:2.4
+ x11-base/xorg-server
+ x11-drivers/xf86-input-vmmouse
+ x11-drivers/xf86-video-vmware
+ x11-libs/gtk+:2
+ x11-libs/libnotify
+ x11-libs/libX11
+ x11-libs/libXtst
+ )
+ sys-fs/fuse
+ icu? ( dev-libs/icu:= )
+ xinerama? ( x11-libs/libXinerama )
+"
+
+DEPEND="${COMMON_DEPEND}
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ virtual/linux-sources
+ sys-apps/findutils
+"
+
+RDEPEND="${COMMON_DEPEND}
+ modules? ( app-emulation/open-vm-tools-kmod )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup vmware
+}
+
+src_prepare() {
+ # Do not filter out Werror
+ # Upstream Bug http://sourceforge.net/tracker/?func=detail&aid=2959749&group_id=204462&atid=989708
+ # sed -i -e 's/CFLAGS=.*Werror/#&/g' configure || die "sed comment out Werror failed"
+ sed -i -e 's:\(TEST_PLUGIN_INSTALLDIR=\).*:\1\$libdir/open-vm-tools/plugins/tests:g' configure || die "sed test_plugin_installdir failed"
+}
+
+src_configure() {
+ # http://bugs.gentoo.org/402279
+ if has_version '>=sys-process/procps-3.3.2'; then
+ export CUSTOM_PROCPS_NAME=procps
+ export CUSTOM_PROCPS_LIBS="$($(tc-getPKG_CONFIG) --libs libprocps)"
+ fi
+
+ local myeconfargs=(
+ --with-procps
+ --with-dnet
+ --without-kernel-modules
+ $(use_enable doc docs)
+ --docdir=/usr/share/doc/${PF}
+ $(use_with X x)
+ $(use_with X gtk2)
+ $(use_with X gtkmm)
+ $(use_with icu)
+ $(use_with pam)
+ $(use_with pic)
+ $(use_enable xinerama multimon)
+ )
+
+ econf "${myeconfargs[@]}"
+
+ # Bugs 260878, 326761
+ find ./ -name Makefile | xargs sed -i -e 's/-Werror//g' || die "sed out Werror failed"
+}
+
+src_install() {
+ default
+
+ rm "${D}"/etc/pam.d/vmtoolsd
+ pamd_mimic_system vmtoolsd auth account
+
+ rm "${D}"/usr/$(get_libdir)/*.la
+ rm "${D}"/usr/$(get_libdir)/open-vm-tools/plugins/common/*.la
+
+ newinitd "${FILESDIR}/open-vm-tools.initd" vmware-tools
+ newconfd "${FILESDIR}/open-vm-tools.confd" vmware-tools
+ systemd_dounit "${FILESDIR}"/vmtoolsd.service
+
+ exeinto /etc/vmware-tools/scripts/vmware/
+ doexe "${FILESDIR}"/network
+
+ if use X;
+ then
+ fperms 4755 "/usr/bin/vmware-user-suid-wrapper"
+
+ dobin "${S}"/scripts/common/vmware-xdg-detect-de
+
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}/open-vm-tools.desktop"
+
+ elog "To be able to use the drag'n'drop feature of VMware for file"
+ elog "exchange, please add the users to the 'vmware' group."
+ fi
+ elog "Add 'vmware-tools' service to the default runlevel."
+}
diff --git a/app-emulation/open-vm-tools/open-vm-tools-9.10.0_p2476743.ebuild b/app-emulation/open-vm-tools/open-vm-tools-9.10.0_p2476743.ebuild
new file mode 100644
index 000000000000..565c0d77cf3c
--- /dev/null
+++ b/app-emulation/open-vm-tools/open-vm-tools-9.10.0_p2476743.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib pam user versionator flag-o-matic systemd toolchain-funcs
+
+MY_P="${PN}-${PV/_p/-}"
+
+DESCRIPTION="Opensourced tools for VMware guests"
+HOMEPAGE="https://github.com/vmware/open-vm-tools"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X doc grabbitmqproxy icu modules pam +pic vgauth xinerama"
+
+COMMON_DEPEND="
+ dev-libs/glib:2
+ dev-libs/libdnet
+ sys-apps/ethtool
+ sys-fs/fuse
+ >=sys-process/procps-3.3.2
+ grabbitmqproxy? ( dev-libs/openssl:0 )
+ icu? ( dev-libs/icu:= )
+ pam? ( virtual/pam )
+ vgauth? (
+ dev-libs/openssl:0
+ dev-libs/xerces-c
+ dev-libs/xml-security-c
+ )
+ X? (
+ dev-cpp/gtkmm:2.4
+ x11-base/xorg-server
+ x11-drivers/xf86-input-vmmouse
+ x11-drivers/xf86-video-vmware
+ x11-libs/gtk+:2
+ x11-libs/libnotify
+ x11-libs/libX11
+ x11-libs/libXtst
+ )
+ xinerama? ( x11-libs/libXinerama )
+"
+
+DEPEND="${COMMON_DEPEND}
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ virtual/linux-sources
+ sys-apps/findutils
+"
+
+RDEPEND="${COMMON_DEPEND}
+ modules? ( app-emulation/open-vm-tools-kmod )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup vmware
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/9.10.0-vgauth.patch"
+ epatch_user
+}
+
+src_configure() {
+ # http://bugs.gentoo.org/402279
+ export CUSTOM_PROCPS_NAME=procps
+ export CUSTOM_PROCPS_LIBS="$($(tc-getPKG_CONFIG) --libs libprocps)"
+
+ local myeconfargs=(
+ --disable-deploypkg
+ --disable-tests
+ # Broken build
+ --docdir=/usr/share/doc/${PF}
+ --with-procps
+ --with-dnet
+ --without-kernel-modules
+ $(use_enable doc docs)
+ $(use_enable grabbitmqproxy)
+ $(use_enable vgauth)
+ $(use_enable xinerama multimon)
+ $(use_with icu)
+ $(use_with pam)
+ $(use_with pic)
+ $(use_with X gtk2)
+ $(use_with X gtkmm)
+ $(use_with X x)
+ )
+
+ econf "${myeconfargs[@]}"
+
+ # Bugs 260878, 326761
+ find . -name Makefile | xargs sed -i -e 's/-Werror//g' || die "sed out Werror failed"
+}
+
+src_install() {
+ default
+
+ rm "${D}"/etc/pam.d/vmtoolsd
+ pamd_mimic_system vmtoolsd auth account
+
+ rm "${D}"/usr/$(get_libdir)/*.la
+ rm "${D}"/usr/$(get_libdir)/open-vm-tools/plugins/common/*.la
+
+ newinitd "${FILESDIR}/open-vm-tools.initd" vmware-tools
+ newconfd "${FILESDIR}/open-vm-tools.confd" vmware-tools
+ systemd_dounit "${FILESDIR}"/vmtoolsd.service
+
+ exeinto /etc/vmware-tools/scripts/vmware
+ doexe "${FILESDIR}"/network
+
+ if use X; then
+ fperms 4755 "/usr/bin/vmware-user-suid-wrapper"
+
+ dobin "${S}"/scripts/common/vmware-xdg-detect-de
+
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}/open-vm-tools.desktop"
+
+ elog "To be able to use the drag'n'drop feature of VMware for file"
+ elog "exchange, please add the users to the 'vmware' group."
+ fi
+ elog "Add 'vmware-tools' service to the default runlevel."
+}
diff --git a/app-emulation/open-vm-tools/open-vm-tools-9.10.2_p2822639.ebuild b/app-emulation/open-vm-tools/open-vm-tools-9.10.2_p2822639.ebuild
new file mode 100644
index 000000000000..3c2064794121
--- /dev/null
+++ b/app-emulation/open-vm-tools/open-vm-tools-9.10.2_p2822639.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib pam user versionator flag-o-matic systemd toolchain-funcs
+
+MY_P="${PN}-${PV/_p/-}"
+
+DESCRIPTION="Opensourced tools for VMware guests"
+HOMEPAGE="https://github.com/vmware/open-vm-tools"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X doc grabbitmqproxy icu pam +pic vgauth xinerama"
+
+RDEPEND="
+ dev-libs/glib:2
+ dev-libs/libdnet
+ sys-apps/ethtool
+ sys-fs/fuse
+ >=sys-process/procps-3.3.2
+ grabbitmqproxy? ( dev-libs/openssl:0 )
+ icu? ( dev-libs/icu:= )
+ pam? ( virtual/pam )
+ vgauth? (
+ dev-libs/openssl:0
+ dev-libs/xerces-c
+ dev-libs/xml-security-c
+ )
+ X? (
+ dev-cpp/gtkmm:2.4
+ x11-base/xorg-server
+ x11-drivers/xf86-input-vmmouse
+ x11-drivers/xf86-video-vmware
+ x11-libs/gtk+:2
+ x11-libs/libnotify
+ x11-libs/libX11
+ x11-libs/libXtst
+ )
+ xinerama? ( x11-libs/libXinerama )
+"
+
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ sys-apps/findutils
+"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup vmware
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/9.10.0-vgauth.patch"
+ chmod +x configure || die
+ epatch_user
+}
+
+src_configure() {
+ # http://bugs.gentoo.org/402279
+ export CUSTOM_PROCPS_NAME=procps
+ export CUSTOM_PROCPS_LIBS="$($(tc-getPKG_CONFIG) --libs libprocps)"
+
+ local myeconfargs=(
+ --disable-deploypkg
+ --disable-tests
+ # Broken build
+ --docdir=/usr/share/doc/${PF}
+ --with-procps
+ --with-dnet
+ --without-kernel-modules
+ $(use_enable doc docs)
+ $(use_enable grabbitmqproxy)
+ $(use_enable vgauth)
+ $(use_enable xinerama multimon)
+ $(use_with icu)
+ $(use_with pam)
+ $(use_with pic)
+ $(use_with X gtk2)
+ $(use_with X gtkmm)
+ $(use_with X x)
+ )
+
+ econf "${myeconfargs[@]}"
+
+ # Bugs 260878, 326761
+ find . -name Makefile | xargs sed -i -e 's/-Werror//g' || die "sed out Werror failed"
+}
+
+src_install() {
+ default
+
+ rm "${D}"/etc/pam.d/vmtoolsd
+ pamd_mimic_system vmtoolsd auth account
+
+ rm "${D}"/usr/$(get_libdir)/*.la
+ rm "${D}"/usr/$(get_libdir)/open-vm-tools/plugins/common/*.la
+
+ newinitd "${FILESDIR}/open-vm-tools.initd" vmware-tools
+ newconfd "${FILESDIR}/open-vm-tools.confd" vmware-tools
+ systemd_dounit "${FILESDIR}"/vmtoolsd.service
+
+ exeinto /etc/vmware-tools/scripts/vmware
+ doexe "${FILESDIR}"/network
+
+ if use X; then
+ fperms 4755 "/usr/bin/vmware-user-suid-wrapper"
+
+ dobin "${S}"/scripts/common/vmware-xdg-detect-de
+
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}/open-vm-tools.desktop"
+
+ elog "To be able to use the drag'n'drop feature of VMware for file"
+ elog "exchange, please add the users to the 'vmware' group."
+ fi
+}
diff --git a/app-emulation/open-vm-tools/open-vm-tools-9.4.0.1280544.ebuild b/app-emulation/open-vm-tools/open-vm-tools-9.4.0.1280544.ebuild
new file mode 100644
index 000000000000..105c842bf803
--- /dev/null
+++ b/app-emulation/open-vm-tools/open-vm-tools-9.4.0.1280544.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib pam user versionator flag-o-matic systemd toolchain-funcs
+
+MY_PV="$(replace_version_separator 3 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Opensourced tools for VMware guests"
+HOMEPAGE="https://github.com/vmware/open-vm-tools"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X doc fuse icu +pic xinerama"
+
+RDEPEND="app-emulation/open-vm-tools-kmod
+ dev-libs/glib:2
+ dev-libs/libdnet
+ sys-apps/ethtool
+ sys-process/procps
+ virtual/pam
+ X? (
+ dev-cpp/gtkmm:2.4
+ x11-base/xorg-server
+ x11-drivers/xf86-input-vmmouse
+ x11-drivers/xf86-video-vmware
+ x11-libs/gtk+:2
+ x11-libs/libnotify
+ x11-libs/libX11
+ x11-libs/libXtst
+ )
+ fuse? ( sys-fs/fuse )
+ icu? ( dev-libs/icu:= )
+ xinerama? ( x11-libs/libXinerama )
+ "
+
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ virtual/linux-sources
+ sys-apps/findutils
+ "
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup vmware
+}
+
+src_prepare() {
+ # Do not filter out Werror
+ # Upstream Bug http://sourceforge.net/tracker/?func=detail&aid=2959749&group_id=204462&atid=989708
+ # sed -i -e 's/CFLAGS=.*Werror/#&/g' configure || die "sed comment out Werror failed"
+ sed -i -e 's:\(TEST_PLUGIN_INSTALLDIR=\).*:\1\$libdir/open-vm-tools/plugins/tests:g' configure || die "sed test_plugin_installdir failed"
+}
+
+src_configure() {
+ # http://bugs.gentoo.org/402279
+ if has_version '>=sys-process/procps-3.3.2'; then
+ export CUSTOM_PROCPS_NAME=procps
+ export CUSTOM_PROCPS_LIBS="$($(tc-getPKG_CONFIG) --libs libprocps)"
+ fi
+
+ econf \
+ --with-procps \
+ --with-dnet \
+ --without-kernel-modules \
+ $(use_enable doc docs) \
+ --docdir=/usr/share/doc/${PF} \
+ $(use_with X x) \
+ $(use_with X gtk2) \
+ $(use_with X gtkmm) \
+ $(use_with icu) \
+ $(use_with pic) \
+ $(use_enable xinerama multimon)
+
+ # Bugs 260878, 326761
+ find ./ -name Makefile | xargs sed -i -e 's/-Werror//g' || die "sed out Werror failed"
+}
+
+src_install() {
+ default
+
+ rm "${D}"/etc/pam.d/vmtoolsd
+ pamd_mimic_system vmtoolsd auth account
+
+ rm "${D}"/usr/$(get_libdir)/*.la
+ rm "${D}"/usr/$(get_libdir)/open-vm-tools/plugins/common/*.la
+
+ newinitd "${FILESDIR}/open-vm-tools.initd" vmware-tools
+ newconfd "${FILESDIR}/open-vm-tools.confd" vmware-tools
+ systemd_dounit "${FILESDIR}"/vmtoolsd.service
+
+ exeinto /etc/vmware-tools/scripts/vmware/
+ doexe "${FILESDIR}"/network
+
+ if use X;
+ then
+ fperms 4755 "/usr/bin/vmware-user-suid-wrapper"
+
+ dobin "${S}"/scripts/common/vmware-xdg-detect-de
+
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}/open-vm-tools.desktop"
+
+ elog "To be able to use the drag'n'drop feature of VMware for file"
+ elog "exchange, please add the users to the 'vmware' group."
+ fi
+ elog "Add 'vmware-tools' service to the default runlevel."
+}
diff --git a/app-emulation/openstack-guest-agents-unix/Manifest b/app-emulation/openstack-guest-agents-unix/Manifest
new file mode 100644
index 000000000000..022a7c87a12b
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/Manifest
@@ -0,0 +1,2 @@
+DIST openstack-guest-agents-unix-1.39.0.tar.gz 75013 SHA256 eaa22564c8da46c2c1c08e6c0ccd2507e181ffac66fa89f1d9ac2323a2a77d97 SHA512 4f7c4c1f2bc2c8ebda25dc8c0fa79c39e8e5a83040ff103f8c583d9142e71c6527d23e430da983e3a8c9add508298c31ec13a7e56d1db3b5338736dd470fec80 WHIRLPOOL 8e91593dcf6e1f0a8281a9a19946aa67c6e57acfcd5dd5739cddc9b0db0ea0952552f592f598a156140f5c8834fd47f9e20fddddec0f7648bcc40ebce0127d63
+DIST openstack-guest-agents-unix-1.39.1.tar.gz 75458 SHA256 dab0bafb2a632040b0e76ac277fee5714dc8eb9cb9781e80f64a94aaa6bd06a2 SHA512 b1e88bb3492018375e7b2275829e2698d82d75c975a396ab7409c9b88f7787145b0da87c81a089aa8914fae30e996654b589bc1675bba769b661d7d1deb9590d WHIRLPOOL 5ba6cf326b78ea5141611b59d9d2b21b9c6a54f4ed9b358a6751ac135a77eac0c20a0b8ce7e078557158bc6a0192e13fed44c75bb9e7794eded1f4777b24b072
diff --git a/app-emulation/openstack-guest-agents-unix/files/0513f013625b6a652d7dcb663eb396b9b5bb924e.patch b/app-emulation/openstack-guest-agents-unix/files/0513f013625b6a652d7dcb663eb396b9b5bb924e.patch
new file mode 100644
index 000000000000..bf95287a86f9
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/files/0513f013625b6a652d7dcb663eb396b9b5bb924e.patch
@@ -0,0 +1,60 @@
+From 84e1a32ee2b8d0607f2868365aa46aaea58f014c Mon Sep 17 00:00:00 2001
+From: Nate House <nathan.house@rackspace.com>
+Date: Mon, 20 Oct 2014 18:50:52 -0500
+Subject: [PATCH] Updated regexp to work with config headers added sometime ago
+
+---
+ tests/test_resetnetwork_interfaces.py | 26 +++++++++++---------------
+ 1 file changed, 11 insertions(+), 15 deletions(-)
+
+diff --git a/tests/test_resetnetwork_interfaces.py b/tests/test_resetnetwork_interfaces.py
+index dc8e7e7..b12b84c 100644
+--- a/tests/test_resetnetwork_interfaces.py
++++ b/tests/test_resetnetwork_interfaces.py
+@@ -344,17 +344,13 @@ def test_gentoo_legacy_ipv4(self):
+
+ generated = outfiles['net'].rstrip()
+ # (todo: naterh) Update tests to mock for both ifconfig/iproute2
+- pattern = ('modules=\( "ifconfig|iproute2" \)\n*' +
++ # (todo: naterh) Remove excessive unused kwargs
++ pattern = ('.*?modules="(ifconfig|iproute2)"\n*' +
+ '# Label public\n*' +
+ 'config_eth0=\(\s*"192.0.2.42 netmask 255.255.255.0"\s*\)\n*' +
+ 'routes_eth0=\(\s*"default via 192.0.2.1"\s*\)\n*' +
+- 'dns_servers_eth0=\(\s*"192.0.2.2"\s*\)').format(
+- ip=interface['ipv4'][0][0],
+- netmask=interface['ipv4'][0][1],
+- gateway=interface['gateway4'],
+- dns=interface['dns'][0]
+- )
+- expected_regex = re.compile(pattern, re.MULTILINE)
++ 'dns_servers_eth0=\(\s*"192.0.2.2"\s*\)')
++ expected_regex = re.compile(pattern, re.DOTALL)
+
+ self.assertRegexpMatches(generated, expected_regex)
+
+@@ -373,17 +369,17 @@ def test_gentoo_legacy_ipv6(self):
+
+ # (todo: naterh) Update tests to mock for both ifconfig/iproute2
+ generated = outfiles['net'].rstrip()
+- pattern = ('modules=\( "ifconfig|iproute2" \)\n*' +
++ pattern = ('.*?modules="(ifconfig|iproute2)"\n*' +
+ '# Label public\n*' +
+ 'config_eth0=\(\s*"{ip}/{netmask_len}"\s*\)\n*' +
+ 'routes_eth0=\(\s*"default via {gateway}"\s*\)\n*' +
+ 'dns_servers_eth0=\(\s*"{dns}"\s*\)').format(
+- ip=interface['ipv6'][0][0],
+- netmask_len=interface['ipv6'][0][1],
+- gateway=interface['gateway6'],
+- dns=interface['dns'][0]
+- )
+- expected_regex = re.compile(pattern, re.MULTILINE)
++ ip=interface['ipv6'][0][0],
++ netmask_len=interface['ipv6'][0][1],
++ gateway=interface['gateway6'],
++ dns=interface['dns'][0]
++ )
++ expected_regex = re.compile(pattern, re.DOTALL)
+
+ self.assertRegexpMatches(generated, expected_regex)
+
diff --git a/app-emulation/openstack-guest-agents-unix/files/4453b4773688eef6c60736d9cf07100716308a5e.patch b/app-emulation/openstack-guest-agents-unix/files/4453b4773688eef6c60736d9cf07100716308a5e.patch
new file mode 100644
index 000000000000..ea506845ed36
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/files/4453b4773688eef6c60736d9cf07100716308a5e.patch
@@ -0,0 +1,57 @@
+From 4453b4773688eef6c60736d9cf07100716308a5e Mon Sep 17 00:00:00 2001
+From: Nate House <nathan.house@rackspace.com>
+Date: Sun, 19 Oct 2014 15:49:35 -0500
+Subject: [PATCH] Updated tests to check for either ifconfig/iproute2
+
+---
+ tests/test_resetnetwork_interfaces.py | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_resetnetwork_interfaces.py b/tests/test_resetnetwork_interfaces.py
+index f2b73bf..dc8e7e7 100644
+--- a/tests/test_resetnetwork_interfaces.py
++++ b/tests/test_resetnetwork_interfaces.py
+@@ -343,8 +343,8 @@ def test_gentoo_legacy_ipv4(self):
+ self.assertTrue('net' in outfiles)
+
+ generated = outfiles['net'].rstrip()
+-
+- pattern = ('modules=\( "ifconfig" \)\n*' +
++ # (todo: naterh) Update tests to mock for both ifconfig/iproute2
++ pattern = ('modules=\( "ifconfig|iproute2" \)\n*' +
+ '# Label public\n*' +
+ 'config_eth0=\(\s*"192.0.2.42 netmask 255.255.255.0"\s*\)\n*' +
+ 'routes_eth0=\(\s*"default via 192.0.2.1"\s*\)\n*' +
+@@ -371,8 +371,9 @@ def test_gentoo_legacy_ipv6(self):
+
+ self.assertTrue('net' in outfiles)
+
++ # (todo: naterh) Update tests to mock for both ifconfig/iproute2
+ generated = outfiles['net'].rstrip()
+- pattern = ('modules=\( "ifconfig" \)\n*' +
++ pattern = ('modules=\( "ifconfig|iproute2" \)\n*' +
+ '# Label public\n*' +
+ 'config_eth0=\(\s*"{ip}/{netmask_len}"\s*\)\n*' +
+ 'routes_eth0=\(\s*"default via {gateway}"\s*\)\n*' +
+@@ -399,8 +400,9 @@ def test_gentoo_openrc_ipv4(self):
+
+ self.assertTrue('net' in outfiles)
+
++ # (todo: naterh) Update tests to mock for both ifconfig/iproute2
+ generated = outfiles['net'].rstrip()
+- pattern = ('modules="ifconfig"\n*' +
++ pattern = ('modules="ifconfig|iproute2"\n*' +
+ '# Label public\n*' +
+ 'config_eth0="\s*{ip}/{netmask_len}\s*"\n*' +
+ 'routes_eth0="\s*default via {gateway}\s*"\n*' +
+@@ -429,8 +431,9 @@ def test_gentoo_openrc_ipv6(self):
+
+ self.assertTrue('net' in outfiles)
+
++ # (todo: naterh) Update tests to mock for both ifconfig/iproute2
+ generated = outfiles['net'].rstrip()
+- pattern = ('modules="ifconfig"\n*' +
++ pattern = ('modules="ifconfig|iproute2"\n*' +
+ '# Label public\n*' +
+ 'config_eth0="\s*{ip}/{netmask_len}\s*"\n*' +
+ 'routes_eth0="\s*default via {gateway}\s*"\n*' +
diff --git a/app-emulation/openstack-guest-agents-unix/files/openstack-guest-agents-unix-1.39.0-python2.patch b/app-emulation/openstack-guest-agents-unix/files/openstack-guest-agents-unix-1.39.0-python2.patch
new file mode 100644
index 000000000000..0010e9ea5eae
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/files/openstack-guest-agents-unix-1.39.0-python2.patch
@@ -0,0 +1,15 @@
+diff -Nuar openstack-guest-agents-unix-1.39.0.orig/scripts/gentoo/nova-agent.in openstack-guest-agents-unix-1.39.0/scripts/gentoo/nova-agent.in
+--- openstack-guest-agents-unix-1.39.0.orig/scripts/gentoo/nova-agent.in 2013-12-31 02:02:57.000000000 -0800
++++ openstack-guest-agents-unix-1.39.0/scripts/gentoo/nova-agent.in 2014-06-21 17:20:01.527148493 -0700
+@@ -35,8 +35,9 @@
+ NOVA_PYTHONPATH="${reallibdir}/${NOVA_PYTHONPATH}"
+ NOVA_PYTHONPATH="${NOVA_PYTHONPATH}:${NOVA_PYTHONPATH}/site-packages"
+
+-if [ `which python > /dev/null 2>&1 ; echo $?` -eq 0 ]; then
+- PYTHONPATH="$(python -c 'import sys; print ":".join(sys.path)')"
++PYTHON=python2
++if [ `which $PYTHON > /dev/null 2>&1 ; echo $?` -eq 0 ]; then
++ PYTHONPATH="$($PYTHON -c 'import sys; print ":".join(sys.path)')"
+ fi
+ export PYTHONPATH="$NOVA_PYTHONPATH:$PYTHONPATH"
+ export PYTHONHOME="$NOVA_PYTHONPATH:$PYTHONPATH"
diff --git a/app-emulation/openstack-guest-agents-unix/files/patches-1.39.0-20140621.patch b/app-emulation/openstack-guest-agents-unix/files/patches-1.39.0-20140621.patch
new file mode 100644
index 000000000000..c275982fa94b
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/files/patches-1.39.0-20140621.patch
@@ -0,0 +1,323 @@
+commit fc8c9fe076e321ff98cc6717abbb21ee57808c52
+Merge: eaaae09 1ecec49
+Author: teran-mckinney <teran.mckinney@rackspace.com>
+Date: Wed Apr 30 15:33:43 2014 +0000
+
+ Merge pull request #43 from gtmanfred/master
+
+ sbindir changes to exec_prefix
+
+commit eaaae09c27a33998374a8d63702c75b04ab3e5c2
+Merge: 773e431 1505a5a
+Author: teran-mckinney <teran.mckinney@rackspace.com>
+Date: Tue Apr 29 18:21:27 2014 +0000
+
+ Merge pull request #45 from leader716/master
+
+ Added addditional logic to deterine if the hardware address for and inte...
+
+commit 1505a5a8e180910c3307bf04ccfc4eed09c0f40a
+Author: John Ward <john.ward@rackspace.com>
+Date: Tue Apr 29 14:28:34 2014 +0000
+
+ Added addditional logic to deterine if the hardware address for and interface is 0x0 if so go to the next interface.
+ I put this into place to handle tun adapters that have a hardware address of 0x0 which was causing the agent to
+ segfault when it encounterd this type of adapter.
+
+commit 1ecec499d5bea73980a8aec992b394339acc83c7
+Author: Daniel Wallace <danielwallace@gtmanfred.com>
+Date: Fri Apr 25 20:38:35 2014 -0500
+
+ sbindir changes to exec_prefix
+
+ Systemd requires a full path for the start of the command, and there
+ isn't one that isn't a nice way to change this.
+
+commit 773e431997a6612cbda9f11ec9d57f5685a29eea
+Merge: 1ca2056 12c0294
+Author: teran-mckinney <teran.mckinney@rackspace.com>
+Date: Fri Apr 25 18:41:56 2014 +0000
+
+ Merge pull request #39 from Camisa/master
+
+ nova-agent should replace the Slice or Image ID rather than append
+
+commit 1ca2056a455f8075ed951f0a82b92820c0b33b54
+Merge: 1b05c75 f9a365e
+Author: teran-mckinney <teran.mckinney@rackspace.com>
+Date: Fri Apr 25 18:40:29 2014 +0000
+
+ Merge pull request #42 from gtmanfred/master
+
+ Do not add static routes that are the default route, if a default gateway already exists.
+
+ Courtesy of gtmanfred. Thank you!
+
+commit f9a365e7a9543d407ca9d75164688faa0ff53528
+Author: Daniel Wallace <danielwallace@gtmanfred.com>
+Date: Fri Apr 25 10:54:29 2014 -0500
+
+ remove extra and from debian network.py
+
+commit 387d4e77695598a07be9e4593c5b236b81a1aeea
+Author: Daniel Wallace <danielwallace@gtmanfred.com>
+Date: Fri Apr 25 09:31:15 2014 -0500
+
+ Do not add static routes that are the default route
+
+commit 1b05c75530c8b4cbf5347e84815e275ee0bbacd4
+Author: teran-mckinney <teran.mckinney@rackspace.com>
+Date: Thu Feb 13 19:26:36 2014 +0000
+
+ Fix nova-agent not starting on some systems
+
+ data/host existing could cause a fault on xs_handle.mkdir(self.request_path) if request_path (data/host) already existed. Wrap it in a try/except clause to ignore the fault as if the directory already exists, there's no reason to throw an exception while trying to create it.
+
+ Workaround without this patch is to xenstore-rm data/host from affected VMs, or to do it from dom0 with the full path.
+
+commit 12c02941ef02dc6645e6d4700e8a028decbf0c19
+Author: Christopher J. Camisa <cjc@operator.host>
+Date: Thu Jan 30 03:11:51 2014 -0600
+
+ nova-agent should replace the Slice or Image ID rather than append
+
+commit ce388bf600136736fdb790edef58a57aad8adfc1
+Author: AbhishekKr <abhikumar163@gmail.com>
+Date: Tue Jan 21 17:22:23 2014 +0530
+
+ shebang fixed for installer.sh and bintar script; gitignore updated
+
+commit 91fe7d0262fe8ad685a287df291b504250b1184c
+Author: AbhishekKr <abhikumar163@gmail.com>
+Date: Fri Jan 3 16:51:54 2014 +0530
+
+ FreeBSD changed ports, so bintar creation script need to
+diff --git a/.gitignore b/.gitignore
+index ae1ae1b..6bdeda8 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -55,3 +55,4 @@ unix/scripts/generic/nova-agent
+ unix/scripts/gentoo/nova-agent
+ unix/scripts/freebsd/nova-agent
+ .idea/*
++**/.venv
+diff --git a/commands/arch/network.py b/commands/arch/network.py
+index 1d698ca..2bc0aff 100644
+--- a/commands/arch/network.py
++++ b/commands/arch/network.py
+@@ -373,6 +373,11 @@ def _update_rc_conf_legacy(infile, interfaces):
+ ifaces.append((ifname.replace(':', '_'), ' '.join(line)))
+
+ for i, route in enumerate(interface['routes']):
++ if route['network'] == '0.0.0.0' and \
++ route['netmask'] == '0.0.0.0' and \
++ route['gateway'] == gateway4:
++ continue
++
+ line = "-net %(network)s netmask %(netmask)s gw %(gateway)s" % \
+ route
+
+@@ -499,7 +504,10 @@ def _get_file_data_netctl(ifname, interface):
+ print >>outfile, 'Gateway6=%s' % gateway6
+
+ routes = ['%(network)s/%(netmask)s via %(gateway)s' % route
+- for route in interface['routes']]
++ for route in interface['routes'] if not
++ route['network'] == '0.0.0.0' and not
++ route['netmask'] == '0.0.0.0' and not
++ route['gateway'] == gateway4]
+
+ if routes:
+ print >>outfile, 'Routes=(\'%s\')' % '\' \''.join(routes)
+@@ -552,7 +560,10 @@ def _get_file_data_netcfg(ifname, interface):
+ print >>outfile, 'GATEWAY6="%s"' % gateway6
+
+ routes = ['"%(network)s/%(netmask)s via %(gateway)s"' % route
+- for route in interface['routes']]
++ for route in interface['routes'] if not
++ route['network'] == '0.0.0.0' and not
++ route['netmask'] == '0.0.0.0' and not
++ route['gateway'] == gateway4]
+
+ if routes:
+ print >>outfile, 'ROUTES=(%s)' % ' '.join(routes)
+diff --git a/commands/debian/network.py b/commands/debian/network.py
+index d91d602..3b82d97 100644
+--- a/commands/debian/network.py
++++ b/commands/debian/network.py
+@@ -234,6 +234,11 @@ def _get_file_data(interfaces):
+ ifname_suffix_num += 1
+
+ for route in interface['routes']:
++ if route['network'] == '0.0.0.0' \
++ and route['netmask'] == '0.0.0.0'\
++ and 'gateway4' in interface \
++ and route['gateway'] == interface['gateway4']:
++ continue
+ file_data += " post-up route add -net %(network)s " \
+ "netmask %(netmask)s gw %(gateway)s || true\n" % route
+ file_data += " pre-down route del -net %(network)s " \
+diff --git a/commands/freebsd/network.py b/commands/freebsd/network.py
+index 2d5d7f1..87e5e9e 100644
+--- a/commands/freebsd/network.py
++++ b/commands/freebsd/network.py
+@@ -211,6 +211,10 @@ def _create_rcconf_file(infile, interfaces, hostname):
+ ifname_suffix_num += 1
+
+ for route in interface['routes']:
++ if route['network'] == '0.0.0.0' and \
++ route['netmask'] == '0.0.0.0' and \
++ route['gateway'] == gateway4:
++ continue
+ if ':' in route['network']:
+ # ipv6
+ fmt = '-net %(network)s/%(netmask)s %(gateway)s'
+diff --git a/commands/gentoo/network.py b/commands/gentoo/network.py
+index f3ceff5..f3e5251 100644
+--- a/commands/gentoo/network.py
++++ b/commands/gentoo/network.py
+@@ -199,7 +199,11 @@ def _confd_net_file(interfaces):
+ lines.extend([ " {0}/{1} via {2}".format(route['network'],
+ commands.network.NETMASK_TO_PREFIXLEN[route['netmask']],
+ route['gateway']
+- ) for route in interface['routes'] ])
++ ) for route in interface['routes'] if not
++ route['network'] == '0.0.0.0' and not
++ route['netmask'] == '0.0.0.0' and
++ 'gateway4' in interface and not
++ route['gateway'] == interface['gateway4']])
+ if 'gateway4' in interface and interface['gateway4']:
+ lines.append(" default via {0}".format(interface['gateway4']))
+ if 'gateway6' in interface and interface['gateway6']:
+@@ -247,7 +251,11 @@ def _confd_net_file_legacy(interfaces):
+ lines.append("routes_{0}=(".format(name))
+ lines.extend([ " \"{0} netmask {1} gw {2}\"".format(
+ route['network'], route['netmask'], route['gateway']
+- ) for route in interface['routes'] ])
++ ) for route in interface['routes'] if not
++ route['network'] == '0.0.0.0' and not
++ route['netmask'] == '0.0.0.0' and
++ 'gateway4' in interface and not
++ route['gateway'] == interface['gateway4'] ])
+ if 'gateway4' in interface and interface['gateway4']:
+ lines.append(" \"default via {0}\"".format(interface['gateway4']))
+ if 'gateway6' in interface and interface['gateway6']:
+diff --git a/commands/redhat/network.py b/commands/redhat/network.py
+index a85ed6b..e853fbd 100644
+--- a/commands/redhat/network.py
++++ b/commands/redhat/network.py
+@@ -202,6 +202,11 @@ def _get_file_data(ifname_prefix, interface):
+
+ route_data = ''
+ for i, route in enumerate(interface['routes']):
++ if route['network'] == '0.0.0.0' and \
++ route['netmask'] == '0.0.0.0' and \
++ 'gateway4' in interface and \
++ route['gateway'] == interface['gateway4']:
++ continue
+ route_data += "ADDRESS%d=%s\n" % (i, route['network'])
+ route_data += "NETMASK%d=%s\n" % (i, route['netmask'])
+ route_data += "GATEWAY%d=%s\n" % (i, route['gateway'])
+diff --git a/commands/suse/network.py b/commands/suse/network.py
+index 2947974..baad7b2 100644
+--- a/commands/suse/network.py
++++ b/commands/suse/network.py
+@@ -191,6 +191,10 @@ def _get_file_data(ifname, interface):
+
+ route_data = ''
+ for route in interface['routes']:
++ if route['network'] == '0.0.0.0' and \
++ route['netmask'] == '0.0.0.0' and \
++ route['gateway'] == gateway4:
++ continue
+ network = route['network']
+ netmask = route['netmask']
+ gateway = route['gateway']
+diff --git a/lib/agentlib.c b/lib/agentlib.c
+index ccba6e3..cced430 100644
+--- a/lib/agentlib.c
++++ b/lib/agentlib.c
+@@ -73,7 +73,10 @@ static PyObject *_agentlib_get_interfaces(PyObject *self, PyObject *args)
+ goto next;
+
+ #if defined(__linux__)
+- if (ifa->ifa_addr->sa_family != PF_PACKET)
++ if (ifa->ifa_addr == NULL)
++ goto next;
++
++ if (ifa->ifa_addr->sa_family != PF_PACKET)
+ goto next;
+
+ struct sockaddr_ll *sll = (struct sockaddr_ll *)ifa->ifa_addr;
+diff --git a/plugins/xscomm.py b/plugins/xscomm.py
+index e3faa2e..9b8a33b 100644
+--- a/plugins/xscomm.py
++++ b/plugins/xscomm.py
+@@ -41,7 +41,11 @@ class XSComm(object):
+ XENSTORE_RESPONSE_PATH)
+
+ self.xs_handle = pyxenstore.Handle()
+- self.xs_handle.mkdir(self.request_path)
++ try:
++ self.xs_handle.mkdir(self.request_path)
++ except:
++ pass
++
+ self.requests = []
+
+ def _check_handle(self):
+diff --git a/scripts/gentoo/nova-agent.in b/scripts/gentoo/nova-agent.in
+index a043394..7f2687e 100755
+--- a/scripts/gentoo/nova-agent.in
++++ b/scripts/gentoo/nova-agent.in
+@@ -59,7 +59,7 @@ start() {
+ /usr/bin/xenstore write data/host/system-init '{"name":"resetnetwork","value":""}'
+ /usr/bin/xenstore watch -n 1 data/guest/system-init >/dev/null
+ [ "$(/usr/bin/xenstore read data/guest/system-init | wc -l)" -gt "0" ] || eend 1
+- echo "UUID=\"$(/usr/bin/xenstore read name)\"" >> /etc/conf.d/nova-agent
++ echo "UUID=\"$(/usr/bin/xenstore read name)\"" > /etc/conf.d/nova-agent
+ fi
+
+ eend $RET
+diff --git a/scripts/installer.sh.in b/scripts/installer.sh.in
+index 8ef793d..3fbf352 100755
+--- a/scripts/installer.sh.in
++++ b/scripts/installer.sh.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ # vim: tabstop=4 shiftwidth=4 softtabstop=4
+ #
+diff --git a/scripts/systemd/nova-agent.service.in b/scripts/systemd/nova-agent.service.in
+index 9d8a4a7..b73ebbe 100644
+--- a/scripts/systemd/nova-agent.service.in
++++ b/scripts/systemd/nova-agent.service.in
+@@ -4,7 +4,7 @@ Description=nova-agent service
+ [Service]
+ Environment=LD_LIBRARY_PATH=@prefix@/share/@PACKAGE@/@PACKAGE_VERSION@/lib
+ EnvironmentFile=-/etc/nova-agent.env
+-ExecStart=@sbindir@/nova-agent -n -l info @prefix@/share/@PACKAGE@/nova-agent.py
++ExecStart=@prefix@/sbin/nova-agent -n -l info @prefix@/share/@PACKAGE@/nova-agent.py
+
+
+ [Install]
+diff --git a/tools/nova-agent-builder.sh b/tools/nova-agent-builder.sh
+index 1823639..fcaa7c7 100755
+--- a/tools/nova-agent-builder.sh
++++ b/tools/nova-agent-builder.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ ##### NOVA AGENT BUILDER
+ ##### how_to:$ sh nova-agent-builder.sh help
+ ##### W.I.P. works fine for most of cases,
+@@ -202,7 +202,7 @@ install_pre_requisite_freebsd(){
+ export INSTALL_D=""
+ uname -a
+
+- pkg_add -r git autogen automake wget bash
++ pkg_add -r git autogen automake wget bash libtool
+ pkg_add -r py27-unittest2 py27-cryptkit py27-pycrypto py27-mox
+
+ # re-install xen-tool :: required for pyxenstore install
diff --git a/app-emulation/openstack-guest-agents-unix/metadata.xml b/app-emulation/openstack-guest-agents-unix/metadata.xml
new file mode 100644
index 000000000000..1edaa77a2471
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>alunduil@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">rackerlabs/openstack-guest-agents-unix</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0-r1.ebuild b/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0-r1.ebuild
new file mode 100644
index 000000000000..8bb3d55c6206
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 ) # does not work with py3 yet
+
+inherit autotools eutils vcs-snapshot python-single-r1
+
+DESCRIPTION="Openstack Unix Guest Agent"
+HOMEPAGE="http://github.com/rackerlabs/openstack-guest-agents-unix"
+SRC_URI="https://github.com/rackerlabs/${PN}/tarball/v${PV} -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="dev-util/patchelf
+ dev-python/pycrypto[${PYTHON_USEDEP}]
+ dev-python/pyxenstore[${PYTHON_USEDEP}]"
+
+# Fails to build if python2.5/python2.6 are present
+DEPEND="${RDEPEND}
+ !dev-lang/python:2.5
+ !dev-lang/python:2.6
+ ${PYTHON_DEPS}"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/patches-1.39.0-20140621.patch \
+ "${FILESDIR}"/openstack-guest-agents-unix-1.39.0-python2.patch
+ eautoreconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ doinitd scripts/gentoo/nova-agent
+}
diff --git a/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0-r2.ebuild b/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0-r2.ebuild
new file mode 100644
index 000000000000..25ca053ffc08
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0-r2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 ) # does not work with py3 yet
+
+inherit autotools eutils vcs-snapshot python-single-r1
+
+DESCRIPTION="Openstack Unix Guest Agent"
+HOMEPAGE="http://github.com/rackerlabs/openstack-guest-agents-unix"
+SRC_URI="https://github.com/rackerlabs/${PN}/tarball/v${PV} -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="dev-util/patchelf
+ dev-python/pycrypto[${PYTHON_USEDEP}]
+ dev-python/pyxenstore[${PYTHON_USEDEP}]"
+
+# Fails to build if python2.5/python2.6 are present
+DEPEND="${RDEPEND}
+ !dev-lang/python:2.5
+ !dev-lang/python:2.6
+ ${PYTHON_DEPS}"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/patches-1.39.0-20140621.patch \
+ "${FILESDIR}"/openstack-guest-agents-unix-1.39.0-python2.patch
+ # Ignore the deps of install-exec-local
+ sed -i -e '/^install-exec-local:/s,:.*,:,g' Makefile.am
+ # bashism fix
+ sed -r -i -e '/^export ([A-Z_]+)/{ s,^export ,,g; s,^([A-Z0-9_]+)(.*),\1\2; export \1,g; }' scripts/gentoo/nova-agent.in
+
+ eautoreconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ doinitd scripts/gentoo/nova-agent
+}
diff --git a/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0.ebuild b/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0.ebuild
new file mode 100644
index 000000000000..3697adf98b3f
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.0.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils vcs-snapshot
+
+DESCRIPTION="Openstack Unix Guest Agent"
+HOMEPAGE="http://github.com/rackerlabs/openstack-guest-agents-unix"
+SRC_URI="https://github.com/rackerlabs/${PN}/tarball/v${PV} -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="
+ dev-util/patchelf
+ dev-python/pycrypto
+ dev-python/pyxenstore
+ "
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ doinitd scripts/gentoo/nova-agent
+}
diff --git a/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.1.ebuild b/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.1.ebuild
new file mode 100644
index 000000000000..1a6fc7588765
--- /dev/null
+++ b/app-emulation/openstack-guest-agents-unix/openstack-guest-agents-unix-1.39.1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils python-single-r1 vcs-snapshot
+
+DESCRIPTION="Openstack Unix Guest Agent"
+HOMEPAGE="http://github.com/rackerlabs/openstack-guest-agents-unix"
+SRC_URI="https://github.com/rackerlabs/${PN}/tarball/${PV} -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+
+CDEPEND="
+ dev-python/pycrypto[${PYTHON_USEDEP}]
+ dev-python/pyxenstore[${PYTHON_USEDEP}]
+ dev-util/patchelf
+ ${PYTHON_DEPS}
+"
+DEPEND="
+ ${CDEPEND}
+ test? (
+ dev-python/mox[${PYTHON_USEDEP}]
+ dev-python/unittest2[${PYTHON_USEDEP}]
+ )
+"
+RDEPEND="${CDEPEND}"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/4453b4773688eef6c60736d9cf07100716308a5e.patch \
+ "${FILESDIR}"/0513f013625b6a652d7dcb663eb396b9b5bb924e.patch
+
+ # Note: https://github.com/rackerlabs/openstack-guest-agents-unix/issues/52
+ ebegin 'patching tests/test_injectfile.py'
+ sed \
+ -e '97,127 d' \
+ -i tests/test_injectfile.py
+ STATUS=$?
+ eend ${STATUS}
+ [[ ${STATUS} -gt 0 ]] && die
+
+ eautoreconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ doinitd scripts/gentoo/nova-agent
+}
+
+pkg_postinst() {
+ elog "If you would like to utilize openstack-guest-agents-unix, add 'nova-agent' to"
+ elog "your 'default' runlevel:"
+ elog " rc-update add nova-agent default"
+}
diff --git a/app-emulation/phpvirtualbox/Manifest b/app-emulation/phpvirtualbox/Manifest
new file mode 100644
index 000000000000..4085d43205b8
--- /dev/null
+++ b/app-emulation/phpvirtualbox/Manifest
@@ -0,0 +1,6 @@
+DIST phpvirtualbox-4.1-11.zip 2763347 SHA256 91a78c7dead035edf8138a363c6b3cb89d8f348fa3c38455af232f51bcf592ef SHA512 c5eb1b9fd0bba20e3dda9cbe6985c60d953a340d77b9427f344e8b595a06a5d9805209cf73704fb93de5ee2f412e02cb1434ed0e983b0622cf8a8172d7dff9a5 WHIRLPOOL ca95767f63f3c018738de36dede1859e0b6185cd22d4f7a40128dd5a14791ca9402a2ef54c4928c1a4c4408ddcb62b312a4d05743c0722f9a8fee1555df4021a
+DIST phpvirtualbox-4.1-7.zip 2760199 SHA256 16c27cd1bcc843b464752c3dd7091247b690218bca06fcecbdd130c5daf70b7c SHA512 657d5c5424d540ef3da9db54e638d227b68fcc336ec097f8a319a689990a53ad9f17af6fd0cd4be699212e83f06468bb65c4da03faf0a65ff77386f23aaf9409 WHIRLPOOL f2327749d6333bc07dce1f28f42e297f8e24777b556967513218d429e78db1fdd00112cca5ddd91d94012a8b0c5ab7c475c7209b3f12e2bad95085ce112f6f3d
+DIST phpvirtualbox-4.2-3b.zip 3184088 SHA256 23134a05d22ac9429524abb9d7165eb4c0ef7c52c917e9ced317e9ff71d0405f SHA512 c0ebf5fb2defd23b5999d7616e47a93696259973b563e2e0cd415db0a9f5be5f3798ac9e6d242c44208ce2c51ba2ab7cf43288ae8108563b45bd119ba2fa8c2f WHIRLPOOL 467385c219fc525151285390fa5a68b273b52be699e97a308f77c74bdeab911a845a7e28343b665ee2d6126aca2f0c3021816adbaa23b0d563ea06d7ec20c62c
+DIST phpvirtualbox-4.2-4.zip 3663173 SHA256 dd2681dc9703ec68a995cac98719863dca9e0720e45f5e0322dbb6fa3858138b SHA512 51e3b90bb5fcedbd45a6e54cf3ea6cc74cd764bdc107f97f9cb24c27f2c5d53a862781b808ab7d53cdbbd9d4cff93734d7578676b409d10326895dd1c5dcdc15 WHIRLPOOL 1678790492df50f7ae63bd4b44dbcd0ddd892c1bef9d455bf47bb20f1dcdac4955645fe71d549095ccc4a19f5960abf0f34fa1d95c4f4c8d82a34848a405fe06
+DIST phpvirtualbox-4.2-7.zip 3425805 SHA256 3dc078d7058d75aa5745f531a6d485a11fff18972df1a638a749f019e0196e4e SHA512 a066f127115a83c6061e8c0ff6447464818511f3ab7805c119f75ddc88459efd144d45fb358ce52959301f2f1a4f2609f7f42c2bb24213a5be98f2036085a81b WHIRLPOOL d6cf095b9768b7a9c0113c8df354dad124a0b2dc0a52e8518dfde230823c95dcad6b6e3df56cc41a4474b8b73cb281f3bfc91f417078e0b6f1136acd70dca4cf
+DIST phpvirtualbox-4.3-0.zip 4231805 SHA256 e33eea5553fb134ba6a1203e33e212bc5764c05b28164dcc02c6d66af565c293 SHA512 fd49a6a4c79d75f37fd40d74743f295a148548373ab046cf1f31ef7b982008ea6b9d2838cdad2dc37a1d266ed630cd2ddb7f7423ea62af1e0f8f9f76a12c0e9d WHIRLPOOL 1c96ec2fe19092dabac9e04be596974cc4dbaa9993c34e76b938036e8e04c67dc4f4f344be8afd636d603a478ce0c85435a75f8d6cf59bbdc3a11c6fd575b6c1
diff --git a/app-emulation/phpvirtualbox/files/vboxinit-initd b/app-emulation/phpvirtualbox/files/vboxinit-initd
new file mode 100644
index 000000000000..34a04d8ea5bd
--- /dev/null
+++ b/app-emulation/phpvirtualbox/files/vboxinit-initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+
+description="Controls VirtualBox sessions"
+
+. /etc/conf.d/vboxwebsrv
+
+su_command="su - ${VBOXWEBSRV_USER} -c"
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+start() {
+ einfo "Starting VirtualBox machines"
+ eindent
+ MACHINES=$($su_command "VBoxManage list vms | awk '{ print \$NF }' | sed -e 's/[{}]//g'")
+ for UUID in $MACHINES; do
+ STARTUP=$($su_command "VBoxManage getextradata $UUID 'pvbx/startupMode'" | awk '{ print $NF }')
+ VMNAME=$($su_command "VBoxManage showvminfo $UUID | sed -n '0,/^Name:/s/^Name:[ \t]*//p'")
+ if [ "${STARTUP}" == "auto" ]; then
+ ebegin "Starting machine ${VMNAME}"
+ $su_command "VBoxManage startvm $UUID --type headless" &>> /var/log/vboxinit.log
+ eend $?
+ fi
+ done
+}
+
+stop() {
+ einfo "Saving VirtualBox machines"
+ eindent
+ MACHINES=$($su_command "VBoxManage list runningvms | awk '{ print \$NF }' | sed -e 's/[{}]//g'")
+ for UUID in $MACHINES; do
+ VMNAME=$($su_command "VBoxManage showvminfo $UUID | sed -n '0,/^Name:/s/^Name:[ \t]*//p'")
+ ebegin "Stopping machine ${VMNAME}"
+ $su_command "VBoxManage controlvm $UUID savestate" &>> /var/log/vboxinit.log
+ eend $?
+ done
+}
diff --git a/app-emulation/phpvirtualbox/metadata.xml b/app-emulation/phpvirtualbox/metadata.xml
new file mode 100644
index 000000000000..404a88dcca9b
--- /dev/null
+++ b/app-emulation/phpvirtualbox/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <longdescription lang="en">
+ </longdescription>
+ <upstream>
+ <remote-id type="google-code">phpvirtualbox</remote-id>
+ <remote-id type="sourceforge">phpvirtualbox</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/phpvirtualbox/phpvirtualbox-4.1.11.ebuild b/app-emulation/phpvirtualbox/phpvirtualbox-4.1.11.ebuild
new file mode 100644
index 000000000000..106479817205
--- /dev/null
+++ b/app-emulation/phpvirtualbox/phpvirtualbox-4.1.11.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit versionator eutils webapp depend.php
+
+MY_PV="$(replace_version_separator 2 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Web-based administration for VirtualBox in PHP"
+HOMEPAGE="https://sourceforge.net/projects/phpvirtualbox/"
+SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.zip"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/php[session,unicode,soap,gd]
+"
+DEPEND="app-arch/unzip"
+
+need_php_httpd
+
+src_install() {
+ webapp_src_preinst
+
+ cd ${MY_P}
+
+ dodoc CHANGELOG.txt LICENSE.txt README.txt || die
+ rm -f CHANGELOG.txt LICENSE.txt README.txt
+
+ insinto "${MY_HTDOCSDIR}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
+ webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
+
+ webapp_src_install
+ if has_version app-emulation/virtualbox[vboxwebsrv] || \
+ has_version app-emulation/virtualbox-bin[vboxwebsrv]
+ then
+ newinitd "${FILESDIR}"/vboxinit-initd vboxinit
+ fi
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ elog "Local or remote virtualbox hosts must be compiled with"
+ elog "'vboxwebsrv' useflag and the respective init script"
+ elog "must be running to use this interface"
+ elog " /etc/init.d/vboxwebsrv start"
+ elog
+ elog "To enable the automatic startup mode feature uncomment the"
+ elog "following line in the config.php file:"
+ elog " var \$startStopConfig = true;"
+ elog
+ elog "You should also add the /etc/init.d/vboxinit script to the"
+ elog "default runlevel on the virtualbox host:"
+ elog "\`rc-update add vboxinit default\`"
+ elog "If the server is on a remote host, than the script must be"
+ elog "copied manually from"
+ elog "${FILESDIR}/vboxinit-initd to /etc/init.d/vboxinit"
+ elog "on the remote host."
+}
diff --git a/app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r2.ebuild b/app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r2.ebuild
new file mode 100644
index 000000000000..106479817205
--- /dev/null
+++ b/app-emulation/phpvirtualbox/phpvirtualbox-4.1.7-r2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit versionator eutils webapp depend.php
+
+MY_PV="$(replace_version_separator 2 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Web-based administration for VirtualBox in PHP"
+HOMEPAGE="https://sourceforge.net/projects/phpvirtualbox/"
+SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.zip"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/php[session,unicode,soap,gd]
+"
+DEPEND="app-arch/unzip"
+
+need_php_httpd
+
+src_install() {
+ webapp_src_preinst
+
+ cd ${MY_P}
+
+ dodoc CHANGELOG.txt LICENSE.txt README.txt || die
+ rm -f CHANGELOG.txt LICENSE.txt README.txt
+
+ insinto "${MY_HTDOCSDIR}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
+ webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
+
+ webapp_src_install
+ if has_version app-emulation/virtualbox[vboxwebsrv] || \
+ has_version app-emulation/virtualbox-bin[vboxwebsrv]
+ then
+ newinitd "${FILESDIR}"/vboxinit-initd vboxinit
+ fi
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ elog "Local or remote virtualbox hosts must be compiled with"
+ elog "'vboxwebsrv' useflag and the respective init script"
+ elog "must be running to use this interface"
+ elog " /etc/init.d/vboxwebsrv start"
+ elog
+ elog "To enable the automatic startup mode feature uncomment the"
+ elog "following line in the config.php file:"
+ elog " var \$startStopConfig = true;"
+ elog
+ elog "You should also add the /etc/init.d/vboxinit script to the"
+ elog "default runlevel on the virtualbox host:"
+ elog "\`rc-update add vboxinit default\`"
+ elog "If the server is on a remote host, than the script must be"
+ elog "copied manually from"
+ elog "${FILESDIR}/vboxinit-initd to /etc/init.d/vboxinit"
+ elog "on the remote host."
+}
diff --git a/app-emulation/phpvirtualbox/phpvirtualbox-4.2.3b.ebuild b/app-emulation/phpvirtualbox/phpvirtualbox-4.2.3b.ebuild
new file mode 100644
index 000000000000..106479817205
--- /dev/null
+++ b/app-emulation/phpvirtualbox/phpvirtualbox-4.2.3b.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit versionator eutils webapp depend.php
+
+MY_PV="$(replace_version_separator 2 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Web-based administration for VirtualBox in PHP"
+HOMEPAGE="https://sourceforge.net/projects/phpvirtualbox/"
+SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.zip"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/php[session,unicode,soap,gd]
+"
+DEPEND="app-arch/unzip"
+
+need_php_httpd
+
+src_install() {
+ webapp_src_preinst
+
+ cd ${MY_P}
+
+ dodoc CHANGELOG.txt LICENSE.txt README.txt || die
+ rm -f CHANGELOG.txt LICENSE.txt README.txt
+
+ insinto "${MY_HTDOCSDIR}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
+ webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
+
+ webapp_src_install
+ if has_version app-emulation/virtualbox[vboxwebsrv] || \
+ has_version app-emulation/virtualbox-bin[vboxwebsrv]
+ then
+ newinitd "${FILESDIR}"/vboxinit-initd vboxinit
+ fi
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ elog "Local or remote virtualbox hosts must be compiled with"
+ elog "'vboxwebsrv' useflag and the respective init script"
+ elog "must be running to use this interface"
+ elog " /etc/init.d/vboxwebsrv start"
+ elog
+ elog "To enable the automatic startup mode feature uncomment the"
+ elog "following line in the config.php file:"
+ elog " var \$startStopConfig = true;"
+ elog
+ elog "You should also add the /etc/init.d/vboxinit script to the"
+ elog "default runlevel on the virtualbox host:"
+ elog "\`rc-update add vboxinit default\`"
+ elog "If the server is on a remote host, than the script must be"
+ elog "copied manually from"
+ elog "${FILESDIR}/vboxinit-initd to /etc/init.d/vboxinit"
+ elog "on the remote host."
+}
diff --git a/app-emulation/phpvirtualbox/phpvirtualbox-4.2.4.ebuild b/app-emulation/phpvirtualbox/phpvirtualbox-4.2.4.ebuild
new file mode 100644
index 000000000000..7cdf7969e51d
--- /dev/null
+++ b/app-emulation/phpvirtualbox/phpvirtualbox-4.2.4.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit versionator eutils webapp depend.php readme.gentoo
+
+MY_PV="$(replace_version_separator 2 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Web-based administration for VirtualBox in PHP"
+HOMEPAGE="https://sourceforge.net/projects/phpvirtualbox/"
+SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.zip"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/php[session,unicode,soap,gd]
+"
+DEPEND="app-arch/unzip"
+
+S="${WORKDIR}"/${MY_P}
+
+need_php_httpd
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+Local or remote virtualbox hosts must be compiled with
+'vboxwebsrv' useflag and the respective init script
+must be running to use this interface:
+/etc/init.d/vboxwebsrv start
+
+To enable the automatic startup mode feature uncomment the
+following line in the config.php file:
+var \$startStopConfig = true;
+
+You should also add the /etc/init.d/vboxinit script to the
+default runlevel on the virtualbox host:
+\`rc-update add vboxinit default\`
+If the server is on a remote host, than the script must be
+copied manually from
+'${FILESDIR}'/vboxinit-initd to
+/etc/init.d/vboxinit on the remote host."
+
+src_install() {
+ webapp_src_preinst
+
+ dodoc CHANGELOG.txt LICENSE.txt README.txt
+ rm -f CHANGELOG.txt LICENSE.txt README.txt
+
+ insinto "${MY_HTDOCSDIR}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
+ webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
+
+ webapp_src_install
+ if has_version app-emulation/virtualbox[vboxwebsrv] || \
+ has_version app-emulation/virtualbox-bin[vboxwebsrv]
+ then
+ newinitd "${FILESDIR}"/vboxinit-initd vboxinit
+ fi
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/phpvirtualbox/phpvirtualbox-4.2.7.ebuild b/app-emulation/phpvirtualbox/phpvirtualbox-4.2.7.ebuild
new file mode 100644
index 000000000000..a54923a4471b
--- /dev/null
+++ b/app-emulation/phpvirtualbox/phpvirtualbox-4.2.7.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit versionator eutils webapp depend.php readme.gentoo
+
+MY_PV="$(replace_version_separator 2 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Web-based administration for VirtualBox in PHP"
+HOMEPAGE="https://sourceforge.net/projects/phpvirtualbox/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/php[session,unicode,soap,gd]
+"
+DEPEND="app-arch/unzip"
+
+S="${WORKDIR}"/${MY_P}
+
+need_php_httpd
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+Local or remote virtualbox hosts must be compiled with
+'vboxwebsrv' useflag and the respective init script
+must be running to use this interface:
+/etc/init.d/vboxwebsrv start
+
+To enable the automatic startup mode feature uncomment the
+following line in the config.php file:
+var \$startStopConfig = true;
+
+You should also add the /etc/init.d/vboxinit script to the
+default runlevel on the virtualbox host:
+\`rc-update add vboxinit default\`
+If the server is on a remote host, than the script must be
+copied manually from
+'${FILESDIR}'/vboxinit-initd to
+/etc/init.d/vboxinit on the remote host."
+
+src_install() {
+ webapp_src_preinst
+
+ dodoc CHANGELOG.txt LICENSE.txt README.txt
+ rm -f CHANGELOG.txt LICENSE.txt README.txt
+
+ insinto "${MY_HTDOCSDIR}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
+ webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
+
+ webapp_src_install
+ if has_version app-emulation/virtualbox[vboxwebsrv] || \
+ has_version app-emulation/virtualbox-bin[vboxwebsrv]
+ then
+ newinitd "${FILESDIR}"/vboxinit-initd vboxinit
+ fi
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/phpvirtualbox/phpvirtualbox-4.3.0.ebuild b/app-emulation/phpvirtualbox/phpvirtualbox-4.3.0.ebuild
new file mode 100644
index 000000000000..287392f5c305
--- /dev/null
+++ b/app-emulation/phpvirtualbox/phpvirtualbox-4.3.0.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit versionator eutils webapp depend.php readme.gentoo
+
+MY_PV="$(replace_version_separator 2 '-')"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Web-based administration for VirtualBox in PHP"
+HOMEPAGE="https://sourceforge.net/projects/phpvirtualbox/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/php[session,unicode,soap,gd]
+"
+DEPEND="app-arch/unzip"
+
+S="${WORKDIR}"
+
+need_php_httpd
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+Local or remote virtualbox hosts must be compiled with
+'vboxwebsrv' useflag and the respective init script
+must be running to use this interface:
+/etc/init.d/vboxwebsrv start
+
+To enable the automatic startup mode feature uncomment the
+following line in the config.php file:
+var \$startStopConfig = true;
+
+You should also add the /etc/init.d/vboxinit script to the
+default runlevel on the virtualbox host:
+\`rc-update add vboxinit default\`
+If the server is on a remote host, than the script must be
+copied manually from
+'${FILESDIR}'/vboxinit-initd to
+/etc/init.d/vboxinit on the remote host."
+
+src_install() {
+ webapp_src_preinst
+
+ dodoc CHANGELOG.txt LICENSE.txt README.txt
+ rm -f CHANGELOG.txt LICENSE.txt README.txt
+
+ insinto "${MY_HTDOCSDIR}"
+ doins -r .
+
+ webapp_configfile "${MY_HTDOCSDIR}"/config.php-example
+ webapp_serverowned "${MY_HTDOCSDIR}"/config.php-example
+
+ webapp_src_install
+ if has_version app-emulation/virtualbox[vboxwebsrv] || \
+ has_version app-emulation/virtualbox-bin[vboxwebsrv]
+ then
+ newinitd "${FILESDIR}"/vboxinit-initd vboxinit
+ fi
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ webapp_pkg_postinst
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/playonlinux/Manifest b/app-emulation/playonlinux/Manifest
new file mode 100644
index 000000000000..f7a1477161b0
--- /dev/null
+++ b/app-emulation/playonlinux/Manifest
@@ -0,0 +1,3 @@
+DIST PlayOnLinux_4.2.4.tar.gz 4638249 SHA256 cc6f9c41c9f91278d995d14b7be6bd86c765cf41351c80e885df29da40b57554 SHA512 1f200e43da4e43b6687cc05243cb9375d312c5382d4d82f06f574cc4a1a4322568ed429abc463d830cfcc1a818d0cc93147fbc60858a6b19872b55a479c8c58c WHIRLPOOL d09c5439a618d99af0ae380cb39a8e92acd47869190f984981e9cdc91272da48c6731457d0a23383c47219371bdf9d6018fe89a7acaaba32fc96221b58406d99
+DIST PlayOnLinux_4.2.6.tar.gz 3202517 SHA256 34fc06ce55f889673529a405d17ffc045a68cc998a679377056ed63988dd64e2 SHA512 41c4af5335874020f6405f460a0b9787f7dcfb77790661ff254d2af7ff107a94020b75a8b4f1856f1e4b866e63dee49d5823edf4867d64cd20c41b17387f5490 WHIRLPOOL 4278cc00c76abfeecb87d125046a977c69d5e62b751481ffa5ed4ca4a911507bc6b650bd8648cc7b4cd794e7f0c9e91197adc3854c963770bd87a535d83ab562
+DIST PlayOnLinux_4.2.8.tar.gz 3168086 SHA256 2ae8d5132706f3c697d0a53573c5835938dd042b620eb76790181b285797985c SHA512 8b9c934bf3591030dc9922757eadb09db34fee7c5a5ee8b800c831ee1b99e55959c0b66f645a89d3dc5d7287438da3a26c6877076175272e199221231accba12 WHIRLPOOL cbaafa8f0f90c89931135c0fbcd91df00676fde4e0e9305a3d8f52234a51b96682e5a4aca14138f1f3f54ac43f69d38b7186667fcab97c72fa8043c3ffbd68d6
diff --git a/app-emulation/playonlinux/files/playonlinux-4.2.4-binary-plugin.patch b/app-emulation/playonlinux/files/playonlinux-4.2.4-binary-plugin.patch
new file mode 100644
index 000000000000..d5d3727e9fb0
--- /dev/null
+++ b/app-emulation/playonlinux/files/playonlinux-4.2.4-binary-plugin.patch
@@ -0,0 +1,17 @@
+Description: Remove binary code from the package
+ Upstream ships a binary plugin in the archive. This plugin is not necessary to
+ get PlayOnLinux working and it still can be downloaded from upstream.
+Forwarded: not-needed
+Author: Bertrand Marc <beberking@gmail.com>
+--- a/plugins/plugins.lst
++++ b/plugins/plugins.lst
+@@ -21,9 +21,6 @@
+
+ ## in fact empty line is also ignored because it's more easy to read =)
+
+-##Capture
+-capture;Capture_2.4.3.pol;Capture;enable;2.4.3;11;1;0
+-
+ ##Screencap
+ screencap;ScreenCap_0.0.4.pol;ScreenCap;enable;0.0.4;1;1;1
+
diff --git a/app-emulation/playonlinux/files/playonlinux-4.2.4-pol-bash.patch b/app-emulation/playonlinux/files/playonlinux-4.2.4-pol-bash.patch
new file mode 100644
index 000000000000..f9b3e2b81c29
--- /dev/null
+++ b/app-emulation/playonlinux/files/playonlinux-4.2.4-pol-bash.patch
@@ -0,0 +1,35 @@
+diff --git a/etc/pol_bash b/etc/pol_bash
+index 7911f05..bd891e4 100644
+--- a/etc/pol_bash
++++ b/etc/pol_bash
+@@ -29,7 +29,15 @@ export HISTCONTROL=ignoreboth
+ shopt -s checkwinsize
+
+ # make less more friendly for non-text input files, see lesspipe(1)
+-[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
++less_pipe_cmd=$(lesspipe 2> /dev/null)
++if [ "$less_pipe_cmd" == export* ]; then
++ eval "$(lesspipe)"
++else
++ if [ -x /usr/bin/lesspipe ]; then
++ export LESSOPEN='| lesspipe %s'
++ fi
++fi
++unset less_pipe_cmd
+
+ # set variable identifying the chroot you work in (used in the prompt below)
+ if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
+@@ -73,7 +81,9 @@ fi
+ # enable programmable completion features (you don't need to enable
+ # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+ # sources /etc/bash.bashrc).
+-if [ -f /etc/bash_completion ]; then
+- . /etc/bash_completion
+-fi
+-
++for bashcomp in /etc/{bash_completion,profile.d/bash-completion.sh}; do
++ if [ -r "$bashcomp" ]; then
++ . "$bashcomp"
++ fi
++done
++unset bashcomp
diff --git a/app-emulation/playonlinux/files/playonlinux-4.2.6-stop-update-warning.patch b/app-emulation/playonlinux/files/playonlinux-4.2.6-stop-update-warning.patch
new file mode 100644
index 000000000000..3e93adb0f2c2
--- /dev/null
+++ b/app-emulation/playonlinux/files/playonlinux-4.2.6-stop-update-warning.patch
@@ -0,0 +1,17 @@
+# This patch enables the DEBIAN_PACKGE for playonlinux.
+# The changes are described in the source comments below.
+# The flag is unfortnuately named debian, however the
+# benefits apply to any package management system.
+# Patch written by Adam Mills <adam@armills.info>
+
+--- python/lib/Variables.py 2013-08-10 22:19:46.053365072 -0400
++++ python/lib/Variables-patched.py 2013-08-10 22:17:58.275881842 -0400
+@@ -26,7 +26,7 @@
+ # Debian packagers should switch this to TRUE
+ # It will disable update alerts, bug reports, statistics
+ # It will set the good locale directory, and it will use the good msttcorefonts
+-os.environ["DEBIAN_PACKAGE"] = "FALSE"
++os.environ["DEBIAN_PACKAGE"] = "TRUE"
+
+ # Variables PlayOnMac
+ if (os.environ["POL_OS"] == "Mac"):
diff --git a/app-emulation/playonlinux/files/playonlinux-pkg.1 b/app-emulation/playonlinux/files/playonlinux-pkg.1
new file mode 100644
index 000000000000..b96a8dc921da
--- /dev/null
+++ b/app-emulation/playonlinux/files/playonlinux-pkg.1
@@ -0,0 +1,33 @@
+.TH PLAYONLINUX-PKG 1 "February 6, 2009"
+
+.SH NAME
+playonlinux-pkg \- tool to manage playonlinux packages
+
+.SH SYNOPSIS
+.B playonlinux-pkg
+.RI [ options ]
+.RI [ package ]
+
+.SH DESCRIPTION
+.B playonlinux-pkg
+is a tool to install or manage the playonlinux packages
+
+.SH OPTIONS
+.TP
+.I "-b, --browse"
+ Choose a file.
+.TP
+.I "-e, --extract"
+ Extract the package.
+.TP
+.I "-i, --install"
+ Install the package.
+.TP
+.I "-h, --help"
+ Show usage.
+
+.SH AUTHOR
+playonlinux was written by Quentin Pâris <qparis@playonlinux.com>.
+.PP
+This manual page was written by Bertrand Marc <beberking@gmail.com>,
+for the Debian project (but may be used by others).
diff --git a/app-emulation/playonlinux/files/playonlinux.1 b/app-emulation/playonlinux/files/playonlinux.1
new file mode 100644
index 000000000000..63c499be7327
--- /dev/null
+++ b/app-emulation/playonlinux/files/playonlinux.1
@@ -0,0 +1,33 @@
+.TH PLAYONLINUX 1 "February 6, 2009"
+
+.SH NAME
+PlayOnLinux \- front-end for Wine
+
+.SH SYNOPSIS
+.B playonlinux
+.RI [ options ]
+
+.SH DESCRIPTION
+.B PlayOnLinux
+is a front-end for Wine. It allows you to easily install and use numerous games and software designed to run with Microsoft®'s Windows®.
+.br
+Few games are compatible with GNU/Linux at the moment and it certainly is a factor preventing the migration to this system.
+.P
+.B PlayOnLinux
+performs installations in
+.I ~/.PlayOnLinux
+and uses separate Wine prefixes to avoid conflicts between applications.
+
+.SH OPTIONS
+.TP
+.I --version
+ Show version number and exit.
+.TP
+.I "--run <prog>"
+ Run directly the specified program.
+
+.SH AUTHOR
+playonlinux was written by Quentin Pâris <qparis@playonlinux.com>.
+.PP
+This manual page was written by Bertrand Marc <beberking@gmail.com>,
+for the Debian project (but may be used by others).
diff --git a/app-emulation/playonlinux/metadata.xml b/app-emulation/playonlinux/metadata.xml
new file mode 100644
index 000000000000..d94fe6d47e49
--- /dev/null
+++ b/app-emulation/playonlinux/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>wine</herd>
+ <maintainer>
+ <email>np-hardass@gentoo.org</email>
+ <name>NP-Hardass</name>
+ </maintainer>
+ <use>
+ <flag name="winbind">Enables support for the winbind auth daemon</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/app-emulation/playonlinux/playonlinux-4.2.4.ebuild b/app-emulation/playonlinux/playonlinux-4.2.4.ebuild
new file mode 100644
index 000000000000..51153395dddb
--- /dev/null
+++ b/app-emulation/playonlinux/playonlinux-4.2.4.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit gnome2-utils python-single-r1 games
+
+MY_PN="PlayOnLinux"
+
+DESCRIPTION="Set of scripts to easily install and use Windows games and software"
+HOMEPAGE="http://playonlinux.com/"
+SRC_URI="http://www.playonlinux.com/script_files/${MY_PN}/${PV}/${MY_PN}_${PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="winbind"
+
+DEPEND=""
+RDEPEND="app-emulation/wine
+ app-arch/cabextract
+ app-arch/p7zip
+ app-arch/unzip
+ app-crypt/gnupg
+ dev-python/wxpython:2.8[${PYTHON_USEDEP}]
+ || ( media-gfx/imagemagick media-gfx/graphicsmagick[imagemagick] )
+ net-misc/wget
+ x11-apps/mesa-progs
+ x11-terms/xterm
+ media-gfx/icoutils
+ || ( net-analyzer/netcat net-analyzer/netcat6 )
+ winbind? ( net-fs/samba[winbind] ) "
+
+S=${WORKDIR}/${PN}
+
+# TODO:
+# Having a real install script and let playonlinux use standard filesystem
+# architecture to prevent having everything installed into GAMES_DATADIR
+# It will let using LANGUAGES easily
+# How to deal with Microsoft Fonts installation asked every time ?
+# How to deal with wine version installed ? (have a better mgmt of system one)
+# Look at debian pkg: http://packages.debian.org/sid/playonlinux
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ games_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-4.2.4-pol-bash.patch"
+ epatch "${FILESDIR}/${PN}-4.2.4-binary-plugin.patch"
+
+ python_fix_shebang .
+
+ # remove playonmac
+ rm etc/{playonmac.icns,terminal.applescript} || die
+
+ # remove desktop integration
+ rm etc/{PlayOnLinux.desktop,PlayOnLinux.directory,playonlinux-Programmes.menu} || die
+}
+
+src_install() {
+ # all things without exec permissions
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r resources lang lib etc plugins
+
+ # bash/ install
+ exeinto "${GAMES_DATADIR}/${PN}/bash"
+ find "${S}/bash" -type f -exec doexe '{}' +
+ exeinto "${GAMES_DATADIR}/${PN}/bash/expert"
+ find "${S}/bash/expert" -type f -exec doexe '{}' +
+
+ # python/ install
+ python_moduleinto "${GAMES_DATADIR}/${PN}"
+ python_domodule python
+
+ # main executable files
+ exeinto "${GAMES_DATADIR}/${PN}"
+ doexe ${PN}{,-pkg,-bash,-shell,-url_handler}
+
+ # icons
+ doicon -s 128 etc/${PN}.png
+ for size in 16 22 32; do
+ newicon -s $size etc/${PN}$size.png ${PN}.png
+ done
+
+ doman "${FILESDIR}"/playonlinux{,-pkg}.1
+ dodoc CHANGELOG.md
+
+ games_make_wrapper ${PN} "./${PN}" "${GAMES_DATADIR}/${PN}"
+ games_make_wrapper ${PN}-pkg "./${PN}-pkg" "${GAMES_DATADIR}/${PN}"
+ make_desktop_entry ${PN} ${MY_PN} ${PN} Game
+
+ prepgamesdirs
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ gnome2_icon_cache_update
+}
+
+pkg_prerm() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "Installed softwares and games with playonlinux have not been removed."
+ elog "To remove them, you can re-install playonlinux and remove them using it"
+ elog "or do it manually by removing .PlayOnLinux/ in your home directory."
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/playonlinux/playonlinux-4.2.6.ebuild b/app-emulation/playonlinux/playonlinux-4.2.6.ebuild
new file mode 100644
index 000000000000..9c7e063e98e4
--- /dev/null
+++ b/app-emulation/playonlinux/playonlinux-4.2.6.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit gnome2-utils python-single-r1 games
+
+MY_PN="PlayOnLinux"
+
+DESCRIPTION="Set of scripts to easily install and use Windows games and software"
+HOMEPAGE="http://playonlinux.com/"
+SRC_URI="http://www.playonlinux.com/script_files/${MY_PN}/${PV}/${MY_PN}_${PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="winbind"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND=""
+RDEPEND="app-emulation/wine
+ app-arch/cabextract
+ app-arch/p7zip
+ app-arch/unzip
+ app-crypt/gnupg
+ dev-python/wxpython:2.8[${PYTHON_USEDEP}]
+ || ( media-gfx/imagemagick media-gfx/graphicsmagick[imagemagick] )
+ net-misc/wget
+ x11-apps/mesa-progs
+ x11-terms/xterm
+ media-gfx/icoutils
+ || ( net-analyzer/netcat net-analyzer/netcat6 )
+ winbind? ( net-fs/samba[winbind] ) "
+
+S=${WORKDIR}/${PN}
+
+# TODO:
+# Having a real install script and let playonlinux use standard filesystem
+# architecture to prevent having everything installed into GAMES_DATADIR
+# It will let using LANGUAGES easily
+# How to deal with Microsoft Fonts installation asked every time ?
+# How to deal with wine version installed ? (have a better mgmt of system one)
+# Look at debian pkg: http://packages.debian.org/sid/playonlinux
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ games_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-4.2.4-pol-bash.patch"
+ epatch "${FILESDIR}/${PN}-4.2.4-binary-plugin.patch"
+ epatch "${FILESDIR}/${PN}-4.2.6-stop-update-warning.patch"
+
+ python_fix_shebang .
+
+ # remove playonmac
+ rm etc/{playonmac.icns,terminal.applescript} || die
+
+ # remove desktop integration
+ rm etc/{PlayOnLinux.desktop,PlayOnLinux.directory,playonlinux-Programmes.menu} || die
+}
+
+src_install() {
+ # all things without exec permissions
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r resources lang lib etc plugins
+
+ # bash/ install
+ exeinto "${GAMES_DATADIR}/${PN}/bash"
+ find "${S}/bash" -type f -exec doexe '{}' +
+ exeinto "${GAMES_DATADIR}/${PN}/bash/expert"
+ find "${S}/bash/expert" -type f -exec doexe '{}' +
+
+ # python/ install
+ python_moduleinto "${GAMES_DATADIR}/${PN}"
+ python_domodule python
+
+ # main executable files
+ exeinto "${GAMES_DATADIR}/${PN}"
+ doexe ${PN}{,-pkg,-bash,-shell,-url_handler}
+
+ # icons
+ doicon -s 128 etc/${PN}.png
+ for size in 16 22 32; do
+ newicon -s $size etc/${PN}$size.png ${PN}.png
+ done
+
+ doman "${FILESDIR}"/playonlinux{,-pkg}.1
+ dodoc CHANGELOG.md
+
+ games_make_wrapper ${PN} "./${PN}" "${GAMES_DATADIR}/${PN}"
+ games_make_wrapper ${PN}-pkg "./${PN}-pkg" "${GAMES_DATADIR}/${PN}"
+ make_desktop_entry ${PN} ${MY_PN} ${PN} Game
+
+ prepgamesdirs
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ gnome2_icon_cache_update
+}
+
+pkg_prerm() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "Installed softwares and games with playonlinux have not been removed."
+ elog "To remove them, you can re-install playonlinux and remove them using it"
+ elog "or do it manually by removing .PlayOnLinux/ in your home directory."
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/playonlinux/playonlinux-4.2.8.ebuild b/app-emulation/playonlinux/playonlinux-4.2.8.ebuild
new file mode 100644
index 000000000000..9c7e063e98e4
--- /dev/null
+++ b/app-emulation/playonlinux/playonlinux-4.2.8.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit gnome2-utils python-single-r1 games
+
+MY_PN="PlayOnLinux"
+
+DESCRIPTION="Set of scripts to easily install and use Windows games and software"
+HOMEPAGE="http://playonlinux.com/"
+SRC_URI="http://www.playonlinux.com/script_files/${MY_PN}/${PV}/${MY_PN}_${PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="winbind"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND=""
+RDEPEND="app-emulation/wine
+ app-arch/cabextract
+ app-arch/p7zip
+ app-arch/unzip
+ app-crypt/gnupg
+ dev-python/wxpython:2.8[${PYTHON_USEDEP}]
+ || ( media-gfx/imagemagick media-gfx/graphicsmagick[imagemagick] )
+ net-misc/wget
+ x11-apps/mesa-progs
+ x11-terms/xterm
+ media-gfx/icoutils
+ || ( net-analyzer/netcat net-analyzer/netcat6 )
+ winbind? ( net-fs/samba[winbind] ) "
+
+S=${WORKDIR}/${PN}
+
+# TODO:
+# Having a real install script and let playonlinux use standard filesystem
+# architecture to prevent having everything installed into GAMES_DATADIR
+# It will let using LANGUAGES easily
+# How to deal with Microsoft Fonts installation asked every time ?
+# How to deal with wine version installed ? (have a better mgmt of system one)
+# Look at debian pkg: http://packages.debian.org/sid/playonlinux
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ games_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-4.2.4-pol-bash.patch"
+ epatch "${FILESDIR}/${PN}-4.2.4-binary-plugin.patch"
+ epatch "${FILESDIR}/${PN}-4.2.6-stop-update-warning.patch"
+
+ python_fix_shebang .
+
+ # remove playonmac
+ rm etc/{playonmac.icns,terminal.applescript} || die
+
+ # remove desktop integration
+ rm etc/{PlayOnLinux.desktop,PlayOnLinux.directory,playonlinux-Programmes.menu} || die
+}
+
+src_install() {
+ # all things without exec permissions
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r resources lang lib etc plugins
+
+ # bash/ install
+ exeinto "${GAMES_DATADIR}/${PN}/bash"
+ find "${S}/bash" -type f -exec doexe '{}' +
+ exeinto "${GAMES_DATADIR}/${PN}/bash/expert"
+ find "${S}/bash/expert" -type f -exec doexe '{}' +
+
+ # python/ install
+ python_moduleinto "${GAMES_DATADIR}/${PN}"
+ python_domodule python
+
+ # main executable files
+ exeinto "${GAMES_DATADIR}/${PN}"
+ doexe ${PN}{,-pkg,-bash,-shell,-url_handler}
+
+ # icons
+ doicon -s 128 etc/${PN}.png
+ for size in 16 22 32; do
+ newicon -s $size etc/${PN}$size.png ${PN}.png
+ done
+
+ doman "${FILESDIR}"/playonlinux{,-pkg}.1
+ dodoc CHANGELOG.md
+
+ games_make_wrapper ${PN} "./${PN}" "${GAMES_DATADIR}/${PN}"
+ games_make_wrapper ${PN}-pkg "./${PN}-pkg" "${GAMES_DATADIR}/${PN}"
+ make_desktop_entry ${PN} ${MY_PN} ${PN} Game
+
+ prepgamesdirs
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ gnome2_icon_cache_update
+}
+
+pkg_prerm() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "Installed softwares and games with playonlinux have not been removed."
+ elog "To remove them, you can re-install playonlinux and remove them using it"
+ elog "or do it manually by removing .PlayOnLinux/ in your home directory."
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/q4wine/Manifest b/app-emulation/q4wine/Manifest
new file mode 100644
index 000000000000..f203be4b98c5
--- /dev/null
+++ b/app-emulation/q4wine/Manifest
@@ -0,0 +1,2 @@
+DIST q4wine-1.0-r3.tar.bz2 889308 SHA256 9f1319dd0baff3834a3938e0a048c1529cb9ea521158370176b706fce0d4d2ff SHA512 df10a2fbf6874f4c4e02dd9c43031453a46c76f03d83321f2d6e9544d0540dd07da1bc9246767c5c91ce17d67d5d236227294efaed9de09f3d5a18afbd60b224 WHIRLPOOL 51b5b4cfc157da6b99154269ef4ef9f38ff91f861864158b789352505af485d8b523a21c6d4b59544804ed3c15cb1c6c756db3f3203c8e3ba55c8396c3630df3
+DIST q4wine-1.1-r2.tar.bz2 888990 SHA256 01463f9ec3ef9f7ef987d2b77425f2806cf2b60f574deb6644458366782eafc7 SHA512 8aaeec46d239a86a9eb10377842d63d84a35864f920f9dc46a022ae1cf3e010273d3759701595e058a089f6418a297a0bf94ed62b580a71fa1c8c27a80f4ec7e WHIRLPOOL 6ae891e33a2bf3759c45930820e21a273b2bf36f2c386a841a96c3bf14cfdb6741871d3c90383dde3b6b01df1a87f5b1537ae40bac5a494bdd3023248c526244
diff --git a/app-emulation/q4wine/files/q4wine-qtsingleapp.patch b/app-emulation/q4wine/files/q4wine-qtsingleapp.patch
new file mode 100644
index 000000000000..803284dbdb17
--- /dev/null
+++ b/app-emulation/q4wine/files/q4wine-qtsingleapp.patch
@@ -0,0 +1,15 @@
+https://github.com/brezerk/q4wine/issues/39
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index adb8db6..7c0d0d2 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -275,7 +275,7 @@ SET ( Q4WINE_HEADERS_DIR
+
+ IF (${WITH_SYSTEM_SINGLEAPP} MATCHES ON )
+ MESSAGE(STATUS "Searching for QtSingleApplication package (WITH_SYSTEM_SINGLEAPP=ON) --\n")
+- find_path(QTSINGLEAPPLIB_INCLUDE_DIR QtSingleApplication PATH_SUFFIXES QtSolutions)
++ find_path(QTSINGLEAPPLIB_INCLUDE_DIR QtSingleApplication PATH_SUFFIXES QtSolutions PATHS /usr/include/qt4)
+ find_library(QTSINGLEAPPLIB QtSolutions_SingleApplication-2.6)
+
+ IF (QTSINGLEAPPLIB_INCLUDE_DIR AND QTSINGLEAPPLIB )
diff --git a/app-emulation/q4wine/metadata.xml b/app-emulation/q4wine/metadata.xml
new file mode 100644
index 000000000000..4ad3c6023f85
--- /dev/null
+++ b/app-emulation/q4wine/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>qt</herd>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <use>
+ <flag name="gnome">Use the gksu sudo GUI for managing the devices</flag>
+ <flag name="icoutils">Enable icoutils support</flag>
+ <flag name="kde">Use the kdesu sudo GUI for managing the devices</flag>
+ <flag name="wineappdb">Enable Win AppDB browser subsystem</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">q4wine</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/q4wine/q4wine-1.0-r3.ebuild b/app-emulation/q4wine/q4wine-1.0-r3.ebuild
new file mode 100644
index 000000000000..474649f6698c
--- /dev/null
+++ b/app-emulation/q4wine/q4wine-1.0-r3.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+LANGS="cs de en es fa he it ru uk pl pt af"
+
+inherit cmake-utils
+
+DESCRIPTION="Qt4 GUI configuration tool for Wine"
+HOMEPAGE="http://q4wine.brezblock.org.ua/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}/${PN}%20${PV}/${PF}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug +icoutils +wineappdb -dbus gnome kde"
+
+for x in ${LANGS}; do
+ IUSE+=" linguas_${x}"
+done
+
+DEPEND="dev-qt/qtgui:4
+ dev-qt/qtsql:4[sqlite]
+ dev-util/cmake"
+
+RDEPEND="dev-qt/qtgui:4
+ dev-qt/qtsql:4[sqlite]
+ app-admin/sudo
+ app-emulation/wine
+ >=sys-apps/which-2.19
+ icoutils? ( >=media-gfx/icoutils-0.26.0 )
+ sys-fs/fuseiso
+ kde? ( kde-apps/kdesu:4 )
+ gnome? ( x11-libs/gksu )
+ dbus? ( dev-qt/qtdbus:4 )"
+
+DOCS="README AUTHORS ChangeLog"
+
+S="${WORKDIR}/${PF}"
+
+src_configure() {
+ mycmakeargs="${mycmakeargs} \
+ $(cmake-utils_use debug DEBUG) \
+ $(cmake-utils_use_with icoutils ICOUTILS) \
+ $(cmake-utils_use_with wineappdb WINEAPPDB) \
+ $(cmake-utils_use_with dbus DBUS)"
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ for x in ${LANGS}; do
+ if ! has ${x} ${LINGUAS}; then
+ find "${D}" -name "${PN}_${x}*.qm" -exec rm {} \;
+ fi
+ done
+}
diff --git a/app-emulation/q4wine/q4wine-1.1_p2-r1.ebuild b/app-emulation/q4wine/q4wine-1.1_p2-r1.ebuild
new file mode 100644
index 000000000000..d63a1068d6ff
--- /dev/null
+++ b/app-emulation/q4wine/q4wine-1.1_p2-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PLOCALES="af_ZA cs_CZ de_DE en_US es_ES fa_IR he_IL it_IT pl_PL pt_BR ru_RU uk_UA"
+PLOCALE_BACKUP="en_US"
+
+inherit cmake-utils l10n
+
+DESCRIPTION="Qt4 GUI configuration tool for Wine"
+HOMEPAGE="http://q4wine.brezblock.org.ua/"
+
+# Upstream names the package PV-rX. We change that to
+# PV_pX so we can use portage revisions.
+MY_PV="${PV/_p/-r}"
+MY_P="${PN}-${MY_PV}"
+SRC_URI="mirror://sourceforge/${PN}/${PN}/${PN}%20${MY_PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+dbus debug +icoutils +wineappdb"
+
+DEPEND="
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4
+ dev-qt/qtsingleapplication[qt4(+),X]
+ dev-qt/qtsql:4[sqlite]
+ dbus? ( dev-qt/qtdbus:4 )
+"
+RDEPEND="${DEPEND}
+ app-admin/sudo
+ app-emulation/wine
+ >=sys-apps/which-2.19
+ sys-fs/fuseiso
+ icoutils? ( >=media-gfx/icoutils-0.26.0 )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS=( AUTHORS ChangeLog README )
+
+src_configure() {
+ local enabled_linguas
+ construct_LINGUAS() {
+ local current_locale="$(echo ${1} | tr '[:upper:]' '[:lower:]')"
+ enabled_linguas="${enabled_linguas};${current_locale}"
+ }
+ l10n_for_each_locale_do construct_LINGUAS
+ local mycmakeargs=(
+ -DLINGUAS="${enabled_linguas}"
+ -DQT5=OFF
+ -DWITH_SYSTEM_SINGLEAPP=ON
+ $(cmake-utils_use debug)
+ $(cmake-utils_use_with dbus)
+ $(cmake-utils_use_with icoutils)
+ $(cmake-utils_use_with wineappdb)
+ )
+ cmake-utils_src_configure
+}
diff --git a/app-emulation/qemu-guest-agent/Manifest b/app-emulation/qemu-guest-agent/Manifest
new file mode 100644
index 000000000000..158032159d7e
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/Manifest
@@ -0,0 +1,8 @@
+DIST qemu-1.5.2-e26b4ba6.tar.xz 21348 SHA256 877cc321b3bd5e30aaa7a481b359e16845ad731927a49df1fb2d5b0cfbfd0ad6 SHA512 1f015c5d9ca37475bddf9d474255b10ae3f03d01280270211deb1195a2ef288e6a1bbff9490cb4173a7af4b02787469278816fd5dee69d8e11d601b5a46b0e53 WHIRLPOOL 86a249c1339bb241a1534e5047bab696b8c26ad491eda073ee57ce1f9104df54ab7e251cd5ad9568a1381307b118029b7619bf689dec36f454d3f77f2f2f402a
+DIST qemu-1.5.2.tar.bz2 11932902 SHA256 f661147d190ab8432045058a660d810f13dc528fe7017ce578e9f2da2997a250 SHA512 cae47d34b99d3d3ded688b5a434ba69a377a838dddd367d10e4a71cd697305870c9671e4291490c0028b8143870b0998469e508cd28922fbebd8ea5f86f591b9 WHIRLPOOL bd5e8063c40e3e2fc43934e3649562f594f249002209bf09e05fda06155d423587d714862c8b55f9b2621f3ce20154f4e81b5c73df65ef2513ae824ae5bbcee9
+DIST qemu-1.6.0-49bdd50f.tar.xz 3132 SHA256 b722c117c3998b90d63a01558ab009a40df6e5d7fc184b650cb581ae45594c17 SHA512 c3403958c6f4412f7656a161b1e065966893a4426f582fedf5350acb466b590349fbba3dcc5f52a3df023c7894ca7ee0bd5a3c41df7dc515c08d3dfbb838668d WHIRLPOOL fb99c0faac3052dd42f9f3d5bb87520974277831f41bb965a7dabb8ce7be83ea387522a44cbc8013f3d875d67d0ee7e86067887a341f8d7acb01efd6d47c63f0
+DIST qemu-1.6.0.tar.bz2 12040196 SHA256 3132e58ada26d43b6924e8c2f07db80aa1e5022f3dcf03dee7d8bb9194b2cb48 SHA512 18dfc35eeb6fa48c9e73483c905885ae98191cf76acc00c568d57c6973d912f8bea4de24e85f55308d22e74028b809349b00d7c531c3b2dd5c837cd213a8faac WHIRLPOOL bdf7611557876cf86e207153c6793132511f555940f9e5ad671e4294c3a738a85e9c84c678a7daf73b863a15c7223ba7e7f4fd36c68ee3d59b3beabd7d17930a
+DIST qemu-2.0.0.tar.bz2 12839647 SHA256 60cc1aa0cad39cec891f970bed60ca8a484f071adad4943123599ac223543a3b SHA512 8fe2e8faa66251aaea7d6017ee71675d5b05f93f92be7e2ad3e1d02af185b3d6c4069bd83a13fb1e35a3e8947aff76f22446b395f97ac18b6f7a99744202e3fa WHIRLPOOL 6b39916acdcaa5e22510afec8a972935e71064de9ff0a3f9a698a8142f66b130a24d0a38cc56a7a92dbdc78d5145abe743a9c6933f819ce9e682b7cffdac1508
+DIST qemu-2.1.2.tar.bz2 23563255 SHA256 fd10f5e45cf5a736fa5a3e1c279ae9821534e700beb7d1aab88a07648a394885 SHA512 73ef758c82b23eec649c807bee8937d7fbf267278f7777adbdb22b738672543b826d211a4b523f38cee3e2b01f05ccf40a75756fc19c911362988d8e86d5cd58 WHIRLPOOL 5703d0aa8bb4366bb7aeb44fa4f3d1b54f188de42cd8c82e894584f627802b80a3dde1aa3b15fe8602a1891ec61ac66b3cd44ec031385cca88768f375c15b554
+DIST qemu-2.2.0.tar.bz2 24316697 SHA256 b68c9b6c7c694f5489b5a6bffe993cd976ffbb78e7d178eb3bc016caf460039c SHA512 c1a42cc53a01175875411cad13defaab46f97740897b89f19fbf345106534f83fc707fae4a58d890f64eea475b940b934c7531a6ed04aa01f54cadb52b0b5909 WHIRLPOOL a9cb92406d4f2cfd6b7989c9876f7df4b305083241110e7b2bf16642cfd77531c48a48753745dfeb31b9aa7d71a2d4d3f8c5aba797918c9c60e920c79066ea2d
+DIST qemu-2.3.0.tar.bz2 24683085 SHA256 b6bab7f763d5be73e7cb5ee7d4c8365b7a8df2972c52fa5ded18893bd8281588 SHA512 7a40d213c5696b27784abd2a3119e49d42c38c923be431826c73a8f14c19074435d7f1a652686c53baf08e81f5a3005b2ddc92d67c32f6a2b19659ab627e9eaa WHIRLPOOL 9dad6e342027c3be512b4e0b40e810e0a6f1dc84a16847aa5aac74d97f7a347e60d42e770335a090f83e90a1614294f86552a84edc1faafc7093d3e32602f5de
diff --git a/app-emulation/qemu-guest-agent/files/qemu-ga-systemd.service b/app-emulation/qemu-guest-agent/files/qemu-ga-systemd.service
new file mode 100644
index 000000000000..51cd7b37ff79
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/files/qemu-ga-systemd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=QEMU Guest Agent
+BindTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device
+After=dev-virtio\x2dports-org.qemu.guest_agent.0.device
+
+[Service]
+ExecStart=-/usr/bin/qemu-ga
+Restart=always
+RestartSec=0
+
+[Install]
diff --git a/app-emulation/qemu-guest-agent/files/qemu-ga-systemd.udev b/app-emulation/qemu-guest-agent/files/qemu-ga-systemd.udev
new file mode 100644
index 000000000000..8a290abbd3e3
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/files/qemu-ga-systemd.udev
@@ -0,0 +1,2 @@
+SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0", \
+ TAG+="systemd" ENV{SYSTEMD_WANTS}="qemu-guest-agent.service"
diff --git a/app-emulation/qemu-guest-agent/files/qemu-ga.conf-r1 b/app-emulation/qemu-guest-agent/files/qemu-ga.conf-r1
new file mode 100644
index 000000000000..a1a78df3dea0
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/files/qemu-ga.conf-r1
@@ -0,0 +1,11 @@
+# Specifies the transport method used to communicate to QEMU on the host side
+# Default: virtio-serial
+#GA_METHOD="virtio-serial"
+
+# Specifies the device path for the communications back to QEMU on the host
+# Default: /dev/virtio-ports/org.qemu.guest_agent.0
+#GA_PATH="/dev/virtio-ports/org.qemu.guest_agent.0"
+
+# Additional options to qemu-guest-agent such as --fsfreeze-hook
+# See qemu-ga --help for more info
+#GA_OPTIONS="-F/etc/qemu/fsfreeze-hook"
diff --git a/app-emulation/qemu-guest-agent/files/qemu-ga.init-r1 b/app-emulation/qemu-guest-agent/files/qemu-ga.init-r1
new file mode 100644
index 000000000000..9ad147c5fdfa
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/files/qemu-ga.init-r1
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+start() {
+ GA_METHOD=${GA_METHOD:-virtio-serial}
+ GA_PATH=${GA_PATH:-/dev/virtio-ports/org.qemu.guest_agent.0}
+
+ ebegin "Starting QEMU Guest Agent"
+
+ start-stop-daemon --start --pidfile /run/qemu-ga.pid \
+ --exec /usr/bin/qemu-ga -- -m ${GA_METHOD} -p ${GA_PATH} \
+ -l /var/log/qemu-ga.log -d -f /run/qemu-ga.pid -t /run ${GA_OPTIONS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping QEMU Guest Agent"
+
+ start-stop-daemon --stop --pidfile /run/qemu-ga.pid
+
+ eend $?
+}
diff --git a/app-emulation/qemu-guest-agent/files/qemu-ga.logrotate b/app-emulation/qemu-guest-agent/files/qemu-ga.logrotate
new file mode 100644
index 000000000000..ffcc477d3358
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/files/qemu-ga.logrotate
@@ -0,0 +1,9 @@
+/var/log/qemu-ga.log {
+ weekly
+ missingok
+ rotate 4
+ compress
+ delaycompress
+ copytruncate
+ minsize 100k
+}
diff --git a/app-emulation/qemu-guest-agent/metadata.xml b/app-emulation/qemu-guest-agent/metadata.xml
new file mode 100644
index 000000000000..6645932c4865
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>qemu</herd>
+</pkgmetadata>
+
diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-1.5.2-r2.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-1.5.2-r2.ebuild
new file mode 100644
index 000000000000..395b435202b2
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/qemu-guest-agent-1.5.2-r2.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils systemd udev python-r1
+
+BACKPORTS=e26b4ba6
+MY_PN="qemu"
+MY_P="${MY_PN}-${PV}"
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
+HOMEPAGE="http://wiki.qemu.org/Features/QAPI/GuestAgent"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=dev-libs/glib-2.22
+ !<app-emulation/qemu-1.1.1-r1
+ !<sys-apps/sysvinit-2.88-r5"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ python_export_best
+}
+
+src_prepare() {
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ epatch_user
+}
+
+src_configure() {
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir=/usr/$(get_libdir) \
+ --localstatedir=/ \
+ --disable-bsd-user \
+ --disable-linux-user \
+ --disable-system \
+ --disable-strip \
+ --disable-werror \
+ --enable-guest-agent \
+ --python=${PYTHON}
+}
+
+src_compile() {
+ emake qemu-ga
+}
+
+src_install() {
+ dobin qemu-ga
+
+ # Normal init stuff
+ newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
+ newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent
+
+ # systemd stuff
+ udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules
+
+ systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \
+ qemu-guest-agent.service
+}
+
+pkg_postinst() {
+ elog "You should add 'qemu-guest-agent' to the default runlevel."
+ elog "e.g. rc-update add qemu-guest-agent default"
+}
diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-1.6.0-r1.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-1.6.0-r1.ebuild
new file mode 100644
index 000000000000..6ebaa089cb63
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/qemu-guest-agent-1.6.0-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils systemd udev python-r1
+
+BACKPORTS=49bdd50f
+MY_PN="qemu"
+MY_P="${MY_PN}-${PV}"
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
+HOMEPAGE="http://wiki.qemu.org/Features/QAPI/GuestAgent"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=dev-libs/glib-2.22
+ !<app-emulation/qemu-1.1.1-r1
+ !<sys-apps/sysvinit-2.88-r5"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ python_export_best
+}
+
+src_prepare() {
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ epatch_user
+}
+
+src_configure() {
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir=/usr/$(get_libdir) \
+ --localstatedir=/ \
+ --disable-bsd-user \
+ --disable-linux-user \
+ --disable-system \
+ --disable-strip \
+ --disable-werror \
+ --enable-guest-agent \
+ --python=${PYTHON}
+}
+
+src_compile() {
+ emake qemu-ga
+}
+
+src_install() {
+ dobin qemu-ga
+
+ # Normal init stuff
+ newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
+ newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent
+
+ # systemd stuff
+ udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules
+
+ systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \
+ qemu-guest-agent.service
+}
+
+pkg_postinst() {
+ elog "You should add 'qemu-guest-agent' to the default runlevel."
+ elog "e.g. rc-update add qemu-guest-agent default"
+}
diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-2.0.0.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.0.0.ebuild
new file mode 100644
index 000000000000..f70050b2ec0a
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.0.0.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils systemd udev python-r1
+
+BACKPORTS=
+MY_PN="qemu"
+MY_P="${MY_PN}-${PV}"
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+else
+ SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
+HOMEPAGE="http://wiki.qemu.org/Features/QAPI/GuestAgent"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=dev-libs/glib-2.22
+ !<app-emulation/qemu-1.1.1-r1
+ !<sys-apps/sysvinit-2.88-r5"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ epatch_user
+}
+
+src_configure() {
+ python_export_best
+
+ tc-export AR LD OBJCOPY
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir="/usr/$(get_libdir)" \
+ --localstatedir=/ \
+ --disable-bsd-user \
+ --disable-linux-user \
+ --disable-system \
+ --disable-strip \
+ --disable-werror \
+ --enable-guest-agent \
+ --python="${PYTHON}" \
+ --cc="$(tc-getCC)" \
+ --cxx="$(tc-getCXX)" \
+ --host-cc="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ emake V=1 qemu-ga
+}
+
+src_install() {
+ dobin qemu-ga
+
+ # Normal init stuff
+ newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
+ newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent
+
+ # systemd stuff
+ udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules
+
+ systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \
+ qemu-guest-agent.service
+}
+
+pkg_postinst() {
+ elog "You should add 'qemu-guest-agent' to the default runlevel."
+ elog "e.g. rc-update add qemu-guest-agent default"
+}
diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-2.1.2.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.1.2.ebuild
new file mode 100644
index 000000000000..4894d94835cf
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.1.2.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils systemd udev python-r1
+
+BACKPORTS=
+MY_PN="qemu"
+MY_P="${MY_PN}-${PV}"
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+else
+ SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="amd64 ppc ppc64 x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
+HOMEPAGE="http://wiki.qemu.org/Features/QAPI/GuestAgent"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=dev-libs/glib-2.22
+ !<app-emulation/qemu-1.1.1-r1
+ !<sys-apps/sysvinit-2.88-r5"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ epatch_user
+}
+
+src_configure() {
+ python_export_best
+
+ tc-export AR LD OBJCOPY
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir="/usr/$(get_libdir)" \
+ --localstatedir=/ \
+ --disable-bsd-user \
+ --disable-linux-user \
+ --disable-system \
+ --disable-strip \
+ --disable-werror \
+ --enable-guest-agent \
+ --python="${PYTHON}" \
+ --cc="$(tc-getCC)" \
+ --cxx="$(tc-getCXX)" \
+ --host-cc="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ emake V=1 qemu-ga
+}
+
+src_install() {
+ dobin qemu-ga
+
+ # Normal init stuff
+ newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
+ newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent
+
+ # systemd stuff
+ udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules
+
+ systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \
+ qemu-guest-agent.service
+}
+
+pkg_postinst() {
+ elog "You should add 'qemu-guest-agent' to the default runlevel."
+ elog "e.g. rc-update add qemu-guest-agent default"
+}
diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-2.2.0.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.2.0.ebuild
new file mode 100644
index 000000000000..d449da5038b4
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.2.0.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils systemd udev python-r1
+
+BACKPORTS=
+MY_PN="qemu"
+MY_P="${MY_PN}-${PV}"
+
+if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+else
+ SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
+HOMEPAGE="http://wiki.qemu.org/Features/QAPI/GuestAgent"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=dev-libs/glib-2.22
+ !<app-emulation/qemu-1.1.1-r1
+ !<sys-apps/sysvinit-2.88-r5"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ epatch_user
+}
+
+src_configure() {
+ python_export_best
+
+ tc-export AR LD OBJCOPY
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir="/usr/$(get_libdir)" \
+ --localstatedir=/ \
+ --disable-bsd-user \
+ --disable-linux-user \
+ --disable-system \
+ --disable-strip \
+ --disable-werror \
+ --enable-guest-agent \
+ --python="${PYTHON}" \
+ --cc="$(tc-getCC)" \
+ --cxx="$(tc-getCXX)" \
+ --host-cc="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ emake V=1 qemu-ga
+}
+
+src_install() {
+ dobin qemu-ga
+
+ # Normal init stuff
+ newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
+ newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent
+
+ # systemd stuff
+ udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules
+
+ systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \
+ qemu-guest-agent.service
+}
+
+pkg_postinst() {
+ elog "You should add 'qemu-guest-agent' to the default runlevel."
+ elog "e.g. rc-update add qemu-guest-agent default"
+}
diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-2.3.0.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.3.0.ebuild
new file mode 100644
index 000000000000..e244a7970f61
--- /dev/null
+++ b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.3.0.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils systemd udev python-r1
+
+MY_PN="qemu"
+MY_P="${MY_PN}-${PV}"
+
+if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+else
+ SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.bz2"
+ KEYWORDS="amd64 ~ppc ~ppc64 x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM"
+HOMEPAGE="http://wiki.qemu.org/Features/QAPI/GuestAgent"
+
+LICENSE="GPL-2 BSD-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=dev-libs/glib-2.22
+ !<app-emulation/qemu-1.1.1-r1
+ !<sys-apps/sysvinit-2.88-r5"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ python_setup
+
+ tc-export AR LD OBJCOPY
+
+ local myconf=(
+ --prefix=/usr
+ --sysconfdir=/etc
+ --libdir="/usr/$(get_libdir)"
+ --localstatedir=/
+ --disable-bsd-user
+ --disable-linux-user
+ --disable-system
+ --disable-strip
+ --disable-werror
+ --enable-guest-agent
+ --python="${PYTHON}"
+ --cc="$(tc-getCC)"
+ --cxx="$(tc-getCXX)"
+ --host-cc="$(tc-getBUILD_CC)"
+ )
+ echo "./configure ${myconf[*]}"
+ ./configure "${myconf[@]}" || die
+}
+
+src_compile() {
+ emake V=1 qemu-ga
+}
+
+src_install() {
+ dobin qemu-ga
+
+ # Normal init stuff
+ newinitd "${FILESDIR}/qemu-ga.init-r1" qemu-guest-agent
+ newconfd "${FILESDIR}/qemu-ga.conf-r1" qemu-guest-agent
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/qemu-ga.logrotate" qemu-guest-agent
+
+ # systemd stuff
+ udev_newrules "${FILESDIR}/qemu-ga-systemd.udev" 99-qemu-guest-agent.rules
+
+ systemd_newunit "${FILESDIR}/qemu-ga-systemd.service" \
+ qemu-guest-agent.service
+}
+
+pkg_postinst() {
+ elog "You should add 'qemu-guest-agent' to the default runlevel."
+ elog "e.g. rc-update add qemu-guest-agent default"
+}
diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest
new file mode 100644
index 000000000000..f36eb6020d44
--- /dev/null
+++ b/app-emulation/qemu/Manifest
@@ -0,0 +1 @@
+DIST qemu-2.3.0.tar.bz2 24683085 SHA256 b6bab7f763d5be73e7cb5ee7d4c8365b7a8df2972c52fa5ded18893bd8281588 SHA512 7a40d213c5696b27784abd2a3119e49d42c38c923be431826c73a8f14c19074435d7f1a652686c53baf08e81f5a3005b2ddc92d67c32f6a2b19659ab627e9eaa WHIRLPOOL 9dad6e342027c3be512b4e0b40e810e0a6f1dc84a16847aa5aac74d97f7a347e60d42e770335a090f83e90a1614294f86552a84edc1faafc7093d3e32602f5de
diff --git a/app-emulation/qemu/files/65-kvm.rules b/app-emulation/qemu/files/65-kvm.rules
new file mode 100644
index 000000000000..c2f7317aacca
--- /dev/null
+++ b/app-emulation/qemu/files/65-kvm.rules
@@ -0,0 +1 @@
+KERNEL=="kvm", GROUP="kvm", MODE="0660"
diff --git a/app-emulation/qemu/files/bridge.conf b/app-emulation/qemu/files/bridge.conf
new file mode 100644
index 000000000000..2bde37e2efc9
--- /dev/null
+++ b/app-emulation/qemu/files/bridge.conf
@@ -0,0 +1,14 @@
+# This should have the following permissions: root:qemu 0640
+
+# allow br0
+# Uncommenting the above would allow users in the 'qemu' group
+# to add devices to 'br0'
+
+# allow virbr0
+# Uncommenting the above would allow users in the 'qemu' group
+# to add devices to 'virbr0'
+
+# include /etc/qemu/bob.conf
+# Uncommenting the above would allow users in the 'bob' group
+# to have permissions defined in it, iff it has the following
+# permissions: root:bob 0640
diff --git a/app-emulation/qemu/files/qemu-1.7.0-cflags.patch b/app-emulation/qemu/files/qemu-1.7.0-cflags.patch
new file mode 100644
index 000000000000..cd003f6de023
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-1.7.0-cflags.patch
@@ -0,0 +1,11 @@
+--- a/configure
++++ b/configure
+@@ -3131,8 +3131,6 @@ fi
+ if test "$gcov" = "yes" ; then
+ CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+ LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+-elif test "$debug" = "no" ; then
+- CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+ fi
+
+
diff --git a/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-1.patch b/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-1.patch
new file mode 100644
index 000000000000..35ef8fdebf0a
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-1.patch
@@ -0,0 +1,241 @@
+From a2bebfd6e09d285aa793cae3fb0fc3a39a9fee6e Mon Sep 17 00:00:00 2001
+From: "Daniel P. Berrange" <berrange@redhat.com>
+Date: Mon, 23 Mar 2015 22:58:21 +0000
+Subject: [PATCH] CVE-2015-1779: incrementally decode websocket frames
+
+The logic for decoding websocket frames wants to fully
+decode the frame header and payload, before allowing the
+VNC server to see any of the payload data. There is no
+size limit on websocket payloads, so this allows a
+malicious network client to consume 2^64 bytes in memory
+in QEMU. It can trigger this denial of service before
+the VNC server even performs any authentication.
+
+The fix is to decode the header, and then incrementally
+decode the payload data as it is needed. With this fix
+the websocket decoder will allow at most 4k of data to
+be buffered before decoding and processing payload.
+
+Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
+
+[ kraxel: fix frequent spurious disconnects, suggested by Peter Maydell ]
+
+ @@ -361,7 +361,7 @@ int vncws_decode_frame_payload(Buffer *input,
+ - *payload_size = input->offset;
+ + *payload_size = *payload_remain;
+
+[ kraxel: fix 32bit build ]
+
+ @@ -306,7 +306,7 @@ struct VncState
+ - uint64_t ws_payload_remain;
+ + size_t ws_payload_remain;
+
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+ ui/vnc-ws.c | 105 ++++++++++++++++++++++++++++++++++++++++--------------------
+ ui/vnc-ws.h | 9 ++++--
+ ui/vnc.h | 2 ++
+ 3 files changed, 80 insertions(+), 36 deletions(-)
+
+diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
+index 85dbb7e..0b7de4e 100644
+--- a/ui/vnc-ws.c
++++ b/ui/vnc-ws.c
+@@ -107,7 +107,7 @@ long vnc_client_read_ws(VncState *vs)
+ {
+ int ret, err;
+ uint8_t *payload;
+- size_t payload_size, frame_size;
++ size_t payload_size, header_size;
+ VNC_DEBUG("Read websocket %p size %zd offset %zd\n", vs->ws_input.buffer,
+ vs->ws_input.capacity, vs->ws_input.offset);
+ buffer_reserve(&vs->ws_input, 4096);
+@@ -117,18 +117,39 @@ long vnc_client_read_ws(VncState *vs)
+ }
+ vs->ws_input.offset += ret;
+
+- /* make sure that nothing is left in the ws_input buffer */
++ ret = 0;
++ /* consume as much of ws_input buffer as possible */
+ do {
+- err = vncws_decode_frame(&vs->ws_input, &payload,
+- &payload_size, &frame_size);
+- if (err <= 0) {
+- return err;
++ if (vs->ws_payload_remain == 0) {
++ err = vncws_decode_frame_header(&vs->ws_input,
++ &header_size,
++ &vs->ws_payload_remain,
++ &vs->ws_payload_mask);
++ if (err <= 0) {
++ return err;
++ }
++
++ buffer_advance(&vs->ws_input, header_size);
+ }
++ if (vs->ws_payload_remain != 0) {
++ err = vncws_decode_frame_payload(&vs->ws_input,
++ &vs->ws_payload_remain,
++ &vs->ws_payload_mask,
++ &payload,
++ &payload_size);
++ if (err < 0) {
++ return err;
++ }
++ if (err == 0) {
++ return ret;
++ }
++ ret += err;
+
+- buffer_reserve(&vs->input, payload_size);
+- buffer_append(&vs->input, payload, payload_size);
++ buffer_reserve(&vs->input, payload_size);
++ buffer_append(&vs->input, payload, payload_size);
+
+- buffer_advance(&vs->ws_input, frame_size);
++ buffer_advance(&vs->ws_input, payload_size);
++ }
+ } while (vs->ws_input.offset > 0);
+
+ return ret;
+@@ -265,15 +286,14 @@ void vncws_encode_frame(Buffer *output, const void *payload,
+ buffer_append(output, payload, payload_size);
+ }
+
+-int vncws_decode_frame(Buffer *input, uint8_t **payload,
+- size_t *payload_size, size_t *frame_size)
++int vncws_decode_frame_header(Buffer *input,
++ size_t *header_size,
++ size_t *payload_remain,
++ WsMask *payload_mask)
+ {
+ unsigned char opcode = 0, fin = 0, has_mask = 0;
+- size_t header_size = 0;
+- uint32_t *payload32;
++ size_t payload_len;
+ WsHeader *header = (WsHeader *)input->buffer;
+- WsMask mask;
+- int i;
+
+ if (input->offset < WS_HEAD_MIN_LEN + 4) {
+ /* header not complete */
+@@ -283,7 +303,7 @@ int vncws_decode_frame(Buffer *input, uint8_t **payload,
+ fin = (header->b0 & 0x80) >> 7;
+ opcode = header->b0 & 0x0f;
+ has_mask = (header->b1 & 0x80) >> 7;
+- *payload_size = header->b1 & 0x7f;
++ payload_len = header->b1 & 0x7f;
+
+ if (opcode == WS_OPCODE_CLOSE) {
+ /* disconnect */
+@@ -300,40 +320,57 @@ int vncws_decode_frame(Buffer *input, uint8_t **payload,
+ return -2;
+ }
+
+- if (*payload_size < 126) {
+- header_size = 6;
+- mask = header->u.m;
+- } else if (*payload_size == 126 && input->offset >= 8) {
+- *payload_size = be16_to_cpu(header->u.s16.l16);
+- header_size = 8;
+- mask = header->u.s16.m16;
+- } else if (*payload_size == 127 && input->offset >= 14) {
+- *payload_size = be64_to_cpu(header->u.s64.l64);
+- header_size = 14;
+- mask = header->u.s64.m64;
++ if (payload_len < 126) {
++ *payload_remain = payload_len;
++ *header_size = 6;
++ *payload_mask = header->u.m;
++ } else if (payload_len == 126 && input->offset >= 8) {
++ *payload_remain = be16_to_cpu(header->u.s16.l16);
++ *header_size = 8;
++ *payload_mask = header->u.s16.m16;
++ } else if (payload_len == 127 && input->offset >= 14) {
++ *payload_remain = be64_to_cpu(header->u.s64.l64);
++ *header_size = 14;
++ *payload_mask = header->u.s64.m64;
+ } else {
+ /* header not complete */
+ return 0;
+ }
+
+- *frame_size = header_size + *payload_size;
++ return 1;
++}
++
++int vncws_decode_frame_payload(Buffer *input,
++ size_t *payload_remain, WsMask *payload_mask,
++ uint8_t **payload, size_t *payload_size)
++{
++ size_t i;
++ uint32_t *payload32;
+
+- if (input->offset < *frame_size) {
+- /* frame not complete */
++ *payload = input->buffer;
++ /* If we aren't at the end of the payload, then drop
++ * off the last bytes, so we're always multiple of 4
++ * for purpose of unmasking, except at end of payload
++ */
++ if (input->offset < *payload_remain) {
++ *payload_size = input->offset - (input->offset % 4);
++ } else {
++ *payload_size = *payload_remain;
++ }
++ if (*payload_size == 0) {
+ return 0;
+ }
+-
+- *payload = input->buffer + header_size;
++ *payload_remain -= *payload_size;
+
+ /* unmask frame */
+ /* process 1 frame (32 bit op) */
+ payload32 = (uint32_t *)(*payload);
+ for (i = 0; i < *payload_size / 4; i++) {
+- payload32[i] ^= mask.u;
++ payload32[i] ^= payload_mask->u;
+ }
+ /* process the remaining bytes (if any) */
+ for (i *= 4; i < *payload_size; i++) {
+- (*payload)[i] ^= mask.c[i % 4];
++ (*payload)[i] ^= payload_mask->c[i % 4];
+ }
+
+ return 1;
+diff --git a/ui/vnc-ws.h b/ui/vnc-ws.h
+index ef229b7..14d4230 100644
+--- a/ui/vnc-ws.h
++++ b/ui/vnc-ws.h
+@@ -83,7 +83,12 @@ long vnc_client_read_ws(VncState *vs);
+ void vncws_process_handshake(VncState *vs, uint8_t *line, size_t size);
+ void vncws_encode_frame(Buffer *output, const void *payload,
+ const size_t payload_size);
+-int vncws_decode_frame(Buffer *input, uint8_t **payload,
+- size_t *payload_size, size_t *frame_size);
++int vncws_decode_frame_header(Buffer *input,
++ size_t *header_size,
++ size_t *payload_remain,
++ WsMask *payload_mask);
++int vncws_decode_frame_payload(Buffer *input,
++ size_t *payload_remain, WsMask *payload_mask,
++ uint8_t **payload, size_t *payload_size);
+
+ #endif /* __QEMU_UI_VNC_WS_H */
+diff --git a/ui/vnc.h b/ui/vnc.h
+index e19ac39..3f7c6a9 100644
+--- a/ui/vnc.h
++++ b/ui/vnc.h
+@@ -306,6 +306,8 @@ struct VncState
+ #ifdef CONFIG_VNC_WS
+ Buffer ws_input;
+ Buffer ws_output;
++ size_t ws_payload_remain;
++ WsMask ws_payload_mask;
+ #endif
+ /* current output mode information */
+ VncWritePixels *write_pixels;
+--
+2.3.5
+
diff --git a/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-2.patch b/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-2.patch
new file mode 100644
index 000000000000..c7a8c8b3ec7f
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-2.patch
@@ -0,0 +1,58 @@
+From 2cdb5e142fb93e875fa53c52864ef5eb8d5d8b41 Mon Sep 17 00:00:00 2001
+From: "Daniel P. Berrange" <berrange@redhat.com>
+Date: Mon, 23 Mar 2015 22:58:22 +0000
+Subject: [PATCH] CVE-2015-1779: limit size of HTTP headers from websockets
+ clients
+
+The VNC server websockets decoder will read and buffer data from
+websockets clients until it sees the end of the HTTP headers,
+as indicated by \r\n\r\n. In theory this allows a malicious to
+trick QEMU into consuming an arbitrary amount of RAM. In practice,
+because QEMU runs g_strstr_len() across the buffered header data,
+it will spend increasingly long burning CPU time searching for
+the substring match and less & less time reading data. So while
+this does cause arbitrary memory growth, the bigger problem is
+that QEMU will be burning 100% of available CPU time.
+
+A novnc websockets client typically sends headers of around
+512 bytes in length. As such it is reasonable to place a 4096
+byte limit on the amount of data buffered while searching for
+the end of HTTP headers.
+
+Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+ ui/vnc-ws.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
+index 0b7de4e..62eb97f 100644
+--- a/ui/vnc-ws.c
++++ b/ui/vnc-ws.c
+@@ -81,8 +81,11 @@ void vncws_handshake_read(void *opaque)
+ VncState *vs = opaque;
+ uint8_t *handshake_end;
+ long ret;
+- buffer_reserve(&vs->ws_input, 4096);
+- ret = vnc_client_read_buf(vs, buffer_end(&vs->ws_input), 4096);
++ /* Typical HTTP headers from novnc are 512 bytes, so limiting
++ * total header size to 4096 is easily enough. */
++ size_t want = 4096 - vs->ws_input.offset;
++ buffer_reserve(&vs->ws_input, want);
++ ret = vnc_client_read_buf(vs, buffer_end(&vs->ws_input), want);
+
+ if (!ret) {
+ if (vs->csock == -1) {
+@@ -99,6 +102,9 @@ void vncws_handshake_read(void *opaque)
+ vncws_process_handshake(vs, vs->ws_input.buffer, vs->ws_input.offset);
+ buffer_advance(&vs->ws_input, handshake_end - vs->ws_input.buffer +
+ strlen(WS_HANDSHAKE_END));
++ } else if (vs->ws_input.offset >= 4096) {
++ VNC_DEBUG("End of headers not found in first 4096 bytes\n");
++ vnc_client_error(vs);
+ }
+ }
+
+--
+2.3.5
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3209.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3209.patch
new file mode 100644
index 000000000000..885db3b52eea
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3209.patch
@@ -0,0 +1,51 @@
+https://bugs.gentoo.org/551752
+
+From 9f7c594c006289ad41169b854d70f5da6e400a2a Mon Sep 17 00:00:00 2001
+From: Petr Matousek <pmatouse@redhat.com>
+Date: Sun, 24 May 2015 10:53:44 +0200
+Subject: [PATCH] pcnet: force the buffer access to be in bounds during tx
+
+4096 is the maximum length per TMD and it is also currently the size of
+the relay buffer pcnet driver uses for sending the packet data to QEMU
+for further processing. With packet spanning multiple TMDs it can
+happen that the overall packet size will be bigger than sizeof(buffer),
+which results in memory corruption.
+
+Fix this by only allowing to queue maximum sizeof(buffer) bytes.
+
+This is CVE-2015-3209.
+
+[Fixed 3-space indentation to QEMU's 4-space coding standard.
+--Stefan]
+
+Signed-off-by: Petr Matousek <pmatouse@redhat.com>
+Reported-by: Matt Tait <matttait@google.com>
+Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
+Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ hw/net/pcnet.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
+index bdfd38f..68b9981 100644
+--- a/hw/net/pcnet.c
++++ b/hw/net/pcnet.c
+@@ -1241,6 +1241,14 @@ static void pcnet_transmit(PCNetState *s)
+ }
+
+ bcnt = 4096 - GET_FIELD(tmd.length, TMDL, BCNT);
++
++ /* if multi-tmd packet outsizes s->buffer then skip it silently.
++ Note: this is not what real hw does */
++ if (s->xmit_pos + bcnt > sizeof(s->buffer)) {
++ s->xmit_pos = -1;
++ goto txdone;
++ }
++
+ s->phys_mem_read(s->dma_opaque, PHYSADDR(s, tmd.tbadr),
+ s->buffer + s->xmit_pos, bcnt, CSR_BSWP(s));
+ s->xmit_pos += bcnt;
+--
+2.2.0.rc0.207.ga3a616c
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3214.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3214.patch
new file mode 100644
index 000000000000..7fee8fdcac28
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3214.patch
@@ -0,0 +1,41 @@
+From: Petr Matousek <pmatouse@redhat.com>
+Date: Wed, 17 Jun 2015 10:46:11 +0000 (+0200)
+Subject: i8254: fix out-of-bounds memory access in pit_ioport_read()
+X-Git-Tag: v2.4.0-rc0~43^2~9
+X-Git-Url: http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h=d4862a87e31a51de9eb260f25c9e99a75efe3235;hp=9dacf32d2cbd66cbcce7944ebdfd6b2df20e33b8
+
+i8254: fix out-of-bounds memory access in pit_ioport_read()
+
+Due converting PIO to the new memory read/write api we no longer provide
+separate I/O region lenghts for read and write operations. As a result,
+reading from PIT Mode/Command register will end with accessing
+pit->channels with invalid index.
+
+Fix this by ignoring read from the Mode/Command register.
+
+This is CVE-2015-3214.
+
+Reported-by: Matt Tait <matttait@google.com>
+Fixes: 0505bcdec8228d8de39ab1a02644e71999e7c052
+Cc: qemu-stable@nongnu.org
+Signed-off-by: Petr Matousek <pmatouse@redhat.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+---
+
+diff --git a/hw/timer/i8254.c b/hw/timer/i8254.c
+index 3450c98..9b65a33 100644
+--- a/hw/timer/i8254.c
++++ b/hw/timer/i8254.c
+@@ -196,6 +196,12 @@ static uint64_t pit_ioport_read(void *opaque, hwaddr addr,
+ PITChannelState *s;
+
+ addr &= 3;
++
++ if (addr == 3) {
++ /* Mode/Command register is write only, read is ignored */
++ return 0;
++ }
++
+ s = &pit->channels[addr];
+ if (s->status_latched) {
+ s->status_latched = 0;
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3456.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3456.patch
new file mode 100644
index 000000000000..87697d08ef4d
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3456.patch
@@ -0,0 +1,86 @@
+https://bugs.gentoo.org/549404
+
+From e907746266721f305d67bc0718795fedee2e824c Mon Sep 17 00:00:00 2001
+From: Petr Matousek <pmatouse@redhat.com>
+Date: Wed, 6 May 2015 09:48:59 +0200
+Subject: [PATCH] fdc: force the fifo access to be in bounds of the allocated buffer
+
+During processing of certain commands such as FD_CMD_READ_ID and
+FD_CMD_DRIVE_SPECIFICATION_COMMAND the fifo memory access could
+get out of bounds leading to memory corruption with values coming
+from the guest.
+
+Fix this by making sure that the index is always bounded by the
+allocated memory.
+
+This is CVE-2015-3456.
+
+Signed-off-by: Petr Matousek <pmatouse@redhat.com>
+Reviewed-by: John Snow <jsnow@redhat.com>
+Signed-off-by: John Snow <jsnow@redhat.com>
+---
+ hw/block/fdc.c | 17 +++++++++++------
+ 1 files changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/hw/block/fdc.c b/hw/block/fdc.c
+index f72a392..d8a8edd 100644
+--- a/hw/block/fdc.c
++++ b/hw/block/fdc.c
+@@ -1497,7 +1497,7 @@ static uint32_t fdctrl_read_data(FDCtrl *fdctrl)
+ {
+ FDrive *cur_drv;
+ uint32_t retval = 0;
+- int pos;
++ uint32_t pos;
+
+ cur_drv = get_cur_drv(fdctrl);
+ fdctrl->dsr &= ~FD_DSR_PWRDOWN;
+@@ -1506,8 +1506,8 @@ static uint32_t fdctrl_read_data(FDCtrl *fdctrl)
+ return 0;
+ }
+ pos = fdctrl->data_pos;
++ pos %= FD_SECTOR_LEN;
+ if (fdctrl->msr & FD_MSR_NONDMA) {
+- pos %= FD_SECTOR_LEN;
+ if (pos == 0) {
+ if (fdctrl->data_pos != 0)
+ if (!fdctrl_seek_to_next_sect(fdctrl, cur_drv)) {
+@@ -1852,10 +1852,13 @@ static void fdctrl_handle_option(FDCtrl *fdctrl, int direction)
+ static void fdctrl_handle_drive_specification_command(FDCtrl *fdctrl, int direction)
+ {
+ FDrive *cur_drv = get_cur_drv(fdctrl);
++ uint32_t pos;
+
+- if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80) {
++ pos = fdctrl->data_pos - 1;
++ pos %= FD_SECTOR_LEN;
++ if (fdctrl->fifo[pos] & 0x80) {
+ /* Command parameters done */
+- if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x40) {
++ if (fdctrl->fifo[pos] & 0x40) {
+ fdctrl->fifo[0] = fdctrl->fifo[1];
+ fdctrl->fifo[2] = 0;
+ fdctrl->fifo[3] = 0;
+@@ -1955,7 +1958,7 @@ static uint8_t command_to_handler[256];
+ static void fdctrl_write_data(FDCtrl *fdctrl, uint32_t value)
+ {
+ FDrive *cur_drv;
+- int pos;
++ uint32_t pos;
+
+ /* Reset mode */
+ if (!(fdctrl->dor & FD_DOR_nRESET)) {
+@@ -2004,7 +2007,9 @@ static void fdctrl_write_data(FDCtrl *fdctrl, uint32_t value)
+ }
+
+ FLOPPY_DPRINTF("%s: %02x\n", __func__, value);
+- fdctrl->fifo[fdctrl->data_pos++] = value;
++ pos = fdctrl->data_pos++;
++ pos %= FD_SECTOR_LEN;
++ fdctrl->fifo[pos] = value;
+ if (fdctrl->data_pos == fdctrl->data_len) {
+ /* We now have all parameters
+ * and will be able to treat the command
+--
+1.7.0.4
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-1.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-1.patch
new file mode 100644
index 000000000000..759e403c5edd
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-1.patch
@@ -0,0 +1,75 @@
+From d2ff85854512574e7209f295e87b0835d5b032c6 Mon Sep 17 00:00:00 2001
+From: Kevin Wolf <kwolf@redhat.com>
+Date: Sun, 26 Jul 2015 23:42:53 -0400
+Subject: [PATCH] ide: Check array bounds before writing to io_buffer
+ (CVE-2015-5154)
+
+If the end_transfer_func of a command is called because enough data has
+been read or written for the current PIO transfer, and it fails to
+correctly call the command completion functions, the DRQ bit in the
+status register and s->end_transfer_func may remain set. This allows the
+guest to access further bytes in s->io_buffer beyond s->data_end, and
+eventually overflowing the io_buffer.
+
+One case where this currently happens is emulation of the ATAPI command
+START STOP UNIT.
+
+This patch fixes the problem by adding explicit array bounds checks
+before accessing the buffer instead of relying on end_transfer_func to
+function correctly.
+
+Cc: qemu-stable@nongnu.org
+Signed-off-by: Kevin Wolf <kwolf@redhat.com>
+Reviewed-by: John Snow <jsnow@redhat.com>
+---
+ hw/ide/core.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/hw/ide/core.c b/hw/ide/core.c
+index 122e955..44fcc23 100644
+--- a/hw/ide/core.c
++++ b/hw/ide/core.c
+@@ -2021,6 +2021,10 @@ void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
+ }
+
+ p = s->data_ptr;
++ if (p + 2 > s->data_end) {
++ return;
++ }
++
+ *(uint16_t *)p = le16_to_cpu(val);
+ p += 2;
+ s->data_ptr = p;
+@@ -2042,6 +2046,10 @@ uint32_t ide_data_readw(void *opaque, uint32_t addr)
+ }
+
+ p = s->data_ptr;
++ if (p + 2 > s->data_end) {
++ return 0;
++ }
++
+ ret = cpu_to_le16(*(uint16_t *)p);
+ p += 2;
+ s->data_ptr = p;
+@@ -2063,6 +2071,10 @@ void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
+ }
+
+ p = s->data_ptr;
++ if (p + 4 > s->data_end) {
++ return;
++ }
++
+ *(uint32_t *)p = le32_to_cpu(val);
+ p += 4;
+ s->data_ptr = p;
+@@ -2084,6 +2096,10 @@ uint32_t ide_data_readl(void *opaque, uint32_t addr)
+ }
+
+ p = s->data_ptr;
++ if (p + 4 > s->data_end) {
++ return 0;
++ }
++
+ ret = cpu_to_le32(*(uint32_t *)p);
+ p += 4;
+ s->data_ptr = p;
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-2.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-2.patch
new file mode 100644
index 000000000000..6d7902a5347f
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-2.patch
@@ -0,0 +1,26 @@
+From 03441c3a4a42beb25460dd11592539030337d0f8 Mon Sep 17 00:00:00 2001
+From: Kevin Wolf <kwolf@redhat.com>
+Date: Sun, 26 Jul 2015 23:42:53 -0400
+Subject: [PATCH] ide/atapi: Fix START STOP UNIT command completion
+
+The command must be completed on all code paths. START STOP UNIT with
+pwrcnd set should succeed without doing anything.
+
+Signed-off-by: Kevin Wolf <kwolf@redhat.com>
+Reviewed-by: John Snow <jsnow@redhat.com>
+---
+ hw/ide/atapi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
+index 950e311..79dd167 100644
+--- a/hw/ide/atapi.c
++++ b/hw/ide/atapi.c
+@@ -983,6 +983,7 @@ static void cmd_start_stop_unit(IDEState *s, uint8_t* buf)
+
+ if (pwrcnd) {
+ /* eject/load only happens for power condition == 0 */
++ ide_atapi_cmd_ok(s);
+ return;
+ }
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-3.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-3.patch
new file mode 100644
index 000000000000..f6f346f19747
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5154-3.patch
@@ -0,0 +1,69 @@
+From cb72cba83021fa42719e73a5249c12096a4d1cfc Mon Sep 17 00:00:00 2001
+From: Kevin Wolf <kwolf@redhat.com>
+Date: Sun, 26 Jul 2015 23:42:53 -0400
+Subject: [PATCH] ide: Clear DRQ after handling all expected accesses
+
+This is additional hardening against an end_transfer_func that fails to
+clear the DRQ status bit. The bit must be unset as soon as the PIO
+transfer has completed, so it's better to do this in a central place
+instead of duplicating the code in all commands (and forgetting it in
+some).
+
+Signed-off-by: Kevin Wolf <kwolf@redhat.com>
+Reviewed-by: John Snow <jsnow@redhat.com>
+---
+ hw/ide/core.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/hw/ide/core.c b/hw/ide/core.c
+index 44fcc23..50449ca 100644
+--- a/hw/ide/core.c
++++ b/hw/ide/core.c
+@@ -2028,8 +2028,10 @@ void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
+ *(uint16_t *)p = le16_to_cpu(val);
+ p += 2;
+ s->data_ptr = p;
+- if (p >= s->data_end)
++ if (p >= s->data_end) {
++ s->status &= ~DRQ_STAT;
+ s->end_transfer_func(s);
++ }
+ }
+
+ uint32_t ide_data_readw(void *opaque, uint32_t addr)
+@@ -2053,8 +2055,10 @@ uint32_t ide_data_readw(void *opaque, uint32_t addr)
+ ret = cpu_to_le16(*(uint16_t *)p);
+ p += 2;
+ s->data_ptr = p;
+- if (p >= s->data_end)
++ if (p >= s->data_end) {
++ s->status &= ~DRQ_STAT;
+ s->end_transfer_func(s);
++ }
+ return ret;
+ }
+
+@@ -2078,8 +2082,10 @@ void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
+ *(uint32_t *)p = le32_to_cpu(val);
+ p += 4;
+ s->data_ptr = p;
+- if (p >= s->data_end)
++ if (p >= s->data_end) {
++ s->status &= ~DRQ_STAT;
+ s->end_transfer_func(s);
++ }
+ }
+
+ uint32_t ide_data_readl(void *opaque, uint32_t addr)
+@@ -2103,8 +2109,10 @@ uint32_t ide_data_readl(void *opaque, uint32_t addr)
+ ret = cpu_to_le32(*(uint32_t *)p);
+ p += 4;
+ s->data_ptr = p;
+- if (p >= s->data_end)
++ if (p >= s->data_end) {
++ s->status &= ~DRQ_STAT;
+ s->end_transfer_func(s);
++ }
+ return ret;
+ }
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5158.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5158.patch
new file mode 100644
index 000000000000..9badc9b92878
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5158.patch
@@ -0,0 +1,40 @@
+commit c170aad8b057223b1139d72e5ce7acceafab4fa9
+Author: Paolo Bonzini <pbonzini@redhat.com>
+Date: Tue Jul 21 08:59:39 2015 +0200
+
+ scsi: fix buffer overflow in scsi_req_parse_cdb (CVE-2015-5158)
+
+ This is a guest-triggerable buffer overflow present in QEMU 2.2.0
+ and newer. scsi_cdb_length returns -1 as an error value, but the
+ caller does not check it.
+
+ Luckily, the massive overflow means that QEMU will just SIGSEGV,
+ making the impact much smaller.
+
+ Reported-by: Zhu Donghai (朱东海) <donghai.zdh@alibaba-inc.com>
+ Fixes: 1894df02811f6b79ea3ffbf1084599d96f316173
+ Reviewed-by: Fam Zheng <famz@redhat.com>
+ Cc: qemu-stable@nongnu.org
+ Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+
+diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
+index f50b2f0..f0ae462 100644
+--- a/hw/scsi/scsi-bus.c
++++ b/hw/scsi/scsi-bus.c
+@@ -1239,10 +1239,15 @@ int scsi_cdb_length(uint8_t *buf) {
+ int scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf)
+ {
+ int rc;
++ int len;
+
+ cmd->lba = -1;
+- cmd->len = scsi_cdb_length(buf);
++ len = scsi_cdb_length(buf);
++ if (len < 0) {
++ return -1;
++ }
+
++ cmd->len = len;
+ switch (dev->type) {
+ case TYPE_TAPE:
+ rc = scsi_req_stream_xfer(cmd, dev, buf);
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-1.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-1.patch
new file mode 100644
index 000000000000..043d1893579c
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-1.patch
@@ -0,0 +1,82 @@
+From 5e0c290415b9d57077a86e70c8e6a058868334d3 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Wed, 15 Jul 2015 18:16:58 +0100
+Subject: [PATCH 1/7] rtl8139: avoid nested ifs in IP header parsing
+
+Transmit offload needs to parse packet headers. If header fields have
+unexpected values the offload processing is skipped.
+
+The code currently uses nested ifs because there is relatively little
+input validation. The next patches will add missing input validation
+and a goto label is more appropriate to avoid deep if statement nesting.
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ hw/net/rtl8139.c | 41 ++++++++++++++++++++++-------------------
+ 1 file changed, 22 insertions(+), 19 deletions(-)
+
+diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
+index 5f0197c..91ba33b 100644
+--- a/hw/net/rtl8139.c
++++ b/hw/net/rtl8139.c
+@@ -2174,28 +2174,30 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+ size_t eth_payload_len = 0;
+
+ int proto = be16_to_cpu(*(uint16_t *)(saved_buffer + 12));
+- if (proto == ETH_P_IP)
++ if (proto != ETH_P_IP)
+ {
+- DPRINTF("+++ C+ mode has IP packet\n");
+-
+- /* not aligned */
+- eth_payload_data = saved_buffer + ETH_HLEN;
+- eth_payload_len = saved_size - ETH_HLEN;
+-
+- ip = (ip_header*)eth_payload_data;
+-
+- if (IP_HEADER_VERSION(ip) != IP_HEADER_VERSION_4) {
+- DPRINTF("+++ C+ mode packet has bad IP version %d "
+- "expected %d\n", IP_HEADER_VERSION(ip),
+- IP_HEADER_VERSION_4);
+- ip = NULL;
+- } else {
+- hlen = IP_HEADER_LENGTH(ip);
+- ip_protocol = ip->ip_p;
+- ip_data_len = be16_to_cpu(ip->ip_len) - hlen;
+- }
++ goto skip_offload;
+ }
+
++ DPRINTF("+++ C+ mode has IP packet\n");
++
++ /* not aligned */
++ eth_payload_data = saved_buffer + ETH_HLEN;
++ eth_payload_len = saved_size - ETH_HLEN;
++
++ ip = (ip_header*)eth_payload_data;
++
++ if (IP_HEADER_VERSION(ip) != IP_HEADER_VERSION_4) {
++ DPRINTF("+++ C+ mode packet has bad IP version %d "
++ "expected %d\n", IP_HEADER_VERSION(ip),
++ IP_HEADER_VERSION_4);
++ goto skip_offload;
++ }
++
++ hlen = IP_HEADER_LENGTH(ip);
++ ip_protocol = ip->ip_p;
++ ip_data_len = be16_to_cpu(ip->ip_len) - hlen;
++
+ if (ip)
+ {
+ if (txdw0 & CP_TX_IPCS)
+@@ -2391,6 +2393,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+ }
+ }
+
++skip_offload:
+ /* update tally counter */
+ ++s->tally_counters.TxOk;
+
+--
+2.1.4
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-2.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-2.patch
new file mode 100644
index 000000000000..7a76a8a40d25
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-2.patch
@@ -0,0 +1,373 @@
+From 2d7d80e8dc160904fa7276cc05da26c062a50066 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Wed, 15 Jul 2015 18:16:59 +0100
+Subject: [PATCH 2/7] rtl8139: drop tautologous if (ip) {...} statement
+
+The previous patch stopped using the ip pointer as an indicator that the
+IP header is present. When we reach the if (ip) {...} statement we know
+ip is always non-NULL.
+
+Remove the if statement to reduce nesting.
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ hw/net/rtl8139.c | 305 +++++++++++++++++++++++++++----------------------------
+ 1 file changed, 151 insertions(+), 154 deletions(-)
+
+diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
+index 91ba33b..2f12d42 100644
+--- a/hw/net/rtl8139.c
++++ b/hw/net/rtl8139.c
+@@ -2198,198 +2198,195 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+ ip_protocol = ip->ip_p;
+ ip_data_len = be16_to_cpu(ip->ip_len) - hlen;
+
+- if (ip)
++ if (txdw0 & CP_TX_IPCS)
+ {
+- if (txdw0 & CP_TX_IPCS)
+- {
+- DPRINTF("+++ C+ mode need IP checksum\n");
++ DPRINTF("+++ C+ mode need IP checksum\n");
+
+- if (hlen<sizeof(ip_header) || hlen>eth_payload_len) {/* min header length */
+- /* bad packet header len */
+- /* or packet too short */
+- }
+- else
+- {
+- ip->ip_sum = 0;
+- ip->ip_sum = ip_checksum(ip, hlen);
+- DPRINTF("+++ C+ mode IP header len=%d checksum=%04x\n",
+- hlen, ip->ip_sum);
+- }
++ if (hlen<sizeof(ip_header) || hlen>eth_payload_len) {/* min header length */
++ /* bad packet header len */
++ /* or packet too short */
+ }
+-
+- if ((txdw0 & CP_TX_LGSEN) && ip_protocol == IP_PROTO_TCP)
++ else
+ {
+- int large_send_mss = (txdw0 >> 16) & CP_TC_LGSEN_MSS_MASK;
++ ip->ip_sum = 0;
++ ip->ip_sum = ip_checksum(ip, hlen);
++ DPRINTF("+++ C+ mode IP header len=%d checksum=%04x\n",
++ hlen, ip->ip_sum);
++ }
++ }
+
+- DPRINTF("+++ C+ mode offloaded task TSO MTU=%d IP data %d "
+- "frame data %d specified MSS=%d\n", ETH_MTU,
+- ip_data_len, saved_size - ETH_HLEN, large_send_mss);
++ if ((txdw0 & CP_TX_LGSEN) && ip_protocol == IP_PROTO_TCP)
++ {
++ int large_send_mss = (txdw0 >> 16) & CP_TC_LGSEN_MSS_MASK;
+
+- int tcp_send_offset = 0;
+- int send_count = 0;
++ DPRINTF("+++ C+ mode offloaded task TSO MTU=%d IP data %d "
++ "frame data %d specified MSS=%d\n", ETH_MTU,
++ ip_data_len, saved_size - ETH_HLEN, large_send_mss);
+
+- /* maximum IP header length is 60 bytes */
+- uint8_t saved_ip_header[60];
++ int tcp_send_offset = 0;
++ int send_count = 0;
+
+- /* save IP header template; data area is used in tcp checksum calculation */
+- memcpy(saved_ip_header, eth_payload_data, hlen);
++ /* maximum IP header length is 60 bytes */
++ uint8_t saved_ip_header[60];
+
+- /* a placeholder for checksum calculation routine in tcp case */
+- uint8_t *data_to_checksum = eth_payload_data + hlen - 12;
+- // size_t data_to_checksum_len = eth_payload_len - hlen + 12;
++ /* save IP header template; data area is used in tcp checksum calculation */
++ memcpy(saved_ip_header, eth_payload_data, hlen);
+
+- /* pointer to TCP header */
+- tcp_header *p_tcp_hdr = (tcp_header*)(eth_payload_data + hlen);
++ /* a placeholder for checksum calculation routine in tcp case */
++ uint8_t *data_to_checksum = eth_payload_data + hlen - 12;
++ // size_t data_to_checksum_len = eth_payload_len - hlen + 12;
+
+- int tcp_hlen = TCP_HEADER_DATA_OFFSET(p_tcp_hdr);
++ /* pointer to TCP header */
++ tcp_header *p_tcp_hdr = (tcp_header*)(eth_payload_data + hlen);
+
+- /* ETH_MTU = ip header len + tcp header len + payload */
+- int tcp_data_len = ip_data_len - tcp_hlen;
+- int tcp_chunk_size = ETH_MTU - hlen - tcp_hlen;
++ int tcp_hlen = TCP_HEADER_DATA_OFFSET(p_tcp_hdr);
+
+- DPRINTF("+++ C+ mode TSO IP data len %d TCP hlen %d TCP "
+- "data len %d TCP chunk size %d\n", ip_data_len,
+- tcp_hlen, tcp_data_len, tcp_chunk_size);
++ /* ETH_MTU = ip header len + tcp header len + payload */
++ int tcp_data_len = ip_data_len - tcp_hlen;
++ int tcp_chunk_size = ETH_MTU - hlen - tcp_hlen;
+
+- /* note the cycle below overwrites IP header data,
+- but restores it from saved_ip_header before sending packet */
++ DPRINTF("+++ C+ mode TSO IP data len %d TCP hlen %d TCP "
++ "data len %d TCP chunk size %d\n", ip_data_len,
++ tcp_hlen, tcp_data_len, tcp_chunk_size);
+
+- int is_last_frame = 0;
++ /* note the cycle below overwrites IP header data,
++ but restores it from saved_ip_header before sending packet */
+
+- for (tcp_send_offset = 0; tcp_send_offset < tcp_data_len; tcp_send_offset += tcp_chunk_size)
+- {
+- uint16_t chunk_size = tcp_chunk_size;
+-
+- /* check if this is the last frame */
+- if (tcp_send_offset + tcp_chunk_size >= tcp_data_len)
+- {
+- is_last_frame = 1;
+- chunk_size = tcp_data_len - tcp_send_offset;
+- }
+-
+- DPRINTF("+++ C+ mode TSO TCP seqno %08x\n",
+- be32_to_cpu(p_tcp_hdr->th_seq));
+-
+- /* add 4 TCP pseudoheader fields */
+- /* copy IP source and destination fields */
+- memcpy(data_to_checksum, saved_ip_header + 12, 8);
+-
+- DPRINTF("+++ C+ mode TSO calculating TCP checksum for "
+- "packet with %d bytes data\n", tcp_hlen +
+- chunk_size);
+-
+- if (tcp_send_offset)
+- {
+- memcpy((uint8_t*)p_tcp_hdr + tcp_hlen, (uint8_t*)p_tcp_hdr + tcp_hlen + tcp_send_offset, chunk_size);
+- }
+-
+- /* keep PUSH and FIN flags only for the last frame */
+- if (!is_last_frame)
+- {
+- TCP_HEADER_CLEAR_FLAGS(p_tcp_hdr, TCP_FLAG_PUSH|TCP_FLAG_FIN);
+- }
+-
+- /* recalculate TCP checksum */
+- ip_pseudo_header *p_tcpip_hdr = (ip_pseudo_header *)data_to_checksum;
+- p_tcpip_hdr->zeros = 0;
+- p_tcpip_hdr->ip_proto = IP_PROTO_TCP;
+- p_tcpip_hdr->ip_payload = cpu_to_be16(tcp_hlen + chunk_size);
+-
+- p_tcp_hdr->th_sum = 0;
+-
+- int tcp_checksum = ip_checksum(data_to_checksum, tcp_hlen + chunk_size + 12);
+- DPRINTF("+++ C+ mode TSO TCP checksum %04x\n",
+- tcp_checksum);
+-
+- p_tcp_hdr->th_sum = tcp_checksum;
+-
+- /* restore IP header */
+- memcpy(eth_payload_data, saved_ip_header, hlen);
+-
+- /* set IP data length and recalculate IP checksum */
+- ip->ip_len = cpu_to_be16(hlen + tcp_hlen + chunk_size);
+-
+- /* increment IP id for subsequent frames */
+- ip->ip_id = cpu_to_be16(tcp_send_offset/tcp_chunk_size + be16_to_cpu(ip->ip_id));
+-
+- ip->ip_sum = 0;
+- ip->ip_sum = ip_checksum(eth_payload_data, hlen);
+- DPRINTF("+++ C+ mode TSO IP header len=%d "
+- "checksum=%04x\n", hlen, ip->ip_sum);
+-
+- int tso_send_size = ETH_HLEN + hlen + tcp_hlen + chunk_size;
+- DPRINTF("+++ C+ mode TSO transferring packet size "
+- "%d\n", tso_send_size);
+- rtl8139_transfer_frame(s, saved_buffer, tso_send_size,
+- 0, (uint8_t *) dot1q_buffer);
+-
+- /* add transferred count to TCP sequence number */
+- p_tcp_hdr->th_seq = cpu_to_be32(chunk_size + be32_to_cpu(p_tcp_hdr->th_seq));
+- ++send_count;
+- }
++ int is_last_frame = 0;
+
+- /* Stop sending this frame */
+- saved_size = 0;
+- }
+- else if (txdw0 & (CP_TX_TCPCS|CP_TX_UDPCS))
++ for (tcp_send_offset = 0; tcp_send_offset < tcp_data_len; tcp_send_offset += tcp_chunk_size)
+ {
+- DPRINTF("+++ C+ mode need TCP or UDP checksum\n");
++ uint16_t chunk_size = tcp_chunk_size;
+
+- /* maximum IP header length is 60 bytes */
+- uint8_t saved_ip_header[60];
+- memcpy(saved_ip_header, eth_payload_data, hlen);
++ /* check if this is the last frame */
++ if (tcp_send_offset + tcp_chunk_size >= tcp_data_len)
++ {
++ is_last_frame = 1;
++ chunk_size = tcp_data_len - tcp_send_offset;
++ }
+
+- uint8_t *data_to_checksum = eth_payload_data + hlen - 12;
+- // size_t data_to_checksum_len = eth_payload_len - hlen + 12;
++ DPRINTF("+++ C+ mode TSO TCP seqno %08x\n",
++ be32_to_cpu(p_tcp_hdr->th_seq));
+
+ /* add 4 TCP pseudoheader fields */
+ /* copy IP source and destination fields */
+ memcpy(data_to_checksum, saved_ip_header + 12, 8);
+
+- if ((txdw0 & CP_TX_TCPCS) && ip_protocol == IP_PROTO_TCP)
++ DPRINTF("+++ C+ mode TSO calculating TCP checksum for "
++ "packet with %d bytes data\n", tcp_hlen +
++ chunk_size);
++
++ if (tcp_send_offset)
+ {
+- DPRINTF("+++ C+ mode calculating TCP checksum for "
+- "packet with %d bytes data\n", ip_data_len);
++ memcpy((uint8_t*)p_tcp_hdr + tcp_hlen, (uint8_t*)p_tcp_hdr + tcp_hlen + tcp_send_offset, chunk_size);
++ }
+
+- ip_pseudo_header *p_tcpip_hdr = (ip_pseudo_header *)data_to_checksum;
+- p_tcpip_hdr->zeros = 0;
+- p_tcpip_hdr->ip_proto = IP_PROTO_TCP;
+- p_tcpip_hdr->ip_payload = cpu_to_be16(ip_data_len);
++ /* keep PUSH and FIN flags only for the last frame */
++ if (!is_last_frame)
++ {
++ TCP_HEADER_CLEAR_FLAGS(p_tcp_hdr, TCP_FLAG_PUSH|TCP_FLAG_FIN);
++ }
+
+- tcp_header* p_tcp_hdr = (tcp_header *) (data_to_checksum+12);
++ /* recalculate TCP checksum */
++ ip_pseudo_header *p_tcpip_hdr = (ip_pseudo_header *)data_to_checksum;
++ p_tcpip_hdr->zeros = 0;
++ p_tcpip_hdr->ip_proto = IP_PROTO_TCP;
++ p_tcpip_hdr->ip_payload = cpu_to_be16(tcp_hlen + chunk_size);
+
+- p_tcp_hdr->th_sum = 0;
++ p_tcp_hdr->th_sum = 0;
+
+- int tcp_checksum = ip_checksum(data_to_checksum, ip_data_len + 12);
+- DPRINTF("+++ C+ mode TCP checksum %04x\n",
+- tcp_checksum);
++ int tcp_checksum = ip_checksum(data_to_checksum, tcp_hlen + chunk_size + 12);
++ DPRINTF("+++ C+ mode TSO TCP checksum %04x\n",
++ tcp_checksum);
+
+- p_tcp_hdr->th_sum = tcp_checksum;
+- }
+- else if ((txdw0 & CP_TX_UDPCS) && ip_protocol == IP_PROTO_UDP)
+- {
+- DPRINTF("+++ C+ mode calculating UDP checksum for "
+- "packet with %d bytes data\n", ip_data_len);
++ p_tcp_hdr->th_sum = tcp_checksum;
+
+- ip_pseudo_header *p_udpip_hdr = (ip_pseudo_header *)data_to_checksum;
+- p_udpip_hdr->zeros = 0;
+- p_udpip_hdr->ip_proto = IP_PROTO_UDP;
+- p_udpip_hdr->ip_payload = cpu_to_be16(ip_data_len);
++ /* restore IP header */
++ memcpy(eth_payload_data, saved_ip_header, hlen);
+
+- udp_header *p_udp_hdr = (udp_header *) (data_to_checksum+12);
++ /* set IP data length and recalculate IP checksum */
++ ip->ip_len = cpu_to_be16(hlen + tcp_hlen + chunk_size);
+
+- p_udp_hdr->uh_sum = 0;
++ /* increment IP id for subsequent frames */
++ ip->ip_id = cpu_to_be16(tcp_send_offset/tcp_chunk_size + be16_to_cpu(ip->ip_id));
+
+- int udp_checksum = ip_checksum(data_to_checksum, ip_data_len + 12);
+- DPRINTF("+++ C+ mode UDP checksum %04x\n",
+- udp_checksum);
++ ip->ip_sum = 0;
++ ip->ip_sum = ip_checksum(eth_payload_data, hlen);
++ DPRINTF("+++ C+ mode TSO IP header len=%d "
++ "checksum=%04x\n", hlen, ip->ip_sum);
+
+- p_udp_hdr->uh_sum = udp_checksum;
+- }
++ int tso_send_size = ETH_HLEN + hlen + tcp_hlen + chunk_size;
++ DPRINTF("+++ C+ mode TSO transferring packet size "
++ "%d\n", tso_send_size);
++ rtl8139_transfer_frame(s, saved_buffer, tso_send_size,
++ 0, (uint8_t *) dot1q_buffer);
+
+- /* restore IP header */
+- memcpy(eth_payload_data, saved_ip_header, hlen);
++ /* add transferred count to TCP sequence number */
++ p_tcp_hdr->th_seq = cpu_to_be32(chunk_size + be32_to_cpu(p_tcp_hdr->th_seq));
++ ++send_count;
+ }
++
++ /* Stop sending this frame */
++ saved_size = 0;
++ }
++ else if (txdw0 & (CP_TX_TCPCS|CP_TX_UDPCS))
++ {
++ DPRINTF("+++ C+ mode need TCP or UDP checksum\n");
++
++ /* maximum IP header length is 60 bytes */
++ uint8_t saved_ip_header[60];
++ memcpy(saved_ip_header, eth_payload_data, hlen);
++
++ uint8_t *data_to_checksum = eth_payload_data + hlen - 12;
++ // size_t data_to_checksum_len = eth_payload_len - hlen + 12;
++
++ /* add 4 TCP pseudoheader fields */
++ /* copy IP source and destination fields */
++ memcpy(data_to_checksum, saved_ip_header + 12, 8);
++
++ if ((txdw0 & CP_TX_TCPCS) && ip_protocol == IP_PROTO_TCP)
++ {
++ DPRINTF("+++ C+ mode calculating TCP checksum for "
++ "packet with %d bytes data\n", ip_data_len);
++
++ ip_pseudo_header *p_tcpip_hdr = (ip_pseudo_header *)data_to_checksum;
++ p_tcpip_hdr->zeros = 0;
++ p_tcpip_hdr->ip_proto = IP_PROTO_TCP;
++ p_tcpip_hdr->ip_payload = cpu_to_be16(ip_data_len);
++
++ tcp_header* p_tcp_hdr = (tcp_header *) (data_to_checksum+12);
++
++ p_tcp_hdr->th_sum = 0;
++
++ int tcp_checksum = ip_checksum(data_to_checksum, ip_data_len + 12);
++ DPRINTF("+++ C+ mode TCP checksum %04x\n",
++ tcp_checksum);
++
++ p_tcp_hdr->th_sum = tcp_checksum;
++ }
++ else if ((txdw0 & CP_TX_UDPCS) && ip_protocol == IP_PROTO_UDP)
++ {
++ DPRINTF("+++ C+ mode calculating UDP checksum for "
++ "packet with %d bytes data\n", ip_data_len);
++
++ ip_pseudo_header *p_udpip_hdr = (ip_pseudo_header *)data_to_checksum;
++ p_udpip_hdr->zeros = 0;
++ p_udpip_hdr->ip_proto = IP_PROTO_UDP;
++ p_udpip_hdr->ip_payload = cpu_to_be16(ip_data_len);
++
++ udp_header *p_udp_hdr = (udp_header *) (data_to_checksum+12);
++
++ p_udp_hdr->uh_sum = 0;
++
++ int udp_checksum = ip_checksum(data_to_checksum, ip_data_len + 12);
++ DPRINTF("+++ C+ mode UDP checksum %04x\n",
++ udp_checksum);
++
++ p_udp_hdr->uh_sum = udp_checksum;
++ }
++
++ /* restore IP header */
++ memcpy(eth_payload_data, saved_ip_header, hlen);
+ }
+ }
+
+--
+2.1.4
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-3.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-3.patch
new file mode 100644
index 000000000000..5676f4653284
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-3.patch
@@ -0,0 +1,39 @@
+From 043d28507ef7c5fdc34866f5e3b27a72bd0cd072 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Wed, 15 Jul 2015 18:17:00 +0100
+Subject: [PATCH 3/7] rtl8139: skip offload on short Ethernet/IP header
+
+Transmit offload features access Ethernet and IP headers the packet. If
+the packet is too short we must not attempt to access header fields:
+
+ int proto = be16_to_cpu(*(uint16_t *)(saved_buffer + 12));
+ ...
+ eth_payload_data = saved_buffer + ETH_HLEN;
+ ...
+ ip = (ip_header*)eth_payload_data;
+ if (IP_HEADER_VERSION(ip) != IP_HEADER_VERSION_4) {
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ hw/net/rtl8139.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
+index 2f12d42..d377b6b 100644
+--- a/hw/net/rtl8139.c
++++ b/hw/net/rtl8139.c
+@@ -2164,6 +2164,11 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+ {
+ DPRINTF("+++ C+ mode offloaded task checksum\n");
+
++ /* Large enough for Ethernet and IP headers? */
++ if (saved_size < ETH_HLEN + sizeof(ip_header)) {
++ goto skip_offload;
++ }
++
+ /* ip packet header */
+ ip_header *ip = NULL;
+ int hlen = 0;
+--
+2.1.4
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-4.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-4.patch
new file mode 100644
index 000000000000..495d8d616b26
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-4.patch
@@ -0,0 +1,53 @@
+From 5a75d242fe019d05b46ef9bc330a6892525c84a7 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Wed, 15 Jul 2015 18:17:01 +0100
+Subject: [PATCH 4/7] rtl8139: check IP Header Length field
+
+The IP Header Length field was only checked in the IP checksum case, but
+is used in other cases too.
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ hw/net/rtl8139.c | 19 ++++++++-----------
+ 1 file changed, 8 insertions(+), 11 deletions(-)
+
+diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
+index d377b6b..cd5ac05 100644
+--- a/hw/net/rtl8139.c
++++ b/hw/net/rtl8139.c
+@@ -2200,6 +2200,10 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+ }
+
+ hlen = IP_HEADER_LENGTH(ip);
++ if (hlen < sizeof(ip_header) || hlen > eth_payload_len) {
++ goto skip_offload;
++ }
++
+ ip_protocol = ip->ip_p;
+ ip_data_len = be16_to_cpu(ip->ip_len) - hlen;
+
+@@ -2207,17 +2211,10 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+ {
+ DPRINTF("+++ C+ mode need IP checksum\n");
+
+- if (hlen<sizeof(ip_header) || hlen>eth_payload_len) {/* min header length */
+- /* bad packet header len */
+- /* or packet too short */
+- }
+- else
+- {
+- ip->ip_sum = 0;
+- ip->ip_sum = ip_checksum(ip, hlen);
+- DPRINTF("+++ C+ mode IP header len=%d checksum=%04x\n",
+- hlen, ip->ip_sum);
+- }
++ ip->ip_sum = 0;
++ ip->ip_sum = ip_checksum(ip, hlen);
++ DPRINTF("+++ C+ mode IP header len=%d checksum=%04x\n",
++ hlen, ip->ip_sum);
+ }
+
+ if ((txdw0 & CP_TX_LGSEN) && ip_protocol == IP_PROTO_TCP)
+--
+2.1.4
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-5.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-5.patch
new file mode 100644
index 000000000000..e633ea6b2e0b
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-5.patch
@@ -0,0 +1,34 @@
+From 6c79ea275d72bc1fd88bdcf1e7d231b2c9c865de Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Wed, 15 Jul 2015 18:17:02 +0100
+Subject: [PATCH 5/7] rtl8139: check IP Total Length field
+
+The IP Total Length field includes the IP header and data. Make sure it
+is valid and does not exceed the Ethernet payload size.
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ hw/net/rtl8139.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
+index cd5ac05..ed2b23b 100644
+--- a/hw/net/rtl8139.c
++++ b/hw/net/rtl8139.c
+@@ -2205,7 +2205,12 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+ }
+
+ ip_protocol = ip->ip_p;
+- ip_data_len = be16_to_cpu(ip->ip_len) - hlen;
++
++ ip_data_len = be16_to_cpu(ip->ip_len);
++ if (ip_data_len < hlen || ip_data_len > eth_payload_len) {
++ goto skip_offload;
++ }
++ ip_data_len -= hlen;
+
+ if (txdw0 & CP_TX_IPCS)
+ {
+--
+2.1.4
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-6.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-6.patch
new file mode 100644
index 000000000000..dd716a6d6dc7
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-6.patch
@@ -0,0 +1,35 @@
+From 30aa7be430e7c982e9163f3bcc745d3aa57b6aa4 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Wed, 15 Jul 2015 18:17:03 +0100
+Subject: [PATCH 6/7] rtl8139: skip offload on short TCP header
+
+TCP Large Segment Offload accesses the TCP header in the packet. If the
+packet is too short we must not attempt to access header fields:
+
+ tcp_header *p_tcp_hdr = (tcp_header*)(eth_payload_data + hlen);
+ int tcp_hlen = TCP_HEADER_DATA_OFFSET(p_tcp_hdr);
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ hw/net/rtl8139.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
+index ed2b23b..c8f0df9 100644
+--- a/hw/net/rtl8139.c
++++ b/hw/net/rtl8139.c
+@@ -2224,6 +2224,11 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+
+ if ((txdw0 & CP_TX_LGSEN) && ip_protocol == IP_PROTO_TCP)
+ {
++ /* Large enough for the TCP header? */
++ if (ip_data_len < sizeof(tcp_header)) {
++ goto skip_offload;
++ }
++
+ int large_send_mss = (txdw0 >> 16) & CP_TC_LGSEN_MSS_MASK;
+
+ DPRINTF("+++ C+ mode offloaded task TSO MTU=%d IP data %d "
+--
+2.1.4
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-7.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-7.patch
new file mode 100644
index 000000000000..4c0ad7993545
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5165-7.patch
@@ -0,0 +1,32 @@
+From 9a084807bf6ca7c16d997a236d304111894a6539 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Wed, 15 Jul 2015 18:17:04 +0100
+Subject: [PATCH 7/7] rtl8139: check TCP Data Offset field
+
+The TCP Data Offset field contains the length of the header. Make sure
+it is valid and does not exceed the IP data length.
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+---
+ hw/net/rtl8139.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
+index c8f0df9..2df4a51 100644
+--- a/hw/net/rtl8139.c
++++ b/hw/net/rtl8139.c
+@@ -2253,6 +2253,11 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
+
+ int tcp_hlen = TCP_HEADER_DATA_OFFSET(p_tcp_hdr);
+
++ /* Invalid TCP data offset? */
++ if (tcp_hlen < sizeof(tcp_header) || tcp_hlen > ip_data_len) {
++ goto skip_offload;
++ }
++
+ /* ETH_MTU = ip header len + tcp header len + payload */
+ int tcp_data_len = ip_data_len - tcp_hlen;
+ int tcp_chunk_size = ETH_MTU - hlen - tcp_hlen;
+--
+2.1.4
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5166.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5166.patch
new file mode 100644
index 000000000000..fc41d7b6a99c
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-5166.patch
@@ -0,0 +1,36 @@
+From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+
+Fix release_drive on unplugged devices (pci_piix3_xen_ide_unplug)
+
+pci_piix3_xen_ide_unplug should completely unhook the unplugged
+IDEDevice from the corresponding BlockBackend, otherwise the next call
+to release_drive will try to detach the drive again.
+
+Suggested-by: Kevin Wolf <kwolf@redhat.com>
+Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+
+diff --git a/hw/ide/piix.c b/hw/ide/piix.c
+index adb6649..5a26c86 100644
+--- a/hw/ide/piix.c
++++ b/hw/ide/piix.c
+@@ -169,6 +169,7 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev)
+ PCIIDEState *pci_ide;
+ DriveInfo *di;
+ int i;
++ IDEDevice *idedev;
+
+ pci_ide = PCI_IDE(dev);
+
+@@ -181,6 +182,12 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev)
+ blk_detach_dev(blk, ds);
+ }
+ pci_ide->bus[di->bus].ifs[di->unit].blk = NULL;
++ if (!(i % 2)) {
++ idedev = pci_ide->bus[di->bus].master;
++ } else {
++ idedev = pci_ide->bus[di->bus].slave;
++ }
++ idedev->conf.blk = NULL;
+ blk_unref(blk);
+ }
+ }
diff --git a/app-emulation/qemu/files/qemu-binfmt.initd-r1 b/app-emulation/qemu/files/qemu-binfmt.initd-r1
new file mode 100644
index 000000000000..3e518a998f17
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-binfmt.initd-r1
@@ -0,0 +1,139 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel
+
+# Defaulting to OC should be safe because it comes down to:
+# - do we trust the interp itself to not be malicious? yes; we built it.
+# - do we trust the programs we're running? ish; same permission as native
+# binaries apply. so if user can do bad stuff natively, cross isn't worse.
+: ${QEMU_BINFMT_FLAGS:=OC}
+
+depend() {
+ after procfs
+}
+
+start() {
+ ebegin "Registering qemu-user binaries (flags: ${QEMU_BINFMT_FLAGS})"
+
+ if [ ! -d /proc/sys/fs/binfmt_misc ] ; then
+ modprobe -q binfmt_misc
+ fi
+
+ if [ ! -d /proc/sys/fs/binfmt_misc ] ; then
+ eend $? "You need support for 'misc binaries' in your kernel!" || return
+ fi
+
+ if [ ! -f /proc/sys/fs/binfmt_misc/register ] ; then
+ mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc >/dev/null 2>&1
+ eend $? || return
+ fi
+
+ # probe cpu type
+ cpu=`uname -m`
+ case "$cpu" in
+ i386|i486|i586|i686|i86pc|BePC|x86_64)
+ cpu="i386"
+ ;;
+ m68k)
+ cpu="m68k"
+ ;;
+ mips*)
+ cpu="mips"
+ ;;
+ "Power Macintosh"|ppc|ppc64)
+ cpu="ppc"
+ ;;
+ armv[4-9]*)
+ cpu="arm"
+ ;;
+ sparc*)
+ cpu="sparc"
+ ;;
+ esac
+
+ # register the interpreter for each cpu except for the native one
+ if [ $cpu != "i386" -a -x "/usr/bin/qemu-i386" ] ; then
+ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "alpha" -a -x "/usr/bin/qemu-alpha" ] ; then
+ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "arm" -a -x "/usr/bin/qemu-arm" ] ; then
+ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "arm" -a -x "/usr/bin/qemu-armeb" ] ; then
+ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "aarch64" -a -x "/usr/bin/qemu-aarch64" ] ; then
+ echo ':aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sparc" -a -x "/usr/bin/qemu-sparc" ] ; then
+ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "ppc" -a -x "/usr/bin/qemu-ppc" ] ; then
+ echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "m68k" -a -x "/usr/bin/qemu-m68k" ] ; then
+ #echo 'Please check cpu value and header information for m68k!'
+ echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips" ] ; then
+ # FIXME: We could use the other endianness on a MIPS host.
+ echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsel" ] ; then
+ echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32" ] ; then
+ echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32el" ] ; then
+ echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64" ] ; then
+ echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64el" ] ; then
+ echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4" ] ; then
+ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4eb" ] ; then
+ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "s390x" -a -x "/usr/bin/qemu-s390x" ] ; then
+ echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x:'"${QEMU_BINFMT_FLAGS}" > /proc/sys/fs/binfmt_misc/register
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Unregistering qemu-user binaries"
+ local arches
+
+ arches="${arches} i386 i486"
+ arches="${arches} alpha"
+ arches="${arches} arm armeb"
+ arches="${arches} aarch64"
+ arches="${arches} sparc"
+ arches="${arches} ppc"
+ arches="${arches} m68k"
+ arches="${arches} mips mipsel mipsn32 mipsn32el mips64 mips64el"
+ arches="${arches} sh4 sh4eb"
+ arches="${arches} s390x"
+
+ for a in ${arches}; do
+ if [ -f /proc/sys/fs/binfmt_misc/$a ] ; then
+ echo '-1' > /proc/sys/fs/binfmt_misc/$a
+ fi
+ done
+
+ eend $?
+}
+
+# vim: ts=4 :
diff --git a/app-emulation/qemu/metadata.xml b/app-emulation/qemu/metadata.xml
new file mode 100644
index 000000000000..c287e3d0b514
--- /dev/null
+++ b/app-emulation/qemu/metadata.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>qemu</herd>
+<use>
+ <flag name='accessibility'>Adds support for braille displays using brltty</flag>
+ <flag name='aio'>Enables support for Linux's Async IO</flag>
+ <flag name='alsa'>Enable alsa output for sound emulation</flag>
+ <flag name='curl'>Support ISOs / -cdrom directives vis HTTP or HTTPS.</flag>
+ <flag name='fdt'>Enables firmware device tree support</flag>
+ <flag name='glusterfs'>Enables GlusterFS cluster fileystem via
+ <pkg>sys-cluster/glusterfs</pkg></flag>
+ <flag name='gtk2'>Use gtk-2 instead of gtk-3</flag>
+ <flag name='iscsi'>Enable direct iSCSI support via
+ <pkg>net-libs/libiscsi</pkg> instead of indirectly via the Linux
+ block layer that <pkg>sys-block/open-iscsi</pkg> does.</flag>
+ <flag name='ncurses'>Enable the ncurses-based console</flag>
+ <flag name='nfs'>Enable NFS support</flag>
+ <flag name='numa'>Enable NUMA support</flag>
+ <flag name='pin-upstream-blobs'>Pin the versions of BIOS firmware to the version included in the upstream release.
+ This is needed to sanely support migration/suspend/resume/snapshotting/etc... of instances.
+ When the blobs are different, random corruption/bugs/crashes/etc... may be observed.</flag>
+ <flag name='pulseaudio'>Enable pulseaudio output for sound emulation</flag>
+ <flag name='rbd'>Enable rados block device backend support, see http://ceph.newdream.net/wiki/QEMU-RBD</flag>
+ <flag name='sdl'>Enable the SDL-based console</flag>
+ <flag name='sdl2'>Use libsdl2 instead of libsdl</flag>
+ <flag name='spice'>Enable Spice protocol support via <pkg>app-emulation/spice</pkg></flag>
+ <flag name='ssh'>Enable SSH based block device support via <pkg>net-libs/libssh2</pkg></flag>
+ <flag name='static-softmmu'>Builds the Software MMU (system) targets as static binaries</flag>
+ <flag name='static-user'>Build the User targets as static binaries</flag>
+ <flag name='static'>Enables both 'static-softmmu' and 'static-user'</flag>
+ <flag name='snappy'>Enable support for snappy compression</flag>
+ <flag name='systemtap'>Enable SystemTAP/DTrace tracing</flag>
+ <flag name='tci'>Enable the TCG Interpreter which can speed up or slowdown workloads depending on the host and guest CPUs being emulated. In the future it will be a runtime option but for now its compile time.</flag>
+ <flag name='tls'>Enable TLS support for the VNC console server.
+ For 1.4 and newer this also enables WebSocket support.
+ For 2.0 through 2.3 also enables disk quorum support.</flag>
+ <flag name='jpeg'>Enable jpeg image support for the VNC console server</flag>
+ <flag name='png'>Enable png image support for the VNC console server</flag>
+ <flag name='usb'>Enable USB passthrough via <pkg>dev-libs/libusb</pkg></flag>
+ <flag name="usbredir">Use <pkg>sys-apps/usbredir</pkg> to redirect USB devices to another machine over TCP</flag>
+ <flag name='uuid'>Enable UUID support in the vdi block driver</flag>
+ <flag name='vde'>Enable VDE-based networking</flag>
+ <flag name='vhost-net'>Enable accelerated networking using vhost-net, see http://www.linux-kvm.org/page/VhostNet</flag>
+ <flag name='virtfs'>Enable VirtFS via virtio-9p-pci / fsdev. See http://wiki.qemu.org/Documentation/9psetup</flag>
+ <flag name='vte'>Enable terminal support (<pkg>x11-libs/vte</pkg>) in the GTK+ interface</flag>
+ <flag name='xattr'>Add support for getting and setting POSIX extended attributes, through
+ <pkg>sys-apps/attr</pkg>. Requisite for the virtfs backend.
+ </flag>
+ <flag name='xen'>Enables support for Xen backends</flag>
+ <flag name='xfs'>Support xfsctl() notification and syncing for XFS backed
+ virtual disks.</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/qemu/qemu-2.3.0-r4.ebuild b/app-emulation/qemu/qemu-2.3.0-r4.ebuild
new file mode 100644
index 000000000000..c97b274df5a5
--- /dev/null
+++ b/app-emulation/qemu/qemu-2.3.0-r4.ebuild
@@ -0,0 +1,607 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ncurses,readline"
+
+inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
+ user udev fcaps readme.gentoo pax-utils
+
+BACKPORTS=
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+ SRC_URI=""
+else
+ SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="amd64 ~ppc ~ppc64 x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
+HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
+
+LICENSE="GPL-2 LGPL-2 BSD-2"
+SLOT="0"
+IUSE="accessibility +aio alsa bluetooth +caps +curl debug +fdt glusterfs \
+gtk gtk2 infiniband iscsi +jpeg \
+kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
++png pulseaudio python \
+rbd sasl +seccomp sdl selinux smartcard snappy spice ssh static static-softmmu \
+static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \
+virtfs +vnc xattr xen xfs"
+
+COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
+mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32
+x86_64"
+IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb"
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus"
+
+use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
+use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
+IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
+
+# Require at least one softmmu or user target.
+# Block USE flag configurations known to not work.
+REQUIRED_USE="|| ( ${use_softmmu_targets} ${use_user_targets} )
+ ${PYTHON_REQUIRED_USE}
+ gtk2? ( gtk )
+ qemu_softmmu_targets_arm? ( fdt )
+ qemu_softmmu_targets_microblaze? ( fdt )
+ qemu_softmmu_targets_ppc? ( fdt )
+ qemu_softmmu_targets_ppc64? ( fdt )
+ static? ( static-softmmu static-user )
+ static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 )
+ virtfs? ( xattr )"
+
+# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
+#
+# The attr lib isn't always linked in (although the USE flag is always
+# respected). This is because qemu supports using the C library's API
+# when available rather than always using the extranl library.
+COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ xattr? ( sys-apps/attr[static-libs(+)] )"
+SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
+ >=x11-libs/pixman-0.28.0[static-libs(+)]
+ aio? ( dev-libs/libaio[static-libs(+)] )
+ caps? ( sys-libs/libcap-ng[static-libs(+)] )
+ curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
+ fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
+ infiniband? ( sys-infiniband/librdmacm:=[static-libs(+)] )
+ jpeg? ( virtual/jpeg:=[static-libs(+)] )
+ lzo? ( dev-libs/lzo:2[static-libs(+)] )
+ ncurses? ( sys-libs/ncurses[static-libs(+)] )
+ nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] )
+ numa? ( sys-process/numactl[static-libs(+)] )
+ png? ( media-libs/libpng:0=[static-libs(+)] )
+ rbd? ( sys-cluster/ceph[static-libs(+)] )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
+ sdl? ( >=media-libs/libsdl-1.2.11[static-libs(+)] )
+ seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
+ snappy? ( app-arch/snappy[static-libs(+)] )
+ spice? ( >=app-emulation/spice-0.12.0[static-libs(+)] )
+ ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
+ tls? ( net-libs/gnutls[static-libs(+)] )
+ usb? ( >=dev-libs/libusb-1.0.18[static-libs(+)] )
+ uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] )
+ vde? ( net-misc/vde[static-libs(+)] )
+ xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
+USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
+X86_FIRMWARE_DEPEND="
+ >=sys-firmware/ipxe-1.0.0_p20130624
+ pin-upstream-blobs? (
+ ~sys-firmware/seabios-1.7.5
+ ~sys-firmware/sgabios-0.1_pre8
+ ~sys-firmware/vgabios-0.7a
+ )
+ !pin-upstream-blobs? (
+ sys-firmware/seabios
+ sys-firmware/sgabios
+ sys-firmware/vgabios
+ )"
+CDEPEND="
+ !static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) " ${use_softmmu_targets}) )
+ !static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) " ${use_user_targets}) )
+ qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
+ qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
+ accessibility? ( app-accessibility/brltty )
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ bluetooth? ( net-wireless/bluez )
+ gtk? (
+ gtk2? ( x11-libs/gtk+:2 )
+ !gtk2? ( x11-libs/gtk+:3 )
+ x11-libs/vte:2.90
+ )
+ iscsi? ( net-libs/libiscsi )
+ opengl? ( virtual/opengl )
+ pulseaudio? ( media-sound/pulseaudio )
+ python? ( ${PYTHON_DEPS} )
+ sdl? ( media-libs/libsdl[X] )
+ smartcard? ( dev-libs/nss !app-emulation/libcacard )
+ spice? ( >=app-emulation/spice-protocol-0.12.3 )
+ systemtap? ( dev-util/systemtap )
+ usbredir? ( >=sys-apps/usbredir-0.6 )
+ virtfs? ( sys-libs/libcap )
+ xen? ( app-emulation/xen-tools )"
+DEPEND="${CDEPEND}
+ dev-lang/perl
+ =dev-lang/python-2*
+ sys-apps/texinfo
+ virtual/pkgconfig
+ kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
+ gtk? ( nls? ( sys-devel/gettext ) )
+ static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND} ) " ${use_softmmu_targets}) )
+ static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND} ) " ${use_user_targets}) )
+ test? (
+ dev-libs/glib[utils]
+ sys-devel/bc
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-qemu )
+"
+
+STRIP_MASK="/usr/share/qemu/palcode-clipper"
+
+QA_PREBUILT="
+ usr/share/qemu/openbios-ppc
+ usr/share/qemu/openbios-sparc64
+ usr/share/qemu/openbios-sparc32
+ usr/share/qemu/palcode-clipper
+ usr/share/qemu/s390-ccw.img
+ usr/share/qemu/u-boot.e500
+"
+
+QA_WX_LOAD="usr/bin/qemu-i386
+ usr/bin/qemu-x86_64
+ usr/bin/qemu-alpha
+ usr/bin/qemu-arm
+ usr/bin/qemu-cris
+ usr/bin/qemu-m68k
+ usr/bin/qemu-microblaze
+ usr/bin/qemu-microblazeel
+ usr/bin/qemu-mips
+ usr/bin/qemu-mipsel
+ usr/bin/qemu-or32
+ usr/bin/qemu-ppc
+ usr/bin/qemu-ppc64
+ usr/bin/qemu-ppc64abi32
+ usr/bin/qemu-sh4
+ usr/bin/qemu-sh4eb
+ usr/bin/qemu-sparc
+ usr/bin/qemu-sparc64
+ usr/bin/qemu-armeb
+ usr/bin/qemu-sparc32plus
+ usr/bin/qemu-s390x
+ usr/bin/qemu-unicore32"
+
+DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure
+you have the kernel module loaded before running kvm. The easiest way to
+ensure that the kernel module is loaded is to load it on boot.\n
+For AMD CPUs the module is called 'kvm-amd'\n
+For Intel CPUs the module is called 'kvm-intel'\n
+Please review /etc/conf.d/modules for how to load these\n\n
+Make sure your user is in the 'kvm' group\n
+Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
+
+qemu_support_kvm() {
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \
+ use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \
+ use qemu_softmmu_targets_s390x; then
+ return 0
+ fi
+
+ return 1
+}
+
+pkg_pretend() {
+ if use kernel_linux && kernel_is lt 2 6 25; then
+ eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
+ elif use kernel_linux; then
+ if ! linux_config_exists; then
+ eerror "Unable to check your kernel for KVM support"
+ else
+ CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
+ ERROR_KVM="You must enable KVM in your kernel to continue"
+ ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
+ ERROR_KVM_AMD+=" your kernel configuration."
+ ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
+ ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
+ ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
+ ERROR_TUN+=" into your kernel or loaded as a module to use the"
+ ERROR_TUN+=" virtual network device if using -net tap."
+ ERROR_BRIDGE="You will also need support for 802.1d"
+ ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
+ use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
+ ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
+ ERROR_VHOST_NET+=" support"
+
+ if use amd64 || use x86 || use amd64-linux || use x86-linux; then
+ CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
+ fi
+
+ use python && CONFIG_CHECK+=" ~DEBUG_FS"
+ ERROR_DEBUG_FS="debugFS support required for kvm_stat"
+
+ # Now do the actual checks setup above
+ check_extra_config
+ fi
+ fi
+
+ if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
+ eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
+ eerror "instances are still pointing to it. Please update your"
+ eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
+ eerror "and the right system binary (e.g. qemu-system-x86_64)."
+ die "update your virt configs to not use qemu-kvm"
+ fi
+}
+
+pkg_setup() {
+ enewgroup kvm 78
+}
+
+src_prepare() {
+ # Alter target makefiles to accept CFLAGS set via flag-o
+ sed -i -r \
+ -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+ Makefile Makefile.target || die
+
+ # Cheap hack to disable gettext .mo generation.
+ use nls || rm -f po/*.po
+
+ epatch "${FILESDIR}"/qemu-1.7.0-cflags.patch
+ epatch "${FILESDIR}"/${P}-CVE-2015-3456.patch #549404
+ epatch "${FILESDIR}"/${P}-CVE-2015-3209.patch #551752
+ epatch "${FILESDIR}"/${P}-CVE-2015-5158.patch #555680
+ epatch "${FILESDIR}"/${P}-CVE-2015-3214.patch #556052
+ epatch "${FILESDIR}"/${P}-CVE-2015-5154-1.patch #556050 / #555532
+ epatch "${FILESDIR}"/${P}-CVE-2015-5154-2.patch #556050 / #555532
+ epatch "${FILESDIR}"/${P}-CVE-2015-5154-3.patch #556050 / #555532`
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ # Fix ld and objcopy being called directly
+ tc-export AR LD OBJCOPY
+
+ # Verbose builds
+ MAKEOPTS+=" V=1"
+
+ epatch_user
+}
+
+##
+# configures qemu based on the build directory and the build type
+# we are using.
+#
+qemu_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local buildtype=$1
+ local builddir=$2
+ local static_flag="static-${buildtype}"
+
+ # audio options
+ local audio_opts="oss"
+ use alsa && audio_opts="alsa,${audio_opts}"
+ use sdl && audio_opts="sdl,${audio_opts}"
+ use pulseaudio && audio_opts="pa,${audio_opts}"
+
+ local conf_opts=(
+ --prefix=/usr
+ --sysconfdir=/etc
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}/html
+ --disable-bsd-user
+ --disable-guest-agent
+ --disable-strip
+ --disable-werror
+ --python="${PYTHON}"
+ --cc="$(tc-getCC)"
+ --cxx="$(tc-getCXX)"
+ --host-cc="$(tc-getBUILD_CC)"
+ $(use_enable debug debug-info)
+ $(use_enable debug debug-tcg)
+ --enable-docs
+ $(use_enable tci tcg-interpreter)
+ $(use_enable xattr attr)
+ )
+
+ # Disable options not used by user targets as the default configure
+ # options will autoprobe and try to link in a bunch of unused junk.
+ conf_softmmu() {
+ if [[ ${buildtype} == "user" ]] ; then
+ echo "--disable-${2:-$1}"
+ else
+ use_enable "$@"
+ fi
+ }
+ conf_opts+=(
+ $(conf_softmmu accessibility brlapi)
+ $(conf_softmmu aio linux-aio)
+ $(conf_softmmu bluetooth bluez)
+ $(conf_softmmu caps cap-ng)
+ $(conf_softmmu curl)
+ $(conf_softmmu fdt)
+ $(conf_softmmu glusterfs)
+ $(conf_softmmu gtk)
+ $(conf_softmmu infiniband rdma)
+ $(conf_softmmu iscsi libiscsi)
+ $(conf_softmmu jpeg vnc-jpeg)
+ $(conf_softmmu kernel_linux kvm)
+ $(conf_softmmu lzo)
+ $(conf_softmmu ncurses curses)
+ $(conf_softmmu nfs libnfs)
+ $(conf_softmmu numa)
+ $(conf_softmmu opengl)
+ $(conf_softmmu png vnc-png)
+ $(conf_softmmu rbd)
+ $(conf_softmmu sasl vnc-sasl)
+ $(conf_softmmu sdl)
+ $(conf_softmmu seccomp)
+ $(conf_softmmu smartcard smartcard-nss)
+ $(conf_softmmu snappy)
+ $(conf_softmmu spice)
+ $(conf_softmmu ssh libssh2)
+ $(conf_softmmu tls quorum)
+ $(conf_softmmu tls vnc-tls)
+ $(conf_softmmu tls vnc-ws)
+ $(conf_softmmu usb libusb)
+ $(conf_softmmu usbredir usb-redir)
+ $(conf_softmmu uuid)
+ $(conf_softmmu vde)
+ $(conf_softmmu vhost-net)
+ $(conf_softmmu virtfs)
+ $(conf_softmmu vnc)
+ $(conf_softmmu xen)
+ $(conf_softmmu xen xen-pci-passthrough)
+ $(conf_softmmu xfs xfsctl)
+ )
+
+ case ${buildtype} in
+ user)
+ conf_opts+=(
+ --enable-linux-user
+ --disable-system
+ --target-list="${user_targets}"
+ --disable-blobs
+ --disable-tools
+ )
+ ;;
+ softmmu)
+ conf_opts+=(
+ --disable-linux-user
+ --enable-system
+ --target-list="${softmmu_targets}"
+ --with-system-pixman
+ --audio-drv-list="${audio_opts}"
+ )
+ use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) )
+ ;;
+ esac
+
+ # Add support for SystemTAP
+ use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
+
+ # We always want to attempt to build with PIE support as it results
+ # in a more secure binary. But it doesn't work with static or if
+ # the current GCC doesn't have PIE support.
+ if use ${static_flag}; then
+ conf_opts+=( --static --disable-pie )
+ else
+ gcc-specs-pie && conf_opts+=( --enable-pie )
+ fi
+
+ einfo "../configure ${conf_opts[*]}"
+ cd "${builddir}"
+ ../configure "${conf_opts[@]}" || die "configure failed"
+
+ # FreeBSD's kernel does not support QEMU assigning/grabbing
+ # host USB devices yet
+ use kernel_FreeBSD && \
+ sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
+}
+
+src_configure() {
+ local target
+
+ python_setup
+
+ softmmu_targets= softmmu_bins=()
+ user_targets= user_bins=()
+
+ for target in ${IUSE_SOFTMMU_TARGETS} ; do
+ if use "qemu_softmmu_targets_${target}"; then
+ softmmu_targets+=",${target}-softmmu"
+ softmmu_bins+=( "qemu-system-${target}" )
+ fi
+ done
+
+ for target in ${IUSE_USER_TARGETS} ; do
+ if use "qemu_user_targets_${target}"; then
+ user_targets+=",${target}-linux-user"
+ user_bins+=( "qemu-${target}" )
+ fi
+ done
+
+ [[ -n ${softmmu_targets} ]] && \
+ einfo "Building the following softmmu targets: ${softmmu_targets}"
+
+ [[ -n ${user_targets} ]] && \
+ einfo "Building the following user targets: ${user_targets}"
+
+ if [[ -n ${softmmu_targets} ]]; then
+ mkdir "${S}/softmmu-build"
+ qemu_src_configure "softmmu" "${S}/softmmu-build"
+ fi
+
+ if [[ -n ${user_targets} ]]; then
+ mkdir "${S}/user-build"
+ qemu_src_configure "user" "${S}/user-build"
+ fi
+}
+
+src_compile() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ default
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ default
+ fi
+}
+
+src_test() {
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ pax-mark m */qemu-system-* #515550
+ emake -j1 check
+ emake -j1 check-report.html
+ fi
+}
+
+qemu_python_install() {
+ python_domodule "${S}/scripts/qmp/qmp.py"
+
+ python_doscript "${S}/scripts/kvm/kvm_stat"
+ python_doscript "${S}/scripts/kvm/vmxcap"
+ python_doscript "${S}/scripts/qmp/qmp-shell"
+ python_doscript "${S}/scripts/qmp/qemu-ga-client"
+}
+
+src_install() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ emake DESTDIR="${ED}" install
+
+ # Install binfmt handler init script for user targets
+ newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ emake DESTDIR="${ED}" install
+
+ # This might not exist if the test failed. #512010
+ [[ -e check-report.html ]] && dohtml check-report.html
+
+ if use kernel_linux; then
+ udev_dorules "${FILESDIR}"/65-kvm.rules
+ fi
+
+ if use python; then
+ python_foreach_impl qemu_python_install
+ fi
+ fi
+
+ # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
+ pushd "${ED}"/usr/bin >/dev/null
+ pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}"
+ popd >/dev/null
+
+ # Install config file example for qemu-bridge-helper
+ insinto "/etc/qemu"
+ doins "${FILESDIR}/bridge.conf"
+
+ # Remove the docdir placed qmp-commands.txt
+ mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/qmp/"
+
+ cd "${S}"
+ dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
+ newdoc pc-bios/README README.pc-bios
+ dodoc docs/qmp/*.txt
+
+ # Remove SeaBIOS since we're using the SeaBIOS packaged one
+ rm "${ED}/usr/share/qemu/bios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
+ fi
+
+ # Remove vgabios since we're using the vgabios packaged one
+ if [[ -n ${softmmu_targets} ]]; then
+ rm "${ED}/usr/share/qemu/vgabios.bin"
+ rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
+ rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
+ rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
+ rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
+ dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
+ dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
+ dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
+ dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
+ fi
+
+ # Remove sgabios since we're using the sgabios packaged one
+ rm "${ED}/usr/share/qemu/sgabios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
+ fi
+
+ # Remove iPXE since we're using the iPXE packaged one
+ rm "${ED}"/usr/share/qemu/pxe-*.rom
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
+ dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
+ dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
+ dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
+ dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
+ dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
+ fi
+ fi
+
+ qemu_support_kvm && readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ if qemu_support_kvm; then
+ readme.gentoo_print_elog
+ ewarn "Migration from qemu-kvm instances and loading qemu-kvm created"
+ ewarn "save states has been removed starting with the 1.6.2 release"
+ ewarn
+ ewarn "It is recommended that you migrate any VMs that may be running"
+ ewarn "on qemu-kvm to a host with a newer qemu and regenerate"
+ ewarn "any saved states with a newer qemu."
+ ewarn
+ ewarn "qemu-kvm was the primary qemu provider in Gentoo through 1.2.x"
+
+ if use x86 || use amd64; then
+ ewarn
+ ewarn "The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer"
+ ewarn "installed. In order to use kvm acceleration, pass the flag"
+ ewarn "-enable-kvm when running your system target."
+ fi
+ fi
+
+ if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
+ udev_reload
+ fi
+
+ fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
+ if use virtfs && [ -n "${softmmu_targets}" ]; then
+ local virtfs_caps="cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_setgid,cap_mknod,cap_setuid"
+ fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper
+ fi
+}
+
+pkg_info() {
+ echo "Using:"
+ echo " $(best_version app-emulation/spice-protocol)"
+ echo " $(best_version sys-firmware/ipxe)"
+ echo " $(best_version sys-firmware/seabios)"
+ if has_version sys-firmware/seabios[binary]; then
+ echo " USE=binary"
+ else
+ echo " USE=''"
+ fi
+ echo " $(best_version sys-firmware/vgabios)"
+}
diff --git a/app-emulation/qemu/qemu-2.3.0-r5.ebuild b/app-emulation/qemu/qemu-2.3.0-r5.ebuild
new file mode 100644
index 000000000000..2d57b0ee746e
--- /dev/null
+++ b/app-emulation/qemu/qemu-2.3.0-r5.ebuild
@@ -0,0 +1,615 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ncurses,readline"
+
+inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
+ user udev fcaps readme.gentoo pax-utils
+
+BACKPORTS=
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+ SRC_URI=""
+else
+ SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="amd64 ~ppc ~ppc64 x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
+HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
+
+LICENSE="GPL-2 LGPL-2 BSD-2"
+SLOT="0"
+IUSE="accessibility +aio alsa bluetooth +caps +curl debug +fdt glusterfs \
+gtk gtk2 infiniband iscsi +jpeg \
+kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
++png pulseaudio python \
+rbd sasl +seccomp sdl selinux smartcard snappy spice ssh static static-softmmu \
+static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \
+virtfs +vnc xattr xen xfs"
+
+COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
+mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32
+x86_64"
+IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb"
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus"
+
+use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
+use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
+IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
+
+# Require at least one softmmu or user target.
+# Block USE flag configurations known to not work.
+REQUIRED_USE="|| ( ${use_softmmu_targets} ${use_user_targets} )
+ ${PYTHON_REQUIRED_USE}
+ gtk2? ( gtk )
+ qemu_softmmu_targets_arm? ( fdt )
+ qemu_softmmu_targets_microblaze? ( fdt )
+ qemu_softmmu_targets_ppc? ( fdt )
+ qemu_softmmu_targets_ppc64? ( fdt )
+ static? ( static-softmmu static-user )
+ static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 )
+ virtfs? ( xattr )"
+
+# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
+#
+# The attr lib isn't always linked in (although the USE flag is always
+# respected). This is because qemu supports using the C library's API
+# when available rather than always using the extranl library.
+COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ xattr? ( sys-apps/attr[static-libs(+)] )"
+SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
+ >=x11-libs/pixman-0.28.0[static-libs(+)]
+ aio? ( dev-libs/libaio[static-libs(+)] )
+ caps? ( sys-libs/libcap-ng[static-libs(+)] )
+ curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
+ fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
+ infiniband? ( sys-infiniband/librdmacm:=[static-libs(+)] )
+ jpeg? ( virtual/jpeg:=[static-libs(+)] )
+ lzo? ( dev-libs/lzo:2[static-libs(+)] )
+ ncurses? ( sys-libs/ncurses[static-libs(+)] )
+ nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] )
+ numa? ( sys-process/numactl[static-libs(+)] )
+ png? ( media-libs/libpng:0=[static-libs(+)] )
+ rbd? ( sys-cluster/ceph[static-libs(+)] )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
+ sdl? ( >=media-libs/libsdl-1.2.11[static-libs(+)] )
+ seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
+ snappy? ( app-arch/snappy[static-libs(+)] )
+ spice? ( >=app-emulation/spice-0.12.0[static-libs(+)] )
+ ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
+ tls? ( net-libs/gnutls[static-libs(+)] )
+ usb? ( >=dev-libs/libusb-1.0.18[static-libs(+)] )
+ uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] )
+ vde? ( net-misc/vde[static-libs(+)] )
+ xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
+USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
+X86_FIRMWARE_DEPEND="
+ >=sys-firmware/ipxe-1.0.0_p20130624
+ pin-upstream-blobs? (
+ ~sys-firmware/seabios-1.7.5
+ ~sys-firmware/sgabios-0.1_pre8
+ ~sys-firmware/vgabios-0.7a
+ )
+ !pin-upstream-blobs? (
+ sys-firmware/seabios
+ sys-firmware/sgabios
+ sys-firmware/vgabios
+ )"
+CDEPEND="
+ !static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) " ${use_softmmu_targets}) )
+ !static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) " ${use_user_targets}) )
+ qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
+ qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
+ accessibility? ( app-accessibility/brltty )
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ bluetooth? ( net-wireless/bluez )
+ gtk? (
+ gtk2? ( x11-libs/gtk+:2 )
+ !gtk2? ( x11-libs/gtk+:3 )
+ x11-libs/vte:2.90
+ )
+ iscsi? ( net-libs/libiscsi )
+ opengl? ( virtual/opengl )
+ pulseaudio? ( media-sound/pulseaudio )
+ python? ( ${PYTHON_DEPS} )
+ sdl? ( media-libs/libsdl[X] )
+ smartcard? ( dev-libs/nss !app-emulation/libcacard )
+ spice? ( >=app-emulation/spice-protocol-0.12.3 )
+ systemtap? ( dev-util/systemtap )
+ usbredir? ( >=sys-apps/usbredir-0.6 )
+ virtfs? ( sys-libs/libcap )
+ xen? ( app-emulation/xen-tools )"
+DEPEND="${CDEPEND}
+ dev-lang/perl
+ =dev-lang/python-2*
+ sys-apps/texinfo
+ virtual/pkgconfig
+ kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
+ gtk? ( nls? ( sys-devel/gettext ) )
+ static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND} ) " ${use_softmmu_targets}) )
+ static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND} ) " ${use_user_targets}) )
+ test? (
+ dev-libs/glib[utils]
+ sys-devel/bc
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-qemu )
+"
+
+STRIP_MASK="/usr/share/qemu/palcode-clipper"
+
+QA_PREBUILT="
+ usr/share/qemu/openbios-ppc
+ usr/share/qemu/openbios-sparc64
+ usr/share/qemu/openbios-sparc32
+ usr/share/qemu/palcode-clipper
+ usr/share/qemu/s390-ccw.img
+ usr/share/qemu/u-boot.e500
+"
+
+QA_WX_LOAD="usr/bin/qemu-i386
+ usr/bin/qemu-x86_64
+ usr/bin/qemu-alpha
+ usr/bin/qemu-arm
+ usr/bin/qemu-cris
+ usr/bin/qemu-m68k
+ usr/bin/qemu-microblaze
+ usr/bin/qemu-microblazeel
+ usr/bin/qemu-mips
+ usr/bin/qemu-mipsel
+ usr/bin/qemu-or32
+ usr/bin/qemu-ppc
+ usr/bin/qemu-ppc64
+ usr/bin/qemu-ppc64abi32
+ usr/bin/qemu-sh4
+ usr/bin/qemu-sh4eb
+ usr/bin/qemu-sparc
+ usr/bin/qemu-sparc64
+ usr/bin/qemu-armeb
+ usr/bin/qemu-sparc32plus
+ usr/bin/qemu-s390x
+ usr/bin/qemu-unicore32"
+
+DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure
+you have the kernel module loaded before running kvm. The easiest way to
+ensure that the kernel module is loaded is to load it on boot.\n
+For AMD CPUs the module is called 'kvm-amd'\n
+For Intel CPUs the module is called 'kvm-intel'\n
+Please review /etc/conf.d/modules for how to load these\n\n
+Make sure your user is in the 'kvm' group\n
+Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
+
+qemu_support_kvm() {
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \
+ use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \
+ use qemu_softmmu_targets_s390x; then
+ return 0
+ fi
+
+ return 1
+}
+
+pkg_pretend() {
+ if use kernel_linux && kernel_is lt 2 6 25; then
+ eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
+ elif use kernel_linux; then
+ if ! linux_config_exists; then
+ eerror "Unable to check your kernel for KVM support"
+ else
+ CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
+ ERROR_KVM="You must enable KVM in your kernel to continue"
+ ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
+ ERROR_KVM_AMD+=" your kernel configuration."
+ ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
+ ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
+ ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
+ ERROR_TUN+=" into your kernel or loaded as a module to use the"
+ ERROR_TUN+=" virtual network device if using -net tap."
+ ERROR_BRIDGE="You will also need support for 802.1d"
+ ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
+ use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
+ ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
+ ERROR_VHOST_NET+=" support"
+
+ if use amd64 || use x86 || use amd64-linux || use x86-linux; then
+ CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
+ fi
+
+ use python && CONFIG_CHECK+=" ~DEBUG_FS"
+ ERROR_DEBUG_FS="debugFS support required for kvm_stat"
+
+ # Now do the actual checks setup above
+ check_extra_config
+ fi
+ fi
+
+ if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
+ eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
+ eerror "instances are still pointing to it. Please update your"
+ eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
+ eerror "and the right system binary (e.g. qemu-system-x86_64)."
+ die "update your virt configs to not use qemu-kvm"
+ fi
+}
+
+pkg_setup() {
+ enewgroup kvm 78
+}
+
+src_prepare() {
+ # Alter target makefiles to accept CFLAGS set via flag-o
+ sed -i -r \
+ -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+ Makefile Makefile.target || die
+
+ # Cheap hack to disable gettext .mo generation.
+ use nls || rm -f po/*.po
+
+ epatch "${FILESDIR}"/qemu-1.7.0-cflags.patch
+ epatch "${FILESDIR}"/${P}-CVE-2015-3456.patch #549404
+ epatch "${FILESDIR}"/${P}-CVE-2015-3209.patch #551752
+ epatch "${FILESDIR}"/${P}-CVE-2015-5158.patch #555680
+ epatch "${FILESDIR}"/${P}-CVE-2015-3214.patch #556052
+ epatch "${FILESDIR}"/${P}-CVE-2015-5154-1.patch #556050 / #555532
+ epatch "${FILESDIR}"/${P}-CVE-2015-5154-2.patch #556050 / #555532
+ epatch "${FILESDIR}"/${P}-CVE-2015-5154-3.patch #556050 / #555532
+ epatch "${FILESDIR}"/${P}-CVE-2015-5165-1.patch #556304
+ epatch "${FILESDIR}"/${P}-CVE-2015-5165-2.patch #556304
+ epatch "${FILESDIR}"/${P}-CVE-2015-5165-3.patch #556304
+ epatch "${FILESDIR}"/${P}-CVE-2015-5165-4.patch #556304
+ epatch "${FILESDIR}"/${P}-CVE-2015-5165-5.patch #556304
+ epatch "${FILESDIR}"/${P}-CVE-2015-5165-6.patch #556304
+ epatch "${FILESDIR}"/${P}-CVE-2015-5165-7.patch #556304
+ epatch "${FILESDIR}"/${P}-CVE-2015-5166.patch #556304
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ # Fix ld and objcopy being called directly
+ tc-export AR LD OBJCOPY
+
+ # Verbose builds
+ MAKEOPTS+=" V=1"
+
+ epatch_user
+}
+
+##
+# configures qemu based on the build directory and the build type
+# we are using.
+#
+qemu_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local buildtype=$1
+ local builddir=$2
+ local static_flag="static-${buildtype}"
+
+ # audio options
+ local audio_opts="oss"
+ use alsa && audio_opts="alsa,${audio_opts}"
+ use sdl && audio_opts="sdl,${audio_opts}"
+ use pulseaudio && audio_opts="pa,${audio_opts}"
+
+ local conf_opts=(
+ --prefix=/usr
+ --sysconfdir=/etc
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}/html
+ --disable-bsd-user
+ --disable-guest-agent
+ --disable-strip
+ --disable-werror
+ --python="${PYTHON}"
+ --cc="$(tc-getCC)"
+ --cxx="$(tc-getCXX)"
+ --host-cc="$(tc-getBUILD_CC)"
+ $(use_enable debug debug-info)
+ $(use_enable debug debug-tcg)
+ --enable-docs
+ $(use_enable tci tcg-interpreter)
+ $(use_enable xattr attr)
+ )
+
+ # Disable options not used by user targets as the default configure
+ # options will autoprobe and try to link in a bunch of unused junk.
+ conf_softmmu() {
+ if [[ ${buildtype} == "user" ]] ; then
+ echo "--disable-${2:-$1}"
+ else
+ use_enable "$@"
+ fi
+ }
+ conf_opts+=(
+ $(conf_softmmu accessibility brlapi)
+ $(conf_softmmu aio linux-aio)
+ $(conf_softmmu bluetooth bluez)
+ $(conf_softmmu caps cap-ng)
+ $(conf_softmmu curl)
+ $(conf_softmmu fdt)
+ $(conf_softmmu glusterfs)
+ $(conf_softmmu gtk)
+ $(conf_softmmu infiniband rdma)
+ $(conf_softmmu iscsi libiscsi)
+ $(conf_softmmu jpeg vnc-jpeg)
+ $(conf_softmmu kernel_linux kvm)
+ $(conf_softmmu lzo)
+ $(conf_softmmu ncurses curses)
+ $(conf_softmmu nfs libnfs)
+ $(conf_softmmu numa)
+ $(conf_softmmu opengl)
+ $(conf_softmmu png vnc-png)
+ $(conf_softmmu rbd)
+ $(conf_softmmu sasl vnc-sasl)
+ $(conf_softmmu sdl)
+ $(conf_softmmu seccomp)
+ $(conf_softmmu smartcard smartcard-nss)
+ $(conf_softmmu snappy)
+ $(conf_softmmu spice)
+ $(conf_softmmu ssh libssh2)
+ $(conf_softmmu tls quorum)
+ $(conf_softmmu tls vnc-tls)
+ $(conf_softmmu tls vnc-ws)
+ $(conf_softmmu usb libusb)
+ $(conf_softmmu usbredir usb-redir)
+ $(conf_softmmu uuid)
+ $(conf_softmmu vde)
+ $(conf_softmmu vhost-net)
+ $(conf_softmmu virtfs)
+ $(conf_softmmu vnc)
+ $(conf_softmmu xen)
+ $(conf_softmmu xen xen-pci-passthrough)
+ $(conf_softmmu xfs xfsctl)
+ )
+
+ case ${buildtype} in
+ user)
+ conf_opts+=(
+ --enable-linux-user
+ --disable-system
+ --target-list="${user_targets}"
+ --disable-blobs
+ --disable-tools
+ )
+ ;;
+ softmmu)
+ conf_opts+=(
+ --disable-linux-user
+ --enable-system
+ --target-list="${softmmu_targets}"
+ --with-system-pixman
+ --audio-drv-list="${audio_opts}"
+ )
+ use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) )
+ ;;
+ esac
+
+ # Add support for SystemTAP
+ use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
+
+ # We always want to attempt to build with PIE support as it results
+ # in a more secure binary. But it doesn't work with static or if
+ # the current GCC doesn't have PIE support.
+ if use ${static_flag}; then
+ conf_opts+=( --static --disable-pie )
+ else
+ gcc-specs-pie && conf_opts+=( --enable-pie )
+ fi
+
+ einfo "../configure ${conf_opts[*]}"
+ cd "${builddir}"
+ ../configure "${conf_opts[@]}" || die "configure failed"
+
+ # FreeBSD's kernel does not support QEMU assigning/grabbing
+ # host USB devices yet
+ use kernel_FreeBSD && \
+ sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
+}
+
+src_configure() {
+ local target
+
+ python_setup
+
+ softmmu_targets= softmmu_bins=()
+ user_targets= user_bins=()
+
+ for target in ${IUSE_SOFTMMU_TARGETS} ; do
+ if use "qemu_softmmu_targets_${target}"; then
+ softmmu_targets+=",${target}-softmmu"
+ softmmu_bins+=( "qemu-system-${target}" )
+ fi
+ done
+
+ for target in ${IUSE_USER_TARGETS} ; do
+ if use "qemu_user_targets_${target}"; then
+ user_targets+=",${target}-linux-user"
+ user_bins+=( "qemu-${target}" )
+ fi
+ done
+
+ [[ -n ${softmmu_targets} ]] && \
+ einfo "Building the following softmmu targets: ${softmmu_targets}"
+
+ [[ -n ${user_targets} ]] && \
+ einfo "Building the following user targets: ${user_targets}"
+
+ if [[ -n ${softmmu_targets} ]]; then
+ mkdir "${S}/softmmu-build"
+ qemu_src_configure "softmmu" "${S}/softmmu-build"
+ fi
+
+ if [[ -n ${user_targets} ]]; then
+ mkdir "${S}/user-build"
+ qemu_src_configure "user" "${S}/user-build"
+ fi
+}
+
+src_compile() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ default
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ default
+ fi
+}
+
+src_test() {
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ pax-mark m */qemu-system-* #515550
+ emake -j1 check
+ emake -j1 check-report.html
+ fi
+}
+
+qemu_python_install() {
+ python_domodule "${S}/scripts/qmp/qmp.py"
+
+ python_doscript "${S}/scripts/kvm/kvm_stat"
+ python_doscript "${S}/scripts/kvm/vmxcap"
+ python_doscript "${S}/scripts/qmp/qmp-shell"
+ python_doscript "${S}/scripts/qmp/qemu-ga-client"
+}
+
+src_install() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ emake DESTDIR="${ED}" install
+
+ # Install binfmt handler init script for user targets
+ newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ emake DESTDIR="${ED}" install
+
+ # This might not exist if the test failed. #512010
+ [[ -e check-report.html ]] && dohtml check-report.html
+
+ if use kernel_linux; then
+ udev_dorules "${FILESDIR}"/65-kvm.rules
+ fi
+
+ if use python; then
+ python_foreach_impl qemu_python_install
+ fi
+ fi
+
+ # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
+ pushd "${ED}"/usr/bin >/dev/null
+ pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}"
+ popd >/dev/null
+
+ # Install config file example for qemu-bridge-helper
+ insinto "/etc/qemu"
+ doins "${FILESDIR}/bridge.conf"
+
+ # Remove the docdir placed qmp-commands.txt
+ mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/qmp/"
+
+ cd "${S}"
+ dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
+ newdoc pc-bios/README README.pc-bios
+ dodoc docs/qmp/*.txt
+
+ if [[ -n ${softmmu_targets} ]]; then
+ # Remove SeaBIOS since we're using the SeaBIOS packaged one
+ rm "${ED}/usr/share/qemu/bios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
+ fi
+
+ # Remove vgabios since we're using the vgabios packaged one
+ rm "${ED}/usr/share/qemu/vgabios.bin"
+ rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
+ rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
+ rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
+ rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
+ dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
+ dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
+ dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
+ dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
+ fi
+
+ # Remove sgabios since we're using the sgabios packaged one
+ rm "${ED}/usr/share/qemu/sgabios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
+ fi
+
+ # Remove iPXE since we're using the iPXE packaged one
+ rm "${ED}"/usr/share/qemu/pxe-*.rom
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
+ dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
+ dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
+ dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
+ dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
+ dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
+ fi
+ fi
+
+ qemu_support_kvm && readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ if qemu_support_kvm; then
+ readme.gentoo_print_elog
+ ewarn "Migration from qemu-kvm instances and loading qemu-kvm created"
+ ewarn "save states has been removed starting with the 1.6.2 release"
+ ewarn
+ ewarn "It is recommended that you migrate any VMs that may be running"
+ ewarn "on qemu-kvm to a host with a newer qemu and regenerate"
+ ewarn "any saved states with a newer qemu."
+ ewarn
+ ewarn "qemu-kvm was the primary qemu provider in Gentoo through 1.2.x"
+
+ if use x86 || use amd64; then
+ ewarn
+ ewarn "The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer"
+ ewarn "installed. In order to use kvm acceleration, pass the flag"
+ ewarn "-enable-kvm when running your system target."
+ fi
+ fi
+
+ if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
+ udev_reload
+ fi
+
+ fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
+ if use virtfs && [ -n "${softmmu_targets}" ]; then
+ local virtfs_caps="cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_setgid,cap_mknod,cap_setuid"
+ fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper
+ fi
+}
+
+pkg_info() {
+ echo "Using:"
+ echo " $(best_version app-emulation/spice-protocol)"
+ echo " $(best_version sys-firmware/ipxe)"
+ echo " $(best_version sys-firmware/seabios)"
+ if has_version sys-firmware/seabios[binary]; then
+ echo " USE=binary"
+ else
+ echo " USE=''"
+ fi
+ echo " $(best_version sys-firmware/vgabios)"
+}
diff --git a/app-emulation/qemu/qemu-9999.ebuild b/app-emulation/qemu/qemu-9999.ebuild
new file mode 100644
index 000000000000..677e059ccfe3
--- /dev/null
+++ b/app-emulation/qemu/qemu-9999.ebuild
@@ -0,0 +1,612 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ncurses,readline"
+
+inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
+ user udev fcaps readme.gentoo pax-utils
+
+BACKPORTS=
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+ SRC_URI=""
+else
+ SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
+HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
+
+LICENSE="GPL-2 LGPL-2 BSD-2"
+SLOT="0"
+IUSE="accessibility +aio alsa bluetooth +caps +curl debug +fdt glusterfs \
+gtk gtk2 infiniband iscsi +jpeg \
+kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
++png pulseaudio python \
+rbd sasl +seccomp sdl sdl2 selinux smartcard snappy spice ssh static static-softmmu
+static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \
+virtfs +vnc vte xattr xen xfs"
+
+COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
+mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32
+x86_64"
+IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb"
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus"
+
+use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
+use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
+IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
+
+# Allow no targets to be built so that people can get a tools-only build.
+# Block USE flag configurations known to not work.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ gtk2? ( gtk )
+ qemu_softmmu_targets_arm? ( fdt )
+ qemu_softmmu_targets_microblaze? ( fdt )
+ qemu_softmmu_targets_ppc? ( fdt )
+ qemu_softmmu_targets_ppc64? ( fdt )
+ sdl2? ( sdl )
+ static? ( static-softmmu static-user )
+ static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 )
+ virtfs? ( xattr )
+ vte? ( gtk )"
+
+# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
+#
+# The attr lib isn't always linked in (although the USE flag is always
+# respected). This is because qemu supports using the C library's API
+# when available rather than always using the extranl library.
+COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ xattr? ( sys-apps/attr[static-libs(+)] )"
+SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
+ >=x11-libs/pixman-0.28.0[static-libs(+)]
+ aio? ( dev-libs/libaio[static-libs(+)] )
+ caps? ( sys-libs/libcap-ng[static-libs(+)] )
+ curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
+ fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
+ infiniband? ( sys-infiniband/librdmacm:=[static-libs(+)] )
+ jpeg? ( virtual/jpeg:=[static-libs(+)] )
+ lzo? ( dev-libs/lzo:2[static-libs(+)] )
+ ncurses? ( sys-libs/ncurses[static-libs(+)] )
+ nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] )
+ numa? ( sys-process/numactl[static-libs(+)] )
+ png? ( media-libs/libpng:0=[static-libs(+)] )
+ rbd? ( sys-cluster/ceph[static-libs(+)] )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
+ sdl? (
+ !sdl2? ( >=media-libs/libsdl-1.2.11[static-libs(+)] )
+ sdl2? ( media-libs/libsdl2[static-libs(+)] )
+ )
+ seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
+ snappy? ( app-arch/snappy[static-libs(+)] )
+ spice? ( >=app-emulation/spice-0.12.0[static-libs(+)] )
+ ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
+ tls? ( net-libs/gnutls[static-libs(+)] )
+ usb? ( >=dev-libs/libusb-1.0.18[static-libs(+)] )
+ uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] )
+ vde? ( net-misc/vde[static-libs(+)] )
+ xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
+USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
+X86_FIRMWARE_DEPEND="
+ >=sys-firmware/ipxe-1.0.0_p20130624
+ pin-upstream-blobs? (
+ ~sys-firmware/seabios-1.7.5
+ ~sys-firmware/sgabios-0.1_pre8
+ ~sys-firmware/vgabios-0.7a
+ )
+ !pin-upstream-blobs? (
+ sys-firmware/seabios
+ sys-firmware/sgabios
+ sys-firmware/vgabios
+ )"
+CDEPEND="
+ !static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) " ${use_softmmu_targets}) )
+ !static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) " ${use_user_targets}) )
+ qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
+ qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
+ accessibility? ( app-accessibility/brltty )
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ bluetooth? ( net-wireless/bluez )
+ gtk? (
+ gtk2? (
+ x11-libs/gtk+:2
+ vte? ( x11-libs/vte:0 )
+ )
+ !gtk2? (
+ x11-libs/gtk+:3
+ vte? ( x11-libs/vte:2.90 )
+ )
+ )
+ iscsi? ( net-libs/libiscsi )
+ opengl? (
+ virtual/opengl
+ media-libs/mesa[gles2]
+ )
+ pulseaudio? ( media-sound/pulseaudio )
+ python? ( ${PYTHON_DEPS} )
+ sdl? (
+ !sdl2? ( media-libs/libsdl[X] )
+ sdl2? ( media-libs/libsdl2[X] )
+ )
+ smartcard? ( dev-libs/nss !app-emulation/libcacard )
+ spice? ( >=app-emulation/spice-protocol-0.12.3 )
+ systemtap? ( dev-util/systemtap )
+ usbredir? ( >=sys-apps/usbredir-0.6 )
+ virtfs? ( sys-libs/libcap )
+ xen? ( app-emulation/xen-tools )"
+DEPEND="${CDEPEND}
+ dev-lang/perl
+ =dev-lang/python-2*
+ sys-apps/texinfo
+ virtual/pkgconfig
+ kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
+ gtk? ( nls? ( sys-devel/gettext ) )
+ static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND} ) " ${use_softmmu_targets}) )
+ static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND} ) " ${use_user_targets}) )
+ test? (
+ dev-libs/glib[utils]
+ sys-devel/bc
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-qemu )
+"
+
+STRIP_MASK="/usr/share/qemu/palcode-clipper"
+
+QA_PREBUILT="
+ usr/share/qemu/openbios-ppc
+ usr/share/qemu/openbios-sparc64
+ usr/share/qemu/openbios-sparc32
+ usr/share/qemu/palcode-clipper
+ usr/share/qemu/s390-ccw.img
+ usr/share/qemu/u-boot.e500
+"
+
+QA_WX_LOAD="usr/bin/qemu-i386
+ usr/bin/qemu-x86_64
+ usr/bin/qemu-alpha
+ usr/bin/qemu-arm
+ usr/bin/qemu-cris
+ usr/bin/qemu-m68k
+ usr/bin/qemu-microblaze
+ usr/bin/qemu-microblazeel
+ usr/bin/qemu-mips
+ usr/bin/qemu-mipsel
+ usr/bin/qemu-or32
+ usr/bin/qemu-ppc
+ usr/bin/qemu-ppc64
+ usr/bin/qemu-ppc64abi32
+ usr/bin/qemu-sh4
+ usr/bin/qemu-sh4eb
+ usr/bin/qemu-sparc
+ usr/bin/qemu-sparc64
+ usr/bin/qemu-armeb
+ usr/bin/qemu-sparc32plus
+ usr/bin/qemu-s390x
+ usr/bin/qemu-unicore32"
+
+DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure
+you have the kernel module loaded before running kvm. The easiest way to
+ensure that the kernel module is loaded is to load it on boot.\n
+For AMD CPUs the module is called 'kvm-amd'\n
+For Intel CPUs the module is called 'kvm-intel'\n
+Please review /etc/conf.d/modules for how to load these\n\n
+Make sure your user is in the 'kvm' group\n
+Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
+
+qemu_support_kvm() {
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \
+ use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \
+ use qemu_softmmu_targets_s390x; then
+ return 0
+ fi
+
+ return 1
+}
+
+pkg_pretend() {
+ if use kernel_linux && kernel_is lt 2 6 25; then
+ eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
+ elif use kernel_linux; then
+ if ! linux_config_exists; then
+ eerror "Unable to check your kernel for KVM support"
+ else
+ CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
+ ERROR_KVM="You must enable KVM in your kernel to continue"
+ ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
+ ERROR_KVM_AMD+=" your kernel configuration."
+ ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
+ ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
+ ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
+ ERROR_TUN+=" into your kernel or loaded as a module to use the"
+ ERROR_TUN+=" virtual network device if using -net tap."
+ ERROR_BRIDGE="You will also need support for 802.1d"
+ ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
+ use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
+ ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
+ ERROR_VHOST_NET+=" support"
+
+ if use amd64 || use x86 || use amd64-linux || use x86-linux; then
+ CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
+ fi
+
+ use python && CONFIG_CHECK+=" ~DEBUG_FS"
+ ERROR_DEBUG_FS="debugFS support required for kvm_stat"
+
+ # Now do the actual checks setup above
+ check_extra_config
+ fi
+ fi
+
+ if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
+ eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
+ eerror "instances are still pointing to it. Please update your"
+ eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
+ eerror "and the right system binary (e.g. qemu-system-x86_64)."
+ die "update your virt configs to not use qemu-kvm"
+ fi
+}
+
+pkg_setup() {
+ enewgroup kvm 78
+}
+
+src_prepare() {
+ # Alter target makefiles to accept CFLAGS set via flag-o
+ sed -i -r \
+ -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+ Makefile Makefile.target || die
+
+ # Cheap hack to disable gettext .mo generation.
+ use nls || rm -f po/*.po
+
+ epatch "${FILESDIR}"/qemu-1.7.0-cflags.patch
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ # Fix ld and objcopy being called directly
+ tc-export AR LD OBJCOPY
+
+ # Verbose builds
+ MAKEOPTS+=" V=1"
+
+ epatch_user
+}
+
+##
+# configures qemu based on the build directory and the build type
+# we are using.
+#
+qemu_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local buildtype=$1
+ local builddir="${S}/${buildtype}-build"
+ local static_flag="static-${buildtype}"
+
+ mkdir "${builddir}"
+
+ # audio options
+ local audio_opts="oss"
+ use alsa && audio_opts="alsa,${audio_opts}"
+ use sdl && audio_opts="sdl,${audio_opts}"
+ use pulseaudio && audio_opts="pa,${audio_opts}"
+
+ local conf_opts=(
+ --prefix=/usr
+ --sysconfdir=/etc
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}/html
+ --disable-bsd-user
+ --disable-guest-agent
+ --disable-strip
+ --disable-werror
+ --python="${PYTHON}"
+ --cc="$(tc-getCC)"
+ --cxx="$(tc-getCXX)"
+ --host-cc="$(tc-getBUILD_CC)"
+ $(use_enable debug debug-info)
+ $(use_enable debug debug-tcg)
+ --enable-docs
+ $(use_enable tci tcg-interpreter)
+ $(use_enable xattr attr)
+ )
+
+ # Disable options not used by user targets as the default configure
+ # options will autoprobe and try to link in a bunch of unused junk.
+ conf_softmmu() {
+ if [[ ${buildtype} == "user" ]] ; then
+ echo "--disable-${2:-$1}"
+ else
+ use_enable "$@"
+ fi
+ }
+ conf_opts+=(
+ $(conf_softmmu accessibility brlapi)
+ $(conf_softmmu aio linux-aio)
+ $(conf_softmmu bluetooth bluez)
+ $(conf_softmmu caps cap-ng)
+ $(conf_softmmu curl)
+ $(conf_softmmu fdt)
+ $(conf_softmmu glusterfs)
+ $(conf_softmmu gtk)
+ $(conf_softmmu infiniband rdma)
+ $(conf_softmmu iscsi libiscsi)
+ $(conf_softmmu jpeg vnc-jpeg)
+ $(conf_softmmu kernel_linux kvm)
+ $(conf_softmmu lzo)
+ $(conf_softmmu ncurses curses)
+ $(conf_softmmu nfs libnfs)
+ $(conf_softmmu numa)
+ $(conf_softmmu opengl)
+ $(conf_softmmu png vnc-png)
+ $(conf_softmmu rbd)
+ $(conf_softmmu sasl vnc-sasl)
+ $(conf_softmmu sdl)
+ $(conf_softmmu seccomp)
+ $(conf_softmmu smartcard smartcard-nss)
+ $(conf_softmmu snappy)
+ $(conf_softmmu spice)
+ $(conf_softmmu ssh libssh2)
+ $(conf_softmmu tls vnc-tls)
+ $(conf_softmmu usb libusb)
+ $(conf_softmmu usbredir usb-redir)
+ $(conf_softmmu uuid)
+ $(conf_softmmu vde)
+ $(conf_softmmu vhost-net)
+ $(conf_softmmu virtfs)
+ $(conf_softmmu vnc)
+ $(conf_softmmu vte)
+ $(conf_softmmu xen)
+ $(conf_softmmu xen xen-pci-passthrough)
+ $(conf_softmmu xfs xfsctl)
+ )
+
+ case ${buildtype} in
+ user)
+ conf_opts+=(
+ --enable-linux-user
+ --disable-system
+ --disable-blobs
+ --disable-tools
+ )
+ ;;
+ softmmu)
+ conf_opts+=(
+ --disable-linux-user
+ --enable-system
+ --with-system-pixman
+ --audio-drv-list="${audio_opts}"
+ )
+ use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) )
+ use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) )
+ ;;
+ tools)
+ conf_opts+=(
+ --disable-linux-user
+ --disable-system
+ --disable-blobs
+ )
+ static_flag="static"
+ ;;
+ esac
+
+ local targets="${buildtype}_targets"
+ [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
+
+ # Add support for SystemTAP
+ use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
+
+ # We always want to attempt to build with PIE support as it results
+ # in a more secure binary. But it doesn't work with static or if
+ # the current GCC doesn't have PIE support.
+ if use ${static_flag}; then
+ conf_opts+=( --static --disable-pie )
+ else
+ gcc-specs-pie && conf_opts+=( --enable-pie )
+ fi
+
+ echo "../configure ${conf_opts[*]}"
+ cd "${builddir}"
+ ../configure "${conf_opts[@]}" || die "configure failed"
+
+ # FreeBSD's kernel does not support QEMU assigning/grabbing
+ # host USB devices yet
+ use kernel_FreeBSD && \
+ sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
+}
+
+src_configure() {
+ local target
+
+ python_setup
+
+ softmmu_targets= softmmu_bins=()
+ user_targets= user_bins=()
+
+ for target in ${IUSE_SOFTMMU_TARGETS} ; do
+ if use "qemu_softmmu_targets_${target}"; then
+ softmmu_targets+=",${target}-softmmu"
+ softmmu_bins+=( "qemu-system-${target}" )
+ fi
+ done
+
+ for target in ${IUSE_USER_TARGETS} ; do
+ if use "qemu_user_targets_${target}"; then
+ user_targets+=",${target}-linux-user"
+ user_bins+=( "qemu-${target}" )
+ fi
+ done
+
+ softmmu_targets=${softmmu_targets#,}
+ user_targets=${user_targets#,}
+
+ [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
+ [[ -n ${user_targets} ]] && qemu_src_configure "user"
+ [[ -z ${softmmu_targets}${user_targets} ]] && qemu_src_configure "tools"
+}
+
+src_compile() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ default
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ default
+ fi
+
+ if [[ -z ${softmmu_targets}${user_targets} ]]; then
+ cd "${S}/tools-build"
+ default
+ fi
+}
+
+src_test() {
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ pax-mark m */qemu-system-* #515550
+ emake -j1 check
+ emake -j1 check-report.html
+ fi
+}
+
+qemu_python_install() {
+ python_domodule "${S}/scripts/qmp/qmp.py"
+
+ python_doscript "${S}/scripts/kvm/kvm_stat"
+ python_doscript "${S}/scripts/kvm/vmxcap"
+ python_doscript "${S}/scripts/qmp/qmp-shell"
+ python_doscript "${S}/scripts/qmp/qemu-ga-client"
+}
+
+src_install() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ emake DESTDIR="${ED}" install
+
+ # Install binfmt handler init script for user targets
+ newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ emake DESTDIR="${ED}" install
+
+ # This might not exist if the test failed. #512010
+ [[ -e check-report.html ]] && dohtml check-report.html
+
+ if use kernel_linux; then
+ udev_dorules "${FILESDIR}"/65-kvm.rules
+ fi
+
+ if use python; then
+ python_foreach_impl qemu_python_install
+ fi
+ fi
+
+ if [[ -z ${softmmu_targets}${user_targets} ]]; then
+ cd "${S}/tools-build"
+ emake DESTDIR="${ED}" install
+ fi
+
+ # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
+ pushd "${ED}"/usr/bin >/dev/null
+ pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}"
+ popd >/dev/null
+
+ # Install config file example for qemu-bridge-helper
+ insinto "/etc/qemu"
+ doins "${FILESDIR}/bridge.conf"
+
+ # Remove the docdir placed qmp-commands.txt
+ mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/qmp/"
+
+ cd "${S}"
+ dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
+ newdoc pc-bios/README README.pc-bios
+ dodoc docs/qmp/*.txt
+
+ if [[ -n ${softmmu_targets} ]]; then
+ # Remove SeaBIOS since we're using the SeaBIOS packaged one
+ rm "${ED}/usr/share/qemu/bios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
+ fi
+
+ # Remove vgabios since we're using the vgabios packaged one
+ rm "${ED}/usr/share/qemu/vgabios.bin"
+ rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
+ rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
+ rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
+ rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
+ dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
+ dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
+ dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
+ dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
+ fi
+
+ # Remove sgabios since we're using the sgabios packaged one
+ rm "${ED}/usr/share/qemu/sgabios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
+ fi
+
+ # Remove iPXE since we're using the iPXE packaged one
+ rm "${ED}"/usr/share/qemu/pxe-*.rom
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
+ dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
+ dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
+ dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
+ dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
+ dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
+ fi
+ fi
+
+ qemu_support_kvm && readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ if qemu_support_kvm; then
+ readme.gentoo_print_elog
+ fi
+
+ if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
+ udev_reload
+ fi
+
+ fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
+ if use virtfs && [ -n "${softmmu_targets}" ]; then
+ local virtfs_caps="cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_setgid,cap_mknod,cap_setuid"
+ fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper
+ fi
+}
+
+pkg_info() {
+ echo "Using:"
+ echo " $(best_version app-emulation/spice-protocol)"
+ echo " $(best_version sys-firmware/ipxe)"
+ echo " $(best_version sys-firmware/seabios)"
+ if has_version 'sys-firmware/seabios[binary]'; then
+ echo " USE=binary"
+ else
+ echo " USE=''"
+ fi
+ echo " $(best_version sys-firmware/vgabios)"
+}
diff --git a/app-emulation/qtemu/Manifest b/app-emulation/qtemu/Manifest
new file mode 100644
index 000000000000..7d80d3725c8a
--- /dev/null
+++ b/app-emulation/qtemu/Manifest
@@ -0,0 +1 @@
+DIST qtemu-1.0.5.tar.bz2 555872 SHA256 752942fae239996c826580fd0b32986cf96a92a0982710f726947ddf791dc921 SHA512 c8380acea500453053d8d2a9cc3eecb51c766d5743a22a7fbe13d3bd5d543ab63ab715ac2ffbd2389f24c699ea81ca3e0584c7578a9799300cef514886d1cee8 WHIRLPOOL 7ca11b4da2961385511b830e397bc63a1a648bc5fe37c4eca1d658623a15ad6a5346ae06ce39ed168421cdcdbe12de32019fbd7c1e9a8afc9ff0509199d57fa5
diff --git a/app-emulation/qtemu/files/1.0.5-help_and_translation_paths.patch b/app-emulation/qtemu/files/1.0.5-help_and_translation_paths.patch
new file mode 100644
index 000000000000..8fc1680aacb0
--- /dev/null
+++ b/app-emulation/qtemu/files/1.0.5-help_and_translation_paths.patch
@@ -0,0 +1,63 @@
+diff -Naur qtemu-1.0.5.orig/CMakeLists.txt qtemu-1.0.5/CMakeLists.txt
+--- qtemu-1.0.5.orig/CMakeLists.txt 2008-02-22 19:32:43.000000000 +0100
++++ qtemu-1.0.5/CMakeLists.txt 2008-02-22 19:35:29.000000000 +0100
+@@ -114,7 +114,7 @@
+ DEPENDS ${QM_FILES})
+
+ INSTALL (FILES ${QM_FILES}
+- DESTINATION translations)
++ DESTINATION share/qtemu/translations)
+ # translation end
+
+ SET(QT_USE_QTXML)
+@@ -146,13 +146,13 @@
+ )
+
+ FILE(GLOB helpfiles "${CMAKE_CURRENT_SOURCE_DIR}/help/*.png")
+-INSTALL(FILES ${helpfiles} DESTINATION help)
++INSTALL(FILES ${helpfiles} DESTINATION share/qtemu/help)
+
+-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/help/main.htm DESTINATION help)
++INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/help/main.htm DESTINATION share/qtemu/help)
+
+ FILE(GLOB helpfiles_de "${CMAKE_CURRENT_SOURCE_DIR}/help/de/*.png")
+-INSTALL(FILES ${helpfiles_de} DESTINATION help/de)
++INSTALL(FILES ${helpfiles_de} DESTINATION share/qtemu/help/de)
+
+-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/help/de/main.htm DESTINATION help/de)
++INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/help/de/main.htm DESTINATION share/qtemu/help/de)
+
+ INSTALL(TARGETS qtemu DESTINATION bin)
+diff -Naur qtemu-1.0.5.orig/helpwindow.cpp qtemu-1.0.5/helpwindow.cpp
+--- qtemu-1.0.5.orig/helpwindow.cpp 2008-02-22 19:32:44.000000000 +0100
++++ qtemu-1.0.5/helpwindow.cpp 2008-02-22 19:33:26.000000000 +0100
+@@ -80,7 +80,7 @@
+ return testUrl;
+
+ //check for case when qtemu executable is in bin/ (installed on linux)
+- testUrl = QUrl(QCoreApplication::applicationDirPath()+"/../help/" + locale + "/main.htm");
++ testUrl = QUrl(QCoreApplication::applicationDirPath()+"/../share/qtemu/help/" + locale + "/main.htm");
+ if (QFile::exists(testUrl.toString()))
+ return testUrl;
+ }
+@@ -96,7 +96,7 @@
+ return testUrl;
+
+ //check for case when qtemu executable is in bin/ (installed on linux)
+- testUrl = QUrl(QCoreApplication::applicationDirPath()+"/../help/main.htm");
++ testUrl = QUrl(QCoreApplication::applicationDirPath()+"/../share/qtemu/help/main.htm");
+ if (QFile::exists(testUrl.toString()))
+ return testUrl;
+
+diff -Naur qtemu-1.0.5.orig/main.cpp qtemu-1.0.5/main.cpp
+--- qtemu-1.0.5.orig/main.cpp 2008-02-22 19:32:43.000000000 +0100
++++ qtemu-1.0.5/main.cpp 2008-02-22 19:36:32.000000000 +0100
+@@ -45,7 +45,7 @@
+ translator.load(path);
+ else
+ {
+- path = QCoreApplication::applicationDirPath()+"/../translations/qtemu_" + locale + ".qm";
++ path = QCoreApplication::applicationDirPath()+"/../share/qtemu/translations/qtemu_" + locale + ".qm";
+ if (QFile::exists(path))
+ translator.load(path);
+ }
diff --git a/app-emulation/qtemu/metadata.xml b/app-emulation/qtemu/metadata.xml
new file mode 100644
index 000000000000..6f617db635ac
--- /dev/null
+++ b/app-emulation/qtemu/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">qtemu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/qtemu/qtemu-1.0.5.ebuild b/app-emulation/qtemu/qtemu-1.0.5.ebuild
new file mode 100644
index 000000000000..9adc53e7c3cd
--- /dev/null
+++ b/app-emulation/qtemu/qtemu-1.0.5.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils cmake-utils
+
+DESCRIPTION="A graphical user interface for QEMU written in Qt4"
+HOMEPAGE="http://qtemu.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1 CC-BY-3.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-qt/qtcore:4
+ dev-qt/qtgui:4"
+RDEPEND="${DEPEND}
+ app-emulation/qemu"
+
+DOCS=( ChangeLog README )
+PATCHES=(
+ "${FILESDIR}/${PV}-help_and_translation_paths.patch"
+)
+
+src_install() {
+ cmake-utils_src_install
+ doicon "${S}/images/${PN}.ico"
+ make_desktop_entry "qtemu" "QtEmu" "${PN}.ico" "Qt;Utility;Emulator"
+}
diff --git a/app-emulation/rex-client/metadata.xml b/app-emulation/rex-client/metadata.xml
new file mode 100644
index 000000000000..3b15722d898d
--- /dev/null
+++ b/app-emulation/rex-client/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
+
diff --git a/app-emulation/rex-client/rex-client-9999.ebuild b/app-emulation/rex-client/rex-client-9999.ebuild
new file mode 100644
index 000000000000..8eea78563fc8
--- /dev/null
+++ b/app-emulation/rex-client/rex-client-9999.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Remote EXexcution agent"
+HOMEPAGE="http://mduft.github.io/rex/"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/mduft/rex.git"
+else
+ SRC_URI=""
+ KEYWORDS="~x86-linux"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+
+REX_EXE=(
+ "client/rex-exec.sh"
+ "client/rex-register.sh"
+ "client/rex-paths.sh"
+ "client/rex-remote-pconv.sh"
+ "client/winpath2unix"
+ "client/unixpath2win"
+ )
+
+src_prepare() {
+ for x in ${REX_EXE[@]}; do
+ sed \
+ -e "s,\. \${HOME}/rex-config.sh,\. ${EPREFIX}/etc/rex.conf,g" \
+ -i "${x}" || die
+ done
+}
+
+src_install() {
+ for x in ${REX_EXE[@]}; do
+ dobin "${S}"/${x}
+ done
+
+ insinto /etc
+ newins client/rex-config.sh rex.conf
+}
diff --git a/app-emulation/runc/Manifest b/app-emulation/runc/Manifest
new file mode 100644
index 000000000000..1494296fb3d9
--- /dev/null
+++ b/app-emulation/runc/Manifest
@@ -0,0 +1 @@
+DIST runc-0.0.2.tar.gz 370712 SHA256 3d0aa68ebb1622853d0bbed432ebd4b6c9ef210881ac74f3a695b4e914d246dc SHA512 e0a44d5dd8a1b8eaeaf7d466cebc7dc8beaa26f49bd0e76d3a955cef9c5c266d2afe6652f28fa905a408b5b93966f52e345112fa7aef373216561ad7069181c5 WHIRLPOOL e7ed1ee3d159a81fb0b2b0f5fac9a9a66116035babc88f6f266a6c8455953ce372e93351baf7c621c42ab8c5907961fd899b1d158e7f7b1335f83fcef7252c71
diff --git a/app-emulation/runc/metadata.xml b/app-emulation/runc/metadata.xml
new file mode 100644
index 000000000000..ba8b76a7d180
--- /dev/null
+++ b/app-emulation/runc/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription lang="en">
+ runc is a CLI tool for spawning and running containers according
+ to the OCF (Open Container Format) specification.
+ </longdescription>
+ <maintainer>
+ <email>cardoe@gentoo.org</email>
+ <name>Doug Goldstein</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">opencontainers/runc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/runc/runc-0.0.2.ebuild b/app-emulation/runc/runc-0.0.2.ebuild
new file mode 100644
index 000000000000..f5bb49f1adfb
--- /dev/null
+++ b/app-emulation/runc/runc-0.0.2.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="runc container cli tools"
+HOMEPAGE="http://runc.io"
+
+GITHUB_URI="github.com/opencontainers/runc"
+
+if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="git://${GITHUB_URI}.git"
+ inherit git-r3
+else
+ SRC_URI="https://${GITHUB_URI}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+inherit multilib
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND=">=dev-lang/go-1.4:="
+RDEPEND=""
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ # Taken from app-emulation/docker-1.7.0-r1
+ export CGO_CFLAGS="-I${ROOT}/usr/include"
+ export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
+
+ # Setup GOPATH so things build
+ rm -rf .gopath
+ mkdir -p .gopath/src/"$(dirname "${GITHUB_URI}")"
+ ln -sf ../../../.. .gopath/src/"${GITHUB_URI}"
+ export GOPATH="${PWD}/.gopath:${PWD}/vendor"
+
+ make
+}
+
+src_install() {
+ dobin runc
+}
diff --git a/app-emulation/simh/Manifest b/app-emulation/simh/Manifest
new file mode 100644
index 000000000000..e30b80eca8e1
--- /dev/null
+++ b/app-emulation/simh/Manifest
@@ -0,0 +1,3 @@
+DIST simhv33-0.zip 2153444 SHA256 28fcdc8443f6e2460193eb6ed8d41be95d75226490926219a0dfd5028eaf051c SHA512 33d9dd4652f7a240a6f2d14be53dbb00bb03cf02e753d8e80defa4c83916ff28b79a2058d0ec0cc8b8eaf8c1c280d05c01e444e7b6087ccdc04fb3ec691f07ee WHIRLPOOL 683fe1dd5baf4504ea5b1b549a08f7b621831ca3b242ca5b1e40d326ceb2bda0e6db5630ecf43535c81706879b63d60e6d86dd409346f65ec5a477109c92646e
+DIST simhv38-1.zip 2954982 SHA256 4fe294fa5285b1d6d0bd69f60889c00e518ce2be5f00abc2bd4adfa8daa85b06 SHA512 b9ff1c2a9d52df98ca99f243dd89102f3afa9018d03990cefecb1fbf1c9d5244cc00335ada7d190d6890f81db9cd4606b02ab1b620854b8de7b2f489a74f1bdb WHIRLPOOL 7c30e3be18a82a7f9316f9d0c33601c34173ceb052d19c1126068a04df3ca9df339898cb44a4d110de4676717f5dfeebc18b306586f046176b805126175002a0
+DIST simhv39-0.zip 3103657 SHA256 e49b259b66ad6311ca9066dee3d3693cd915106a6938a52ed685cdbada8eda3b SHA512 5e8cbf92e980b7cb40d68ff60a266f70c0bef0eecdc169a8077ae72a6a71fe12a7be5c62bd033ca36727e2cb8f266a5a6f8a5ed6dd509afbf0a9d7b618f1a4f6 WHIRLPOOL 3b324046169df5b0378dfb00520c80b4372d2b7bd717484151e00dc17a8e60b42daaf8f8fd200cbf25ab693271783d9b307f4d34985de0f33bd68e484b92b2de
diff --git a/app-emulation/simh/files/makefile.patch b/app-emulation/simh/files/makefile.patch
new file mode 100644
index 000000000000..15cd4406a17e
--- /dev/null
+++ b/app-emulation/simh/files/makefile.patch
@@ -0,0 +1,11 @@
+--- simh/makefile 2004-12-09 15:37:34.823634965 +0000
++++ simh.new/makefile 2004-12-09 15:38:34.401562833 +0000
+@@ -13,7 +13,7 @@
+ CC = gcc -std=c99 -O2 -g -lm $(OS_CCDEFS) -I .
+ ifeq ($(USE_NETWORK),)
+ else
+-NETWORK_OPT = -DUSE_NETWORK -isystem /usr/local/include /usr/local/lib/libpcap.a
++NETWORK_OPT = -DUSE_NETWORK -DNEED_PCAP_SENDPACKET -lpcap
+ endif
+ else
+ #Win32 Environments
diff --git a/app-emulation/simh/files/simh-3.8.1-asneeded.patch b/app-emulation/simh/files/simh-3.8.1-asneeded.patch
new file mode 100644
index 000000000000..8843d3412a3b
--- /dev/null
+++ b/app-emulation/simh/files/simh-3.8.1-asneeded.patch
@@ -0,0 +1,168 @@
+--- makefile.orig 2010-09-07 15:30:17.000000000 -0400
++++ makefile 2010-09-07 15:31:37.000000000 -0400
+@@ -12,7 +12,8 @@
+ OS_CCDEFS = -lrt -lm -D_GNU_SOURCE
+ endif
+ endif
+- CC = gcc -std=c99 -U__STRICT_ANSI__ -g $(OS_CCDEFS) -I .
++ CC := $(CC) -std=c99 -U__STRICT_ANSI__ $(OS_CCDEFS) -I . $(CFLAGS)
++ LIBS = -lm -lrt
+ ifeq ($(USE_NETWORK),)
+ else
+ NETWORK_OPT = -DUSE_NETWORK -isystem /usr/local/include /usr/local/lib/libpcap.a
+@@ -274,129 +275,129 @@
+ pdp1 : ${BIN}pdp1${EXE}
+
+ ${BIN}pdp1${EXE} : ${PDP1} ${SIM}
+- ${CC} ${PDP1} ${SIM} ${PDP1_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${PDP1} ${SIM} ${PDP1_OPT} -o $@ $(LIBS)
+
+ pdp4 : ${BIN}pdp4${EXE}
+
+ ${BIN}pdp4${EXE} : ${PDP18B} ${SIM}
+- ${CC} ${PDP18B} ${SIM} ${PDP4_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${PDP18B} ${SIM} ${PDP4_OPT} -o $@ $(LIBS)
+
+ pdp7 : ${BIN}pdp7${EXE}
+
+ ${BIN}pdp7${EXE} : ${PDP18B} ${SIM}
+- ${CC} ${PDP18B} ${SIM} ${PDP7_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${PDP18B} ${SIM} ${PDP7_OPT} -o $@ $(LIBS)
+
+ pdp8 : ${BIN}pdp8${EXE}
+
+ ${BIN}pdp8${EXE} : ${PDP8} ${SIM}
+- ${CC} ${PDP8} ${SIM} ${PDP8_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${PDP8} ${SIM} ${PDP8_OPT} -o $@ $(LIBS)
+
+ pdp9 : ${BIN}pdp9${EXE}
+
+ ${BIN}pdp9${EXE} : ${PDP18B} ${SIM}
+- ${CC} ${PDP18B} ${SIM} ${PDP9_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${PDP18B} ${SIM} ${PDP9_OPT} -o $@ $(LIBS)
+
+ pdp15 : ${BIN}pdp15${EXE}
+
+ ${BIN}pdp15${EXE} : ${PDP18B} ${SIM}
+- ${CC} ${PDP18B} ${SIM} ${PDP15_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${PDP18B} ${SIM} ${PDP15_OPT} -o $@ $(LIBS)
+
+ pdp10 : ${BIN}pdp10${EXE}
+
+ ${BIN}pdp10${EXE} : ${PDP10} ${SIM}
+- ${CC} ${PDP10} ${SIM} ${PDP10_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${PDP10} ${SIM} ${PDP10_OPT} -o $@ $(LIBS)
+
+ pdp11 : ${BIN}pdp11${EXE}
+
+ ${BIN}pdp11${EXE} : ${PDP11} ${SIM}
+- ${CC} ${PDP11} ${SIM} ${PDP11_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${PDP11} ${SIM} ${PDP11_OPT} -o $@ $(LIBS)
+
+ vax : ${BIN}vax${EXE}
+
+ ${BIN}vax${EXE} : ${VAX} ${SIM}
+- ${CC} ${VAX} ${SIM} ${VAX_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${VAX} ${SIM} ${VAX_OPT} -o $@ $(LIBS)
+
+ vax780 : ${BIN}vax780${EXE}
+
+ ${BIN}vax780${EXE} : ${VAX780} ${SIM}
+- ${CC} ${VAX780} ${SIM} ${VAX780_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${VAX780} ${SIM} ${VAX780_OPT} -o $@ $(LIBS)
+
+ nova : ${BIN}nova${EXE}
+
+ ${BIN}nova${EXE} : ${NOVA} ${SIM}
+- ${CC} ${NOVA} ${SIM} ${NOVA_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${NOVA} ${SIM} ${NOVA_OPT} -o $@ $(LIBS)
+
+ eclipse : ${BIN}eclipse${EXE}
+
+ ${BIN}eclipse${EXE} : ${ECLIPSE} ${SIM}
+- ${CC} ${ECLIPSE} ${SIM} ${ECLIPSE_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${ECLIPSE} ${SIM} ${ECLIPSE_OPT} -o $@ $(LIBS)
+
+ h316 : ${BIN}h316${EXE}
+
+ ${BIN}h316${EXE} : ${H316} ${SIM}
+- ${CC} ${H316} ${SIM} ${H316_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${H316} ${SIM} ${H316_OPT} -o $@ $(LIBS)
+
+ hp2100 : ${BIN}hp2100${EXE}
+
+ ${BIN}hp2100${EXE} : ${HP2100} ${SIM}
+- ${CC} ${HP2100} ${SIM} ${HP2100_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${HP2100} ${SIM} ${HP2100_OPT} -o $@ $(LIBS)
+
+ i1401 : ${BIN}i1401${EXE}
+
+ ${BIN}i1401${EXE} : ${I1401} ${SIM}
+- ${CC} ${I1401} ${SIM} ${I1401_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${I1401} ${SIM} ${I1401_OPT} -o $@ $(LIBS)
+
+ i1620 : ${BIN}i1620${EXE}
+
+ ${BIN}i1620${EXE} : ${I1620} ${SIM}
+- ${CC} ${I1620} ${SIM} ${I1620_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${I1620} ${SIM} ${I1620_OPT} -o $@ $(LIBS)
+
+ i7094 : ${BIN}i7094${EXE}
+
+ ${BIN}i7094${EXE} : ${I7094} ${SIM}
+- ${CC} ${I7094} ${SIM} ${I7094_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${I7094} ${SIM} ${I7094_OPT} -o $@ $(LIBS)
+
+ ibm1130 : ${BIN}ibm1130${EXE}
+
+ ${BIN}ibm1130${EXE} : ${IBM1130}
+- ${CC} ${IBM1130} ${SIM} ${IBM1130_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${IBM1130} ${SIM} ${IBM1130_OPT} -o $@ $(LIBS)
+
+ s3 : ${BIN}s3${EXE}
+
+ ${BIN}s3${EXE} : ${S3} ${SIM}
+- ${CC} ${S3} ${SIM} ${S3_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${S3} ${SIM} ${S3_OPT} -o $@ $(LIBS)
+
+ altair : ${BIN}altair${EXE}
+
+ ${BIN}altair${EXE} : ${ALTAIR} ${SIM}
+- ${CC} ${ALTAIR} ${SIM} ${ALTAIR_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${ALTAIR} ${SIM} ${ALTAIR_OPT} -o $@ $(LIBS)
+
+ altairz80 : ${BIN}altairz80${EXE}
+
+ ${BIN}altairz80${EXE} : ${ALTAIRZ80} ${SIM}
+- ${CC} ${ALTAIRZ80} ${SIM} ${ALTAIRZ80_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${ALTAIRZ80} ${SIM} ${ALTAIRZ80_OPT} -o $@ $(LIBS)
+
+ gri : ${BIN}gri${EXE}
+
+ ${BIN}gri${EXE} : ${GRI} ${SIM}
+- ${CC} ${GRI} ${SIM} ${GRI_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${GRI} ${SIM} ${GRI_OPT} -o $@ $(LIBS)
+
+ lgp : ${BIN}lgp${EXE}
+
+ ${BIN}lgp${EXE} : ${LGP} ${SIM}
+- ${CC} ${LGP} ${SIM} ${LGP_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${LGP} ${SIM} ${LGP_OPT} -o $@ $(LIBS)
+
+ id16 : ${BIN}id16${EXE}
+
+ ${BIN}id16${EXE} : ${ID16} ${SIM}
+- ${CC} ${ID16} ${SIM} ${ID16_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${ID16} ${SIM} ${ID16_OPT} -o $@ $(LIBS)
+
+ id32 : ${BIN}id32${EXE}
+
+ ${BIN}id32${EXE} : ${ID32} ${SIM}
+- ${CC} ${ID32} ${SIM} ${ID32_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${ID32} ${SIM} ${ID32_OPT} -o $@ $(LIBS)
+
+ sds : ${BIN}sds${EXE}
+
+ ${BIN}sds${EXE} : ${SDS} ${SIM}
+- ${CC} ${SDS} ${SIM} ${SDS_OPT} -o $@ ${LDFLAGS}
++ ${CC} $(LDFLAGS) ${SDS} ${SIM} ${SDS_OPT} -o $@ $(LIBS)
diff --git a/app-emulation/simh/files/simh-3.8.1-makefile.patch b/app-emulation/simh/files/simh-3.8.1-makefile.patch
new file mode 100644
index 000000000000..612a4afce2c9
--- /dev/null
+++ b/app-emulation/simh/files/simh-3.8.1-makefile.patch
@@ -0,0 +1,11 @@
+--- makefile.orig 2010-09-07 15:05:01.000000000 -0400
++++ makefile 2010-09-07 15:05:19.000000000 -0400
+@@ -15,7 +15,7 @@
+ CC = gcc -std=c99 -U__STRICT_ANSI__ -g $(OS_CCDEFS) -I .
+ ifeq ($(USE_NETWORK),)
+ else
+- NETWORK_OPT = -DUSE_NETWORK -isystem /usr/local/include /usr/local/lib/libpcap.a
++ NETWORK_OPT = -DUSE_NETWORK -DNEED_PCAP_SENDPACKET -lpcap
+ endif
+ else
+ #Win32 Environments
diff --git a/app-emulation/simh/files/simh-3.9.0-fix-mkdir-race.patch b/app-emulation/simh/files/simh-3.9.0-fix-mkdir-race.patch
new file mode 100644
index 000000000000..3a2aae35207c
--- /dev/null
+++ b/app-emulation/simh/files/simh-3.9.0-fix-mkdir-race.patch
@@ -0,0 +1,11 @@
+--- simh-3.9.0/makefile
++++ simh-3.9.0/makefile
+@@ -249,7 +249,7 @@
+ NETWORK_OPT = $(NETWORK_CCDEFS)
+ endif
+ ifneq (binexists,$(shell if $(TEST) -e BIN; then echo binexists; fi))
+- MKDIRBIN = if $(TEST) ! -e BIN; then mkdir BIN; fi
++ MKDIRBIN = mkdir -p BIN
+ endif
+ else
+ #Win32 Environments (via MinGW32)
diff --git a/app-emulation/simh/files/simh-3.9.0-respect-FLAGS.patch b/app-emulation/simh/files/simh-3.9.0-respect-FLAGS.patch
new file mode 100644
index 000000000000..0f7cd1d114ea
--- /dev/null
+++ b/app-emulation/simh/files/simh-3.9.0-respect-FLAGS.patch
@@ -0,0 +1,13 @@
+--- simh-3.9.0/makefile
++++ simh-3.9.0/makefile
+@@ -300,8 +300,8 @@
+ CFLAGS_O = -O0
+ BUILD_FEATURES = - debugging support
+ else
+- CFLAGS_O = -O2
+- LDFLAGS_O =
++ CFLAGS_O ?= -O2
++ LDFLAGS_O ?=
+ GCC_MAJOR_VERSION = $(firstword $(subst ., ,$(GCC_VERSION)))
+ ifneq (3,$(GCC_MAJOR_VERSION))
+ ifeq (,$(GCC_OPTIMIZERS_CMD))
diff --git a/app-emulation/simh/metadata.xml b/app-emulation/simh/metadata.xml
new file mode 100644
index 000000000000..1adcc9617845
--- /dev/null
+++ b/app-emulation/simh/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>alex.buell@munted.eu</email>
+ <name>Alex Buell</name>
+ </maintainer>
+ <maintainer>
+ <email>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/simh/simh-3.3.0.ebuild b/app-emulation/simh/simh-3.3.0.ebuild
new file mode 100644
index 000000000000..ac5ffef39723
--- /dev/null
+++ b/app-emulation/simh/simh-3.3.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils versionator
+
+MY_P="${PN}v$(get_version_component_range 1)$(get_version_component_range 2)-$(get_version_component_range 3)"
+DESCRIPTION="a simulator for historical computers such as Vax, PDP-11 etc.)"
+HOMEPAGE="http://simh.trailing-edge.com/"
+SRC_URI="http://simh.trailing-edge.com/sources/${MY_P}.zip"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="x86"
+
+RDEPEND="net-libs/libpcap"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S="${WORKDIR}"
+
+MAKEOPTS="USE_NETWORK=1 ${MAKEOPTS}"
+
+src_unpack() {
+ mkdir "${WORKDIR}/BIN"
+ unpack ${A}
+
+ # convert makefile from dos format to unix format
+ sed -i 's/.$//' makefile
+
+ epatch "${FILESDIR}/makefile.patch"
+}
+
+src_compile() {
+ emake || die "make failed"
+}
+
+src_install() {
+ cd "${S}/BIN"
+ for BINFILE in *; do
+ newbin ${BINFILE} "simh-${BINFILE}"
+ done
+
+ cd "${S}"
+ dodir /usr/share/simh
+ insinto /usr/share/simh
+ doins VAX/*.bin
+ dodoc *.txt */*.txt
+}
diff --git a/app-emulation/simh/simh-3.8.1.ebuild b/app-emulation/simh/simh-3.8.1.ebuild
new file mode 100644
index 000000000000..8cc23cddc6f9
--- /dev/null
+++ b/app-emulation/simh/simh-3.8.1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs versionator
+
+MY_P="${PN}v$(get_version_component_range 1)$(get_version_component_range 2)-$(get_version_component_range 3)"
+DESCRIPTION="a simulator for historical computers such as Vax, PDP-11 etc.)"
+HOMEPAGE="http://simh.trailing-edge.com/"
+SRC_URI="http://simh.trailing-edge.com/sources/${MY_P}.zip"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE=""
+
+RDEPEND="net-libs/libpcap"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}
+
+MAKEOPTS="USE_NETWORK=1 ${MAKEOPTS}"
+
+src_unpack() {
+ mkdir "${WORKDIR}/BIN"
+ unpack ${A}
+
+ # convert makefile from dos format to unix format
+ edos2unix makefile
+
+ epatch "${FILESDIR}/${P}-makefile.patch" \
+ "${FILESDIR}/${P}-asneeded.patch"
+
+ # fix linking on Darwin
+ [[ ${CHOST} == *-darwin* ]] && sed -i 's/-lrt//g' makefile
+}
+
+src_compile() {
+ tc-export CC
+ emake || die "make failed"
+}
+
+src_install() {
+ cd "${S}/BIN"
+ for BINFILE in *; do
+ newbin ${BINFILE} "simh-${BINFILE}"
+ done
+
+ cd "${S}"
+ dodir /usr/share/simh
+ insinto /usr/share/simh
+ doins VAX/*.bin
+ dodoc *.txt */*.txt
+}
diff --git a/app-emulation/simh/simh-3.9.0-r1.ebuild b/app-emulation/simh/simh-3.9.0-r1.ebuild
new file mode 100644
index 000000000000..1149d0f161cc
--- /dev/null
+++ b/app-emulation/simh/simh-3.9.0-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs versionator
+
+MY_P="${PN}v$(get_version_component_range 1)$(get_version_component_range 2)-$(get_version_component_range 3)"
+DESCRIPTION="a simulator for historical computers such as Vax, PDP-11 etc.)"
+HOMEPAGE="http://simh.trailing-edge.com/"
+SRC_URI="http://simh.trailing-edge.com/sources/${MY_P}.zip"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE=""
+
+RDEPEND="net-libs/libpcap"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}
+
+src_prepare() {
+ # convert makefile from dos format to unix format
+ edos2unix makefile
+
+ epatch "${FILESDIR}"/${P}-respect-FLAGS.patch \
+ "${FILESDIR}"/${P}-fix-mkdir-race.patch
+
+ # fix linking on Darwin
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ sed -e 's/-lrt//g' \
+ -i makefile || die
+ fi
+}
+
+src_compile() {
+ export GCC="$(tc-getCC)"
+ export LDFLAGS_O="${LDFLAGS}"
+ export CFLAGS_O="${CFLAGS}"
+
+ local my_makeopts="USE_NETWORK=1"
+ if [ "$(gcc-major-version)" -le "4" -a "$(gcc-minor-version)" -lt "6" ] ; then
+ my_makeopts+=" NO_LTO=1"
+ fi
+
+ emake ${my_makeopts}
+}
+
+src_install() {
+ for BINFILE in BIN/* ; do
+ newbin ${BINFILE} "simh-$(basename ${BINFILE})"
+ done
+
+ insinto /usr/share/simh
+ doins VAX/*.bin
+
+ dodoc *.txt */*.txt
+}
diff --git a/app-emulation/ski/Manifest b/app-emulation/ski/Manifest
new file mode 100644
index 000000000000..d22f98f73de6
--- /dev/null
+++ b/app-emulation/ski/Manifest
@@ -0,0 +1 @@
+DIST ski-1.3.2.tar.gz 2715791 SHA256 34b2a1b2575d6c8703df8f1f3980f7b668e744c4a03f20ed4ed91d40cf40c076 SHA512 21f2e1dd87cb517602d4d6ef62707ec6042c1b6ec5dfd063db7315d13bbc3fb47b491c15b7efb0433fc82f27c7924e2d50b2f57fe24e49aeb864ce2c3c2c8bd0 WHIRLPOOL a6b00dc928612a37c33dc3dacd8a53f749ffa660f3aef5572b214e5c97ed93728e987c4be8abb2d375e0a84eb3037f9de490f3f0474a579e3c0476e50d6010ef
diff --git a/app-emulation/ski/files/ski-1.3.2-AC_C_BIGENDIAN.patch b/app-emulation/ski/files/ski-1.3.2-AC_C_BIGENDIAN.patch
new file mode 100644
index 000000000000..34a7d8183702
--- /dev/null
+++ b/app-emulation/ski/files/ski-1.3.2-AC_C_BIGENDIAN.patch
@@ -0,0 +1,75 @@
+use standard AC_C_BIGENDIAN macro rather than trying to define it manually
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -155,52 +155,24 @@ AC_SUBST(GSKI_CFLAGS)
+ AC_SUBST(GSKI_LIBS)
+ AM_CONDITIONAL(WITH_GTK_INTERFACE, test "x$with_gtk" = "xyes")
+
+-dnl Target endianness
+-AC_ARG_ENABLE(bigendian,
+-AC_HELP_STRING([--enable-bigendian],
+- [the target is big endian default=no]),
+-ski_cv_c_target_bigendian=${enableval}, ski_cv_c_target_bigendian=no)
+-
+ dnl Check for host endianness
+ AC_CACHE_CHECK([whether host byte ordering is defined in sys/param.h],
+ ski_cv_c_bigendian_compile,
+ [AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/param.h>
+ ],[
+ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ #error bogus endian macros
+ #endif
+ ],
+ ski_cv_c_bigendian_compile=yes, ski_cv_c_bigendian_compile=no)])
+
+ if test "x$ski_cv_c_bigendian_compile" = xyes; then
+ AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1,
+ [define if sys/param.h defines the endiness])
+-else
+-AC_CACHE_CHECK([whether host byte ordering is big endian],
+-ski_cv_c_bigendian,
+-[AC_TRY_RUN([int main () {
+- union {
+- long l;
+- char c[sizeof (long)];
+- } u;
+- u.l = 1;
+- return (u.c[sizeof (long) - 1] == 1);
+-}],
+-ski_cv_c_bigendian=no, ski_cv_c_bigendian=yes,
+-AC_MSG_ERROR([cannot detect host endianness]))])
+-
+-AC_DEFINE(BIG_ENDIAN, 4321, [define to 4321 if missing from sys/param.h])
+-AC_DEFINE(LITTLE_ENDIAN, 1234, [define to 4321 if missing from sys/param.h])
+-if test "x$ski_cv_c_bigendian" = xyes; then
+- AC_DEFINE(BYTE_ORDER, 4321,
+- [define to 4321 if host is big endian, 1234 if little endian])
+-else
+- AC_DEFINE(BYTE_ORDER, 1234,
+- [define to 4321 if host is big endian, 1234 if little endian])
+-fi
+ fi
++AC_C_BIGENDIAN
+
+ dnl Check for variables & functions
+
+--- a/src/std.h
++++ b/src/std.h
+@@ -62,6 +62,14 @@ extern unsigned long long __strtoull(const char *, char **, int);
+ # define BIG_ENDIAN 4321
+ # define LITTLE_ENDIAN 1234
+ # define BYTE_ORDER BIG_ENDIAN
++# else
++# define BIG_ENDIAN 4321
++# define LITTLE_ENDIAN 1234
++# ifdef WORDS_BIGENDIAN
++# define BYTE_ORDER BIG_ENDIAN
++# else
++# define BYTE_ORDER LITTLE_ENDIAN
++# endif
+ # endif /* !defined HAVE_CONFIG_H */
+ #endif /* !defined ENDIANESS_IN_SYS_PARAM_H */
+
diff --git a/app-emulation/ski/files/ski-1.3.2-binutils.patch b/app-emulation/ski/files/ski-1.3.2-binutils.patch
new file mode 100644
index 000000000000..71094f3bf4b6
--- /dev/null
+++ b/app-emulation/ski/files/ski-1.3.2-binutils.patch
@@ -0,0 +1,31 @@
+From 30d3253c6b413ba22ca0ca30dcd4c4c24daec2e1 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Tue, 19 Aug 2014 09:42:43 +0300
+Subject: [PATCH] Fix build failure against binutils-2.16.1 and upper.
+
+Follow binutils' upstream change from 2004:
+
+ https://sourceware.org/git/?p=binutils.git;a=commitdiff;h=7e2dd9e4c3e0b69dcb7d471b891879b5fd28687e
+ > section.c (struct sec): Rename "_cooked_size" to "size".
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ src/linux/dwarf-linux.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/linux/dwarf-linux.c b/src/linux/dwarf-linux.c
+index 1941a1f..73be0e6 100644
+--- a/src/linux/dwarf-linux.c
++++ b/src/linux/dwarf-linux.c
+@@ -155,7 +155,7 @@ find_in_section (bfd * bfd, asection * sect, PTR obj)
+ first.function = function;
+ first.line = line;
+ first.num_lines = 1;
+- first.limit = sect->_cooked_size;
++ first.limit = sect->size;
+ last_line = line;
+ }
+ if (line > last_line
+--
+2.0.4
+
diff --git a/app-emulation/ski/files/ski-1.3.2-configure-withval.patch b/app-emulation/ski/files/ski-1.3.2-configure-withval.patch
new file mode 100644
index 000000000000..7bb3ce9fc85c
--- /dev/null
+++ b/app-emulation/ski/files/ski-1.3.2-configure-withval.patch
@@ -0,0 +1,22 @@
+fix handling of 3rd/4th args to AC_ARG_WITH()
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -130,7 +130,7 @@ dnl See if we build X11
+ AC_ARG_WITH(x11,
+ AC_HELP_STRING([--with-x11],
+ [Enable the Motif based X11 interface default=no]),
+- [with_x11=yes],[with_x11=no])
++ [with_x11=$withval])
+
+ if test "x$with_x11" = "xyes"; then
+ dnl Check for motif, error out if not found
+@@ -144,7 +144,7 @@ dnl See if we build GTK
+ AC_ARG_WITH(gtk,
+ AC_HELP_STRING([--with-gtk],
+ [Enable building the GTK Ski interface default=no]),
+- [with_gtk=yes],[with_gtk=no]
++ [with_gtk=$withval]
+ )
+
+ if test "x$with_gtk" = "xyes"; then
diff --git a/app-emulation/ski/files/ski-1.3.2-no-local-ltdl.patch b/app-emulation/ski/files/ski-1.3.2-no-local-ltdl.patch
new file mode 100644
index 000000000000..aa75146668b5
--- /dev/null
+++ b/app-emulation/ski/files/ski-1.3.2-no-local-ltdl.patch
@@ -0,0 +1,22 @@
+build against the system ltdl rather than the local copy
+
+--- ski-1.3.2/src/Makefile.am
++++ ski-1.3.2/src/Makefile.am
+@@ -181,8 +181,7 @@
+ eparse.h \
+ libdas.h \
+ netdev.h \
+- osload.h \
+- ltdl.h
++ osload.h
+
+ EXTRA_linux_FILES = \
+ linux/dwarf-linux.c \
+@@ -279,7 +278,6 @@
+ eparse.y \
+ escan.l \
+ load.c \
+- ltdl.c \
+ platform.c \
+ libdas.c \
+ libsrs.c
diff --git a/app-emulation/ski/files/ski-1.3.2-remove-hayes.patch b/app-emulation/ski/files/ski-1.3.2-remove-hayes.patch
new file mode 100644
index 000000000000..3e9de483fd17
--- /dev/null
+++ b/app-emulation/ski/files/ski-1.3.2-remove-hayes.patch
@@ -0,0 +1,14 @@
+## Description: Remove references to HAYES
+## Origin/Author: Andreas Moog <amoog@ubuntu.com>
+## Bug-Ubuntu: https://bugs.launchpad.net/bugs/756157
+--- ski//src/linux/syscall-linux.c
++++ ski.new//src/linux/syscall-linux.c
+@@ -2250,8 +2250,6 @@
+ case TIOCSERSETMULTI: /* Set multiport config */
+ case TIOCMIWAIT: /* wait for a change on serial input line(s) */
+ case TIOCGICOUNT: /* read serial port inline interrupt counts */
+- case TIOCGHAYESESP: /* Get Hayes ESP configuration */
+- case TIOCSHAYESESP: /* Set Hayes ESP configuration */
+ case SIOCRTMSG: /* call to routing system */
+ case SIOCSIFLINK: /* set iface channel */
+ case SIOCGIFMEM: /* get memory address (BSD) */
diff --git a/app-emulation/ski/files/ski-1.3.2-syscall-linux-includes.patch b/app-emulation/ski/files/ski-1.3.2-syscall-linux-includes.patch
new file mode 100644
index 000000000000..e3c1083687ac
--- /dev/null
+++ b/app-emulation/ski/files/ski-1.3.2-syscall-linux-includes.patch
@@ -0,0 +1,18 @@
+--- ski-1.3.2/src/linux/syscall-linux.c
++++ ski-1.3.2/src/linux/syscall-linux.c
+@@ -45,7 +45,6 @@
+ #include <linux/posix_types.h>
+ #include <linux/personality.h>
+ #include <linux/sockios.h>
+-#include <sys/io.h>
+
+ #include <sys/file.h>
+ #include <sys/fsuid.h>
+@@ -72,7 +71,6 @@
+ #include <sys/uio.h>
+
+ #include <linux/serial.h>
+-#include <asm/page.h>
+ #include <asm/unistd.h>
+
+ #include "std.h"
diff --git a/app-emulation/ski/metadata.xml b/app-emulation/ski/metadata.xml
new file mode 100644
index 000000000000..96baef6ac811
--- /dev/null
+++ b/app-emulation/ski/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ia64</herd>
+ <upstream>
+ <remote-id type="sourceforge">ski</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/ski/ski-1.3.2-r1.ebuild b/app-emulation/ski/ski-1.3.2-r1.ebuild
new file mode 100644
index 000000000000..875a6ddf4361
--- /dev/null
+++ b/app-emulation/ski/ski-1.3.2-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit autotools eutils
+
+DESCRIPTION="ia64 instruction set simulator"
+HOMEPAGE="http://ski.sourceforge.net/ http://www.gelato.unsw.edu.au/IA64wiki/SkiSimulator"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+gtk motif"
+
+RDEPEND="dev-libs/libltdl:0
+ || ( dev-libs/elfutils dev-libs/libelf )
+ sys-libs/ncurses
+ gtk? (
+ gnome-base/libglade:2.0
+ gnome-base/libgnomeui
+ x11-libs/gtk+:2
+ )
+ motif? ( x11-libs/motif )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex
+ dev-util/gperf"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-syscall-linux-includes.patch
+ "${FILESDIR}"/${P}-remove-hayes.patch
+ "${FILESDIR}"/${P}-no-local-ltdl.patch
+ "${FILESDIR}"/${P}-AC_C_BIGENDIAN.patch
+ "${FILESDIR}"/${P}-configure-withval.patch
+ "${FILESDIR}"/${P}-binutils.patch
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+
+ rm -rf libltdl src/ltdl.[ch] macros/ltdl.m4
+
+ AT_M4DIR="macros" eautoreconf
+}
+
+src_configure() {
+ econf \
+ --without-included-ltdl \
+ $(use_with gtk) \
+ $(use_with motif x11)
+}
diff --git a/app-emulation/ski/ski-1.3.2.ebuild b/app-emulation/ski/ski-1.3.2.ebuild
new file mode 100644
index 000000000000..4d62c2acc364
--- /dev/null
+++ b/app-emulation/ski/ski-1.3.2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit autotools eutils
+
+DESCRIPTION="ia64 instruction set simulator"
+HOMEPAGE="http://ski.sourceforge.net/ http://www.gelato.unsw.edu.au/IA64wiki/SkiSimulator"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+gtk motif"
+
+RDEPEND="dev-libs/libltdl
+ || ( dev-libs/elfutils dev-libs/libelf )
+ sys-libs/ncurses
+ gtk? (
+ gnome-base/libglade:2.0
+ gnome-base/libgnomeui
+ x11-libs/gtk+:2
+ )
+ motif? ( x11-libs/motif )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex
+ dev-util/gperf"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-syscall-linux-includes.patch
+ "${FILESDIR}"/${P}-remove-hayes.patch
+ "${FILESDIR}"/${P}-no-local-ltdl.patch
+ "${FILESDIR}"/${P}-AC_C_BIGENDIAN.patch
+ "${FILESDIR}"/${P}-configure-withval.patch
+ "${FILESDIR}"/${P}-binutils.patch
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+
+ rm -rf libltdl src/ltdl.[ch] macros/ltdl.m4
+
+ AT_M4DIR="macros" eautoreconf
+}
+
+src_configure() {
+ econf \
+ --without-included-ltdl \
+ $(use_with gtk) \
+ $(use_with motif x11)
+}
diff --git a/app-emulation/skyeye/Manifest b/app-emulation/skyeye/Manifest
new file mode 100644
index 000000000000..9b609bece41d
--- /dev/null
+++ b/app-emulation/skyeye/Manifest
@@ -0,0 +1 @@
+DIST skyeye-1.0.0.tar.bz2 235167 SHA256 b3a773354ab98932f70cbb5cdcee98369640827d85902b94cd6a1565c42df688 SHA512 d1407f254b2465b7f5e4ef40f7c0ecd4237d0183e8328b1b183c9657a79fcca006376b9525d8e64dacfceaaac5b3b87ca15c3e3ce0ed082e7f4c55b87ff3892a WHIRLPOOL 580fd902a638642963f430244b13c58d79497a29d666ebdd1f3f880a632b77c237ac011ec269747f60bdc4be6d442c43a700cd64ed85de01bb7380981b88e1af
diff --git a/app-emulation/skyeye/metadata.xml b/app-emulation/skyeye/metadata.xml
new file mode 100644
index 000000000000..5454528f2093
--- /dev/null
+++ b/app-emulation/skyeye/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>arm</herd>
+</pkgmetadata>
diff --git a/app-emulation/skyeye/skyeye-1.0.0.ebuild b/app-emulation/skyeye/skyeye-1.0.0.ebuild
new file mode 100644
index 000000000000..8fbb1b1191f8
--- /dev/null
+++ b/app-emulation/skyeye/skyeye-1.0.0.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+DESCRIPTION="an ARM embedded hardware simulator"
+HOMEPAGE="http://www.skyeye.org/"
+SRC_URI="http://download.gro.clinux.org/skyeye/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND="sys-libs/ncurses
+ media-libs/freetype
+ x11-libs/gtk+:2
+ dev-libs/glib:2
+ x11-libs/pango"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_install() {
+ dobin binary/skyeye || die "skyeye"
+ dodoc ChangeLog README
+}
diff --git a/app-emulation/softgun/Manifest b/app-emulation/softgun/Manifest
new file mode 100644
index 000000000000..dbb53766a0ae
--- /dev/null
+++ b/app-emulation/softgun/Manifest
@@ -0,0 +1,2 @@
+DIST softgun-0.21.tgz 1126433 SHA256 a133b6d1062545cbad78442902c9b447bc8307b08e055933fed177659b34eea5 SHA512 145c6e8407e57353212dcb7ab8193c9b5d5c7fa6271dfbe3f4637c236b07989ef61729f55850da14639dc7d7d64ad5b68c73783e634dc5d2763865977c62ca8a WHIRLPOOL a4fcaae3846ecedb863d16673630cc5b7346af010dc21fd4161b7a5a3ec8af24a1a4db018835f0b2860cc06aed4843aaba41cc47ef18a91ae5c5933e7f82be08
+DIST softgun-0.22.tgz 1239881 SHA256 413d0137a3ee588ab76703058d9bc132f25b4f760ff5a97d6150ffe2f9d2e2fb SHA512 5c13840874b09aab6c0921d705c0ea94da87cc1a80d2fcbc9f329ade25f33bb2c8eba2fe284b4c3b41e70b8f258a45fc83caa296880bfa3e7870994de587e591 WHIRLPOOL cbbb2745b9e5cf72a18fcea87c604078db436ec6376c918920f31132fdfae246fea6f9279260787e25481e43013e200e19a9b7aef05ccd469caaa84c9effb34d
diff --git a/app-emulation/softgun/files/softgun-0.21-make.patch b/app-emulation/softgun/files/softgun-0.21-make.patch
new file mode 100644
index 000000000000..bb3ded406a0a
--- /dev/null
+++ b/app-emulation/softgun/files/softgun-0.21-make.patch
@@ -0,0 +1,68 @@
+--- softgun-0.21/config.mk
++++ softgun-0.21/config.mk
+@@ -9,7 +9,7 @@ bindir=$(prefix)/bin
+ libdir=$(prefix)/lib/softgun/
+
+ #CFLAGS=-Wall -pg -O1 -g
+-CFLAGS=-Wall -O9 -g -fomit-frame-pointer -fno-strict-overflow -Wstrict-overflow=3 -Wno-unused-but-set-variable
++CFLAGS+=-fno-strict-overflow -Wstrict-overflow=3 -Wno-unused-but-set-variable
+ DEFS=-D_GNU_SOURCE
+ INCLUDES:=-I$(top_srcdir) -I.
+
+@@ -19,13 +19,13 @@
+ SHAREDLDFLAGS=-nostdlib -shared
+ CYGWIN=$(findstring CYGWIN,$(shell uname))
+ ifeq ($(shell uname),Linux)
+-LDFLAGS=-lpthread -lrt -lm -lz -lasound
++LDLIBS=-lpthread -ldl -lrt -lm -lz -lasound
+ else
+ ifeq ($(shell uname),FreeBSD)
+- LDFLAGS=-lpthread -lm -lz -lSDL
++ LDLIBS=-lpthread -lm -lz -lSDL
+ else
+ ifeq ($(CYGWIN),CYGWIN)
+- LDFLAGS=-lpthread -lrt -lm -lz
++ LDLIBS=-lpthread -lrt -lm -lz
+ else
+ $(error "Unknown architecture $(shell uname)")
+ endif
+--- softgun-0.21/Makefile
++++ softgun-0.21/Makefile
+@@ -116,7 +116,7 @@
+
+
+ softgun: $(OBJS)
+- $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
+
+ boards/libboards.a:
+ $(MAKE) -C boards libboards.a
+--- softgun-0.21/printer/module.mk
++++ softgun-0.21/printer/module.mk
+@@ -5,5 +5,5 @@
+ INSTALL_BINS += pcl3gui2png
+
+ pcl3gui2png: $(PRINTER_OBJS) printer/pcl3gui2png.c
+- $(CC) -o $@ $(PRINTER_OBJS) printer/pcl3gui2png.c
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
+
+--- softgun-0.21/tools/Makefile
++++ softgun-0.21/tools/Makefile
+@@ -2,7 +2,7 @@ include ../config.mk
+
+ ifeq ($(shell uname),Linux)
+ sg_tunctl: tunctl.c
+- $(CC) $(CFLAGS) tunctl.c -o sg_tunctl
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
+
+ install:
+ install -m 0755 sg_tunctl $(bindir)
+@@ -14,7 +14,7 @@ install:
+ endif
+
+ to_c_array: to_c_array.c
+- $(CC) $(CFLAGS) to_c_array.c -o to_c_array
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
+
+
+ clean:
diff --git a/app-emulation/softgun/files/softgun-0.22-make.patch b/app-emulation/softgun/files/softgun-0.22-make.patch
new file mode 100644
index 000000000000..9d1ea9b38e0d
--- /dev/null
+++ b/app-emulation/softgun/files/softgun-0.22-make.patch
@@ -0,0 +1,75 @@
+--- softgun-0.22/config.mk
++++ softgun-0.22/config.mk
+@@ -9,7 +9,7 @@ bindir=$(prefix)/bin
+ libdir=$(prefix)/lib/softgun/
+
+ #CFLAGS=-Wall -pg -O0 -DPROFILE
+-CFLAGS=-Wall -O9 -g -fomit-frame-pointer -fno-strict-overflow -Wstrict-overflow=3 -Wno-unused-but-set-variable
+-DEFS=-D_GNU_SOURCE
++CFLAGS+=-Wall -fno-strict-overflow -Wstrict-overflow=3 -Wno-unused-but-set-variable -fno-strict-aliasing
++DEFS=$(CPPFLAGS) -D_GNU_SOURCE
+ INCLUDES:=-I$(top_srcdir) -I.
+
+@@ -17,15 +17,16 @@ INCLUDES:=-I$(top_srcdir) -I.
+ # to omit stack protection symbol in object file
+ SHAREDCFLAGS=-fPIC -nostdlib -D_SHARED_
+ SHAREDLDFLAGS=-nostdlib -shared
+-CYGWIN=$(findstring CYGWIN,$(shell uname))
+-ifeq ($(shell uname),Linux)
+-LDFLAGS=-lpthread -lrt -lm -lz -lasound
++UNAME=$(shell uname)
++CYGWIN=$(findstring CYGWIN,$(UNAME))
++ifeq ($(UNAME),Linux)
++LDLIBS=-lpthread -ldl -lrt -lm -lz -lasound
+ else
+- ifeq ($(shell uname),FreeBSD)
+- LDFLAGS=-lpthread -lm -lz -lSDL
++ ifeq ($(UNAME),FreeBSD)
++ LDLIBS=-lpthread -lm -lz -lSDL
+ else
+ ifeq ($(CYGWIN),CYGWIN)
+- LDFLAGS=-lpthread -lrt -lm -lz
++ LDLIBS=-lpthread -lrt -lm -lz
+ else
+ $(error "Unknown architecture $(shell uname)")
+ endif
+--- softgun-0.22/Makefile
++++ softgun-0.22/Makefile
+@@ -116,7 +116,7 @@
+
+
+ softgun: $(OBJS)
+- $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
+
+ boards/libboards.a:
+ $(MAKE) -C boards libboards.a
+--- softgun-0.22/printer/module.mk
++++ softgun-0.22/printer/module.mk
+@@ -5,5 +5,5 @@
+ INSTALL_BINS += pcl3gui2png
+
+ pcl3gui2png: $(PRINTER_OBJS) printer/pcl3gui2png.c
+- $(CC) -o $@ $(PRINTER_OBJS) printer/pcl3gui2png.c
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
+
+--- softgun-0.22/tools/Makefile
++++ softgun-0.22/tools/Makefile
+@@ -2,7 +2,7 @@ include ../config.mk
+
+ ifeq ($(shell uname),Linux)
+ sg_tunctl: tunctl.c
+- $(CC) $(CFLAGS) tunctl.c -o sg_tunctl
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
+
+ install:
+ install -m 0755 sg_tunctl $(bindir)
+@@ -14,7 +14,7 @@ install:
+ endif
+
+ to_c_array: to_c_array.c
+- $(CC) $(CFLAGS) to_c_array.c -o to_c_array
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
+
+
+ clean:
diff --git a/app-emulation/softgun/metadata.xml b/app-emulation/softgun/metadata.xml
new file mode 100644
index 000000000000..3e94ca34282f
--- /dev/null
+++ b/app-emulation/softgun/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>arm</herd>
+ <upstream>
+ <remote-id type="sourceforge">softgun</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/softgun/softgun-0.21.ebuild b/app-emulation/softgun/softgun-0.21.ebuild
new file mode 100644
index 000000000000..16e6be2b0b79
--- /dev/null
+++ b/app-emulation/softgun/softgun-0.21.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="ARM software emulator"
+HOMEPAGE="http://softgun.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.21-make.patch
+ sed -i \
+ -e "/^CFLAGS/s:-O9.*-Werror:${CFLAGS}:" \
+ config.mk || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dodir /usr/bin
+ emake install prefix="${D}/usr"
+ dodoc README configs/*.sg
+}
diff --git a/app-emulation/softgun/softgun-0.22.ebuild b/app-emulation/softgun/softgun-0.22.ebuild
new file mode 100644
index 000000000000..a87216dcd5bf
--- /dev/null
+++ b/app-emulation/softgun/softgun-0.22.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="ARM software emulator"
+HOMEPAGE="http://softgun.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND="media-libs/alsa-lib"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.22-make.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dodir /usr/bin
+ emake install prefix="${D}/usr"
+ dodoc README configs/*.sg
+}
diff --git a/app-emulation/spectemu/Manifest b/app-emulation/spectemu/Manifest
new file mode 100644
index 000000000000..8e3314e68712
--- /dev/null
+++ b/app-emulation/spectemu/Manifest
@@ -0,0 +1 @@
+DIST spectemu-0.99.3.tar.gz 269524 SHA256 a3f51176fdbcdbd1cdf8e0bab6b668a548c79b8fc699d5a7199ecfde79c79bc1 SHA512 a2efcf46a2481a213825b452987626ade3fa95a525d26bd11a315ef885eb4f536343a7a58389733f459d05486b3da73e81503a0988ebe768ad93b089351f3e25 WHIRLPOOL 3cd4cb7faf5dc585ec8fa0e8985d8a55906486926fc82fff545287bd802d91923711a7796ba4145353569fefa6dd78330dfcc33303cbcfa7d85c1ee55a6ea2d0
diff --git a/app-emulation/spectemu/files/spectemu-0.99.3-automagic.patch b/app-emulation/spectemu/files/spectemu-0.99.3-automagic.patch
new file mode 100644
index 000000000000..6e813d6373e5
--- /dev/null
+++ b/app-emulation/spectemu/files/spectemu-0.99.3-automagic.patch
@@ -0,0 +1,31 @@
+--- configure.in
++++ configure.in
+@@ -121,13 +121,22 @@
+ dnl -----------------------------------------------------------
+ dnl Check for SVGALIB
+ dnl -----------------------------------------------------------
+-AC_CHECK_LIB(vga, vga_setmode, no_vga="", no_vga=yes)
+-if test "$no_vga" != yes; then
+- progs="$progs vgaspect"
+- vgalib=-lvga
+
+- LIBS="$vgalib $olibs"
+- AC_CHECK_FUNC(vga_runinbackground_version, AC_DEFINE(RUN_IN_BACKGROUND))
++svgalibs=""
++withsvga=no
++AC_ARG_WITH(svga,
++[ --with-svga Compile with svga library],
++[if test "$withval" = no; then withsvga=no; fi])
++
++if test "$withsvga" = yes; then
++ AC_CHECK_LIB(vga, vga_setmode, no_vga="", no_vga=yes)
++ if test "$no_vga" != yes; then
++ progs="$progs vgaspect"
++ vgalib=-lvga
++
++ LIBS="$vgalib $olibs"
++ AC_CHECK_FUNC(vga_runinbackground_version, AC_DEFINE(RUN_IN_BACKGROUND))
++ fi
+ fi
+
+ LIBS="$olibs"
diff --git a/app-emulation/spectemu/files/spectemu-0.99.3-build.patch b/app-emulation/spectemu/files/spectemu-0.99.3-build.patch
new file mode 100644
index 000000000000..1c354a5fa933
--- /dev/null
+++ b/app-emulation/spectemu/files/spectemu-0.99.3-build.patch
@@ -0,0 +1,34 @@
+--- Makefile.in
++++ Makefile.in
+@@ -44,17 +44,19 @@
+ ./mkinstalldirs $(i_bindir) $(i_mandir)
+
+ install_prog: $(progs)
++ mkdir -p $(i_bindir)
+ if test -f xspect; then \
+- $(INSTALL_PROGRAM) -s -m 755 xspect $(i_bindir); fi
++ $(INSTALL_PROGRAM) -m 755 xspect $(i_bindir); fi
+ if test -f vgaspect; then \
+- $(INSTALL_PROGRAM) -s -m 4755 vgaspect $(i_bindir); fi
++ $(INSTALL_PROGRAM) -m 4755 vgaspect $(i_bindir); fi
+
+ install_man:
++ mkdir -p $(i_mandir)
+ $(INSTALL_DATA) ./xspect.1 $(i_mandir)
+ $(INSTALL_DATA) ./tapeout.1 $(i_mandir)
+ (cd $(i_mandir); rm -f vgaspect.1; ln -s xspect.1 vgaspect.1)
+
+-install: installdirs install_prog install_man
++install: install_prog install_man
+
+ z80_c_objs=z80.o z80optab.o z80_step.o spperif.o spect.o rom48.o \
+ z80_op1.o z80_op2.o z80_op3.o z80_op4.o z80_op5.o z80_op6.o
+@@ -88,7 +90,7 @@
+ ./sp_to_s < i386emul.sp > i386emul.s
+
+ i386emul.o: i386emul.s
+- $(CC) -c $(CFLAGS) i386emul.s
++ $(CC) -c $(ASFLAGS) -Xassembler --noexecstack i386emul.s
+
+ sp_to_s: sp_to_s.o
+ $(CC) -o sp_to_s $(LDFLAGS) sp_to_s.o
diff --git a/app-emulation/spectemu/files/spectemu-0.99.3-qa.patch b/app-emulation/spectemu/files/spectemu-0.99.3-qa.patch
new file mode 100644
index 000000000000..00d136305819
--- /dev/null
+++ b/app-emulation/spectemu/files/spectemu-0.99.3-qa.patch
@@ -0,0 +1,23 @@
+--- spectemu-0.99.3/Makefile.in
++++ spectemu-0.99.3/Makefile.in
+@@ -45,9 +45,9 @@
+
+ install_prog: $(progs)
+ if test -f xspect; then \
+- $(INSTALL_PROGRAM) -s -m 755 xspect $(i_bindir); fi
++ $(INSTALL_PROGRAM) -m 755 xspect $(i_bindir); fi
+ if test -f vgaspect; then \
+- $(INSTALL_PROGRAM) -s -m 4755 vgaspect $(i_bindir); fi
++ $(INSTALL_PROGRAM) -m 4755 vgaspect $(i_bindir); fi
+
+ install_man:
+ $(INSTALL_DATA) ./xspect.1 $(i_mandir)
+@@ -88,7 +88,7 @@
+ ./sp_to_s < i386emul.sp > i386emul.s
+
+ i386emul.o: i386emul.s
+- $(CC) -c $(CFLAGS) i386emul.s
++ $(CC) -c $(ASFLAGS) -Xassembler --noexecstack i386emul.s
+
+ sp_to_s: sp_to_s.o
+ $(CC) -o sp_to_s $(LDFLAGS) sp_to_s.o
diff --git a/app-emulation/spectemu/metadata.xml b/app-emulation/spectemu/metadata.xml
new file mode 100644
index 000000000000..d9cd2cad66c2
--- /dev/null
+++ b/app-emulation/spectemu/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/app-emulation/spectemu/spectemu-0.99.3-r1.ebuild b/app-emulation/spectemu/spectemu-0.99.3-r1.ebuild
new file mode 100644
index 000000000000..10aaa2bc722b
--- /dev/null
+++ b/app-emulation/spectemu/spectemu-0.99.3-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools eutils
+
+DESCRIPTION="48k ZX Spectrum Emulator"
+HOMEPAGE="http://kempelen.iit.bme.hu/~mszeredi/spectemu/spectemu.html"
+SRC_URI="http://www.inf.bme.hu/~mszeredi/spectemu/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="readline svga +X"
+
+REQUIRED_USE="|| ( svga X )"
+
+DEPEND="X? ( >=x11-proto/xf86vidmodeproto-2.2.2
+ >=x11-proto/xextproto-7.0.2
+ >=x11-proto/xproto-7.0.4
+ >=x11-libs/libX11-1.0.0
+ >=x11-libs/libXext-1.0.0
+ >=x11-libs/libXxf86vm-1.0.0 )
+ readline? ( sys-libs/readline )"
+RDEPEND="${DEPEND}
+ svga? ( media-libs/svgalib )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-automagic.patch
+ epatch "${FILESDIR}"/${P}-build.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with readline) \
+ $(use_with svga) \
+ $(use_with X x)
+}
+
+src_install() {
+ emake install_root="${D}" install
+}
diff --git a/app-emulation/spectemu/spectemu-0.99.3.ebuild b/app-emulation/spectemu/spectemu-0.99.3.ebuild
new file mode 100644
index 000000000000..1dbab72574f4
--- /dev/null
+++ b/app-emulation/spectemu/spectemu-0.99.3.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+### Several versions of specemu exist, xspect & vgaspect, utilising X11
+### and/or svgalib. libreadline provides optional runtime features.
+### The ./configure script automagically figures out which binaries to build
+### so the run/compiletime dependancies here are use dependant
+
+inherit eutils
+
+DESCRIPTION="48k ZX Spectrum Emulator"
+HOMEPAGE="http://kempelen.iit.bme.hu/~mszeredi/spectemu/spectemu.html"
+SRC_URI="http://www.inf.bme.hu/~mszeredi/spectemu/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="X readline svga"
+
+DEPEND="X? ( >=x11-proto/xf86vidmodeproto-2.2.2
+ >=x11-proto/xextproto-7.0.2
+ >=x11-proto/xproto-7.0.4
+ >=x11-libs/libX11-1.0.0
+ >=x11-libs/libXext-1.0.0
+ >=x11-libs/libXxf86vm-1.0.0 )
+ readline? ( sys-libs/readline )"
+RDEPEND="svga? ( media-libs/svgalib )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-qa.patch
+}
+
+src_compile() {
+ econf \
+ $(use_with readline) \
+ $(use_with X x)
+ emake CC="$(tc-getCC)" \
+ CPP="$(tc-getCPP)" \
+ || die "emake failed"
+}
+
+src_install() {
+ # Parallel install bug #255777
+ emake -j1 install_root="${D}" install || die "emake install failed"
+}
diff --git a/app-emulation/spice-protocol/Manifest b/app-emulation/spice-protocol/Manifest
new file mode 100644
index 000000000000..4dac47cfcd9c
--- /dev/null
+++ b/app-emulation/spice-protocol/Manifest
@@ -0,0 +1,4 @@
+DIST spice-protocol-0.12.3.tar.bz2 69854 SHA256 dc8609efe23e6f9b78d56663aa9ca5e8cb10c2b8403b8fc02aa72ae7686cc037 SHA512 55423743cf195459125305c726803db491ebf16a5ef0cb821eed7e0d71ace9d581b9a6a60c11a03d6a17c0ecc31e2b4c649ed117857a050f409844686b7df3e0 WHIRLPOOL 308ced9222f8b43e2455733fc5d311912bc9d10fbf830d8d4eecd0e86bfd6dc6a0ae15c3d94dc5c3d73aa9635247023259642c570e31557e0ba9caf4bd2c7eb6
+DIST spice-protocol-0.12.5.tar.bz2 70068 SHA256 feacb14940cdcc10214ec8cdc2198d880e54eb206e6d65a9bddf8360b27f7bf9 SHA512 04c48a88b9ab3c094f44400bbcf8be7b2f32c8a38350e38237108a366b2b0d94cf4244b83de749b1bce5fc6f71c9111d5ae063c9cac43d29074fa1f372450ec6 WHIRLPOOL 1c40deed7a054ed8726628067a0a708cddd500245f278eca30c3b5e25adf4137c70faf0a08bbc3a414a257a3d9b8100d05680c40405ba410ecdad3fb870b4b08
+DIST spice-protocol-0.12.6.tar.bz2 70176 SHA256 9d4745602eb2ab1d1c1ab98b4babf587574870993b4faefe354ac57bb5e8259b SHA512 0c9a1dcc6c0afbfb7350b7003a261b692de4864afc8bd8f33e7a730753f43112977bfa5148e0b5af3231d43d9a057859f34f6dff0c738d9aaea07f70138e1f13 WHIRLPOOL 52331e2ebe3a54e02c1115459580ebe405304c3539f3534527cec9e1f72e606c2c8f6b4acf30fcc5df022489f146a0fb253bfa8849e9894f31fb8b2dc48ef706
+DIST spice-protocol-0.12.7.tar.bz2 71276 SHA256 96c6cb73361816ed19bfd8536f65d4547da35709aa00af1380e650c1174916c2 SHA512 48205ab8daba97f754ae1ac9bbb7071efb2f450c43620839ee70d7577eab2ef696151fcce8f6f5c95b2593c58b6a0d5779e36b6fc0b6d450872ac677ea525800 WHIRLPOOL fc990949806c4a27081f2156ff4c2c3388785f3f68e468b7f2c77852c874789fa391ce85fdbb78b30bbe3cd39b7e0615d7815405e3ced815376481e49202bf78
diff --git a/app-emulation/spice-protocol/metadata.xml b/app-emulation/spice-protocol/metadata.xml
new file mode 100644
index 000000000000..6804d7590f41
--- /dev/null
+++ b/app-emulation/spice-protocol/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/spice-protocol/spice-protocol-0.12.3.ebuild b/app-emulation/spice-protocol/spice-protocol-0.12.3.ebuild
new file mode 100644
index 000000000000..e7694629e919
--- /dev/null
+++ b/app-emulation/spice-protocol/spice-protocol-0.12.3.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Headers defining the SPICE protocol"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~ia64 ~ppc ~ppc64 ~sparc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
diff --git a/app-emulation/spice-protocol/spice-protocol-0.12.5.ebuild b/app-emulation/spice-protocol/spice-protocol-0.12.5.ebuild
new file mode 100644
index 000000000000..3bfc620c0fa2
--- /dev/null
+++ b/app-emulation/spice-protocol/spice-protocol-0.12.5.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Headers defining the SPICE protocol"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
diff --git a/app-emulation/spice-protocol/spice-protocol-0.12.6.ebuild b/app-emulation/spice-protocol/spice-protocol-0.12.6.ebuild
new file mode 100644
index 000000000000..3bfc620c0fa2
--- /dev/null
+++ b/app-emulation/spice-protocol/spice-protocol-0.12.6.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Headers defining the SPICE protocol"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
diff --git a/app-emulation/spice-protocol/spice-protocol-0.12.7.ebuild b/app-emulation/spice-protocol/spice-protocol-0.12.7.ebuild
new file mode 100644
index 000000000000..3bfc620c0fa2
--- /dev/null
+++ b/app-emulation/spice-protocol/spice-protocol-0.12.7.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Headers defining the SPICE protocol"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
diff --git a/app-emulation/spice-vdagent/Manifest b/app-emulation/spice-vdagent/Manifest
new file mode 100644
index 000000000000..a89f6379b263
--- /dev/null
+++ b/app-emulation/spice-vdagent/Manifest
@@ -0,0 +1,3 @@
+DIST spice-vdagent-0.10.1.tar.bz2 107250 SHA256 cea0db6f2def79a96876d0921f2a6234875797c68a8143d24cf9af8cc01361db SHA512 b7a42af7fd1d15dcfd618be34b99c73fa2d07105e37236a5a8c2a0b70d7d112de9e99200257ae746f60de583735681ce7c1437445921f6b8a877c7a9b2083afe WHIRLPOOL 83f3f6b2501966a0a5b053547759fd8a131d3e6a795f008c21f0a11794fd6ae7e30800328189e4dead11c19ae2a0a08a35ff192011622ca2fa8eac204711d035
+DIST spice-vdagent-0.12.0.tar.bz2 114252 SHA256 e0bee1985c2c31ccc44043ed6735304078e09e14c4f805962cf8c288fa205659 SHA512 42c98a3cc3167884203d4d0a31562668be3df10c89eca2a9257c6de1f787b7db77f0648013f307554eb09c0bf3f0cddc8632f050c4018aef544b9c22a02b2dfe WHIRLPOOL 3e00f0ac9ca66a2c6fec4307d4b6eea51fc4a266e72e6d5764e8f3fb01ab407440cabe20ee1db4d9703e5bda5d66616f71a8baa1d8d6610b0e1c75a67b3affae
+DIST spice-vdagent-0.8.1.tar.bz2 98437 SHA256 99ec232805a6201da78d409e6f874ff0aa6bb25e7ffe623aa77752539ae7d7ff SHA512 45c2b94dc66dd2061b57cfe90d7b900fd095fa067c6bca560ecc300979953e8c37b63e8cbdb4683275a1cc084512aa97e1125bbb17e39a6966387e4f1be2c178 WHIRLPOOL 1cfeabc97f4c1fd9e42a9ad849916f04d9f4f640a586158c3d8b2ab3b9449f6e1cf8acba196a9e684a1499404747971fa82ad922bd50e87c257526d67468a85f
diff --git a/app-emulation/spice-vdagent/files/spice-vdagent.confd b/app-emulation/spice-vdagent/files/spice-vdagent.confd
new file mode 100644
index 000000000000..326f894424d7
--- /dev/null
+++ b/app-emulation/spice-vdagent/files/spice-vdagent.confd
@@ -0,0 +1,7 @@
+
+# The virtual communication port provided by the hypervisor/vm
+PORT="/dev/virtio-ports/com.redhat.spice.0"
+
+# extra arguments for spice-vdagentd
+SPICE_VDAGENT_ARGS=""
+
diff --git a/app-emulation/spice-vdagent/files/spice-vdagent.confd-2 b/app-emulation/spice-vdagent/files/spice-vdagent.confd-2
new file mode 100644
index 000000000000..763fdaf886d0
--- /dev/null
+++ b/app-emulation/spice-vdagent/files/spice-vdagent.confd-2
@@ -0,0 +1,11 @@
+# The virtual communication port provided by the hypervisor/vm
+# Default: /dev/virtio-ports/com.redhat.spice.0
+#PORT="/dev/virtio-ports/com.redhat.spice.0"
+
+# Userspace Input Device
+# Default: /dev/uinput or /dev/input/uinput
+#DEVICE=""
+
+# Extra arguments for spice-vdagentd
+# Default: none
+#SPICE_VDAGENT_ARGS=""
diff --git a/app-emulation/spice-vdagent/files/spice-vdagent.initd b/app-emulation/spice-vdagent/files/spice-vdagent.initd
new file mode 100644
index 000000000000..68a64fb8b051
--- /dev/null
+++ b/app-emulation/spice-vdagent/files/spice-vdagent.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ after dbus
+}
+
+PIDFILE="/var/run/spice-vdagentd/spice-vdagentd.pid"
+
+start() {
+ ebegin "Checking for required modules and devices"
+
+ if [[ ! -d /sys/module/uinput ]] ; then
+ eerror "Module 'uinput' not loaded or not enabled in the kernel"
+ eend 1
+ return 1
+ fi
+
+ if [[ ! -c "${PORT}" ]] ; then
+ eerror "Required virtio port does not exist. Make sure you"
+ eerror "started the virtual machine with appropriate parameters."
+ eend 1
+ return 1
+ fi
+ eend 0
+
+ # recreate the directory since /var/run may reside on a ramdisk
+ mkdir -p /var/run/spice-vdagentd
+
+ # cleanup stalled socket
+ rm -f /var/run/spice-vdagentd/spice-vdagent-sock
+
+ ebegin "Starting spice VD agent daemon"
+ start-stop-daemon \
+ --start \
+ --pidfile "${PIDFILE}" \
+ --exec /usr/sbin/spice-vdagentd \
+ -- ${SPICE_VDAGENT_ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping spice VD agent daemon"
+ start-stop-daemon \
+ --stop \
+ --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/app-emulation/spice-vdagent/files/spice-vdagent.initd-2 b/app-emulation/spice-vdagent/files/spice-vdagent.initd-2
new file mode 100644
index 000000000000..a394a851125a
--- /dev/null
+++ b/app-emulation/spice-vdagent/files/spice-vdagent.initd-2
@@ -0,0 +1,61 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ after dbus
+}
+
+PIDFILE="/var/run/spice-vdagentd/spice-vdagentd.pid"
+
+start() {
+ PORT="${PORT:-/dev/virtio-ports/com.redhat.spice.0}"
+ DEVICE="${DEVICE:-/dev/uinput}"
+
+ ebegin "Checking for required modules and devices"
+
+ if [[ ! -d /sys/module/uinput ]]; then
+ modprobe -q uinput
+ fi
+
+ if [[ ! -d /sys/module/uinput ]]; then
+ eerror "Module 'uinput' not loaded or not enabled in the kernel"
+ eend 1
+ return 1
+ fi
+
+ if [[ ! -c "${PORT}" ]] ; then
+ eerror "Required virtio port does not exist. Make sure you"
+ eerror "started the virtual machine with appropriate parameters."
+ eend 1
+ return 1
+ fi
+ eend 0
+
+ if [[ ! -c ${DEVICE} && -c /dev/input/uinput ]]; then
+ DEVICE=/dev/input/uinput
+ fi
+
+ # recreate the directory since /var/run may reside on a ramdisk
+ mkdir -p /var/run/spice-vdagentd
+
+ # cleanup stalled socket
+ rm -f /var/run/spice-vdagentd/spice-vdagent-sock
+
+ ebegin "Starting spice VD agent daemon"
+ start-stop-daemon \
+ --start \
+ --pidfile "${PIDFILE}" \
+ --exec /usr/sbin/spice-vdagentd \
+ -- -u "${DEVICE}" ${SPICE_VDAGENT_ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping spice VD agent daemon"
+ start-stop-daemon \
+ --stop \
+ --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/app-emulation/spice-vdagent/metadata.xml b/app-emulation/spice-vdagent/metadata.xml
new file mode 100644
index 000000000000..7b4cb96eca68
--- /dev/null
+++ b/app-emulation/spice-vdagent/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+ <use>
+ <flag name="consolekit">Use <pkg>sys-auth/consolekit</pkg> to determine the
+ master vdagentd in case of multiple running vdagentds (highly
+ recommended)</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/spice-vdagent/spice-vdagent-0.10.1.ebuild b/app-emulation/spice-vdagent/spice-vdagent-0.10.1.ebuild
new file mode 100644
index 000000000000..ec72d1262b37
--- /dev/null
+++ b/app-emulation/spice-vdagent/spice-vdagent-0.10.1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit linux-info
+
+DESCRIPTION="SPICE VD Linux Guest Agent"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+consolekit selinux"
+
+CDEPEND="x11-libs/libXfixes
+ x11-libs/libXrandr
+ x11-libs/libX11
+ x11-libs/libXinerama
+ >=x11-libs/libpciaccess-0.10
+ >=app-emulation/spice-protocol-0.10.1
+ consolekit? ( sys-auth/consolekit sys-apps/dbus )"
+DEPEND="virtual/pkgconfig
+ ${CDEPEND}"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-vdagent )"
+
+CONFIG_CHECK="~INPUT_UINPUT ~VIRTIO_CONSOLE"
+ERROR_INPUT_UINPUT="User level input support is required"
+ERROR_VIRTIO_CONSOLE="VirtIO console/serial device support is required"
+
+src_configure() {
+ local opt=
+
+ use consolekit && opt="${opt} --with-session-info=console-kit"
+
+ econf \
+ --localstatedir=/var \
+ ${opt}
+}
+
+src_install() {
+ default
+
+ rm -rf "${D}"/etc/{rc,tmpfiles}.d
+
+ keepdir /var/run/spice-vdagentd
+ keepdir /var/log/spice-vdagentd
+
+ newinitd "${FILESDIR}/${PN}.initd-2" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd-2" "${PN}"
+}
diff --git a/app-emulation/spice-vdagent/spice-vdagent-0.12.0.ebuild b/app-emulation/spice-vdagent/spice-vdagent-0.12.0.ebuild
new file mode 100644
index 000000000000..ec72d1262b37
--- /dev/null
+++ b/app-emulation/spice-vdagent/spice-vdagent-0.12.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit linux-info
+
+DESCRIPTION="SPICE VD Linux Guest Agent"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+consolekit selinux"
+
+CDEPEND="x11-libs/libXfixes
+ x11-libs/libXrandr
+ x11-libs/libX11
+ x11-libs/libXinerama
+ >=x11-libs/libpciaccess-0.10
+ >=app-emulation/spice-protocol-0.10.1
+ consolekit? ( sys-auth/consolekit sys-apps/dbus )"
+DEPEND="virtual/pkgconfig
+ ${CDEPEND}"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-vdagent )"
+
+CONFIG_CHECK="~INPUT_UINPUT ~VIRTIO_CONSOLE"
+ERROR_INPUT_UINPUT="User level input support is required"
+ERROR_VIRTIO_CONSOLE="VirtIO console/serial device support is required"
+
+src_configure() {
+ local opt=
+
+ use consolekit && opt="${opt} --with-session-info=console-kit"
+
+ econf \
+ --localstatedir=/var \
+ ${opt}
+}
+
+src_install() {
+ default
+
+ rm -rf "${D}"/etc/{rc,tmpfiles}.d
+
+ keepdir /var/run/spice-vdagentd
+ keepdir /var/log/spice-vdagentd
+
+ newinitd "${FILESDIR}/${PN}.initd-2" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd-2" "${PN}"
+}
diff --git a/app-emulation/spice-vdagent/spice-vdagent-0.8.1-r1.ebuild b/app-emulation/spice-vdagent/spice-vdagent-0.8.1-r1.ebuild
new file mode 100644
index 000000000000..231b56cac8a2
--- /dev/null
+++ b/app-emulation/spice-vdagent/spice-vdagent-0.8.1-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit linux-info
+
+DESCRIPTION="SPICE VD Linux Guest Agent"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+consolekit selinux"
+
+CDEPEND="x11-libs/libXfixes
+ x11-libs/libXrandr
+ x11-libs/libX11
+ >=app-emulation/spice-protocol-0.8.1
+ consolekit? ( sys-auth/consolekit sys-apps/dbus )"
+DEPEND="virtual/pkgconfig
+ ${CDEPEND}"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-vdagent )"
+
+CONFIG_CHECK="~INPUT_UINPUT"
+ERROR_INPUT_UINPUT="User level driver support is required to run the spice-vdagent daemon"
+
+src_configure() {
+ econf \
+ --localstatedir=/var \
+ $(use_enable consolekit console-kit)
+}
+
+src_install() {
+ default
+
+ rm -rf "${D}"/etc/{rc,tmpfiles}.d
+
+ keepdir /var/run/spice-vdagentd
+ keepdir /var/log/spice-vdagentd
+
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+}
+
+pkg_postinst() {
+ elog "Make sure that the User level driver support kernel module 'uinput' is loaded"
+ elog "if built as a module before starting the vdagent daemon."
+}
diff --git a/app-emulation/spice/Manifest b/app-emulation/spice/Manifest
new file mode 100644
index 000000000000..f77be293b65e
--- /dev/null
+++ b/app-emulation/spice/Manifest
@@ -0,0 +1 @@
+DIST spice-0.12.5.tar.bz2 1737169 SHA256 4209a20d8f67cb99a8a6ac499cfe79a18d4ca226360457954a223d6795c2f581 SHA512 1501c913ba3b1856444536a9bfda7a2138a96088f940b483e963df342b91deb945d77bfb3c83ebddfcd7c3008695c0dd7df30ff9fd8502cbbcac1c610a273572 WHIRLPOOL 8f50a91febb0d2279ac867ae31cb14f996106625f0f26ba1bb8b5b576eedce6839f52c70e19a03f03be209f695c36b3ba1d94fadee6c9f134e2afffd5b99c476
diff --git a/app-emulation/spice/files/0.11.0-gold.patch b/app-emulation/spice/files/0.11.0-gold.patch
new file mode 100644
index 000000000000..ad08c14e9abc
--- /dev/null
+++ b/app-emulation/spice/files/0.11.0-gold.patch
@@ -0,0 +1,30 @@
+ server/tests/Makefile.am | 2 ++
+ server/tests/Makefile.in | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
+index e77865c..905de9d 100644
+--- a/server/tests/Makefile.am
++++ b/server/tests/Makefile.am
+@@ -19,6 +19,8 @@ LDADD = \
+ $(top_builddir)/server/libspice-server.la \
+ $(NULL)
+
++AM_LDFLAGS = -pthread
++
+ COMMON_BASE = \
+ basic_event_loop.c \
+ basic_event_loop.h \
+diff --git a/server/tests/Makefile.in b/server/tests/Makefile.in
+index 5b177e2..3aacfd3 100644
+--- a/server/tests/Makefile.in
++++ b/server/tests/Makefile.in
+@@ -144,7 +144,7 @@ am__v_at_0 = @
+ CCLD = $(CC)
+ LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+- $(AM_LDFLAGS) $(LDFLAGS) -o $@
++ $(AM_LDFLAGS) $(LDFLAGS) -pthread -o $@
+ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+ am__v_CCLD_0 = @echo " CCLD " $@;
diff --git a/app-emulation/spice/files/spice-0.12.5-fix-assert-in-mjpeg_encoder_adjust_params_to_bit_rate.patch b/app-emulation/spice/files/spice-0.12.5-fix-assert-in-mjpeg_encoder_adjust_params_to_bit_rate.patch
new file mode 100644
index 000000000000..0ced72887065
--- /dev/null
+++ b/app-emulation/spice/files/spice-0.12.5-fix-assert-in-mjpeg_encoder_adjust_params_to_bit_rate.patch
@@ -0,0 +1,30 @@
+From 284cca2a5ebc98257275585083321a7100fb89b3 Mon Sep 17 00:00:00 2001
+From: Jonathon Jongsma <jjongsma@redhat.com>
+Date: Fri, 30 May 2014 18:45:02 +0000
+Subject: Fix assert in mjpeg_encoder_adjust_params_to_bit_rate()
+
+If mjpeg_encoder_reset_quality() is called with the same quality as currently
+set, it will not reset last_enc_size but not reset num_recent_enc_frames,
+violating some assumptions in _adjust_params_to_bit_rate(). To avoid aborting
+the server, simply return early from this function.
+
+Resolves: rhbz#1086820
+---
+diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
+index f465d88..12447da 100644
+--- a/server/mjpeg_encoder.c
++++ b/server/mjpeg_encoder.c
+@@ -625,7 +625,10 @@ static void mjpeg_encoder_adjust_params_to_bit_rate(MJpegEncoder *encoder)
+ return;
+ }
+
+- spice_assert(rate_control->num_recent_enc_frames);
++ if (!rate_control->num_recent_enc_frames) {
++ spice_debug("No recent encoded frames");
++ return;
++ }
+
+ if (rate_control->num_recent_enc_frames < MJPEG_AVERAGE_SIZE_WINDOW &&
+ rate_control->num_recent_enc_frames < rate_control->fps) {
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/app-emulation/spice/files/spice-0.12.5-fix-crash-when-clearing-surface-memory.patch b/app-emulation/spice/files/spice-0.12.5-fix-crash-when-clearing-surface-memory.patch
new file mode 100644
index 000000000000..b14a56b1d245
--- /dev/null
+++ b/app-emulation/spice/files/spice-0.12.5-fix-crash-when-clearing-surface-memory.patch
@@ -0,0 +1,31 @@
+From 1898f3949cf75422aa1fedba40c429b28d8d6b67 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
+Date: Wed, 6 Aug 2014 18:34:56 +0200
+Subject: Fix crash when clearing surface memory
+
+The beginning of the surface data needs to be computed correctly if the
+stride is negative, otherwise, it should point already to the beginning
+of the surface data. This bug seems to exists since 4a208b (0.5.2)
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1029646
+
+diff --git a/server/red_worker.c b/server/red_worker.c
+index 6bdad93..35a1a04 100644
+--- a/server/red_worker.c
++++ b/server/red_worker.c
+@@ -9470,7 +9470,11 @@ static inline void red_create_surface(RedWorker *worker, uint32_t surface_id, ui
+ surface->context.stride = stride;
+ surface->context.line_0 = line_0;
+ if (!data_is_valid) {
+- memset((char *)line_0 + (int32_t)(stride * (height - 1)), 0, height*abs(stride));
++ char *data = line_0;
++ if (stride < 0) {
++ data -= abs(stride) * (height - 1);
++ }
++ memset(data, 0, height*abs(stride));
+ }
+ surface->create.info = NULL;
+ surface->destroy.info = NULL;
+--
+cgit v0.10.2
+
diff --git a/app-emulation/spice/files/spice-0.12.5-server-dont-assert-on-invalid-client-message.patch b/app-emulation/spice/files/spice-0.12.5-server-dont-assert-on-invalid-client-message.patch
new file mode 100644
index 000000000000..d9b49a4abb27
--- /dev/null
+++ b/app-emulation/spice/files/spice-0.12.5-server-dont-assert-on-invalid-client-message.patch
@@ -0,0 +1,30 @@
+From 3c25192ee90f843a2f84ff99d119b1cb45979bac Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
+Date: Wed, 25 Jun 2014 14:36:03 +0200
+Subject: server: don't assert on invalid client message
+
+Some users have been reaching this error:
+snd_receive: ASSERT n failed
+
+A misbehaving client could easily hit that condition by sending too big
+messages. Instead of assert(), replace with a warning. When a message
+too big to fit is received, it will simply disconnect the channel.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=962187
+
+diff --git a/server/snd_worker.c b/server/snd_worker.c
+index 7d52ded..70148b7 100644
+--- a/server/snd_worker.c
++++ b/server/snd_worker.c
+@@ -421,7 +421,7 @@ static void snd_receive(void* data)
+ for (;;) {
+ ssize_t n;
+ n = channel->receive_data.end - channel->receive_data.now;
+- spice_assert(n);
++ spice_warn_if(n <= 0);
+ n = reds_stream_read(channel->stream, channel->receive_data.now, n);
+ if (n <= 0) {
+ if (n == 0) {
+--
+cgit v0.10.2
+
diff --git a/app-emulation/spice/metadata.xml b/app-emulation/spice/metadata.xml
new file mode 100644
index 000000000000..f139eea39762
--- /dev/null
+++ b/app-emulation/spice/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+ <use>
+ <flag name="client">Build the spicec client app (does not reduce dependencies at the moment).</flag>
+ <flag name="smartcard">Enable smartcard remoting using <pkg>app-emulation/libcacard</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/spice/spice-0.12.5-r1.ebuild b/app-emulation/spice/spice-0.12.5-r1.ebuild
new file mode 100644
index 000000000000..e33e68a64888
--- /dev/null
+++ b/app-emulation/spice/spice-0.12.5-r1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-any-r1
+
+DESCRIPTION="SPICE server and client"
+HOMEPAGE="http://spice-space.org/"
+SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="client sasl smartcard static-libs" # static
+
+# only the client links against libcacard, the libspice-server only uses the headers
+# the client cannot be built statically since alsa and qemu[smartcard] are missing static-libs
+RDEPEND=">=x11-libs/pixman-0.17.7[static-libs(+)?]
+ >=dev-libs/glib-2.22:2[static-libs(+)?]
+ >=media-libs/celt-0.5.1.1:0.5.1[static-libs(+)?]
+ media-libs/opus[static-libs(+)?]
+ dev-libs/openssl[static-libs(+)?]
+ virtual/jpeg[static-libs(+)?]
+ sys-libs/zlib[static-libs(+)?]
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)?] )
+ client? (
+ media-libs/alsa-lib
+ >=x11-libs/libXrandr-1.2
+ x11-libs/libX11
+ x11-libs/libXext
+ >=x11-libs/libXinerama-1.0
+ x11-libs/libXfixes
+ x11-libs/libXrender
+ smartcard? ( app-emulation/qemu[smartcard] )
+ )"
+
+DEPEND="virtual/pkgconfig
+ $(python_gen_any_dep \
+ '>=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]')
+ smartcard? ( app-emulation/qemu[smartcard] )
+ ${RDEPEND}"
+
+python_check_deps() {
+ has_version ">=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && python-any-r1_pkg_setup
+}
+
+# maintainer notes:
+# * opengl support is currently broken
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/0.11.0-gold.patch" \
+ "${FILESDIR}/${P}-fix-assert-in-mjpeg_encoder_adjust_params_to_bit_rate.patch" \
+ "${FILESDIR}/${P}-server-dont-assert-on-invalid-client-message.patch" \
+ "${FILESDIR}/${P}-fix-crash-when-clearing-surface-memory.patch"
+
+ epatch_user
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static) \
+ $(use_enable client) \
+ $(use_with sasl) \
+ $(use_enable smartcard) \
+ --disable-gui \
+ --disable-static-linkage
+# $(use_enable static static-linkage) \
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files
+}
diff --git a/app-emulation/spim/Manifest b/app-emulation/spim/Manifest
new file mode 100644
index 000000000000..22c907b435ee
--- /dev/null
+++ b/app-emulation/spim/Manifest
@@ -0,0 +1 @@
+DIST spim-8.0.tar.gz 355204 SHA256 6f205776cb9fa112729507008843b289012190ed3131cbd426c610a58387ee4b SHA512 c4eb66863a931b74d6c6ecd92860d16fd6369c85caecba1e71a1149e73e708502d1070f17a9beb6d0af1368db1ee5a85c040b596866a1236275cdd410a661adf WHIRLPOOL 222d85244a1dc24f50dc577e5147c9c67493d16d65b7b56f3a81565f80839eff184df081d58891c3333a23f836bfdd7700e2e2b69920801f271714ec2ec40b1e
diff --git a/app-emulation/spim/files/spim-8.0-r1-respect_env.patch b/app-emulation/spim/files/spim-8.0-r1-respect_env.patch
new file mode 100644
index 000000000000..c7c8925c4e5f
--- /dev/null
+++ b/app-emulation/spim/files/spim-8.0-r1-respect_env.patch
@@ -0,0 +1,183 @@
+--- spim/Makefile 2010-08-01 22:14:53.352906061 +0200
++++ spim/Makefile 2010-08-01 22:15:00.994905920 +0200
+@@ -66,13 +66,13 @@
+
+
+ # Full path for the directory that will hold the executable files:
+-BIN_DIR = /usr/local/bin
++BIN_DIR = $(DESTDIR)/usr/bin
+
+ # Full path for the directory that will hold the exception handler:
+-EXCEPTION_DIR = /usr/local/lib/spim
++EXCEPTION_DIR = $(DESTDIR)/var/lib/spim
+
+ # Full path for the directory that will hold the man files:
+-MAN_DIR = /usr/local/man/en
++MAN_DIR = $(DESTDIR)/usr/share/man
+
+
+ # If you have flex, use it instead of lex. If you use flex, define this
+@@ -104,11 +104,10 @@
+
+ DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_EXCEPTION_HANDLER="\"$(EXCEPTION_DIR)/exceptions.s\"" -DSPIM_VERSION="\"`cat ../VERSION`\""
+
+-CC = gcc
+-CFLAGS = -I. -I$(CPU_DIR) $(DEFINES) -g -Wall
++CC ?= gcc
++CFLAGS += -I. -I$(CPU_DIR) $(DEFINES) -Wall
+ YFLAGS = -d --file-prefix=y
+ YCFLAGS =
+-LDFLAGS = -lm
+ CSH = bash
+
+ # lex.yy.c is usually compiled with -O to speed it up.
+@@ -122,10 +121,10 @@
+
+
+ spim: force
+- make -f Makefile spim2
++ $(MAKE) -f Makefile spim2
+
+ spim2: $(OBJS) spim.o
+- $(CC) -g $(OBJS) spim.o $(LDFLAGS) -o spim -lm
++ $(CC) $(OBJS) spim.o $(LDFLAGS) -o spim -lm
+
+
+ force: configuration
+@@ -143,19 +142,19 @@
+ @echo
+ @echo "Testing tt.bare.s:"
+ $(CSH) -c "./spim -delayed_branches -delayed_loads -noexception -file $(TEST_DIR)/tt.bare.s >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+
+ @echo
+ @echo "Testing tt.core.s:"
+ $(CSH) -c "./spim -ef $(CPU_DIR)/exceptions.s -file $(TEST_DIR)/tt.core.s < $(TEST_DIR)/tt.in >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+
+ @echo
+ @echo "Testing tt.endian.s:"
+ $(CSH) -c "./spim -ef $(CPU_DIR)/exceptions.s -file $(TEST_DIR)/tt.endian.s >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+ @echo
+
+@@ -166,13 +165,13 @@
+ @echo
+ @echo "Testing tt.alu.bare.s:"
+ $(CSH) -c "./spim -bare -noexception -file $(TEST_DIR)/tt.alu.bare.s >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+
+ @echo
+ @echo "Testing tt.fpt.bare.s:"
+ $(CSH) -c "./spim -bare -noexception -file $(TEST_DIR)/tt.fpu.bare.s >& test.out"
+- @tail -2 test.out
++ @tail -n2 test.out
+ @echo
+ @echo
+
+@@ -192,8 +191,6 @@
+ install -m 0444 $(CPU_DIR)/exceptions.s $(EXCEPTION_DIR)/exceptions.s
+
+ install-man:
+- install -d $(MAN_DIR)
+- install -m 0444 $(DOC_DIR)/spim.man $(MAN_DIR)
+
+ very-clean: clean
+ rm -f configuration
+--- xspim/Makefile 2010-08-01 22:14:53.351905921 +0200
++++ xspim/Makefile 2010-08-01 22:26:08.361917058 +0200
+@@ -169,18 +169,18 @@
+
+ VARDBDIR = $(VARDIR)/lib
+
+- AR = ar clq
++ AR = $(AR) clq
+
+ # Nice try but useless: make will inherit BOOTSTRAPCFLAGS
+ # from top Makefile
+ BOOTSTRAPCFLAGS =
+
+- CC = gcc -m32
+- AS = gcc -m32 -c -x assembler
++ CC ?= gcc -m32
++ AS ?= gcc -m32 -c -x assembler
+
+ .SUFFIXES: .cc
+
+- CXX = c++ -m32
++ CXX ?= c++ -m32
+
+ CXXFILT = c++filt
+
+@@ -199,14 +199,14 @@
+ COMPRESS = compress
+ GZIPCMD = gzip
+
+- CPP = cpp $(STD_CPP_DEFINES)
+- RAWCPP = cpp -undef $(STD_CPP_OPTIONS)
+- PREPROCESSCMD = gcc -m32 -E $(STD_CPP_DEFINES)
++ CPP = $(CPP) $(STD_CPP_DEFINES)
++ RAWCPP = $(CPP) -undef $(STD_CPP_OPTIONS)
++ PREPROCESSCMD = $(CC) -E $(STD_CPP_DEFINES)
+
+ INSTALL = install
+ INSTALLFLAGS = -c
+
+- LD = gcc -m32 -nostdlib
++ LD ?= $(CC) -nostdlib
+
+ LEX = flex -l
+ M4 = m4
+@@ -270,18 +270,18 @@
+ COL = col
+ COLFLAGS = -b
+
+- MODCC = gcc -m32
++ MODCC ?= $(CC)
+
+- MODCPP = cpp
++ MODCPP = $(CPP)
+ MODCFLAGS = $(CFLAGS)
+- MODAS = gcc -m32 -c -x assembler
++ MODAS ?= $(CC) -c -x assembler
+ MODASFLAGS =
+
+- MODLD = gcc -m32 -nostdlib
++ MODLD ?= $(CC) -nostdlib
+
+ MODLDFLAGS =
+ MODLDCOMBINEFLAGS = -r
+- MODAR = ar clq
++ MODAR ?= $(AR) clq
+
+ MODRANLIB = ranlib
+
+@@ -330,7 +330,7 @@
+
+ ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(INSTALLED_INCLUDES) $(STD_INCLUDES)
+ ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(MODULE_DEFINES) $(DEFINES) $(EXTRA_DEFINES)
+- CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
++ CFLAGS += $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
+ LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
+ LDPRELIB = $(INSTALLED_LIBS)
+ LDPOSTLIB =
+@@ -339,9 +339,9 @@
+
+ LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+
+- CCLINK = $(CC)
++ CCLINK = $(CC) $(LDFLAGS)
+
+- CXXLINK = $(CXX)
++ CXXLINK = $(CXX) $(LDFLAGS)
+
+ LDSTRIPFLAGS = -x
+ LDCOMBINEFLAGS = -r
diff --git a/app-emulation/spim/files/xspim.svg b/app-emulation/spim/files/xspim.svg
new file mode 100644
index 000000000000..4840b752e16a
--- /dev/null
+++ b/app-emulation/spim/files/xspim.svg
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47pre1 r21720"
+ inkscape:export-filename="/home/maco/src/spim/spim-7.5/debian/16x16.png"
+ inkscape:export-xdpi="30"
+ inkscape:export-ydpi="30"
+ sodipodi:docname="icon.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient5060">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop5062" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop5064" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3598">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop3600" />
+ <stop
+ id="stop5056"
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0.49803922;" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop3602" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060"
+ id="linearGradient5070"
+ x1="52.067394"
+ y1="1029.1332"
+ x2="53.406746"
+ y2="1029.1332"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-5.4933245,-1.255617)" />
+ <filter
+ inkscape:collect="always"
+ id="filter5100"
+ x="-3.8212016"
+ width="8.6424033"
+ y="-0.029297812"
+ height="1.0585956">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.54030659"
+ id="feGaussianBlur5102" />
+ </filter>
+ <inkscape:perspective
+ id="perspective5112"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5060-1"
+ id="linearGradient5070-5"
+ x1="52.067394"
+ y1="1029.1332"
+ x2="53.406746"
+ y2="1029.1332"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-5.4933245,-1.255617)" />
+ <linearGradient
+ id="linearGradient5060-1">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop5062-6" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop5064-0" />
+ </linearGradient>
+ <filter
+ color-interpolation-filters="sRGB"
+ inkscape:collect="always"
+ id="filter5100-9"
+ x="-3.8212016"
+ width="8.6424036"
+ y="-0.029297812"
+ height="1.0585957">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.54030659"
+ id="feGaussianBlur5102-1" />
+ </filter>
+ <linearGradient
+ y2="1029.1332"
+ x2="53.406746"
+ y1="1029.1332"
+ x1="52.067394"
+ gradientTransform="translate(17.106625,4.0807905)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient5123"
+ xlink:href="#linearGradient5060-1"
+ inkscape:collect="always" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="6.3713695"
+ inkscape:cx="51.128112"
+ inkscape:cy="24.031581"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1278"
+ inkscape:window-height="770"
+ inkscape:window-x="0"
+ inkscape:window-y="28"
+ inkscape:window-maximized="0"
+ inkscape:snap-global="false"
+ inkscape:snap-grids="true">
+ <inkscape:grid
+ type="xygrid"
+ id="grid5169"
+ emppacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <path
+ style="fill:none;stroke:url(#linearGradient5070);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter5100)"
+ d="m 47.242591,1005.7474 c 0.02394,0.2045 -0.04024,0.4266 0,0.6278 0.0423,0.2116 0.135488,0.4132 0.156952,0.6279 0.03123,0.3123 0,0.6278 0,0.9417 0,0.7847 0,1.5695 0,2.3542 0,5.4411 0,10.8821 0,16.3231 0,1.8834 0,3.7668 0,5.6502 0,0.6279 0,1.2557 0,1.8835 0,0.2092 0.02311,0.4198 0,0.6278 -0.02946,0.2651 -0.123863,0.52 -0.156952,0.7847 -0.03894,0.3115 0,0.6278 0,0.9418 0,0.4185 0,0.837 0,1.2556 0,0.8894 0,1.7788 0,2.6682 0,0.3139 0.02842,0.6291 0,0.9417 -0.02415,0.2656 -0.130408,0.5193 -0.156952,0.7847 -0.02603,0.2603 0,0.5232 0,0.7848 0,0.2616 0,0.5232 0,0.7848 0,1.3602 0,2.7205 0,4.0807 0,0.074 -0.0071,0.7777 0,0.7848 0.03699,0.037 0.119958,-0.037 0.156952,0 0.005,0 0,0.4328 0,0.4708 0,0.2093 0,0.4186 0,0.6278 0,0.052 0,0.1047 0,0.157 0,0.052 0.05232,0.1569 0,0.1569 -0.05232,0 -0.03699,-0.1199 0,-0.1569 0.03699,-0.037 0.104635,0 0.156952,0"
+ id="path5058" />
+ <path
+ style="fill:none;stroke:url(#linearGradient5123);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter5100-9)"
+ d="m 69.842541,1011.0837 c 0.02394,0.2045 -0.04024,0.4266 0,0.6278 0.0423,0.2116 0.135488,0.4132 0.156952,0.6279 0.03123,0.3123 0,0.6278 0,0.9417 0,0.7847 0,1.5695 0,2.3542 0,5.4411 0,10.8821 0,16.3231 0,1.8834 0,3.7668 0,5.6502 0,0.6279 0,1.2557 0,1.8835 0,0.2092 0.02311,0.4198 0,0.6278 -0.02946,0.2651 -0.123863,0.52 -0.156952,0.7847 -0.03894,0.3115 0,0.6278 0,0.9418 0,0.4185 0,0.837 0,1.2556 0,0.8894 0,1.7788 0,2.6682 0,0.3139 0.02842,0.6291 0,0.9417 -0.02415,0.2656 -0.130408,0.5193 -0.156952,0.7847 -0.02603,0.2603 0,0.5232 0,0.7848 0,0.2616 0,0.5232 0,0.7848 0,1.3602 0,2.7205 0,4.0807 0,0.074 -0.0071,0.7777 0,0.7848 0.03699,0.037 0.119958,-0.037 0.156952,0 0.005,0 0,0.4328 0,0.4708 0,0.2093 0,0.4186 0,0.6278 0,0.052 0,0.1047 0,0.157 0,0.052 0.05232,0.1569 0,0.1569 -0.05232,0 -0.03699,-0.1199 0,-0.1569 0.03699,-0.037 0.104635,0 0.156952,0"
+ id="path5058-2"
+ transform="matrix(0.00689565,0.99997622,-0.99997622,0.00689565,1057.4614,973.82277)" />
+ <rect
+ style="fill:#4e9a06;stroke:#142701;stroke-opacity:1"
+ id="rect2816"
+ width="45"
+ height="45"
+ x="1.5777434"
+ y="1005.2093"
+ rx="1.365"
+ ry="1.3395145" />
+ <rect
+ style="fill:#555753;stroke:#2e3436;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3590"
+ width="26.054052"
+ height="25.426245"
+ x="10.829698"
+ y="1015.1646"
+ rx="1.365"
+ ry="1.3395145" />
+ <text
+ xml:space="preserve"
+ style="font-size:17.58400536px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+ x="3.1478038"
+ y="1042.1913"
+ id="text3592"
+ transform="scale(1.0064984,0.99354354)"><tspan
+ sodipodi:role="line"
+ id="tspan3594"
+ x="3.1478038"
+ y="1042.1913">MIPS</tspan></text>
+ </g>
+</svg>
diff --git a/app-emulation/spim/metadata.xml b/app-emulation/spim/metadata.xml
new file mode 100644
index 000000000000..8260022a7fa1
--- /dev/null
+++ b/app-emulation/spim/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ A self-contained simulator that will run MIPS32 assembly language
+ programs. It also provides a simple debugger and a minimal set of
+ operating system services.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">spimsimulator</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/spim/spim-8.0-r1.ebuild b/app-emulation/spim/spim-8.0-r1.ebuild
new file mode 100644
index 000000000000..f00ca7fe089b
--- /dev/null
+++ b/app-emulation/spim/spim-8.0-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="MIPS Simulator"
+HOMEPAGE="http://spimsimulator.sourceforge.net/"
+SRC_URI="http://www.cs.wisc.edu/~larus/SPIM/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ppc ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="doc X"
+
+RDEPEND="X? ( media-fonts/font-adobe-100dpi
+ x11-libs/libXaw
+ x11-libs/libXp )"
+DEPEND="${RDEPEND}
+ X? ( x11-misc/imake
+ x11-proto/xproto )
+ >=sys-apps/sed-4
+ sys-devel/bison"
+
+src_prepare() {
+ # fix bugs 240005 and 243588
+ epatch "${FILESDIR}/${PF}-respect_env.patch"
+
+ #fix bug 330389
+ sed -i -e 's:-12-\*-75-:-14-\*-100-:g' xspim/xspim.c || die
+}
+
+src_configure() {
+ tc-export CC
+ emake -C spim configuration || die
+
+ if use X; then
+ emake -C xspim configuration || die
+ fi
+}
+
+src_compile() {
+ emake DESTDIR="${EPREFIX}" -C spim || die
+
+ if use X; then
+ emake DESTDIR="${EPREFIX}" EXCEPTION_DIR=/var/lib/spim \
+ -C xspim -j1 xspim || die
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${ED}" -C spim install || die
+ newman Documentation/spim.man spim.1 || die
+
+ if use X; then
+ emake DESTDIR="${ED}" -C xspim install || die
+ newman Documentation/xspim.man xspim.1 || die
+ fi
+
+ doicon "${FILESDIR}"/xspim.svg || die
+ make_desktop_entry xspim xSPIM xspim "ComputerScience;Science;Education" \
+ "Comment=Graphical MIPS32 Assembly language emulator"
+
+ dohtml Documentation/SPIM.html || die
+ dodoc ChangeLog Documentation/BLURB README VERSION || die
+ if use doc ; then
+ dodoc Documentation/TeX/{cycle,spim}.ps || die
+ fi
+}
+
+src_test() {
+ emake -C spim test || die
+}
diff --git a/app-emulation/uade/Manifest b/app-emulation/uade/Manifest
new file mode 100644
index 000000000000..d4f22ebc5a0d
--- /dev/null
+++ b/app-emulation/uade/Manifest
@@ -0,0 +1 @@
+DIST uade-2.13.tar.bz2 2897931 SHA256 3b194e5aebbfa99d3708d5a0b5e6bd7dc5d1caaecf4ae9b52f8ff87e222dd612 SHA512 675c3369ed55a314cab81ae7ba8a09b277ab1cfe2354eac92194f746803ec2464b7603d665cf30da41caef5997c21515e69f0313d8d2b079c242a08fef786183 WHIRLPOOL 7ef11e14d00bffe660140cacbbd46b5e98578337e9c32ec41114c8c3cbda00b34d94ccc49c9dca62ed93fdd566287df60358c380611240996178b4f161cae313
diff --git a/app-emulation/uade/metadata.xml b/app-emulation/uade/metadata.xml
new file mode 100644
index 000000000000..d3c2cc926f0b
--- /dev/null
+++ b/app-emulation/uade/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>games</herd>
+</pkgmetadata>
diff --git a/app-emulation/uade/uade-2.13.ebuild b/app-emulation/uade/uade-2.13.ebuild
new file mode 100644
index 000000000000..1648f6732fc6
--- /dev/null
+++ b/app-emulation/uade/uade-2.13.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="Unix Amiga Delitracker Emulator - plays old Amiga tunes through UAE emulation"
+HOMEPAGE="http://zakalwe.fi/uade"
+SRC_URI="http://zakalwe.fi/uade/uade2/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+RDEPEND="media-libs/libao"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ ./configure \
+ --prefix=/usr \
+ --package-prefix="${D}" \
+ --with-uade123 \
+ --with-text-scope \
+ --without-xmms \
+ --without-audacious || die
+}
+
+src_install() {
+ DOCS="AUTHORS ChangeLog doc/BUGS doc/PLANS" \
+ default
+ doman doc/uade123.1
+}
diff --git a/app-emulation/uae/Manifest b/app-emulation/uae/Manifest
new file mode 100644
index 000000000000..1c4b9b13937e
--- /dev/null
+++ b/app-emulation/uae/Manifest
@@ -0,0 +1 @@
+DIST uae-0.8.29.tar.bz2 925508 SHA256 2463524b19b36ab44de158c5f24871878eda05230ea391343849959643634317 SHA512 2b8f362f9ba7171cf9ce71938b0a4f22c5d90d518524d50023792f4dc9f75a1b1e17e55966926e1138801b4d9ffbc2f1ae4c4b5dfa42e98a8e6ec688adb84064 WHIRLPOOL 0fcf540415b4434f59f8df97de6c49db03f088d219267eb19647afad483ffc99c48cba7cbf704e86e3d2f25ab184f19119d5a1c578df6dcbe53f7e6c25d1648c
diff --git a/app-emulation/uae/files/sdlgfx.h b/app-emulation/uae/files/sdlgfx.h
new file mode 100644
index 000000000000..30bee2ee4024
--- /dev/null
+++ b/app-emulation/uae/files/sdlgfx.h
@@ -0,0 +1,38 @@
+/*
+ * UAE - The Un*x Amiga Emulator
+ *
+ * SDL graphics support
+ *
+ * Copyright 2004 Richard Drummond
+ */
+
+/*
+ * What graphics platform are we running on . . .?
+ *
+ * Yes, SDL is supposed to abstract away from the underlying
+ * platform, but we need to know this to be able to map raw keys
+ * and to work around any platform-specific quirks . . .
+ */
+enum {
+ SDLGFX_DRIVER_UNKNOWN,
+ SDLGFX_DRIVER_X11,
+ SDLGFX_DRIVER_DGA,
+ SDLGFX_DRIVER_SVGALIB,
+ SDLGFX_DRIVER_FBCON,
+ SDLGFX_DRIVER_DIRECTFB,
+ SDLGFX_DRIVER_QUARTZ,
+ SDLGFX_DRIVER_BWINDOW,
+ SDLGFX_DRIVER_CYBERGFX,
+ SDLGFX_DRIVER_AMIGAOS4
+};
+
+extern int get_sdlgfx_type (void);
+
+/* keyboard support */
+struct uae_input_device_kbr_default *get_default_raw_keymap (int type);
+extern int keysym2amiga (int keycode);
+int modifier_hack (int *scancode, int *pressed);
+
+/* hotkey support */
+struct uae_hotkeyseq *get_default_cooked_hotkeys (void);
+struct uae_hotkeyseq *get_default_raw_hotkeys (void);
diff --git a/app-emulation/uae/files/uae-0.8.25-allow_spaces_in_zip_filenames.diff b/app-emulation/uae/files/uae-0.8.25-allow_spaces_in_zip_filenames.diff
new file mode 100644
index 000000000000..629ae702c520
--- /dev/null
+++ b/app-emulation/uae/files/uae-0.8.25-allow_spaces_in_zip_filenames.diff
@@ -0,0 +1,18 @@
+## 03_allow_spaces_in_zip_filenames.dpatch by Florian Ernst <florian@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Allow spaces in filenames for zipped files, bug#238678
+
+@DPATCH@
+diff -urNad uae-0.8.25~/src/zfile.c uae-0.8.25/src/zfile.c
+--- uae-0.8.25~/src/zfile.c 2005-07-01 17:53:26.000000000 +0200
++++ uae-0.8.25/src/zfile.c 2005-11-08 01:17:59.000000000 +0100
+@@ -126,7 +126,7 @@
+ if (!dst)
+ return 1;
+ #if defined AMIGA || defined __unix
+- sprintf (cmd, "unzip -p %s '*.adf' >%s", src, dst);
++ sprintf (cmd, "unzip -p \"%s\" '*.adf' >%s", src, dst);
+ return !system (cmd);
+ #endif
+ }
diff --git a/app-emulation/uae/files/uae-0.8.25-struct_uae_wrong_fields_name.diff b/app-emulation/uae/files/uae-0.8.25-struct_uae_wrong_fields_name.diff
new file mode 100644
index 000000000000..cd8d7e00cd8a
--- /dev/null
+++ b/app-emulation/uae/files/uae-0.8.25-struct_uae_wrong_fields_name.diff
@@ -0,0 +1,18 @@
+Somewhere wrong (old) names are used in accessing the preferences structure.
+
+This is just a remainder for the upstream!!
+
+Antonio Ospite <ospite@studenti.unina.it>
+
+diff -pruN uae-0.8.25/src/tui.c uae-0.8.25_patched/src/tui.c
+--- uae-0.8.25/src/tui.c 2006-06-07 17:45:55.000000000 +0200
++++ uae-0.8.25_patched/src/tui.c 2006-06-07 17:55:39.000000000 +0200
+@@ -606,7 +606,7 @@ static void SoundOptions (void)
+ currprefs.sound_freq = atoi (tmp);
+ break;
+ case 5:
+- currprefs.stereo = (currprefs.stereo + 1) % 3;
++ currprefs.sound_stereo = (currprefs.sound_stereo + 1) % 3;
+ break;
+ }
+ }
diff --git a/app-emulation/uae/files/uae-0.8.26-uae_reset_args.diff b/app-emulation/uae/files/uae-0.8.26-uae_reset_args.diff
new file mode 100644
index 000000000000..3df99e4d2a4f
--- /dev/null
+++ b/app-emulation/uae/files/uae-0.8.26-uae_reset_args.diff
@@ -0,0 +1,86 @@
+diff -Naur uae-0.8.26.orig/src/ncurses.c uae-0.8.26/src/ncurses.c
+--- uae-0.8.26.orig/src/ncurses.c 2007-08-05 20:01:58.000000000 +0400
++++ uae-0.8.26/src/ncurses.c 2007-08-12 18:36:33.000000000 +0400
+@@ -595,7 +595,7 @@
+ if (ch == 16) --lastmy; /* ^P */
+ if (ch == 11) {buttonstate[0] = keydelay;ch = 0;} /* ^K */
+ if (ch == 25) {buttonstate[2] = keydelay;ch = 0;} /* ^Y */
+- if (ch == 15) uae_reset (); /* ^O */
++ if (ch == 15) uae_reset (0); /* ^O */
+ if (ch == 17) uae_quit (); /* ^Q */
+ if (ch == KEY_F(1)) {
+ curses_insert_disk();
+diff -Naur uae-0.8.26.orig/src/NeXTwin.m uae-0.8.26/src/NeXTwin.m
+--- uae-0.8.26.orig/src/NeXTwin.m 1997-10-18 17:39:04.000000000 +0400
++++ uae-0.8.26/src/NeXTwin.m 2007-08-12 18:36:33.000000000 +0400
+@@ -86,7 +86,7 @@
+ @implementation AmigaView
+ -reset:sender
+ {
+- uae_reset();
++ uae_reset(0);
+ //m68k_reset();
+ return self;
+ }
+diff -Naur uae-0.8.26.orig/src/od-beos/beos.cpp uae-0.8.26/src/od-beos/beos.cpp
+--- uae-0.8.26.orig/src/od-beos/beos.cpp 2001-02-19 23:59:11.000000000 +0300
++++ uae-0.8.26/src/od-beos/beos.cpp 2007-08-12 18:36:33.000000000 +0400
+@@ -719,7 +719,7 @@
+ uint32 mouse_buttons;
+
+ if (reset_thyself) {
+- uae_reset();
++ uae_reset(0);
+ reset_thyself = false;
+ }
+
+diff -Naur uae-0.8.26.orig/src/od-win32/keyboard.c uae-0.8.26/src/od-win32/keyboard.c
+--- uae-0.8.26.orig/src/od-win32/keyboard.c 2007-08-06 00:23:08.000000000 +0400
++++ uae-0.8.26/src/od-win32/keyboard.c 2007-08-12 18:36:33.000000000 +0400
+@@ -488,8 +488,8 @@
+ record_key ((akey << 1) + 1);
+
+ /* "Affengriff" */
+- if( (keystate[AK_CTRL] || keystate[AK_RCTRL] ) && keystate[AK_LAMI] && keystate[AK_RAMI])uae_reset();
+- //if( (keystate[AK_CTRL] || keystate[AK_RCTRL] ) && keystate[AK_RAMI])uae_reset();
++ if( (keystate[AK_CTRL] || keystate[AK_RCTRL] ) && keystate[AK_LAMI] && keystate[AK_RAMI])uae_reset(0);
++ //if( (keystate[AK_CTRL] || keystate[AK_RCTRL] ) && keystate[AK_RAMI])uae_reset(0);
+
+ return 0;
+ }
+diff -Naur uae-0.8.26.orig/src/od-win32/win32gui.c uae-0.8.26/src/od-win32/win32gui.c
+--- uae-0.8.26.orig/src/od-win32/win32gui.c 2007-08-06 00:23:08.000000000 +0400
++++ uae-0.8.26/src/od-win32/win32gui.c 2007-08-12 18:36:33.000000000 +0400
+@@ -2260,7 +2260,7 @@
+ }
+ break;
+ case IDC_RESETAMIGA:
+- uae_reset();
++ uae_reset(0);
+ break;
+ case IDC_QUITEMU:
+ uae_quit();
+diff -Naur uae-0.8.26.orig/src/svga.c uae-0.8.26/src/svga.c
+--- uae-0.8.26.orig/src/svga.c 2007-08-05 20:01:58.000000000 +0400
++++ uae-0.8.26/src/svga.c 2007-08-12 18:36:33.000000000 +0400
+@@ -438,7 +438,7 @@
+
+ /* "Affengriff" */
+ if ((keystate[AK_CTRL] || keystate[AK_RCTRL]) && keystate[AK_LAMI] && keystate[AK_RAMI])
+- uae_reset ();
++ uae_reset (0);
+ }
+
+ static void leave_graphics_mode (void)
+diff -Naur uae-0.8.26.orig/src/tui.c uae-0.8.26/src/tui.c
+--- uae-0.8.26.orig/src/tui.c 2007-08-12 18:35:41.000000000 +0400
++++ uae-0.8.26/src/tui.c 2007-08-12 18:36:33.000000000 +0400
+@@ -683,7 +683,7 @@
+ case 0: DiskOptions (); break;
+ case 1: OtherOptions (); break;
+ case 2: save_settings (); break;
+- case 3: uae_reset (); break;
++ case 3: uae_reset (0); break;
+ case 4: uae_quit (); break;
+ }
+ }
diff --git a/app-emulation/uae/files/uae-0.8.26-underlinking.patch b/app-emulation/uae/files/uae-0.8.26-underlinking.patch
new file mode 100644
index 000000000000..16bf5744826e
--- /dev/null
+++ b/app-emulation/uae/files/uae-0.8.26-underlinking.patch
@@ -0,0 +1,19 @@
+--- configure.in
++++ configure.in
+@@ -81,6 +81,16 @@
+ AC_CHECK_LIB(audio, alOpenPort, HAVE_SGIAUDIO_LIB=yes, HAVE_SGIAUDIO_LIB=no)
+ AC_CHECK_LIB(asound, snd_pcm_open, HAVE_ALSA=yes, HAVE_ALSA=no)
+
++dnl Check for libm for cos()
++AC_SEARCH_LIBS([cos], [m], [], [
++ AC_MSG_ERROR([unable to find the cos() function])
++])
++
++dnl Check for libm for floor()
++AC_SEARCH_LIBS([floor], [m], [], [
++ AC_MSG_ERROR([unable to find the floor() function])
++])
++
+ AC_PATH_XTRA
+ AC_CONFIG_HEADER(src/sysconfig.h)
+
diff --git a/app-emulation/uae/metadata.xml b/app-emulation/uae/metadata.xml
new file mode 100644
index 000000000000..542646bcd47e
--- /dev/null
+++ b/app-emulation/uae/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ UAE is a mostly complete software emulation of the hardware of the
+ Commodore Amiga 500/1000/2000. A Commodore Amiga is a 16/32 bit computer
+ system based on the Motorola 680x0 CPU and a few specially designed
+ custom chips that provide very good graphics and sound capabilities. It's
+ first incarnation, the A1000, appeared in 1985, followed by the highly
+ successful A500 and A2000 models.
+ </longdescription>
+ <use>
+ <flag name='scsi'>Enable the uaescsi.device</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/uae/uae-0.8.29-r2.ebuild b/app-emulation/uae/uae-0.8.29-r2.ebuild
new file mode 100644
index 000000000000..bd951a854a86
--- /dev/null
+++ b/app-emulation/uae/uae-0.8.29-r2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils autotools
+
+DESCRIPTION="The Umiquious Amiga Emulator"
+HOMEPAGE="http://www.amigaemulator.org/"
+SRC_URI="ftp://ftp.amigaemulator.org/pub/uae/sources/develop/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="sdl alsa scsi"
+
+DEPEND="sdl? ( media-libs/libsdl
+ media-libs/sdl-gfx
+ x11-libs/gtk+:2
+ alsa? ( media-libs/alsa-lib )
+ )
+ !sdl? ( x11-libs/libXext
+ x11-libs/gtk+:2
+ )
+ alsa? ( media-libs/alsa-lib )
+ scsi? ( app-cdr/cdrtools )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.8.25-allow_spaces_in_zip_filenames.diff
+ epatch "${FILESDIR}"/${PN}-0.8.25-struct_uae_wrong_fields_name.diff
+ epatch "${FILESDIR}"/${PN}-0.8.26-uae_reset_args.diff
+ epatch "${FILESDIR}"/${PN}-0.8.26-underlinking.patch
+
+ cp "${FILESDIR}"/sdlgfx.h "${S}"/src || die
+
+ eautoreconf
+}
+
+src_configure() {
+ # disabling lots of options, cause many code-paths are broken, these should compile,
+ # if you want/need other options, please test if they work with other combinations
+ # before opening a bug
+ econf --enable-ui --with-x --without-svgalib \
+ --without-asciiart --without-sdl-sound --enable-threads \
+ $(use_with sdl) $(use_with sdl sdl-gfx) \
+ $(use_with alsa) \
+ $(use_enable scsi scsi-device)
+}
+
+src_compile() {
+ emake -j1
+}
+
+src_install() {
+ dobin uae readdisk
+ cp docs/unix/README docs/README.unix || die
+ rm -r docs/{AmigaOS,BeOS,pOS,translated,unix} || die
+ dodoc docs/*
+
+ insinto /usr/share/uae/amiga-tools
+ doins amiga/{*hack,trans*,uae*}
+}
+
+pkg_postinst() {
+ elog
+ elog "Upstream recommends using SDL graphics (with an environment variable)"
+ elog "SDL_VIDEO_X11_XRANDR=1 for fullscreen support."
+ echo
+}
diff --git a/app-emulation/vagrant/Manifest b/app-emulation/vagrant/Manifest
new file mode 100644
index 000000000000..a4955742eee9
--- /dev/null
+++ b/app-emulation/vagrant/Manifest
@@ -0,0 +1 @@
+DIST vagrant-1.4.3.tar.gz 2391973 SHA256 09ccc0d87999a3c133b9ef52a5cff58402745ee64af6080b2a5d304eb06c9c58 SHA512 93fd1cfa263004cadbf670fac4dc318db9719d2a86afe188857cbc97c1317e6ef2387be498ef9278ca95cdda6bd41400426e3bf52448eb59c31877c9fd0624e4 WHIRLPOOL e581e8488e0b1e75bcdd75f4572b89f9c23338e422d3acb57b1d5d513d9357ec0b061371d926ad0bb1087bf890e70422d4e3527dfd518329ba910f42f0733673
diff --git a/app-emulation/vagrant/files/vagrant-1.2.1-no-warning.patch b/app-emulation/vagrant/files/vagrant-1.2.1-no-warning.patch
new file mode 100644
index 000000000000..08d1d3568b80
--- /dev/null
+++ b/app-emulation/vagrant/files/vagrant-1.2.1-no-warning.patch
@@ -0,0 +1,12 @@
+--- vagrant-1.2.1/bin/vagrant
++++ vagrant-1.2.1/bin/vagrant
+@@ -74,9 +74,6 @@
+ warned = true
+ end
+ end
+-
+- # If we're not in the installer, warn.
+- env.ui.warn(I18n.t("vagrant.general.not_in_installer")) if !warned
+ end
+
+ begin
diff --git a/app-emulation/vagrant/files/vagrant-1.2.2-rvm.patch b/app-emulation/vagrant/files/vagrant-1.2.2-rvm.patch
new file mode 100644
index 000000000000..99265a26bfbf
--- /dev/null
+++ b/app-emulation/vagrant/files/vagrant-1.2.2-rvm.patch
@@ -0,0 +1,12 @@
+--- vagrant-1.2.2/bin/vagrant
++++ vagrant-1.2.2/bin/vagrant
+@@ -5,6 +5,9 @@
+ # initializing which have historically resulted in stack traces.
+ Signal.trap("INT") { exit 1 }
+
++ENV.delete('GEM_HOME')
++ENV.delete('GEM_PATH')
++
+ require 'log4r'
+ require 'vagrant'
+ require 'vagrant/cli'
diff --git a/app-emulation/vagrant/metadata.xml b/app-emulation/vagrant/metadata.xml
new file mode 100644
index 000000000000..5125c656be0c
--- /dev/null
+++ b/app-emulation/vagrant/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">mitchellh/vagrant</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/vagrant/vagrant-1.4.3-r2.ebuild b/app-emulation/vagrant/vagrant-1.4.3-r2.ebuild
new file mode 100644
index 000000000000..edac95f3c32a
--- /dev/null
+++ b/app-emulation/vagrant/vagrant-1.4.3-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+USE_RUBY="ruby20"
+
+RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"
+RUBY_FAKEGEM_GEMSPEC="vagrant.gemspec"
+RUBY_FAKEGEM_EXTRAINSTALL="config keys plugins templates"
+RUBY_FAKEGEM_TASK_DOC=""
+
+inherit ruby-fakegem eutils
+
+DESCRIPTION="A tool for building and distributing virtual machines using VirtualBox"
+HOMEPAGE="http://vagrantup.com/"
+SRC_URI="https://github.com/mitchellh/vagrant/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~x64-macos"
+IUSE="test"
+
+# Missing ebuild for contest
+RESTRICT="test"
+
+RDEPEND="${RDEPEND}
+ app-arch/libarchive
+ net-misc/curl
+ !x64-macos? ( || ( app-emulation/virtualbox app-emulation/virtualbox-bin ) )"
+
+ruby_add_rdepend "
+ >=dev-ruby/childprocess-0.3.7
+ >=dev-ruby/erubis-2.7.0
+ dev-ruby/i18n:0.6
+ >=dev-ruby/json-1.5.1
+ >=dev-ruby/log4r-1.1.9
+ >=dev-ruby/net-ssh-2.6.6
+ >=dev-ruby/net-scp-1.1.0
+"
+
+ruby_add_bdepend "
+ dev-ruby/rake
+ test? ( dev-ruby/mocha virtual/ruby-minitest )
+"
+
+all_ruby_prepare() {
+ # remove bundler support
+ sed -i '/[Bb]undler/d' Rakefile || die
+ rm Gemfile || die
+
+ # loosen dependencies
+ sed -e '/childprocess\|erubis\|log4r\|net-scp/s/~>/>=/' \
+ -e '/net-ssh/s:, "< 2.8.0"::' \
+ -i ${PN}.gemspec || die
+
+ epatch "${FILESDIR}"/${PN}-1.2.1-no-warning.patch
+ epatch "${FILESDIR}"/${PN}-1.2.2-rvm.patch
+}
+
+pkg_postinst() {
+ if use x64-macos ; then
+ ewarn
+ ewarn "For Mac OS X prefixes, you must install the virtualbox"
+ ewarn "package specifically for OS X which can be found at:"
+ ewarn "https://www.virtualbox.org/wiki/Downloads"
+ ewarn
+ fi
+}
diff --git a/app-emulation/vboxgtk/Manifest b/app-emulation/vboxgtk/Manifest
new file mode 100644
index 000000000000..578ed92664fd
--- /dev/null
+++ b/app-emulation/vboxgtk/Manifest
@@ -0,0 +1 @@
+DIST vboxgtk-0.8.2.tar.gz 43717 SHA256 317d7b55cc0c98bf3c1fe294a8fc62668709ae14f12b3bf3b32d5fa33451fe95 SHA512 7326bf3892ec6f7d81614982b1a08ba4bf25ed3c10d327f9f56cad1f1493faf784e2d5324177e3abaea9de29eb5daec49c878b6152b4b3c0301ae640142d8aee WHIRLPOOL b465a9ccf2c582b685fa80cdfc16906768c2ac83c25399959a4a737fa13f0a24711651c5bde8ee980bcfee556dc8c539b167299e8f7e9b2637c35659b544cfd6
diff --git a/app-emulation/vboxgtk/metadata.xml b/app-emulation/vboxgtk/metadata.xml
new file mode 100644
index 000000000000..e96e35b1a37c
--- /dev/null
+++ b/app-emulation/vboxgtk/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
+
diff --git a/app-emulation/vboxgtk/vboxgtk-0.8.2-r1.ebuild b/app-emulation/vboxgtk/vboxgtk-0.8.2-r1.ebuild
new file mode 100644
index 000000000000..8f3c0c08cc90
--- /dev/null
+++ b/app-emulation/vboxgtk/vboxgtk-0.8.2-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PLOCALES="cs gl"
+inherit gnome2-utils l10n distutils-r1
+
+DESCRIPTION="GTK frontend for VirtualBox"
+HOMEPAGE="http://code.google.com/p/vboxgtk/"
+SRC_URI="http://vboxgtk.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ || ( >=app-emulation/virtualbox-4.2.0[-headless,python,sdk]
+ >=app-emulation/virtualbox-bin-4.2.0[python] )
+ dev-python/pygobject:3
+ x11-libs/gtk+:3[introspection]"
+DEPEND="dev-util/intltool
+ sys-devel/gettext"
+
+DOCS=( AUTHORS README )
+
+python_prepare_all() {
+ rm_locale() { rm -r po/"${1}".po || die "LINGUAS removal failed" ;}
+ l10n_for_each_disabled_locale_do rm_locale
+ distutils-r1_python_prepare_all
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vice/Manifest b/app-emulation/vice/Manifest
new file mode 100644
index 000000000000..bb31cd05de86
--- /dev/null
+++ b/app-emulation/vice/Manifest
@@ -0,0 +1,2 @@
+DIST vice-2.4.20.tar.gz 25156408 SHA256 e5d3d125940f0fafe409aabeec9de4e3ae8d9c19a731aa7ec6a57f6d2b897c5f SHA512 a27b1672ca356d0e8f2890c91e449b78ef76512f6d81bdf25350b90c1f472d57ae6d23646d0176c5544c47d81023aa3deb172e3a02eeb0022ea32a13311b5a76 WHIRLPOOL 5f25bfa72ade54dbe09699b5932df2c37017c3993daba048eb09f723a4351300b6722cf06ceb264202459051780a775f45b787b6ea60db78560d5c65da684541
+DIST vice-2.4.tar.gz 13656511 SHA256 ff8b8d5f0f497d1f8e75b95bbc4204993a789284a08a8a59ba727ad81dcace10 SHA512 ad197fc35eb80c9738b7f4f551d350dbb4440c7c8103e5d472b7f7ea5106c1356e9d6e3f481552a028a313129ef233833d3147e03f6f00b9890229d5708e3ebb WHIRLPOOL 80f89f7c144fe1ef2305e109049b49e47dfa4af9b69d0d848bf7b06bd0f2d210669acece363b550abad1c50f53dd45a30397eb1bfacfaa443c9e865c686d0823
diff --git a/app-emulation/vice/files/vice-2.4-arm.patch b/app-emulation/vice/files/vice-2.4-arm.patch
new file mode 100644
index 000000000000..55e2d5a35b0c
--- /dev/null
+++ b/app-emulation/vice/files/vice-2.4-arm.patch
@@ -0,0 +1,38 @@
+--- vice/configure.in
++++ vice/configure.in
+@@ -2299,6 +2299,7 @@
+
+ if test x"$PARSID_SUPPORT" = "xno"; then
+ AC_CHECK_FUNCS(ioperm,[PARSID_SUPPORT=yes],)
++ AC_CHECK_FUNCS(outb_p inb_p)
+ fi
+
+ if test x"$PARSID_SUPPORT" = "xyes"; then
+--- vice/src/arch/unix/parsid.c
++++ vice/src/arch/unix/parsid.c
+@@ -217,8 +217,12 @@
+ #endif
+ #endif
+ #ifdef HAVE_IOPERM
++#ifndef HAVE_OUTB_P
++ outb(value, addr);
++#else
+ outb_p(value, addr);
+ #endif
++#endif
+ }
+
+ BYTE parsid_inb(int addr)
+@@ -237,8 +241,12 @@
+ #endif
+ #endif
+ #ifdef HAVE_IOPERM
++#ifndef HAVE_INB_P
++ return inb((unsigned short)addr);
++#else
+ return inb_p((unsigned short)addr);
+ #endif
++#endif
+ }
+
+ /* chip control pin assignments */
diff --git a/app-emulation/vice/files/vice-2.4-autotools.patch b/app-emulation/vice/files/vice-2.4-autotools.patch
new file mode 100644
index 000000000000..f67113f0b45e
--- /dev/null
+++ b/app-emulation/vice/files/vice-2.4-autotools.patch
@@ -0,0 +1,11 @@
+--- vice-2.4.orig/configure.in
++++ vice-2.4/configure.in
+@@ -105,7 +105,7 @@
+ AC_SUBST(VICE_VERSION)
+
+ AM_INIT_AUTOMAKE(vice, $VICE_VERSION)
+-AM_CONFIG_HEADER(src/config.h)
++AC_CONFIG_HEADERS(src/config.h)
+
+ if test x"$VICE_VERSION_BUILD" = "x" -o x"$VICE_VERSION_BUILD" = "x0" ; then
+ VERSION_RC=$VICE_VERSION_MAJOR","$VICE_VERSION_MINOR",0,0"
diff --git a/app-emulation/vice/files/vice-2.4-buffer.patch b/app-emulation/vice/files/vice-2.4-buffer.patch
new file mode 100644
index 000000000000..dc5fab9b5725
--- /dev/null
+++ b/app-emulation/vice/files/vice-2.4-buffer.patch
@@ -0,0 +1,14 @@
+avoid writing past the end of the gcr_track buffer
+https://bugs.gentoo.org/show_bug.cgi?id=464708
+
+--- ./src/diskimage/fsimage-create.c.orig
++++ ./src/diskimage/fsimage-create.c
+@@ -262,7 +262,7 @@
+ gcrptr = gcr_track;
+ util_word_to_le_buf(gcrptr, disk_image_raw_track_size(image->type, track));
+ gcrptr += 2;
+- memset(gcrptr, 0x55, NUM_MAX_BYTES_TRACK);
++ memset(gcrptr, 0x55, NUM_MAX_BYTES_TRACK - 2);
+
+ header.track = track;
+ for (sector = 0;
diff --git a/app-emulation/vice/files/vice-2.4-ffmpeg-1.patch b/app-emulation/vice/files/vice-2.4-ffmpeg-1.patch
new file mode 100644
index 000000000000..4aefda24584f
--- /dev/null
+++ b/app-emulation/vice/files/vice-2.4-ffmpeg-1.patch
@@ -0,0 +1,135 @@
+Fixes build with recent FFmpeg versions.
+
+https://bugs.gentoo.org/show_bug.cgi?id=443218
+https://sourceforge.net/tracker/?func=detail&aid=3601992&group_id=223021&atid=1057619
+
+--- vice-2.4.orig/src/gfxoutputdrv/ffmpegdrv.c
++++ vice-2.4/src/gfxoutputdrv/ffmpegdrv.c
+@@ -343,7 +343,7 @@ static int ffmpegmovie_init_audio(int sp
+ c = st->codec;
+ c->codec_id = ffmpegdrv_fmt->audio_codec;
+ c->codec_type = AVMEDIA_TYPE_AUDIO;
+- c->sample_fmt = SAMPLE_FMT_S16;
++ c->sample_fmt = AV_SAMPLE_FMT_S16;
+
+ /* put sample parameters */
+ c->bit_rate = audio_bitrate;
+@@ -613,12 +613,7 @@ static int ffmpegdrv_init_file(void)
+ if (!video_init_done || !audio_init_done)
+ return 0;
+
+- if ((*ffmpeglib.p_av_set_parameters)(ffmpegdrv_oc, NULL) < 0) {
+- log_debug("ffmpegdrv: Invalid output format parameters");
+- return -1;
+- }
+-
+- (*ffmpeglib.p_dump_format)(ffmpegdrv_oc, 0, ffmpegdrv_oc->filename, 1);
++ (*ffmpeglib.p_av_dump_format)(ffmpegdrv_oc, 0, ffmpegdrv_oc->filename, 1);
+
+ if (video_st && (ffmpegdrv_open_video(ffmpegdrv_oc, video_st) < 0)) {
+ ui_error(translate_text(IDGS_FFMPEG_CANNOT_OPEN_VSTREAM));
+@@ -632,8 +627,8 @@ static int ffmpegdrv_init_file(void)
+ }
+
+ if (!(ffmpegdrv_fmt->flags & AVFMT_NOFILE)) {
+- if ((*ffmpeglib.p_url_fopen)(&ffmpegdrv_oc->pb, ffmpegdrv_oc->filename,
+- URL_WRONLY) < 0)
++ if ((*ffmpeglib.p_avio_open)(&ffmpegdrv_oc->pb, ffmpegdrv_oc->filename,
++ AVIO_FLAG_WRITE) < 0)
+ {
+ ui_error(translate_text(IDGS_FFMPEG_CANNOT_OPEN_S), ffmpegdrv_oc->filename);
+ screenshot_stop_recording();
+@@ -642,7 +637,7 @@ static int ffmpegdrv_init_file(void)
+
+ }
+
+- (*ffmpeglib.p_av_write_header)(ffmpegdrv_oc);
++ (*ffmpeglib.p_avformat_write_header)(ffmpegdrv_oc,NULL);
+
+ log_debug("ffmpegdrv: Initialized file successfully");
+
+@@ -724,7 +719,7 @@ static int ffmpegdrv_close(screenshot_t
+ (*ffmpeglib.p_av_write_trailer)(ffmpegdrv_oc);
+ if (!(ffmpegdrv_fmt->flags & AVFMT_NOFILE)) {
+ /* close the output file */
+- (*ffmpeglib.p_url_fclose)(ffmpegdrv_oc->pb);
++ (*ffmpeglib.p_avio_close)(ffmpegdrv_oc->pb);
+ }
+ }
+
+--- vice-2.4.orig/src/gfxoutputdrv/ffmpeglib.c
++++ vice-2.4/src/gfxoutputdrv/ffmpeglib.c
+@@ -208,13 +208,12 @@ static int load_avformat(ffmpeglib_t *li
+ GET_SYMBOL_AND_TEST_AVFORMAT(av_init_packet);
+ GET_SYMBOL_AND_TEST_AVFORMAT(av_register_all);
+ GET_SYMBOL_AND_TEST_AVFORMAT(av_new_stream);
+- GET_SYMBOL_AND_TEST_AVFORMAT(av_set_parameters);
+- GET_SYMBOL_AND_TEST_AVFORMAT(av_write_header);
++ GET_SYMBOL_AND_TEST_AVFORMAT(avformat_write_header);
+ GET_SYMBOL_AND_TEST_AVFORMAT(av_write_frame);
+ GET_SYMBOL_AND_TEST_AVFORMAT(av_write_trailer);
+- GET_SYMBOL_AND_TEST_AVFORMAT(url_fopen);
+- GET_SYMBOL_AND_TEST_AVFORMAT(url_fclose);
+- GET_SYMBOL_AND_TEST_AVFORMAT(dump_format);
++ GET_SYMBOL_AND_TEST_AVFORMAT(avio_open);
++ GET_SYMBOL_AND_TEST_AVFORMAT(avio_close);
++ GET_SYMBOL_AND_TEST_AVFORMAT(av_dump_format);
+ GET_SYMBOL_AND_TEST_AVFORMAT(av_guess_format);
+ #ifndef HAVE_FFMPEG_SWSCALE
+ GET_SYMBOL_AND_TEST_AVFORMAT(img_convert);
+@@ -240,13 +239,12 @@ static void free_avformat(ffmpeglib_t *l
+ lib->p_av_init_packet = NULL;
+ lib->p_av_register_all = NULL;
+ lib->p_av_new_stream = NULL;
+- lib->p_av_set_parameters = NULL;
+- lib->p_av_write_header = NULL;
++ lib->p_avformat_write_header = NULL;
+ lib->p_av_write_frame = NULL;
+ lib->p_av_write_trailer = NULL;
+- lib->p_url_fopen = NULL;
+- lib->p_url_fclose = NULL;
+- lib->p_dump_format = NULL;
++ lib->p_avio_open = NULL;
++ lib->p_avio_close = NULL;
++ lib->p_av_dump_format = NULL;
+ lib->p_av_guess_format = NULL;
+ #ifndef HAVE_FFMPEG_SWSCALE
+ lib->p_img_convert = NULL;
+--- vice-2.4.orig/src/gfxoutputdrv/ffmpeglib.h
++++ vice-2.4/src/gfxoutputdrv/ffmpeglib.h
+@@ -80,13 +80,12 @@ typedef int (*avpicture_get_size_t) (int
+ typedef void (*av_init_packet_t) (AVPacket *pkt);
+ typedef void (*av_register_all_t) (void);
+ typedef AVStream* (*av_new_stream_t) (AVFormatContext*, int);
+-typedef int (*av_set_parameters_t) (AVFormatContext*, AVFormatParameters*);
+-typedef int (*av_write_header_t) (AVFormatContext*);
++typedef int (*avformat_write_header_t) (AVFormatContext*,AVDictionary **);
+ typedef int (*av_write_frame_t) (AVFormatContext*, AVPacket*);
+ typedef int (*av_write_trailer_t) (AVFormatContext*);
+-typedef int (*url_fopen_t) (ByteIOContext**, const char*, int);
+-typedef int (*url_fclose_t) (ByteIOContext*);
+-typedef void (*dump_format_t) (AVFormatContext *, int, const char*, int);
++typedef int (*avio_open_t) (AVIOContext**, const char*, int);
++typedef int (*avio_close_t) (AVIOContext*);
++typedef void (*av_dump_format_t) (AVFormatContext *, int, const char*, int);
+ typedef AVOutputFormat* (*av_guess_format_t) (const char*, const char*, const char*);
+ typedef int (*img_convert_t) (AVPicture*, int, AVPicture*, int, int, int);
+
+@@ -118,13 +117,12 @@ struct ffmpeglib_s {
+ av_init_packet_t p_av_init_packet;
+ av_register_all_t p_av_register_all;
+ av_new_stream_t p_av_new_stream;
+- av_set_parameters_t p_av_set_parameters;
+- av_write_header_t p_av_write_header;
++ avformat_write_header_t p_avformat_write_header;
+ av_write_frame_t p_av_write_frame;
+ av_write_trailer_t p_av_write_trailer;
+- url_fopen_t p_url_fopen;
+- url_fclose_t p_url_fclose;
+- dump_format_t p_dump_format;
++ avio_open_t p_avio_open;
++ avio_close_t p_avio_close;
++ av_dump_format_t p_av_dump_format;
+ av_guess_format_t p_av_guess_format;
+ #ifndef HAVE_FFMPEG_SWSCALE
+ img_convert_t p_img_convert;
diff --git a/app-emulation/vice/files/vice-2.4.20-autotools.patch b/app-emulation/vice/files/vice-2.4.20-autotools.patch
new file mode 100644
index 000000000000..7bebd2800ef6
--- /dev/null
+++ b/app-emulation/vice/files/vice-2.4.20-autotools.patch
@@ -0,0 +1,11 @@
+--- vice-2.4.7.orig/configure.ac
++++ vice-2.4.7/configure.ac
+@@ -124,7 +118,7 @@
+ AC_SUBST(VICE_VERSION)
+
+ AM_INIT_AUTOMAKE(vice, $VICE_VERSION)
+-AM_CONFIG_HEADER(src/config.h)
++AC_CONFIG_HEADERS(src/config.h)
+
+ if test x"$VICE_VERSION_BUILD" = "x" -o x"$VICE_VERSION_BUILD" = "x0" ; then
+ VERSION_RC=$VICE_VERSION_MAJOR","$VICE_VERSION_MINOR",0,0"
diff --git a/app-emulation/vice/files/vice-2.4.20-xf86extensions.patch b/app-emulation/vice/files/vice-2.4.20-xf86extensions.patch
new file mode 100644
index 000000000000..357d68666511
--- /dev/null
+++ b/app-emulation/vice/files/vice-2.4.20-xf86extensions.patch
@@ -0,0 +1,15 @@
+--- a/trunk/vice/src/arch/unix/x11/gnome/x11ui.c
++++ b/trunk/vice/src/arch/unix/x11/gnome/x11ui.c
+@@ -102,9 +102,10 @@
+ #include "ui-threads.h"
+ #endif
+
+-#ifdef USE_XF86_EXTENSIONS
++#if defined(USE_XF86_EXTENSIONS) || !defined(HAVE_VTE)
+ #include <gdk/gdkx.h>
+ #endif
++
+ #include "x11ui.h"
+
+ #ifdef DEBUG_X11UI
+
diff --git a/app-emulation/vice/metadata.xml b/app-emulation/vice/metadata.xml
new file mode 100644
index 000000000000..9364cf9ad61e
--- /dev/null
+++ b/app-emulation/vice/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>games</herd>
+ <use>
+ <flag name="ethernet">Enable ethernet emulation</flag>
+ <flag name="fullscreen">Enable the ability to run fullscreen</flag>
+ <flag name="gtk2">Use GTK+2 for GUI instead of GTK+3</flag>
+ <flag name="memmap">Enable extra monitor features</flag>
+ <flag name="sdlsound">Use <pkg>media-libs/libsdl</pkg> for sound support</flag>
+ <flag name="vte">Enable support for <pkg>x11-libs/vte</pkg> in the GTK+ interface</flag>
+ <flag name="xrandr">Enable support for the X xrandr extension</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">vice-emu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/vice/vice-2.4.20.ebuild b/app-emulation/vice/vice-2.4.20.ebuild
new file mode 100644
index 000000000000..d4bb1665411d
--- /dev/null
+++ b/app-emulation/vice/vice-2.4.20.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils toolchain-funcs flag-o-matic games
+
+DESCRIPTION="The Versatile Commodore 8-bit Emulator"
+HOMEPAGE="http://vice-emu.sourceforge.net/"
+SRC_URI="mirror://sourceforge/vice-emu/releases/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="Xaw3d alsa ethernet ffmpeg fullscreen +gtk2 ipv6 lame nls oss png pulseaudio sdl +sdlsound threads vte zlib"
+
+# upstream says gtk3 and sdl2 shouldn't be exposed yet.
+#REQUIRED_USE="?? ( gtk2 gtk3 sdl )"
+REQUIRED_USE="?? ( gtk2 sdl )"
+
+GTK_COMMON="
+ x11-libs/pango
+ x11-libs/cairo"
+# gtk3? (
+# x11-libs/gtk+:3
+# vte? ( x11-libs/vte:2.90 )
+# ${GTK_COMMON}
+# )
+RDEPEND="
+ virtual/jpeg:0
+ virtual/opengl
+ media-libs/giflib
+ alsa? ( media-libs/alsa-lib )
+ pulseaudio? ( media-sound/pulseaudio )
+ sdlsound? ( media-libs/libsdl[sound] )
+ ethernet? (
+ >=net-libs/libpcap-0.9.8
+ >=net-libs/libnet-1.1.2.1:1.1
+ )
+ ffmpeg? ( virtual/ffmpeg )
+ lame? ( media-sound/lame )
+ nls? ( virtual/libintl )
+ png? ( media-libs/libpng:0 )
+ zlib? ( sys-libs/zlib )
+ sdl? (
+ media-libs/libsdl[joystick,video]
+ )
+ !sdl? (
+ fullscreen? (
+ x11-libs/libXrandr
+ x11-libs/libXxf86vm )
+ x11-libs/libX11
+ x11-libs/libXext
+ sys-libs/readline
+ )
+ gtk2? (
+ x11-libs/gtk+:2
+ vte? ( x11-libs/vte:0 )
+ x11-libs/gtkglext
+ ${GTK_COMMON}
+ )
+ !sdl? ( !gtk2? (
+ x11-libs/libXmu
+ x11-libs/libXpm
+ x11-libs/libXt
+ x11-libs/libXv
+ Xaw3d? ( x11-libs/libXaw3d )
+ !Xaw3d? ( x11-libs/libXaw )
+ ) )
+ "
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ !sdl? (
+ fullscreen? ( x11-proto/xf86vidmodeproto )
+ !gtk2? (
+ x11-libs/libICE
+ x11-libs/libSM
+ )
+ )
+ x11-apps/bdftopcf
+ x11-apps/mkfontdir
+ x11-proto/xproto
+ x11-proto/xextproto
+ media-libs/fontconfig
+ x11-proto/videoproto
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-autotools.patch \
+ "${FILESDIR}"/${P}-xf86extensions.patch
+ sed -i \
+ -e 's/building//' \
+ doc/Makefile.am || die
+ sed -i \
+ -e "/^docdir =/s:=.*:=/usr/share/doc/${PF}:" \
+ doc/Makefile.am \
+ doc/readmes/Makefile.am || die
+ sed -i \
+ -e "/^docdir =/s:=.*:=/usr/share/doc/${PF}/html:" \
+ doc/html/Makefile.am || die
+ sed -i \
+ -e "s:/usr/local/lib/VICE:$(games_get_libdir)/${PN}:" \
+ man/vice.1 \
+ $(grep -rl --exclude="*texi" /usr/local/lib doc) || die
+ sed -i \
+ -e "/VICEDIR=/s:=.*:=\"$(games_get_libdir)/${PN}\";:" \
+ configure.ac || die
+ sed -i \
+ -e "s:\(#define LIBDIR \).*:\1\"$(games_get_libdir)/${PN}\":" \
+ -e "s:\(#define DOCDIR \).*:\1\"/usr/share/doc/${PF}\":" \
+ src/arch/unix/archdep.h \
+ src/arch/sdl/archdep_unix.h || die
+ rm -rf src/lib/{libffmpeg,liblame} || die
+ sed -i \
+ -e '/SUBDIRS/s/libffmpeg//;' \
+ -e '/SUBDIRS/s/liblame//;' \
+ src/lib/Makefile.am || die
+ AT_NO_RECURSIVE=1 eautoreconf
+}
+
+src_configure() {
+ local gui_arg snd_arg
+
+ snd_arg+=" $(use_with alsa)"
+ snd_arg+=" $(use_with oss)"
+ snd_arg+=" $(use_with pulseaudio pulse)"
+ snd_arg+=" $(use_with sdlsound)"
+
+ gui_arg+=" $(use_enable sdl sdlui)"
+ # The gtk UI code has raw calls to XOpenDisplay and
+ # is missing -lX11 if vte doesn't pull it in.
+ #if use gtk2 || use gtk3 ; then
+ if use gtk2 ; then
+ use vte || append-libs -lX11
+ fi
+ gui_arg+=" $(use_enable gtk2 gnomeui)"
+ #gui_arg+=" $(use_enable gtk3 gnomeui3)"
+ gui_arg+=" $(use_enable Xaw3d xaw3d)"
+
+ # --with-readline is forced to avoid using the embedded copy
+ # don't try to actually run fc-cache (bug #280976)
+ FCCACHE=/bin/true \
+ PKG_CONFIG=$(tc-getPKG_CONFIG) \
+ egamesconf \
+ --enable-parsid \
+ --with-resid \
+ --with-readline \
+ --without-arts \
+ --without-midas \
+ $(use_enable ethernet) \
+ $(use_enable ffmpeg) \
+ $(use_enable ffmpeg external-ffmpeg) \
+ $(use_enable fullscreen) \
+ $(use_enable ipv6) \
+ $(use_enable lame) \
+ $(use_enable nls) \
+ $(use_enable vte) \
+ $(use_with png) \
+ $(use_with threads uithreads) \
+ $(use_with zlib) \
+ ${gui_arg} \
+ ${snd_arg} \
+ --disable-option-checking
+ # --disable-option-checking has to be last
+}
+
+src_install() {
+ DOCS="AUTHORS ChangeLog FEEDBACK README" \
+ default
+ prepgamesdirs
+}
diff --git a/app-emulation/vice/vice-2.4.ebuild b/app-emulation/vice/vice-2.4.ebuild
new file mode 100644
index 000000000000..21350933eb8f
--- /dev/null
+++ b/app-emulation/vice/vice-2.4.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils toolchain-funcs games
+
+DESCRIPTION="The Versatile Commodore 8-bit Emulator"
+HOMEPAGE="http://vice-emu.sourceforge.net/"
+SRC_URI="mirror://sourceforge/vice-emu/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ~sparc x86"
+IUSE="Xaw3d alsa gnome nls png readline sdl ipv6 memmap ethernet oss zlib X gif jpeg xv dga xrandr ffmpeg lame pulseaudio"
+
+RDEPEND="
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXpm
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXt
+ x11-libs/libXxf86vm
+ x11-apps/xset
+ Xaw3d? ( x11-libs/libXaw3d )
+ !Xaw3d? ( !gnome? ( x11-libs/libXaw ) )
+ alsa? ( media-libs/alsa-lib )
+ gnome? (
+ x11-libs/gtk+:2
+ x11-libs/vte:0
+ dev-libs/atk
+ x11-libs/pango
+ )
+ lame? ( media-sound/lame )
+ ffmpeg? ( virtual/ffmpeg )
+ ethernet? (
+ >=net-libs/libpcap-0.9.8
+ >=net-libs/libnet-1.1.2.1
+ )
+ nls? ( virtual/libintl )
+ png? ( media-libs/libpng:0 )
+ readline? ( sys-libs/readline )
+ sdl? ( media-libs/libsdl )
+ gif? ( media-libs/giflib )
+ jpeg? ( virtual/jpeg )
+ xv? ( x11-libs/libXv )
+ dga? ( x11-libs/libXxf86dga )
+ xrandr? ( x11-libs/libXrandr )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ x11-apps/bdftopcf
+ x11-apps/mkfontdir
+ x11-proto/xproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xextproto
+ media-libs/fontconfig
+ dga? ( x11-proto/xf86dgaproto )
+ xv? ( x11-proto/videoproto )
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-arm.patch \
+ "${FILESDIR}"/${P}-ffmpeg-1.patch \
+ "${FILESDIR}"/${P}-buffer.patch \
+ "${FILESDIR}"/${P}-autotools.patch
+ sed -i \
+ -e "s:/usr/local/lib/VICE:${GAMES_DATADIR}/${PN}:" \
+ man/vice.1 \
+ $(grep -rl --exclude="*texi" /usr/local/lib doc) \
+ || die
+ sed -i \
+ -e '/VICE_ARG_LIST_CHECK/d' \
+ -e "/VICEDIR=/s:=.*:=\"${GAMES_DATADIR}/${PN}\";:" \
+ configure.in || die
+ sed -i \
+ -e "s:\(#define LIBDIR \).*:\1\"${GAMES_DATADIR}/${PN}\":" \
+ -e "s:\(#define DOCDIR \).*:\1\"/usr/share/doc/${PF}\":" \
+ src/arch/unix/archdep.h \
+ src/arch/sdl/archdep_unix.h
+ mv configure.in configure.ac || die
+ AT_NO_RECURSIVE=1 eautoreconf
+}
+
+src_configure() {
+ # don't try to actually run fc-cache (bug #280976)
+ FCCACHE=/bin/true \
+ PKG_CONFIG=$(tc-getPKG_CONFIG) \
+ egamesconf \
+ --enable-fullscreen \
+ --enable-parsid \
+ --with-resid \
+ --without-arts \
+ --without-midas \
+ $(use_enable ffmpeg) \
+ $(use_enable lame) \
+ $(use_enable gnome gnomeui) \
+ $(use_enable nls) \
+ $(use_with Xaw3d xaw3d) \
+ $(use_with alsa) \
+ $(use_with pulseaudio pulse) \
+ $(use_with png) \
+ $(use_with readline) \
+ $(use_with sdl sdlsound) \
+ $(use_enable ipv6) \
+ $(use oss || echo --without-oss) \
+ $(use_enable memmap) \
+ $(use_enable ethernet) \
+ $(use_with zlib) \
+ $(use_with X x)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS ChangeLog FEEDBACK README
+ prepgamesdirs
+}
diff --git a/app-emulation/virt-manager/Manifest b/app-emulation/virt-manager/Manifest
new file mode 100644
index 000000000000..9dde0f24c656
--- /dev/null
+++ b/app-emulation/virt-manager/Manifest
@@ -0,0 +1,2 @@
+DIST virt-manager-1.1.0.tar.gz 2509440 SHA256 ab0906cb15a132f1893f89ac4ca211c6c2c9c2d1860fbc285edbf9451c0f7941 SHA512 8c3aa56e13f1ec4a67e353b15b4f61bdc067300dbc459790b04e5f5258bf526694ec712a9f74d7af48ddd271081d48ae98d576f4bc5ed139e046620a9aa64e2d WHIRLPOOL aaffdf75b313c88a10648503bf552357139aff2a1624da1b17cac3975fec21ad6c3ccce00999ef8f4f1f4731aabf5ae2c07e70e453785caefe932c3b0deab456
+DIST virt-manager-1.2.1.tar.gz 2524812 SHA256 74bba80e72e5e1b4d84f1d5b7211b874e9c4ae00a0a44149d1721acab38ce6be SHA512 b99144f498bc2f28c98bb2395e0a9c2fe244a3da476892698ff0f1fd4a6d36a8ddf53e13561593c5e94932ce8176a27092c818ed218634fc5201666ad6792791 WHIRLPOOL d2402087453ec720add0a815433e9feda1bd36e253178dfe1cf27f52e0ad41a13e1e1d6a9977b63485ed8acc257d93c903625b775c6ab130ea7235e52be0e8fc
diff --git a/app-emulation/virt-manager/files/virt-manager-1.1.0-optional_avahi.patch b/app-emulation/virt-manager/files/virt-manager-1.1.0-optional_avahi.patch
new file mode 100644
index 000000000000..a480148d8c59
--- /dev/null
+++ b/app-emulation/virt-manager/files/virt-manager-1.1.0-optional_avahi.patch
@@ -0,0 +1,15 @@
+diff --git a/virtManager/connect.py b/virtManager/connect.py
+index f7f268e..c19c224 100644
+--- a/virtManager/connect.py
++++ b/virtManager/connect.py
+@@ -95,7 +95,10 @@ class vmmConnect(vmmGObjectUI):
+ self.avahiserver = Gio.DBusProxy.new_sync(self.dbus, 0, None,
+ "org.freedesktop.Avahi", "/",
+ "org.freedesktop.Avahi.Server", None)
++ self.avahiserver.GetVersionString()
++ logging.debug("self.avahiserver=%s", self.avahiserver)
+ except Exception, e:
++ self.avahiserver = None
+ logging.debug("Couldn't contact avahi: %s", str(e))
+
+ self.reset_state()
diff --git a/app-emulation/virt-manager/metadata.xml b/app-emulation/virt-manager/metadata.xml
new file mode 100644
index 000000000000..26005ac4f6c5
--- /dev/null
+++ b/app-emulation/virt-manager/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <use>
+ <flag name='policykit'>
+ Enables <pkg>sys-auth/polkit</pkg> authentication support,
+ required when using <pkg>app-emulation/libvirt</pkg> with
+ PolicyKit authentication
+ </flag>
+ <flag name='sasl'>
+ Depend on the proper libraries needed to connect to SASL-enabled
+ libvirtd instances (e.g. Kerberos-protected instances).
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/virt-manager/virt-manager-1.1.0-r2.ebuild b/app-emulation/virt-manager/virt-manager-1.1.0-r2.ebuild
new file mode 100644
index 000000000000..4d97c50c3ccd
--- /dev/null
+++ b/app-emulation/virt-manager/virt-manager-1.1.0-r2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=1
+
+inherit gnome2 distutils-r1
+
+DESCRIPTION="A graphical tool for administering virtual machines"
+HOMEPAGE="http://virt-manager.org"
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-2
+ SRC_URI=""
+ KEYWORDS=""
+ EGIT_REPO_URI="git://git.fedorahosted.org/virt-manager.git"
+else
+ SRC_URI="http://virt-manager.org/download/sources/${PN}/${P}.tar.gz"
+ KEYWORDS="amd64 x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="gnome-keyring gtk policykit sasl"
+
+RDEPEND="!app-emulation/virtinst
+ dev-python/libvirt-python[${PYTHON_USEDEP}]
+ >=app-emulation/libvirt-glib-0.0.9[introspection,python,${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}
+ dev-libs/libxml2[python,${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ dev-python/urlgrabber[${PYTHON_USEDEP}]
+ sys-libs/libosinfo[introspection]
+ gtk? (
+ x11-libs/gtk+:3[introspection]
+ gnome-base/dconf
+ >=net-libs/gtk-vnc-0.3.8[gtk3,introspection,python,${PYTHON_USEDEP}]
+ net-misc/spice-gtk[usbredir,gtk3,introspection,python,sasl?,${PYTHON_USEDEP}]
+ net-misc/x11-ssh-askpass
+ x11-libs/vte:2.90[introspection]
+ gnome-keyring? ( dev-python/gnome-keyring-python )
+ policykit? ( sys-auth/polkit[introspection] )
+ x11-themes/gnome-icon-theme
+ )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ dev-util/intltool"
+
+DOCS=( README NEWS )
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-optional_avahi.patch
+
+ distutils-r1_src_prepare
+}
+
+distutils-r1_python_compile() {
+ local defgraphics=
+
+ esetup.py configure \
+ --qemu-user=qemu \
+ --default-graphics=spice
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ python_fix_shebang \
+ "${ED}"/usr/share/virt-manager/virt-{clone,convert,install,manager}
+}
+
+pkg_preinst() {
+ if use gtk; then
+ gnome2_pkg_preinst
+
+ cd "${ED}"
+ export GNOME2_ECLASS_ICONS=$(find 'usr/share/virt-manager/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
+ else
+ rm -rf "${ED}/usr/share/virt-manager/virtManager"
+ rm -f "${ED}/usr/share/virt-manager/virt-manager"
+ rm -rf "${ED}/usr/share/virt-manager/ui/"
+ rm -rf "${ED}/usr/share/virt-manager/icons/"
+ rm -rf "${ED}/usr/share/man/man1/virt-manager.1*"
+ rm -rf "${ED}/usr/share/icons/"
+ rm -rf "${ED}/usr/share/applications/virt-manager.desktop"
+ rm -rf "${ED}/usr/bin/virt-manager"
+ fi
+}
+
+pkg_postinst() {
+ use gtk && gnome2_pkg_postinst
+}
diff --git a/app-emulation/virt-manager/virt-manager-1.2.1.ebuild b/app-emulation/virt-manager/virt-manager-1.2.1.ebuild
new file mode 100644
index 000000000000..b79811547c1d
--- /dev/null
+++ b/app-emulation/virt-manager/virt-manager-1.2.1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=1
+
+inherit gnome2 distutils-r1
+
+DESCRIPTION="A graphical tool for administering virtual machines"
+HOMEPAGE="http://virt-manager.org"
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-2
+ SRC_URI=""
+ KEYWORDS=""
+ EGIT_REPO_URI="git://git.fedorahosted.org/virt-manager.git"
+else
+ SRC_URI="http://virt-manager.org/download/sources/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="gnome-keyring gtk policykit sasl"
+
+RDEPEND="!app-emulation/virtinst
+ dev-python/libvirt-python[${PYTHON_USEDEP}]
+ >=app-emulation/libvirt-glib-0.0.9[introspection,python,${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}
+ dev-libs/libxml2[python,${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ dev-python/urlgrabber[${PYTHON_USEDEP}]
+ sys-libs/libosinfo[introspection]
+ gtk? (
+ x11-libs/gtk+:3[introspection]
+ gnome-base/dconf
+ >=net-libs/gtk-vnc-0.3.8[gtk3,introspection,python,${PYTHON_USEDEP}]
+ net-misc/spice-gtk[usbredir,gtk3,introspection,python,sasl?,${PYTHON_USEDEP}]
+ net-misc/x11-ssh-askpass
+ x11-libs/vte:2.90[introspection]
+ gnome-keyring? ( dev-python/gnome-keyring-python )
+ policykit? ( sys-auth/polkit[introspection] )
+ x11-themes/gnome-icon-theme
+ )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ dev-util/intltool"
+
+DOCS=( README NEWS )
+
+src_prepare() {
+ distutils-r1_src_prepare
+}
+
+distutils-r1_python_compile() {
+ local defgraphics=
+
+ esetup.py configure \
+ --qemu-user=qemu \
+ --default-graphics=spice
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ python_fix_shebang \
+ "${ED}"/usr/share/virt-manager/virt-{clone,convert,install,manager}
+}
+
+pkg_preinst() {
+ if use gtk; then
+ gnome2_pkg_preinst
+
+ cd "${ED}"
+ export GNOME2_ECLASS_ICONS=$(find 'usr/share/virt-manager/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
+ else
+ rm -rf "${ED}/usr/share/virt-manager/virtManager"
+ rm -f "${ED}/usr/share/virt-manager/virt-manager"
+ rm -rf "${ED}/usr/share/virt-manager/ui/"
+ rm -rf "${ED}/usr/share/virt-manager/icons/"
+ rm -rf "${ED}/usr/share/man/man1/virt-manager.1*"
+ rm -rf "${ED}/usr/share/icons/"
+ rm -rf "${ED}/usr/share/applications/virt-manager.desktop"
+ rm -rf "${ED}/usr/bin/virt-manager"
+ fi
+}
+
+pkg_postinst() {
+ use gtk && gnome2_pkg_postinst
+}
diff --git a/app-emulation/virt-manager/virt-manager-9999.ebuild b/app-emulation/virt-manager/virt-manager-9999.ebuild
new file mode 100644
index 000000000000..8f0ce94204db
--- /dev/null
+++ b/app-emulation/virt-manager/virt-manager-9999.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_SINGLE_IMPL=1
+
+inherit gnome2 distutils-r1
+
+DESCRIPTION="A graphical tool for administering virtual machines"
+HOMEPAGE="http://virt-manager.org"
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-2
+ SRC_URI=""
+ KEYWORDS=""
+ EGIT_REPO_URI="git://git.fedorahosted.org/virt-manager.git"
+else
+ SRC_URI="http://virt-manager.org/download/sources/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="gnome-keyring gtk policykit sasl"
+
+RDEPEND="!app-emulation/virtinst
+ dev-python/libvirt-python[${PYTHON_USEDEP}]
+ >=app-emulation/libvirt-glib-0.0.9[introspection,python,${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}
+ dev-libs/libxml2[python,${PYTHON_USEDEP}]
+ dev-python/ipaddr[${PYTHON_USEDEP}]
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ dev-python/urlgrabber[${PYTHON_USEDEP}]
+ sys-libs/libosinfo[introspection]
+ gtk? (
+ x11-libs/gtk+:3[introspection]
+ gnome-base/dconf
+ >=net-libs/gtk-vnc-0.3.8[gtk3,introspection]
+ net-misc/spice-gtk[usbredir,gtk3,introspection,python,sasl?,${PYTHON_USEDEP}]
+ net-misc/x11-ssh-askpass
+ x11-libs/vte:2.90[introspection]
+ gnome-keyring? ( dev-python/gnome-keyring-python )
+ policykit? ( sys-auth/polkit[introspection] )
+ x11-themes/gnome-icon-theme
+ )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ dev-util/intltool"
+
+DOCS=( README NEWS )
+
+src_prepare() {
+ distutils-r1_src_prepare
+}
+
+distutils-r1_python_compile() {
+ local defgraphics=
+
+ esetup.py configure \
+ --qemu-user=qemu \
+ --default-graphics=spice
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ python_fix_shebang \
+ "${ED}"/usr/share/virt-manager/virt-{clone,convert,image,install,manager}
+}
+
+pkg_preinst() {
+ if use gtk; then
+ gnome2_pkg_preinst
+
+ cd "${ED}"
+ export GNOME2_ECLASS_ICONS=$(find 'usr/share/virt-manager/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
+ else
+ rm -rf "${ED}/usr/share/virt-manager/virtManager"
+ rm -f "${ED}/usr/share/virt-manager/virt-manager"
+ rm -rf "${ED}/usr/share/virt-manager/ui/"
+ rm -rf "${ED}/usr/share/virt-manager/icons/"
+ rm -rf "${ED}/usr/share/man/man1/virt-manager.1*"
+ rm -rf "${ED}/usr/share/icons/"
+ rm -rf "${ED}/usr/share/applications/virt-manager.desktop"
+ rm -rf "${ED}/usr/bin/virt-manager"
+ fi
+}
+
+pkg_postinst() {
+ use gtk && gnome2_pkg_postinst
+}
diff --git a/app-emulation/virt-viewer/Manifest b/app-emulation/virt-viewer/Manifest
new file mode 100644
index 000000000000..307c60892f12
--- /dev/null
+++ b/app-emulation/virt-viewer/Manifest
@@ -0,0 +1,2 @@
+DIST virt-viewer-0.5.6.tar.gz 664421 SHA256 b397e9da15c454e8b53765cef65cdbf1b9939d4f9976965b7942ae9a9aa45857 SHA512 a4a7aa4dfe7fa9d5ae8e907831b27ad04b6337c6feaf5c5d2635ea308fa8eef8f9b138fd37ef2a574cd4b65b2f45cba5103003ee17db6430985edb8817323668 WHIRLPOOL 8843416e3b2f75e2e258f6e641b262cfd60b6e126565d6408af0ad3fc93351cd5ef1ed2eea87f2dfed4b0849ecd9ab92ec0863e81157e0e16f5adc2bf2e122df
+DIST virt-viewer-2.0.tar.gz 771874 SHA256 e9c583bcb5acdabac6a8a13eff6ce4e093a3050645771628f832e15ce685d437 SHA512 271ded11e4af3f1dd208c7b8ab7d1c0cd24f641a79e05178d0762a03de3dcf99ae7432acde2b67460e7a98d1fa562587b6b08cf06ab3cf80f025a7b259e8203e WHIRLPOOL aba5eabc490c5b998dfb4b1f5bbac6ae43affc782ccf19072e3a23333607256ce65328e80d46673ab6c25e38ba1bcd8410c270e213d0e28534fd141fd7d90ed3
diff --git a/app-emulation/virt-viewer/files/virt-viewer-0.6.0-fix-c99-compat.patch b/app-emulation/virt-viewer/files/virt-viewer-0.6.0-fix-c99-compat.patch
new file mode 100644
index 000000000000..b6768381ad91
--- /dev/null
+++ b/app-emulation/virt-viewer/files/virt-viewer-0.6.0-fix-c99-compat.patch
@@ -0,0 +1,29 @@
+diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
+index 20d5fb1..b600481 100644
+--- a/src/virt-viewer-session.c
++++ b/src/virt-viewer-session.c
+@@ -395,13 +395,14 @@ virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
+ gboolean all_fullscreen = TRUE;
+ guint nmonitors = 0;
+ GdkRectangle *monitors = NULL;
++ GList *l;
+
+ klass = VIRT_VIEWER_SESSION_GET_CLASS(self);
+ if (!klass->apply_monitor_geometry)
+ return;
+
+ /* find highest monitor ID so we can create the sparse array */
+- for (GList *l = self->priv->displays; l; l = l->next) {
++ for (l = self->priv->displays; l; l = l->next) {
+ VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);
+ guint nth = 0;
+ g_object_get(d, "nth-display", &nth, NULL);
+@@ -410,7 +411,7 @@ virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
+ }
+
+ monitors = g_new0(GdkRectangle, nmonitors);
+- for (GList *l = self->priv->displays; l; l = l->next) {
++ for (l = self->priv->displays; l; l = l->next) {
+ VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);
+ guint nth = 0;
+ GdkRectangle *rect = NULL;
diff --git a/app-emulation/virt-viewer/metadata.xml b/app-emulation/virt-viewer/metadata.xml
new file mode 100644
index 000000000000..cdeb87ceefc1
--- /dev/null
+++ b/app-emulation/virt-viewer/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>virtualization</herd>
+ <use>
+ <flag name="spice">Support connecting to SPICE-enabled virtual
+ machines.</flag>
+ <flag name="vnc">Support connecting to VNC-enabled virtual
+ machines.</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/app-emulation/virt-viewer/virt-viewer-0.5.6.ebuild b/app-emulation/virt-viewer/virt-viewer-0.5.6.ebuild
new file mode 100644
index 000000000000..9cb96ba2adc8
--- /dev/null
+++ b/app-emulation/virt-viewer/virt-viewer-0.5.6.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils gnome2 toolchain-funcs
+
+DESCRIPTION="Graphical console client for connecting to virtual machines"
+HOMEPAGE="http://virt-manager.org/"
+SRC_URI="http://virt-manager.org/download/sources/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="sasl +spice +vnc"
+
+RDEPEND=">=app-emulation/libvirt-0.10.0[sasl?]
+ >=dev-libs/libxml2-2.6
+ x11-libs/gtk+:3
+ spice? ( >=net-misc/spice-gtk-0.18[sasl?,gtk3] )
+ vnc? ( >=net-libs/gtk-vnc-0.5.0[sasl?,gtk3] )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ >=dev-util/intltool-0.35.0
+ virtual/pkgconfig
+ spice? ( >=app-emulation/spice-protocol-0.10.1 )"
+
+REQUIRED_USE="|| ( spice vnc )"
+
+pkg_setup() {
+ G2CONF="$(use_with vnc gtk-vnc) $(use_with spice spice-gtk)"
+ G2CONF="${G2CONF} --with-gtk=3.0"
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_test() {
+ default
+}
+
+src_install() {
+ default
+}
diff --git a/app-emulation/virt-viewer/virt-viewer-2.0.ebuild b/app-emulation/virt-viewer/virt-viewer-2.0.ebuild
new file mode 100644
index 000000000000..b7bb8cae2608
--- /dev/null
+++ b/app-emulation/virt-viewer/virt-viewer-2.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils gnome2 fdo-mime
+
+DESCRIPTION="Graphical console client for connecting to virtual machines"
+HOMEPAGE="http://virt-manager.org/"
+SRC_URI="http://virt-manager.org/download/sources/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~x86"
+IUSE="sasl +spice +vnc"
+
+RDEPEND=">=app-emulation/libvirt-0.10.0[sasl?]
+ >=dev-libs/libxml2-2.6
+ x11-libs/gtk+:3
+ spice? ( >=net-misc/spice-gtk-0.22[sasl?,gtk3] )
+ vnc? ( >=net-libs/gtk-vnc-0.5.0[sasl?,gtk3] )"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ >=dev-util/intltool-0.35.0
+ virtual/pkgconfig
+ spice? ( >=app-emulation/spice-protocol-0.10.1 )"
+
+REQUIRED_USE="|| ( spice vnc )"
+
+pkg_setup() {
+ G2CONF="$(use_with vnc gtk-vnc) $(use_with spice spice-gtk)"
+ G2CONF="${G2CONF} --with-gtk=3.0 --without-ovirt --disable-update-mimedb"
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_test() {
+ default
+}
+
+src_install() {
+ default
+}
+
+pkg_postinst() {
+ fdo-mime_mime_database_update
+}
diff --git a/app-emulation/virt-what/Manifest b/app-emulation/virt-what/Manifest
new file mode 100644
index 000000000000..bbdc6cd59f5b
--- /dev/null
+++ b/app-emulation/virt-what/Manifest
@@ -0,0 +1 @@
+DIST virt-what-1.12.tar.gz 147144 SHA256 2592082f5b2caa93d3967b7c275a3afabfe49de9f051fdf0da6ded59e2c11b1c SHA512 629e452419a01b86cd5442c4294b5aea6fc475522d7a350ac8e727b59e63948915c755fe6cae16f7824749059662bb0fbd4557a2aa56c098b407037a35881735 WHIRLPOOL a3f9a519c183950a766fe407f8e814a131e2586d738fa0fdbf341d0755bbf726e58da9cde594a8b7c32b9c27094c442ff95b6d3e5adaf92b57d96710383453d3
diff --git a/app-emulation/virt-what/metadata.xml b/app-emulation/virt-what/metadata.xml
new file mode 100644
index 000000000000..0bc914a7f9ae
--- /dev/null
+++ b/app-emulation/virt-what/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>cardoe@gentoo.org</email>
+ <name>Doug Goldstein</name>
+ </maintainer>
+ <use>
+ <flag name='dmi'>Use <pkg>sys-apps/dmidecode</pkg> to read firmware data</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/app-emulation/virt-what/virt-what-1.12.ebuild b/app-emulation/virt-what/virt-what-1.12.ebuild
new file mode 100644
index 000000000000..f3d981a92713
--- /dev/null
+++ b/app-emulation/virt-what/virt-what-1.12.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Detects if the current machine is running in a virtual machine"
+HOMEPAGE="http://people.redhat.com/~rjones/virt-what/"
+SRC_URI="http://people.redhat.com/~rjones/virt-what/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ppc ppc64 sparc x86"
+IUSE="dmi"
+
+DEPEND="dev-lang/perl"
+RDEPEND="app-shells/bash
+ dmi? ( sys-apps/dmidecode )"
diff --git a/app-emulation/virtualbox-additions/Manifest b/app-emulation/virtualbox-additions/Manifest
new file mode 100644
index 000000000000..2538fcf7d596
--- /dev/null
+++ b/app-emulation/virtualbox-additions/Manifest
@@ -0,0 +1,3 @@
+DIST VBoxGuestAdditions_4.3.28.iso 58241024 SHA256 9f52e186d6c9407b2676d4b2ed1cdf96940ec129cc2bd92e54b24526271a9733 SHA512 78055f389dc1a7bd62577f1fa670b8f8899ab3a58a87953d30fcaea1cd0c77f8662e15fea932c434309747971a2a61b61854b6f087654d9d2fb2de07fb6f1b5c WHIRLPOOL 64275e44c01f4f260899a7c16aaeb494ebe81277e7cbdec87e487736833cc239338f3c32c00759244b3be55c5754788593b81d06dab7d9ab26991369fa9d65fd
+DIST VBoxGuestAdditions_4.3.30.iso 58257408 SHA256 432c2da1d9a939de7ba1d2cfb10595031374af9ce66417a43979d1794beedbb1 SHA512 a782e47381b708aee8a8f2c1d6608d51d09a2fb0d55ea3b543530a31cbf489043f05d4c334a9e269b922318339cb78a897603b8bce2749fe02088a6e9a4fd177 WHIRLPOOL c70b9e630820f7be38e38fd7ce20073c3766758950f60367a3a6e666644f10baadbfb5a9dc67c7c8364770e7ae28d27d632c53699fd6d1102bf672672419f1f2
+DIST VBoxGuestAdditions_5.0.0.iso 58601472 SHA256 7b61f523db7ba75aebc4c7bb0cae2da92674fa72299e4a006c5c67517f7d786b SHA512 8db386b2bf4ccfadcffbef2d38fc8374e4c51aabdbddc4ccf632be029b84d560416bcd255ae1e228f862ea294ff2c7e4f1e0b1076f387d84ed72fbf03407d6e8 WHIRLPOOL 2fcd8544bb668b38e25b9f70ab9b1e646daea7657c5c15c9eaecb9a028ee6961cc8b729ec4d0f1db2de620e074e033bbb6cd0a8529ce133136634498f44e33d2
diff --git a/app-emulation/virtualbox-additions/metadata.xml b/app-emulation/virtualbox-additions/metadata.xml
new file mode 100644
index 000000000000..cefd27ea325b
--- /dev/null
+++ b/app-emulation/virtualbox-additions/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/virtualbox-additions/virtualbox-additions-4.3.28.ebuild b/app-emulation/virtualbox-additions/virtualbox-additions-4.3.28.ebuild
new file mode 100644
index 000000000000..2a3252b24929
--- /dev/null
+++ b/app-emulation/virtualbox-additions/virtualbox-additions-4.3.28.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+MY_PN=VBoxGuestAdditions
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=${MY_PN}_${MY_PV}
+
+DESCRIPTION="CD image containing guest additions for VirtualBox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.iso"
+
+LICENSE="GPL-2+ LGPL-2.1+ MIT SGI-B-2.0 CDDL"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+RESTRICT="mirror"
+
+RDEPEND="!app-emulation/virtualbox-bin
+ !=app-emulation/virtualbox-9999"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ return 0
+}
+
+src_install() {
+ insinto /usr/share/${PN/-additions}
+ newins "${DISTDIR}"/${MY_P}.iso ${MY_PN}.iso
+}
diff --git a/app-emulation/virtualbox-additions/virtualbox-additions-4.3.30.ebuild b/app-emulation/virtualbox-additions/virtualbox-additions-4.3.30.ebuild
new file mode 100644
index 000000000000..e46434cb5133
--- /dev/null
+++ b/app-emulation/virtualbox-additions/virtualbox-additions-4.3.30.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+MY_PN=VBoxGuestAdditions
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=${MY_PN}_${MY_PV}
+
+DESCRIPTION="CD image containing guest additions for VirtualBox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.iso"
+
+LICENSE="GPL-2+ LGPL-2.1+ MIT SGI-B-2.0 CDDL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="mirror"
+
+RDEPEND="!app-emulation/virtualbox-bin
+ !=app-emulation/virtualbox-9999"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ return 0
+}
+
+src_install() {
+ insinto /usr/share/${PN/-additions}
+ newins "${DISTDIR}"/${MY_P}.iso ${MY_PN}.iso
+}
diff --git a/app-emulation/virtualbox-additions/virtualbox-additions-5.0.0.ebuild b/app-emulation/virtualbox-additions/virtualbox-additions-5.0.0.ebuild
new file mode 100644
index 000000000000..e46434cb5133
--- /dev/null
+++ b/app-emulation/virtualbox-additions/virtualbox-additions-5.0.0.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+MY_PN=VBoxGuestAdditions
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=${MY_PN}_${MY_PV}
+
+DESCRIPTION="CD image containing guest additions for VirtualBox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.iso"
+
+LICENSE="GPL-2+ LGPL-2.1+ MIT SGI-B-2.0 CDDL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="mirror"
+
+RDEPEND="!app-emulation/virtualbox-bin
+ !=app-emulation/virtualbox-9999"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ return 0
+}
+
+src_install() {
+ insinto /usr/share/${PN/-additions}
+ newins "${DISTDIR}"/${MY_P}.iso ${MY_PN}.iso
+}
diff --git a/app-emulation/virtualbox-bin/Manifest b/app-emulation/virtualbox-bin/Manifest
new file mode 100644
index 000000000000..47ad70e59c70
--- /dev/null
+++ b/app-emulation/virtualbox-bin/Manifest
@@ -0,0 +1,12 @@
+DIST Oracle_VM_VirtualBox_Extension_Pack-4.3.28-100309.tar.gz 15961939 SHA256 72e101d9dc5eabeb76d1ab5bd6d2f817a11c89adfe8bb72cc5d614a2eef532d1 SHA512 57ad44a99a7abcad195e6ceccc1fe7b494979da65601a52e0be8336bb819812d5cef48a8bc0fe9f74f3a05238e6fd29562ac678d4ef7e0c78587fe81c287a65e WHIRLPOOL fb08189c53841664119bffb4de6a76d6f72fb035f887ed5e948f38faa5be2891e35de0806da02d299e818370285bcddba06eb84bea7db4d3cfa09d92f8042db7
+DIST Oracle_VM_VirtualBox_Extension_Pack-4.3.30-101610.tar.gz 15983777 SHA256 770d49247976f2a0d14a66196dddf864c6b9d185671e2a29cab459fc28f105db SHA512 f5d8275fe3e1ea60e8d15af3b0c7382faab172df39369c8904ff734a5105daed87a48215880b2e286c6735ead341c237d2260e6ee923f513818f85cf0b452def WHIRLPOOL 3b1e29a44413ebc65dc250b2366b1fe75d6ea48fd94b722c8ec9eb7e97e6981470e9201c9840d566953c9c9bdd4a7893f9d525b3fac7150ca24391f696bba9c4
+DIST Oracle_VM_VirtualBox_Extension_Pack-5.0.0-101573.tar.gz 18028050 SHA256 c357e36368883df821ed092d261890a95c75e50422b75848c40ad20984086a7a SHA512 8eb21610ab4d4b5ada5901e25adcc99ad2b4ab20e86309c90f9bad993d71007f13eccf81e3670102e5400fa02d3df9c03d0901389f8980e9cdfa092b2d326271 WHIRLPOOL bd0cff1c58d90663b5c4f7983b05be9f3469f201143f30ef729723aaa55508685a34355b00ad952dc5132045589a1b26d71bbc5a5ee0d0fc32b99cf0a5f8e4f8
+DIST VirtualBox-4.3.28-100309-Linux_amd64.run 85677523 SHA256 8c862533f876dc32fbfae993597b1123e2feac81a302c60e73b7ee891e17a77f SHA512 75dc2cd257b187b0a497b87c2f1e576a57ceece290327a98804c903810522444b0a64a704bc51a25945dbaa5c0caf30898ba258829577e2f17f7c736fcf59bb0 WHIRLPOOL c8d5d885807ad633bf1c4c6f98cac8dddf4002dc2e21ed2d2fb2f0a859f447b7ce06d1c49c4daff4147b25ca4992da14b6b75b39f47075c861732e6ef00091d1
+DIST VirtualBox-4.3.28-100309-Linux_x86.run 85083598 SHA256 aeb224d7136314865db8175db665408a3dc08f50ed68fbd4bf1568b32b7ea2f6 SHA512 110e20a45657c7677fcab0158d31052c909893b8f618adad2a2c95ad119d47d7c35d4aedf3692dd650fda62ba0747acf202364c14034e5c10d17cd45a9918707 WHIRLPOOL 35c97248985d11c77194ac03448357331e08b7ef64a77ba416564b6051eaf74ffb5a0acdf835bfcf71657c5fdd58066947b0ba1c42e91d34dbf026434f662f67
+DIST VirtualBox-4.3.30-101610-Linux_amd64.run 81069522 SHA256 5745bc9b1edd1d7d28f81ba7fed7fff3ed0bbe7084c39a77bd305018ad0a420d SHA512 928dc5b6b9031892f9391ded3aa10b090a9312c16e5b8bd4d0457d3af3d5f5495323e48a5cc781411c14318aab5d3856de5369bbf1ac3b75068797ef4c5445a7 WHIRLPOOL bf5175a228ddef4319f6972dadefa035dc0902b290691ba14478f10fe89947fbc3f9545b65d4c09f397c06309fb01a7fab6187b5f9f9d2cb39b9f808b0bb5bb5
+DIST VirtualBox-4.3.30-101610-Linux_x86.run 80537038 SHA256 c8e42d247ecfa1ff3e3da6c7988a58e2d64fbb54598e9b08211308226d61c42a SHA512 629907432887606b1e31328a751c5ec3c764e90b3eae4a984c5d9e6b5f77b626e8eafa235bb55a0e1725fe95324dcb3cc1c8e2f441d716a8408d1e1ddf0e5dde WHIRLPOOL c10976693284b7b1c178aa036eb5d28ce76366362ac00eb0f686e8f99ddb93df508654d8acab0912714d3f9215d8f217a91999c25877fb2b973171b9be8b7d09
+DIST VirtualBox-5.0.0-101573-Linux_amd64.run 84284870 SHA256 19d6ffec4fd84924a70cbe07bb9021b77dea26b85082b5a008828e5ecf57e4bc SHA512 5e5aba2325118c60f4fcdf15c306ff0aa3fd036cd4dd7097455a5390b85c8d40a5a435143004085ef263367f987f6e9d7d03175ba7e64c2978be09d698c2900a WHIRLPOOL 20b123932afd3c3b407d1768eec84ab9469dfec7e92e07a73fdf0bd800736b21da113590b5edef85dcc1092040073ecbb3b17e35333600229ae25368c8438d5d
+DIST VirtualBox-5.0.0-101573-Linux_x86.run 83353025 SHA256 fddb7946ae68f235ef07a88dfc57130efd2c4e02ae76c9d809c30ecec8896905 SHA512 84363cac2b453469adaeeb58dd93a9b8a69dbc58c0355a0b7f55d5fc65ccebb808da144beb3e1f7550286ce7622cc583f2e0c5de6f99539a335bb5e5e490ce65 WHIRLPOOL fc8f1c948852fb10ab140a3ea9ea3946da35b275adb3382f37e14310cc2d815b7b63ce2b12a8c3bdb8d8e0dc0da1ddadd03e3c0091fa870a337cfebbae43420b
+DIST VirtualBoxSDK-4.3.28-100309.zip 11698378 SHA256 fe0cc316cecb3dfe9bbb925e6c023620d4cfd8e137b2a9b9f40f22f527af16fa SHA512 6af7d2107cff080281a356cbf522961b2e9d1917e861e410b169ce5ca3cefe05cc87e4e01f78ae171f8716f7006c031f14fc01d8d282a872a4f619638049b11a WHIRLPOOL 23a77dbc410a28b2799264da88d79b2c4335c07da67dd8bf4be26cac271e3ed38a9bf4fb2966ec0a3c06fb869bb252f5fa6a34a9a9c62cbb9a2fb0ad76442f66
+DIST VirtualBoxSDK-4.3.30-101610.zip 11436700 SHA256 6d8f1a006d56dfa1bbec10a35369c80c75845fdc6127c4d806b5c69cec03ab7e SHA512 2b2b3220d9ce908813699f8fc4cee80de5b29cb134ec968c2ccbb78c40b8d0d8aeb666996627f0f13cd036ef0376582c48f6c12b45acb7593d8b0eefd6eba960 WHIRLPOOL fe82cacecfedc05b6d92feac5285bc41100a9538f6cb37027c85ee08e051580243e2635af9d873c67970ecab5e8ee8eee0cee89e50be59895b44862264aa3fdf
+DIST VirtualBoxSDK-5.0.0-101573.zip 9635666 SHA256 769267df1940ed6be0742ace40af98d141b9b79a832c8cc772af5e87628c0b7c SHA512 f115653cf2595bbed59add41c297cb1c96332fc87770cf7d2784a0f6148970492038b533a17a569dd5037f9bf136b14205bd8afa71cde0f54f37a2d722c2b13e WHIRLPOOL 022be41a5ec6d316c588447ced475219102103c4292a4d9bc05eee78d621680cff87c18ff809d0245f01f201b05d1163a014453179f790d58103846ae1c2091e
diff --git a/app-emulation/virtualbox-bin/files/10-virtualbox.rules b/app-emulation/virtualbox-bin/files/10-virtualbox.rules
new file mode 100644
index 000000000000..014c164a37f5
--- /dev/null
+++ b/app-emulation/virtualbox-bin/files/10-virtualbox.rules
@@ -0,0 +1,7 @@
+# create second tree of USB devices according to
+# http://www.virtualbox.org/ticket/7759#comment:5
+
+SUBSYSTEM=="usb_device", ACTION!="remove", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
+SUBSYSTEM=="usb", ACTION!="remove", ENV{DEVTYPE}=="usb_device", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
+SUBSYSTEM=="usb_device", ACTION=="remove", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh --remove $major $minor"
+SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh --remove $major $minor"
diff --git a/app-emulation/virtualbox-bin/files/vboxwebsrv-confd b/app-emulation/virtualbox-bin/files/vboxwebsrv-confd
new file mode 100644
index 000000000000..14ce08c72ac4
--- /dev/null
+++ b/app-emulation/virtualbox-bin/files/vboxwebsrv-confd
@@ -0,0 +1,20 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# The host to bind to (defaults to "localhost").
+VBOXWEBSRV_HOST="localhost"
+
+# Which port to on the host (defaults to 18083).
+VBOXWEBSRV_PORT="18083"
+
+# Session timeout, in seconds. (defaults to 20).
+VBOXWEBSRV_TIMEOUT=20
+
+# The interval in which the webservice checks for
+# timed-out clients, in seconds. Normally does not
+# need to be changed (defaults to 5).
+VBOXWEBSRV_INTERVAL=5
+
+# User under which vboxwebsrv is running
+VBOXWEBSRV_USER="root"
diff --git a/app-emulation/virtualbox-bin/files/vboxwebsrv-initd b/app-emulation/virtualbox-bin/files/vboxwebsrv-initd
new file mode 100644
index 000000000000..99db87dc4bbf
--- /dev/null
+++ b/app-emulation/virtualbox-bin/files/vboxwebsrv-initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ #checkconfig || return $?
+
+ ebegin "Starting VirtualBox WebService"
+ start-stop-daemon --start --quiet --user ${VBOXWEBSRV_USER} --pidfile /var/run/vboxwebsrv.pid \
+ --background --make-pidfile --exec /opt/bin/vboxwebsrv \
+ -- -H ${VBOXWEBSRV_HOST} -p ${VBOXWEBSRV_PORT} -t ${VBOXWEBSRV_TIMEOUT} -i ${VBOXWEBSRV_INTERVAL}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping VirtualBox WebService"
+ start-stop-daemon --stop --user ${VBOXWEBSRV_USER} --quiet --pidfile /var/run/vboxwebsrv.pid
+ eend $?
+}
diff --git a/app-emulation/virtualbox-bin/files/virtualbox-bin-3-wrapper b/app-emulation/virtualbox-bin/files/virtualbox-bin-3-wrapper
new file mode 100755
index 000000000000..6f2da490065d
--- /dev/null
+++ b/app-emulation/virtualbox-bin/files/virtualbox-bin-3-wrapper
@@ -0,0 +1,104 @@
+#!/bin/sh
+#
+# Sun VirtualBox
+#
+# Copyright (C) 2006-2009 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+# Clara, CA 95054 USA or visit http://www.sun.com if you need
+# additional information or have any questions.
+#
+
+PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+CONFIG="/etc/vbox/vbox.cfg"
+
+if [ ! -r "$CONFIG" ]; then
+ echo "Could not find VirtualBox installation. Please reinstall."
+ exit 1
+fi
+
+. "$CONFIG"
+
+# Note: This script must not fail if the module was not successfully installed
+# because the user might not want to run a VM but only change VM params!
+
+if [ "$1" = "shutdown" ]; then
+ SHUTDOWN="true"
+elif ! lsmod|grep -q vboxdrv; then
+ cat << EOF
+WARNING: The VirtualBox kernel modules are not loaded.
+ Please load all the needed kernel modules by:
+
+ for m in vbox{drv,netadp,netflt}; do modprobe \$m; done
+
+ You will not be able to start VMs until this problem is fixed.
+EOF
+elif [ ! -c /dev/vboxdrv ]; then
+ cat << EOF
+WARNING: The character device /dev/vboxdrv does not exist.
+ Please try to reload all the needed kernel modules by:
+
+ for m in vbox{netflt,netadp,drv}; do rmmod \$m; done
+ for m in vbox{drv,netadp,netflt}; do modprobe \$m; done
+
+ and if that is not successful, try to re-install the package by:
+
+ emerge -1av app-emulation/virtualbox-modules
+
+ You will not be able to start VMs until this problem is fixed.
+EOF
+fi
+
+SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'`
+if [ -z "$SERVER_PID" ]; then
+ # Server not running yet/anymore, cleanup socket path.
+ # See IPC_GetDefaultSocketPath()!
+ if [ -n "$LOGNAME" ]; then
+ rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1
+ else
+ rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1
+ fi
+fi
+
+if [ "$SHUTDOWN" = "true" ]; then
+ if [ -n "$SERVER_PID" ]; then
+ kill -TERM $SERVER_PID
+ sleep 2
+ fi
+ exit 0
+fi
+
+APP=`which $0`
+APP=`basename $APP`
+APP=${APP##/*/}
+case "$APP" in
+ VirtualBox)
+ exec "$INSTALL_DIR/VirtualBox" "$@"
+ ;;
+ VBoxManage)
+ exec "$INSTALL_DIR/VBoxManage" "$@"
+ ;;
+ VBoxSDL)
+ exec "$INSTALL_DIR/VBoxSDL" "$@"
+ ;;
+ VBoxVRDP)
+ exec "$INSTALL_DIR/VBoxHeadless" "$@"
+ ;;
+ VBoxHeadless)
+ exec "$INSTALL_DIR/VBoxHeadless" "$@"
+ ;;
+ vboxwebsrv)
+ exec "$INSTALL_DIR/vboxwebsrv" "$@"
+ ;;
+ *)
+ echo "Unknown application - $APP"
+ ;;
+esac
diff --git a/app-emulation/virtualbox-bin/files/virtualbox-bin-config b/app-emulation/virtualbox-bin/files/virtualbox-bin-config
new file mode 100644
index 000000000000..f69e73e2fcb6
--- /dev/null
+++ b/app-emulation/virtualbox-bin/files/virtualbox-bin-config
@@ -0,0 +1 @@
+INSTALL_DIR=/opt/VirtualBox
diff --git a/app-emulation/virtualbox-bin/files/virtualbox-bin.desktop-2 b/app-emulation/virtualbox-bin/files/virtualbox-bin.desktop-2
new file mode 100644
index 000000000000..112e8f81348a
--- /dev/null
+++ b/app-emulation/virtualbox-bin/files/virtualbox-bin.desktop-2
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=Oracle xVM VirtualBox
+Type=Application
+Comment=Run several virtual systems on a single host computer
+Exec=VirtualBox
+TryExec=VirtualBox
+Icon=virtualbox-bin
+Categories=System;Emulator;
diff --git a/app-emulation/virtualbox-bin/metadata.xml b/app-emulation/virtualbox-bin/metadata.xml
new file mode 100644
index 000000000000..8ad5c4d1f45c
--- /dev/null
+++ b/app-emulation/virtualbox-bin/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+<use>
+ <flag name='additions'>Install Guest System Tools ISO</flag>
+ <flag name='chm'>Install kchmviewer binary to enable online help (in MS CHM format)</flag>
+ <flag name='headless'>Install without any graphic frontend</flag>
+ <flag name='sdk'>Enable building of SDK</flag>
+ <flag name='vboxwebsrv'>Install the VirtualBox webservice</flag>
+ <flag name='rdesktop-vrdp'>Install the rdesktop client integration</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/virtualbox-bin/virtualbox-bin-4.3.28.100309.ebuild b/app-emulation/virtualbox-bin/virtualbox-bin-4.3.28.100309.ebuild
new file mode 100644
index 000000000000..e000c4b1cfae
--- /dev/null
+++ b/app-emulation/virtualbox-bin/virtualbox-bin-4.3.28.100309.ebuild
@@ -0,0 +1,357 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils fdo-mime gnome2 pax-utils python-r1 udev unpacker versionator
+
+MAIN_PV="$(get_version_component_range 1-3)"
+if [[ ${PV} = *_beta* ]] || [[ ${PV} = *_rc* ]] ; then
+ MY_PV="${MAIN_PV}_$(get_version_component_range 5)"
+ MY_PV="${MY_PV/beta/BETA}"
+ MY_PV="${MY_PV/rc/RC}"
+else
+ MY_PV="${MAIN_PV}"
+fi
+VBOX_BUILD_ID="$(get_version_component_range 4)"
+VBOX_PV="${MY_PV}-${VBOX_BUILD_ID}"
+MY_P="VirtualBox-${VBOX_PV}-Linux"
+# needed as sometimes the extpack gets another build ID
+EXTP_PV="${VBOX_PV}"
+EXTP_PN="Oracle_VM_VirtualBox_Extension_Pack"
+EXTP_P="${EXTP_PN}-${EXTP_PV}"
+# needed as sometimes the SDK gets another build ID
+SDK_PV="${VBOX_PV}"
+SDK_P="VirtualBoxSDK-${SDK_PV}"
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="amd64? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}_amd64.run )
+ x86? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}_x86.run )
+ http://download.virtualbox.org/virtualbox/${MY_PV}/${EXTP_P}.vbox-extpack -> ${EXTP_P}.tar.gz"
+
+LICENSE="GPL-2 PUEL"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="+additions +chm headless python vboxwebsrv rdesktop-vrdp"
+RESTRICT="mirror"
+
+if [[ "${PV}" != *beta* ]] ; then
+ SRC_URI+="
+ sdk? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${SDK_P}.zip )"
+ IUSE+=" sdk"
+fi
+
+DEPEND="app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="!!app-emulation/virtualbox
+ !app-emulation/virtualbox-additions
+ ~app-emulation/virtualbox-modules-${MAIN_PV}
+ !headless? (
+ x11-libs/libXcursor
+ media-libs/libsdl[X]
+ x11-libs/libXrender
+ x11-libs/libXfixes
+ media-libs/libpng
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXinerama
+ x11-libs/libXft
+ media-libs/freetype
+ media-libs/fontconfig
+ x11-libs/libXext
+ dev-libs/glib
+ chm? ( dev-libs/expat )
+ )
+ x11-libs/libXt
+ dev-libs/libxml2
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXmu
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-libs/libXdmcp
+ python? ( ${PYTHON_DEPS} )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+S=${WORKDIR}
+
+QA_TEXTRELS_amd64="opt/VirtualBox/VBoxVMM.so"
+QA_TEXTRELS_x86="opt/VirtualBox/VBoxGuestPropSvc.so
+ opt/VirtualBox/VBoxSDL.so
+ opt/VirtualBox/VBoxDbg.so
+ opt/VirtualBox/VBoxSharedFolders.so
+ opt/VirtualBox/VBoxDD2.so
+ opt/VirtualBox/VBoxOGLrenderspu.so
+ opt/VirtualBox/VBoxPython.so
+ opt/VirtualBox/VBoxPython2_7.so
+ opt/VirtualBox/VBoxDD.so
+ opt/VirtualBox/VBoxVRDP.so
+ opt/VirtualBox/VBoxDDU.so
+ opt/VirtualBox/VBoxREM64.so
+ opt/VirtualBox/VBoxSharedClipboard.so
+ opt/VirtualBox/VBoxHeadless.so
+ opt/VirtualBox/VBoxRT.so
+ opt/VirtualBox/VRDPAuth.so
+ opt/VirtualBox/VBoxREM.so
+ opt/VirtualBox/VBoxSettings.so
+ opt/VirtualBox/VBoxKeyboard.so
+ opt/VirtualBox/VBoxSharedCrOpenGL.so
+ opt/VirtualBox/VBoxVMM.so
+ opt/VirtualBox/VirtualBox.so
+ opt/VirtualBox/VBoxOGLhosterrorspu.so
+ opt/VirtualBox/components/VBoxC.so
+ opt/VirtualBox/components/VBoxSVCM.so
+ opt/VirtualBox/VBoxREM32.so
+ opt/VirtualBox/VBoxXPCOMC.so
+ opt/VirtualBox/VBoxOGLhostcrutil.so
+ opt/VirtualBox/VBoxNetDHCP.so
+ opt/VirtualBox/VBoxGuestControlSvc.so"
+QA_PRESTRIPPED="opt/VirtualBox/VBoxDD.so
+ opt/VirtualBox/VBoxDD2.so
+ opt/VirtualBox/VBoxDDU.so
+ opt/VirtualBox/VBoxDbg.so
+ opt/VirtualBox/VBoxGuestControlSvc.so
+ opt/VirtualBox/VBoxGuestPropSvc.so
+ opt/VirtualBox/VBoxHeadless
+ opt/VirtualBox/VBoxHeadless.so
+ opt/VirtualBox/VBoxKeyboard.so
+ opt/VirtualBox/VBoxManage
+ opt/VirtualBox/VBoxNetAdpCtl
+ opt/VirtualBox/VBoxNetDHCP
+ opt/VirtualBox/VBoxNetDHCP.so
+ opt/VirtualBox/VBoxOGLhostcrutil.so
+ opt/VirtualBox/VBoxOGLhosterrorspu.so
+ opt/VirtualBox/VBoxOGLrenderspu.so
+ opt/VirtualBox/VBoxPython.so
+ opt/VirtualBox/VBoxPython2_7.so
+ opt/VirtualBox/VBoxREM.so
+ opt/VirtualBox/VBoxREM32.so
+ opt/VirtualBox/VBoxREM64.so
+ opt/VirtualBox/VBoxRT.so
+ opt/VirtualBox/VBoxSDL
+ opt/VirtualBox/VBoxSDL.so
+ opt/VirtualBox/VBoxSVC
+ opt/VirtualBox/VBoxSettings.so
+ opt/VirtualBox/VBoxSharedClipboard.so
+ opt/VirtualBox/VBoxSharedCrOpenGL.so
+ opt/VirtualBox/VBoxSharedFolders.so
+ opt/VirtualBox/VBoxTestOGL
+ opt/VirtualBox/VBoxTunctl
+ opt/VirtualBox/VBoxVMM.so
+ opt/VirtualBox/VBoxVRDP.so
+ opt/VirtualBox/VBoxXPCOM.so
+ opt/VirtualBox/VBoxXPCOMC.so
+ opt/VirtualBox/VBoxXPCOMIPCD
+ opt/VirtualBox/VRDPAuth.so
+ opt/VirtualBox/VirtualBox
+ opt/VirtualBox/VirtualBox.so
+ opt/VirtualBox/accessible/libqtaccessiblewidgets.so
+ opt/VirtualBox/components/VBoxC.so
+ opt/VirtualBox/components/VBoxSVCM.so
+ opt/VirtualBox/components/VBoxXPCOMIPCC.so
+ opt/VirtualBox/kchmviewer
+ opt/VirtualBox/libQtCoreVBox.so.4
+ opt/VirtualBox/libQtGuiVBox.so.4
+ opt/VirtualBox/libQtNetworkVBox.so.4
+ opt/VirtualBox/libQtOpenGLVBox.so.4
+ opt/VirtualBox/vboxwebsrv"
+
+PYTHON_UPDATER_IGNORE="1"
+
+src_unpack() {
+ unpack_makeself ${MY_P}_${ARCH}.run
+ unpack ./VirtualBox.tar.bz2
+
+ mkdir "${S}"/${EXTP_PN} || die
+ pushd "${S}"/${EXTP_PN} &>/dev/null || die
+ unpack ${EXTP_P}.tar.gz
+ popd &>/dev/null || die
+
+ if [[ "${PV}" != *beta* ]] && use sdk ; then
+ unpack VirtualBoxSDK-${SDK_PV}.zip
+ fi
+}
+
+src_configure() {
+ :;
+}
+
+src_compile() {
+ :;
+}
+
+src_install() {
+ # create virtualbox configurations files
+ insinto /etc/vbox
+ newins "${FILESDIR}/${PN}-config" vbox.cfg
+
+ if ! use headless ; then
+ pushd "${S}"/icons &>/dev/null || die
+ for size in * ; do
+ if [ -f "${size}/virtualbox.png" ] ; then
+ insinto "/usr/share/icons/hicolor/${size}/apps"
+ newins "${size}/virtualbox.png" ${PN}.png
+ fi
+ done
+ dodir /usr/share/pixmaps
+ cp "48x48/virtualbox.png" "${D}/usr/share/pixmaps/${PN}.png" \
+ || die
+ popd &>/dev/null || die
+
+ newmenu "${FILESDIR}"/${PN}.desktop-2 ${PN}.desktop
+ fi
+
+ pushd "${S}"/${EXTP_PN} &>/dev/null || die
+ insinto /opt/VirtualBox/ExtensionPacks/${EXTP_PN}
+ doins -r linux.${ARCH}
+ doins ExtPack* PXE-Intel.rom
+ popd &>/dev/null || die
+ rm -rf "${S}"/${EXTP_PN}
+
+ insinto /opt/VirtualBox
+ dodir /opt/bin
+
+ doins UserManual.pdf
+
+ if [[ "${PV}" != *beta* ]] && use sdk ; then
+ doins -r sdk
+ fi
+
+ if use additions; then
+ doins -r additions
+ fi
+
+ if use vboxwebsrv; then
+ doins vboxwebsrv
+ fowners root:vboxusers /opt/VirtualBox/vboxwebsrv
+ fperms 0750 /opt/VirtualBox/vboxwebsrv
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/vboxwebsrv
+ newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+ newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+ fi
+
+ if use rdesktop-vrdp; then
+ doins rdesktop-vrdp
+ doins -r rdesktop-vrdp-keymaps
+ fperms 0750 /opt/VirtualBox/rdesktop-vrdp
+ dosym /opt/VirtualBox/rdesktop-vrdp /opt/bin/rdesktop-vrdp
+ fi
+
+ if ! use headless && use chm; then
+ doins kchmviewer VirtualBox.chm
+ fowners root:vboxusers /opt/VirtualBox/kchmviewer
+ fperms 0750 /opt/VirtualBox/kchmviewer
+ fi
+
+ # This ebuild / package supports only py2.7. Where py3 comes is unknown.
+ # The compile phase makes VBoxPython2_[4-7].so.
+ # py3 support would presumably require a binary pre-compiled by py3.
+ use python && doins VBoxPython.so VBoxPython2_7.so
+
+ rm -rf src rdesktop* deffiles install* routines.sh runlevel.sh \
+ vboxdrv.sh VBox.sh VBox.png vboxnet.sh additions VirtualBox.desktop \
+ VirtualBox.tar.bz2 LICENSE VBoxSysInfo.sh rdesktop* vboxwebsrv \
+ webtest kchmviewer VirtualBox.chm vbox-create-usb-node.sh \
+ 90-vbox-usb.fdi uninstall.sh vboxshell.py vboxdrv-pardus.py \
+ VBoxPython?_*.so
+
+ if use headless ; then
+ rm -rf VBoxSDL VirtualBox VBoxKeyboard.so
+ fi
+
+ doins -r * || die
+
+ # create symlinks for working around unsupported $ORIGIN/.. in VBoxC.so (setuid)
+ dosym /opt/VirtualBox/VBoxVMM.so /opt/VirtualBox/components/VBoxVMM.so
+ dosym /opt/VirtualBox/VBoxREM.so /opt/VirtualBox/components/VBoxREM.so
+ dosym /opt/VirtualBox/VBoxRT.so /opt/VirtualBox/components/VBoxRT.so
+ dosym /opt/VirtualBox/VBoxDDU.so /opt/VirtualBox/components/VBoxDDU.so
+ dosym /opt/VirtualBox/VBoxXPCOM.so /opt/VirtualBox/components/VBoxXPCOM.so
+
+ local each
+ for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,NetAdpCtl,NetDHCP,NetNAT,TestOGL,ExtPackHelperApp}; do
+ fowners root:vboxusers /opt/VirtualBox/${each}
+ fperms 0750 /opt/VirtualBox/${each}
+ pax-mark -m "${D}"/opt/VirtualBox/${each}
+ done
+ # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+ fperms 4750 /opt/VirtualBox/VBoxNetAdpCtl
+ fperms 4750 /opt/VirtualBox/VBoxNetDHCP
+ fperms 4750 /opt/VirtualBox/VBoxNetNAT
+
+ if ! use headless ; then
+ # Hardened build: Mark selected binaries set-user-ID-on-execution
+ for each in VBox{SDL,Headless} VirtualBox; do
+ fowners root:vboxusers /opt/VirtualBox/${each}
+ fperms 4510 /opt/VirtualBox/${each}
+ pax-mark -m "${D}"/opt/VirtualBox/${each}
+ done
+
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VirtualBox
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxSDL
+ else
+ # Hardened build: Mark selected binaries set-user-ID-on-execution
+ fowners root:vboxusers /opt/VirtualBox/VBoxHeadless
+ fperms 4510 /opt/VirtualBox/VBoxHeadless
+ pax-mark -m "${D}"/opt/VirtualBox/VBoxHeadless
+ fi
+
+ exeinto /opt/VirtualBox
+ newexe "${FILESDIR}/${PN}-3-wrapper" "VBox.sh"
+ fowners root:vboxusers /opt/VirtualBox/VBox.sh
+ fperms 0750 /opt/VirtualBox/VBox.sh
+
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxManage
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxVRDP
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxHeadless
+ dosym /opt/VirtualBox/VBoxTunctl /opt/bin/VBoxTunctl
+
+ # set an env-variable for 3rd party tools
+ echo -n "VBOX_APP_HOME=/opt/VirtualBox" > "${T}/90virtualbox"
+ doenvd "${T}/90virtualbox"
+
+ local udevdir="$(get_udevdir)"
+ insinto ${udevdir}/rules.d
+ doins "${FILESDIR}"/10-virtualbox.rules
+ sed "s@%UDEVDIR%@${udevdir}@" \
+ -i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
+ # move udev scripts into ${udevdir} (bug #372491)
+ mv "${D}"/opt/VirtualBox/VBoxCreateUSBNode.sh "${D}"${udevdir} || die
+ fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ gnome2_icon_cache_update
+
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ elog ""
+ if ! use headless ; then
+ elog "To launch VirtualBox just type: \"VirtualBox\""
+ elog ""
+ fi
+ elog "You must be in the vboxusers group to use VirtualBox."
+ elog ""
+ elog "For advanced networking setups you should emerge:"
+ elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+ elog ""
+ elog "Please visit http://www.virtualbox.org/wiki/Editions for"
+ elog "an overview about the different features of ${PN}"
+ elog "and virtualbox-ose"
+ if [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
+ elog ""
+ elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
+ elog "or else USB in ${PN} won't work."
+ fi
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/virtualbox-bin/virtualbox-bin-4.3.30.101610.ebuild b/app-emulation/virtualbox-bin/virtualbox-bin-4.3.30.101610.ebuild
new file mode 100644
index 000000000000..c142de049a09
--- /dev/null
+++ b/app-emulation/virtualbox-bin/virtualbox-bin-4.3.30.101610.ebuild
@@ -0,0 +1,357 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils fdo-mime gnome2 pax-utils python-r1 udev unpacker versionator
+
+MAIN_PV="$(get_version_component_range 1-3)"
+if [[ ${PV} = *_beta* ]] || [[ ${PV} = *_rc* ]] ; then
+ MY_PV="${MAIN_PV}_$(get_version_component_range 5)"
+ MY_PV="${MY_PV/beta/BETA}"
+ MY_PV="${MY_PV/rc/RC}"
+else
+ MY_PV="${MAIN_PV}"
+fi
+VBOX_BUILD_ID="$(get_version_component_range 4)"
+VBOX_PV="${MY_PV}-${VBOX_BUILD_ID}"
+MY_P="VirtualBox-${VBOX_PV}-Linux"
+# needed as sometimes the extpack gets another build ID
+EXTP_PV="${VBOX_PV}"
+EXTP_PN="Oracle_VM_VirtualBox_Extension_Pack"
+EXTP_P="${EXTP_PN}-${EXTP_PV}"
+# needed as sometimes the SDK gets another build ID
+SDK_PV="${VBOX_PV}"
+SDK_P="VirtualBoxSDK-${SDK_PV}"
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="amd64? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}_amd64.run )
+ x86? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}_x86.run )
+ http://download.virtualbox.org/virtualbox/${MY_PV}/${EXTP_P}.vbox-extpack -> ${EXTP_P}.tar.gz"
+
+LICENSE="GPL-2 PUEL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+additions +chm headless python vboxwebsrv rdesktop-vrdp"
+RESTRICT="mirror"
+
+if [[ "${PV}" != *beta* ]] ; then
+ SRC_URI+="
+ sdk? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${SDK_P}.zip )"
+ IUSE+=" sdk"
+fi
+
+DEPEND="app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="!!app-emulation/virtualbox
+ !app-emulation/virtualbox-additions
+ ~app-emulation/virtualbox-modules-${MAIN_PV}
+ !headless? (
+ x11-libs/libXcursor
+ media-libs/libsdl[X]
+ x11-libs/libXrender
+ x11-libs/libXfixes
+ media-libs/libpng
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXinerama
+ x11-libs/libXft
+ media-libs/freetype
+ media-libs/fontconfig
+ x11-libs/libXext
+ dev-libs/glib
+ chm? ( dev-libs/expat )
+ )
+ x11-libs/libXt
+ dev-libs/libxml2
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXmu
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-libs/libXdmcp
+ python? ( ${PYTHON_DEPS} )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+S=${WORKDIR}
+
+QA_TEXTRELS_amd64="opt/VirtualBox/VBoxVMM.so"
+QA_TEXTRELS_x86="opt/VirtualBox/VBoxGuestPropSvc.so
+ opt/VirtualBox/VBoxSDL.so
+ opt/VirtualBox/VBoxDbg.so
+ opt/VirtualBox/VBoxSharedFolders.so
+ opt/VirtualBox/VBoxDD2.so
+ opt/VirtualBox/VBoxOGLrenderspu.so
+ opt/VirtualBox/VBoxPython.so
+ opt/VirtualBox/VBoxPython2_7.so
+ opt/VirtualBox/VBoxDD.so
+ opt/VirtualBox/VBoxVRDP.so
+ opt/VirtualBox/VBoxDDU.so
+ opt/VirtualBox/VBoxREM64.so
+ opt/VirtualBox/VBoxSharedClipboard.so
+ opt/VirtualBox/VBoxHeadless.so
+ opt/VirtualBox/VBoxRT.so
+ opt/VirtualBox/VRDPAuth.so
+ opt/VirtualBox/VBoxREM.so
+ opt/VirtualBox/VBoxSettings.so
+ opt/VirtualBox/VBoxKeyboard.so
+ opt/VirtualBox/VBoxSharedCrOpenGL.so
+ opt/VirtualBox/VBoxVMM.so
+ opt/VirtualBox/VirtualBox.so
+ opt/VirtualBox/VBoxOGLhosterrorspu.so
+ opt/VirtualBox/components/VBoxC.so
+ opt/VirtualBox/components/VBoxSVCM.so
+ opt/VirtualBox/VBoxREM32.so
+ opt/VirtualBox/VBoxXPCOMC.so
+ opt/VirtualBox/VBoxOGLhostcrutil.so
+ opt/VirtualBox/VBoxNetDHCP.so
+ opt/VirtualBox/VBoxGuestControlSvc.so"
+QA_PRESTRIPPED="opt/VirtualBox/VBoxDD.so
+ opt/VirtualBox/VBoxDD2.so
+ opt/VirtualBox/VBoxDDU.so
+ opt/VirtualBox/VBoxDbg.so
+ opt/VirtualBox/VBoxGuestControlSvc.so
+ opt/VirtualBox/VBoxGuestPropSvc.so
+ opt/VirtualBox/VBoxHeadless
+ opt/VirtualBox/VBoxHeadless.so
+ opt/VirtualBox/VBoxKeyboard.so
+ opt/VirtualBox/VBoxManage
+ opt/VirtualBox/VBoxNetAdpCtl
+ opt/VirtualBox/VBoxNetDHCP
+ opt/VirtualBox/VBoxNetDHCP.so
+ opt/VirtualBox/VBoxOGLhostcrutil.so
+ opt/VirtualBox/VBoxOGLhosterrorspu.so
+ opt/VirtualBox/VBoxOGLrenderspu.so
+ opt/VirtualBox/VBoxPython.so
+ opt/VirtualBox/VBoxPython2_7.so
+ opt/VirtualBox/VBoxREM.so
+ opt/VirtualBox/VBoxREM32.so
+ opt/VirtualBox/VBoxREM64.so
+ opt/VirtualBox/VBoxRT.so
+ opt/VirtualBox/VBoxSDL
+ opt/VirtualBox/VBoxSDL.so
+ opt/VirtualBox/VBoxSVC
+ opt/VirtualBox/VBoxSettings.so
+ opt/VirtualBox/VBoxSharedClipboard.so
+ opt/VirtualBox/VBoxSharedCrOpenGL.so
+ opt/VirtualBox/VBoxSharedFolders.so
+ opt/VirtualBox/VBoxTestOGL
+ opt/VirtualBox/VBoxTunctl
+ opt/VirtualBox/VBoxVMM.so
+ opt/VirtualBox/VBoxVRDP.so
+ opt/VirtualBox/VBoxXPCOM.so
+ opt/VirtualBox/VBoxXPCOMC.so
+ opt/VirtualBox/VBoxXPCOMIPCD
+ opt/VirtualBox/VRDPAuth.so
+ opt/VirtualBox/VirtualBox
+ opt/VirtualBox/VirtualBox.so
+ opt/VirtualBox/accessible/libqtaccessiblewidgets.so
+ opt/VirtualBox/components/VBoxC.so
+ opt/VirtualBox/components/VBoxSVCM.so
+ opt/VirtualBox/components/VBoxXPCOMIPCC.so
+ opt/VirtualBox/kchmviewer
+ opt/VirtualBox/libQtCoreVBox.so.4
+ opt/VirtualBox/libQtGuiVBox.so.4
+ opt/VirtualBox/libQtNetworkVBox.so.4
+ opt/VirtualBox/libQtOpenGLVBox.so.4
+ opt/VirtualBox/vboxwebsrv"
+
+PYTHON_UPDATER_IGNORE="1"
+
+src_unpack() {
+ unpack_makeself ${MY_P}_${ARCH}.run
+ unpack ./VirtualBox.tar.bz2
+
+ mkdir "${S}"/${EXTP_PN} || die
+ pushd "${S}"/${EXTP_PN} &>/dev/null || die
+ unpack ${EXTP_P}.tar.gz
+ popd &>/dev/null || die
+
+ if [[ "${PV}" != *beta* ]] && use sdk ; then
+ unpack VirtualBoxSDK-${SDK_PV}.zip
+ fi
+}
+
+src_configure() {
+ :;
+}
+
+src_compile() {
+ :;
+}
+
+src_install() {
+ # create virtualbox configurations files
+ insinto /etc/vbox
+ newins "${FILESDIR}/${PN}-config" vbox.cfg
+
+ if ! use headless ; then
+ pushd "${S}"/icons &>/dev/null || die
+ for size in * ; do
+ if [ -f "${size}/virtualbox.png" ] ; then
+ insinto "/usr/share/icons/hicolor/${size}/apps"
+ newins "${size}/virtualbox.png" ${PN}.png
+ fi
+ done
+ dodir /usr/share/pixmaps
+ cp "48x48/virtualbox.png" "${D}/usr/share/pixmaps/${PN}.png" \
+ || die
+ popd &>/dev/null || die
+
+ newmenu "${FILESDIR}"/${PN}.desktop-2 ${PN}.desktop
+ fi
+
+ pushd "${S}"/${EXTP_PN} &>/dev/null || die
+ insinto /opt/VirtualBox/ExtensionPacks/${EXTP_PN}
+ doins -r linux.${ARCH}
+ doins ExtPack* PXE-Intel.rom
+ popd &>/dev/null || die
+ rm -rf "${S}"/${EXTP_PN}
+
+ insinto /opt/VirtualBox
+ dodir /opt/bin
+
+ doins UserManual.pdf
+
+ if [[ "${PV}" != *beta* ]] && use sdk ; then
+ doins -r sdk
+ fi
+
+ if use additions; then
+ doins -r additions
+ fi
+
+ if use vboxwebsrv; then
+ doins vboxwebsrv
+ fowners root:vboxusers /opt/VirtualBox/vboxwebsrv
+ fperms 0750 /opt/VirtualBox/vboxwebsrv
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/vboxwebsrv
+ newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+ newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+ fi
+
+ if use rdesktop-vrdp; then
+ doins rdesktop-vrdp
+ doins -r rdesktop-vrdp-keymaps
+ fperms 0750 /opt/VirtualBox/rdesktop-vrdp
+ dosym /opt/VirtualBox/rdesktop-vrdp /opt/bin/rdesktop-vrdp
+ fi
+
+ if ! use headless && use chm; then
+ doins kchmviewer VirtualBox.chm
+ fowners root:vboxusers /opt/VirtualBox/kchmviewer
+ fperms 0750 /opt/VirtualBox/kchmviewer
+ fi
+
+ # This ebuild / package supports only py2.7. Where py3 comes is unknown.
+ # The compile phase makes VBoxPython2_[4-7].so.
+ # py3 support would presumably require a binary pre-compiled by py3.
+ use python && doins VBoxPython.so VBoxPython2_7.so
+
+ rm -rf src rdesktop* deffiles install* routines.sh runlevel.sh \
+ vboxdrv.sh VBox.sh VBox.png vboxnet.sh additions VirtualBox.desktop \
+ VirtualBox.tar.bz2 LICENSE VBoxSysInfo.sh rdesktop* vboxwebsrv \
+ webtest kchmviewer VirtualBox.chm vbox-create-usb-node.sh \
+ 90-vbox-usb.fdi uninstall.sh vboxshell.py vboxdrv-pardus.py \
+ VBoxPython?_*.so
+
+ if use headless ; then
+ rm -rf VBoxSDL VirtualBox VBoxKeyboard.so
+ fi
+
+ doins -r * || die
+
+ # create symlinks for working around unsupported $ORIGIN/.. in VBoxC.so (setuid)
+ dosym /opt/VirtualBox/VBoxVMM.so /opt/VirtualBox/components/VBoxVMM.so
+ dosym /opt/VirtualBox/VBoxREM.so /opt/VirtualBox/components/VBoxREM.so
+ dosym /opt/VirtualBox/VBoxRT.so /opt/VirtualBox/components/VBoxRT.so
+ dosym /opt/VirtualBox/VBoxDDU.so /opt/VirtualBox/components/VBoxDDU.so
+ dosym /opt/VirtualBox/VBoxXPCOM.so /opt/VirtualBox/components/VBoxXPCOM.so
+
+ local each
+ for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,NetAdpCtl,NetDHCP,NetNAT,TestOGL,ExtPackHelperApp}; do
+ fowners root:vboxusers /opt/VirtualBox/${each}
+ fperms 0750 /opt/VirtualBox/${each}
+ pax-mark -m "${D}"/opt/VirtualBox/${each}
+ done
+ # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+ fperms 4750 /opt/VirtualBox/VBoxNetAdpCtl
+ fperms 4750 /opt/VirtualBox/VBoxNetDHCP
+ fperms 4750 /opt/VirtualBox/VBoxNetNAT
+
+ if ! use headless ; then
+ # Hardened build: Mark selected binaries set-user-ID-on-execution
+ for each in VBox{SDL,Headless} VirtualBox; do
+ fowners root:vboxusers /opt/VirtualBox/${each}
+ fperms 4510 /opt/VirtualBox/${each}
+ pax-mark -m "${D}"/opt/VirtualBox/${each}
+ done
+
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VirtualBox
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxSDL
+ else
+ # Hardened build: Mark selected binaries set-user-ID-on-execution
+ fowners root:vboxusers /opt/VirtualBox/VBoxHeadless
+ fperms 4510 /opt/VirtualBox/VBoxHeadless
+ pax-mark -m "${D}"/opt/VirtualBox/VBoxHeadless
+ fi
+
+ exeinto /opt/VirtualBox
+ newexe "${FILESDIR}/${PN}-3-wrapper" "VBox.sh"
+ fowners root:vboxusers /opt/VirtualBox/VBox.sh
+ fperms 0750 /opt/VirtualBox/VBox.sh
+
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxManage
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxVRDP
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxHeadless
+ dosym /opt/VirtualBox/VBoxTunctl /opt/bin/VBoxTunctl
+
+ # set an env-variable for 3rd party tools
+ echo -n "VBOX_APP_HOME=/opt/VirtualBox" > "${T}/90virtualbox"
+ doenvd "${T}/90virtualbox"
+
+ local udevdir="$(get_udevdir)"
+ insinto ${udevdir}/rules.d
+ doins "${FILESDIR}"/10-virtualbox.rules
+ sed "s@%UDEVDIR%@${udevdir}@" \
+ -i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
+ # move udev scripts into ${udevdir} (bug #372491)
+ mv "${D}"/opt/VirtualBox/VBoxCreateUSBNode.sh "${D}"${udevdir} || die
+ fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ gnome2_icon_cache_update
+
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ elog ""
+ if ! use headless ; then
+ elog "To launch VirtualBox just type: \"VirtualBox\""
+ elog ""
+ fi
+ elog "You must be in the vboxusers group to use VirtualBox."
+ elog ""
+ elog "For advanced networking setups you should emerge:"
+ elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+ elog ""
+ elog "Please visit http://www.virtualbox.org/wiki/Editions for"
+ elog "an overview about the different features of ${PN}"
+ elog "and virtualbox-ose"
+ if [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
+ elog ""
+ elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
+ elog "or else USB in ${PN} won't work."
+ fi
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/virtualbox-bin/virtualbox-bin-5.0.0.101573.ebuild b/app-emulation/virtualbox-bin/virtualbox-bin-5.0.0.101573.ebuild
new file mode 100644
index 000000000000..be7050520b60
--- /dev/null
+++ b/app-emulation/virtualbox-bin/virtualbox-bin-5.0.0.101573.ebuild
@@ -0,0 +1,357 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils fdo-mime gnome2 pax-utils python-r1 udev unpacker versionator
+
+MAIN_PV="$(get_version_component_range 1-3)"
+if [[ ${PV} = *_beta* ]] || [[ ${PV} = *_rc* ]] ; then
+ MY_PV="${MAIN_PV}_$(get_version_component_range 5)"
+ MY_PV="${MY_PV/beta/BETA}"
+ MY_PV="${MY_PV/rc/RC}"
+else
+ MY_PV="${MAIN_PV}"
+fi
+VBOX_BUILD_ID="$(get_version_component_range 4)"
+VBOX_PV="${MY_PV}-${VBOX_BUILD_ID}"
+MY_P="VirtualBox-${VBOX_PV}-Linux"
+# needed as sometimes the extpack gets another build ID
+EXTP_PV="${VBOX_PV}"
+EXTP_PN="Oracle_VM_VirtualBox_Extension_Pack"
+EXTP_P="${EXTP_PN}-${EXTP_PV}"
+# needed as sometimes the SDK gets another build ID
+SDK_PV="${VBOX_PV}"
+SDK_P="VirtualBoxSDK-${SDK_PV}"
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="amd64? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}_amd64.run )
+ x86? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}_x86.run )
+ http://download.virtualbox.org/virtualbox/${MY_PV}/${EXTP_P}.vbox-extpack -> ${EXTP_P}.tar.gz"
+
+LICENSE="GPL-2 PUEL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+additions +chm headless python vboxwebsrv rdesktop-vrdp"
+RESTRICT="mirror"
+
+if [[ "${PV}" != *beta* ]] ; then
+ SRC_URI+="
+ sdk? ( http://download.virtualbox.org/virtualbox/${MY_PV}/${SDK_P}.zip )"
+ IUSE+=" sdk"
+fi
+
+DEPEND="app-arch/unzip
+ ${PYTHON_DEPS}"
+
+RDEPEND="!!app-emulation/virtualbox
+ !app-emulation/virtualbox-additions
+ ~app-emulation/virtualbox-modules-${MAIN_PV}
+ !headless? (
+ x11-libs/libXcursor
+ media-libs/libsdl[X]
+ x11-libs/libXrender
+ x11-libs/libXfixes
+ media-libs/libpng
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXinerama
+ x11-libs/libXft
+ media-libs/freetype
+ media-libs/fontconfig
+ x11-libs/libXext
+ dev-libs/glib
+ chm? ( dev-libs/expat )
+ )
+ x11-libs/libXt
+ dev-libs/libxml2
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXmu
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-libs/libXdmcp
+ ${PYTHON_DEPS}"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+S=${WORKDIR}
+
+QA_TEXTRELS_amd64="opt/VirtualBox/VBoxVMM.so"
+QA_TEXTRELS_x86="opt/VirtualBox/VBoxGuestPropSvc.so
+ opt/VirtualBox/VBoxSDL.so
+ opt/VirtualBox/VBoxDbg.so
+ opt/VirtualBox/VBoxSharedFolders.so
+ opt/VirtualBox/VBoxDD2.so
+ opt/VirtualBox/VBoxOGLrenderspu.so
+ opt/VirtualBox/VBoxPython.so
+ opt/VirtualBox/VBoxPython2_7.so
+ opt/VirtualBox/VBoxDD.so
+ opt/VirtualBox/VBoxVRDP.so
+ opt/VirtualBox/VBoxDDU.so
+ opt/VirtualBox/VBoxREM64.so
+ opt/VirtualBox/VBoxSharedClipboard.so
+ opt/VirtualBox/VBoxHeadless.so
+ opt/VirtualBox/VBoxRT.so
+ opt/VirtualBox/VRDPAuth.so
+ opt/VirtualBox/VBoxREM.so
+ opt/VirtualBox/VBoxSettings.so
+ opt/VirtualBox/VBoxKeyboard.so
+ opt/VirtualBox/VBoxSharedCrOpenGL.so
+ opt/VirtualBox/VBoxVMM.so
+ opt/VirtualBox/VirtualBox.so
+ opt/VirtualBox/VBoxOGLhosterrorspu.so
+ opt/VirtualBox/components/VBoxC.so
+ opt/VirtualBox/components/VBoxSVCM.so
+ opt/VirtualBox/VBoxREM32.so
+ opt/VirtualBox/VBoxXPCOMC.so
+ opt/VirtualBox/VBoxOGLhostcrutil.so
+ opt/VirtualBox/VBoxNetDHCP.so
+ opt/VirtualBox/VBoxGuestControlSvc.so"
+QA_PRESTRIPPED="opt/VirtualBox/VBoxDD.so
+ opt/VirtualBox/VBoxDD2.so
+ opt/VirtualBox/VBoxDDU.so
+ opt/VirtualBox/VBoxDbg.so
+ opt/VirtualBox/VBoxGuestControlSvc.so
+ opt/VirtualBox/VBoxGuestPropSvc.so
+ opt/VirtualBox/VBoxHeadless
+ opt/VirtualBox/VBoxHeadless.so
+ opt/VirtualBox/VBoxKeyboard.so
+ opt/VirtualBox/VBoxManage
+ opt/VirtualBox/VBoxNetAdpCtl
+ opt/VirtualBox/VBoxNetDHCP
+ opt/VirtualBox/VBoxNetDHCP.so
+ opt/VirtualBox/VBoxOGLhostcrutil.so
+ opt/VirtualBox/VBoxOGLhosterrorspu.so
+ opt/VirtualBox/VBoxOGLrenderspu.so
+ opt/VirtualBox/VBoxPython.so
+ opt/VirtualBox/VBoxPython2_7.so
+ opt/VirtualBox/VBoxREM.so
+ opt/VirtualBox/VBoxREM32.so
+ opt/VirtualBox/VBoxREM64.so
+ opt/VirtualBox/VBoxRT.so
+ opt/VirtualBox/VBoxSDL
+ opt/VirtualBox/VBoxSDL.so
+ opt/VirtualBox/VBoxSVC
+ opt/VirtualBox/VBoxSettings.so
+ opt/VirtualBox/VBoxSharedClipboard.so
+ opt/VirtualBox/VBoxSharedCrOpenGL.so
+ opt/VirtualBox/VBoxSharedFolders.so
+ opt/VirtualBox/VBoxTestOGL
+ opt/VirtualBox/VBoxTunctl
+ opt/VirtualBox/VBoxVMM.so
+ opt/VirtualBox/VBoxVRDP.so
+ opt/VirtualBox/VBoxXPCOM.so
+ opt/VirtualBox/VBoxXPCOMC.so
+ opt/VirtualBox/VBoxXPCOMIPCD
+ opt/VirtualBox/VRDPAuth.so
+ opt/VirtualBox/VirtualBox
+ opt/VirtualBox/VirtualBox.so
+ opt/VirtualBox/accessible/libqtaccessiblewidgets.so
+ opt/VirtualBox/components/VBoxC.so
+ opt/VirtualBox/components/VBoxSVCM.so
+ opt/VirtualBox/components/VBoxXPCOMIPCC.so
+ opt/VirtualBox/kchmviewer
+ opt/VirtualBox/libQtCoreVBox.so.4
+ opt/VirtualBox/libQtGuiVBox.so.4
+ opt/VirtualBox/libQtNetworkVBox.so.4
+ opt/VirtualBox/libQtOpenGLVBox.so.4
+ opt/VirtualBox/vboxwebsrv"
+
+PYTHON_UPDATER_IGNORE="1"
+
+src_unpack() {
+ unpack_makeself ${MY_P}_${ARCH}.run
+ unpack ./VirtualBox.tar.bz2
+
+ mkdir "${S}"/${EXTP_PN} || die
+ pushd "${S}"/${EXTP_PN} &>/dev/null || die
+ unpack ${EXTP_P}.tar.gz
+ popd &>/dev/null || die
+
+ if [[ "${PV}" != *beta* ]] && use sdk ; then
+ unpack VirtualBoxSDK-${SDK_PV}.zip
+ fi
+}
+
+src_configure() {
+ :;
+}
+
+src_compile() {
+ :;
+}
+
+src_install() {
+ # create virtualbox configurations files
+ insinto /etc/vbox
+ newins "${FILESDIR}/${PN}-config" vbox.cfg
+
+ if ! use headless ; then
+ pushd "${S}"/icons &>/dev/null || die
+ for size in * ; do
+ if [ -f "${size}/virtualbox.png" ] ; then
+ insinto "/usr/share/icons/hicolor/${size}/apps"
+ newins "${size}/virtualbox.png" ${PN}.png
+ fi
+ done
+ dodir /usr/share/pixmaps
+ cp "48x48/virtualbox.png" "${D}/usr/share/pixmaps/${PN}.png" \
+ || die
+ popd &>/dev/null || die
+
+ newmenu "${FILESDIR}"/${PN}.desktop-2 ${PN}.desktop
+ fi
+
+ pushd "${S}"/${EXTP_PN} &>/dev/null || die
+ insinto /opt/VirtualBox/ExtensionPacks/${EXTP_PN}
+ doins -r linux.${ARCH}
+ doins ExtPack* PXE-Intel.rom
+ popd &>/dev/null || die
+ rm -rf "${S}"/${EXTP_PN}
+
+ insinto /opt/VirtualBox
+ dodir /opt/bin
+
+ doins UserManual.pdf
+
+ if [[ "${PV}" != *beta* ]] && use sdk ; then
+ doins -r sdk
+ fi
+
+ if use additions; then
+ doins -r additions
+ fi
+
+ if use vboxwebsrv; then
+ doins vboxwebsrv
+ fowners root:vboxusers /opt/VirtualBox/vboxwebsrv
+ fperms 0750 /opt/VirtualBox/vboxwebsrv
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/vboxwebsrv
+ newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+ newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+ fi
+
+ if use rdesktop-vrdp; then
+ doins rdesktop-vrdp
+ doins -r rdesktop-vrdp-keymaps
+ fperms 0750 /opt/VirtualBox/rdesktop-vrdp
+ dosym /opt/VirtualBox/rdesktop-vrdp /opt/bin/rdesktop-vrdp
+ fi
+
+ if ! use headless && use chm; then
+ doins kchmviewer VirtualBox.chm
+ fowners root:vboxusers /opt/VirtualBox/kchmviewer
+ fperms 0750 /opt/VirtualBox/kchmviewer
+ fi
+
+ # This ebuild / package supports only py2.7. Where py3 comes is unknown.
+ # The compile phase makes VBoxPython2_[4-7].so.
+ # py3 support would presumably require a binary pre-compiled by py3.
+ use python && doins VBoxPython.so VBoxPython2_7.so
+
+ rm -rf src rdesktop* deffiles install* routines.sh runlevel.sh \
+ vboxdrv.sh VBox.sh VBox.png vboxnet.sh additions VirtualBox.desktop \
+ VirtualBox.tar.bz2 LICENSE VBoxSysInfo.sh rdesktop* vboxwebsrv \
+ webtest kchmviewer VirtualBox.chm vbox-create-usb-node.sh \
+ 90-vbox-usb.fdi uninstall.sh vboxshell.py vboxdrv-pardus.py \
+ VBoxPython?_*.so
+
+ if use headless ; then
+ rm -rf VBoxSDL VirtualBox VBoxKeyboard.so
+ fi
+
+ doins -r * || die
+
+ # create symlinks for working around unsupported $ORIGIN/.. in VBoxC.so (setuid)
+ dosym /opt/VirtualBox/VBoxVMM.so /opt/VirtualBox/components/VBoxVMM.so
+ dosym /opt/VirtualBox/VBoxREM.so /opt/VirtualBox/components/VBoxREM.so
+ dosym /opt/VirtualBox/VBoxRT.so /opt/VirtualBox/components/VBoxRT.so
+ dosym /opt/VirtualBox/VBoxDDU.so /opt/VirtualBox/components/VBoxDDU.so
+ dosym /opt/VirtualBox/VBoxXPCOM.so /opt/VirtualBox/components/VBoxXPCOM.so
+
+ local each
+ for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,NetAdpCtl,NetDHCP,NetNAT,TestOGL,ExtPackHelperApp}; do
+ fowners root:vboxusers /opt/VirtualBox/${each}
+ fperms 0750 /opt/VirtualBox/${each}
+ pax-mark -m "${D}"/opt/VirtualBox/${each}
+ done
+ # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+ fperms 4750 /opt/VirtualBox/VBoxNetAdpCtl
+ fperms 4750 /opt/VirtualBox/VBoxNetDHCP
+ fperms 4750 /opt/VirtualBox/VBoxNetNAT
+
+ if ! use headless ; then
+ # Hardened build: Mark selected binaries set-user-ID-on-execution
+ for each in VBox{SDL,Headless} VirtualBox; do
+ fowners root:vboxusers /opt/VirtualBox/${each}
+ fperms 4510 /opt/VirtualBox/${each}
+ pax-mark -m "${D}"/opt/VirtualBox/${each}
+ done
+
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VirtualBox
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxSDL
+ else
+ # Hardened build: Mark selected binaries set-user-ID-on-execution
+ fowners root:vboxusers /opt/VirtualBox/VBoxHeadless
+ fperms 4510 /opt/VirtualBox/VBoxHeadless
+ pax-mark -m "${D}"/opt/VirtualBox/VBoxHeadless
+ fi
+
+ exeinto /opt/VirtualBox
+ newexe "${FILESDIR}/${PN}-3-wrapper" "VBox.sh"
+ fowners root:vboxusers /opt/VirtualBox/VBox.sh
+ fperms 0750 /opt/VirtualBox/VBox.sh
+
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxManage
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxVRDP
+ dosym /opt/VirtualBox/VBox.sh /opt/bin/VBoxHeadless
+ dosym /opt/VirtualBox/VBoxTunctl /opt/bin/VBoxTunctl
+
+ # set an env-variable for 3rd party tools
+ echo -n "VBOX_APP_HOME=/opt/VirtualBox" > "${T}/90virtualbox"
+ doenvd "${T}/90virtualbox"
+
+ local udevdir="$(get_udevdir)"
+ insinto ${udevdir}/rules.d
+ doins "${FILESDIR}"/10-virtualbox.rules
+ sed "s@%UDEVDIR%@${udevdir}@" \
+ -i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
+ # move udev scripts into ${udevdir} (bug #372491)
+ mv "${D}"/opt/VirtualBox/VBoxCreateUSBNode.sh "${D}"${udevdir} || die
+ fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ gnome2_icon_cache_update
+
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ elog ""
+ if ! use headless ; then
+ elog "To launch VirtualBox just type: \"VirtualBox\""
+ elog ""
+ fi
+ elog "You must be in the vboxusers group to use VirtualBox."
+ elog ""
+ elog "For advanced networking setups you should emerge:"
+ elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+ elog ""
+ elog "Please visit http://www.virtualbox.org/wiki/Editions for"
+ elog "an overview about the different features of ${PN}"
+ elog "and virtualbox-ose"
+ if [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
+ elog ""
+ elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
+ elog "or else USB in ${PN} won't work."
+ fi
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/virtualbox-extpack-oracle/Manifest b/app-emulation/virtualbox-extpack-oracle/Manifest
new file mode 100644
index 000000000000..4718a7ce3b28
--- /dev/null
+++ b/app-emulation/virtualbox-extpack-oracle/Manifest
@@ -0,0 +1,3 @@
+DIST Oracle_VM_VirtualBox_Extension_Pack-4.3.28-100309.tar.gz 15961939 SHA256 72e101d9dc5eabeb76d1ab5bd6d2f817a11c89adfe8bb72cc5d614a2eef532d1 SHA512 57ad44a99a7abcad195e6ceccc1fe7b494979da65601a52e0be8336bb819812d5cef48a8bc0fe9f74f3a05238e6fd29562ac678d4ef7e0c78587fe81c287a65e WHIRLPOOL fb08189c53841664119bffb4de6a76d6f72fb035f887ed5e948f38faa5be2891e35de0806da02d299e818370285bcddba06eb84bea7db4d3cfa09d92f8042db7
+DIST Oracle_VM_VirtualBox_Extension_Pack-4.3.30-101610.tar.gz 15983777 SHA256 770d49247976f2a0d14a66196dddf864c6b9d185671e2a29cab459fc28f105db SHA512 f5d8275fe3e1ea60e8d15af3b0c7382faab172df39369c8904ff734a5105daed87a48215880b2e286c6735ead341c237d2260e6ee923f513818f85cf0b452def WHIRLPOOL 3b1e29a44413ebc65dc250b2366b1fe75d6ea48fd94b722c8ec9eb7e97e6981470e9201c9840d566953c9c9bdd4a7893f9d525b3fac7150ca24391f696bba9c4
+DIST Oracle_VM_VirtualBox_Extension_Pack-5.0.0-101573.tar.gz 18028050 SHA256 c357e36368883df821ed092d261890a95c75e50422b75848c40ad20984086a7a SHA512 8eb21610ab4d4b5ada5901e25adcc99ad2b4ab20e86309c90f9bad993d71007f13eccf81e3670102e5400fa02d3df9c03d0901389f8980e9cdfa092b2d326271 WHIRLPOOL bd0cff1c58d90663b5c4f7983b05be9f3469f201143f30ef729723aaa55508685a34355b00ad952dc5132045589a1b26d71bbc5a5ee0d0fc32b99cf0a5f8e4f8
diff --git a/app-emulation/virtualbox-extpack-oracle/metadata.xml b/app-emulation/virtualbox-extpack-oracle/metadata.xml
new file mode 100644
index 000000000000..cefd27ea325b
--- /dev/null
+++ b/app-emulation/virtualbox-extpack-oracle/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.3.28.100309.ebuild b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.3.28.100309.ebuild
new file mode 100644
index 000000000000..23846b4705a8
--- /dev/null
+++ b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.3.28.100309.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib versionator
+
+MAIN_PV="$(get_version_component_range 1-3)"
+if [[ ${PV} = *_beta* ]] || [[ ${PV} = *_rc* ]] ; then
+ MY_PV="${MAIN_PV}_$(get_version_component_range 5)"
+ MY_PV="${MY_PV/beta/BETA}"
+ MY_PV="${MY_PV/rc/RC}"
+else
+ MY_PV="${MAIN_PV}"
+fi
+VBOX_BUILD_ID="$(get_version_component_range 4)"
+MY_PN="Oracle_VM_VirtualBox_Extension_Pack"
+MY_P="${MY_PN}-${MY_PV}-${VBOX_BUILD_ID}"
+
+DESCRIPTION="PUEL extensions for VirtualBox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.vbox-extpack -> ${MY_P}.tar.gz"
+
+LICENSE="PUEL"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+RESTRICT="mirror strip"
+
+RDEPEND="~app-emulation/virtualbox-${MAIN_PV}"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="/usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}/.*"
+
+src_install() {
+ insinto /usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}
+ doins -r linux.${ARCH}
+ doins ExtPack* PXE-Intel.rom
+}
diff --git a/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.3.30.101610.ebuild b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.3.30.101610.ebuild
new file mode 100644
index 000000000000..720edf8685fc
--- /dev/null
+++ b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-4.3.30.101610.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib versionator
+
+MAIN_PV="$(get_version_component_range 1-3)"
+if [[ ${PV} = *_beta* ]] || [[ ${PV} = *_rc* ]] ; then
+ MY_PV="${MAIN_PV}_$(get_version_component_range 5)"
+ MY_PV="${MY_PV/beta/BETA}"
+ MY_PV="${MY_PV/rc/RC}"
+else
+ MY_PV="${MAIN_PV}"
+fi
+VBOX_BUILD_ID="$(get_version_component_range 4)"
+MY_PN="Oracle_VM_VirtualBox_Extension_Pack"
+MY_P="${MY_PN}-${MY_PV}-${VBOX_BUILD_ID}"
+
+DESCRIPTION="PUEL extensions for VirtualBox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.vbox-extpack -> ${MY_P}.tar.gz"
+
+LICENSE="PUEL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="mirror strip"
+
+RDEPEND="~app-emulation/virtualbox-${MAIN_PV}"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="/usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}/.*"
+
+src_install() {
+ insinto /usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}
+ doins -r linux.${ARCH}
+ doins ExtPack* PXE-Intel.rom
+}
diff --git a/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.0.0.101573.ebuild b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.0.0.101573.ebuild
new file mode 100644
index 000000000000..19d40ce0c134
--- /dev/null
+++ b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.0.0.101573.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib versionator
+
+MAIN_PV="$(get_version_component_range 1-3)"
+if [[ ${PV} = *_beta* ]] || [[ ${PV} = *_rc* ]] ; then
+ MY_PV="${MAIN_PV}_$(get_version_component_range 5)"
+ DEP_PV="${MY_PV}"
+ MY_PV="${MY_PV/beta/BETA}"
+ MY_PV="${MY_PV/rc/RC}"
+else
+ MY_PV="${MAIN_PV}"
+ DEP_PV="${MAIN_PV}"
+fi
+VBOX_BUILD_ID="$(get_version_component_range 4)"
+MY_PN="Oracle_VM_VirtualBox_Extension_Pack"
+MY_P="${MY_PN}-${MY_PV}-${VBOX_BUILD_ID}"
+
+DESCRIPTION="PUEL extensions for VirtualBox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.vbox-extpack -> ${MY_P}.tar.gz"
+
+LICENSE="PUEL"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="mirror strip"
+
+RDEPEND="~app-emulation/virtualbox-${DEP_PV}"
+
+S="${WORKDIR}"
+
+QA_PREBUILT="/usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}/.*"
+
+src_install() {
+ insinto /usr/$(get_libdir)/virtualbox/ExtensionPacks/${MY_PN}
+ doins -r linux.${ARCH}
+ doins ExtPack* PXE-Intel.rom
+}
diff --git a/app-emulation/virtualbox-guest-additions/Manifest b/app-emulation/virtualbox-guest-additions/Manifest
new file mode 100644
index 000000000000..4fdb49ac069a
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/Manifest
@@ -0,0 +1,3 @@
+DIST VirtualBox-4.3.28.tar.bz2 100092002 SHA256 e157ab76d1958ae2c56b2a3875194fbff3de82486ad0e30032fd5bd772297c31 SHA512 b6e849a1420515b6dbda8cee0ab64940dd93296ec58cde76676ac257ff3dad0459aa1fd0bda7e1d0abc751d2d59f055465b198a546fdbb4e70e934a78654a8fc WHIRLPOOL 1b739f1f989032e07829a23ffadadd49e31109d70b0effbc44126a48a165218ff3ebafa576fa0e4f2af76a404033b60e5c9804ac43db5dd3024f1eca25ca70da
+DIST VirtualBox-4.3.30.tar.bz2 97428942 SHA256 ea9569ec16cd6202ee61bcadb2506d31ac12fd343adb91565773a05eaaea9a36 SHA512 d0817335cf4bd196da93b91ede6bc9e48ca0d471166ab2790dbf508a4574e4ace54a86053932abf3b4e804c583e80a713d2ab2e556dc15bee6ef3a62f88b95fc WHIRLPOOL 47cbd702e83cc737e04b5862cc6c52e32be244dc1dc0145f582f57b2f19bb898f0f4b200576a28f10a3290691f1ffd43c256e8c8eb5545a9723be8eefca88a38
+DIST VirtualBox-5.0.0.tar.bz2 109816664 SHA256 bb71356c8f82012c9b5ae16e12302eb111c71ae7b063ada7688fbfa8aa10c2f7 SHA512 c9557820fa04215b1b7905babfab340a01ad2cf733a18462fc608f8db5d0aa908e9ec0d92b3c77075e8a1322c10c92f58f8f14608aa3480052ca730ebd507636 WHIRLPOOL 7cda1523e0cd2851cbea5bb7a202963bac67cc6af29d0ec9a706dcec53746e50e6c85ccea014604eca9558ccaa45e9d2ce05b2eb64dbb54a7edac5f538634134
diff --git a/app-emulation/virtualbox-guest-additions/files/vboxclient.desktop b/app-emulation/virtualbox-guest-additions/files/vboxclient.desktop
new file mode 100644
index 000000000000..316eb9f6203a
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/files/vboxclient.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=VirtualBox Client Service
+Exec=VBoxClient-all
+Terminal=false
+X-KDE-StartupNotify=false
+StartupNotify=false
diff --git a/app-emulation/virtualbox-guest-additions/files/vboxguest-4.1.0-log-use-c99.patch b/app-emulation/virtualbox-guest-additions/files/vboxguest-4.1.0-log-use-c99.patch
new file mode 100644
index 000000000000..f3a738fa15a1
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/files/vboxguest-4.1.0-log-use-c99.patch
@@ -0,0 +1,13 @@
+# https://bugs.gentoo.org/298988
+
+--- vboxguest/Makefile
++++ vboxguest/Makefile
+@@ -104,7 +104,7 @@
+
+ MOD_DEFS = -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST \
+ -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST \
+- -DVBOX_WITH_HGCM
++ -DVBOX_WITH_HGCM -DLOG_USE_C99
+ ifeq ($(BUILD_TARGET_ARCH),amd64)
+ MOD_DEFS += -DRT_ARCH_AMD64
+ else
diff --git a/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3-localconfig b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3-localconfig
new file mode 100644
index 000000000000..aeea54d699e6
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3-localconfig
@@ -0,0 +1,30 @@
+# -*- Makefile -*-
+#
+# Overwrite some default kBuild settings
+#
+
+#
+# Copyright (C) 2006-2008 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License as published by the Free Software Foundation,
+# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
+# distribution. VirtualBox OSE is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+# don't build testcases to save time, they are not needed for the package
+VBOX_WITH_TESTCASES :=
+VBOX_WITH_TESTSUITE :=
+
+KBUILD_MSG_STYLE := brief
+
+## paths, origin, hardening
+VBOX_WITH_HARDENING := 2
+VBOX_WITH_ORIGIN :=
+VBOX_ONLY_ADDITIONS := 1
+
+## don't build with -Werror
+VBOX_WITH_WARNINGS_AS_ERRORS :=
diff --git a/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-5-localconfig b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-5-localconfig
new file mode 100644
index 000000000000..f04dab4ddfb0
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-5-localconfig
@@ -0,0 +1,30 @@
+# -*- Makefile -*-
+#
+# Overwrite some default kBuild settings
+#
+
+#
+# Copyright (C) 2006-2008 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License as published by the Free Software Foundation,
+# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
+# distribution. VirtualBox OSE is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+# don't build testcases to save time, they are not needed for the package
+VBOX_WITH_TESTCASES :=
+VBOX_WITH_VALIDATIONKIT :=
+
+KBUILD_MSG_STYLE := brief
+
+## paths, origin, hardening
+VBOX_WITH_HARDENING := 2
+VBOX_WITH_ORIGIN :=
+VBOX_ONLY_ADDITIONS := 1
+
+## don't build with -Werror
+VBOX_WITH_WARNINGS_AS_ERRORS :=
diff --git a/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-8.initd b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-8.initd
new file mode 100644
index 000000000000..6da4697392fb
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-8.initd
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile="/var/run/vboxguest-service.pid"
+command="/usr/sbin/vboxguest-service"
+command_args="--foreground"
+start_stop_daemon_args="--make-pidfile --pidfile ${pidfile} --background"
+
+depend() {
+ need dbus localmount
+ before xdm
+}
+
+start_pre() {
+ einfo "Loading kernel modules"
+ /sbin/modprobe vboxguest 2>&1
+ /sbin/modprobe vboxsf 2>&1
+}
+
+stop_post() {
+ einfo "Removing kernel modules"
+ /sbin/modprobe -r vboxsf 2>&1
+ /sbin/modprobe -r vboxguest 2>&1
+}
diff --git a/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions.service b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions.service
new file mode 100644
index 000000000000..35f9ce24b80c
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=VirtualBox Guest Additions
+ConditionVirtualization=oracle
+Before=display-manager.service
+
+[Service]
+Type=simple
+ExecStartPre=/sbin/modprobe vboxguest
+ExecStartPre=/sbin/modprobe vboxsf
+ExecStart=/usr/sbin/vboxguest-service --foreground
+ExecStopPost=/sbin/modprobe -r vboxsf
+ExecStopPost=/sbin/modprobe -r vboxguest
+PIDFile=/var/run/vboxguest-service.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-emulation/virtualbox-guest-additions/files/xorg.conf.vbox b/app-emulation/virtualbox-guest-additions/files/xorg.conf.vbox
new file mode 100644
index 000000000000..a8624694e271
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/files/xorg.conf.vbox
@@ -0,0 +1,13 @@
+Section "Device"
+ Identifier "Device-vboxvideo"
+ Driver "vboxvideo"
+EndSection
+Section "Screen"
+ Identifier "Screen-vboxvideo"
+ Device "Device-vboxvideo"
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Screen-vboxvideo"
+EndSection
diff --git a/app-emulation/virtualbox-guest-additions/metadata.xml b/app-emulation/virtualbox-guest-additions/metadata.xml
new file mode 100644
index 000000000000..e71fc2f6ed3d
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.3.28.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.3.28.ebuild
new file mode 100644
index 000000000000..529792d3a551
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.3.28.ebuild
@@ -0,0 +1,221 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-mod systemd user toolchain-funcs
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="X"
+
+RDEPEND="X? ( ~x11-drivers/xf86-video-virtualbox-${PV}
+ x11-apps/xrandr
+ x11-apps/xrefresh
+ x11-libs/libXmu
+ x11-libs/libX11
+ x11-libs/libXt
+ x11-libs/libXext
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-proto/glproto )
+ sys-apps/dbus
+ !!x11-drivers/xf86-input-virtualbox"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ >=dev-lang/yasm-0.6.2
+ sys-devel/bin86
+ sys-libs/pam
+ sys-power/iasl
+ X? ( x11-proto/renderproto )
+ !X? ( x11-proto/xproto )"
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxguest(misc:${WORKDIR}/vboxguest:${WORKDIR}/vboxguest)
+ vboxsf(misc:${WORKDIR}/vboxsf:${WORKDIR}/vboxsf)"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERN_DIR=${KV_OUT_DIR} KERNOUT=${KV_OUT_DIR}"
+ enewgroup vboxguest
+ enewuser vboxguest -1 /bin/sh /dev/null vboxguest
+ # automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
+ enewgroup vboxsf
+}
+
+src_unpack() {
+ unpack ${A}
+
+ # Create and unpack a tarball with the sources of the Linux guest
+ # kernel modules, to include all the needed files
+ "${S}"/src/VBox/Additions/linux/export_modules "${WORKDIR}/vbox-kmod.tar.gz"
+ unpack ./vbox-kmod.tar.gz
+
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ cd "${S}"
+ rm -rf kBuild/bin tools
+}
+
+src_prepare() {
+ # PaX fixes (see bug #298988)
+ pushd "${WORKDIR}" &>/dev/null || die
+ epatch "${FILESDIR}"/vboxguest-4.1.0-log-use-c99.patch
+ popd &>/dev/null || die
+
+ # Disable things unused or splitted into separate ebuilds
+ cp "${FILESDIR}/${PN}-3-localconfig" LocalConfig.kmk || die
+
+ # stupid new header references...
+ for vboxheader in {product,revision}-generated.h ; do
+ for mdir in vbox{guest,sf} ; do
+ ln -sf "${S}"/out/linux.${ARCH}/release/${vboxheader} \
+ "${WORKDIR}/${mdir}/${vboxheader}"
+ done
+ done
+}
+
+src_configure() {
+ # build the user-space tools, warnings are harmless
+ local cmd=(
+ ./configure
+ --nofatal
+ --disable-xpcom
+ --disable-sdl-ttf
+ --disable-pulse
+ --disable-alsa
+ --with-gcc="$(tc-getCC)"
+ --with-g++="$(tc-getCXX)"
+ --target-arch=${ARCH}
+ --with-linux="${KV_OUT_DIR}"
+ --build-headless
+ )
+ echo "${cmd[@]}"
+ "${cmd[@]}" || die "configure failed"
+ source ./env.sh
+ export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
+}
+
+src_compile() {
+ for each in /src/VBox/{Runtime,Additions/common} \
+ /src/VBox/Additions/linux/sharedfolders ; do
+ cd "${S}"${each} || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ KBUILD_VERBOSE=2
+ done
+
+ if use X; then
+ cd "${S}"/src/VBox/Additions/x11/VBoxClient || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ KBUILD_PATH="${S}/kBuild"
+ fi
+
+ # Now creating the kernel modules. We must do this _after_
+ # we compiled the user-space tools as we need two of the
+ # automatically generated header files. (>=3.2.0)
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+
+ cd "${S}"/out/linux.${ARCH}/release/bin/additions || die
+
+ insinto /sbin
+ newins mount.vboxsf mount.vboxsf
+ fperms 4755 /sbin/mount.vboxsf
+
+ newinitd "${FILESDIR}"/${PN}-8.initd ${PN}
+
+ insinto /usr/sbin/
+ newins VBoxService vboxguest-service
+ fperms 0755 /usr/sbin/vboxguest-service
+
+ insinto /usr/bin
+ doins VBoxControl
+ fperms 0755 /usr/bin/VBoxControl
+
+ # VBoxClient user service and xrandr wrapper
+ if use X ; then
+ doins VBoxClient
+ fperms 0755 /usr/bin/VBoxClient
+
+ pushd "${S}"/src/VBox/Additions/x11/Installer &>/dev/null \
+ || die
+ newins 98vboxadd-xclient VBoxClient-all
+ fperms 0755 /usr/bin/VBoxClient-all
+ popd &>/dev/null || die
+ fi
+
+ # udev rule for vboxdrv
+ local udev_rules_dir="/lib/udev/rules.d"
+ dodir ${udev_rules_dir}
+ echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
+ >> "${D}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
+ || die
+ echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
+ >> "${D}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
+ || die
+
+ # VBoxClient autostart file
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}"/vboxclient.desktop
+
+ # sample xorg.conf
+ insinto /usr/share/doc/${PF}
+ doins "${FILESDIR}"/xorg.conf.vbox
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ if ! use X ; then
+ elog "use flag X is off, enable it to install the"
+ elog "X Window System video driver."
+ fi
+ elog ""
+ elog "Please add users to the \"vboxguest\" group so they can"
+ elog "benefit from seamless mode, auto-resize and clipboard."
+ elog ""
+ elog "The vboxsf group has been added to make automount services work."
+ elog "These services are part of the shared folders support."
+ elog ""
+ elog "Please add:"
+ elog "/etc/init.d/${PN}"
+ elog "to the default runlevel in order to start"
+ elog "needed services."
+ elog "To use the VirtualBox X driver, use the following"
+ elog "file as your /etc/X11/xorg.conf:"
+ elog " /usr/share/doc/${PF}/xorg.conf.vbox"
+ elog ""
+ elog "Also make sure you use the Mesa library for OpenGL:"
+ elog " eselect opengl set xorg-x11"
+ elog ""
+ elog "An autostart .desktop file has been installed to start"
+ elog "VBoxClient in desktop sessions."
+ elog ""
+ elog "You can mount shared folders with:"
+ elog " mount -t vboxsf <shared_folder_name> <mount_point>"
+ elog ""
+ elog "Warning:"
+ elog "this ebuild is only needed if you are running gentoo"
+ elog "inside a VirtualBox Virtual Machine, you don't need"
+ elog "it to run VirtualBox itself."
+ elog ""
+}
diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.3.30.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.3.30.ebuild
new file mode 100644
index 000000000000..9f52986657ca
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-4.3.30.ebuild
@@ -0,0 +1,221 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-mod systemd user toolchain-funcs
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X"
+
+RDEPEND="X? ( ~x11-drivers/xf86-video-virtualbox-${PV}
+ x11-apps/xrandr
+ x11-apps/xrefresh
+ x11-libs/libXmu
+ x11-libs/libX11
+ x11-libs/libXt
+ x11-libs/libXext
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-proto/glproto )
+ sys-apps/dbus
+ !!x11-drivers/xf86-input-virtualbox"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ >=dev-lang/yasm-0.6.2
+ sys-devel/bin86
+ sys-libs/pam
+ sys-power/iasl
+ X? ( x11-proto/renderproto )
+ !X? ( x11-proto/xproto )"
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxguest(misc:${WORKDIR}/vboxguest:${WORKDIR}/vboxguest)
+ vboxsf(misc:${WORKDIR}/vboxsf:${WORKDIR}/vboxsf)"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERN_DIR=${KV_OUT_DIR} KERNOUT=${KV_OUT_DIR}"
+ enewgroup vboxguest
+ enewuser vboxguest -1 /bin/sh /dev/null vboxguest
+ # automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
+ enewgroup vboxsf
+}
+
+src_unpack() {
+ unpack ${A}
+
+ # Create and unpack a tarball with the sources of the Linux guest
+ # kernel modules, to include all the needed files
+ "${S}"/src/VBox/Additions/linux/export_modules "${WORKDIR}/vbox-kmod.tar.gz"
+ unpack ./vbox-kmod.tar.gz
+
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ cd "${S}"
+ rm -rf kBuild/bin tools
+}
+
+src_prepare() {
+ # PaX fixes (see bug #298988)
+ pushd "${WORKDIR}" &>/dev/null || die
+ epatch "${FILESDIR}"/vboxguest-4.1.0-log-use-c99.patch
+ popd &>/dev/null || die
+
+ # Disable things unused or splitted into separate ebuilds
+ cp "${FILESDIR}/${PN}-3-localconfig" LocalConfig.kmk || die
+
+ # stupid new header references...
+ for vboxheader in {product,revision}-generated.h ; do
+ for mdir in vbox{guest,sf} ; do
+ ln -sf "${S}"/out/linux.${ARCH}/release/${vboxheader} \
+ "${WORKDIR}/${mdir}/${vboxheader}"
+ done
+ done
+}
+
+src_configure() {
+ # build the user-space tools, warnings are harmless
+ local cmd=(
+ ./configure
+ --nofatal
+ --disable-xpcom
+ --disable-sdl-ttf
+ --disable-pulse
+ --disable-alsa
+ --with-gcc="$(tc-getCC)"
+ --with-g++="$(tc-getCXX)"
+ --target-arch=${ARCH}
+ --with-linux="${KV_OUT_DIR}"
+ --build-headless
+ )
+ echo "${cmd[@]}"
+ "${cmd[@]}" || die "configure failed"
+ source ./env.sh
+ export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
+}
+
+src_compile() {
+ for each in /src/VBox/{Runtime,Additions/common} \
+ /src/VBox/Additions/linux/sharedfolders ; do
+ cd "${S}"${each} || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ KBUILD_VERBOSE=2
+ done
+
+ if use X; then
+ cd "${S}"/src/VBox/Additions/x11/VBoxClient || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ KBUILD_PATH="${S}/kBuild"
+ fi
+
+ # Now creating the kernel modules. We must do this _after_
+ # we compiled the user-space tools as we need two of the
+ # automatically generated header files. (>=3.2.0)
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+
+ cd "${S}"/out/linux.${ARCH}/release/bin/additions || die
+
+ insinto /sbin
+ newins mount.vboxsf mount.vboxsf
+ fperms 4755 /sbin/mount.vboxsf
+
+ newinitd "${FILESDIR}"/${PN}-8.initd ${PN}
+
+ insinto /usr/sbin/
+ newins VBoxService vboxguest-service
+ fperms 0755 /usr/sbin/vboxguest-service
+
+ insinto /usr/bin
+ doins VBoxControl
+ fperms 0755 /usr/bin/VBoxControl
+
+ # VBoxClient user service and xrandr wrapper
+ if use X ; then
+ doins VBoxClient
+ fperms 0755 /usr/bin/VBoxClient
+
+ pushd "${S}"/src/VBox/Additions/x11/Installer &>/dev/null \
+ || die
+ newins 98vboxadd-xclient VBoxClient-all
+ fperms 0755 /usr/bin/VBoxClient-all
+ popd &>/dev/null || die
+ fi
+
+ # udev rule for vboxdrv
+ local udev_rules_dir="/lib/udev/rules.d"
+ dodir ${udev_rules_dir}
+ echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
+ >> "${D}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
+ || die
+ echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
+ >> "${D}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
+ || die
+
+ # VBoxClient autostart file
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}"/vboxclient.desktop
+
+ # sample xorg.conf
+ insinto /usr/share/doc/${PF}
+ doins "${FILESDIR}"/xorg.conf.vbox
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ if ! use X ; then
+ elog "use flag X is off, enable it to install the"
+ elog "X Window System video driver."
+ fi
+ elog ""
+ elog "Please add users to the \"vboxguest\" group so they can"
+ elog "benefit from seamless mode, auto-resize and clipboard."
+ elog ""
+ elog "The vboxsf group has been added to make automount services work."
+ elog "These services are part of the shared folders support."
+ elog ""
+ elog "Please add:"
+ elog "/etc/init.d/${PN}"
+ elog "to the default runlevel in order to start"
+ elog "needed services."
+ elog "To use the VirtualBox X driver, use the following"
+ elog "file as your /etc/X11/xorg.conf:"
+ elog " /usr/share/doc/${PF}/xorg.conf.vbox"
+ elog ""
+ elog "Also make sure you use the Mesa library for OpenGL:"
+ elog " eselect opengl set xorg-x11"
+ elog ""
+ elog "An autostart .desktop file has been installed to start"
+ elog "VBoxClient in desktop sessions."
+ elog ""
+ elog "You can mount shared folders with:"
+ elog " mount -t vboxsf <shared_folder_name> <mount_point>"
+ elog ""
+ elog "Warning:"
+ elog "this ebuild is only needed if you are running gentoo"
+ elog "inside a VirtualBox Virtual Machine, you don't need"
+ elog "it to run VirtualBox itself."
+ elog ""
+}
diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.0.0.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.0.0.ebuild
new file mode 100644
index 000000000000..45157583e899
--- /dev/null
+++ b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.0.0.ebuild
@@ -0,0 +1,221 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-mod systemd user toolchain-funcs
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X"
+
+RDEPEND="X? ( ~x11-drivers/xf86-video-virtualbox-${PV}
+ x11-apps/xrandr
+ x11-apps/xrefresh
+ x11-libs/libXmu
+ x11-libs/libX11
+ x11-libs/libXt
+ x11-libs/libXext
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-proto/glproto )
+ sys-apps/dbus
+ !!x11-drivers/xf86-input-virtualbox"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ >=dev-lang/yasm-0.6.2
+ sys-devel/bin86
+ sys-libs/pam
+ sys-power/iasl
+ X? ( x11-proto/renderproto )
+ !X? ( x11-proto/xproto )"
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxguest(misc:${WORKDIR}/vboxguest:${WORKDIR}/vboxguest)
+ vboxsf(misc:${WORKDIR}/vboxsf:${WORKDIR}/vboxsf)"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERN_DIR=${KV_OUT_DIR} KERNOUT=${KV_OUT_DIR}"
+ enewgroup vboxguest
+ enewuser vboxguest -1 /bin/sh /dev/null vboxguest
+ # automount Error: VBoxServiceAutoMountWorker: Group "vboxsf" does not exist
+ enewgroup vboxsf
+}
+
+src_unpack() {
+ unpack ${A}
+
+ # Create and unpack a tarball with the sources of the Linux guest
+ # kernel modules, to include all the needed files
+ "${S}"/src/VBox/Additions/linux/export_modules "${WORKDIR}/vbox-kmod.tar.gz"
+ unpack ./vbox-kmod.tar.gz
+
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ cd "${S}"
+ rm -rf kBuild/bin tools
+}
+
+src_prepare() {
+ # PaX fixes (see bug #298988)
+ pushd "${WORKDIR}" &>/dev/null || die
+ epatch "${FILESDIR}"/vboxguest-4.1.0-log-use-c99.patch
+ popd &>/dev/null || die
+
+ # Disable things unused or splitted into separate ebuilds
+ cp "${FILESDIR}/${PN}-5-localconfig" LocalConfig.kmk || die
+
+ # stupid new header references...
+ for vboxheader in {product,revision}-generated.h ; do
+ for mdir in vbox{guest,sf} ; do
+ ln -sf "${S}"/out/linux.${ARCH}/release/${vboxheader} \
+ "${WORKDIR}/${mdir}/${vboxheader}"
+ done
+ done
+}
+
+src_configure() {
+ # build the user-space tools, warnings are harmless
+ local cmd=(
+ ./configure
+ --nofatal
+ --disable-xpcom
+ --disable-sdl-ttf
+ --disable-pulse
+ --disable-alsa
+ --with-gcc="$(tc-getCC)"
+ --with-g++="$(tc-getCXX)"
+ --target-arch=${ARCH}
+ --with-linux="${KV_OUT_DIR}"
+ --build-headless
+ )
+ echo "${cmd[@]}"
+ "${cmd[@]}" || die "configure failed"
+ source ./env.sh
+ export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
+}
+
+src_compile() {
+ for each in /src/VBox/{Runtime,Additions/common} \
+ /src/VBox/Additions/linux/sharedfolders ; do
+ cd "${S}"${each} || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ KBUILD_VERBOSE=2
+ done
+
+ if use X; then
+ cd "${S}"/src/VBox/Additions/x11/VBoxClient || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ KBUILD_PATH="${S}/kBuild"
+ fi
+
+ # Now creating the kernel modules. We must do this _after_
+ # we compiled the user-space tools as we need two of the
+ # automatically generated header files. (>=3.2.0)
+ linux-mod_src_compile
+}
+
+src_install() {
+ linux-mod_src_install
+
+ cd "${S}"/out/linux.${ARCH}/release/bin/additions || die
+
+ insinto /sbin
+ newins mount.vboxsf mount.vboxsf
+ fperms 4755 /sbin/mount.vboxsf
+
+ newinitd "${FILESDIR}"/${PN}-8.initd ${PN}
+
+ insinto /usr/sbin/
+ newins VBoxService vboxguest-service
+ fperms 0755 /usr/sbin/vboxguest-service
+
+ insinto /usr/bin
+ doins VBoxControl
+ fperms 0755 /usr/bin/VBoxControl
+
+ # VBoxClient user service and xrandr wrapper
+ if use X ; then
+ doins VBoxClient
+ fperms 0755 /usr/bin/VBoxClient
+
+ pushd "${S}"/src/VBox/Additions/x11/Installer &>/dev/null \
+ || die
+ newins 98vboxadd-xclient VBoxClient-all
+ fperms 0755 /usr/bin/VBoxClient-all
+ popd &>/dev/null || die
+ fi
+
+ # udev rule for vboxdrv
+ local udev_rules_dir="/lib/udev/rules.d"
+ dodir ${udev_rules_dir}
+ echo 'KERNEL=="vboxguest", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
+ >> "${D}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
+ || die
+ echo 'KERNEL=="vboxuser", OWNER="vboxguest", GROUP="vboxguest", MODE="0660"' \
+ >> "${D}/${udev_rules_dir}/60-virtualbox-guest-additions.rules" \
+ || die
+
+ # VBoxClient autostart file
+ insinto /etc/xdg/autostart
+ doins "${FILESDIR}"/vboxclient.desktop
+
+ # sample xorg.conf
+ insinto /usr/share/doc/${PF}
+ doins "${FILESDIR}"/xorg.conf.vbox
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ if ! use X ; then
+ elog "use flag X is off, enable it to install the"
+ elog "X Window System video driver."
+ fi
+ elog ""
+ elog "Please add users to the \"vboxguest\" group so they can"
+ elog "benefit from seamless mode, auto-resize and clipboard."
+ elog ""
+ elog "The vboxsf group has been added to make automount services work."
+ elog "These services are part of the shared folders support."
+ elog ""
+ elog "Please add:"
+ elog "/etc/init.d/${PN}"
+ elog "to the default runlevel in order to start"
+ elog "needed services."
+ elog "To use the VirtualBox X driver, use the following"
+ elog "file as your /etc/X11/xorg.conf:"
+ elog " /usr/share/doc/${PF}/xorg.conf.vbox"
+ elog ""
+ elog "Also make sure you use the Mesa library for OpenGL:"
+ elog " eselect opengl set xorg-x11"
+ elog ""
+ elog "An autostart .desktop file has been installed to start"
+ elog "VBoxClient in desktop sessions."
+ elog ""
+ elog "You can mount shared folders with:"
+ elog " mount -t vboxsf <shared_folder_name> <mount_point>"
+ elog ""
+ elog "Warning:"
+ elog "this ebuild is only needed if you are running gentoo"
+ elog "inside a VirtualBox Virtual Machine, you don't need"
+ elog "it to run VirtualBox itself."
+ elog ""
+}
diff --git a/app-emulation/virtualbox-modules/Manifest b/app-emulation/virtualbox-modules/Manifest
new file mode 100644
index 000000000000..49339c606d6d
--- /dev/null
+++ b/app-emulation/virtualbox-modules/Manifest
@@ -0,0 +1,3 @@
+DIST vbox-kernel-module-src-4.3.28.tar.xz 539876 SHA256 fb052997ec4992b0ee102475051b5d7bd8485e17405c6b3dcc94e1fa4a53b761 SHA512 637149f8595cb023e75116f83237bb4cef1b05627f58d475fa952ac86a85aa3cbab5f0cec723d730979f831999c920f35248e5f8db8f6987fb4c15c4a29bd517 WHIRLPOOL ab1ed07ee148a1ef352c0fda3f09865405be4146b987a5dffcb753d7512a00aa88c2ba1f7184b56d694c88320b350c6ececd3bec5636dd1586fc14a6be8a874d
+DIST vbox-kernel-module-src-4.3.30.tar.xz 540712 SHA256 28d89c06a4db190ec690980d68552745fb87ee2e23a3fe53edb29edda889f9d8 SHA512 8536d4bd105edf0fc112488232f7c85d8606b28b6cbeb28ee56bc135f693d1059328e75023299a67033bc1d486aea6a81c0fb23d51af500968119aa2f05156dc WHIRLPOOL 17452456aa127ca4ba53b2883f43970980f26094b80feaaa49b4773c386834d59f67afe21649539edc6dabde8725fd49c968002df9f2eb0e1ea8e888a2f8089b
+DIST vbox-kernel-module-src-5.0.0.tar.xz 585784 SHA256 53a2caf079ebb91cabd1542c8cd977a95cbe73ffe2e1da51457bbecfcb9ad734 SHA512 612bfe3cffa46b949c59a5126f2a80e54a2d4a11b565a2b5d8aa562623e21af02234b6c8ff6ee32980bf4d7608020d05d4d2f695efec88f759b4fc85142abf7c WHIRLPOOL 94b86d5d78d247e4130701c4a3b9c30f5d0fb7ad3df385a919c39a917cd115ab80eb806d55ae4397e542f43ac4bb64a6de62073db473e08efc0980692f278ce1
diff --git a/app-emulation/virtualbox-modules/files/create_vbox_modules_tarball.sh b/app-emulation/virtualbox-modules/files/create_vbox_modules_tarball.sh
new file mode 100755
index 000000000000..756d243542bc
--- /dev/null
+++ b/app-emulation/virtualbox-modules/files/create_vbox_modules_tarball.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Create a virtualbox modules tarball from a VirtualBox binary package.
+# We cannot download the package by this script because of the unpredictable
+# build number being in the filename.
+#
+# usage: create_vbox_modules_tarball.sh VirtualBox-4.1.18-78361-Linux_amd64.run
+
+[ -f "$1" ] || exit 1
+
+VBOX_PACKAGE="$1"
+VERSION_SUFFIX=""
+
+if [[ ${VBOX_PACKAGE} = *_BETA* ]] || [[ ${VBOX_PACKAGE} = *_RC* ]] ; then
+ VERSION_SUFFIX="$(echo ${VBOX_PACKAGE} | sed 's@.*VirtualBox-[[:digit:]\.]\+\(_[[:alpha:]]\+[[:digit:]]\).*@\L\1@')"
+
+fi
+
+VBOX_VER="$(echo ${VBOX_PACKAGE} | sed 's@.*VirtualBox-\([[:digit:]\.]\+\).*@\1@')${VERSION_SUFFIX}"
+
+
+sh ${VBOX_PACKAGE} --noexec --keep --nox11 || exit 2
+cd install || exit 3
+tar -xaf VirtualBox.tar.bz2 || exit 4
+cd src/vboxhost || exit 5
+tar -cvJf ../../../vbox-kernel-module-src-${VBOX_VER}.tar.xz . || exit 6
+cd ../../.. && rm install -rf
+
+exit 0
diff --git a/app-emulation/virtualbox-modules/files/virtualbox-modules-3.17.patch b/app-emulation/virtualbox-modules/files/virtualbox-modules-3.17.patch
new file mode 100644
index 000000000000..1d059c5af361
--- /dev/null
+++ b/app-emulation/virtualbox-modules/files/virtualbox-modules-3.17.patch
@@ -0,0 +1,49 @@
+diff -rupN work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c work.new/vboxdrv/r0drv/linux/alloc-r0drv-linux.c
+--- work/vboxdrv/r0drv/linux/alloc-r0drv-linux.c 2014-01-14 04:27:06.000000000 -0600
++++ work.new/vboxdrv/r0drv/linux/alloc-r0drv-linux.c 2014-09-03 11:12:28.247795756 -0500
+@@ -191,7 +191,7 @@ static PRTMEMHDR rtR0MemAllocExecVmArea(
+ struct page **papPagesIterator = papPages;
+ pVmArea->nr_pages = cPages;
+ pVmArea->pages = papPages;
+- if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC, &papPagesIterator))
++ if (!map_vm_area(pVmArea, PAGE_KERNEL_EXEC, papPagesIterator))
+ {
+ PRTMEMLNXHDREX pHdrEx = (PRTMEMLNXHDREX)pVmArea->addr;
+ pHdrEx->pVmArea = pVmArea;
+diff -rupN work/vboxnetadp/linux/VBoxNetAdp-linux.c work.new/vboxnetadp/linux/VBoxNetAdp-linux.c
+--- work/vboxnetadp/linux/VBoxNetAdp-linux.c 2013-10-09 06:02:09.000000000 -0500
++++ work.new/vboxnetadp/linux/VBoxNetAdp-linux.c 2014-09-03 11:13:55.999687819 -0500
+@@ -52,6 +52,25 @@
+
+ #define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface))
+
++/*******************************
++source for the 4th parameter alloc_netdev fix for kernel 3.17-rc1 is:
++https://github.com/proski/madwifi/commit/c5246021b7b8580c2aeb0a145903acc07d246ac1
++*/
++#ifndef NET_NAME_UNKNOWN
++#undef alloc_netdev
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
++#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
++ alloc_netdev(sizeof_priv, name, setup)
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
++#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
++ alloc_netdev_mq(sizeof_priv, name, setup, 1)
++#else
++#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
++ alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
++#endif
++#endif
++/*******************************/
++
+ /*******************************************************************************
+ * Internal Functions *
+ *******************************************************************************/
+@@ -183,6 +202,7 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis
+ /* No need for private data. */
+ pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV),
+ pThis->szName[0] ? pThis->szName : VBOXNETADP_LINUX_NAME,
++ NET_NAME_UNKNOWN,
+ vboxNetAdpNetDevInit);
+ if (pNetDev)
+ {
diff --git a/app-emulation/virtualbox-modules/files/virtualbox-modules-4.1.4-pax-const.patch b/app-emulation/virtualbox-modules/files/virtualbox-modules-4.1.4-pax-const.patch
new file mode 100644
index 000000000000..4e4cde06c784
--- /dev/null
+++ b/app-emulation/virtualbox-modules/files/virtualbox-modules-4.1.4-pax-const.patch
@@ -0,0 +1,48 @@
+diff -urp vboxdrv.orig/SUPDrvIDC.h vboxdrv/SUPDrvIDC.h
+--- vboxdrv.orig/SUPDrvIDC.h 2011-09-06 15:53:27.852567531 +0200
++++ vboxdrv/SUPDrvIDC.h 2011-09-06 15:54:05.420565524 +0200
+@@ -160,7 +160,7 @@ typedef struct SUPDRVIDCREQGETSYM
+ {
+ /** The symbol address. */
+ PFNRT pfnSymbol;
+- } Out;
++ } __no_const Out;
+ } u;
+ } SUPDRVIDCREQGETSYM;
+ /** Pointer to a SUPDRV IDC get symbol request. */
+diff -urp vboxnetflt.orig/include/VBox/intnet.h vboxnetflt/include/VBox/intnet.h
+--- vboxnetflt.orig/include/VBox/intnet.h 2011-09-06 15:53:27.852567531 +0200
++++ vboxnetflt/include/VBox/intnet.h 2011-09-06 15:54:05.424565524 +0200
+@@ -783,7 +783,7 @@ typedef struct INTNETTRUNKFACTORY
+ DECLR0CALLBACKMEMBER(int, pfnCreateAndConnect,(struct INTNETTRUNKFACTORY *pIfFactory, const char *pszName,
+ PINTNETTRUNKSWPORT pSwitchPort, uint32_t fFlags,
+ PINTNETTRUNKIFPORT *ppIfPort));
+-} INTNETTRUNKFACTORY;
++} __no_const INTNETTRUNKFACTORY;
+ /** Pointer to the trunk factory. */
+ typedef INTNETTRUNKFACTORY *PINTNETTRUNKFACTORY;
+
+diff -urp vboxnetflt.orig/linux/VBoxNetFlt-linux.c vboxnetflt/linux/VBoxNetFlt-linux.c
+--- vboxnetflt.orig/linux/VBoxNetFlt-linux.c 2011-07-19 12:15:22.000000000 +0200
++++ vboxnetflt/linux/VBoxNetFlt-linux.c 2011-09-06 15:56:00.516559379 +0200
+@@ -840,7 +840,7 @@ typedef struct ethtool_ops OVR_OPSTYPE;
+
+ # else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
+
+-typedef struct net_device_ops OVR_OPSTYPE;
++typedef net_device_ops_no_const OVR_OPSTYPE;
+ # define OVR_OPS netdev_ops
+ # define OVR_XMIT pOrgOps->ndo_start_xmit
+
+diff -urp vboxpci.orig/include/VBox/rawpci.h vboxpci/include/VBox/rawpci.h
+--- vboxpci.orig/include/VBox/rawpci.h 2011-04-18 17:01:12.000000000 +0200
++++ vboxpci/include/VBox/rawpci.h 2011-09-06 15:57:17.340555277 +0200
+@@ -545,7 +545,7 @@ typedef struct RAWPCIFACTORY
+ DECLR0CALLBACKMEMBER(void, pfnDeinitVm,(PRAWPCIFACTORY pFactory,
+ PVM pVM,
+ PRAWPCIPERVM pPciData));
+-} RAWPCIFACTORY;
++} __no_const RAWPCIFACTORY;
+
+ #define RAWPCIFACTORY_UUID_STR "ea089839-4171-476f-adfb-9e7ab1cbd0fb"
+
diff --git a/app-emulation/virtualbox-modules/files/virtualbox.conf b/app-emulation/virtualbox-modules/files/virtualbox.conf
new file mode 100644
index 000000000000..6e882a17cb08
--- /dev/null
+++ b/app-emulation/virtualbox-modules/files/virtualbox.conf
@@ -0,0 +1,3 @@
+vboxnetflt
+vboxnetadp
+vboxdrv
diff --git a/app-emulation/virtualbox-modules/metadata.xml b/app-emulation/virtualbox-modules/metadata.xml
new file mode 100644
index 000000000000..7401e9b14556
--- /dev/null
+++ b/app-emulation/virtualbox-modules/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+<use>
+ <flag name="pax_kernel">Apply patch needed for pax enabled kernels</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-4.3.28.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-4.3.28.ebuild
new file mode 100644
index 000000000000..40c753f5ad3a
--- /dev/null
+++ b/app-emulation/virtualbox-modules/virtualbox-modules-4.3.28.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# XXX: the tarball here is just the kernel modules split out of the binary
+# package that comes from virtualbox-bin
+
+EAPI=5
+
+inherit eutils linux-mod user
+
+MY_P=vbox-kernel-module-src-${PV}
+DESCRIPTION="Kernel Modules for Virtualbox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="pax_kernel"
+
+RDEPEND="!=app-emulation/virtualbox-9999"
+
+S=${WORKDIR}
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S}) vboxpci(misc:${S})"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="KERN_DIR=${KV_DIR} O=${KV_OUT_DIR}"
+ enewgroup vboxusers
+}
+
+src_prepare() {
+ if kernel_is -ge 2 6 33 ; then
+ # evil patch for new kernels - header moved
+ grep -lR linux/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:'
+ fi
+
+ if use pax_kernel && kernel_is -ge 3 0 0 ; then
+ epatch "${FILESDIR}"/${PN}-4.1.4-pax-const.patch
+ fi
+}
+
+src_install() {
+ linux-mod_src_install
+ insinto /usr/lib/modules-load.d/
+ doins "${FILESDIR}"/virtualbox.conf
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ elog "If you are using sys-apps/openrc, please add \"vboxdrv\", \"vboxnetflt\""
+ elog "and \"vboxnetadp\" to:"
+ elog " /etc/conf.d/modules"
+}
diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-4.3.30.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-4.3.30.ebuild
new file mode 100644
index 000000000000..e547f6fd527f
--- /dev/null
+++ b/app-emulation/virtualbox-modules/virtualbox-modules-4.3.30.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# XXX: the tarball here is just the kernel modules split out of the binary
+# package that comes from virtualbox-bin
+
+EAPI=5
+
+inherit eutils linux-mod user
+
+MY_P=vbox-kernel-module-src-${PV}
+DESCRIPTION="Kernel Modules for Virtualbox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="pax_kernel"
+
+RDEPEND="!=app-emulation/virtualbox-9999"
+
+S=${WORKDIR}
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S}) vboxpci(misc:${S})"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="KERN_DIR=${KV_DIR} O=${KV_OUT_DIR}"
+ enewgroup vboxusers
+}
+
+src_prepare() {
+ if kernel_is -ge 2 6 33 ; then
+ # evil patch for new kernels - header moved
+ grep -lR linux/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:'
+ fi
+
+ if use pax_kernel && kernel_is -ge 3 0 0 ; then
+ epatch "${FILESDIR}"/${PN}-4.1.4-pax-const.patch
+ fi
+}
+
+src_install() {
+ linux-mod_src_install
+ insinto /usr/lib/modules-load.d/
+ doins "${FILESDIR}"/virtualbox.conf
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ elog "If you are using sys-apps/openrc, please add \"vboxdrv\", \"vboxnetflt\""
+ elog "and \"vboxnetadp\" to:"
+ elog " /etc/conf.d/modules"
+}
diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-5.0.0.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-5.0.0.ebuild
new file mode 100644
index 000000000000..e7254088c70d
--- /dev/null
+++ b/app-emulation/virtualbox-modules/virtualbox-modules-5.0.0.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# XXX: the tarball here is just the kernel modules split out of the binary
+# package that comes from virtualbox-bin
+
+EAPI=5
+
+inherit eutils linux-mod user
+
+MY_P=vbox-kernel-module-src-${PV}
+DESCRIPTION="Kernel Modules for Virtualbox"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="pax_kernel"
+
+RDEPEND="!=app-emulation/virtualbox-9999"
+
+S=${WORKDIR}
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S}) vboxpci(misc:${S})"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="KERN_DIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}"
+ enewgroup vboxusers
+}
+
+src_prepare() {
+ if kernel_is -ge 2 6 33 ; then
+ # evil patch for new kernels - header moved
+ grep -lR linux/autoconf.h * | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:'
+ fi
+
+ if use pax_kernel && kernel_is -ge 3 0 0 ; then
+ epatch "${FILESDIR}"/${PN}-4.1.4-pax-const.patch
+ fi
+}
+
+src_install() {
+ linux-mod_src_install
+ insinto /usr/lib/modules-load.d/
+ doins "${FILESDIR}"/virtualbox.conf
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ elog "If you are using sys-apps/openrc, please add \"vboxdrv\", \"vboxnetflt\""
+ elog "and \"vboxnetadp\" to:"
+ elog " /etc/conf.d/modules"
+}
diff --git a/app-emulation/virtualbox/Manifest b/app-emulation/virtualbox/Manifest
new file mode 100644
index 000000000000..0d4964afdf29
--- /dev/null
+++ b/app-emulation/virtualbox/Manifest
@@ -0,0 +1,5 @@
+DIST VirtualBox-4.3.28.tar.bz2 100092002 SHA256 e157ab76d1958ae2c56b2a3875194fbff3de82486ad0e30032fd5bd772297c31 SHA512 b6e849a1420515b6dbda8cee0ab64940dd93296ec58cde76676ac257ff3dad0459aa1fd0bda7e1d0abc751d2d59f055465b198a546fdbb4e70e934a78654a8fc WHIRLPOOL 1b739f1f989032e07829a23ffadadd49e31109d70b0effbc44126a48a165218ff3ebafa576fa0e4f2af76a404033b60e5c9804ac43db5dd3024f1eca25ca70da
+DIST VirtualBox-4.3.30.tar.bz2 97428942 SHA256 ea9569ec16cd6202ee61bcadb2506d31ac12fd343adb91565773a05eaaea9a36 SHA512 d0817335cf4bd196da93b91ede6bc9e48ca0d471166ab2790dbf508a4574e4ace54a86053932abf3b4e804c583e80a713d2ab2e556dc15bee6ef3a62f88b95fc WHIRLPOOL 47cbd702e83cc737e04b5862cc6c52e32be244dc1dc0145f582f57b2f19bb898f0f4b200576a28f10a3290691f1ffd43c256e8c8eb5545a9723be8eefca88a38
+DIST VirtualBox-5.0.0.tar.bz2 109816664 SHA256 bb71356c8f82012c9b5ae16e12302eb111c71ae7b063ada7688fbfa8aa10c2f7 SHA512 c9557820fa04215b1b7905babfab340a01ad2cf733a18462fc608f8db5d0aa908e9ec0d92b3c77075e8a1322c10c92f58f8f14608aa3480052ca730ebd507636 WHIRLPOOL 7cda1523e0cd2851cbea5bb7a202963bac67cc6af29d0ec9a706dcec53746e50e6c85ccea014604eca9558ccaa45e9d2ce05b2eb64dbb54a7edac5f538634134
+DIST virtualbox-4.3.16-patches-01.tar.xz 4288 SHA256 270c4f01b2c13c4133987b3acc073dfbf78840212cf09f083dbf8fc80407ce6f SHA512 595f88c4b388b4807347c15c1750ec73aceba1c82ad993e9a05c7b78dfece7b679aff0338b3a48e2ccee7911fb5ed0dba803052332a270230078551f747052bc WHIRLPOOL 2157ee3fb9beed906cff28647c869e37d62551ad8c93801c0f0ec6893675f11786aa6d92acf11c348d30aa58b6e03a3faa879c664dddac6e5b8525035986c9ca
+DIST virtualbox-5.0.0_beta3-patches-01.tar.xz 4300 SHA256 6559d2f4c2004cd922d6cb21f668d962b824346cf6d9fa9f25519f2937920447 SHA512 62796002f7cdba59904235bcb79868040c39fbb6682a8ab456848029fc6b287dabfea4090c5f612c8396a0f759a0146dc43c71122cb6b4811becf4c8e4596e6d WHIRLPOOL 577107bd708a725604e872f3247521cd73501db94bb3ac637068b9c6d5978cacad689e6b6e8c277d591ee601854731a28a9b1054a21d4e0149ed2eb11d9d4e83
diff --git a/app-emulation/virtualbox/files/10-virtualbox.rules b/app-emulation/virtualbox/files/10-virtualbox.rules
new file mode 100644
index 000000000000..014c164a37f5
--- /dev/null
+++ b/app-emulation/virtualbox/files/10-virtualbox.rules
@@ -0,0 +1,7 @@
+# create second tree of USB devices according to
+# http://www.virtualbox.org/ticket/7759#comment:5
+
+SUBSYSTEM=="usb_device", ACTION!="remove", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
+SUBSYSTEM=="usb", ACTION!="remove", ENV{DEVTYPE}=="usb_device", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}"
+SUBSYSTEM=="usb_device", ACTION=="remove", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh --remove $major $minor"
+SUBSYSTEM=="usb", ACTION=="remove", ENV{DEVTYPE}=="usb_device", RUN="%UDEVDIR%/VBoxCreateUSBNode.sh --remove $major $minor"
diff --git a/app-emulation/virtualbox/files/vboxwebsrv-confd b/app-emulation/virtualbox/files/vboxwebsrv-confd
new file mode 100644
index 000000000000..447348e9ba62
--- /dev/null
+++ b/app-emulation/virtualbox/files/vboxwebsrv-confd
@@ -0,0 +1,20 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# The host to bind to (defaults to "localhost").
+VBOXWEBSRV_HOST="localhost"
+
+# Which port to on the host (defaults to 18083).
+VBOXWEBSRV_PORT="18083"
+
+# Session timeout, in seconds. (defaults to 20).
+VBOXWEBSRV_TIMEOUT=20
+
+# The interval in which the webservice checks for
+# timed-out clients, in seconds. Normally does not
+# need to be changed (defaults to 5).
+VBOXWEBSRV_INTERVAL=5
+
+# User under which vboxwebsrv is running
+VBOXWEBSRV_USER="root"
diff --git a/app-emulation/virtualbox/files/vboxwebsrv-initd b/app-emulation/virtualbox/files/vboxwebsrv-initd
new file mode 100644
index 000000000000..e736df06e731
--- /dev/null
+++ b/app-emulation/virtualbox/files/vboxwebsrv-initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ #checkconfig || return $?
+
+ ebegin "Starting VirtualBox WebService"
+ start-stop-daemon --start --quiet --user ${VBOXWEBSRV_USER} --pidfile /var/run/vboxwebsrv.pid \
+ --background --make-pidfile --exec /usr/bin/vboxwebsrv \
+ -- -H ${VBOXWEBSRV_HOST} -p ${VBOXWEBSRV_PORT} -t ${VBOXWEBSRV_TIMEOUT} -i ${VBOXWEBSRV_INTERVAL}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping VirtualBox WebService"
+ start-stop-daemon --stop --user ${VBOXWEBSRV_USER} --quiet --pidfile /var/run/vboxwebsrv.pid
+ eend $?
+}
diff --git a/app-emulation/virtualbox/files/virtualbox-4-config b/app-emulation/virtualbox/files/virtualbox-4-config
new file mode 100644
index 000000000000..af7822146560
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-4-config
@@ -0,0 +1 @@
+INSTALL_DIR=/usr/MY_LIBDIR/virtualbox
diff --git a/app-emulation/virtualbox/files/virtualbox-4-localconfig b/app-emulation/virtualbox/files/virtualbox-4-localconfig
new file mode 100644
index 000000000000..5138d9252698
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-4-localconfig
@@ -0,0 +1,45 @@
+# -*- Makefile -*-
+#
+# Overwrite some default kBuild settings
+#
+
+#
+# Copyright (C) 2006-2008 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License as published by the Free Software Foundation,
+# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
+# distribution. VirtualBox OSE is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+# shut up wine complaining about unknown locale
+EXEC_X86_WIN32 := wine
+
+# don't build testcases to save time, they are not needed for the package
+VBOX_WITH_TESTCASES :=
+VBOX_WITH_TESTSUITE :=
+VBOX_DOCBOOK_WITH_LATEX := 1
+
+KBUILD_MSG_STYLE := brief
+
+## paths, origin, hardening
+VBOX_WITH_HARDENING := 1
+VBOX_WITH_ORIGIN :=
+VBOX_PATH_APP_PRIVATE_ARCH := /usr/MY_LIBDIR/virtualbox
+VBOX_PATH_SHARED_LIBS := $(VBOX_PATH_APP_PRIVATE_ARCH)
+VBOX_WITH_RUNPATH := $(VBOX_PATH_APP_PRIVATE_ARCH)
+VBOX_PATH_APP_PRIVATE := /usr/share/virtualbox
+VBOX_PATH_APP_DOCS = $(VBOX_PATH_PACKAGE_DOCS)
+
+## don't build unwanted/splitted stuff
+VBOX_WITHOUT_ADDITIONS := 1
+VBOX_WITH_VBOXDRV :=
+VBOX_WITH_VBOXBFE :=
+VBOX_WITH_KCHMVIEWER :=
+
+## don't build with -Werror
+VBOX_WITH_WARNINGS_AS_ERRORS :=
+
diff --git a/app-emulation/virtualbox/files/virtualbox-5-localconfig b/app-emulation/virtualbox/files/virtualbox-5-localconfig
new file mode 100644
index 000000000000..efa8773cf567
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-5-localconfig
@@ -0,0 +1,45 @@
+# -*- Makefile -*-
+#
+# Overwrite some default kBuild settings
+#
+
+#
+# Copyright (C) 2006-2008 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License as published by the Free Software Foundation,
+# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
+# distribution. VirtualBox OSE is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+# shut up wine complaining about unknown locale
+EXEC_X86_WIN32 := wine
+
+# don't build testcases to save time, they are not needed for the package
+VBOX_WITH_TESTCASES :=
+VBOX_WITH_VALIDATIONKIT :=
+VBOX_DOCBOOK_WITH_LATEX := 1
+
+KBUILD_MSG_STYLE := brief
+
+## paths, origin, hardening
+VBOX_WITH_HARDENING := 1
+VBOX_WITH_ORIGIN :=
+VBOX_PATH_APP_PRIVATE_ARCH := /usr/MY_LIBDIR/virtualbox
+VBOX_PATH_SHARED_LIBS := $(VBOX_PATH_APP_PRIVATE_ARCH)
+VBOX_WITH_RUNPATH := $(VBOX_PATH_APP_PRIVATE_ARCH)
+VBOX_PATH_APP_PRIVATE := /usr/share/virtualbox
+VBOX_PATH_APP_DOCS = $(VBOX_PATH_PACKAGE_DOCS)
+
+## don't build unwanted/splitted stuff
+VBOX_WITHOUT_ADDITIONS := 1
+VBOX_WITH_VBOXDRV :=
+VBOX_WITH_VBOXBFE :=
+VBOX_WITH_KCHMVIEWER :=
+
+## don't build with -Werror
+VBOX_WITH_WARNINGS_AS_ERRORS :=
+
diff --git a/app-emulation/virtualbox/files/virtualbox-ose-3-config b/app-emulation/virtualbox/files/virtualbox-ose-3-config
new file mode 100644
index 000000000000..af7822146560
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-ose-3-config
@@ -0,0 +1 @@
+INSTALL_DIR=/usr/MY_LIBDIR/virtualbox
diff --git a/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper b/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper
new file mode 100755
index 000000000000..6f2da490065d
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper
@@ -0,0 +1,104 @@
+#!/bin/sh
+#
+# Sun VirtualBox
+#
+# Copyright (C) 2006-2009 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+# Clara, CA 95054 USA or visit http://www.sun.com if you need
+# additional information or have any questions.
+#
+
+PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+CONFIG="/etc/vbox/vbox.cfg"
+
+if [ ! -r "$CONFIG" ]; then
+ echo "Could not find VirtualBox installation. Please reinstall."
+ exit 1
+fi
+
+. "$CONFIG"
+
+# Note: This script must not fail if the module was not successfully installed
+# because the user might not want to run a VM but only change VM params!
+
+if [ "$1" = "shutdown" ]; then
+ SHUTDOWN="true"
+elif ! lsmod|grep -q vboxdrv; then
+ cat << EOF
+WARNING: The VirtualBox kernel modules are not loaded.
+ Please load all the needed kernel modules by:
+
+ for m in vbox{drv,netadp,netflt}; do modprobe \$m; done
+
+ You will not be able to start VMs until this problem is fixed.
+EOF
+elif [ ! -c /dev/vboxdrv ]; then
+ cat << EOF
+WARNING: The character device /dev/vboxdrv does not exist.
+ Please try to reload all the needed kernel modules by:
+
+ for m in vbox{netflt,netadp,drv}; do rmmod \$m; done
+ for m in vbox{drv,netadp,netflt}; do modprobe \$m; done
+
+ and if that is not successful, try to re-install the package by:
+
+ emerge -1av app-emulation/virtualbox-modules
+
+ You will not be able to start VMs until this problem is fixed.
+EOF
+fi
+
+SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'`
+if [ -z "$SERVER_PID" ]; then
+ # Server not running yet/anymore, cleanup socket path.
+ # See IPC_GetDefaultSocketPath()!
+ if [ -n "$LOGNAME" ]; then
+ rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1
+ else
+ rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1
+ fi
+fi
+
+if [ "$SHUTDOWN" = "true" ]; then
+ if [ -n "$SERVER_PID" ]; then
+ kill -TERM $SERVER_PID
+ sleep 2
+ fi
+ exit 0
+fi
+
+APP=`which $0`
+APP=`basename $APP`
+APP=${APP##/*/}
+case "$APP" in
+ VirtualBox)
+ exec "$INSTALL_DIR/VirtualBox" "$@"
+ ;;
+ VBoxManage)
+ exec "$INSTALL_DIR/VBoxManage" "$@"
+ ;;
+ VBoxSDL)
+ exec "$INSTALL_DIR/VBoxSDL" "$@"
+ ;;
+ VBoxVRDP)
+ exec "$INSTALL_DIR/VBoxHeadless" "$@"
+ ;;
+ VBoxHeadless)
+ exec "$INSTALL_DIR/VBoxHeadless" "$@"
+ ;;
+ vboxwebsrv)
+ exec "$INSTALL_DIR/vboxwebsrv" "$@"
+ ;;
+ *)
+ echo "Unknown application - $APP"
+ ;;
+esac
diff --git a/app-emulation/virtualbox/files/virtualbox-ose.desktop-2 b/app-emulation/virtualbox/files/virtualbox-ose.desktop-2
new file mode 100644
index 000000000000..ce798dacbdf3
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-ose.desktop-2
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=Oracle xVM VirtualBox
+Type=Application
+Comment=Run several virtual systems on a single host computer
+Exec=VirtualBox
+TryExec=VirtualBox
+Icon=virtualbox
+Categories=System;Emulator;
diff --git a/app-emulation/virtualbox/metadata.xml b/app-emulation/virtualbox/metadata.xml
new file mode 100644
index 000000000000..7150ec6cbf4d
--- /dev/null
+++ b/app-emulation/virtualbox/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+<use>
+ <flag name='additions'>Install Guest System Tools ISO</flag>
+ <flag name='extensions'>Install extension module packages</flag>
+ <flag name='headless'>Build without any graphic frontend</flag>
+ <flag name='sdk'>Enable building of SDK</flag>
+ <flag name='udev'>Controls installation of special USB udev rules.</flag>
+ <flag name='vboxwebsrv'>Build and install the VirtualBox webservice</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/virtualbox/virtualbox-4.3.28.ebuild b/app-emulation/virtualbox/virtualbox-4.3.28.ebuild
new file mode 100644
index 000000000000..2217ceef83ec
--- /dev/null
+++ b/app-emulation/virtualbox/virtualbox-4.3.28.ebuild
@@ -0,0 +1,419 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils fdo-mime flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 qt4-r2 toolchain-funcs udev
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-4.3.16-patches-01.tar.xz"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="+additions alsa doc extensions headless java pam pulseaudio +opengl python +qt4 +sdk +udev vboxwebsrv vnc"
+
+RDEPEND="!app-emulation/virtualbox-bin
+ ~app-emulation/virtualbox-modules-${PV}
+ dev-libs/libIDL
+ >=dev-libs/libxslt-1.1.19
+ net-misc/curl
+ dev-libs/openssl:0=
+ dev-libs/libxml2
+ media-libs/libpng:0=
+ media-libs/libvpx
+ sys-libs/zlib
+ !headless? (
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qtcore:4
+ opengl? ( dev-qt/qtopengl:4 )
+ x11-libs/libXinerama
+ )
+ opengl? ( virtual/opengl media-libs/freeglut )
+ x11-libs/libX11
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXmu
+ x11-libs/libXt
+ media-libs/libsdl:0[X,video]
+ )
+
+ java? ( || ( virtual/jre:1.7 virtual/jre:1.6 ) )
+ udev? ( >=virtual/udev-171 )
+ vnc? ( >=net-libs/libvncserver-0.9.9 )"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ >=dev-lang/yasm-0.6.2
+ sys-devel/bin86
+ sys-power/iasl
+ pam? ( sys-libs/pam )
+ sys-libs/libcap
+ doc? (
+ dev-texlive/texlive-basic
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexrecommended
+ dev-texlive/texlive-latexextra
+ dev-texlive/texlive-fontsrecommended
+ dev-texlive/texlive-fontsextra
+ )
+ java? ( || ( virtual/jdk:1.7 virtual/jdk:1.6 ) )
+ virtual/pkgconfig
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ !headless? ( x11-libs/libXinerama )
+ pulseaudio? ( media-sound/pulseaudio )
+ vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
+ ${PYTHON_DEPS}"
+PDEPEND="additions? ( ~app-emulation/virtualbox-additions-${PV} )
+ extensions? ( =app-emulation/virtualbox-extpack-oracle-${PV}* )"
+
+QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
+ usr/lib/virtualbox/VBoxSDL.so
+ usr/lib/virtualbox/VBoxSharedFolders.so
+ usr/lib/virtualbox/VBoxDD2.so
+ usr/lib/virtualbox/VBoxOGLrenderspu.so
+ usr/lib/virtualbox/VBoxPython.so
+ usr/lib/virtualbox/VBoxDD.so
+ usr/lib/virtualbox/VBoxDDU.so
+ usr/lib/virtualbox/VBoxREM64.so
+ usr/lib/virtualbox/VBoxSharedClipboard.so
+ usr/lib/virtualbox/VBoxHeadless.so
+ usr/lib/virtualbox/VBoxRT.so
+ usr/lib/virtualbox/VBoxREM.so
+ usr/lib/virtualbox/VBoxSettings.so
+ usr/lib/virtualbox/VBoxKeyboard.so
+ usr/lib/virtualbox/VBoxSharedCrOpenGL.so
+ usr/lib/virtualbox/VBoxVMM.so
+ usr/lib/virtualbox/VirtualBox.so
+ usr/lib/virtualbox/VBoxOGLhosterrorspu.so
+ usr/lib/virtualbox/components/VBoxC.so
+ usr/lib/virtualbox/components/VBoxSVCM.so
+ usr/lib/virtualbox/components/VBoxDDU.so
+ usr/lib/virtualbox/components/VBoxRT.so
+ usr/lib/virtualbox/components/VBoxREM.so
+ usr/lib/virtualbox/components/VBoxVMM.so
+ usr/lib/virtualbox/VBoxREM32.so
+ usr/lib/virtualbox/VBoxPython2_4.so
+ usr/lib/virtualbox/VBoxPython2_5.so
+ usr/lib/virtualbox/VBoxPython2_6.so
+ usr/lib/virtualbox/VBoxPython2_7.so
+ usr/lib/virtualbox/VBoxXPCOMC.so
+ usr/lib/virtualbox/VBoxOGLhostcrutil.so
+ usr/lib/virtualbox/VBoxNetDHCP.so
+ usr/lib/virtualbox/VBoxNetNAT.so"
+
+REQUIRED_USE="
+ java? ( sdk )
+ python? (
+ ( sdk )
+ )
+ vboxwebsrv? ( java )
+ ${PYTHON_REQUIRED_USE}
+"
+
+pkg_setup() {
+ if ! use headless && ! use qt4 ; then
+ einfo "No USE=\"qt4\" selected, this build will not include"
+ einfo "any Qt frontend."
+ elif use headless && use qt4 ; then
+ einfo "You selected USE=\"headless qt4\", defaulting to"
+ einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
+ fi
+
+ if ! use opengl ; then
+ einfo "No USE=\"opengl\" selected, this build will lack"
+ einfo "the OpenGL feature."
+ fi
+ if ! use python ; then
+ einfo "You have disabled the \"python\" USE flag. This will only"
+ einfo "disable the python bindings being installed."
+ fi
+ java-pkg-opt-2_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ rm -rf kBuild/bin tools
+
+ # Disable things unused or split into separate ebuilds
+ sed -e "s@MY_LIBDIR@$(get_libdir)@" \
+ "${FILESDIR}"/${PN}-4-localconfig > LocalConfig.kmk || die
+
+ # Respect LDFLAGS
+ sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
+ -i Config.kmk src/libs/xpcom18a4/Config.kmk || die
+
+ # Use PAM only when pam USE flag is enbaled (bug #376531)
+ if ! use pam ; then
+ elog "Disabling PAM removes the possibility to use the VRDP features."
+ sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
+ sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
+ src/VBox/HostServices/Makefile.kmk || die
+ fi
+
+ # add correct java path
+ if use java ; then
+ sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
+ -i "${S}"/Config.kmk || die
+ java-pkg-opt-2_src_prepare
+ fi
+
+ if ! gcc-specs-pie ; then
+ EPATCH_EXCLUDE="050_${PN}-4.3.14-nopie.patch"
+ fi
+
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/patches"
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf
+ use alsa || myconf+=" --disable-alsa"
+ use doc || myconf+=" --disable-docs"
+ use java || myconf+=" --disable-java"
+ use opengl || myconf+=" --disable-opengl"
+ use pulseaudio || myconf+=" --disable-pulse"
+ use python || myconf+=" --disable-python"
+ use vboxwebsrv && myconf+=" --enable-webservice"
+ use vnc && myconf+=" --enable-vnc"
+ if ! use headless ; then
+ use qt4 || myconf+=" --disable-qt4"
+ else
+ myconf+=" --build-headless --disable-opengl"
+ fi
+ if use amd64 && ! has_multilib_profile ; then
+ myconf+=" --disable-vmmraw"
+ fi
+ # not an autoconf script
+ ./configure \
+ --with-gcc="$(tc-getCC)" \
+ --with-g++="$(tc-getCXX)" \
+ --disable-kmods \
+ --disable-dbus \
+ --disable-devmapper \
+ ${myconf} \
+ || die "configure failed"
+}
+
+src_compile() {
+ source ./env.sh
+
+ # Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
+ # and strip all flags
+ # strip-flags
+
+ MAKEJOBS=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+')
+ MAKELOAD=$(echo ${MAKEOPTS} | egrep -o '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+')
+ MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
+ MAKE="kmk" emake \
+ VBOX_BUILD_PUBLISHER=_Gentoo \
+ TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \
+ TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \
+ TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \
+ TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \
+ VBOX_GCC_OPT="${CXXFLAGS}" \
+ TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
+ all
+}
+
+src_install() {
+ cd "${S}"/out/linux.${ARCH}/release/bin || die
+
+ # Create configuration files
+ insinto /etc/vbox
+ newins "${FILESDIR}/${PN}-4-config" vbox.cfg
+
+ # Set the right libdir
+ sed -i \
+ -e "s@MY_LIBDIR@$(get_libdir)@" \
+ "${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
+
+ # Symlink binaries to the shipped wrapper
+ exeinto /usr/$(get_libdir)/${PN}
+ newexe "${FILESDIR}/${PN}-ose-3-wrapper" "VBox"
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBox
+ fperms 0750 /usr/$(get_libdir)/${PN}/VBox
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxManage
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxVRDP
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxHeadless
+ dosym /usr/$(get_libdir)/${PN}/VBoxTunctl /usr/bin/VBoxTunctl
+
+ # Install binaries and libraries
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r components
+
+ if use sdk ; then
+ doins -r sdk
+ fi
+
+ if use vboxwebsrv ; then
+ doins vboxwebsrv
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/vboxwebsrv
+ fperms 0750 /usr/$(get_libdir)/${PN}/vboxwebsrv
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/vboxwebsrv
+ newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+ newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+ fi
+
+ local gcfiles="*gc"
+ if use amd64 && ! has_multilib_profile ; then
+ gcfiles=""
+ fi
+
+ for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,ExtPackHelperApp} *so *r0 ${gcfiles} ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 0750 /usr/$(get_libdir)/${PN}/${each}
+ done
+
+ # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+ for each in VBoxNet{AdpCtl,DHCP,NAT} ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+ done
+
+ # VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
+ # VBoxXPCOMIPCD (bug #524202)
+ for each in VBox{Manage,SVC,XPCOMIPCD} ; do
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each} || die
+ done
+
+ if ! use headless ; then
+ for each in VBox{SDL,Headless} ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each}
+ done
+
+ if use opengl && use qt4 ; then
+ doins VBoxTestOGL
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxTestOGL
+ fperms 0750 /usr/$(get_libdir)/${PN}/VBoxTestOGL
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxTestOGL
+ fi
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxSDL
+
+ if use qt4 ; then
+ doins VirtualBox
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VirtualBox
+ fperms 4750 /usr/$(get_libdir)/${PN}/VirtualBox
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VirtualBox \
+ || die
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VirtualBox
+
+ newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
+ fi
+
+ pushd "${S}"/src/VBox/Resources/OSE &>/dev/null || die
+ for size in 16 32 48 64 128 ; do
+ newicon -s ${size} ${PN}-${size}px.png ${PN}.png
+ done
+ newicon ${PN}-48px.png ${PN}.png
+ popd &>/dev/null || die
+ else
+ doins VBoxHeadless
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxHeadless
+ fperms 4750 /usr/$(get_libdir)/${PN}/VBoxHeadless
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxHeadless || die
+ fi
+
+ insinto /usr/$(get_libdir)/${PN}
+ # Install EFI Firmware files (bug #320757)
+ pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
+ for fwfile in VBoxEFI{32,64}.fd ; do
+ doins ${fwfile}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${fwfile}
+ done
+ popd &>/dev/null || die
+
+ if use udev ; then
+ # New way of handling USB device nodes for VBox (bug #356215)
+ local udevdir="$(get_udevdir)"
+ insinto ${udevdir}
+ doins VBoxCreateUSBNode.sh
+ fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
+ fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
+ insinto ${udevdir}/rules.d
+ doins "${FILESDIR}"/10-virtualbox.rules
+ sed "s@%UDEVDIR%@${udevdir}@" \
+ -i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
+ fi
+
+ insinto /usr/share/${PN}
+ if ! use headless && use qt4 ; then
+ doins -r nls
+ fi
+
+ # VRDPAuth only works with this (bug #351949)
+ dosym VBoxAuth.so /usr/$(get_libdir)/${PN}/VRDPAuth.so
+
+ # set an env-variable for 3rd party tools
+ echo -n "VBOX_APP_HOME=/usr/$(get_libdir)/${PN}" > "${T}/90virtualbox"
+ doenvd "${T}/90virtualbox"
+
+ if use java ; then
+ java-pkg_regjar "${D}/usr/$(get_libdir)/${PN}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
+ java-pkg_regso "${D}/usr/$(get_libdir)/${PN}/libvboxjxpcom.so"
+ fi
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ if use udev ; then
+ udevadm control --reload-rules \
+ && udevadm trigger --subsystem-match=usb
+ fi
+
+ if ! use headless && use qt4 ; then
+ elog "To launch VirtualBox just type: \"VirtualBox\"."
+ fi
+ elog "You must be in the vboxusers group to use VirtualBox."
+ elog ""
+ elog "The latest user manual is available for download at:"
+ elog "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
+ elog ""
+ elog "For advanced networking setups you should emerge:"
+ elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+ elog ""
+ elog "IMPORTANT!"
+ elog "If you upgrade from app-emulation/virtualbox-ose make sure to run"
+ elog "\"env-update\" as root and logout and relogin as the user you wish"
+ elog "to run ${PN} as."
+ elog ""
+ elog "Starting with version 4.0.0, ${PN} has USB-1 support."
+ elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
+ elog " app-emulation/virtualbox-extpack-oracle"
+ elog "package."
+ if ! use udev ; then
+ elog ""
+ elog "WARNING!"
+ elog "Without USE=udev, USB devices will likely not work in ${PN}."
+ elif [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
+ elog ""
+ elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
+ elog "or else USB in ${PN} won't work."
+ fi
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/virtualbox/virtualbox-4.3.30.ebuild b/app-emulation/virtualbox/virtualbox-4.3.30.ebuild
new file mode 100644
index 000000000000..dd7cb3c37f0b
--- /dev/null
+++ b/app-emulation/virtualbox/virtualbox-4.3.30.ebuild
@@ -0,0 +1,419 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils fdo-mime flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 qt4-r2 toolchain-funcs udev
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-4.3.16-patches-01.tar.xz"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+additions alsa doc extensions headless java pam pulseaudio +opengl python +qt4 +sdk +udev vboxwebsrv vnc"
+
+RDEPEND="!app-emulation/virtualbox-bin
+ ~app-emulation/virtualbox-modules-${PV}
+ dev-libs/libIDL
+ >=dev-libs/libxslt-1.1.19
+ net-misc/curl
+ dev-libs/openssl:0=
+ dev-libs/libxml2
+ media-libs/libpng:0=
+ media-libs/libvpx
+ sys-libs/zlib
+ !headless? (
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qtcore:4
+ opengl? ( dev-qt/qtopengl:4 )
+ x11-libs/libXinerama
+ )
+ opengl? ( virtual/opengl media-libs/freeglut )
+ x11-libs/libX11
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXmu
+ x11-libs/libXt
+ media-libs/libsdl:0[X,video]
+ )
+
+ java? ( || ( virtual/jre:1.7 virtual/jre:1.6 ) )
+ udev? ( >=virtual/udev-171 )
+ vnc? ( >=net-libs/libvncserver-0.9.9 )"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ >=dev-lang/yasm-0.6.2
+ sys-devel/bin86
+ sys-power/iasl
+ pam? ( sys-libs/pam )
+ sys-libs/libcap
+ doc? (
+ dev-texlive/texlive-basic
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexrecommended
+ dev-texlive/texlive-latexextra
+ dev-texlive/texlive-fontsrecommended
+ dev-texlive/texlive-fontsextra
+ )
+ java? ( || ( virtual/jdk:1.7 virtual/jdk:1.6 ) )
+ virtual/pkgconfig
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ !headless? ( x11-libs/libXinerama )
+ pulseaudio? ( media-sound/pulseaudio )
+ vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
+ ${PYTHON_DEPS}"
+PDEPEND="additions? ( ~app-emulation/virtualbox-additions-${PV} )
+ extensions? ( =app-emulation/virtualbox-extpack-oracle-${PV}* )"
+
+QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
+ usr/lib/virtualbox/VBoxSDL.so
+ usr/lib/virtualbox/VBoxSharedFolders.so
+ usr/lib/virtualbox/VBoxDD2.so
+ usr/lib/virtualbox/VBoxOGLrenderspu.so
+ usr/lib/virtualbox/VBoxPython.so
+ usr/lib/virtualbox/VBoxDD.so
+ usr/lib/virtualbox/VBoxDDU.so
+ usr/lib/virtualbox/VBoxREM64.so
+ usr/lib/virtualbox/VBoxSharedClipboard.so
+ usr/lib/virtualbox/VBoxHeadless.so
+ usr/lib/virtualbox/VBoxRT.so
+ usr/lib/virtualbox/VBoxREM.so
+ usr/lib/virtualbox/VBoxSettings.so
+ usr/lib/virtualbox/VBoxKeyboard.so
+ usr/lib/virtualbox/VBoxSharedCrOpenGL.so
+ usr/lib/virtualbox/VBoxVMM.so
+ usr/lib/virtualbox/VirtualBox.so
+ usr/lib/virtualbox/VBoxOGLhosterrorspu.so
+ usr/lib/virtualbox/components/VBoxC.so
+ usr/lib/virtualbox/components/VBoxSVCM.so
+ usr/lib/virtualbox/components/VBoxDDU.so
+ usr/lib/virtualbox/components/VBoxRT.so
+ usr/lib/virtualbox/components/VBoxREM.so
+ usr/lib/virtualbox/components/VBoxVMM.so
+ usr/lib/virtualbox/VBoxREM32.so
+ usr/lib/virtualbox/VBoxPython2_4.so
+ usr/lib/virtualbox/VBoxPython2_5.so
+ usr/lib/virtualbox/VBoxPython2_6.so
+ usr/lib/virtualbox/VBoxPython2_7.so
+ usr/lib/virtualbox/VBoxXPCOMC.so
+ usr/lib/virtualbox/VBoxOGLhostcrutil.so
+ usr/lib/virtualbox/VBoxNetDHCP.so
+ usr/lib/virtualbox/VBoxNetNAT.so"
+
+REQUIRED_USE="
+ java? ( sdk )
+ python? (
+ ( sdk )
+ )
+ vboxwebsrv? ( java )
+ ${PYTHON_REQUIRED_USE}
+"
+
+pkg_setup() {
+ if ! use headless && ! use qt4 ; then
+ einfo "No USE=\"qt4\" selected, this build will not include"
+ einfo "any Qt frontend."
+ elif use headless && use qt4 ; then
+ einfo "You selected USE=\"headless qt4\", defaulting to"
+ einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
+ fi
+
+ if ! use opengl ; then
+ einfo "No USE=\"opengl\" selected, this build will lack"
+ einfo "the OpenGL feature."
+ fi
+ if ! use python ; then
+ einfo "You have disabled the \"python\" USE flag. This will only"
+ einfo "disable the python bindings being installed."
+ fi
+ java-pkg-opt-2_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ rm -rf kBuild/bin tools
+
+ # Disable things unused or split into separate ebuilds
+ sed -e "s@MY_LIBDIR@$(get_libdir)@" \
+ "${FILESDIR}"/${PN}-4-localconfig > LocalConfig.kmk || die
+
+ # Respect LDFLAGS
+ sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
+ -i Config.kmk src/libs/xpcom18a4/Config.kmk || die
+
+ # Use PAM only when pam USE flag is enbaled (bug #376531)
+ if ! use pam ; then
+ elog "Disabling PAM removes the possibility to use the VRDP features."
+ sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
+ sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
+ src/VBox/HostServices/Makefile.kmk || die
+ fi
+
+ # add correct java path
+ if use java ; then
+ sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
+ -i "${S}"/Config.kmk || die
+ java-pkg-opt-2_src_prepare
+ fi
+
+ if ! gcc-specs-pie ; then
+ EPATCH_EXCLUDE="050_${PN}-4.3.14-nopie.patch"
+ fi
+
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/patches"
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf
+ use alsa || myconf+=" --disable-alsa"
+ use doc || myconf+=" --disable-docs"
+ use java || myconf+=" --disable-java"
+ use opengl || myconf+=" --disable-opengl"
+ use pulseaudio || myconf+=" --disable-pulse"
+ use python || myconf+=" --disable-python"
+ use vboxwebsrv && myconf+=" --enable-webservice"
+ use vnc && myconf+=" --enable-vnc"
+ if ! use headless ; then
+ use qt4 || myconf+=" --disable-qt4"
+ else
+ myconf+=" --build-headless --disable-opengl"
+ fi
+ if use amd64 && ! has_multilib_profile ; then
+ myconf+=" --disable-vmmraw"
+ fi
+ # not an autoconf script
+ ./configure \
+ --with-gcc="$(tc-getCC)" \
+ --with-g++="$(tc-getCXX)" \
+ --disable-kmods \
+ --disable-dbus \
+ --disable-devmapper \
+ ${myconf} \
+ || die "configure failed"
+}
+
+src_compile() {
+ source ./env.sh
+
+ # Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
+ # and strip all flags
+ # strip-flags
+
+ MAKEJOBS=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+')
+ MAKELOAD=$(echo ${MAKEOPTS} | egrep -o '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+')
+ MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
+ MAKE="kmk" emake \
+ VBOX_BUILD_PUBLISHER=_Gentoo \
+ TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \
+ TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \
+ TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \
+ TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \
+ VBOX_GCC_OPT="${CXXFLAGS}" \
+ TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
+ all
+}
+
+src_install() {
+ cd "${S}"/out/linux.${ARCH}/release/bin || die
+
+ # Create configuration files
+ insinto /etc/vbox
+ newins "${FILESDIR}/${PN}-4-config" vbox.cfg
+
+ # Set the right libdir
+ sed -i \
+ -e "s@MY_LIBDIR@$(get_libdir)@" \
+ "${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
+
+ # Symlink binaries to the shipped wrapper
+ exeinto /usr/$(get_libdir)/${PN}
+ newexe "${FILESDIR}/${PN}-ose-3-wrapper" "VBox"
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBox
+ fperms 0750 /usr/$(get_libdir)/${PN}/VBox
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxManage
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxVRDP
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxHeadless
+ dosym /usr/$(get_libdir)/${PN}/VBoxTunctl /usr/bin/VBoxTunctl
+
+ # Install binaries and libraries
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r components
+
+ if use sdk ; then
+ doins -r sdk
+ fi
+
+ if use vboxwebsrv ; then
+ doins vboxwebsrv
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/vboxwebsrv
+ fperms 0750 /usr/$(get_libdir)/${PN}/vboxwebsrv
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/vboxwebsrv
+ newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+ newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+ fi
+
+ local gcfiles="*gc"
+ if use amd64 && ! has_multilib_profile ; then
+ gcfiles=""
+ fi
+
+ for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,ExtPackHelperApp} *so *r0 ${gcfiles} ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 0750 /usr/$(get_libdir)/${PN}/${each}
+ done
+
+ # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+ for each in VBoxNet{AdpCtl,DHCP,NAT} ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+ done
+
+ # VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
+ # VBoxXPCOMIPCD (bug #524202)
+ for each in VBox{Manage,SVC,XPCOMIPCD} ; do
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each} || die
+ done
+
+ if ! use headless ; then
+ for each in VBox{SDL,Headless} ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each}
+ done
+
+ if use opengl && use qt4 ; then
+ doins VBoxTestOGL
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxTestOGL
+ fperms 0750 /usr/$(get_libdir)/${PN}/VBoxTestOGL
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxTestOGL
+ fi
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxSDL
+
+ if use qt4 ; then
+ doins VirtualBox
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VirtualBox
+ fperms 4750 /usr/$(get_libdir)/${PN}/VirtualBox
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VirtualBox \
+ || die
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VirtualBox
+
+ newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
+ fi
+
+ pushd "${S}"/src/VBox/Resources/OSE &>/dev/null || die
+ for size in 16 32 48 64 128 ; do
+ newicon -s ${size} ${PN}-${size}px.png ${PN}.png
+ done
+ newicon ${PN}-48px.png ${PN}.png
+ popd &>/dev/null || die
+ else
+ doins VBoxHeadless
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxHeadless
+ fperms 4750 /usr/$(get_libdir)/${PN}/VBoxHeadless
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxHeadless || die
+ fi
+
+ insinto /usr/$(get_libdir)/${PN}
+ # Install EFI Firmware files (bug #320757)
+ pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
+ for fwfile in VBoxEFI{32,64}.fd ; do
+ doins ${fwfile}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${fwfile}
+ done
+ popd &>/dev/null || die
+
+ if use udev ; then
+ # New way of handling USB device nodes for VBox (bug #356215)
+ local udevdir="$(get_udevdir)"
+ insinto ${udevdir}
+ doins VBoxCreateUSBNode.sh
+ fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
+ fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
+ insinto ${udevdir}/rules.d
+ doins "${FILESDIR}"/10-virtualbox.rules
+ sed "s@%UDEVDIR%@${udevdir}@" \
+ -i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
+ fi
+
+ insinto /usr/share/${PN}
+ if ! use headless && use qt4 ; then
+ doins -r nls
+ fi
+
+ # VRDPAuth only works with this (bug #351949)
+ dosym VBoxAuth.so /usr/$(get_libdir)/${PN}/VRDPAuth.so
+
+ # set an env-variable for 3rd party tools
+ echo -n "VBOX_APP_HOME=/usr/$(get_libdir)/${PN}" > "${T}/90virtualbox"
+ doenvd "${T}/90virtualbox"
+
+ if use java ; then
+ java-pkg_regjar "${D}/usr/$(get_libdir)/${PN}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
+ java-pkg_regso "${D}/usr/$(get_libdir)/${PN}/libvboxjxpcom.so"
+ fi
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ if use udev ; then
+ udevadm control --reload-rules \
+ && udevadm trigger --subsystem-match=usb
+ fi
+
+ if ! use headless && use qt4 ; then
+ elog "To launch VirtualBox just type: \"VirtualBox\"."
+ fi
+ elog "You must be in the vboxusers group to use VirtualBox."
+ elog ""
+ elog "The latest user manual is available for download at:"
+ elog "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
+ elog ""
+ elog "For advanced networking setups you should emerge:"
+ elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+ elog ""
+ elog "IMPORTANT!"
+ elog "If you upgrade from app-emulation/virtualbox-ose make sure to run"
+ elog "\"env-update\" as root and logout and relogin as the user you wish"
+ elog "to run ${PN} as."
+ elog ""
+ elog "Starting with version 4.0.0, ${PN} has USB-1 support."
+ elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
+ elog " app-emulation/virtualbox-extpack-oracle"
+ elog "package."
+ if ! use udev ; then
+ elog ""
+ elog "WARNING!"
+ elog "Without USE=udev, USB devices will likely not work in ${PN}."
+ elif [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
+ elog ""
+ elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
+ elog "or else USB in ${PN} won't work."
+ fi
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/virtualbox/virtualbox-5.0.0.ebuild b/app-emulation/virtualbox/virtualbox-5.0.0.ebuild
new file mode 100644
index 000000000000..c51c545010bd
--- /dev/null
+++ b/app-emulation/virtualbox/virtualbox-5.0.0.ebuild
@@ -0,0 +1,425 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils fdo-mime flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 qt4-r2 toolchain-funcs udev
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-5.0.0_beta3-patches-01.tar.xz"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa doc headless java pam pulseaudio +opengl python +qt4 +sdk +udev vboxwebsrv vnc"
+
+RDEPEND="!app-emulation/virtualbox-bin
+ ~app-emulation/virtualbox-modules-${PV}
+ dev-libs/libIDL
+ >=dev-libs/libxslt-1.1.19
+ net-misc/curl
+ dev-libs/openssl:0=
+ dev-libs/libxml2
+ media-libs/libpng:0=
+ media-libs/libvpx
+ sys-libs/zlib
+ !headless? (
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qtcore:4
+ opengl? ( dev-qt/qtopengl:4 )
+ x11-libs/libXinerama
+ )
+ opengl? ( virtual/opengl media-libs/freeglut )
+ x11-libs/libX11
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXmu
+ x11-libs/libXt
+ media-libs/libsdl:0[X,video]
+ )
+
+ java? ( || ( virtual/jre:1.7 virtual/jre:1.6 ) )
+ udev? ( >=virtual/udev-171 )
+ vnc? ( >=net-libs/libvncserver-0.9.9 )"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ >=dev-lang/yasm-0.6.2
+ sys-devel/bin86
+ sys-power/iasl
+ pam? ( sys-libs/pam )
+ sys-libs/libcap
+ doc? (
+ dev-texlive/texlive-basic
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexrecommended
+ dev-texlive/texlive-latexextra
+ dev-texlive/texlive-fontsrecommended
+ dev-texlive/texlive-fontsextra
+ )
+ java? ( || ( virtual/jdk:1.7 virtual/jdk:1.6 ) )
+ virtual/pkgconfig
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ !headless? ( x11-libs/libXinerama )
+ pulseaudio? ( media-sound/pulseaudio )
+ vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
+ ${PYTHON_DEPS}"
+
+QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
+ usr/lib/virtualbox/VBoxSDL.so
+ usr/lib/virtualbox/VBoxSharedFolders.so
+ usr/lib/virtualbox/VBoxDD2.so
+ usr/lib/virtualbox/VBoxOGLrenderspu.so
+ usr/lib/virtualbox/VBoxPython.so
+ usr/lib/virtualbox/VBoxDD.so
+ usr/lib/virtualbox/VBoxDDU.so
+ usr/lib/virtualbox/VBoxREM64.so
+ usr/lib/virtualbox/VBoxSharedClipboard.so
+ usr/lib/virtualbox/VBoxHeadless.so
+ usr/lib/virtualbox/VBoxRT.so
+ usr/lib/virtualbox/VBoxREM.so
+ usr/lib/virtualbox/VBoxSettings.so
+ usr/lib/virtualbox/VBoxKeyboard.so
+ usr/lib/virtualbox/VBoxSharedCrOpenGL.so
+ usr/lib/virtualbox/VBoxVMM.so
+ usr/lib/virtualbox/VirtualBox.so
+ usr/lib/virtualbox/VBoxOGLhosterrorspu.so
+ usr/lib/virtualbox/components/VBoxC.so
+ usr/lib/virtualbox/components/VBoxSVCM.so
+ usr/lib/virtualbox/components/VBoxDDU.so
+ usr/lib/virtualbox/components/VBoxRT.so
+ usr/lib/virtualbox/components/VBoxREM.so
+ usr/lib/virtualbox/components/VBoxVMM.so
+ usr/lib/virtualbox/VBoxREM32.so
+ usr/lib/virtualbox/VBoxPython2_4.so
+ usr/lib/virtualbox/VBoxPython2_5.so
+ usr/lib/virtualbox/VBoxPython2_6.so
+ usr/lib/virtualbox/VBoxPython2_7.so
+ usr/lib/virtualbox/VBoxXPCOMC.so
+ usr/lib/virtualbox/VBoxOGLhostcrutil.so
+ usr/lib/virtualbox/VBoxNetDHCP.so
+ usr/lib/virtualbox/VBoxNetNAT.so"
+
+REQUIRED_USE="
+ java? ( sdk )
+ python? (
+ ( sdk )
+ )
+ vboxwebsrv? ( java )
+ ${PYTHON_REQUIRED_USE}
+"
+
+pkg_setup() {
+ if ! use headless && ! use qt4 ; then
+ einfo "No USE=\"qt4\" selected, this build will not include"
+ einfo "any Qt frontend."
+ elif use headless && use qt4 ; then
+ einfo "You selected USE=\"headless qt4\", defaulting to"
+ einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
+ fi
+
+ if ! use opengl ; then
+ einfo "No USE=\"opengl\" selected, this build will lack"
+ einfo "the OpenGL feature."
+ fi
+ if ! use python ; then
+ einfo "You have disabled the \"python\" USE flag. This will only"
+ einfo "disable the python bindings being installed."
+ fi
+ java-pkg-opt-2_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ rm -rf kBuild/bin tools
+
+ # Disable things unused or split into separate ebuilds
+ sed -e "s@MY_LIBDIR@$(get_libdir)@" \
+ "${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
+
+ # Respect LDFLAGS
+ sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
+ -i Config.kmk src/libs/xpcom18a4/Config.kmk || die
+
+ # Use PAM only when pam USE flag is enbaled (bug #376531)
+ if ! use pam ; then
+ elog "Disabling PAM removes the possibility to use the VRDP features."
+ sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
+ sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
+ src/VBox/HostServices/Makefile.kmk || die
+ fi
+
+ # add correct java path
+ if use java ; then
+ sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
+ -i "${S}"/Config.kmk || die
+ java-pkg-opt-2_src_prepare
+ fi
+
+ if ! gcc-specs-pie ; then
+ EPATCH_EXCLUDE="050_${PN}-4.3.14-nopie.patch"
+ fi
+
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/patches"
+
+ #epatch "${FILESDIR}/${PN}-5.0.0_beta1-dont_build_validationkit.patch"
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf
+ use alsa || myconf+=" --disable-alsa"
+ use doc || myconf+=" --disable-docs"
+ use java || myconf+=" --disable-java"
+ use opengl || myconf+=" --disable-opengl"
+ use pulseaudio || myconf+=" --disable-pulse"
+ use python || myconf+=" --disable-python"
+ use vboxwebsrv && myconf+=" --enable-webservice"
+ use vnc && myconf+=" --enable-vnc"
+ if ! use headless ; then
+ use qt4 || myconf+=" --disable-qt4"
+ else
+ myconf+=" --build-headless --disable-opengl"
+ fi
+ if use amd64 && ! has_multilib_profile ; then
+ myconf+=" --disable-vmmraw"
+ fi
+ # not an autoconf script
+ ./configure \
+ --with-gcc="$(tc-getCC)" \
+ --with-g++="$(tc-getCXX)" \
+ --disable-kmods \
+ --disable-dbus \
+ --disable-devmapper \
+ ${myconf} \
+ || die "configure failed"
+}
+
+src_compile() {
+ source ./env.sh
+
+ # Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
+ # and strip all flags
+ # strip-flags
+
+ MAKEJOBS=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+')
+ MAKELOAD=$(echo ${MAKEOPTS} | egrep -o '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+')
+ MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
+ MAKE="kmk" emake \
+ VBOX_BUILD_PUBLISHER=_Gentoo \
+ TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \
+ TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \
+ TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \
+ TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \
+ VBOX_GCC_OPT="${CXXFLAGS}" \
+ TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
+ all
+}
+
+src_install() {
+ cd "${S}"/out/linux.${ARCH}/release/bin || die
+
+ # Create configuration files
+ insinto /etc/vbox
+ newins "${FILESDIR}/${PN}-4-config" vbox.cfg
+
+ # Set the right libdir
+ sed -i \
+ -e "s@MY_LIBDIR@$(get_libdir)@" \
+ "${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
+
+ # Symlink binaries to the shipped wrapper
+ exeinto /usr/$(get_libdir)/${PN}
+ newexe "${FILESDIR}/${PN}-ose-3-wrapper" "VBox"
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBox
+ fperms 0750 /usr/$(get_libdir)/${PN}/VBox
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxManage
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxVRDP
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxHeadless
+ dosym /usr/$(get_libdir)/${PN}/VBoxTunctl /usr/bin/VBoxTunctl
+
+ # Install binaries and libraries
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r components
+
+ if use sdk ; then
+ doins -r sdk
+ fi
+
+ if use vboxwebsrv ; then
+ doins vboxwebsrv
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/vboxwebsrv
+ fperms 0750 /usr/$(get_libdir)/${PN}/vboxwebsrv
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/vboxwebsrv
+ newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+ newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+ fi
+
+ #local gcfiles="*gc"
+ #if use amd64 && ! has_multilib_profile ; then
+ # gcfiles=""
+ #fi
+
+ for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,ExtPackHelperApp} *so *r0 *.rc ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 0750 /usr/$(get_libdir)/${PN}/${each}
+ done
+
+ # VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+ for each in VBoxNet{AdpCtl,DHCP,NAT} ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+ done
+
+ # VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
+ # VBoxXPCOMIPCD (bug #524202)
+ for each in VBox{Manage,SVC,XPCOMIPCD} ; do
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each} || die
+ done
+
+ if ! use headless ; then
+ for each in VBox{SDL,Headless} ; do
+ doins ${each}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+ fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each}
+ done
+
+ if use opengl && use qt4 ; then
+ doins VBoxTestOGL
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxTestOGL
+ fperms 0750 /usr/$(get_libdir)/${PN}/VBoxTestOGL
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxTestOGL
+ fi
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxSDL
+
+ if use qt4 ; then
+ doins VirtualBox
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VirtualBox
+ fperms 4750 /usr/$(get_libdir)/${PN}/VirtualBox
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VirtualBox \
+ || die
+
+ dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VirtualBox
+
+ newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
+ fi
+
+ pushd "${S}"/src/VBox/Resources/OSE &>/dev/null || die
+ for size in 16 32 48 64 128 ; do
+ newicon -s ${size} ${PN}-${size}px.png ${PN}.png
+ done
+ newicon ${PN}-48px.png ${PN}.png
+ popd &>/dev/null || die
+ else
+ doins VBoxHeadless
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxHeadless
+ fperms 4750 /usr/$(get_libdir)/${PN}/VBoxHeadless
+ pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxHeadless || die
+ fi
+
+ insinto /usr/$(get_libdir)/${PN}
+ # Install EFI Firmware files (bug #320757)
+ pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
+ for fwfile in VBoxEFI{32,64}.fd ; do
+ doins ${fwfile}
+ fowners root:vboxusers /usr/$(get_libdir)/${PN}/${fwfile}
+ done
+ popd &>/dev/null || die
+
+ if use udev ; then
+ # New way of handling USB device nodes for VBox (bug #356215)
+ local udevdir="$(get_udevdir)"
+ insinto ${udevdir}
+ doins VBoxCreateUSBNode.sh
+ fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
+ fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
+ insinto ${udevdir}/rules.d
+ doins "${FILESDIR}"/10-virtualbox.rules
+ sed "s@%UDEVDIR%@${udevdir}@" \
+ -i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
+ fi
+
+ insinto /usr/share/${PN}
+ if ! use headless && use qt4 ; then
+ doins -r nls
+ fi
+
+ # VRDPAuth only works with this (bug #351949)
+ dosym VBoxAuth.so /usr/$(get_libdir)/${PN}/VRDPAuth.so
+
+ # set an env-variable for 3rd party tools
+ echo -n "VBOX_APP_HOME=/usr/$(get_libdir)/${PN}" > "${T}/90virtualbox"
+ doenvd "${T}/90virtualbox"
+
+ if use java ; then
+ java-pkg_regjar "${D}/usr/$(get_libdir)/${PN}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
+ java-pkg_regso "${D}/usr/$(get_libdir)/${PN}/libvboxjxpcom.so"
+ fi
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+
+ if use udev ; then
+ udevadm control --reload-rules \
+ && udevadm trigger --subsystem-match=usb
+ fi
+
+ if ! use headless && use qt4 ; then
+ elog "To launch VirtualBox just type: \"VirtualBox\"."
+ fi
+ elog "You must be in the vboxusers group to use VirtualBox."
+ elog ""
+ elog "The latest user manual is available for download at:"
+ elog "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
+ elog ""
+ elog "For advanced networking setups you should emerge:"
+ elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+ elog ""
+ elog "IMPORTANT!"
+ elog "If you upgrade from app-emulation/virtualbox-ose make sure to run"
+ elog "\"env-update\" as root and logout and relogin as the user you wish"
+ elog "to run ${PN} as."
+ elog ""
+ elog "Starting with version 4.0.0, ${PN} has USB-1 support."
+ elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
+ elog " app-emulation/virtualbox-extpack-oracle"
+ elog "package."
+ elog "Starting with version 5.0.0, ${PN} no longer has the \"additions\" and"
+ elog "the \"extension\" USE flag. For installation of the guest additions ISO"
+ elog "image, please emerge"
+ elog " app-emulation/virtualbox-additions"
+ elog "and for the USB2, USB3, VRDP and PXE boot ROM modules, please emerge"
+ elog " app-emulation/virtualbox-extpack-oracle"
+ if ! use udev ; then
+ elog ""
+ elog "WARNING!"
+ elog "Without USE=udev, USB devices will likely not work in ${PN}."
+ elif [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
+ elog ""
+ elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
+ elog "or else USB in ${PN} won't work."
+ fi
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/vmips-cross-bin/Manifest b/app-emulation/vmips-cross-bin/Manifest
new file mode 100644
index 000000000000..27ca9d51fb89
--- /dev/null
+++ b/app-emulation/vmips-cross-bin/Manifest
@@ -0,0 +1 @@
+DIST vmips-cross-bin-1.0.ppc.tar.bz2 9301855 SHA256 ff67411749525b073cf10077219b15e340525d252cd797aff6edfb460efd0f98 SHA512 e1296dcc457133e8ab42f3cff42ee26d5744a6ed89d7b5b217d6aec63a36d463bae1a022365d5586208b1f59cad4c5f7964d82ea78bebd4c9a354f817cbbf4dc WHIRLPOOL 0db7875eb6e0d2dad6510c5392cc3a8fd685ca00a483080de8e3f315f0e528e2846bf645f72436e2b65c11cd1eda52eb4b7336ead70ee25ab0507ff1fa6ac7d0
diff --git a/app-emulation/vmips-cross-bin/metadata.xml b/app-emulation/vmips-cross-bin/metadata.xml
new file mode 100644
index 000000000000..91f4e72fb544
--- /dev/null
+++ b/app-emulation/vmips-cross-bin/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-emulation/vmips-cross-bin/vmips-cross-bin-1.0.ebuild b/app-emulation/vmips-cross-bin/vmips-cross-bin-1.0.ebuild
new file mode 100644
index 000000000000..569682d594bc
--- /dev/null
+++ b/app-emulation/vmips-cross-bin/vmips-cross-bin-1.0.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+SRC_URI="ppc? ( mirror://gentoo/${P}.ppc.tar.bz2 )"
+DESCRIPTION="vmips cross-development tools"
+HOMEPAGE="http://vmips.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc"
+DEPEND=""
+IUSE=""
+
+src_install() {
+ mkdir -p ${D}/opt
+ mv ${WORKDIR}/mips ${D}/opt
+}
diff --git a/app-emulation/vmips/Manifest b/app-emulation/vmips/Manifest
new file mode 100644
index 000000000000..46e5d4ce3f1d
--- /dev/null
+++ b/app-emulation/vmips/Manifest
@@ -0,0 +1,2 @@
+DIST vmips-1.3.1.tar.gz 1144409 SHA256 25c904cb536d2f50bb7823b3ca09b89d25af6d154a985af02e011add7e96b56c SHA512 53f2277dad25b7a6a7b811c58d2b2e22496476cb57815835715789fd73f1c1279a0ad0ae3663a257a962a61182dc1b0be0f6f76d118a064b433f04d995ef915a WHIRLPOOL af3aad285e79afc5a9edca84c149961e343eb0f748216bd34a3ad829d3cad11b58398aacc626cdd3a5935e2edf3a4c10998625c00a2a7576880b3595e8936c08
+DIST vmips-1.3.tar.gz 1086275 SHA256 8c62893ad59d0f35ca0e84873ee5811a36fe7c56d86efe74b64bd2aaa6f430d7 SHA512 9c0aa01588645c4083041ba7fdcd35d6e4e03a9df69c98853a060c91e921bf754701baa4f81611342d0a5245c6f71a8497bf558c2826d0a8b14a876a2087a8e4 WHIRLPOOL 822e7e7d1d41072c742246d541bbe4db8aa05191228eeac8ffdb3e93168e17732433e322c51d0067a3b4089fffeab38f5228891116e519f56df115078e0503ed
diff --git a/app-emulation/vmips/metadata.xml b/app-emulation/vmips/metadata.xml
new file mode 100644
index 000000000000..54b23519c140
--- /dev/null
+++ b/app-emulation/vmips/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">vmips</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/vmips/vmips-1.3.1.ebuild b/app-emulation/vmips/vmips-1.3.1.ebuild
new file mode 100644
index 000000000000..00b0e6bbfd22
--- /dev/null
+++ b/app-emulation/vmips/vmips-1.3.1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A virtual machine simulator based on a MIPS R3000 processor"
+HOMEPAGE="http://vmips.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc"
+IUSE=""
+DEPEND="app-emulation/vmips-cross-bin"
+
+src_install() {
+ make install DESTDIR=${D} || die "make install failed"
+ dodoc README AUTHORS COPYING NEWS THANKS VERSION
+}
diff --git a/app-emulation/vmips/vmips-1.3.ebuild b/app-emulation/vmips/vmips-1.3.ebuild
new file mode 100644
index 000000000000..14174e0321d5
--- /dev/null
+++ b/app-emulation/vmips/vmips-1.3.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A virtual machine simulator based on a MIPS R3000 processor"
+HOMEPAGE="http://vmips.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ppc"
+IUSE=""
+DEPEND="app-emulation/vmips-cross-bin"
+
+src_install() {
+ make install DESTDIR=${D} || die "make install failed"
+ dodoc README AUTHORS COPYING NEWS THANKS VERSION
+}
diff --git a/app-emulation/vmware-modules/files/271-3.10.0.patch b/app-emulation/vmware-modules/files/271-3.10.0.patch
new file mode 100644
index 000000000000..7795b18f5d7e
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-3.10.0.patch
@@ -0,0 +1,809 @@
+--- a/vmnet-only/bridge.c
++++ b/vmnet-only/bridge.c
+@@ -105,8 +105,6 @@ static Bool VNetBridgeCycleDetect(VNetJack *this, int generation);
+ static Bool VNetBridgeIsDeviceWireless(struct net_device *dev);
+ static void VNetBridgePortsChanged(VNetJack *this);
+ static int VNetBridgeIsBridged(VNetJack *this);
+-static int VNetBridgeProcRead(char *page, char **start, off_t off,
+- int count, int *eof, void *data);
+ static void VNetBridgeComputeHeaderPosIPv6(struct sk_buff *skb);
+ static PacketStatus VNetCallSMACFunc(struct SMACState *state,
+ struct sk_buff **skb, void *startOfData,
+@@ -225,6 +223,53 @@ VNetBridgeDevCompatible(VNetBridge *bridge, // IN: Bridge
+ /*
+ *----------------------------------------------------------------------
+ *
++ * VNetBridgeProcShow --
++ *
++ * Callback for read operation on this bridge entry in vnets proc fs.
++ *
++ * Results:
++ * Length of read operation.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------
++ */
++
++int
++VNetBridgeProcShow(struct seq_file *seqf, // IN/OUT: buffer to write into
++ void *data) // IN: client data - pointer to bridge
++{
++ VNetBridge *bridge = (VNetBridge*)data;
++
++ if (!bridge) {
++ return 0;
++ }
++
++ VNetPrintPort(&bridge->port, seqf);
++
++ seq_printf(seqf, "dev %s ", bridge->name);
++
++ seq_printf(seqf, "\n");
++
++ return 0;
++}
++
++static int proc_bridge_open(struct inode *inode, struct file *file)
++{
++ return single_open(file, VNetBridgeProcShow, PDE_DATA(inode));
++}
++
++static const struct file_operations proc_bridge_fops = {
++ .open = proc_bridge_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = seq_release,
++};
++
++/*
++ *----------------------------------------------------------------------
++ *
+ * VNetBridge_Create --
+ *
+ * Creates a bridge. Allocates struct, allocates internal device,
+@@ -319,17 +364,14 @@ VNetBridge_Create(const char *devName, // IN: name of device (e.g., "eth0")
+ * Make proc entry for this jack.
+ */
+
+- retval = VNetProc_MakeEntry(bridge->port.jack.name, S_IFREG,
+- &bridge->port.jack.procEntry);
++ retval = VNetProc_MakeEntryOps(bridge->port.jack.name, S_IFREG,
++ &bridge->port.jack.procEntry, &proc_bridge_fops, bridge);
+ if (retval) {
+ if (retval == -ENXIO) {
+ bridge->port.jack.procEntry = NULL;
+ } else {
+ goto out;
+ }
+- } else {
+- bridge->port.jack.procEntry->read_proc = VNetBridgeProcRead;
+- bridge->port.jack.procEntry->data = bridge;
+ }
+
+ /*
+@@ -1719,45 +1761,3 @@ VNetBridgeReceiveFromDev(struct sk_buff *skb, // IN: packet to receive
+ return 0;
+ }
+
+-
+-/*
+- *----------------------------------------------------------------------
+- *
+- * VNetBridgeProcRead --
+- *
+- * Callback for read operation on this bridge entry in vnets proc fs.
+- *
+- * Results:
+- * Length of read operation.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------
+- */
+-
+-int
+-VNetBridgeProcRead(char *page, // IN/OUT: buffer to write into
+- char **start, // OUT: 0 if file < 4k, else offset into page
+- off_t off, // IN: (unused) offset of read into the file
+- int count, // IN: (unused) maximum number of bytes to read
+- int *eof, // OUT: TRUE if there is nothing more to read
+- void *data) // IN: client data - pointer to bridge
+-{
+- VNetBridge *bridge = (VNetBridge*)data;
+- int len = 0;
+-
+- if (!bridge) {
+- return len;
+- }
+-
+- len += VNetPrintPort(&bridge->port, page+len);
+-
+- len += sprintf(page+len, "dev %s ", bridge->name);
+-
+- len += sprintf(page+len, "\n");
+-
+- *start = 0;
+- *eof = 1;
+- return len;
+-}
+--- a/vmnet-only/driver.c
++++ b/vmnet-only/driver.c
+@@ -1785,21 +1785,17 @@ VNetSetMACUnique(VNetPort *port, // IN:
+ *----------------------------------------------------------------------
+ */
+
+-int
++void
+ VNetPrintJack(const VNetJack *jack, // IN: jack
+- char *buf) // OUT: info about jack
++ struct seq_file *seqf) // OUT: info about jack
+ {
+- int len = 0;
+-
+ read_lock(&vnetPeerLock);
+ if (!jack->peer) {
+- len += sprintf(buf+len, "connected not ");
++ seq_printf(seqf, "connected not ");
+ } else {
+- len += sprintf(buf+len, "connected %s ", jack->peer->name);
++ seq_printf(seqf, "connected %s ", jack->peer->name);
+ }
+ read_unlock(&vnetPeerLock);
+-
+- return len;
+ }
+
+
+@@ -1819,52 +1815,48 @@ VNetPrintJack(const VNetJack *jack, // IN: jack
+ *----------------------------------------------------------------------
+ */
+
+-int
++void
+ VNetPrintPort(const VNetPort *port, // IN: port
+- char *buf) // OUT: info about port
++ struct seq_file *seqf) // OUT: info about port
+ {
+- int len = 0;
++ VNetPrintJack(&port->jack, seqf);
+
+- len += VNetPrintJack(&port->jack, buf+len);
+-
+- len += sprintf(buf+len, "mac %02x:%02x:%02x:%02x:%02x:%02x ",
++ seq_printf(seqf, "mac %02x:%02x:%02x:%02x:%02x:%02x ",
+ port->paddr[0], port->paddr[1], port->paddr[2],
+ port->paddr[3], port->paddr[4], port->paddr[5]);
+
+- len += sprintf(buf+len, "ladrf %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",
++ seq_printf(seqf, "ladrf %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",
+ port->ladrf[0], port->ladrf[1], port->ladrf[2],
+ port->ladrf[3], port->ladrf[4], port->ladrf[5],
+ port->ladrf[6], port->ladrf[7]);
+
+- len += sprintf(buf+len, "flags IFF_RUNNING");
++ seq_printf(seqf, "flags IFF_RUNNING");
+
+ if (port->flags & IFF_UP) {
+- len += sprintf(buf+len, ",IFF_UP");
++ seq_printf(seqf, ",IFF_UP");
+ }
+
+ if (port->flags & IFF_BROADCAST) {
+- len += sprintf(buf+len, ",IFF_BROADCAST");
++ seq_printf(seqf, ",IFF_BROADCAST");
+ }
+
+ if (port->flags & IFF_DEBUG) {
+- len += sprintf(buf+len, ",IFF_DEBUG");
++ seq_printf(seqf, ",IFF_DEBUG");
+ }
+
+ if (port->flags & IFF_PROMISC) {
+- len += sprintf(buf+len, ",IFF_PROMISC");
++ seq_printf(seqf, ",IFF_PROMISC");
+ }
+
+ if (port->flags & IFF_MULTICAST) {
+- len += sprintf(buf+len, ",IFF_MULTICAST");
++ seq_printf(seqf, ",IFF_MULTICAST");
+ }
+
+ if (port->flags & IFF_ALLMULTI) {
+- len += sprintf(buf+len, ",IFF_ALLMULTI");
++ seq_printf(seqf, ",IFF_ALLMULTI");
+ }
+
+- len += sprintf(buf+len, " ");
+-
+- return len;
++ seq_printf(seqf, " ");
+ }
+
+
+--- a/vmnet-only/hub.c
++++ b/vmnet-only/hub.c
+@@ -25,6 +25,7 @@
+ #include <linux/sched.h>
+ #include <linux/slab.h>
+ #include <linux/poll.h>
++#include <linux/seq_file.h>
+
+ #include <linux/netdevice.h>
+ #include <linux/etherdevice.h>
+@@ -71,8 +72,6 @@ static void VNetHubReceive(VNetJack *this, struct sk_buff *skb);
+ static Bool VNetHubCycleDetect(VNetJack *this, int generation);
+ static void VNetHubPortsChanged(VNetJack *this);
+ static int VNetHubIsBridged(VNetJack *this);
+-static int VNetHubProcRead(char *page, char **start, off_t off,
+- int count, int *eof, void *data);
+
+ static VNetHub *vnetHub;
+ static DEFINE_SPINLOCK(vnetHubLock);
+@@ -241,6 +240,53 @@ VNetHub_AllocPvn(uint8 id[]) // IN: the PVN ID to alloc on
+ /*
+ *----------------------------------------------------------------------
+ *
++ * VNetHubProcShow --
++ *
++ * Callback for read operation on hub entry in vnets proc fs.
++ *
++ * Results:
++ * Length of read operation.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------
++ */
++
++int
++VNetHubProcShow(struct seq_file *seqf, // IN/OUT: buffer to write into
++ void *data) // IN: client data - not used
++{
++ VNetJack *jack = (VNetJack*)data;
++ VNetHub *hub;
++
++ if (!jack || !jack->private) {
++ return 0;
++ }
++ hub = (VNetHub*)jack->private;
++
++ VNetPrintJack(jack, seqf);
++
++ seq_printf(seqf, "tx %u ", hub->stats[jack->index].tx);
++ seq_printf(seqf, "\n");
++ return 0;
++}
++
++static int proc_hub_open(struct inode *inode, struct file *file)
++{
++ return single_open(file, VNetHubProcShow, PDE_DATA(inode));
++}
++
++static const struct file_operations proc_hub_fops = {
++ .open = proc_hub_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = seq_release,
++};
++
++/*
++ *----------------------------------------------------------------------
++ *
+ * VNetHubAlloc --
+ *
+ * Allocate a jack on this hub.
+@@ -354,7 +400,7 @@ VNetHubAlloc(Bool allocPvn, // IN: TRUE for PVN, FALSE for vnet
+ * Make proc entry for this jack.
+ */
+
+- retval = VNetProc_MakeEntry(jack->name, S_IFREG, &jack->procEntry);
++ retval = VNetProc_MakeEntryOps(jack->name, S_IFREG, &jack->procEntry, &proc_hub_fops, jack);
+ if (retval) {
+ if (retval == -ENXIO) {
+ jack->procEntry = NULL;
+@@ -362,9 +408,6 @@ VNetHubAlloc(Bool allocPvn, // IN: TRUE for PVN, FALSE for vnet
+ hub->used[i] = FALSE;
+ return NULL;
+ }
+- } else {
+- jack->procEntry->read_proc = VNetHubProcRead;
+- jack->procEntry->data = jack;
+ }
+
+ /*
+@@ -686,46 +729,3 @@ VNetHubIsBridged(VNetJack *this)
+ }
+
+
+-/*
+- *----------------------------------------------------------------------
+- *
+- * VNetHubProcRead --
+- *
+- * Callback for read operation on hub entry in vnets proc fs.
+- *
+- * Results:
+- * Length of read operation.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------
+- */
+-
+-int
+-VNetHubProcRead(char *page, // IN/OUT: buffer to write into
+- char **start, // OUT: 0 if file < 4k, else offset into page
+- off_t off, // IN: offset of read into the file
+- int count, // IN: maximum number of bytes to read
+- int *eof, // OUT: TRUE if there is nothing more to read
+- void *data) // IN: client data - not used
+-{
+- VNetJack *jack = (VNetJack*)data;
+- VNetHub *hub;
+- int len = 0;
+-
+- if (!jack || !jack->private) {
+- return len;
+- }
+- hub = (VNetHub*)jack->private;
+-
+- len += VNetPrintJack(jack, page+len);
+-
+- len += sprintf(page+len, "tx %u ", hub->stats[jack->index].tx);
+-
+- len += sprintf(page+len, "\n");
+-
+- *start = 0;
+- *eof = 1;
+- return len;
+-}
+--- a/vmnet-only/netif.c
++++ b/vmnet-only/netif.c
+@@ -62,8 +62,6 @@ static int VNetNetifStartXmit(struct sk_buff *skb, struct net_device *dev);
+ static struct net_device_stats *VNetNetifGetStats(struct net_device *dev);
+ static int VNetNetifSetMAC(struct net_device *dev, void *addr);
+ static void VNetNetifSetMulticast(struct net_device *dev);
+-static int VNetNetIfProcRead(char *page, char **start, off_t off,
+- int count, int *eof, void *data);
+
+ /*
+ *----------------------------------------------------------------------
+@@ -116,6 +114,53 @@ VNetNetIfSetup(struct net_device *dev) // IN:
+
+ }
+
++/*
++ *----------------------------------------------------------------------
++ *
++ * VNetNetIfProcShow --
++ *
++ * Callback for read operation on this netif entry in vnets proc fs.
++ *
++ * Results:
++ * Length of read operation.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------
++ */
++
++int
++VNetNetIfProcShow(struct seq_file *seqf, // IN/OUT: buffer to write into
++ void *data) // IN: client data
++{
++ VNetNetIF *netIf = data;
++
++ if (!netIf) {
++ return 0;
++ }
++
++ VNetPrintPort(&netIf->port, seqf);
++
++ seq_printf(seqf, "dev %s ", netIf->dev->name);
++
++ seq_printf(seqf, "\n");
++
++ return 0;
++}
++
++static int proc_netif_open(struct inode *inode, struct file *file)
++{
++ return single_open(file, VNetNetIfProcShow, PDE_DATA(inode));
++}
++
++static const struct file_operations proc_netif_fops = {
++ .open = proc_netif_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = seq_release,
++};
++
+
+ /*
+ *----------------------------------------------------------------------
+@@ -180,16 +225,13 @@ VNetNetIf_Create(char *devName, // IN:
+ * Make proc entry for this jack.
+ */
+
+- retval = VNetProc_MakeEntry(netIf->port.jack.name, S_IFREG,
+- &netIf->port.jack.procEntry);
++ retval = VNetProc_MakeEntryOps(netIf->port.jack.name, S_IFREG,
++ &netIf->port.jack.procEntry, &proc_netif_fops, netIf);
+ if (retval) {
+ netIf->port.jack.procEntry = NULL;
+ if (retval != -ENXIO) {
+ goto outFreeDev;
+ }
+- } else {
+- netIf->port.jack.procEntry->read_proc = VNetNetIfProcRead;
+- netIf->port.jack.procEntry->data = netIf;
+ }
+
+ /*
+@@ -553,45 +595,3 @@ VNetNetifGetStats(struct net_device *dev) // IN:
+ return &netIf->stats;
+ }
+
+-
+-/*
+- *----------------------------------------------------------------------
+- *
+- * VNetNetIfProcRead --
+- *
+- * Callback for read operation on this netif entry in vnets proc fs.
+- *
+- * Results:
+- * Length of read operation.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------
+- */
+-
+-int
+-VNetNetIfProcRead(char *page, // IN/OUT: buffer to write into
+- char **start, // OUT: 0 if file < 4k, else offset into page
+- off_t off, // IN: (unused) offset of read into the file
+- int count, // IN: (unused) maximum number of bytes to read
+- int *eof, // OUT: TRUE if there is nothing more to read
+- void *data) // IN: client data
+-{
+- VNetNetIF *netIf = data;
+- int len = 0;
+-
+- if (!netIf) {
+- return len;
+- }
+-
+- len += VNetPrintPort(&netIf->port, page+len);
+-
+- len += sprintf(page+len, "dev %s ", netIf->dev->name);
+-
+- len += sprintf(page+len, "\n");
+-
+- *start = 0;
+- *eof = 1;
+- return len;
+-}
+--- a/vmnet-only/procfs.c
++++ b/vmnet-only/procfs.c
+@@ -45,10 +45,6 @@
+
+ #if defined(CONFIG_PROC_FS)
+
+-static int VNetProcMakeEntryInt(VNetProcEntry *parent, char *name, int mode,
+- VNetProcEntry **ret);
+-static void VNetProcRemoveEntryInt(VNetProcEntry *node, VNetProcEntry *parent);
+-
+ static VNetProcEntry *base = NULL;
+
+
+@@ -71,7 +67,12 @@ static VNetProcEntry *base = NULL;
+ int
+ VNetProc_Init(void)
+ {
+- return VNetProcMakeEntryInt(NULL, "vmnet", S_IFDIR, &base);
++ base = proc_mkdir("vmnet", NULL);
++ if(IS_ERR(base)) {
++ base = NULL;
++ return PTR_ERR(base);
++ }
++ return 0;
+ }
+
+
+@@ -94,14 +95,14 @@ VNetProc_Init(void)
+ void
+ VNetProc_Cleanup(void)
+ {
+- VNetProcRemoveEntryInt(base, NULL);
++ proc_remove(base);
+ base = NULL;
+ }
+
+ /*
+ *----------------------------------------------------------------------
+ *
+- * VNetProcMakeEntryInt --
++ * VNetProc_MakeEntryOps --
+ *
+ * Make an entry in the vnets proc file system.
+ *
+@@ -116,72 +117,21 @@ VNetProc_Cleanup(void)
+ */
+
+ int
+-VNetProcMakeEntryInt(VNetProcEntry *parent, // IN:
+- char *name, // IN:
++VNetProc_MakeEntryOps(char *name, // IN:
+ int mode, // IN:
+- VNetProcEntry **ret) // OUT:
++ VNetProcEntry **ret,
++ const struct file_operations *fops,
++ void *data
++ ) // OUT:
+ {
+ VNetProcEntry *ent;
+- ent = create_proc_entry(name, mode, parent);
++ ent = proc_create_data(name, mode, base, fops, data);
+ *ret = ent;
+ if (!ent)
+ return -ENOMEM;
+ return 0;
+ }
+
+-
+-/*
+- *----------------------------------------------------------------------
+- *
+- * VNetProcRemoveEntryInt --
+- *
+- * Remove a previously installed proc entry.
+- *
+- * Results:
+- * None.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------
+- */
+-
+-void
+-VNetProcRemoveEntryInt(VNetProcEntry *node,
+- VNetProcEntry *parent)
+-{
+- if (node) {
+- remove_proc_entry(node->name, parent);
+- }
+-}
+-
+-
+-/*
+- *----------------------------------------------------------------------
+- *
+- * VNetProc_MakeEntry --
+- *
+- * Make an entry in the vnets proc file system.
+- *
+- * Results:
+- * errno. If errno is 0 and ret is non NULL then ret is filled
+- * in with the resulting proc entry.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------
+- */
+-
+-int
+-VNetProc_MakeEntry(char *name, // IN:
+- int mode, // IN:
+- VNetProcEntry **ret) // OUT:
+-{
+- return VNetProcMakeEntryInt(base, name, mode, ret);
+-}
+-
+-
+ /*
+ *----------------------------------------------------------------------
+ *
+@@ -201,7 +151,8 @@ VNetProc_MakeEntry(char *name, // IN:
+ void
+ VNetProc_RemoveEntry(VNetProcEntry *node)
+ {
+- VNetProcRemoveEntryInt(node, base);
++ if(node)
++ proc_remove(node);
+ }
+
+
+@@ -253,31 +204,6 @@ VNetProc_Cleanup(void)
+ }
+
+
+-/*
+- *----------------------------------------------------------------------
+- *
+- * VNetProc_MakeEntry --
+- *
+- * Make an entry in the vnets proc file system.
+- *
+- * Results:
+- * errno. If errno is 0 and ret is non NULL then ret is filled
+- * in with the resulting proc entry.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------
+- */
+-
+-int
+-VNetProc_MakeEntry(char *name,
+- int mode,
+- VNetProcEntry **ret)
+-{
+- return -ENXIO;
+-}
+-
+
+ /*
+ *----------------------------------------------------------------------
+--- a/vmnet-only/userif.c
++++ b/vmnet-only/userif.c
+@@ -389,7 +389,7 @@ VNetUserIfReceive(VNetJack *this, // IN
+ /*
+ *----------------------------------------------------------------------
+ *
+- * VNetUserIfProcRead --
++ * VNetUserIfProcShow --
+ *
+ * Callback for read operation on this userif entry in vnets proc fs.
+ *
+@@ -403,30 +403,23 @@ VNetUserIfReceive(VNetJack *this, // IN
+ */
+
+ static int
+-VNetUserIfProcRead(char *page, // IN/OUT: buffer to write into
+- char **start, // OUT: 0 if file < 4k, else offset into
+- // page
+- off_t off, // IN: offset of read into the file
+- int count, // IN: maximum number of bytes to read
+- int *eof, // OUT: TRUE if there is nothing more to
+- // read
++VNetUserIfProcShow(struct seq_file *seqf, // IN/OUT: buffer to write into
+ void *data) // IN: client data - not used
+ {
+ VNetUserIF *userIf = (VNetUserIF*)data;
+- int len = 0;
+
+ if (!userIf) {
+- return len;
++ return 0;
+ }
+
+- len += VNetPrintPort(&userIf->port, page+len);
++ VNetPrintPort(&userIf->port, seqf);
+
+- len += sprintf(page+len, "read %u written %u queued %u ",
++ seq_printf(seqf, "read %u written %u queued %u ",
+ userIf->stats.read,
+ userIf->stats.written,
+ userIf->stats.queued);
+
+- len += sprintf(page+len,
++ seq_printf(seqf,
+ "dropped.down %u dropped.mismatch %u "
+ "dropped.overflow %u dropped.largePacket %u",
+ userIf->stats.droppedDown,
+@@ -434,13 +427,23 @@ VNetUserIfProcRead(char *page, // IN/OUT: buffer to write into
+ userIf->stats.droppedOverflow,
+ userIf->stats.droppedLargePacket);
+
+- len += sprintf(page+len, "\n");
++ seq_printf(seqf, "\n");
+
+- *start = 0;
+- *eof = 1;
+- return len;
++ return 0;
++}
++
++static int proc_userif_open(struct inode *inode, struct file *file)
++{
++ return single_open(file, VNetUserIfProcShow, PDE_DATA(inode));
+ }
+
++static const struct file_operations proc_userif_fops = {
++ .open = proc_userif_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = seq_release,
++};
++
+
+ /*
+ *----------------------------------------------------------------------
+@@ -1036,8 +1039,8 @@ VNetUserIf_Create(VNetPort **ret) // OUT
+ * Make proc entry for this jack.
+ */
+
+- retval = VNetProc_MakeEntry(userIf->port.jack.name, S_IFREG,
+- &userIf->port.jack.procEntry);
++ retval = VNetProc_MakeEntryOps(userIf->port.jack.name, S_IFREG,
++ &userIf->port.jack.procEntry, &proc_userif_fops, userIf);
+ if (retval) {
+ if (retval == -ENXIO) {
+ userIf->port.jack.procEntry = NULL;
+@@ -1045,9 +1048,6 @@ VNetUserIf_Create(VNetPort **ret) // OUT
+ kfree(userIf);
+ return retval;
+ }
+- } else {
+- userIf->port.jack.procEntry->read_proc = VNetUserIfProcRead;
+- userIf->port.jack.procEntry->data = userIf;
+ }
+
+ /*
+--- a/vmnet-only/vnetInt.h
++++ b/vmnet-only/vnetInt.h
+@@ -171,12 +171,14 @@ VNetJack *VNetDisconnect(VNetJack *jack);
+
+ void VNetSend(const VNetJack *jack, struct sk_buff *skb);
+
+-int VNetProc_MakeEntry(char *name, int mode,
+- VNetProcEntry **ret);
++int VNetProc_MakeEntryOps(char *name, int mode,
++ VNetProcEntry **ret,
++ const struct file_operations *fops,
++ void *data);
+
+ void VNetProc_RemoveEntry(VNetProcEntry *node);
+
+-int VNetPrintJack(const VNetJack *jack, char *buf);
++void VNetPrintJack(const VNetJack *jack, struct seq_file *seqf);
+
+ int VNet_MakeMACAddress(VNetPort *port);
+
+@@ -196,7 +198,7 @@ Bool VNetPacketMatch(const uint8 *destAddr, const uint8 *ifAddr,
+
+ Bool VNetCycleDetectIf(const char *name, int generation);
+
+-int VNetPrintPort(const VNetPort *port, char *buf);
++void VNetPrintPort(const VNetPort *port, struct seq_file *seqf);
+
+ int VNetSnprintf(char *str, size_t size, const char *format, ...);
+
+--
+--- a/vmblock-only/linux/control.c 2013-05-21 19:21:19.165750556 +0200
++++ b/vmblock-only/linux/control.c 2013-05-21 19:22:18.363747723 +0200
+@@ -208,9 +208,10 @@
+ VMBlockSetProcEntryOwner(controlProcMountpoint);
+
+ /* Create /proc/fs/vmblock/dev */
+- controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
+- VMBLOCK_CONTROL_MODE,
+- controlProcDirEntry);
++ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME,
++ VMBLOCK_CONTROL_MODE,
++ controlProcDirEntry,
++ &ControlFileOps);
+ if (!controlProcEntry) {
+ Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
+ remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
+@@ -218,7 +219,6 @@
+ return -EINVAL;
+ }
+
+- controlProcEntry->proc_fops = &ControlFileOps;
+ return 0;
+ }
+
diff --git a/app-emulation/vmware-modules/files/271-apic.patch b/app-emulation/vmware-modules/files/271-apic.patch
new file mode 100644
index 000000000000..66cd45933246
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-apic.patch
@@ -0,0 +1,12 @@
+diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
+index f1f4b10..c43242f 100644
+--- a/vmmon-only/linux/hostif.c
++++ b/vmmon-only/linux/hostif.c
+@@ -55,6 +55,7 @@
+ #include <linux/kthread.h>
+ #include <linux/wait.h>
+
++#include <asm/apic.h>
+
+ #include "vmware.h"
+ #include "x86apic.h"
diff --git a/app-emulation/vmware-modules/files/271-filldir.patch b/app-emulation/vmware-modules/files/271-filldir.patch
new file mode 100644
index 000000000000..6eb1f315cd97
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-filldir.patch
@@ -0,0 +1,91 @@
+diff --git a/vmblock-only/linux/file.c b/vmblock-only/linux/file.c
+index d7ac1f6..5499169 100644
+--- a/vmblock-only/linux/file.c
++++ b/vmblock-only/linux/file.c
+@@ -38,46 +38,6 @@ typedef u64 inode_num_t;
+ typedef ino_t inode_num_t;
+ #endif
+
+-/* Specifically for our filldir_t callback */
+-typedef struct FilldirInfo {
+- filldir_t filldir;
+- void *dirent;
+-} FilldirInfo;
+-
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Filldir --
+- *
+- * Callback function for readdir that we use in place of the one provided.
+- * This allows us to specify that each dentry is a symlink, but pass through
+- * everything else to the original filldir function.
+- *
+- * Results:
+- * Original filldir's return value.
+- *
+- * Side effects:
+- * Directory information gets copied to user's buffer.
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-static int
+-Filldir(void *buf, // IN: Dirent buffer passed from FileOpReaddir
+- const char *name, // IN: Dirent name
+- int namelen, // IN: len of dirent's name
+- loff_t offset, // IN: Offset
+- inode_num_t ino, // IN: Inode number of dirent
+- unsigned int d_type) // IN: Type of file
+-{
+- FilldirInfo *info = buf;
+-
+- /* Specify DT_LNK regardless */
+- return info->filldir(info->dirent, name, namelen, offset, ino, DT_LNK);
+-}
+-
+-
+ /* File operations */
+
+ /*
+@@ -166,11 +126,10 @@ FileOpOpen(struct inode *inode, // IN
+
+ static int
+ FileOpReaddir(struct file *file, // IN
+- void *dirent, // IN
+- filldir_t filldir) // IN
++ struct dir_context *ctx) // IN
+ {
+ int ret;
+- FilldirInfo info;
++
+ struct file *actualFile;
+
+ if (!file) {
+@@ -184,12 +143,10 @@ FileOpReaddir(struct file *file, // IN
+ return -EINVAL;
+ }
+
+- info.filldir = filldir;
+- info.dirent = dirent;
+-
+- actualFile->f_pos = file->f_pos;
+- ret = vfs_readdir(actualFile, Filldir, &info);
+- file->f_pos = actualFile->f_pos;
++ /* Ricky Wong Yung Fei:
++ * Manipulation of pos is now handled internally by iterate_dir().
++ */
++ ret = iterate_dir(actualFile, ctx);
+
+ return ret;
+ }
+@@ -237,7 +194,7 @@ FileOpRelease(struct inode *inode, // IN
+
+
+ struct file_operations RootFileOps = {
+- .readdir = FileOpReaddir,
++ .iterate = FileOpReaddir,
+ .open = FileOpOpen,
+ .release = FileOpRelease,
+ };
diff --git a/app-emulation/vmware-modules/files/271-makefile-include.patch b/app-emulation/vmware-modules/files/271-makefile-include.patch
new file mode 100644
index 000000000000..39c300030805
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-makefile-include.patch
@@ -0,0 +1,65 @@
+diff --git a/vmblock-only/Makefile.kernel b/vmblock-only/Makefile.kernel
+index ab7a727..e3ec9d2 100644
+--- a/vmblock-only/Makefile.kernel
++++ b/vmblock-only/Makefile.kernel
+@@ -19,7 +19,7 @@
+
+ INCLUDE += -I$(SRCROOT)/include
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+
+ EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/cachecreate.c, -DVMW_KMEMCR_HAS_DTOR, )
+ EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/cachector.c, -DVMW_KMEMCR_CTOR_HAS_3_ARGS, )
+diff --git a/vmci-only/Makefile.kernel b/vmci-only/Makefile.kernel
+index ba343ee..861ea83 100644
+--- a/vmci-only/Makefile.kernel
++++ b/vmci-only/Makefile.kernel
+@@ -21,7 +21,7 @@ CC_OPTS += -DVMCI
+
+ INCLUDE += -I$(SRCROOT)/shared -I$(SRCROOT)/common -I$(SRCROOT)/linux
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+
+ obj-m += $(DRIVER).o
+
+diff --git a/vmmon-only/Makefile.kernel b/vmmon-only/Makefile.kernel
+index 8770d1d..c4746c3 100644
+--- a/vmmon-only/Makefile.kernel
++++ b/vmmon-only/Makefile.kernel
+@@ -22,7 +22,7 @@ CC_OPTS += -DVMMON -DVMCORE
+ INCLUDE := -I$(SRCROOT)/include -I$(SRCROOT)/common -I$(SRCROOT)/linux \
+ -I$(SRCROOT)/vmcore
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+
+ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/smpcall.c, -DVMW_HAVE_SMP_CALL_3ARG, )
+
+diff --git a/vmnet-only/Makefile.kernel b/vmnet-only/Makefile.kernel
+index d1e3133..665d428 100644
+--- a/vmnet-only/Makefile.kernel
++++ b/vmnet-only/Makefile.kernel
+@@ -19,7 +19,7 @@
+
+ INCLUDE := -I$(SRCROOT)
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netdev_has_net.c,-DVMW_NETDEV_HAS_NET, )
+ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netdev_has_dev_net.c,-DVMW_NETDEV_HAS_DEV_NET, )
+ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/nfhook_uses_skb.c,-DVMW_NFHOOK_USES_SKB, )
+diff --git a/vsock-only/Makefile.kernel b/vsock-only/Makefile.kernel
+index b4629ee..264b8cb 100644
+--- a/vsock-only/Makefile.kernel
++++ b/vsock-only/Makefile.kernel
+@@ -25,7 +25,7 @@ INCLUDE += -I$(SRCROOT)/include
+ INCLUDE += -I$(SRCROOT)/linux
+ INCLUDE += -I$(SRCROOT)/common
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+ EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/netcreate_num_params.c, -DVMW_NETCREATE_KERNARG, )
+
+
diff --git a/app-emulation/vmware-modules/files/271-makefile-kernel-dir.patch b/app-emulation/vmware-modules/files/271-makefile-kernel-dir.patch
new file mode 100644
index 000000000000..1a647a3302d8
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-makefile-kernel-dir.patch
@@ -0,0 +1,85 @@
+diff --git a/vmblock-only/Makefile b/vmblock-only/Makefile
+index 2b81323..746c8b8 100644
+--- a/vmblock-only/Makefile
++++ b/vmblock-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vmblock
+ PRODUCT := ws
+diff --git a/vmci-only/Makefile b/vmci-only/Makefile
+index 8e9c5be..6ec828b 100644
+--- a/vmci-only/Makefile
++++ b/vmci-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vmci
+ PRODUCT := ws
+diff --git a/vmmon-only/Makefile b/vmmon-only/Makefile
+index 5bd867b..91a83d4 100644
+--- a/vmmon-only/Makefile
++++ b/vmmon-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vmmon
+ PRODUCT := @@PRODUCT@@
+diff --git a/vmnet-only/Makefile b/vmnet-only/Makefile
+index d4eb73c..c7c6d38 100644
+--- a/vmnet-only/Makefile
++++ b/vmnet-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vmnet
+ PRODUCT := @@PRODUCT@@
+diff --git a/vsock-only/Makefile b/vsock-only/Makefile
+index 93dd61d..9765696 100644
+--- a/vsock-only/Makefile
++++ b/vsock-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vsock
+ PRODUCT := ws
diff --git a/app-emulation/vmware-modules/files/271-netdevice.patch b/app-emulation/vmware-modules/files/271-netdevice.patch
new file mode 100644
index 000000000000..35231a3205e3
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-netdevice.patch
@@ -0,0 +1,24 @@
+diff --git a/vmnet-only/compat_netdevice.h b/vmnet-only/compat_netdevice.h
+index 7a56304..9ff4548 100644
+--- a/vmnet-only/compat_netdevice.h
++++ b/vmnet-only/compat_netdevice.h
+@@ -47,6 +47,19 @@
+ # define net_device device
+ #endif
+
++/* it looks like these have been removed from the kernel 3.1
++ * probably because the "transition" is considered complete.
++ * so to keep this source compatible we just redefine them like they were
++ * previously
++ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
++#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
++ functions are available. */
++#define HAVE_FREE_NETDEV /* free_netdev() */
++#define HAVE_NETDEV_PRIV /* netdev_priv() */
++#define HAVE_NETIF_QUEUE
++#define HAVE_NET_DEVICE_OPS
++#endif
+
+ /*
+ * SET_MODULE_OWNER appeared sometime during 2.3.x. It was setting
diff --git a/app-emulation/vmware-modules/files/271-putname.patch b/app-emulation/vmware-modules/files/271-putname.patch
new file mode 100644
index 000000000000..6e76130fa165
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-putname.patch
@@ -0,0 +1,13 @@
+diff --git a/vmblock-only/linux/control.c b/vmblock-only/linux/control.c
+index 79716bd..2dd83fe 100644
+--- a/vmblock-only/linux/control.c
++++ b/vmblock-only/linux/control.c
+@@ -293,7 +293,7 @@ ExecuteBlockOp(const char __user *buf, // IN: buffer with name
+
+ retval = i < 0 ? -EINVAL : blockOp(name, blocker);
+
+- putname(name);
++ __putname(name);
+
+ return retval;
+ }
diff --git a/app-emulation/vmware-modules/files/271-vfsfollowlink.patch b/app-emulation/vmware-modules/files/271-vfsfollowlink.patch
new file mode 100644
index 000000000000..13f600e39f33
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-vfsfollowlink.patch
@@ -0,0 +1,30 @@
+diff -Naur a/linux/inode.c b/linux/inode.c
+--- a/vmblock-only/linux/inode.c 2013-10-03 04:29:47.471339204 -0400
++++ b/vmblock-only/linux/inode.c 2013-10-03 04:31:56.607334636 -0400
+@@ -36,7 +36,7 @@
+
+ /* Inode operations */
+ static struct dentry *InodeOpLookup(struct inode *dir,
+- struct dentry *dentry, struct nameidata *nd);
++ struct dentry *dentry, unsigned int flags);
+ static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+ static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
+@@ -75,7 +75,7 @@
+ static struct dentry *
+ InodeOpLookup(struct inode *dir, // IN: parent directory's inode
+ struct dentry *dentry, // IN: dentry to lookup
+- struct nameidata *nd) // IN: lookup intent and information
++ unsigned int flags) // IN: lookup intent and information
+ {
+ char *filename;
+ struct inode *inode;
+@@ -221,7 +221,7 @@
+ goto out;
+ }
+
+- ret = vfs_follow_link(nd, iinfo->name);
++ nd_set_link(nd, iinfo->name);
+
+ out:
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
diff --git a/app-emulation/vmware-modules/files/271-vmmon.patch b/app-emulation/vmware-modules/files/271-vmmon.patch
new file mode 100644
index 000000000000..f1979641a4d6
--- /dev/null
+++ b/app-emulation/vmware-modules/files/271-vmmon.patch
@@ -0,0 +1,44 @@
+diff -ru source900/vmmon-only/linux/hostif.c source/vmmon-only/linux/hostif.c
+--- source900/vmmon-only/linux/hostif.c 2012-07-23 18:18:55.000000000 +0900
++++ source/vmmon-only/linux/hostif.c 2012-08-03 16:20:23.200420885 +0900
+@@ -48,6 +48,7 @@
+ #include <linux/smp_lock.h>
+ #endif
+
++#include <asm/asm.h>
+ #include <asm/io.h>
+ #include <asm/uaccess.h>
+ #include <linux/mc146818rtc.h>
+@@ -3586,31 +3587,14 @@
+ {
+ int ret;
+ unsigned low, high;
+-#if defined(VM_X86_64)
+ asm volatile("2: rdmsr ; xor %0,%0\n"
+ "1:\n\t"
+ ".section .fixup,\"ax\"\n\t"
+ "3: mov %4,%0 ; jmp 1b\n\t"
+ ".previous\n\t"
+- ".section __ex_table,\"a\"\n\t"
+- ".balign 8\n"
+- ".quad 2b,3b\n"
+- ".previous\n"
++ _ASM_EXTABLE(2b,3b)
+ : "=r"(ret), "=a"(low), "=d"(high)
+ : "c"(msr), "i"(-EFAULT), "1"(0), "2"(0)); // init eax/edx to 0
+-#else
+- asm volatile("2: rdmsr ; xor %0,%0\n"
+- "1:\n\t"
+- ".section .fixup,\"ax\"\n\t"
+- "3: mov %4,%0 ; jmp 1b\n\t"
+- ".previous\n\t"
+- ".section __ex_table,\"a\"\n"
+- ".balign 4\n"
+- ".long 2b,3b\n"
+- ".previous\n"
+- : "=r"(ret), "=a"(low), "=d"(high)
+- : "c"(msr), "i"(-EFAULT), "1"(0), "2"(0)); // init eax/edx to 0
+-#endif // VM_X86_64
+ *val = (low | ((u64)(high) << 32));
+
+ return ret;
diff --git a/app-emulation/vmware-modules/files/279-apic.patch b/app-emulation/vmware-modules/files/279-apic.patch
new file mode 100644
index 000000000000..66cd45933246
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-apic.patch
@@ -0,0 +1,12 @@
+diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
+index f1f4b10..c43242f 100644
+--- a/vmmon-only/linux/hostif.c
++++ b/vmmon-only/linux/hostif.c
+@@ -55,6 +55,7 @@
+ #include <linux/kthread.h>
+ #include <linux/wait.h>
+
++#include <asm/apic.h>
+
+ #include "vmware.h"
+ #include "x86apic.h"
diff --git a/app-emulation/vmware-modules/files/279-filldir.patch b/app-emulation/vmware-modules/files/279-filldir.patch
new file mode 100644
index 000000000000..6eb1f315cd97
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-filldir.patch
@@ -0,0 +1,91 @@
+diff --git a/vmblock-only/linux/file.c b/vmblock-only/linux/file.c
+index d7ac1f6..5499169 100644
+--- a/vmblock-only/linux/file.c
++++ b/vmblock-only/linux/file.c
+@@ -38,46 +38,6 @@ typedef u64 inode_num_t;
+ typedef ino_t inode_num_t;
+ #endif
+
+-/* Specifically for our filldir_t callback */
+-typedef struct FilldirInfo {
+- filldir_t filldir;
+- void *dirent;
+-} FilldirInfo;
+-
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Filldir --
+- *
+- * Callback function for readdir that we use in place of the one provided.
+- * This allows us to specify that each dentry is a symlink, but pass through
+- * everything else to the original filldir function.
+- *
+- * Results:
+- * Original filldir's return value.
+- *
+- * Side effects:
+- * Directory information gets copied to user's buffer.
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-static int
+-Filldir(void *buf, // IN: Dirent buffer passed from FileOpReaddir
+- const char *name, // IN: Dirent name
+- int namelen, // IN: len of dirent's name
+- loff_t offset, // IN: Offset
+- inode_num_t ino, // IN: Inode number of dirent
+- unsigned int d_type) // IN: Type of file
+-{
+- FilldirInfo *info = buf;
+-
+- /* Specify DT_LNK regardless */
+- return info->filldir(info->dirent, name, namelen, offset, ino, DT_LNK);
+-}
+-
+-
+ /* File operations */
+
+ /*
+@@ -166,11 +126,10 @@ FileOpOpen(struct inode *inode, // IN
+
+ static int
+ FileOpReaddir(struct file *file, // IN
+- void *dirent, // IN
+- filldir_t filldir) // IN
++ struct dir_context *ctx) // IN
+ {
+ int ret;
+- FilldirInfo info;
++
+ struct file *actualFile;
+
+ if (!file) {
+@@ -184,12 +143,10 @@ FileOpReaddir(struct file *file, // IN
+ return -EINVAL;
+ }
+
+- info.filldir = filldir;
+- info.dirent = dirent;
+-
+- actualFile->f_pos = file->f_pos;
+- ret = vfs_readdir(actualFile, Filldir, &info);
+- file->f_pos = actualFile->f_pos;
++ /* Ricky Wong Yung Fei:
++ * Manipulation of pos is now handled internally by iterate_dir().
++ */
++ ret = iterate_dir(actualFile, ctx);
+
+ return ret;
+ }
+@@ -237,7 +194,7 @@ FileOpRelease(struct inode *inode, // IN
+
+
+ struct file_operations RootFileOps = {
+- .readdir = FileOpReaddir,
++ .iterate = FileOpReaddir,
+ .open = FileOpOpen,
+ .release = FileOpRelease,
+ };
diff --git a/app-emulation/vmware-modules/files/279-hardened.patch b/app-emulation/vmware-modules/files/279-hardened.patch
new file mode 100644
index 000000000000..cc3e04152877
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-hardened.patch
@@ -0,0 +1,113 @@
+diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
+index b21dd44..960c2aa 100644
+--- a/vmmon-only/linux/driver.c
++++ b/vmmon-only/linux/driver.c
+@@ -178,7 +178,22 @@ static struct vm_operations_struct vmuser_mops = {
+ #endif
+ };
+
+-static struct file_operations vmuser_fops;
++static struct file_operations vmuser_fops = {
++ .owner = THIS_MODULE,
++ .poll = LinuxDriverPoll,
++#ifdef HAVE_UNLOCKED_IOCTL
++ .unlocked_ioctl = LinuxDriver_UnlockedIoctl,
++#else
++ .ioctl = LinuxDriver_Ioctl,
++#endif
++#ifdef HAVE_COMPAT_IOCTL
++ .compat_ioctl = LinuxDriver_UnlockedIoctl,
++#endif
++ .open = LinuxDriver_Open,
++ .release = LinuxDriver_Close,
++ .mmap = LinuxDriverMmap
++};
++
+ static struct timer_list tscTimer;
+
+ /*
+@@ -357,27 +372,6 @@ init_module(void)
+ spin_lock_init(&linuxState.pollListLock);
+ #endif
+
+- /*
+- * Initialize the file_operations structure. Because this code is always
+- * compiled as a module, this is fine to do it here and not in a static
+- * initializer.
+- */
+-
+- memset(&vmuser_fops, 0, sizeof vmuser_fops);
+- vmuser_fops.owner = THIS_MODULE;
+- vmuser_fops.poll = LinuxDriverPoll;
+-#ifdef HAVE_UNLOCKED_IOCTL
+- vmuser_fops.unlocked_ioctl = LinuxDriver_UnlockedIoctl;
+-#else
+- vmuser_fops.ioctl = LinuxDriver_Ioctl;
+-#endif
+-#ifdef HAVE_COMPAT_IOCTL
+- vmuser_fops.compat_ioctl = LinuxDriver_UnlockedIoctl;
+-#endif
+- vmuser_fops.open = LinuxDriver_Open;
+- vmuser_fops.release = LinuxDriver_Close;
+- vmuser_fops.mmap = LinuxDriverMmap;
+-
+ #ifdef VMX86_DEVEL
+ devel_init_module();
+ linuxState.minor = 0;
+diff --git a/vmnet-only/driver.c b/vmnet-only/driver.c
+index b12b982..40bd4cf 100644
+--- a/vmnet-only/driver.c
++++ b/vmnet-only/driver.c
+@@ -165,7 +165,22 @@ static long VNetFileOpUnlockedIoctl(struct file * filp,
+ unsigned int iocmd, unsigned long ioarg);
+ #endif
+
+-static struct file_operations vnetFileOps;
++static struct file_operations vnetFileOps = {
++ .owner = THIS_MODULE,
++ .read = VNetFileOpRead,
++ .write = VNetFileOpWrite,
++ .poll = VNetFileOpPoll,
++#ifdef HAVE_UNLOCKED_IOCTL
++ .unlocked_ioctl = VNetFileOpUnlockedIoctl,
++#else
++ .ioctl = VNetFileOpIoctl,
++#endif
++#ifdef HAVE_COMPAT_IOCTL
++ .compat_ioctl = VNetFileOpUnlockedIoctl,
++#endif
++ .open = VNetFileOpOpen,
++ .release = VNetFileOpClose
++};
+
+ /*
+ * Utility functions
+@@ -476,28 +491,6 @@ init_module(void)
+ goto err_proto;
+ }
+
+- /*
+- * Initialize the file_operations structure. Because this code is always
+- * compiled as a module, this is fine to do it here and not in a static
+- * initializer.
+- */
+-
+- memset(&vnetFileOps, 0, sizeof vnetFileOps);
+- vnetFileOps.owner = THIS_MODULE;
+- vnetFileOps.read = VNetFileOpRead;
+- vnetFileOps.write = VNetFileOpWrite;
+- vnetFileOps.poll = VNetFileOpPoll;
+-#ifdef HAVE_UNLOCKED_IOCTL
+- vnetFileOps.unlocked_ioctl = VNetFileOpUnlockedIoctl;
+-#else
+- vnetFileOps.ioctl = VNetFileOpIoctl;
+-#endif
+-#ifdef HAVE_COMPAT_IOCTL
+- vnetFileOps.compat_ioctl = VNetFileOpUnlockedIoctl;
+-#endif
+- vnetFileOps.open = VNetFileOpOpen;
+- vnetFileOps.release = VNetFileOpClose;
+-
+ retval = register_chrdev(VNET_MAJOR_NUMBER, "vmnet", &vnetFileOps);
+ if (retval) {
+ LOG(0, (KERN_NOTICE "/dev/vmnet: could not register major device %d\n",
diff --git a/app-emulation/vmware-modules/files/279-makefile-include.patch b/app-emulation/vmware-modules/files/279-makefile-include.patch
new file mode 100644
index 000000000000..39c300030805
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-makefile-include.patch
@@ -0,0 +1,65 @@
+diff --git a/vmblock-only/Makefile.kernel b/vmblock-only/Makefile.kernel
+index ab7a727..e3ec9d2 100644
+--- a/vmblock-only/Makefile.kernel
++++ b/vmblock-only/Makefile.kernel
+@@ -19,7 +19,7 @@
+
+ INCLUDE += -I$(SRCROOT)/include
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+
+ EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/cachecreate.c, -DVMW_KMEMCR_HAS_DTOR, )
+ EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/cachector.c, -DVMW_KMEMCR_CTOR_HAS_3_ARGS, )
+diff --git a/vmci-only/Makefile.kernel b/vmci-only/Makefile.kernel
+index ba343ee..861ea83 100644
+--- a/vmci-only/Makefile.kernel
++++ b/vmci-only/Makefile.kernel
+@@ -21,7 +21,7 @@ CC_OPTS += -DVMCI
+
+ INCLUDE += -I$(SRCROOT)/shared -I$(SRCROOT)/common -I$(SRCROOT)/linux
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+
+ obj-m += $(DRIVER).o
+
+diff --git a/vmmon-only/Makefile.kernel b/vmmon-only/Makefile.kernel
+index 8770d1d..c4746c3 100644
+--- a/vmmon-only/Makefile.kernel
++++ b/vmmon-only/Makefile.kernel
+@@ -22,7 +22,7 @@ CC_OPTS += -DVMMON -DVMCORE
+ INCLUDE := -I$(SRCROOT)/include -I$(SRCROOT)/common -I$(SRCROOT)/linux \
+ -I$(SRCROOT)/vmcore
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+
+ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/smpcall.c, -DVMW_HAVE_SMP_CALL_3ARG, )
+
+diff --git a/vmnet-only/Makefile.kernel b/vmnet-only/Makefile.kernel
+index d1e3133..665d428 100644
+--- a/vmnet-only/Makefile.kernel
++++ b/vmnet-only/Makefile.kernel
+@@ -19,7 +19,7 @@
+
+ INCLUDE := -I$(SRCROOT)
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netdev_has_net.c,-DVMW_NETDEV_HAS_NET, )
+ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netdev_has_dev_net.c,-DVMW_NETDEV_HAS_DEV_NET, )
+ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/nfhook_uses_skb.c,-DVMW_NFHOOK_USES_SKB, )
+diff --git a/vsock-only/Makefile.kernel b/vsock-only/Makefile.kernel
+index b4629ee..264b8cb 100644
+--- a/vsock-only/Makefile.kernel
++++ b/vsock-only/Makefile.kernel
+@@ -25,7 +25,7 @@ INCLUDE += -I$(SRCROOT)/include
+ INCLUDE += -I$(SRCROOT)/linux
+ INCLUDE += -I$(SRCROOT)/common
+
+-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
++EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
+ EXTRA_CFLAGS += $(call vm_check_build, $(AUTOCONF_DIR)/netcreate_num_params.c, -DVMW_NETCREATE_KERNARG, )
+
+
diff --git a/app-emulation/vmware-modules/files/279-makefile-kernel-dir.patch b/app-emulation/vmware-modules/files/279-makefile-kernel-dir.patch
new file mode 100644
index 000000000000..1a647a3302d8
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-makefile-kernel-dir.patch
@@ -0,0 +1,85 @@
+diff --git a/vmblock-only/Makefile b/vmblock-only/Makefile
+index 2b81323..746c8b8 100644
+--- a/vmblock-only/Makefile
++++ b/vmblock-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vmblock
+ PRODUCT := ws
+diff --git a/vmci-only/Makefile b/vmci-only/Makefile
+index 8e9c5be..6ec828b 100644
+--- a/vmci-only/Makefile
++++ b/vmci-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vmci
+ PRODUCT := ws
+diff --git a/vmmon-only/Makefile b/vmmon-only/Makefile
+index 5bd867b..91a83d4 100644
+--- a/vmmon-only/Makefile
++++ b/vmmon-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vmmon
+ PRODUCT := @@PRODUCT@@
+diff --git a/vmnet-only/Makefile b/vmnet-only/Makefile
+index d4eb73c..c7c6d38 100644
+--- a/vmnet-only/Makefile
++++ b/vmnet-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vmnet
+ PRODUCT := @@PRODUCT@@
+diff --git a/vsock-only/Makefile b/vsock-only/Makefile
+index 93dd61d..9765696 100644
+--- a/vsock-only/Makefile
++++ b/vsock-only/Makefile
+@@ -49,10 +49,10 @@ VM_UNAME = $(shell uname -r)
+ ifdef LINUXINCLUDE
+ HEADER_DIR = $(LINUXINCLUDE)
+ else
+-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
++HEADER_DIR = $(KERNEL_DIR)
+ endif
+
+-BUILD_DIR = $(HEADER_DIR)/..
++BUILD_DIR = $(KBUILD_OUTPUT)
+
+ DRIVER := vsock
+ PRODUCT := ws
diff --git a/app-emulation/vmware-modules/files/279-netdevice.patch b/app-emulation/vmware-modules/files/279-netdevice.patch
new file mode 100644
index 000000000000..35231a3205e3
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-netdevice.patch
@@ -0,0 +1,24 @@
+diff --git a/vmnet-only/compat_netdevice.h b/vmnet-only/compat_netdevice.h
+index 7a56304..9ff4548 100644
+--- a/vmnet-only/compat_netdevice.h
++++ b/vmnet-only/compat_netdevice.h
+@@ -47,6 +47,19 @@
+ # define net_device device
+ #endif
+
++/* it looks like these have been removed from the kernel 3.1
++ * probably because the "transition" is considered complete.
++ * so to keep this source compatible we just redefine them like they were
++ * previously
++ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
++#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
++ functions are available. */
++#define HAVE_FREE_NETDEV /* free_netdev() */
++#define HAVE_NETDEV_PRIV /* netdev_priv() */
++#define HAVE_NETIF_QUEUE
++#define HAVE_NET_DEVICE_OPS
++#endif
+
+ /*
+ * SET_MODULE_OWNER appeared sometime during 2.3.x. It was setting
diff --git a/app-emulation/vmware-modules/files/279-putname.patch b/app-emulation/vmware-modules/files/279-putname.patch
new file mode 100644
index 000000000000..6e76130fa165
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-putname.patch
@@ -0,0 +1,13 @@
+diff --git a/vmblock-only/linux/control.c b/vmblock-only/linux/control.c
+index 79716bd..2dd83fe 100644
+--- a/vmblock-only/linux/control.c
++++ b/vmblock-only/linux/control.c
+@@ -293,7 +293,7 @@ ExecuteBlockOp(const char __user *buf, // IN: buffer with name
+
+ retval = i < 0 ? -EINVAL : blockOp(name, blocker);
+
+- putname(name);
++ __putname(name);
+
+ return retval;
+ }
diff --git a/app-emulation/vmware-modules/files/279-vfsfollowlink.patch b/app-emulation/vmware-modules/files/279-vfsfollowlink.patch
new file mode 100644
index 000000000000..13f600e39f33
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-vfsfollowlink.patch
@@ -0,0 +1,30 @@
+diff -Naur a/linux/inode.c b/linux/inode.c
+--- a/vmblock-only/linux/inode.c 2013-10-03 04:29:47.471339204 -0400
++++ b/vmblock-only/linux/inode.c 2013-10-03 04:31:56.607334636 -0400
+@@ -36,7 +36,7 @@
+
+ /* Inode operations */
+ static struct dentry *InodeOpLookup(struct inode *dir,
+- struct dentry *dentry, struct nameidata *nd);
++ struct dentry *dentry, unsigned int flags);
+ static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+ static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
+@@ -75,7 +75,7 @@
+ static struct dentry *
+ InodeOpLookup(struct inode *dir, // IN: parent directory's inode
+ struct dentry *dentry, // IN: dentry to lookup
+- struct nameidata *nd) // IN: lookup intent and information
++ unsigned int flags) // IN: lookup intent and information
+ {
+ char *filename;
+ struct inode *inode;
+@@ -221,7 +221,7 @@
+ goto out;
+ }
+
+- ret = vfs_follow_link(nd, iinfo->name);
++ nd_set_link(nd, iinfo->name);
+
+ out:
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
diff --git a/app-emulation/vmware-modules/files/279-vmblock.patch b/app-emulation/vmware-modules/files/279-vmblock.patch
new file mode 100644
index 000000000000..0daf60355618
--- /dev/null
+++ b/app-emulation/vmware-modules/files/279-vmblock.patch
@@ -0,0 +1,23 @@
+diff -ruN work.orig/vmblock-only/linux/control.c work/vmblock-only/linux/control.c
+--- work.orig/vmblock-only/linux/control.c 2013-11-02 18:05:39.960226399 +0100
++++ work/vmblock-only/linux/control.c 2013-11-02 18:09:11.760231432 +0100
+@@ -208,17 +208,14 @@
+ VMBlockSetProcEntryOwner(controlProcMountpoint);
+
+ /* Create /proc/fs/vmblock/dev */
+- controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
+- VMBLOCK_CONTROL_MODE,
+- controlProcDirEntry);
+- if (!controlProcEntry) {
++ controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME, VMBLOCK_CONTROL_MODE, controlProcDirEntry, &ControlFileOps);
++ if (controlProcEntry == NULL) {
+ Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
+ remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
+ remove_proc_entry(VMBLOCK_CONTROL_PROC_DIRNAME, NULL);
+ return -EINVAL;
+ }
+
+- controlProcEntry->proc_fops = &ControlFileOps;
+ return 0;
+ }
+
diff --git a/app-emulation/vmware-modules/files/hardened.patch b/app-emulation/vmware-modules/files/hardened.patch
new file mode 100644
index 000000000000..ea1b0f300751
--- /dev/null
+++ b/app-emulation/vmware-modules/files/hardened.patch
@@ -0,0 +1,170 @@
+diff --git a/vmci-only/linux/driver.c b/vmci-only/linux/driver.c
+index 921f25c..41a39e3 100644
+--- a/vmci-only/linux/driver.c
++++ b/vmci-only/linux/driver.c
+@@ -241,7 +241,24 @@ static unsigned int LinuxDriverPoll(struct file *file, poll_table *wait);
+ #define LinuxDriverUnlockIoctlPerFD(mutex) do {} while (0)
+ #endif
+
+-static struct file_operations vmuser_fops;
++/*
++ * Moved file operations initialize here because of incompatibilites
++ * with Gentoo hardened profile/hardend Linux 3.
++ */
++static struct file_operations vmuser_fops = {
++ .owner = THIS_MODULE,
++ .poll = LinuxDriverPoll,
++#ifdef HAVE_UNLOCKED_IOCTL
++ .unlocked_ioctl = LinuxDriver_UnlockedIoctl,
++#else
++ .ioctl = LinuxDriver_Ioctl,
++#endif
++#ifdef HAVE_COMPAT_IOCTL
++ .compat_ioctl = LinuxDriver_UnlockedIoctl,
++#endif
++ .open = LinuxDriver_Open,
++ .release = LinuxDriver_Close
++};
+
+
+ /*
+@@ -378,26 +395,6 @@ vmci_host_init(void)
+ return -ENOMEM;
+ }
+
+- /*
+- * Initialize the file_operations structure. Because this code is always
+- * compiled as a module, this is fine to do it here and not in a static
+- * initializer.
+- */
+-
+- memset(&vmuser_fops, 0, sizeof vmuser_fops);
+- vmuser_fops.owner = THIS_MODULE;
+- vmuser_fops.poll = LinuxDriverPoll;
+-#ifdef HAVE_UNLOCKED_IOCTL
+- vmuser_fops.unlocked_ioctl = LinuxDriver_UnlockedIoctl;
+-#else
+- vmuser_fops.ioctl = LinuxDriver_Ioctl;
+-#endif
+-#ifdef HAVE_COMPAT_IOCTL
+- vmuser_fops.compat_ioctl = LinuxDriver_UnlockedIoctl;
+-#endif
+- vmuser_fops.open = LinuxDriver_Open;
+- vmuser_fops.release = LinuxDriver_Close;
+-
+ sprintf(linuxState.deviceName, "vmci");
+ linuxState.major = 10;
+ linuxState.misc.minor = MISC_DYNAMIC_MINOR;
+diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
+index b21dd44..960c2aa 100644
+--- a/vmmon-only/linux/driver.c
++++ b/vmmon-only/linux/driver.c
+@@ -178,7 +178,22 @@ static struct vm_operations_struct vmuser_mops = {
+ #endif
+ };
+
+-static struct file_operations vmuser_fops;
++static struct file_operations vmuser_fops = {
++ .owner = THIS_MODULE,
++ .poll = LinuxDriverPoll,
++#ifdef HAVE_UNLOCKED_IOCTL
++ .unlocked_ioctl = LinuxDriver_UnlockedIoctl,
++#else
++ .ioctl = LinuxDriver_Ioctl,
++#endif
++#ifdef HAVE_COMPAT_IOCTL
++ .compat_ioctl = LinuxDriver_UnlockedIoctl,
++#endif
++ .open = LinuxDriver_Open,
++ .release = LinuxDriver_Close,
++ .mmap = LinuxDriverMmap
++};
++
+ static struct timer_list tscTimer;
+
+ /*
+@@ -357,27 +372,6 @@ init_module(void)
+ spin_lock_init(&linuxState.pollListLock);
+ #endif
+
+- /*
+- * Initialize the file_operations structure. Because this code is always
+- * compiled as a module, this is fine to do it here and not in a static
+- * initializer.
+- */
+-
+- memset(&vmuser_fops, 0, sizeof vmuser_fops);
+- vmuser_fops.owner = THIS_MODULE;
+- vmuser_fops.poll = LinuxDriverPoll;
+-#ifdef HAVE_UNLOCKED_IOCTL
+- vmuser_fops.unlocked_ioctl = LinuxDriver_UnlockedIoctl;
+-#else
+- vmuser_fops.ioctl = LinuxDriver_Ioctl;
+-#endif
+-#ifdef HAVE_COMPAT_IOCTL
+- vmuser_fops.compat_ioctl = LinuxDriver_UnlockedIoctl;
+-#endif
+- vmuser_fops.open = LinuxDriver_Open;
+- vmuser_fops.release = LinuxDriver_Close;
+- vmuser_fops.mmap = LinuxDriverMmap;
+-
+ #ifdef VMX86_DEVEL
+ devel_init_module();
+ linuxState.minor = 0;
+diff --git a/vmnet-only/driver.c b/vmnet-only/driver.c
+index b12b982..40bd4cf 100644
+--- a/vmnet-only/driver.c
++++ b/vmnet-only/driver.c
+@@ -165,7 +165,22 @@ static long VNetFileOpUnlockedIoctl(struct file * filp,
+ unsigned int iocmd, unsigned long ioarg);
+ #endif
+
+-static struct file_operations vnetFileOps;
++static struct file_operations vnetFileOps = {
++ .owner = THIS_MODULE,
++ .read = VNetFileOpRead,
++ .write = VNetFileOpWrite,
++ .poll = VNetFileOpPoll,
++#ifdef HAVE_UNLOCKED_IOCTL
++ .unlocked_ioctl = VNetFileOpUnlockedIoctl,
++#else
++ .ioctl = VNetFileOpIoctl,
++#endif
++#ifdef HAVE_COMPAT_IOCTL
++ .compat_ioctl = VNetFileOpUnlockedIoctl,
++#endif
++ .open = VNetFileOpOpen,
++ .release = VNetFileOpClose
++};
+
+ /*
+ * Utility functions
+@@ -476,28 +491,6 @@ init_module(void)
+ goto err_proto;
+ }
+
+- /*
+- * Initialize the file_operations structure. Because this code is always
+- * compiled as a module, this is fine to do it here and not in a static
+- * initializer.
+- */
+-
+- memset(&vnetFileOps, 0, sizeof vnetFileOps);
+- vnetFileOps.owner = THIS_MODULE;
+- vnetFileOps.read = VNetFileOpRead;
+- vnetFileOps.write = VNetFileOpWrite;
+- vnetFileOps.poll = VNetFileOpPoll;
+-#ifdef HAVE_UNLOCKED_IOCTL
+- vnetFileOps.unlocked_ioctl = VNetFileOpUnlockedIoctl;
+-#else
+- vnetFileOps.ioctl = VNetFileOpIoctl;
+-#endif
+-#ifdef HAVE_COMPAT_IOCTL
+- vnetFileOps.compat_ioctl = VNetFileOpUnlockedIoctl;
+-#endif
+- vnetFileOps.open = VNetFileOpOpen;
+- vnetFileOps.release = VNetFileOpClose;
+-
+ retval = register_chrdev(VNET_MAJOR_NUMBER, "vmnet", &vnetFileOps);
+ if (retval) {
+ LOG(0, (KERN_NOTICE "/dev/vmnet: could not register major device %d\n",
diff --git a/app-emulation/vmware-modules/metadata.xml b/app-emulation/vmware-modules/metadata.xml
new file mode 100644
index 000000000000..e5af2b1722dd
--- /dev/null
+++ b/app-emulation/vmware-modules/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>vmware</herd>
+ <use>
+ <flag name="pax_kernel">Apply patch needed for pax enabled kernels</flag>
+ <flag name="vmci">Build the Virtual Machine Communication Interface module; disable this if you want to use the module from the mainline kernel</flag>
+ <flag name="vsock">Build the VMware VMCI transport for Virtual Sockets; disable this if you want to use the module from the mainline kernel</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/vmware-modules/vmware-modules-271.3.ebuild b/app-emulation/vmware-modules/vmware-modules-271.3.ebuild
new file mode 100644
index 000000000000..e284750c960c
--- /dev/null
+++ b/app-emulation/vmware-modules/vmware-modules-271.3.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic linux-info linux-mod user versionator udev
+
+PV_MAJOR=$(get_major_version)
+PV_MINOR=$(get_version_component_range 2)
+
+DESCRIPTION="VMware kernel modules"
+HOMEPAGE="http://www.vmware.com/"
+
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="pax_kernel"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ || ( =app-emulation/vmware-player-5.0.${PV_MINOR}*
+ =app-emulation/vmware-workstation-9.0.${PV_MINOR}* )"
+
+S=${WORKDIR}
+
+pkg_setup() {
+ CONFIG_CHECK="~HIGH_RES_TIMERS"
+ if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then
+ CONFIG_CHECK="${CONFIG_CHECK} BKL"
+ fi
+
+ linux-info_pkg_setup
+
+ linux-mod_pkg_setup
+
+ VMWARE_GROUP=${VMWARE_GROUP:-vmware}
+
+ VMWARE_MODULE_LIST="vmblock vmci vmmon vmnet vsock"
+ VMWARE_MOD_DIR="${PN}-${PVR}"
+
+ BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
+
+ enewgroup "${VMWARE_GROUP}"
+ filter-flags -mfpmath=sse
+
+ for mod in ${VMWARE_MODULE_LIST}; do
+ MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"
+ done
+}
+
+src_unpack() {
+ cd "${S}"
+ for mod in ${VMWARE_MODULE_LIST}; do
+ tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar
+ done
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch"
+ use pax_kernel && epatch "${FILESDIR}/hardened.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-apic.patch"
+ kernel_is ge 3 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-putname.patch"
+ kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10.0.patch"
+ kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-filldir.patch"
+ kernel_is ge 3 12 0 && epatch "${FILESDIR}/${PV_MAJOR}-vfsfollowlink.patch"
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_install() {
+ linux-mod_src_install
+ local udevrules="${T}/60-vmware.rules"
+ cat > "${udevrules}" <<-EOF
+ KERNEL=="vmci", GROUP="vmware", MODE=660
+ KERNEL=="vmmon", GROUP="vmware", MODE=660
+ KERNEL=="vsock", GROUP="vmware", MODE=660
+ EOF
+ udev_dorules "${udevrules}"
+}
diff --git a/app-emulation/vmware-modules/vmware-modules-279.1-r1.ebuild b/app-emulation/vmware-modules/vmware-modules-279.1-r1.ebuild
new file mode 100644
index 000000000000..0c4018d34a2e
--- /dev/null
+++ b/app-emulation/vmware-modules/vmware-modules-279.1-r1.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod user versionator udev
+
+PV_MAJOR=$(get_major_version)
+PV_MINOR=$(get_version_component_range 2)
+
+DESCRIPTION="VMware kernel modules"
+HOMEPAGE="http://www.vmware.com/"
+
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="pax_kernel +vmci +vsock"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ || ( =app-emulation/vmware-player-6.0.${PV_MINOR}*
+ =app-emulation/vmware-workstation-10.0.${PV_MINOR}* )"
+
+S=${WORKDIR}
+
+pkg_setup() {
+ CONFIG_CHECK="~HIGH_RES_TIMERS"
+ if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then
+ CONFIG_CHECK="${CONFIG_CHECK} BKL"
+ fi
+ if use vmci ; then
+ CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI"
+ else
+ CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI"
+ fi
+ if use vsock ; then
+ CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS"
+ else
+ CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS"
+ fi
+
+ linux-info_pkg_setup
+
+ linux-mod_pkg_setup
+
+ VMWARE_GROUP=${VMWARE_GROUP:-vmware}
+
+ VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock"
+ VMWARE_MODULE_LIST="vmblock vmmon vmnet"
+ use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci"
+ use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock"
+
+ VMWARE_MOD_DIR="${PN}-${PVR}"
+
+ BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
+
+ enewgroup "${VMWARE_GROUP}"
+ filter-flags -mfpmath=sse
+
+ for mod in ${VMWARE_MODULE_LIST}; do
+ MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"
+ done
+}
+
+src_unpack() {
+ cd "${S}"
+ for mod in ${VMWARE_MODULE_LIST_ALL}; do
+ tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar
+ done
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch"
+ use pax_kernel && epatch "${FILESDIR}/279-hardened.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-apic.patch"
+ kernel_is ge 3 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-putname.patch"
+ kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-vmblock.patch"
+ kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-filldir.patch"
+ kernel_is ge 3 12 0 && epatch "${FILESDIR}/${PV_MAJOR}-vfsfollowlink.patch"
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_install() {
+ linux-mod_src_install
+ local udevrules="${T}/60-vmware.rules"
+ cat > "${udevrules}" <<-EOF
+ KERNEL=="vmci", GROUP="vmware", MODE=660
+ KERNEL=="vmw_vmci", GROUP="vmware", MODE=660
+ KERNEL=="vmmon", GROUP="vmware", MODE=660
+ KERNEL=="vsock", GROUP="vmware", MODE=660
+ EOF
+ udev_dorules "${udevrules}"
+}
diff --git a/app-emulation/vmware-modules/vmware-modules-279.2.ebuild b/app-emulation/vmware-modules/vmware-modules-279.2.ebuild
new file mode 100644
index 000000000000..0c4018d34a2e
--- /dev/null
+++ b/app-emulation/vmware-modules/vmware-modules-279.2.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod user versionator udev
+
+PV_MAJOR=$(get_major_version)
+PV_MINOR=$(get_version_component_range 2)
+
+DESCRIPTION="VMware kernel modules"
+HOMEPAGE="http://www.vmware.com/"
+
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="pax_kernel +vmci +vsock"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ || ( =app-emulation/vmware-player-6.0.${PV_MINOR}*
+ =app-emulation/vmware-workstation-10.0.${PV_MINOR}* )"
+
+S=${WORKDIR}
+
+pkg_setup() {
+ CONFIG_CHECK="~HIGH_RES_TIMERS"
+ if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then
+ CONFIG_CHECK="${CONFIG_CHECK} BKL"
+ fi
+ if use vmci ; then
+ CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI"
+ else
+ CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI"
+ fi
+ if use vsock ; then
+ CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS"
+ else
+ CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS"
+ fi
+
+ linux-info_pkg_setup
+
+ linux-mod_pkg_setup
+
+ VMWARE_GROUP=${VMWARE_GROUP:-vmware}
+
+ VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock"
+ VMWARE_MODULE_LIST="vmblock vmmon vmnet"
+ use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci"
+ use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock"
+
+ VMWARE_MOD_DIR="${PN}-${PVR}"
+
+ BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
+
+ enewgroup "${VMWARE_GROUP}"
+ filter-flags -mfpmath=sse
+
+ for mod in ${VMWARE_MODULE_LIST}; do
+ MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"
+ done
+}
+
+src_unpack() {
+ cd "${S}"
+ for mod in ${VMWARE_MODULE_LIST_ALL}; do
+ tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar
+ done
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch"
+ use pax_kernel && epatch "${FILESDIR}/279-hardened.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-apic.patch"
+ kernel_is ge 3 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-putname.patch"
+ kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-vmblock.patch"
+ kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-filldir.patch"
+ kernel_is ge 3 12 0 && epatch "${FILESDIR}/${PV_MAJOR}-vfsfollowlink.patch"
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_install() {
+ linux-mod_src_install
+ local udevrules="${T}/60-vmware.rules"
+ cat > "${udevrules}" <<-EOF
+ KERNEL=="vmci", GROUP="vmware", MODE=660
+ KERNEL=="vmw_vmci", GROUP="vmware", MODE=660
+ KERNEL=="vmmon", GROUP="vmware", MODE=660
+ KERNEL=="vsock", GROUP="vmware", MODE=660
+ EOF
+ udev_dorules "${udevrules}"
+}
diff --git a/app-emulation/vmware-modules/vmware-modules-279.3.ebuild b/app-emulation/vmware-modules/vmware-modules-279.3.ebuild
new file mode 100644
index 000000000000..0c4018d34a2e
--- /dev/null
+++ b/app-emulation/vmware-modules/vmware-modules-279.3.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod user versionator udev
+
+PV_MAJOR=$(get_major_version)
+PV_MINOR=$(get_version_component_range 2)
+
+DESCRIPTION="VMware kernel modules"
+HOMEPAGE="http://www.vmware.com/"
+
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="pax_kernel +vmci +vsock"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ || ( =app-emulation/vmware-player-6.0.${PV_MINOR}*
+ =app-emulation/vmware-workstation-10.0.${PV_MINOR}* )"
+
+S=${WORKDIR}
+
+pkg_setup() {
+ CONFIG_CHECK="~HIGH_RES_TIMERS"
+ if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then
+ CONFIG_CHECK="${CONFIG_CHECK} BKL"
+ fi
+ if use vmci ; then
+ CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI"
+ else
+ CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI"
+ fi
+ if use vsock ; then
+ CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS"
+ else
+ CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS"
+ fi
+
+ linux-info_pkg_setup
+
+ linux-mod_pkg_setup
+
+ VMWARE_GROUP=${VMWARE_GROUP:-vmware}
+
+ VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock"
+ VMWARE_MODULE_LIST="vmblock vmmon vmnet"
+ use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci"
+ use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock"
+
+ VMWARE_MOD_DIR="${PN}-${PVR}"
+
+ BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
+
+ enewgroup "${VMWARE_GROUP}"
+ filter-flags -mfpmath=sse
+
+ for mod in ${VMWARE_MODULE_LIST}; do
+ MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"
+ done
+}
+
+src_unpack() {
+ cd "${S}"
+ for mod in ${VMWARE_MODULE_LIST_ALL}; do
+ tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar
+ done
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch"
+ use pax_kernel && epatch "${FILESDIR}/279-hardened.patch"
+ epatch "${FILESDIR}/${PV_MAJOR}-apic.patch"
+ kernel_is ge 3 7 0 && epatch "${FILESDIR}/${PV_MAJOR}-putname.patch"
+ kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-vmblock.patch"
+ kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-filldir.patch"
+ kernel_is ge 3 12 0 && epatch "${FILESDIR}/${PV_MAJOR}-vfsfollowlink.patch"
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_install() {
+ linux-mod_src_install
+ local udevrules="${T}/60-vmware.rules"
+ cat > "${udevrules}" <<-EOF
+ KERNEL=="vmci", GROUP="vmware", MODE=660
+ KERNEL=="vmw_vmci", GROUP="vmware", MODE=660
+ KERNEL=="vmmon", GROUP="vmware", MODE=660
+ KERNEL=="vsock", GROUP="vmware", MODE=660
+ EOF
+ udev_dorules "${udevrules}"
+}
diff --git a/app-emulation/vmware-player/Manifest b/app-emulation/vmware-player/Manifest
new file mode 100644
index 000000000000..23833ca2ba75
--- /dev/null
+++ b/app-emulation/vmware-player/Manifest
@@ -0,0 +1,8 @@
+DIST VMware-Player-5.0.3-1410761.i386.bundle.tar 220047360 SHA256 cf821022b093c9aef768596131085d0c5adcef25339dddefbc0a214e00645a97 SHA512 4660efa92671b33cd701dc37b86d8a18a84acd4e85b660f6e4e9f60c71bbe744574eb07fd563d6fda2626768eeaa9ee7c64c2f61f9b3cdd0eab666ec62abde48 WHIRLPOOL 39e4a85b176f27c0019ab3d8fde2f91973932e81896b006845f7059a4306ed324b7422857cfa4896c7ef216cca937ae238fdbcee4e5c72df86e49a0d52411652
+DIST VMware-Player-5.0.3-1410761.x86_64.bundle.tar 185425920 SHA256 e2ef55702e06646a4465baa16ddb742dd7f9e8021e8f53670a33d7e8f996c678 SHA512 8560ecfb1525d991ac0d3f665c8a89aae81d429cf94ff56fbd22fbd9f41f5a03a56d874811876aaae8042e81f4b57a298e4d29327dab94492c5ded8a58b81071 WHIRLPOOL 8f1c8997e0e2ff90e227474d9b7791b702d180af9a669a9de62a4bc6e373468bca1d7fa8ea9e28e5491992f2b9b0d6d1370a856751422190cafcd6c04682ed07
+DIST VMware-Player-6.0.1-1379776.i386.bundle.tar 232140800 SHA256 3f9bd8b5df203c6e5a2022f0a0c8dfe9fcae17f70f269a9bfe3790be171fe95b SHA512 525fbcc9dfa6856ce2ca926ac3d8b87beca96695b131eb87623756d8b751165b9b693e5d4f0fde5ad752f56c548d9879e983e7fd96d64c9b13357471697e8f61 WHIRLPOOL ab9b0ff567eb91726ba5ac17d2eb1dfcf748f3dff2cfa3c62bfd34b33cfc43d6d9871fe0f5940dc8a58ce62c7151c7153e1699ac319658358fc1f4ae8d85cc55
+DIST VMware-Player-6.0.1-1379776.x86_64.bundle.tar 199587840 SHA256 f108a03892ee180ecff98c59dbe1ea014a23e6fa6dafc83169972c9c300fb69f SHA512 b5218881d7e331aee7e6b834b32d262d09e1e9e8cd33ced0b38a815e2085ab935974980ac15475ce1678fc36816ebc408dced71a200c7642015313dcff34356e WHIRLPOOL 40220941297512a58807fe1a8c69b375ff48835615dacf658e97bc39a00b4d9244db5016f1f2b2e2ccb7524b92f7e4943419a7eb8c6d19a947ddb3db52cfcd3d
+DIST VMware-Player-6.0.2-1744117.i386.bundle.tar 233226240 SHA256 b3314b1b4658fff3a3bd821381e141b4039bc6925088d509f073dfdc19f78937 SHA512 da912c898306a50392cdf814f523321962e70d6d2afabe2cbcec35e581c60d1ba3e28fdf11f4e83306c9057038a7ab8d1d1e2e4281068fdb9997f6d1aaf34e74 WHIRLPOOL bdd81a3620a56a689f48443d8cb0fc5dbde8ec5d996fcff5e38a983eb4fa5d6bfb73658f1b15837f6c4272578b4f90875f9393db3318ee9ad84cf1266fbcbed5
+DIST VMware-Player-6.0.2-1744117.x86_64.bundle.tar 200560640 SHA256 6e8ef0982303128fe2d41f59cc6d4031edcc85f4dcc8ba20e17df9837a4c972f SHA512 8e71b59e5152ec6a21e2bc87e11462fbc9f25a27ea48e73ace6daa198bc75fb0cf49d895755abe10b3fb52df0ec0586fd00e8bd51c461b7a638e745c6bbd996e WHIRLPOOL a9af879ce290a9f0ac2fb5f6af425e509455d6fb553156250013a941e782c416435be7326498ed544ee81623fbac4a5924940cc05dd56325c0d8e4c71c44b0b8
+DIST VMware-Player-6.0.3-1895310.i386.bundle.tar 233216000 SHA256 7e7afedc7cef2c10e018924e26143dfea4e7bbe1de8fc3f30ff6d6ffe681a57b SHA512 3d00bfc0f1978ece042d5dca72bebcbb37761a83678ae645c77c8e87ca4b1b7bce63b857c9f455b0dce8fda1ba1b6c2b787794bebf5ed1faa8dced78316cc060 WHIRLPOOL c6284b025f0a772674987cef231b43bb32d3e0605c575a4b8156a2c2720f5c6c35eef496495d80ed83c9a8b49d16a3d26d8c333e1eabcf1d2cf55b4775a56b17
+DIST VMware-Player-6.0.3-1895310.x86_64.bundle.tar 200550400 SHA256 6ab3d3c718d2973f486b69dfe9ad70c4a091640454f8ac8a78d505b2f57d59af SHA512 492f48e73eaf820645e6db99672106b5cc6148b53266729b85011844300b97d9cf2c36305d28ec77cc61ec70fe2883322bd23254ba3495b95bb6d92021b38036 WHIRLPOOL 9e9d8bebd05b8a4c4d2f940d6daf1305d16de31cc096f7b2ec966e9610b37cda991a2fea9f3249bbe679b6dc25c52c119a9992a94cca54fdc786737387f37b04
diff --git a/app-emulation/vmware-player/files/config-3.0 b/app-emulation/vmware-player/files/config-3.0
new file mode 100644
index 000000000000..cc83931d70bf
--- /dev/null
+++ b/app-emulation/vmware-player/files/config-3.0
@@ -0,0 +1,10 @@
+VMCI_CONFED = "yes"
+NETWORKING = "yes"
+initscriptdir = "/etc/init.d"
+VMBLOCK_CONFED = "yes"
+authd.fullpath = "@@VM_INSTALL_DIR@@/sbin/vmware-authd"
+gksu.rootMethod = "su"
+VSOCK_CONFED = "yes"
+libdir = "@@VM_INSTALL_DIR@@/lib/vmware"
+bindir = "@@VM_INSTALL_DIR@@/bin"
+product.buildNumber = "@@BUILD_NUMBER@@"
diff --git a/app-emulation/vmware-player/files/list-bundle-components.xsl b/app-emulation/vmware-player/files/list-bundle-components.xsl
new file mode 100644
index 000000000000..db1a4e4f6602
--- /dev/null
+++ b/app-emulation/vmware-player/files/list-bundle-components.xsl
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output omit-xml-declaration="yes"/>
+
+ <xsl:template match="text()"/>
+
+ <xsl:template match="/bundle/components/component">
+ <xsl:value-of select="@offset"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@size"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/app-emulation/vmware-player/files/list-component-files.xsl b/app-emulation/vmware-player/files/list-component-files.xsl
new file mode 100644
index 000000000000..91c6152fa21b
--- /dev/null
+++ b/app-emulation/vmware-player/files/list-component-files.xsl
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output omit-xml-declaration="yes"/>
+
+ <xsl:template match="text()"/>
+
+ <xsl:template match="/component/fileset/file">
+ <xsl:value-of select="@offset"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@compressedSize"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@uncompressedSize"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@path"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/app-emulation/vmware-player/files/vmware-3.0.rc b/app-emulation/vmware-player/files/vmware-3.0.rc
new file mode 100644
index 000000000000..25299fc35563
--- /dev/null
+++ b/app-emulation/vmware-player/files/vmware-3.0.rc
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ use net
+}
+
+start() {
+ ebegin Starting VMware USB Arbitrator
+ #start-stop-daemon --start --exec @@BINDIR@@/vmware-usbarbitrator
+ @@BINDIR@@/vmware-usbarbitrator
+ eend $?
+ ebegin Starting VMware services
+ modprobe -a vmmon vmci vsock vmblock vmnet
+ eend $?
+ @@BINDIR@@/vmware-networks --start
+ eend $?
+}
+
+stop() {
+ ebegin Stopping VMware USB Arbitrator
+ #start-stop-daemon --stop --exec @@BINDIR@@/vmware-usbarbitrator
+ killall --wait @@BINDIR@@/vmware-usbarbitrator
+ eend $?
+ @@BINDIR@@/vmware-networks --stop
+ eend $?
+ ebegin Stopping VMware services
+ modprobe -r vsock vmci vmmon vmblock vmnet
+ eend $?
+}
diff --git a/app-emulation/vmware-player/metadata.xml b/app-emulation/vmware-player/metadata.xml
new file mode 100644
index 000000000000..aef2572555a8
--- /dev/null
+++ b/app-emulation/vmware-player/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>vmware</herd>
+ <longdescription lang="en">
+ VMware Player - free desktop virtualization software application - makes it
+ easy to operate any virtual machine created by VMware Workstation, VMware Fusion,
+ VMware Server or VMware ESX, as well as Microsoft Virtual Server virtual
+ machines or Microsoft Virtual PC virtual machines.
+ </longdescription>
+ <use>
+ <flag name="vmware-tools">Install VMware Tools images</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/vmware-player/vmware-player-5.0.3.1410761.ebuild b/app-emulation/vmware-player/vmware-player-5.0.3.1410761.ebuild
new file mode 100644
index 000000000000..0a4a5d928bb8
--- /dev/null
+++ b/app-emulation/vmware-player/vmware-player-5.0.3.1410761.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator fdo-mime gnome2-utils pax-utils vmware-bundle
+
+MY_PN="VMware-Player"
+MY_PV=$(get_version_component_range 1-3)
+PV_MINOR=$(get_version_component_range 3)
+PV_BUILD=$(get_version_component_range 4)
+MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
+
+DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
+HOMEPAGE="http://www.vmware.com/products/player/"
+BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/player/${MY_PV}/${PV_BUILD}/linux/core/"
+SRC_URI="
+ x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
+ amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
+ "
+
+LICENSE="vmware GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="cups doc +vmware-tools"
+RESTRICT="strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="dev-cpp/cairomm
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:2.4
+ dev-cpp/libgnomecanvasmm:2.6
+ dev-cpp/pangomm:1.4
+ dev-libs/atk
+ dev-libs/glib:2
+ dev-libs/libaio
+ dev-libs/libsigc++
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ dev-libs/xmlrpc-c
+ gnome-base/libgnomecanvas
+ gnome-base/libgtop:2
+ gnome-base/librsvg:2
+ gnome-base/orbit
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libart_lgpl
+ =media-libs/libpng-1.2*
+ net-misc/curl
+ cups? ( net-print/cups )
+ sys-devel/gcc
+ sys-fs/fuse
+ sys-libs/glibc
+ sys-libs/zlib
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libgksu
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXcomposite
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXft
+ x11-libs/libXi
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libXtst
+ x11-libs/pango
+ x11-libs/startup-notification
+ !app-emulation/vmware-workstation"
+PDEPEND="~app-emulation/vmware-modules-271.${PV_MINOR}
+ vmware-tools? ( app-emulation/vmware-tools )"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+
+src_unpack() {
+ default
+ local bundle=${A%.tar}
+
+ local component ; for component in \
+ vmware-player \
+ vmware-player-app \
+ vmware-vmx \
+ vmware-usbarbitrator \
+ vmware-network-editor \
+ vmware-player-setup
+ #vmware-ovftool
+ do
+ vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
+ done
+}
+
+src_prepare() {
+ rm -f bin/vmware-modconfig
+ rm -rf lib/modules/binary
+ # Bug 459566
+ mv lib/libvmware-netcfg.so lib/lib/
+}
+
+clean_bundled_libs() {
+ ebegin 'Removing superfluous libraries'
+ # exclude OpenSSL from unbundling until the AES-NI patch gets into the tree
+ # see http://forums.gentoo.org/viewtopic-t-835867.html
+ # must use shipped libgcr.so.0 or else "undefined symbol: gcr_certificate_widget_new"
+ ldconfig -p | sed 's:^\s\+\([^(]*[^( ]\).*=> \(/.*\)$:\1 \2:g;t;d' | fgrep -v 'libcrypto.so.0.9.8
+libssl.so.0.9.8
+libgcr.so.0' | while read -r libname libpath ; do
+ dosym "${libpath}" "${VM_INSTALL_DIR}/lib/vmware/lib/${libname}/${libname}"
+ done
+ eend
+}
+
+src_install() {
+ # install the binaries
+ into "${VM_INSTALL_DIR}"
+ dobin bin/* || die "failed to install bin"
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r lib/*
+
+ # Bug 432918
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
+
+ # install the ancillaries
+ insinto /usr
+ doins -r share
+
+ if use cups; then
+ exeinto $(cups-config --serverbin)/filter
+ doexe extras/thnucups
+
+ insinto /etc/cups
+ doins -r etc/cups/*
+ fi
+
+ # install documentation
+ if use doc; then
+ dodoc doc/*
+ fi
+
+ exeinto "${VM_INSTALL_DIR}"/lib/vmware/setup
+ doexe vmware-config
+
+ # create symlinks for the various tools
+ local tool ; for tool in thnuclnt vmplayer{,-daemon} \
+ vmware-{acetool,unity-helper,modconfig{,-console},gksu,fuseUI} ; do
+ dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
+ done
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
+ fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
+
+ pax-mark -m "${D}${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx
+
+ # create the environment
+ local envd="${T}/90vmware"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}" || die
+
+ # create the configuration
+ dodir /etc/vmware || die
+
+ cat > "${D}"/etc/vmware/bootstrap <<-EOF
+ BINDIR='${VM_INSTALL_DIR}/bin'
+ LIBDIR='${VM_INSTALL_DIR}/lib'
+ EOF
+
+ cat > "${D}"/etc/vmware/config <<-EOF
+ bindir = "${VM_INSTALL_DIR}/bin"
+ libdir = "${VM_INSTALL_DIR}/lib/vmware"
+ initscriptdir = "/etc/init.d"
+ authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
+ gksu.rootMethod = "su"
+ VMCI_CONFED = "yes"
+ VMBLOCK_CONFED = "yes"
+ VSOCK_CONFED = "yes"
+ NETWORKING = "yes"
+ player.product.version = "${MY_PV}"
+ product.buildNumber = "${PV_BUILD}"
+ EOF
+
+ # install the init.d script
+ local initscript="${T}/vmware.rc"
+
+ sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ "${FILESDIR}/vmware-3.0.rc" > "${initscript}" || die
+ newinitd "${initscript}" vmware || die
+
+ # fill in variable placeholders
+ sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
+ -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}} || die
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/${PN}.desktop" || die
+}
+
+pkg_config() {
+ "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+ ewarn ""
+ ewarn "Before you can use vmware-player, you must configure a default network setup."
+ ewarn "You can do this by running 'emerge --config ${PN}'."
+}
+
+pkg_prerm() {
+ einfo "Stopping ${PN} for safe unmerge"
+ /etc/init.d/vmware stop
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vmware-player/vmware-player-6.0.1.1379776.ebuild b/app-emulation/vmware-player/vmware-player-6.0.1.1379776.ebuild
new file mode 100644
index 000000000000..b103c88f554a
--- /dev/null
+++ b/app-emulation/vmware-player/vmware-player-6.0.1.1379776.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils versionator fdo-mime gnome2-utils pax-utils vmware-bundle
+
+MY_PN="VMware-Player"
+MY_PV=$(get_version_component_range 1-3)
+PV_MINOR=$(get_version_component_range 3)
+PV_BUILD=$(get_version_component_range 4)
+MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
+
+DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
+HOMEPAGE="http://www.vmware.com/products/player/"
+BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/player/${MY_PV}/${PV_BUILD}/linux/core/"
+SRC_URI="
+ x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
+ amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
+ "
+
+LICENSE="vmware GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="cups doc +vmware-tools"
+RESTRICT="strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="dev-cpp/cairomm
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:2.4
+ dev-cpp/libgnomecanvasmm:2.6
+ dev-cpp/pangomm:1.4
+ dev-libs/atk
+ dev-libs/glib:2
+ dev-libs/libaio
+ dev-libs/libsigc++
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ dev-libs/xmlrpc-c
+ gnome-base/libgnomecanvas
+ gnome-base/libgtop:2
+ gnome-base/librsvg:2
+ gnome-base/orbit
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libart_lgpl
+ =media-libs/libpng-1.2*
+ net-misc/curl
+ cups? ( net-print/cups )
+ sys-devel/gcc
+ sys-fs/fuse
+ sys-libs/glibc
+ sys-libs/zlib
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libgksu
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXcomposite
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXft
+ x11-libs/libXi
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libXtst
+ x11-libs/pango
+ x11-libs/startup-notification
+ !app-emulation/vmware-workstation"
+PDEPEND="~app-emulation/vmware-modules-279.${PV_MINOR}
+ vmware-tools? ( app-emulation/vmware-tools )"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+
+src_unpack() {
+ default
+ local bundle=${A%.tar}
+
+ local component ; for component in \
+ vmware-player \
+ vmware-player-app \
+ vmware-vmx \
+ vmware-usbarbitrator \
+ vmware-network-editor \
+ vmware-player-setup
+ #vmware-ovftool
+ do
+ vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
+ done
+}
+
+src_prepare() {
+ rm -f bin/vmware-modconfig
+ rm -rf lib/modules/binary
+ # Bug 459566
+ mv lib/libvmware-netcfg.so lib/lib/
+}
+
+clean_bundled_libs() {
+ ebegin 'Removing superfluous libraries'
+ # exclude OpenSSL from unbundling until the AES-NI patch gets into the tree
+ # see http://forums.gentoo.org/viewtopic-t-835867.html
+ # must use shipped libgcr.so.0 or else "undefined symbol: gcr_certificate_widget_new"
+ ldconfig -p | sed 's:^\s\+\([^(]*[^( ]\).*=> \(/.*\)$:\1 \2:g;t;d' | fgrep -v 'libcrypto.so.0.9.8
+libssl.so.0.9.8
+libgcr.so.0' | while read -r libname libpath ; do
+ dosym "${libpath}" "${VM_INSTALL_DIR}/lib/vmware/lib/${libname}/${libname}"
+ done
+ eend
+}
+
+src_install() {
+ # install the binaries
+ into "${VM_INSTALL_DIR}"
+ dobin bin/* || die "failed to install bin"
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r lib/*
+
+ # Bug 432918
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
+
+ # install the ancillaries
+ insinto /usr
+ doins -r share
+
+ if use cups; then
+ exeinto $(cups-config --serverbin)/filter
+ doexe extras/thnucups
+
+ insinto /etc/cups
+ doins -r etc/cups/*
+ fi
+
+ # install documentation
+ if use doc; then
+ dodoc doc/*
+ fi
+
+ exeinto "${VM_INSTALL_DIR}"/lib/vmware/setup
+ doexe vmware-config
+
+ # create symlinks for the various tools
+ local tool ; for tool in thnuclnt vmplayer{,-daemon} \
+ vmware-{acetool,unity-helper,modconfig{,-console},gksu,fuseUI} ; do
+ dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
+ done
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
+ fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
+
+ pax-mark -m "${D}${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx
+
+ # create the environment
+ local envd="${T}/90vmware"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}" || die
+
+ # create the configuration
+ dodir /etc/vmware || die
+
+ cat > "${D}"/etc/vmware/bootstrap <<-EOF
+ BINDIR='${VM_INSTALL_DIR}/bin'
+ LIBDIR='${VM_INSTALL_DIR}/lib'
+ EOF
+
+ cat > "${D}"/etc/vmware/config <<-EOF
+ bindir = "${VM_INSTALL_DIR}/bin"
+ libdir = "${VM_INSTALL_DIR}/lib/vmware"
+ initscriptdir = "/etc/init.d"
+ authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
+ gksu.rootMethod = "su"
+ VMCI_CONFED = "yes"
+ VMBLOCK_CONFED = "yes"
+ VSOCK_CONFED = "yes"
+ NETWORKING = "yes"
+ player.product.version = "${MY_PV}"
+ product.buildNumber = "${PV_BUILD}"
+ EOF
+
+ # install the init.d script
+ local initscript="${T}/vmware.rc"
+
+ sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ "${FILESDIR}/vmware-3.0.rc" > "${initscript}" || die
+ newinitd "${initscript}" vmware || die
+
+ # fill in variable placeholders
+ sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
+ -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}} || die
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/${PN}.desktop" || die
+}
+
+pkg_config() {
+ "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+ ewarn ""
+ ewarn "Before you can use vmware-player, you must configure a default network setup."
+ ewarn "You can do this by running 'emerge --config ${PN}'."
+}
+
+pkg_prerm() {
+ einfo "Stopping ${PN} for safe unmerge"
+ /etc/init.d/vmware stop
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vmware-player/vmware-player-6.0.2.1744117.ebuild b/app-emulation/vmware-player/vmware-player-6.0.2.1744117.ebuild
new file mode 100644
index 000000000000..b103c88f554a
--- /dev/null
+++ b/app-emulation/vmware-player/vmware-player-6.0.2.1744117.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils versionator fdo-mime gnome2-utils pax-utils vmware-bundle
+
+MY_PN="VMware-Player"
+MY_PV=$(get_version_component_range 1-3)
+PV_MINOR=$(get_version_component_range 3)
+PV_BUILD=$(get_version_component_range 4)
+MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
+
+DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
+HOMEPAGE="http://www.vmware.com/products/player/"
+BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/player/${MY_PV}/${PV_BUILD}/linux/core/"
+SRC_URI="
+ x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
+ amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
+ "
+
+LICENSE="vmware GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="cups doc +vmware-tools"
+RESTRICT="strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="dev-cpp/cairomm
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:2.4
+ dev-cpp/libgnomecanvasmm:2.6
+ dev-cpp/pangomm:1.4
+ dev-libs/atk
+ dev-libs/glib:2
+ dev-libs/libaio
+ dev-libs/libsigc++
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ dev-libs/xmlrpc-c
+ gnome-base/libgnomecanvas
+ gnome-base/libgtop:2
+ gnome-base/librsvg:2
+ gnome-base/orbit
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libart_lgpl
+ =media-libs/libpng-1.2*
+ net-misc/curl
+ cups? ( net-print/cups )
+ sys-devel/gcc
+ sys-fs/fuse
+ sys-libs/glibc
+ sys-libs/zlib
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libgksu
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXcomposite
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXft
+ x11-libs/libXi
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libXtst
+ x11-libs/pango
+ x11-libs/startup-notification
+ !app-emulation/vmware-workstation"
+PDEPEND="~app-emulation/vmware-modules-279.${PV_MINOR}
+ vmware-tools? ( app-emulation/vmware-tools )"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+
+src_unpack() {
+ default
+ local bundle=${A%.tar}
+
+ local component ; for component in \
+ vmware-player \
+ vmware-player-app \
+ vmware-vmx \
+ vmware-usbarbitrator \
+ vmware-network-editor \
+ vmware-player-setup
+ #vmware-ovftool
+ do
+ vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
+ done
+}
+
+src_prepare() {
+ rm -f bin/vmware-modconfig
+ rm -rf lib/modules/binary
+ # Bug 459566
+ mv lib/libvmware-netcfg.so lib/lib/
+}
+
+clean_bundled_libs() {
+ ebegin 'Removing superfluous libraries'
+ # exclude OpenSSL from unbundling until the AES-NI patch gets into the tree
+ # see http://forums.gentoo.org/viewtopic-t-835867.html
+ # must use shipped libgcr.so.0 or else "undefined symbol: gcr_certificate_widget_new"
+ ldconfig -p | sed 's:^\s\+\([^(]*[^( ]\).*=> \(/.*\)$:\1 \2:g;t;d' | fgrep -v 'libcrypto.so.0.9.8
+libssl.so.0.9.8
+libgcr.so.0' | while read -r libname libpath ; do
+ dosym "${libpath}" "${VM_INSTALL_DIR}/lib/vmware/lib/${libname}/${libname}"
+ done
+ eend
+}
+
+src_install() {
+ # install the binaries
+ into "${VM_INSTALL_DIR}"
+ dobin bin/* || die "failed to install bin"
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r lib/*
+
+ # Bug 432918
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
+
+ # install the ancillaries
+ insinto /usr
+ doins -r share
+
+ if use cups; then
+ exeinto $(cups-config --serverbin)/filter
+ doexe extras/thnucups
+
+ insinto /etc/cups
+ doins -r etc/cups/*
+ fi
+
+ # install documentation
+ if use doc; then
+ dodoc doc/*
+ fi
+
+ exeinto "${VM_INSTALL_DIR}"/lib/vmware/setup
+ doexe vmware-config
+
+ # create symlinks for the various tools
+ local tool ; for tool in thnuclnt vmplayer{,-daemon} \
+ vmware-{acetool,unity-helper,modconfig{,-console},gksu,fuseUI} ; do
+ dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
+ done
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
+ fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
+
+ pax-mark -m "${D}${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx
+
+ # create the environment
+ local envd="${T}/90vmware"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}" || die
+
+ # create the configuration
+ dodir /etc/vmware || die
+
+ cat > "${D}"/etc/vmware/bootstrap <<-EOF
+ BINDIR='${VM_INSTALL_DIR}/bin'
+ LIBDIR='${VM_INSTALL_DIR}/lib'
+ EOF
+
+ cat > "${D}"/etc/vmware/config <<-EOF
+ bindir = "${VM_INSTALL_DIR}/bin"
+ libdir = "${VM_INSTALL_DIR}/lib/vmware"
+ initscriptdir = "/etc/init.d"
+ authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
+ gksu.rootMethod = "su"
+ VMCI_CONFED = "yes"
+ VMBLOCK_CONFED = "yes"
+ VSOCK_CONFED = "yes"
+ NETWORKING = "yes"
+ player.product.version = "${MY_PV}"
+ product.buildNumber = "${PV_BUILD}"
+ EOF
+
+ # install the init.d script
+ local initscript="${T}/vmware.rc"
+
+ sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ "${FILESDIR}/vmware-3.0.rc" > "${initscript}" || die
+ newinitd "${initscript}" vmware || die
+
+ # fill in variable placeholders
+ sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
+ -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}} || die
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/${PN}.desktop" || die
+}
+
+pkg_config() {
+ "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+ ewarn ""
+ ewarn "Before you can use vmware-player, you must configure a default network setup."
+ ewarn "You can do this by running 'emerge --config ${PN}'."
+}
+
+pkg_prerm() {
+ einfo "Stopping ${PN} for safe unmerge"
+ /etc/init.d/vmware stop
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vmware-player/vmware-player-6.0.3.1895310.ebuild b/app-emulation/vmware-player/vmware-player-6.0.3.1895310.ebuild
new file mode 100644
index 000000000000..b103c88f554a
--- /dev/null
+++ b/app-emulation/vmware-player/vmware-player-6.0.3.1895310.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils versionator fdo-mime gnome2-utils pax-utils vmware-bundle
+
+MY_PN="VMware-Player"
+MY_PV=$(get_version_component_range 1-3)
+PV_MINOR=$(get_version_component_range 3)
+PV_BUILD=$(get_version_component_range 4)
+MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
+
+DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
+HOMEPAGE="http://www.vmware.com/products/player/"
+BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/player/${MY_PV}/${PV_BUILD}/linux/core/"
+SRC_URI="
+ x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
+ amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
+ "
+
+LICENSE="vmware GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="cups doc +vmware-tools"
+RESTRICT="strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="dev-cpp/cairomm
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:2.4
+ dev-cpp/libgnomecanvasmm:2.6
+ dev-cpp/pangomm:1.4
+ dev-libs/atk
+ dev-libs/glib:2
+ dev-libs/libaio
+ dev-libs/libsigc++
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ dev-libs/xmlrpc-c
+ gnome-base/libgnomecanvas
+ gnome-base/libgtop:2
+ gnome-base/librsvg:2
+ gnome-base/orbit
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libart_lgpl
+ =media-libs/libpng-1.2*
+ net-misc/curl
+ cups? ( net-print/cups )
+ sys-devel/gcc
+ sys-fs/fuse
+ sys-libs/glibc
+ sys-libs/zlib
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libgksu
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXcomposite
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXft
+ x11-libs/libXi
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libXtst
+ x11-libs/pango
+ x11-libs/startup-notification
+ !app-emulation/vmware-workstation"
+PDEPEND="~app-emulation/vmware-modules-279.${PV_MINOR}
+ vmware-tools? ( app-emulation/vmware-tools )"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+
+src_unpack() {
+ default
+ local bundle=${A%.tar}
+
+ local component ; for component in \
+ vmware-player \
+ vmware-player-app \
+ vmware-vmx \
+ vmware-usbarbitrator \
+ vmware-network-editor \
+ vmware-player-setup
+ #vmware-ovftool
+ do
+ vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
+ done
+}
+
+src_prepare() {
+ rm -f bin/vmware-modconfig
+ rm -rf lib/modules/binary
+ # Bug 459566
+ mv lib/libvmware-netcfg.so lib/lib/
+}
+
+clean_bundled_libs() {
+ ebegin 'Removing superfluous libraries'
+ # exclude OpenSSL from unbundling until the AES-NI patch gets into the tree
+ # see http://forums.gentoo.org/viewtopic-t-835867.html
+ # must use shipped libgcr.so.0 or else "undefined symbol: gcr_certificate_widget_new"
+ ldconfig -p | sed 's:^\s\+\([^(]*[^( ]\).*=> \(/.*\)$:\1 \2:g;t;d' | fgrep -v 'libcrypto.so.0.9.8
+libssl.so.0.9.8
+libgcr.so.0' | while read -r libname libpath ; do
+ dosym "${libpath}" "${VM_INSTALL_DIR}/lib/vmware/lib/${libname}/${libname}"
+ done
+ eend
+}
+
+src_install() {
+ # install the binaries
+ into "${VM_INSTALL_DIR}"
+ dobin bin/* || die "failed to install bin"
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r lib/*
+
+ # Bug 432918
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
+
+ # install the ancillaries
+ insinto /usr
+ doins -r share
+
+ if use cups; then
+ exeinto $(cups-config --serverbin)/filter
+ doexe extras/thnucups
+
+ insinto /etc/cups
+ doins -r etc/cups/*
+ fi
+
+ # install documentation
+ if use doc; then
+ dodoc doc/*
+ fi
+
+ exeinto "${VM_INSTALL_DIR}"/lib/vmware/setup
+ doexe vmware-config
+
+ # create symlinks for the various tools
+ local tool ; for tool in thnuclnt vmplayer{,-daemon} \
+ vmware-{acetool,unity-helper,modconfig{,-console},gksu,fuseUI} ; do
+ dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
+ done
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
+ fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
+
+ pax-mark -m "${D}${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx
+
+ # create the environment
+ local envd="${T}/90vmware"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}" || die
+
+ # create the configuration
+ dodir /etc/vmware || die
+
+ cat > "${D}"/etc/vmware/bootstrap <<-EOF
+ BINDIR='${VM_INSTALL_DIR}/bin'
+ LIBDIR='${VM_INSTALL_DIR}/lib'
+ EOF
+
+ cat > "${D}"/etc/vmware/config <<-EOF
+ bindir = "${VM_INSTALL_DIR}/bin"
+ libdir = "${VM_INSTALL_DIR}/lib/vmware"
+ initscriptdir = "/etc/init.d"
+ authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
+ gksu.rootMethod = "su"
+ VMCI_CONFED = "yes"
+ VMBLOCK_CONFED = "yes"
+ VSOCK_CONFED = "yes"
+ NETWORKING = "yes"
+ player.product.version = "${MY_PV}"
+ product.buildNumber = "${PV_BUILD}"
+ EOF
+
+ # install the init.d script
+ local initscript="${T}/vmware.rc"
+
+ sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ "${FILESDIR}/vmware-3.0.rc" > "${initscript}" || die
+ newinitd "${initscript}" vmware || die
+
+ # fill in variable placeholders
+ sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
+ -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}} || die
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/${PN}.desktop" || die
+}
+
+pkg_config() {
+ "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+ ewarn ""
+ ewarn "Before you can use vmware-player, you must configure a default network setup."
+ ewarn "You can do this by running 'emerge --config ${PN}'."
+}
+
+pkg_prerm() {
+ einfo "Stopping ${PN} for safe unmerge"
+ /etc/init.d/vmware stop
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vmware-tools/Manifest b/app-emulation/vmware-tools/Manifest
new file mode 100644
index 000000000000..62772645c3eb
--- /dev/null
+++ b/app-emulation/vmware-tools/Manifest
@@ -0,0 +1,36 @@
+DIST vmware-tools-freebsd-9.2.3-1031769.i386.component.tar 15216640 SHA256 a54e3fa823495b18dca3635dde7f37c5c15a6374ec6a863bfccaf02bcb75fd9b SHA512 9d0eb0699ba3d36ed7a1810e553632fdc1ae0339848de2e4c2123222e3063da1164c73d2aca38bfd82b3825f1a8940fe76a461f9bdb9280f0f3473587824d890 WHIRLPOOL aa2309ef38995e301059ce9dbbe0c680aa74aa95b2cb07cf930e71a6c9f620be777b83ef3ad8e93f53760a7b266ffa08b77c34f137fe01d3b51d5ba68ffb4686
+DIST vmware-tools-freebsd-9.2.3-1031769.x86_64.component.tar 15216640 SHA256 4d4047a0ffaa13aa546f065a50e345d23128746fefa4e6f7ad7b54dc947b1276 SHA512 741b55b32a04957efe42684288447faf346c6a13cbb67819984c8efcf18995f75979f7db2ce7e37f4bfcc9b2a3c867c851e2d5e4db9ddf81209ea296813a8e44 WHIRLPOOL b44274d75a76214e1b4581143825f246a0345da4199d4692a3a0d6bceb360c8402bb0d6fc6594d2e20c0532cc40a27a03f1e1e98071be7ec67c4640b504936b8
+DIST vmware-tools-freebsd-9.6.1-1379776.i386.component.tar 15155200 SHA256 a3be78504eff68c089599ff4989bb4fc3cbc829495ef6dca8f9d2c86437bd355 SHA512 d6f62180756df7f7aedbbbd7cd828ed417446f90f718216d5b113c9bbb069486ec0fc8e9a8d7856f6dc2e81bae28650992513380994f4fcce95c130b92c558f0 WHIRLPOOL c4ee83d9227771494cb2c651ddf77b6cf39321209886741e14528a6f333c55bb2f499d01ed7168adfeb0fcb1bd55a4b7e597e8b3330dd014914945d6ef6eab6e
+DIST vmware-tools-freebsd-9.6.1-1379776.x86_64.component.tar 15155200 SHA256 941e58d81e00a11b4f611475e5ecb4257c78380ceef42bd9a3f2341b6bbad43e SHA512 3a1d3e49c6ccbb174868925b5d980e9676e61c61b6df67352cad6f96a004902466ba26e18ef4919ae5afdfd0e7b213ce9754fd97e39bd0873a0da695f11f046e WHIRLPOOL b37985ac5017d3bf306a10b5414d04c206b6f657b012609b0278aa79ab238535782913e5f31918e6906e6b48a95e26bd0cabe3433b380f4c472fd57c58308942
+DIST vmware-tools-freebsd-9.6.2-1744117.i386.component.tar 15144960 SHA256 a9c7c25f829db43005c14bd416a08ae8a30b8096dcc5b924e17ebbaacfcb595c SHA512 e9c1049cc639464532927d5d2f0e16141e114ca8fa68eb6acb0297748036c4d810a57001ab782efaa38cd1d8e3976e70ecc9687f36be0963cd3aab9edc5aa7e9 WHIRLPOOL ec49dfaa540f0f7233a6950d01f8c7bfde6e10a292561a6b81bcd2e0c90de529f33316298c6db6dae49c53f67fe06d1ec335a36c005e0602c1ebff90193a14b2
+DIST vmware-tools-freebsd-9.6.2-1744117.x86_64.component.tar 15144960 SHA256 1c6d4d21aa4ae8ba0c56f4b24fc8c73da07a4e8bfaf421b4db7c25012328fde1 SHA512 3306ccba195ed0373cf94e810fbb75f74f1b4238ed5be9bc50141222c2a5b687f79b794729ab40e192bba1c861670867abc792e54b01445b1bae8553eace2437 WHIRLPOOL 4556ea97c83ab3708316bd96e9e525fcf1a67c46bb2dd55c005e89102b2d4b8992d5a4376d79cc1c2faf20e65e08b8c3c79e26d9c9fd4c30d680a6ed184b9974
+DIST vmware-tools-linux-9.2.3-1031769.i386.component.tar 66211840 SHA256 0383d632139dbb463bba02c3f6770c877b2fc254710b05167b1d0d4213fbc11c SHA512 076d952a70bec0be1dcdc22534a57631faa1e74136cd1baac479d6f98d924a8d870958aa02aaaa9eef98e23609470ab85bde5ab7afacbc15516a5d7ad7b023c2 WHIRLPOOL 4429145db5528b8160115a7c55bc895e8b52745c9c3b08024a096e3bdefbb0e11ef6fdad976178e96fa32320711f30c2889c8830535dc6f6dfb8f6cbb214be03
+DIST vmware-tools-linux-9.2.3-1031769.x86_64.component.tar 66211840 SHA256 be5fa35af317058bffe98979b3b1f77eed416f17c7f6ee265a4717bbe3c9e718 SHA512 1f26d724e8e50df9d34333e44831d002ecd1a8af43cfed575c092316c4328ef3f34ac52b32c81ad6eb01dd362947ed462b09af080ee5e19cfd8aa89fbf83cd1d WHIRLPOOL 7292d3d69a46ad97b6decd5dff6c9c5dc19f76545965c6b95a904a14755072bc061742c458eecf974e8ca910af5d6464ccc6708c00c647095c3e98856ab628b0
+DIST vmware-tools-linux-9.6.1-1379776.i386.component.tar 60518400 SHA256 88ef45021e7dcc2197bbbb2021703000065c7aee0df35706b6c0927e06b9a8eb SHA512 1047b481d20fc3ab2818bb540ba0af16e8bc0f703af95e7f78449a688324d73f32af8650a6325400c38dace5ce582c71e1079c08605db69c45c0476dbe98997e WHIRLPOOL 70ab1d8730f95c2c628d397951f922e3022fc938676e330446ba3bc357eba9c1b0157c319bbd3857d46694e0296e280f88f5334af4ed6acde98207c260cad4eb
+DIST vmware-tools-linux-9.6.1-1379776.x86_64.component.tar 60518400 SHA256 b9d453f210891c1f76d70a45c6e463465940af27826006ebba090bd71e7d9590 SHA512 99b941fc7ce87d122f9b66d19d0d9406ba6d479f7b4ee782f261939694768c42bc31fb60974e4e854fe86964ff24f4a9ea7dfa1f8ed42ae697640d19834b89c6 WHIRLPOOL ab6892d084be06d753b1e452316ac30c38cfd1fc2607181159fe5d3ef5f2c9b2466145cae5f2f93c95be1010bc5484d1a39b4ececc9e9fdb3439a4fe64229521
+DIST vmware-tools-linux-9.6.2-1744117.i386.component.tar 61143040 SHA256 d84a4db83b1feb991b1a382b0936b864fc231dcc73c39304a16c34bb343e9f50 SHA512 7338a83330a62212559062e1c75f0540b7eb7f1037b7a32a9b8aba1750c9f53f2bb2c82c79147df93d93f9113b6902b3318ccd29d67d21ecb523f638d541c1e5 WHIRLPOOL 93213e870e99b71fc1dad344bd81acd61dd29a9fe853c37fa44408105d2be68e48ff044c56ad9dde8905ce7d42a614d585ab106ad1f9c5fea07f37fc2ba92526
+DIST vmware-tools-linux-9.6.2-1744117.x86_64.component.tar 61143040 SHA256 ce07d8afe9c63dc8018979528d252413ea49f9330006fca7b9d9d1fb394dd2e4 SHA512 e5078b84a10ab0b6962ca175ae95475e89cda3f2cf94c0e077e012b7163f46f54a418f34439224b5cb41428f809359e053e36926e85cf17d2ef7a9dbed868b80 WHIRLPOOL 51186181d1ee9bf371e3d042d11baa16bf6627922ef9c967ab1a6c731763d50782787d0028978c5640ec7792f48072de3b2ece78bdfc30ad23a49352a4ea11d2
+DIST vmware-tools-netware-9.2.3-1031769.i386.component.tar 81920 SHA256 906680d060a59414fa1726ef71b29f90f3923b823d4a123d72f345f6c35bab97 SHA512 892b0e9e18a80ab33dc6113447d281e31eb1925fea67ad9d90bfe6af808f855c8efaef6800540037062c4062bacc575fd638b7a49b34998006f5a49696558623 WHIRLPOOL b97bb7314868b1600a349d3b6af0b516aa3bd17124f3cf6bc309f1cdc21617b4c0abbbf74bb080aaaa64f31dc6ebb57905851678600cb6fce48e235428a5099c
+DIST vmware-tools-netware-9.2.3-1031769.x86_64.component.tar 81920 SHA256 e1279aeb2d402fa87c643fb5bcdda695fa39c93495b9a2b75b4e80a713176817 SHA512 542c350d1052a9bad0930138042424a0c91f55f861511e10ce4b81327a40dc1c8a339606b9118ae1e37a3d4171b0617d0205f74e03c2e28b398b2663575206cc WHIRLPOOL 5b146c80e1537f30c8051266994e44d366cd5964539ab1f2d51e82e0e9c10802f78de38bfdcfd83a0f0f91299381aada5f77dc3a19a759bf69b932a9718a0900
+DIST vmware-tools-netware-9.6.1-1379776.i386.component.tar 81920 SHA256 c5c2e4870bf8e9b36a997018b2b40b736ee445b23ac0ee6cf21983cddf67747c SHA512 33e94dbe2c7817703219a00a8dc14af97cd827ab1602c2a17c959dbed072185a2f8c3ede2e075318b67d457f35599054d88e78bf0af190c97e8b5e9039a9c9a1 WHIRLPOOL 96ac4f31879489d9615e5dcaeee876b471a30b7caf54cddc8291143dec66ec9a23664ea527e42249ae44dc46d631b376ea32518335d55e615cde6cd0022640c6
+DIST vmware-tools-netware-9.6.1-1379776.x86_64.component.tar 81920 SHA256 4dbc8ebfecceb0d281db4f75a535e7648f6fbb921202dd5d9dace8e6e8e3db8f SHA512 2497bfc1d1c31a2e7cc787bbf11254aa5d953e19e16f9fa99548a1b05424a6713106f63e3e1981d46d8c5045ca095ab6070b7e03fc934a064f91323b5b224a44 WHIRLPOOL c628730b5a8e1750babdd3d8bd97d25869fc01751cb2f9532d0024865455b7d89b334f5b34894ffa2262838a740d6c51e61e6000b673532a1014e5ad9028f7f7
+DIST vmware-tools-netware-9.6.2-1744117.i386.component.tar 81920 SHA256 1bcf7439f957d07fd84a56e6ab1bf88818759cf9f9a11df50ae5d0d65f0fd466 SHA512 9579e36b667af282ac3901ff4b836ba3fb1e74af81d19ac82fac94deb51d3bcf074e97ccb27bcab0cf8b9e319404c4cc305cea03ce08c6695191f89461c9de4a WHIRLPOOL 34bb18ee5facaebc273e8a2e8212dd4aa946af0c873a822d5704b0dd5bbbfa3225fc6c7629ae1a21ca55608f41df6c1f1a3d80140d6f8a4c3f9566caf04dcd85
+DIST vmware-tools-netware-9.6.2-1744117.x86_64.component.tar 81920 SHA256 ba9d0f84db9d1acf2c53574f411cf9c287b5905fddeaca703c5b503ba400e19d SHA512 72d1d8c8a2339e83a1feb206e8597dae8a922d5c99dbadf3f1c29662e34c3ac409783336e06b12f1885cff9a1f90840410478c7240770864564ff73e7ec5bfee WHIRLPOOL 2d9bede35a1b10648307405fce67dfd2e2dbbf5f5c34b017ef620b1f30680d7442abc785f5685edfcaf85c4cba9eb8d560aafd59d0962f87e3c17e6c6c9a3194
+DIST vmware-tools-solaris-9.2.3-1031769.i386.component.tar 13096960 SHA256 bb38d98351c0bb7f1c268a5ec1140bf2023276fd82dc31895fc6039f983ce964 SHA512 5abbb8e7e31753301a02dc411ca41a4857fb41b0c97a1264e954a53a5f15869dec7e01f8b65190aaf20e86c04e929beb88d6f14261761801480f453ce6b3107b WHIRLPOOL 3ebfa56078c49d53bc17215124a901931fcc3fdcd660ad55f72ea0c8cb81a31463bc83ecc480d7e7cccba602c3a37157e560a99231edae3b8e2c1e26242ce252
+DIST vmware-tools-solaris-9.2.3-1031769.x86_64.component.tar 13096960 SHA256 94ed550543096d9e03326a5adea93928f24f69349e5bc6a995e1fefead7112d9 SHA512 04724855a497aefcbd1ccf6ddd1e793eb6fd4bc65960f59f0e0dc95096434d8fa1a5a12b49a20f7e293427a794e4c16df06e4a844042fd21537b2513992bae41 WHIRLPOOL 223977e8ff88601f58752b7a2fda99a15212858d8045504aefe181b18ca29ca4b09dd2b07ddc4091533fd07da5062777000dcbd1e557a789688dbec70fae9069
+DIST vmware-tools-solaris-9.6.1-1379776.i386.component.tar 13096960 SHA256 f6057b82bfc070e506b51503c4c7e3dd66565dcc06a2f7fbddeaaa87d76283d6 SHA512 aee20ebff38ac19f7d4512fde2cac6b152af61b5b669eedb152530a9bbbad32136aba9747e4f8c57e78c27b6a24b08c026503b6e7f86fcb427f03e4d5ef28b00 WHIRLPOOL 97c5aed51529a8a38f75ce602cdf88821241388d1ff1a3abeaa7ebad041c047233645b020f2ba6719bc5a3cdda24bdf06ffbd43672dc17ae22fc794a8dfa3b10
+DIST vmware-tools-solaris-9.6.1-1379776.x86_64.component.tar 13096960 SHA256 96ad456174dd66acf25dee3fd4f8ecae718120b0d21296fe21bf22d0fd24ec17 SHA512 c41a707e8c68c8e1fff32cd962e9f8d0d30044346e823e2171bf3dc8392c536de97a8b8466af5088869625dfb96c8746e74f1d6080c62183b51c5e0f94fd885a WHIRLPOOL ec4900bfc58325bf4719c4783f42e590a83032529dd8694d912ee586584a49cbec68f8945a25666d8dee94ea7fb50d8e28c33fca454ab68e501cde0c6fb8e497
+DIST vmware-tools-solaris-9.6.2-1744117.i386.component.tar 13086720 SHA256 07b51c4fff9c4ee67f1d45215da0c2c1258620cbd5d8d24c0cae118b48af4ad4 SHA512 3e9aae368556e335b8915f90921caebb6e95d629a1bdf56125bead32ef6a7bcaafca03768e9d8779f530e808b70c23e7ef59bb4563bfb3693e6c0fa008b553f0 WHIRLPOOL 82cdf434c9700dd633fda1a259934617bf8175370690ce3549b3edee109997b2b0cd0108b28c127a744db4c271391de040efda11df68f4ce341e35414e6d94b9
+DIST vmware-tools-solaris-9.6.2-1744117.x86_64.component.tar 13086720 SHA256 6845e98fdd41ed190d6f5b7ae5d2713be7028172297607aee778cf955505e038 SHA512 9a3796cf5102423506c0375d4f1702f1074adb8a818309084a1f7b6de99cf424c4833cfb39bdb8062dde729ddfb62325c2763730af04d8cfdabd1ab3f14fc19f WHIRLPOOL bd23daac15397bf148156f109af1c6bea819ddf70d6de2f98f943880aac64de0c9647ca40dd909ce6395354d169239d7b1e95041531d89c0d5893401a6e6ce35
+DIST vmware-tools-winPre2k-9.2.3-1031769.i386.component.tar 11253760 SHA256 a83173fbed35fd6484740fa1c3899ef18c84f0e2728e8db2cca442c809bafe1f SHA512 466625a1e342afae65203b1f04568c4d6c57eee2022890ca463a750d67c6fbbd1f9e5c557515298db0566d9297ffcb32183ff476a5e9368fa05b63b073ade467 WHIRLPOOL a5192928c6fc5c198e818bcf5f623660ae4741017a25cf4e691005ff8284666afb3d5e1dbc037a4caa5889e1bf102e91e4a9f06b630c041674cb0d53d8c0d0f4
+DIST vmware-tools-winPre2k-9.2.3-1031769.x86_64.component.tar 11253760 SHA256 9b51d31ca911ccf95db641834ae79220db44df53c2fd5a91d6b6e382cffdd39e SHA512 60f99dcb92794d3b798334c91966658f8bbb5cd11a435672094e0a0ccd0b070c0be277d38a9dfac9df77db6d7b91da806fa50a13e67b30d19c33fe153ff63a2e WHIRLPOOL 8426b651f35902f1ac87d556b330100f68ca1c615011301e6ab0dffb160fb4dab4f205f293ffd83ad74c67e9776d54c354f9fe98d70c596cec165929c5a1ba5c
+DIST vmware-tools-winPre2k-9.6.1-1379776.i386.component.tar 11458560 SHA256 9d46fa6842684d099f8eaf3459aac8973644193ebb4c663164c04b3f69536872 SHA512 6ecb3726235d1cb156898f6887508f7540a5e93437bde43e86740bce15cb8db4a9c9bb4e2d89ef1f5670f37ac11a457410551ff70d8e096d881b51630fd0b40a WHIRLPOOL ed4a441ceb6eac141ea009d871e4a2315e63a1f4f086fb93055b6c2de97e2d06fa98a772a4fda4582cd2e2511a0ace85b2ed52127f1c7343e3e46e122808602d
+DIST vmware-tools-winPre2k-9.6.1-1379776.x86_64.component.tar 11458560 SHA256 99d603372e69bea2e57e62c3c78dff5ac8119de3e89b438a8cf83a22b0f9774a SHA512 0f4ef0bb79cac357cbdb62d918d22f63a6f1ced51a3d15c10c32dd25dc97474858c85ce9dd080210e07e0b5f7c40741fb7695f1cacf84f5c29c8f8abae15f2c8 WHIRLPOOL f523815ad06bca65719ab99bc54da850a9c67568aa9e6e3ac567ec9669a81d6b554b91ddefe774387cadb014e418b33bb47cc3651caa897bca330a9ec1f22df8
+DIST vmware-tools-winPre2k-9.6.2-1744117.i386.component.tar 11458560 SHA256 24f197f2d20d44f052f97d206cd904cb8cb6943a165a43188a6ab616e3d9346d SHA512 c1b9272097d83bc645cdce8d5e477053d9c68f3216440c31f7ad3d6e0acbb0cf6daa294584d3c381075fe9ccc8489e21d94040a6f47c06c4d8984ba4d0910551 WHIRLPOOL e9d4c6a77a926cbbe035babb6b6a0c28338cc6bfff6a791da2fab73bcc917b69642e7cd8963f228370cda0d508f7e9b7ef15c9d8378c09397b33fc46ea0032ac
+DIST vmware-tools-winPre2k-9.6.2-1744117.x86_64.component.tar 11458560 SHA256 9b32f4f4fccdc6e40f36544ea5cc21f77fd2a517dace8dd672b5ca5e25604b6e SHA512 51259807b2e4e0267a4c7bd2ea294ab504b1681e91101813e5bb16ac155d7b0f065a3fabb692dc0108d44024fc373398aa891cb64eaa96244c5c644c08123159 WHIRLPOOL 07c963e0e821df31b60677769fb46fa836f552b3b41af4c133b0bc7ce76cd6011808fbd6a678c8e38e1c07dfb9221e46caee0923d22844cb399ac2831015e47b
+DIST vmware-tools-windows-9.2.3-1031769.i386.component.tar 61777920 SHA256 0fa4f7aac30b589292b6064c23702e6a257ac27ce1342c96755352f6f39e3b04 SHA512 776c834b49ad8f4bbe84ba800aa866e740e1dd236496065ebd46ddafa35621d4356f99a6f0bb45dfb1fe337bc75452236b5d5c87ec8c5ab6b5a1b6c18bc8d542 WHIRLPOOL 787725514f0ee1a48b64cc2f3b25f706290e386f9762857290ca2a84baea4a21205900b37df197976205baf27606023ea7626337b580299d4f6d63288c8ba39b
+DIST vmware-tools-windows-9.2.3-1031769.x86_64.component.tar 61777920 SHA256 dbb7f6dbbcf9e44263193e40ad89944a45ef860f4f3b4b51d00ae1602f863f8c SHA512 818e2895c57be6792e82362c9616e2e6e8638997bde65ecea1416f71ccfa9681fc5cd44cd3356780ab35345e6b19ac8054a05eb8424dff1bcd779c9b686455a9 WHIRLPOOL ab847bddd07b029ba7a75fb6ae96133211d5a412fbe2059f851ae249854357dd0e25ab28df98fc2a3ee33f5aae08587a8b4bbfd6a60a2313f77fe6f98a1a3a3d
+DIST vmware-tools-windows-9.6.1-1379776.i386.component.tar 69232640 SHA256 cb09c083adec2bd6a10f9cb75e4570fc19019ddd98320e7cf1ddf311737f75bd SHA512 a1caf8095e8ec56cf15c55e6c0081e16dc3b25e035f1a50eb9f6636a5879b5bbadb4dd079d822b6b1c27f2279c4214eefe004e460f1c1ae70f28242d0aafd400 WHIRLPOOL e61f9df173f83e8844dafd9e226d4b8cd0530df18b4104d1229d18a8c4e8757adc35ac1085602baeb35ba4896273070739c4d783679f18085583124bd856a715
+DIST vmware-tools-windows-9.6.1-1379776.x86_64.component.tar 69232640 SHA256 4034d5f0fe06a7fb4d2dcd7159f59223f0886d2be5ea4dd1ae685cf5ff0c535d SHA512 8a1be0aae39bf7abe5c76d74f26f7f936dda2d6d169d3e5256479251cb961753abcb519647fcc6a026da11d57f45fa626d1c4a7d91a985ffd2361b2468ab601c WHIRLPOOL 2faccc4a8c04fb52bc0749dd69e887b3ad6f8e9776623f7e583590c5e1612de50bb3355372a60e850104f13f8c9ecd613e5f43ebccffe86661838b757110b57c
+DIST vmware-tools-windows-9.6.2-1744117.i386.component.tar 69283840 SHA256 f5f43a1a8d39b16d74953a6ffd36f8b56a4e20808918e7358047080f961c7367 SHA512 9fd041f13d250665ea4adb5d9af7c07e1f3eb48708e1744e88ab7378844632e7da2c42c283b87d0b58af3afc456b9b6cd2eebfc28af1ccca3a53b7968eaadb7f WHIRLPOOL 12ccfd6c5d947caaceb7319359ccf70185ed4fe2d0bd60c39e1f4f6200d7ef89bd1a2c7fbeec5eb7b675fc23cd30aa8339fedfed1350f23745640a768fa9df07
+DIST vmware-tools-windows-9.6.2-1744117.x86_64.component.tar 69283840 SHA256 d4fe4f1d5137c577dd2b82eae8eeee55fe4fc021506eeaa8eaf77ef45f309331 SHA512 c3e40d7e2b10e6c318776d7fcef151c140fd20848de6d48d4a380ff8596b0c4889f8c46816bcacd6e3cdd815d0d8b868283714dba9e9095d94a7cd64da79dc80 WHIRLPOOL 0b1670d8ce585333755fccc72fa55bed6919645c5756917dfd96ccfd6a1eca9d9cd17c74f6458b38e8b9db0632668a33ff9b6d6724e4b01d185eaceff9f14e41
diff --git a/app-emulation/vmware-tools/metadata.xml b/app-emulation/vmware-tools/metadata.xml
new file mode 100644
index 000000000000..672ebec01f3b
--- /dev/null
+++ b/app-emulation/vmware-tools/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>vmware</herd>
+</pkgmetadata>
diff --git a/app-emulation/vmware-tools/vmware-tools-9.2.3.1031769.ebuild b/app-emulation/vmware-tools/vmware-tools-9.2.3.1031769.ebuild
new file mode 100644
index 000000000000..58b387ffae5a
--- /dev/null
+++ b/app-emulation/vmware-tools/vmware-tools-9.2.3.1031769.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit versionator vmware-bundle
+
+MY_PV="$(replace_version_separator 3 - $PV)"
+#BASE_URI="http://softwareupdate.vmware.com/cds/vmw-desktop/player/5.0.$(get_version_component_range 3)/$(get_version_component_range 4)/linux/packages/"
+BASE_URI="http://softwareupdate.vmware.com/cds/vmw-desktop/player/5.0.2/$(get_version_component_range 4)/linux/packages/"
+
+DESCRIPTION="VMware Tools for guest operating systems"
+HOMEPAGE="http://www.vmware.com/products/player/"
+
+LICENSE="vmware"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+RESTRICT="mirror"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+IUSE_VMWARE_GUEST="freebsd linux netware solaris windows winPre2k"
+
+VM_INSTALL_DIR="/opt/vmware"
+
+for guest in ${IUSE_VMWARE_GUEST} ; do
+ SRC_URI+=" vmware_guest_${guest}? (
+ amd64? ( ${BASE_URI}vmware-tools-${guest}-${MY_PV}.x86_64.component.tar )
+ x86? ( ${BASE_URI}vmware-tools-${guest}-${MY_PV}.i386.component.tar )
+ )"
+ IUSE+=" vmware_guest_${guest}"
+done ; unset guest
+
+src_unpack() {
+ local arch
+ if use x86 ; then arch='i386'
+ elif use amd64 ; then arch='x86_64'
+ fi
+ local guest ; for guest in ${IUSE_VMWARE_GUEST} ; do
+ if use "vmware_guest_${guest}" ; then
+ local component="vmware-tools-${guest}-${MY_PV}.${arch}.component"
+ unpack "${component}.tar"
+ vmware-bundle_extract-component "${component}"
+ fi
+ done
+}
+
+src_install() {
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/isoimages
+ local guest ; for guest in ${IUSE_VMWARE_GUEST} ; do
+ if use "vmware_guest_${guest}" ; then
+ doins "${guest}".iso{,.sig}
+ fi
+ done
+}
diff --git a/app-emulation/vmware-tools/vmware-tools-9.6.1.1379776.ebuild b/app-emulation/vmware-tools/vmware-tools-9.6.1.1379776.ebuild
new file mode 100644
index 000000000000..b3a29af4d322
--- /dev/null
+++ b/app-emulation/vmware-tools/vmware-tools-9.6.1.1379776.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit versionator vmware-bundle
+
+MY_PV="$(replace_version_separator 3 - $PV)"
+BASE_URI="http://softwareupdate.vmware.com/cds/vmw-desktop/player/6.0.$(get_version_component_range 3)/$(get_version_component_range 4)/linux/packages/"
+
+DESCRIPTION="VMware Tools for guest operating systems"
+HOMEPAGE="http://www.vmware.com/products/player/"
+
+LICENSE="vmware"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+RESTRICT="mirror"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+IUSE_VMWARE_GUEST="freebsd linux netware solaris windows winPre2k"
+
+VM_INSTALL_DIR="/opt/vmware"
+
+for guest in ${IUSE_VMWARE_GUEST} ; do
+ SRC_URI+=" vmware_guest_${guest}? (
+ amd64? ( ${BASE_URI}vmware-tools-${guest}-${MY_PV}.x86_64.component.tar )
+ x86? ( ${BASE_URI}vmware-tools-${guest}-${MY_PV}.i386.component.tar )
+ )"
+ IUSE+=" vmware_guest_${guest}"
+done ; unset guest
+
+src_unpack() {
+ local arch
+ if use x86 ; then arch='i386'
+ elif use amd64 ; then arch='x86_64'
+ fi
+ local guest ; for guest in ${IUSE_VMWARE_GUEST} ; do
+ if use "vmware_guest_${guest}" ; then
+ local component="vmware-tools-${guest}-${MY_PV}.${arch}.component"
+ unpack "${component}.tar"
+ vmware-bundle_extract-component "${component}"
+ fi
+ done
+}
+
+src_install() {
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/isoimages
+ local guest ; for guest in ${IUSE_VMWARE_GUEST} ; do
+ if use "vmware_guest_${guest}" ; then
+ doins "${guest}".iso{,.sig}
+ fi
+ done
+}
diff --git a/app-emulation/vmware-tools/vmware-tools-9.6.2.1744117.ebuild b/app-emulation/vmware-tools/vmware-tools-9.6.2.1744117.ebuild
new file mode 100644
index 000000000000..15241361226c
--- /dev/null
+++ b/app-emulation/vmware-tools/vmware-tools-9.6.2.1744117.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit versionator vmware-bundle
+
+MY_PV="$(replace_version_separator 3 - $PV)"
+BASE_URI="http://softwareupdate.vmware.com/cds/vmw-desktop/player/6.0.$(get_version_component_range 3)/$(get_version_component_range 4)/linux/packages/"
+
+DESCRIPTION="VMware Tools for guest operating systems"
+HOMEPAGE="http://www.vmware.com/products/player/"
+
+LICENSE="vmware"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+RESTRICT="mirror"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+IUSE_VMWARE_GUEST="freebsd linux netware solaris windows winPre2k"
+
+VM_INSTALL_DIR="/opt/vmware"
+
+for guest in ${IUSE_VMWARE_GUEST} ; do
+ SRC_URI+=" vmware_guest_${guest}? (
+ amd64? ( ${BASE_URI}vmware-tools-${guest}-${MY_PV}.x86_64.component.tar )
+ x86? ( ${BASE_URI}vmware-tools-${guest}-${MY_PV}.i386.component.tar )
+ )"
+ IUSE+=" vmware_guest_${guest}"
+done ; unset guest
+
+src_unpack() {
+ local arch
+ if use x86 ; then arch='i386'
+ elif use amd64 ; then arch='x86_64'
+ fi
+ local guest ; for guest in ${IUSE_VMWARE_GUEST} ; do
+ if use "vmware_guest_${guest}" ; then
+ local component="vmware-tools-${guest}-${MY_PV}.${arch}.component"
+ unpack "${component}.tar"
+ vmware-bundle_extract-component "${component}"
+ fi
+ done
+}
+
+src_install() {
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/isoimages
+ local guest ; for guest in ${IUSE_VMWARE_GUEST} ; do
+ if use "vmware_guest_${guest}" ; then
+ doins "${guest}".iso{,.sig}
+ fi
+ done
+}
diff --git a/app-emulation/vmware-view-open-client/Manifest b/app-emulation/vmware-view-open-client/Manifest
new file mode 100644
index 000000000000..4b5bbda798d8
--- /dev/null
+++ b/app-emulation/vmware-view-open-client/Manifest
@@ -0,0 +1 @@
+DIST VMware-view-open-client-source-4.5.0-297975.tar.gz 3044430 SHA256 8c81aed954419180c4b36807df15907b333c5558dd0b57650f3743af7c67702c SHA512 2f270114386035c8fdf03c81da4a7fc3471eeb5e9a034d87f027d0d0dacd1a252b021ecf48a9ece26c26ed92960efe6ffd734a36c56eaeaff2307b80a51387e7 WHIRLPOOL aebf972174c64d7ff05ccbe6f1c542f1c7cbfdb29cb84ed1b058a943466a213f616e14780b881dcb365902456d9d370fa42c805959fe0ef3ef7b71ea5fbf46d9
diff --git a/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-curl-headers.patch b/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-curl-headers.patch
new file mode 100644
index 000000000000..48b6904c8c79
--- /dev/null
+++ b/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-curl-headers.patch
@@ -0,0 +1,12 @@
+diff --git a/lib/bora/basicHttp/http.c b/lib/bora/basicHttp/http.c
+index a0f7df3..1f538b4 100644
+--- a/lib/bora/basicHttp/http.c
++++ b/lib/bora/basicHttp/http.c
+@@ -40,7 +40,6 @@
+ #include "requestQueue.h"
+
+ #include <curl/curl.h>
+-#include <curl/types.h>
+ #include <curl/easy.h>
+ #include <curl/multi.h>
+
diff --git a/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-linking.patch b/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-linking.patch
new file mode 100644
index 000000000000..62b37cc993a3
--- /dev/null
+++ b/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-linking.patch
@@ -0,0 +1,14 @@
+Upstream: http://code.google.com/p/vmware-view-open-client/issues/detail?id=84
+
+diff -Naur VMware-view-open-client-source-4.5.0-297975/configure.ac VMware-view-open-client-source-4.5.0-297975.new/configure.ac
+--- VMware-view-open-client-source-4.5.0-297975/configure.ac 2010-09-10 22:09:17.000000000 +0200
++++ VMware-view-open-client-source-4.5.0-297975.new/configure.ac 2011-06-01 16:58:57.145105019 +0200
+@@ -140,7 +140,7 @@
+ PKG_PROG_PKG_CONFIG
+ PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.6.0 gmodule-2.0 >= 2.6.0])
+ if test "$use_gtk" = "yes" ; then
+- PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.4.0])
++ PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.4.0 x11])
+ fi
+ PKG_CHECK_MODULES(XML, [libxml-2.0 >= 2.6.0])
+ PKG_CHECK_MODULES(CURL, [libcurl >= 7.16.0])
diff --git a/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-unbundle-intltool.patch b/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-unbundle-intltool.patch
new file mode 100644
index 000000000000..d663fb50d41e
--- /dev/null
+++ b/app-emulation/vmware-view-open-client/files/vmware-view-open-client-4.5.0.297975-unbundle-intltool.patch
@@ -0,0 +1,35 @@
+Use system's intltool.
+
+Fixes build failure: https://bugs.gentoo.org/show_bug.cgi?id=425604
+(automake fails to regenerate missing files)
+
+Patches by Kvicadlo.
+diff --git a/configure.ac b/configure.ac
+index d127fad..b9005c5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -549,9 +549,6 @@ doc/changelog.Debian
+ doc/vmware-view.1
+ doc/vmware-view-tunnel.1
+ fix-toolchain-paths.sh
+-intltool-update
+-intltool-merge
+-intltool-extract
+ po/Makefile.in
+ vmware-view.desktop.in
+ ])
+diff --git a/Makefile.inc b/Makefile.inc
+index 41dfe8f..c440f01 100644
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -243,10 +243,6 @@ testUrl_LDADD += $(GLIB_LIBS)
+ testUrl_LDADD += $(ICU_LIBS)
+ testUrl_LDADD += $(TUNNEL_FRAMEWORKS)
+
+-dist_noinst_DATA += intltool-extract.in
+-dist_noinst_DATA += intltool-merge.in
+-dist_noinst_DATA += intltool-update.in
+-
+ desktop_in_files += vmware-view.desktop.in
+
+ dist_noinst_DATA += INSTALL
diff --git a/app-emulation/vmware-view-open-client/metadata.xml b/app-emulation/vmware-view-open-client/metadata.xml
new file mode 100644
index 000000000000..7a2e673ac0ce
--- /dev/null
+++ b/app-emulation/vmware-view-open-client/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>vmware</herd>
+ <maintainer>
+ <email>tgurr@gentoo.org</email>
+ </maintainer>
+ <longdescription>VMware View Open Client lets you connect from a Linux desktop to remote
+ Windows desktops managed by VMware View.</longdescription>
+ <upstream>
+ <remote-id type="google-code">vmware-view-open-client</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/vmware-view-open-client/vmware-view-open-client-4.5.0.297975-r1.ebuild b/app-emulation/vmware-view-open-client/vmware-view-open-client-4.5.0.297975-r1.ebuild
new file mode 100644
index 000000000000..01a9f58b0fa7
--- /dev/null
+++ b/app-emulation/vmware-view-open-client/vmware-view-open-client-4.5.0.297975-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools versionator
+
+MY_PV=$(replace_version_separator 3 '-' )
+MY_P="${PN/vm/VM}-source-${MY_PV}"
+
+DESCRIPTION="Open Source VMware View Client"
+HOMEPAGE="http://code.google.com/p/vmware-view-open-client/"
+SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+COMMON_DEPEND="
+ >=dev-libs/boost-1.34.1
+ >=dev-libs/icu-3.8.0:=
+ >=dev-libs/libxml2-2.6.0
+ >=dev-libs/openssl-0.9.8
+ >=net-misc/curl-7.16.0[ssl]
+ x11-libs/gtk+:2
+"
+
+DEPEND="${COMMON_DEPEND}
+ >=dev-util/intltool-0.21
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ >=net-misc/rdesktop-1.4.1
+"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-linking.patch" \
+ "${FILESDIR}"/${P}-curl-headers.patch \
+ "${FILESDIR}"/${P}-unbundle-intltool.patch
+ sed -e "s:e.x.p:$(get_version_component_range 1-3):" \
+ -e "s:00000:$(get_version_component_range 4):" \
+ -i configure.ac
+
+ AT_M4DIR="${AT_M4DIR} -I ${ROOT}/usr/share/aclocal" eautoreconf
+}
+
+src_configure() {
+ econf \
+ --disable-static-icu \
+ --enable-nls \
+ --with-boost
+}
diff --git a/app-emulation/vmware-vix/Manifest b/app-emulation/vmware-vix/Manifest
new file mode 100644
index 000000000000..f36e161757ee
--- /dev/null
+++ b/app-emulation/vmware-vix/Manifest
@@ -0,0 +1,2 @@
+DIST VMware-VIX-1.11.4-744019.i386.bundle 76259648 SHA256 0e866bbdcc7f9ed7511af012a8645092a29d7d7b6cedd9d82d08560a9e3bde03 SHA512 2a7dca59e03abb3ed2a64b75bec51fd67e42350a26b106bc855fe99f7c842737d4ae89f7aa3c2f76e131451be4a9977054335527098672dc80eae34b13d70e80 WHIRLPOOL 5120209529429bbbb8ca1006bd9796881e9fbd5f5597a19076d527fec99cb5d2a55d10e14e9b6c96b8ad9daddd6250e5d7eb386d439acbca40f3d41d95f5b192
+DIST VMware-VIX-1.11.4-744019.x86_64.bundle 79518116 SHA256 0a77d6254963d15f9238c3054d98aa3597bdca7e7df69a55a6a74debdb2784be SHA512 318622143b3686802c86f649eeb60d33ecf0d5974c701c52d3081c6ab7074977c9cb3cfe5399b081a7313282215888c6d3fb64c016e5d31cc30e60239c4cc761 WHIRLPOOL c8af9f68b9828c71a363a09ce9384f6ba6bc874b4dd911ceac7991881e22e4f46c2656f58c4f561000f6e31142a3d525c5a6c6091f689554de16d309f17eb913
diff --git a/app-emulation/vmware-vix/metadata.xml b/app-emulation/vmware-vix/metadata.xml
new file mode 100644
index 000000000000..bf1b34bea29b
--- /dev/null
+++ b/app-emulation/vmware-vix/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>vmware</herd>
+ <longdescription>
+ The VIX API allows you to write programs and scripts that automate
+ virtual machine operations, as well as the guests within virtual
+ machines. This API is high-level, easy to use, and practical for both
+ script writers and application programmers. It runs on both Windows and
+ Linux and supports management of VMware Server, Workstation, and Virtual
+ Infrastructure (both ESX and vCenter). Bindings are provided for C,
+ Perl, and COM (Visual Basic, VBscript, C#).
+ </longdescription>
+</pkgmetadata>
diff --git a/app-emulation/vmware-vix/vmware-vix-1.11.4.744019.ebuild b/app-emulation/vmware-vix/vmware-vix-1.11.4.744019.ebuild
new file mode 100644
index 000000000000..f7d635d21525
--- /dev/null
+++ b/app-emulation/vmware-vix/vmware-vix-1.11.4.744019.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator vmware-bundle
+
+MY_PN="VMware-VIX"
+MY_PV="$(replace_version_separator 3 - $PV)"
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="VMware VIX API for Linux"
+HOMEPAGE="http://www.vmware.com/support/developer/vix-api/"
+SRC_URI="
+ x86? ( ${MY_P}.i386.bundle )
+ amd64? ( ${MY_P}.x86_64.bundle )
+ "
+
+LICENSE="vmware"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="doc"
+RESTRICT="fetch mirror strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="
+ dev-libs/glib:2
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ net-misc/curl
+ sys-libs/glibc
+ sys-libs/zlib
+ !app-emulation/vmware-workstation"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+
+pkg_nofetch() {
+ local bundle
+
+ if use x86; then
+ bundle="${MY_P}.i386.bundle"
+ elif use amd64; then
+ bundle="${MY_P}.x86_64.bundle"
+ fi
+
+ einfo "Please download ${bundle}"
+ einfo "from ${HOMEPAGE}"
+ einfo "and place it in ${DISTDIR}"
+}
+
+src_unpack() {
+ local component; for component in \
+ vmware-vix \
+ vmware-vix-core \
+ vmware-vix-lib-Workstation800andvSphere500
+ #vmware-vix-legacy \
+ do
+ vmware-bundle_extract-bundle-component "${DISTDIR}/${A}" "${component}" "${S}"
+ done
+}
+
+src_install() {
+ # install the binary
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-vix
+ doins -r lib/*
+
+ dosym vmware-vix/libvixAllProducts.so "${VM_INSTALL_DIR}"/lib/libbvixAllProducts.so
+
+ # install headers
+ insinto /usr/include/vmware-vix
+ doins include/*
+
+ if use doc; then
+ dohtml -r doc/*
+ fi
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware-vix/setup/vmware-config
+
+ # create the environment
+ local envd="${T}/90${PN}"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}"
+
+ # create the configuration
+ dodir /etc/vmware
+
+ local vmconfig="${T}/config"
+ if [[ -e ${ROOT}/etc/vmware/config ]]
+ then
+ cp -a "${ROOT}"/etc/vmware/config "${vmconfig}"
+ sed -i -e "/vmware.fullpath/d" "${vmconfig}"
+ sed -i -e "/vix.libdir/d" "${vmconfig}"
+ sed -i -e "/vix.config.version/d" "${vmconfig}"
+ fi
+
+ cat >> "${vmconfig}" <<-EOF
+ vmware.fullpath = "${VM_INSTALL_DIR}/bin/vmware"
+ vix.libdir = "${VM_INSTALL_DIR}/lib/vmware-vix"
+ vix.config.version = "1"
+ EOF
+
+ insinto /etc/vmware/
+ doins "${vmconfig}"
+}
+
+pkg_postinst() {
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+}
+
+pkg_prerm() {
+ sed -i -e "/vix.libdir/d" "${ROOT}"/etc/vmware/config
+}
diff --git a/app-emulation/vmware-workstation/Manifest b/app-emulation/vmware-workstation/Manifest
new file mode 100644
index 000000000000..46c1c76d08cf
--- /dev/null
+++ b/app-emulation/vmware-workstation/Manifest
@@ -0,0 +1,9 @@
+DIST VMware-Workstation-10.0.1-1379776.i386.bundle.tar 282562560 SHA256 14482ce63270b16cd0ffaa176fc84b0d2e82d7f49f082c4c277a4552156ac351 SHA512 f53eaf70b905e235fe16fc642303def43155ece6847179b48c95cdb9aa4ea2bc2d16d0126178ab021a25101c955b061f2572a6e55e53a10cf89383bec1a6016f WHIRLPOOL 250490facd8559fe1e920c1bfe61dcbf2c493b99504d65c1b2b961ffee837342d923c9858585893bebf9657dee058db2d6cbee5ced957405b802e13cbd37891a
+DIST VMware-Workstation-10.0.1-1379776.x86_64.bundle.tar 253132800 SHA256 4fef8984cb30ea04f204ef4dcdc9c5740fe31d196bb89c9af4f05187f749ba06 SHA512 e92a17bc6c21a365bf402fcfb07ffbc7c0c6adf61a040f148a81dafb9634c8c01db81479e48ff37f0ee43f72e90cca9aa54d59d0985006b1f9d0b2f1b6313eb5 WHIRLPOOL ba6b3f9ba03d4933010ecd37a41034c327943ae0e6aa2110b603d4d9cfa844ba0b2c1973eb8099fbbc3deefb82525ea0329d28cb871583812440a901713941bc
+DIST VMware-Workstation-10.0.2-1744117.i386.bundle.tar 283658240 SHA256 3b8fcdf6e459c93b3f2a69288eed53dc92931841d30f064701030434e08231ea SHA512 a5b574d8d0bf5c32a8aa177fcc7d51456ba11fe81e142ba1c16fd25393faa0944844ed10c9e6438ac66ebaeeeefeca1561a590f42768d1685347b93c7acacc23 WHIRLPOOL 53686ed03fdadbd829f560e432bd64d3f227a5f243ae921f2c789203c8a28f26f806ea30817937b31514abb740541ddb7c675855e6f93ec40f8f4d222e348888
+DIST VMware-Workstation-10.0.2-1744117.x86_64.bundle.tar 254115840 SHA256 95986090a4f2f59ae551a63a78f9ff5bdc3a87c48b25b10abb754720c3581f02 SHA512 69ede2f67e3283a3b234605ca5aa05555da008917d6b329ab6ca27f578620b6268ec79622b4fc5c331111f527fcac917dd78a844ad2ff4bbd0149aa4dbb7755d WHIRLPOOL 42117a4bb6184629ec2e8c13c39f3298c746a4fa10b0928cee3ccd1c3e4464af95f59c7ff0f71c44184d25cc91e593cbb40fd050275ee1e66b308010fc907a17
+DIST VMware-Workstation-10.0.3-1895310.i386.bundle.tar 283648000 SHA256 8d66dd5b9351e53ce6729f96f8c9eca0631926220e14c34395236e9133b0c717 SHA512 32b953d25a89ac7a681a5e54adb8005ab32f47ca536af56e6b0095984376e28c59609af615b0f9f5a32999bbb65e2c2d20a4dca25ff7f28768435a1ac60b9ba3 WHIRLPOOL 060d82b470a5fb382ba49e4e2859d3e363864c451b91e4ece2bc19a75131b395438039dfb3cb9baa316beae70992f1ddc47522c0d891c17bbc67cbc1510eacfb
+DIST VMware-Workstation-10.0.3-1895310.x86_64.bundle.tar 254105600 SHA256 59cd70ddb31b08bcf0cf369b4d2d566dee70ed0119a93ec34e180adcd82852bc SHA512 bf32a4d31152c614291cdb490a4ce41a51dbb5421232b8abef7461438e60f6dd8c989e6bf17899ef2d4e4dfb3e36707374368e5d09039f4193b402175d1fb421 WHIRLPOOL cae78535dfe59334b3812586ac454086bf54c32f238ee1a5981e404382ec4b5c2b5042de89fe568545908824377b77bfbd6ec549c1b5968502358d96ce49ff9e
+DIST VMware-Workstation-9.0.3-1410761.i386.bundle.tar 264908800 SHA256 dfe9aaa75987793eac096c0fbdb364f94e354ab668213774ea3e90d5ddcecdc0 SHA512 5d0943400cb1fefca20f1a81d3989bf5cdda5e123d1a70b09ebc20a56498d36f597ed7a0730d2f6f752c3c4baad2c86d5ef7691e8d245147d944c6f7e4e708b0 WHIRLPOOL 14a950f2deb03c3b7a088d4fb50378c7109330d89903965c28ead0be1e2223dbce05a628b1ea859215d31a8978f497bd8f807652cf266667d67893eaf2d7372b
+DIST VMware-Workstation-9.0.3-1410761.x86_64.bundle.tar 232724480 SHA256 2612f8a523c9f23164d7557c105520bc6e010af82b3e6d4a3ada04d8ff03cbf0 SHA512 07923231e481550cb0348e40ef341c2d0682ac0daf6c8e0ada130c03113f43a37bf322e64fb9dc73511dea0fd2851f3cb4f5e755bbad4beba9e3cc4e69566070 WHIRLPOOL d979f2d9ef8888be89d5747c16e0db7ca45609cd9d77d84baf8485b4956f9e9f99bf46c33a2690b7b1fea851c0495ed0a06b36e3e69b51abfc11604d9a62fe4d
+DIST gentoo-01.tar.gz 1884 SHA256 e92c694865f1b29f4d7a39efa1dd87bc71dc5f922573f00a3d31ee8e27a8c335 SHA512 454ab93997781bd0a9accddb2ac7bb446f07ea7cddef5640369025c30e03592e14869e0f0f7b4457db2f1ada31c98051426016c86201afa8bc8e3aa4ccc2f875 WHIRLPOOL 9202583b617532ab2612b384da307218e7c93c2962f0d233e28bea066b07163c9bc51c0a599309f9d703c5575ebeb292d787716225624dc1c2fdff3c44fa3513
diff --git a/app-emulation/vmware-workstation/files/configure-hostd.sh b/app-emulation/vmware-workstation/files/configure-hostd.sh
new file mode 100644
index 000000000000..480e9037d86d
--- /dev/null
+++ b/app-emulation/vmware-workstation/files/configure-hostd.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+action="$1"
+
+case $action in
+ add)
+ rc-update -q add vmware-workstation-server default
+ rc-service vmware-workstation-server start
+ ;;
+ remove)
+ rc-update -q del vmware-workstation-server default
+ rc-service vmware-workstation-server stop
+ ;;
+ status)
+ rc-service -q vmware-workstation-server status
+ ;;
+ *)
+ exit 1
+ ;;
+esac
diff --git a/app-emulation/vmware-workstation/files/list-bundle-components.xsl b/app-emulation/vmware-workstation/files/list-bundle-components.xsl
new file mode 100644
index 000000000000..db1a4e4f6602
--- /dev/null
+++ b/app-emulation/vmware-workstation/files/list-bundle-components.xsl
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output omit-xml-declaration="yes"/>
+
+ <xsl:template match="text()"/>
+
+ <xsl:template match="/bundle/components/component">
+ <xsl:value-of select="@offset"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@size"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/app-emulation/vmware-workstation/files/list-component-files.xsl b/app-emulation/vmware-workstation/files/list-component-files.xsl
new file mode 100644
index 000000000000..91c6152fa21b
--- /dev/null
+++ b/app-emulation/vmware-workstation/files/list-component-files.xsl
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output omit-xml-declaration="yes"/>
+
+ <xsl:template match="text()"/>
+
+ <xsl:template match="/component/fileset/file">
+ <xsl:value-of select="@offset"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@compressedSize"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@uncompressedSize"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@path"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/app-emulation/vmware-workstation/files/vmware-10.0.rc b/app-emulation/vmware-workstation/files/vmware-10.0.rc
new file mode 100644
index 000000000000..85ae7cdb0e76
--- /dev/null
+++ b/app-emulation/vmware-workstation/files/vmware-10.0.rc
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ use net
+}
+
+start() {
+ ebegin Starting VMware USB Arbitrator
+ #start-stop-daemon --start --exec @@BINDIR@@/vmware-usbarbitrator
+ @@BINDIR@@/vmware-usbarbitrator
+ eend $?
+ ebegin Starting VMware services
+ modprobe -v vmci || modprobe -v vmw_vmci
+ eend $?
+ modprobe -av vmmon vmci vsock vmblock vmnet
+ eend $?
+ @@BINDIR@@/vmware-networks --start
+ eend $?
+}
+
+stop() {
+ ebegin Stopping VMware USB Arbitrator
+ #start-stop-daemon --stop --exec @@BINDIR@@/vmware-usbarbitrator
+ killall --wait @@BINDIR@@/vmware-usbarbitrator
+ eend $?
+ @@BINDIR@@/vmware-networks --stop
+ eend $?
+ ebegin Stopping VMware services
+ modprobe -rv vsock vmmon vmblock vmnet
+ eend $?
+ modprobe -rv vmci || modprobe -rv vmw_vmci
+ eend $?
+}
diff --git a/app-emulation/vmware-workstation/files/vmware-9.0.rc b/app-emulation/vmware-workstation/files/vmware-9.0.rc
new file mode 100644
index 000000000000..85ae7cdb0e76
--- /dev/null
+++ b/app-emulation/vmware-workstation/files/vmware-9.0.rc
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ use net
+}
+
+start() {
+ ebegin Starting VMware USB Arbitrator
+ #start-stop-daemon --start --exec @@BINDIR@@/vmware-usbarbitrator
+ @@BINDIR@@/vmware-usbarbitrator
+ eend $?
+ ebegin Starting VMware services
+ modprobe -v vmci || modprobe -v vmw_vmci
+ eend $?
+ modprobe -av vmmon vmci vsock vmblock vmnet
+ eend $?
+ @@BINDIR@@/vmware-networks --start
+ eend $?
+}
+
+stop() {
+ ebegin Stopping VMware USB Arbitrator
+ #start-stop-daemon --stop --exec @@BINDIR@@/vmware-usbarbitrator
+ killall --wait @@BINDIR@@/vmware-usbarbitrator
+ eend $?
+ @@BINDIR@@/vmware-networks --stop
+ eend $?
+ ebegin Stopping VMware services
+ modprobe -rv vsock vmmon vmblock vmnet
+ eend $?
+ modprobe -rv vmci || modprobe -rv vmw_vmci
+ eend $?
+}
diff --git a/app-emulation/vmware-workstation/files/vmware-server-10.0.rc b/app-emulation/vmware-workstation/files/vmware-server-10.0.rc
new file mode 100644
index 000000000000..a82b9009c109
--- /dev/null
+++ b/app-emulation/vmware-workstation/files/vmware-server-10.0.rc
@@ -0,0 +1,55 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount vmware
+ use net
+}
+
+checkconfig() {
+ # Check if certificates exist. If not, we need to generate them, ala sshd.
+ if [ ! -e @@ETCDIR@@/ssl/rui.key -o ! -e @@ETCDIR@@/ssl/rui.crt ]; then
+ mkdir -p @@ETCDIR@@/ssl
+ openssl req -x509 -days 365 -newkey rsa:2048 -keyout @@ETCDIR@@/ssl/rui.key -out @@ETCDIR@@/ssl/rui.crt -config @@ETCDIR@@/ssl/hostd.ssl.config
+ chmod -R 600 @@ETCDIR@@/ssl
+ fi
+}
+
+start() {
+ checkconfig
+
+ ebegin Starting VMware Authentication Daemon
+ start-stop-daemon --start \
+ --exec @@PREFIX@@/sbin/vmware-authdlauncher
+ eend $?
+ ebegin Starting VMware Workstation Server
+ start-stop-daemon --start \
+ --pidfile /var/run/vmware/vmware-hostd.PID \
+ --exec @@BINDIR@@/vmware-hostd \
+ -- -a -d @@ETCDIR@@/hostd/config.xml
+
+ eend $?
+}
+
+stop() {
+ ebegin "Shutdown VMs in the AutoStart Sequence"
+ local HOHO_ADMIN="$(@@BINDIR@@/vmware-wssc-adminTool "@@ETCDIR@@/hostd/authorization.xml" 2>/dev/null)"
+
+ if [ "x" != "x${HOHO_ADMIN}" ]; then
+ @@BINDIR@@/vmware-vim-cmd -U "${HOHO_ADMIN}" hostsvc/autostartmanager/autostop
+ fi
+ eend $?
+
+ ebegin Stopping VMware Workstation Server
+ start-stop-daemon --stop \
+ --pidfile /var/run/vmware/vmware-hostd.PID \
+ --exec @@BINDIR@@/vmware-hostd
+ eend $?
+ ebegin Stopping VMware Authentication Daemon
+ #start-stop-daemon --stop \
+ # --exec @@PREFIX@@/sbin/vmware-authdlauncher
+ killall @@PREFIX@@/sbin/vmware-authdlauncher
+ eend $?
+}
diff --git a/app-emulation/vmware-workstation/files/vmware-server-9.0.rc b/app-emulation/vmware-workstation/files/vmware-server-9.0.rc
new file mode 100644
index 000000000000..a07011d14832
--- /dev/null
+++ b/app-emulation/vmware-workstation/files/vmware-server-9.0.rc
@@ -0,0 +1,55 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount vmware
+ use net
+}
+
+checkconfig() {
+ # Check if certificates exist. If not, we need to generate them, ala sshd.
+ if [ ! -e @@ETCDIR@@/ssl/rui.key -o ! -e @@ETCDIR@@/ssl/rui.crt ]; then
+ mkdir -p @@ETCDIR@@/ssl
+ openssl req -x509 -days 365 -newkey rsa:2048 -keyout @@ETCDIR@@/ssl/rui.key -out @@ETCDIR@@/ssl/rui.crt -config @@ETCDIR@@/ssl/hostd.ssl.config
+ chmod -R 600 @@ETCDIR@@/ssl
+ fi
+}
+
+start() {
+ checkconfig
+
+ ebegin Starting VMware Authentication Daemon
+ start-stop-daemon --start \
+ --exec @@PREFIX@@/sbin/vmware-authdlauncher
+ eend $?
+ ebegin Starting VMware Workstation Server
+ start-stop-daemon --start \
+ --pidfile /var/run/vmware/vmware-hostd.PID \
+ --exec @@BINDIR@@/vmware-hostd \
+ -- -a -d @@ETCDIR@@/hostd/config.xml
+
+ eend $?
+}
+
+stop() {
+ ebegin "Shutdown VMs in the AutoStart Sequence"
+ local HOHO_ADMIN="$(@@BINDIR@@/vmware-wssc-adminTool "@@ETCDIR@@/hostd/authorization.xml" 2>/dev/null)"
+
+ if [ "x" != "x${HOHO_ADMIN}" ]; then
+ @@BINDIR@@/vmware-vim-cmd -U "${HOHO_ADMIN}" hostsvc/autostartmanager/autostop
+ fi
+ eend $?
+
+ ebegin Stopping VMware Workstation Server
+ start-stop-daemon --stop \
+ --pidfile /var/run/vmware/vmware-hostd.PID \
+ --exec @@BINDIR@@/vmware-hostd
+ eend $?
+ ebegin Stopping VMware Authentication Daemon
+ #start-stop-daemon --stop \
+ # --exec @@PREFIX@@/sbin/vmware-authdlauncher
+ killall @@PREFIX@@/sbin/vmware-authdlauncher
+ eend $?
+}
diff --git a/app-emulation/vmware-workstation/metadata.xml b/app-emulation/vmware-workstation/metadata.xml
new file mode 100644
index 000000000000..7570b9e39a2c
--- /dev/null
+++ b/app-emulation/vmware-workstation/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>vmware</herd>
+ <longdescription>
+ VMWare Workstation is a virtual machine which can be used to install
+ other operating systems in a virtual environment to run on top of Gentoo.
+ </longdescription>
+ <use>
+ <flag name="ovftool">Install OVF tool.</flag>
+ <flag name="server">Install VMware Workstation Server component.</flag>
+ <flag name="vix">Install VIX. The VIX API allows you to write programs and scripts
+ that automate virtual machine operations, and run programs or manipulate
+ files within guest operating systems.
+ </flag>
+ <flag name="vmware-tools">Install VMware Tools images</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">akhuettel/systemd-vmware</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/vmware-workstation/vmware-workstation-10.0.1.1379776-r1.ebuild b/app-emulation/vmware-workstation/vmware-workstation-10.0.1.1379776-r1.ebuild
new file mode 100644
index 000000000000..fa297474b979
--- /dev/null
+++ b/app-emulation/vmware-workstation/vmware-workstation-10.0.1.1379776-r1.ebuild
@@ -0,0 +1,493 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator fdo-mime systemd gnome2-utils pam vmware-bundle
+
+MY_PN="VMware-Workstation"
+MY_PV=$(get_version_component_range 1-3)
+PV_MINOR=$(get_version_component_range 3)
+PV_BUILD=$(get_version_component_range 4)
+MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
+
+SYSTEMD_UNITS_TAG="gentoo-01"
+
+DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
+HOMEPAGE="http://www.vmware.com/products/workstation/"
+BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/ws/${MY_PV}/${PV_BUILD}/linux/core/"
+SRC_URI="
+ x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
+ amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
+ https://github.com/akhuettel/systemd-vmware/archive/${SYSTEMD_UNITS_TAG}.tar.gz
+ "
+LICENSE="vmware GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="cups doc ovftool server vix vmware-tools"
+RESTRICT="mirror strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="dev-cpp/cairomm
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:2.4
+ dev-cpp/libgnomecanvasmm
+ dev-cpp/pangomm
+ dev-libs/atk
+ dev-libs/glib:2
+ dev-libs/icu
+ dev-libs/expat
+ dev-libs/libaio
+ dev-libs/libgcrypt:0
+ dev-libs/libsigc++
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ dev-libs/xmlrpc-c
+ gnome-base/libgnomecanvas
+ gnome-base/libgtop:2
+ gnome-base/librsvg:2
+ gnome-base/orbit
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libart_lgpl
+ =media-libs/libpng-1.2*
+ media-libs/libpng
+ net-misc/curl
+ cups? ( net-print/cups )
+ sys-devel/gcc
+ sys-fs/fuse
+ sys-libs/glibc
+ sys-libs/zlib
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libgksu
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXcomposite
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXft
+ x11-libs/libXi
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libXtst
+ x11-libs/pango
+ x11-libs/pangox-compat
+ x11-libs/startup-notification
+ x11-themes/hicolor-icon-theme
+ !app-emulation/vmware-player"
+PDEPEND="~app-emulation/vmware-modules-279.${PV_MINOR}
+ vmware-tools? ( app-emulation/vmware-tools )"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+VM_DATA_STORE_DIR="/var/lib/vmware/Shared VMs"
+VM_HOSTD_USER="root"
+
+src_unpack() {
+ default
+ local bundle
+ use amd64 && bundle=${MY_P}.x86_64.bundle
+ use x86 && bundle=${MY_P}.i386.bundle
+ local component; for component in \
+ vmware-vmx \
+ vmware-player-app \
+ vmware-player-setup \
+ vmware-workstation \
+ vmware-network-editor \
+ vmware-network-editor-ui \
+ vmware-usbarbitrator \
+ vmware-vprobe
+ do
+ vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
+ done
+
+ if use server; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-workstation-server #"${S}"
+ fi
+
+ if use vix; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-core vmware-vix
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-lib-Workstation1000andvSphere550 vmware-vix
+ fi
+ if use ovftool; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-ovftool
+ fi
+}
+
+src_prepare() {
+ rm -f bin/vmware-modconfig
+ rm -rf lib/modules/binary
+ # Bug 459566
+ mv lib/libvmware-netcfg.so lib/lib/
+
+ if use server; then
+ rm -f vmware-workstation-server/bin/{openssl,configure-hostd.sh}
+ fi
+
+ find "${S}" -name '*.a' -delete
+
+# clean_bundled_libs
+}
+
+clean_bundled_libs() {
+ ebegin 'Removing superfluous libraries'
+ cd lib/lib || die
+ ldconfig -p | \
+ sed 's:^\s\+\([^(]*[^( ]\).*=> /.*$:\1:g;t;d' | \
+ fgrep -vx 'libcrypto.so.0.9.8
+libssl.so.0.9.8i
+libgcr.so.0
+libglib-2.0.so.0' |
+ xargs -d'\n' -r rm -rf
+ eend
+}
+
+src_install() {
+ local major_minor=$(get_version_component_range 1-2 "${PV}")
+ local major_minor_revision=$(get_version_component_range 1-3 "${PV}")
+ local build=$(get_version_component_range 4 "${PV}")
+
+ # install the binaries
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r lib/*
+
+ # Bug 432918
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
+
+ # install the ancillaries
+ insinto /usr
+ doins -r share
+
+ if use cups; then
+ exeinto $(cups-config --serverbin)/filter
+ doexe extras/thnucups
+
+ insinto /etc/cups
+ doins -r etc/cups/*
+ fi
+
+ insinto /etc/xdg
+ doins -r etc/xdg/*
+
+ # install documentation
+ doman man/man1/vmware.1.gz
+
+ if use doc; then
+ dodoc doc/*
+ fi
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/setup
+ doins vmware-config
+
+ # install vmware workstation server
+ if use server; then
+ dosbin sbin/*
+
+ cd "${S}"/vmware-workstation-server
+
+ # install binaries
+ into "${VM_INSTALL_DIR}"/lib/vmware
+ dobin bin/*
+
+ dobin "${FILESDIR}"/configure-hostd.sh
+
+ dobin "${FILESDIR}"/configure-hostd.sh
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/lib
+ doins -r lib/*
+
+ into "${VM_INSTALL_DIR}"
+ for tool in vmware-{hostd,wssc-adminTool} ; do
+ cat > "${T}/${tool}" <<-EOF
+ #!/usr/bin/env bash
+ set -e
+
+ . /etc/vmware/bootstrap
+
+ exec "${VM_INSTALL_DIR}/lib/vmware/lib/wrapper-gtk24.sh" \\
+ "${VM_INSTALL_DIR}/lib/vmware/lib" \\
+ "${VM_INSTALL_DIR}/lib/vmware/bin/${tool}" \\
+ "${VM_INSTALL_DIR}/lib/vmware/libconf" "\$@"
+ EOF
+ dobin "${T}/${tool}"
+ done
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r hostd
+
+ # create the configuration
+ insinto /etc/vmware/hostd
+ doins -r config/etc/vmware/hostd/*
+ doins -r etc/vmware/hostd/*
+
+ insinto /etc/vmware/ssl
+ doins etc/vmware/ssl/*
+
+ # pam
+ pamd_mimic_system vmware-authd auth account
+
+ # create directory for shared virtual machines.
+ keepdir "${VM_DATA_STORE_DIR}"
+ keepdir /var/log/vmware
+ fi
+
+ # install vmware-vix
+ if use vix; then
+ cd "${S}"/vmware-vix
+
+ # install the binary
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-vix
+ doins -r lib/*
+
+ dosym vmware-vix/libvixAllProducts.so "${VM_INSTALL_DIR}"/lib/libbvixAllProducts.so
+
+ # install headers
+ insinto /usr/include/vmware-vix
+ doins include/*
+
+ if use doc; then
+ dohtml -r doc/*
+ fi
+ fi
+
+ # install ovftool
+ if use ovftool; then
+ cd "${S}"
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-ovftool
+ doins -r vmware-ovftool/*
+
+ chmod 0755 "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/{ovftool,ovftool.bin}
+ dosym "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/ovftool "${VM_INSTALL_DIR}"/bin/ovftool
+ fi
+
+ # create symlinks for the various tools
+ local tool ; for tool in thnuclnt vmware vmplayer{,-daemon} licenseTool vmamqpd \
+ vmware-{acetool,enter-serial,gksu,fuseUI,modconfig{,-console},netcfg,tray,unity-helper,zenity} ; do
+ dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
+ done
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware "${VM_INSTALL_DIR}"/bin/vmware
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/setup/vmware-config
+ fperms 4711 "${VM_INSTALL_DIR}"/bin/vmware-mount
+ fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
+ if use server; then
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-{hostd,wssc-adminTool}
+ fperms 4711 "${VM_INSTALL_DIR}"/sbin/vmware-authd
+ fperms 1777 "${VM_DATA_STORE_DIR}"
+ fi
+ if use vix; then
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware-vix/setup/vmware-config
+ fi
+
+ # create the environment
+ local envd="${T}/90vmware"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}"
+
+ # create the configuration
+ dodir /etc/vmware
+
+ cat > "${D}"/etc/vmware/bootstrap <<-EOF
+ BINDIR='${VM_INSTALL_DIR}/bin'
+ LIBDIR='${VM_INSTALL_DIR}/lib'
+ EOF
+
+ cat > "${D}"/etc/vmware/config <<-EOF
+ bindir = "${VM_INSTALL_DIR}/bin"
+ libdir = "${VM_INSTALL_DIR}/lib/vmware"
+ initscriptdir = "/etc/init.d"
+ authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
+ gksu.rootMethod = "su"
+ VMCI_CONFED = "yes"
+ VMBLOCK_CONFED = "yes"
+ VSOCK_CONFED = "yes"
+ NETWORKING = "yes"
+ player.product.version = "${major_minor_revision}"
+ product.version = "${major_minor_revision}"
+ product.buildNumber = "${build}"
+ product.name = "VMware Workstation"
+ workstation.product.version = "${major_minor_revision}"
+ EOF
+
+ if use vix; then
+ cat >> "${D}"/etc/vmware/config <<-EOF
+ vmware.fullpath = "${VM_INSTALL_DIR}/bin/vmware"
+ vix.libdir = "${VM_INSTALL_DIR}/lib/vmware-vix"
+ vix.config.version = "1"
+ EOF
+ fi
+
+ if use server; then
+ cat >> "${D}"/etc/vmware/config <<-EOF
+ authd.client.port = "902"
+ authd.proxy.nfc = "vmware-hostd:ha-nfc"
+ authd.soapserver = "TRUE"
+ EOF
+ fi
+
+ # install the init.d script
+ local initscript="${T}/vmware.rc"
+ sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ "${FILESDIR}/vmware-${major_minor}.rc" > ${initscript}
+ newinitd "${initscript}" vmware
+
+ if use server; then
+ # install the init.d script
+ local initscript="${T}/vmware-workstation-server.rc"
+ sed -e "s:@@ETCDIR@@:/etc/vmware:g" \
+ -e "s:@@PREFIX@@:${VM_INSTALL_DIR}:g" \
+ -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ -e "s:@@LIBDIR@@:${VM_INSTALL_DIR}/lib/vmware:g" \
+ "${FILESDIR}/vmware-server-${major_minor}.rc" > ${initscript}
+ newinitd "${initscript}" vmware-workstation-server
+ fi
+
+ # fill in variable placeholders
+ sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
+ -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}}
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/${PN}.desktop"
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/vmware-player.desktop"
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware-netcfg:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/vmware-netcfg.desktop"
+
+ if use server; then
+ # Configuration for vmware-workstation-server
+ local hostdUser="${VM_HOSTD_USER:-root}"
+ sed -e "/ACEDataUser/s:root:${hostdUser}:g" \
+ -i "${D}/etc/vmware/hostd/authorization.xml" || die
+
+ # Shared VMs Path: [standard].
+ sed -e "s:##{DS_NAME}##:standard:g" \
+ -e "s:##{DS_PATH}##:${VM_DATA_STORE_DIR}:g" \
+ -i "${D}/etc/vmware/hostd/datastores.xml" || die
+
+ sed -e "s:##{HTTP_PORT}##:-1:g" \
+ -e "s:##{HTTPS_PORT}##:443:g" \
+ -e "s:##{PIPE_PREFIX}##:/var/run/vmware/:g" \
+ -i "${D}/etc/vmware/hostd/proxy.xml" || die
+
+ # See vmware-workstation-server.py for more details.
+ sed -e "s:##{BUILD_CFGDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{CFGALTDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{CFGDIR}##:/etc/vmware/:g" \
+ -e "s:##{ENABLE_AUTH}##:true:g" \
+ -e "s:##{HOSTDMODE}##:ws:g" \
+ -e "s:##{HOSTD_CFGDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{HOSTD_MOCKUP}##:false:g" \
+ -e "s:##{LIBDIR}##:${VM_INSTALL_DIR}/lib/vmware:g" \
+ -e "s:##{LIBDIR_INSTALLED}##:${VM_INSTALL_DIR}/lib/vmware/:g" \
+ -e "s:##{LOGDIR}##:/var/log/vmware/:g" \
+ -e "s:##{LOGLEVEL}##:verbose:g" \
+ -e "s:##{MOCKUP}##:mockup-host-config.xml:g" \
+ -e "s:##{PLUGINDIR}##:./:g" \
+ -e "s:##{SHLIB_PREFIX}##:lib:g" \
+ -e "s:##{SHLIB_SUFFIX}##:.so:g" \
+ -e "s:##{USE_BLKLISTSVC}##:false:g" \
+ -e "s:##{USE_CBRCSVC}##:false:g" \
+ -e "s:##{USE_CIMSVC}##:false:g" \
+ -e "s:##{USE_DIRECTORYSVC}##:false:g" \
+ -e "s:##{USE_DIRECTORYSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_DYNAMIC_PLUGIN_LOADING}##:false:g" \
+ -e "s:##{USE_DYNAMO}##:false:g" \
+ -e "s:##{USE_DYNSVC}##:false:g" \
+ -e "s:##{USE_GUESTSVC}##:false:g" \
+ -e "s:##{USE_HBRSVC}##:false:g" \
+ -e "s:##{USE_HBRSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_HOSTSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_HTTPNFCSVC}##:false:g" \
+ -e "s:##{USE_HTTPNFCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_LICENSESVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_NFCSVC}##:true:g" \
+ -e "s:##{USE_NFCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_OVFMGRSVC}##:true:g" \
+ -e "s:##{USE_PARTITIONSVC}##:false:g" \
+ -e "s:##{USE_SECURESOAP}##:false:g" \
+ -e "s:##{USE_SNMPSVC}##:false:g" \
+ -e "s:##{USE_SOLO_MOCKUP}##:false:g" \
+ -e "s:##{USE_STATSSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VDISKSVC}##:false:g" \
+ -e "s:##{USE_VDISKSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VMSVC_MOCKUP}##:false:g" \
+ -e "s:##{VM_INVENTORY}##:vmInventory.xml:g" \
+ -e "s:##{VM_RESOURCES}##:vmResources.xml:g" \
+ -e "s:##{WEBSERVER_PORT_ENTRY}##::g" \
+ -e "s:##{WORKINGDIR}##:./:g" \
+ -i "${D}/etc/vmware/hostd/config.xml" || die
+
+ sed -e "s:##{ENV_LOCATION}##:/etc/vmware/hostd/env/:g" \
+ -i "${D}/etc/vmware/hostd/environments.xml" || die
+
+ # @@VICLIENT_URL@@=XXX
+ sed -e "s:@@AUTHD_PORT@@:902:g" \
+ -i "${D}${VM_INSTALL_DIR}/lib/vmware/hostd/docroot/client/clients.xml" || die
+ fi
+
+ # install systemd unit files
+ systemd_dounit "${WORKDIR}/systemd-vmware-${SYSTEMD_UNITS_TAG}/"*.{service,target}
+}
+
+pkg_config() {
+ "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+ ewarn ""
+ ewarn "Before you can use vmware workstation, you must configure a default network setup."
+ ewarn "You can do this by running 'emerge --config ${PN}'."
+}
+
+pkg_prerm() {
+ einfo "Stopping ${PN} for safe unmerge"
+ /etc/init.d/vmware stop
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vmware-workstation/vmware-workstation-10.0.2.1744117.ebuild b/app-emulation/vmware-workstation/vmware-workstation-10.0.2.1744117.ebuild
new file mode 100644
index 000000000000..fa297474b979
--- /dev/null
+++ b/app-emulation/vmware-workstation/vmware-workstation-10.0.2.1744117.ebuild
@@ -0,0 +1,493 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator fdo-mime systemd gnome2-utils pam vmware-bundle
+
+MY_PN="VMware-Workstation"
+MY_PV=$(get_version_component_range 1-3)
+PV_MINOR=$(get_version_component_range 3)
+PV_BUILD=$(get_version_component_range 4)
+MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
+
+SYSTEMD_UNITS_TAG="gentoo-01"
+
+DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
+HOMEPAGE="http://www.vmware.com/products/workstation/"
+BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/ws/${MY_PV}/${PV_BUILD}/linux/core/"
+SRC_URI="
+ x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
+ amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
+ https://github.com/akhuettel/systemd-vmware/archive/${SYSTEMD_UNITS_TAG}.tar.gz
+ "
+LICENSE="vmware GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="cups doc ovftool server vix vmware-tools"
+RESTRICT="mirror strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="dev-cpp/cairomm
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:2.4
+ dev-cpp/libgnomecanvasmm
+ dev-cpp/pangomm
+ dev-libs/atk
+ dev-libs/glib:2
+ dev-libs/icu
+ dev-libs/expat
+ dev-libs/libaio
+ dev-libs/libgcrypt:0
+ dev-libs/libsigc++
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ dev-libs/xmlrpc-c
+ gnome-base/libgnomecanvas
+ gnome-base/libgtop:2
+ gnome-base/librsvg:2
+ gnome-base/orbit
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libart_lgpl
+ =media-libs/libpng-1.2*
+ media-libs/libpng
+ net-misc/curl
+ cups? ( net-print/cups )
+ sys-devel/gcc
+ sys-fs/fuse
+ sys-libs/glibc
+ sys-libs/zlib
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libgksu
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXcomposite
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXft
+ x11-libs/libXi
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libXtst
+ x11-libs/pango
+ x11-libs/pangox-compat
+ x11-libs/startup-notification
+ x11-themes/hicolor-icon-theme
+ !app-emulation/vmware-player"
+PDEPEND="~app-emulation/vmware-modules-279.${PV_MINOR}
+ vmware-tools? ( app-emulation/vmware-tools )"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+VM_DATA_STORE_DIR="/var/lib/vmware/Shared VMs"
+VM_HOSTD_USER="root"
+
+src_unpack() {
+ default
+ local bundle
+ use amd64 && bundle=${MY_P}.x86_64.bundle
+ use x86 && bundle=${MY_P}.i386.bundle
+ local component; for component in \
+ vmware-vmx \
+ vmware-player-app \
+ vmware-player-setup \
+ vmware-workstation \
+ vmware-network-editor \
+ vmware-network-editor-ui \
+ vmware-usbarbitrator \
+ vmware-vprobe
+ do
+ vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
+ done
+
+ if use server; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-workstation-server #"${S}"
+ fi
+
+ if use vix; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-core vmware-vix
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-lib-Workstation1000andvSphere550 vmware-vix
+ fi
+ if use ovftool; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-ovftool
+ fi
+}
+
+src_prepare() {
+ rm -f bin/vmware-modconfig
+ rm -rf lib/modules/binary
+ # Bug 459566
+ mv lib/libvmware-netcfg.so lib/lib/
+
+ if use server; then
+ rm -f vmware-workstation-server/bin/{openssl,configure-hostd.sh}
+ fi
+
+ find "${S}" -name '*.a' -delete
+
+# clean_bundled_libs
+}
+
+clean_bundled_libs() {
+ ebegin 'Removing superfluous libraries'
+ cd lib/lib || die
+ ldconfig -p | \
+ sed 's:^\s\+\([^(]*[^( ]\).*=> /.*$:\1:g;t;d' | \
+ fgrep -vx 'libcrypto.so.0.9.8
+libssl.so.0.9.8i
+libgcr.so.0
+libglib-2.0.so.0' |
+ xargs -d'\n' -r rm -rf
+ eend
+}
+
+src_install() {
+ local major_minor=$(get_version_component_range 1-2 "${PV}")
+ local major_minor_revision=$(get_version_component_range 1-3 "${PV}")
+ local build=$(get_version_component_range 4 "${PV}")
+
+ # install the binaries
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r lib/*
+
+ # Bug 432918
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
+
+ # install the ancillaries
+ insinto /usr
+ doins -r share
+
+ if use cups; then
+ exeinto $(cups-config --serverbin)/filter
+ doexe extras/thnucups
+
+ insinto /etc/cups
+ doins -r etc/cups/*
+ fi
+
+ insinto /etc/xdg
+ doins -r etc/xdg/*
+
+ # install documentation
+ doman man/man1/vmware.1.gz
+
+ if use doc; then
+ dodoc doc/*
+ fi
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/setup
+ doins vmware-config
+
+ # install vmware workstation server
+ if use server; then
+ dosbin sbin/*
+
+ cd "${S}"/vmware-workstation-server
+
+ # install binaries
+ into "${VM_INSTALL_DIR}"/lib/vmware
+ dobin bin/*
+
+ dobin "${FILESDIR}"/configure-hostd.sh
+
+ dobin "${FILESDIR}"/configure-hostd.sh
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/lib
+ doins -r lib/*
+
+ into "${VM_INSTALL_DIR}"
+ for tool in vmware-{hostd,wssc-adminTool} ; do
+ cat > "${T}/${tool}" <<-EOF
+ #!/usr/bin/env bash
+ set -e
+
+ . /etc/vmware/bootstrap
+
+ exec "${VM_INSTALL_DIR}/lib/vmware/lib/wrapper-gtk24.sh" \\
+ "${VM_INSTALL_DIR}/lib/vmware/lib" \\
+ "${VM_INSTALL_DIR}/lib/vmware/bin/${tool}" \\
+ "${VM_INSTALL_DIR}/lib/vmware/libconf" "\$@"
+ EOF
+ dobin "${T}/${tool}"
+ done
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r hostd
+
+ # create the configuration
+ insinto /etc/vmware/hostd
+ doins -r config/etc/vmware/hostd/*
+ doins -r etc/vmware/hostd/*
+
+ insinto /etc/vmware/ssl
+ doins etc/vmware/ssl/*
+
+ # pam
+ pamd_mimic_system vmware-authd auth account
+
+ # create directory for shared virtual machines.
+ keepdir "${VM_DATA_STORE_DIR}"
+ keepdir /var/log/vmware
+ fi
+
+ # install vmware-vix
+ if use vix; then
+ cd "${S}"/vmware-vix
+
+ # install the binary
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-vix
+ doins -r lib/*
+
+ dosym vmware-vix/libvixAllProducts.so "${VM_INSTALL_DIR}"/lib/libbvixAllProducts.so
+
+ # install headers
+ insinto /usr/include/vmware-vix
+ doins include/*
+
+ if use doc; then
+ dohtml -r doc/*
+ fi
+ fi
+
+ # install ovftool
+ if use ovftool; then
+ cd "${S}"
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-ovftool
+ doins -r vmware-ovftool/*
+
+ chmod 0755 "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/{ovftool,ovftool.bin}
+ dosym "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/ovftool "${VM_INSTALL_DIR}"/bin/ovftool
+ fi
+
+ # create symlinks for the various tools
+ local tool ; for tool in thnuclnt vmware vmplayer{,-daemon} licenseTool vmamqpd \
+ vmware-{acetool,enter-serial,gksu,fuseUI,modconfig{,-console},netcfg,tray,unity-helper,zenity} ; do
+ dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
+ done
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware "${VM_INSTALL_DIR}"/bin/vmware
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/setup/vmware-config
+ fperms 4711 "${VM_INSTALL_DIR}"/bin/vmware-mount
+ fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
+ if use server; then
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-{hostd,wssc-adminTool}
+ fperms 4711 "${VM_INSTALL_DIR}"/sbin/vmware-authd
+ fperms 1777 "${VM_DATA_STORE_DIR}"
+ fi
+ if use vix; then
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware-vix/setup/vmware-config
+ fi
+
+ # create the environment
+ local envd="${T}/90vmware"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}"
+
+ # create the configuration
+ dodir /etc/vmware
+
+ cat > "${D}"/etc/vmware/bootstrap <<-EOF
+ BINDIR='${VM_INSTALL_DIR}/bin'
+ LIBDIR='${VM_INSTALL_DIR}/lib'
+ EOF
+
+ cat > "${D}"/etc/vmware/config <<-EOF
+ bindir = "${VM_INSTALL_DIR}/bin"
+ libdir = "${VM_INSTALL_DIR}/lib/vmware"
+ initscriptdir = "/etc/init.d"
+ authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
+ gksu.rootMethod = "su"
+ VMCI_CONFED = "yes"
+ VMBLOCK_CONFED = "yes"
+ VSOCK_CONFED = "yes"
+ NETWORKING = "yes"
+ player.product.version = "${major_minor_revision}"
+ product.version = "${major_minor_revision}"
+ product.buildNumber = "${build}"
+ product.name = "VMware Workstation"
+ workstation.product.version = "${major_minor_revision}"
+ EOF
+
+ if use vix; then
+ cat >> "${D}"/etc/vmware/config <<-EOF
+ vmware.fullpath = "${VM_INSTALL_DIR}/bin/vmware"
+ vix.libdir = "${VM_INSTALL_DIR}/lib/vmware-vix"
+ vix.config.version = "1"
+ EOF
+ fi
+
+ if use server; then
+ cat >> "${D}"/etc/vmware/config <<-EOF
+ authd.client.port = "902"
+ authd.proxy.nfc = "vmware-hostd:ha-nfc"
+ authd.soapserver = "TRUE"
+ EOF
+ fi
+
+ # install the init.d script
+ local initscript="${T}/vmware.rc"
+ sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ "${FILESDIR}/vmware-${major_minor}.rc" > ${initscript}
+ newinitd "${initscript}" vmware
+
+ if use server; then
+ # install the init.d script
+ local initscript="${T}/vmware-workstation-server.rc"
+ sed -e "s:@@ETCDIR@@:/etc/vmware:g" \
+ -e "s:@@PREFIX@@:${VM_INSTALL_DIR}:g" \
+ -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ -e "s:@@LIBDIR@@:${VM_INSTALL_DIR}/lib/vmware:g" \
+ "${FILESDIR}/vmware-server-${major_minor}.rc" > ${initscript}
+ newinitd "${initscript}" vmware-workstation-server
+ fi
+
+ # fill in variable placeholders
+ sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
+ -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}}
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/${PN}.desktop"
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/vmware-player.desktop"
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware-netcfg:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/vmware-netcfg.desktop"
+
+ if use server; then
+ # Configuration for vmware-workstation-server
+ local hostdUser="${VM_HOSTD_USER:-root}"
+ sed -e "/ACEDataUser/s:root:${hostdUser}:g" \
+ -i "${D}/etc/vmware/hostd/authorization.xml" || die
+
+ # Shared VMs Path: [standard].
+ sed -e "s:##{DS_NAME}##:standard:g" \
+ -e "s:##{DS_PATH}##:${VM_DATA_STORE_DIR}:g" \
+ -i "${D}/etc/vmware/hostd/datastores.xml" || die
+
+ sed -e "s:##{HTTP_PORT}##:-1:g" \
+ -e "s:##{HTTPS_PORT}##:443:g" \
+ -e "s:##{PIPE_PREFIX}##:/var/run/vmware/:g" \
+ -i "${D}/etc/vmware/hostd/proxy.xml" || die
+
+ # See vmware-workstation-server.py for more details.
+ sed -e "s:##{BUILD_CFGDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{CFGALTDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{CFGDIR}##:/etc/vmware/:g" \
+ -e "s:##{ENABLE_AUTH}##:true:g" \
+ -e "s:##{HOSTDMODE}##:ws:g" \
+ -e "s:##{HOSTD_CFGDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{HOSTD_MOCKUP}##:false:g" \
+ -e "s:##{LIBDIR}##:${VM_INSTALL_DIR}/lib/vmware:g" \
+ -e "s:##{LIBDIR_INSTALLED}##:${VM_INSTALL_DIR}/lib/vmware/:g" \
+ -e "s:##{LOGDIR}##:/var/log/vmware/:g" \
+ -e "s:##{LOGLEVEL}##:verbose:g" \
+ -e "s:##{MOCKUP}##:mockup-host-config.xml:g" \
+ -e "s:##{PLUGINDIR}##:./:g" \
+ -e "s:##{SHLIB_PREFIX}##:lib:g" \
+ -e "s:##{SHLIB_SUFFIX}##:.so:g" \
+ -e "s:##{USE_BLKLISTSVC}##:false:g" \
+ -e "s:##{USE_CBRCSVC}##:false:g" \
+ -e "s:##{USE_CIMSVC}##:false:g" \
+ -e "s:##{USE_DIRECTORYSVC}##:false:g" \
+ -e "s:##{USE_DIRECTORYSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_DYNAMIC_PLUGIN_LOADING}##:false:g" \
+ -e "s:##{USE_DYNAMO}##:false:g" \
+ -e "s:##{USE_DYNSVC}##:false:g" \
+ -e "s:##{USE_GUESTSVC}##:false:g" \
+ -e "s:##{USE_HBRSVC}##:false:g" \
+ -e "s:##{USE_HBRSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_HOSTSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_HTTPNFCSVC}##:false:g" \
+ -e "s:##{USE_HTTPNFCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_LICENSESVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_NFCSVC}##:true:g" \
+ -e "s:##{USE_NFCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_OVFMGRSVC}##:true:g" \
+ -e "s:##{USE_PARTITIONSVC}##:false:g" \
+ -e "s:##{USE_SECURESOAP}##:false:g" \
+ -e "s:##{USE_SNMPSVC}##:false:g" \
+ -e "s:##{USE_SOLO_MOCKUP}##:false:g" \
+ -e "s:##{USE_STATSSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VDISKSVC}##:false:g" \
+ -e "s:##{USE_VDISKSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VMSVC_MOCKUP}##:false:g" \
+ -e "s:##{VM_INVENTORY}##:vmInventory.xml:g" \
+ -e "s:##{VM_RESOURCES}##:vmResources.xml:g" \
+ -e "s:##{WEBSERVER_PORT_ENTRY}##::g" \
+ -e "s:##{WORKINGDIR}##:./:g" \
+ -i "${D}/etc/vmware/hostd/config.xml" || die
+
+ sed -e "s:##{ENV_LOCATION}##:/etc/vmware/hostd/env/:g" \
+ -i "${D}/etc/vmware/hostd/environments.xml" || die
+
+ # @@VICLIENT_URL@@=XXX
+ sed -e "s:@@AUTHD_PORT@@:902:g" \
+ -i "${D}${VM_INSTALL_DIR}/lib/vmware/hostd/docroot/client/clients.xml" || die
+ fi
+
+ # install systemd unit files
+ systemd_dounit "${WORKDIR}/systemd-vmware-${SYSTEMD_UNITS_TAG}/"*.{service,target}
+}
+
+pkg_config() {
+ "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+ ewarn ""
+ ewarn "Before you can use vmware workstation, you must configure a default network setup."
+ ewarn "You can do this by running 'emerge --config ${PN}'."
+}
+
+pkg_prerm() {
+ einfo "Stopping ${PN} for safe unmerge"
+ /etc/init.d/vmware stop
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vmware-workstation/vmware-workstation-10.0.3.1895310.ebuild b/app-emulation/vmware-workstation/vmware-workstation-10.0.3.1895310.ebuild
new file mode 100644
index 000000000000..fa297474b979
--- /dev/null
+++ b/app-emulation/vmware-workstation/vmware-workstation-10.0.3.1895310.ebuild
@@ -0,0 +1,493 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator fdo-mime systemd gnome2-utils pam vmware-bundle
+
+MY_PN="VMware-Workstation"
+MY_PV=$(get_version_component_range 1-3)
+PV_MINOR=$(get_version_component_range 3)
+PV_BUILD=$(get_version_component_range 4)
+MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
+
+SYSTEMD_UNITS_TAG="gentoo-01"
+
+DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
+HOMEPAGE="http://www.vmware.com/products/workstation/"
+BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/ws/${MY_PV}/${PV_BUILD}/linux/core/"
+SRC_URI="
+ x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
+ amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
+ https://github.com/akhuettel/systemd-vmware/archive/${SYSTEMD_UNITS_TAG}.tar.gz
+ "
+LICENSE="vmware GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="cups doc ovftool server vix vmware-tools"
+RESTRICT="mirror strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="dev-cpp/cairomm
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:2.4
+ dev-cpp/libgnomecanvasmm
+ dev-cpp/pangomm
+ dev-libs/atk
+ dev-libs/glib:2
+ dev-libs/icu
+ dev-libs/expat
+ dev-libs/libaio
+ dev-libs/libgcrypt:0
+ dev-libs/libsigc++
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ dev-libs/xmlrpc-c
+ gnome-base/libgnomecanvas
+ gnome-base/libgtop:2
+ gnome-base/librsvg:2
+ gnome-base/orbit
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libart_lgpl
+ =media-libs/libpng-1.2*
+ media-libs/libpng
+ net-misc/curl
+ cups? ( net-print/cups )
+ sys-devel/gcc
+ sys-fs/fuse
+ sys-libs/glibc
+ sys-libs/zlib
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libgksu
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXcomposite
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXft
+ x11-libs/libXi
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libXtst
+ x11-libs/pango
+ x11-libs/pangox-compat
+ x11-libs/startup-notification
+ x11-themes/hicolor-icon-theme
+ !app-emulation/vmware-player"
+PDEPEND="~app-emulation/vmware-modules-279.${PV_MINOR}
+ vmware-tools? ( app-emulation/vmware-tools )"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+VM_DATA_STORE_DIR="/var/lib/vmware/Shared VMs"
+VM_HOSTD_USER="root"
+
+src_unpack() {
+ default
+ local bundle
+ use amd64 && bundle=${MY_P}.x86_64.bundle
+ use x86 && bundle=${MY_P}.i386.bundle
+ local component; for component in \
+ vmware-vmx \
+ vmware-player-app \
+ vmware-player-setup \
+ vmware-workstation \
+ vmware-network-editor \
+ vmware-network-editor-ui \
+ vmware-usbarbitrator \
+ vmware-vprobe
+ do
+ vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
+ done
+
+ if use server; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-workstation-server #"${S}"
+ fi
+
+ if use vix; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-core vmware-vix
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-lib-Workstation1000andvSphere550 vmware-vix
+ fi
+ if use ovftool; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-ovftool
+ fi
+}
+
+src_prepare() {
+ rm -f bin/vmware-modconfig
+ rm -rf lib/modules/binary
+ # Bug 459566
+ mv lib/libvmware-netcfg.so lib/lib/
+
+ if use server; then
+ rm -f vmware-workstation-server/bin/{openssl,configure-hostd.sh}
+ fi
+
+ find "${S}" -name '*.a' -delete
+
+# clean_bundled_libs
+}
+
+clean_bundled_libs() {
+ ebegin 'Removing superfluous libraries'
+ cd lib/lib || die
+ ldconfig -p | \
+ sed 's:^\s\+\([^(]*[^( ]\).*=> /.*$:\1:g;t;d' | \
+ fgrep -vx 'libcrypto.so.0.9.8
+libssl.so.0.9.8i
+libgcr.so.0
+libglib-2.0.so.0' |
+ xargs -d'\n' -r rm -rf
+ eend
+}
+
+src_install() {
+ local major_minor=$(get_version_component_range 1-2 "${PV}")
+ local major_minor_revision=$(get_version_component_range 1-3 "${PV}")
+ local build=$(get_version_component_range 4 "${PV}")
+
+ # install the binaries
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r lib/*
+
+ # Bug 432918
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
+
+ # install the ancillaries
+ insinto /usr
+ doins -r share
+
+ if use cups; then
+ exeinto $(cups-config --serverbin)/filter
+ doexe extras/thnucups
+
+ insinto /etc/cups
+ doins -r etc/cups/*
+ fi
+
+ insinto /etc/xdg
+ doins -r etc/xdg/*
+
+ # install documentation
+ doman man/man1/vmware.1.gz
+
+ if use doc; then
+ dodoc doc/*
+ fi
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/setup
+ doins vmware-config
+
+ # install vmware workstation server
+ if use server; then
+ dosbin sbin/*
+
+ cd "${S}"/vmware-workstation-server
+
+ # install binaries
+ into "${VM_INSTALL_DIR}"/lib/vmware
+ dobin bin/*
+
+ dobin "${FILESDIR}"/configure-hostd.sh
+
+ dobin "${FILESDIR}"/configure-hostd.sh
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/lib
+ doins -r lib/*
+
+ into "${VM_INSTALL_DIR}"
+ for tool in vmware-{hostd,wssc-adminTool} ; do
+ cat > "${T}/${tool}" <<-EOF
+ #!/usr/bin/env bash
+ set -e
+
+ . /etc/vmware/bootstrap
+
+ exec "${VM_INSTALL_DIR}/lib/vmware/lib/wrapper-gtk24.sh" \\
+ "${VM_INSTALL_DIR}/lib/vmware/lib" \\
+ "${VM_INSTALL_DIR}/lib/vmware/bin/${tool}" \\
+ "${VM_INSTALL_DIR}/lib/vmware/libconf" "\$@"
+ EOF
+ dobin "${T}/${tool}"
+ done
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r hostd
+
+ # create the configuration
+ insinto /etc/vmware/hostd
+ doins -r config/etc/vmware/hostd/*
+ doins -r etc/vmware/hostd/*
+
+ insinto /etc/vmware/ssl
+ doins etc/vmware/ssl/*
+
+ # pam
+ pamd_mimic_system vmware-authd auth account
+
+ # create directory for shared virtual machines.
+ keepdir "${VM_DATA_STORE_DIR}"
+ keepdir /var/log/vmware
+ fi
+
+ # install vmware-vix
+ if use vix; then
+ cd "${S}"/vmware-vix
+
+ # install the binary
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-vix
+ doins -r lib/*
+
+ dosym vmware-vix/libvixAllProducts.so "${VM_INSTALL_DIR}"/lib/libbvixAllProducts.so
+
+ # install headers
+ insinto /usr/include/vmware-vix
+ doins include/*
+
+ if use doc; then
+ dohtml -r doc/*
+ fi
+ fi
+
+ # install ovftool
+ if use ovftool; then
+ cd "${S}"
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-ovftool
+ doins -r vmware-ovftool/*
+
+ chmod 0755 "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/{ovftool,ovftool.bin}
+ dosym "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/ovftool "${VM_INSTALL_DIR}"/bin/ovftool
+ fi
+
+ # create symlinks for the various tools
+ local tool ; for tool in thnuclnt vmware vmplayer{,-daemon} licenseTool vmamqpd \
+ vmware-{acetool,enter-serial,gksu,fuseUI,modconfig{,-console},netcfg,tray,unity-helper,zenity} ; do
+ dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
+ done
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware "${VM_INSTALL_DIR}"/bin/vmware
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/setup/vmware-config
+ fperms 4711 "${VM_INSTALL_DIR}"/bin/vmware-mount
+ fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
+ if use server; then
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-{hostd,wssc-adminTool}
+ fperms 4711 "${VM_INSTALL_DIR}"/sbin/vmware-authd
+ fperms 1777 "${VM_DATA_STORE_DIR}"
+ fi
+ if use vix; then
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware-vix/setup/vmware-config
+ fi
+
+ # create the environment
+ local envd="${T}/90vmware"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}"
+
+ # create the configuration
+ dodir /etc/vmware
+
+ cat > "${D}"/etc/vmware/bootstrap <<-EOF
+ BINDIR='${VM_INSTALL_DIR}/bin'
+ LIBDIR='${VM_INSTALL_DIR}/lib'
+ EOF
+
+ cat > "${D}"/etc/vmware/config <<-EOF
+ bindir = "${VM_INSTALL_DIR}/bin"
+ libdir = "${VM_INSTALL_DIR}/lib/vmware"
+ initscriptdir = "/etc/init.d"
+ authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
+ gksu.rootMethod = "su"
+ VMCI_CONFED = "yes"
+ VMBLOCK_CONFED = "yes"
+ VSOCK_CONFED = "yes"
+ NETWORKING = "yes"
+ player.product.version = "${major_minor_revision}"
+ product.version = "${major_minor_revision}"
+ product.buildNumber = "${build}"
+ product.name = "VMware Workstation"
+ workstation.product.version = "${major_minor_revision}"
+ EOF
+
+ if use vix; then
+ cat >> "${D}"/etc/vmware/config <<-EOF
+ vmware.fullpath = "${VM_INSTALL_DIR}/bin/vmware"
+ vix.libdir = "${VM_INSTALL_DIR}/lib/vmware-vix"
+ vix.config.version = "1"
+ EOF
+ fi
+
+ if use server; then
+ cat >> "${D}"/etc/vmware/config <<-EOF
+ authd.client.port = "902"
+ authd.proxy.nfc = "vmware-hostd:ha-nfc"
+ authd.soapserver = "TRUE"
+ EOF
+ fi
+
+ # install the init.d script
+ local initscript="${T}/vmware.rc"
+ sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ "${FILESDIR}/vmware-${major_minor}.rc" > ${initscript}
+ newinitd "${initscript}" vmware
+
+ if use server; then
+ # install the init.d script
+ local initscript="${T}/vmware-workstation-server.rc"
+ sed -e "s:@@ETCDIR@@:/etc/vmware:g" \
+ -e "s:@@PREFIX@@:${VM_INSTALL_DIR}:g" \
+ -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ -e "s:@@LIBDIR@@:${VM_INSTALL_DIR}/lib/vmware:g" \
+ "${FILESDIR}/vmware-server-${major_minor}.rc" > ${initscript}
+ newinitd "${initscript}" vmware-workstation-server
+ fi
+
+ # fill in variable placeholders
+ sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
+ -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}}
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/${PN}.desktop"
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/vmware-player.desktop"
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware-netcfg:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/vmware-netcfg.desktop"
+
+ if use server; then
+ # Configuration for vmware-workstation-server
+ local hostdUser="${VM_HOSTD_USER:-root}"
+ sed -e "/ACEDataUser/s:root:${hostdUser}:g" \
+ -i "${D}/etc/vmware/hostd/authorization.xml" || die
+
+ # Shared VMs Path: [standard].
+ sed -e "s:##{DS_NAME}##:standard:g" \
+ -e "s:##{DS_PATH}##:${VM_DATA_STORE_DIR}:g" \
+ -i "${D}/etc/vmware/hostd/datastores.xml" || die
+
+ sed -e "s:##{HTTP_PORT}##:-1:g" \
+ -e "s:##{HTTPS_PORT}##:443:g" \
+ -e "s:##{PIPE_PREFIX}##:/var/run/vmware/:g" \
+ -i "${D}/etc/vmware/hostd/proxy.xml" || die
+
+ # See vmware-workstation-server.py for more details.
+ sed -e "s:##{BUILD_CFGDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{CFGALTDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{CFGDIR}##:/etc/vmware/:g" \
+ -e "s:##{ENABLE_AUTH}##:true:g" \
+ -e "s:##{HOSTDMODE}##:ws:g" \
+ -e "s:##{HOSTD_CFGDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{HOSTD_MOCKUP}##:false:g" \
+ -e "s:##{LIBDIR}##:${VM_INSTALL_DIR}/lib/vmware:g" \
+ -e "s:##{LIBDIR_INSTALLED}##:${VM_INSTALL_DIR}/lib/vmware/:g" \
+ -e "s:##{LOGDIR}##:/var/log/vmware/:g" \
+ -e "s:##{LOGLEVEL}##:verbose:g" \
+ -e "s:##{MOCKUP}##:mockup-host-config.xml:g" \
+ -e "s:##{PLUGINDIR}##:./:g" \
+ -e "s:##{SHLIB_PREFIX}##:lib:g" \
+ -e "s:##{SHLIB_SUFFIX}##:.so:g" \
+ -e "s:##{USE_BLKLISTSVC}##:false:g" \
+ -e "s:##{USE_CBRCSVC}##:false:g" \
+ -e "s:##{USE_CIMSVC}##:false:g" \
+ -e "s:##{USE_DIRECTORYSVC}##:false:g" \
+ -e "s:##{USE_DIRECTORYSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_DYNAMIC_PLUGIN_LOADING}##:false:g" \
+ -e "s:##{USE_DYNAMO}##:false:g" \
+ -e "s:##{USE_DYNSVC}##:false:g" \
+ -e "s:##{USE_GUESTSVC}##:false:g" \
+ -e "s:##{USE_HBRSVC}##:false:g" \
+ -e "s:##{USE_HBRSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_HOSTSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_HTTPNFCSVC}##:false:g" \
+ -e "s:##{USE_HTTPNFCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_LICENSESVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_NFCSVC}##:true:g" \
+ -e "s:##{USE_NFCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_OVFMGRSVC}##:true:g" \
+ -e "s:##{USE_PARTITIONSVC}##:false:g" \
+ -e "s:##{USE_SECURESOAP}##:false:g" \
+ -e "s:##{USE_SNMPSVC}##:false:g" \
+ -e "s:##{USE_SOLO_MOCKUP}##:false:g" \
+ -e "s:##{USE_STATSSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VDISKSVC}##:false:g" \
+ -e "s:##{USE_VDISKSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VMSVC_MOCKUP}##:false:g" \
+ -e "s:##{VM_INVENTORY}##:vmInventory.xml:g" \
+ -e "s:##{VM_RESOURCES}##:vmResources.xml:g" \
+ -e "s:##{WEBSERVER_PORT_ENTRY}##::g" \
+ -e "s:##{WORKINGDIR}##:./:g" \
+ -i "${D}/etc/vmware/hostd/config.xml" || die
+
+ sed -e "s:##{ENV_LOCATION}##:/etc/vmware/hostd/env/:g" \
+ -i "${D}/etc/vmware/hostd/environments.xml" || die
+
+ # @@VICLIENT_URL@@=XXX
+ sed -e "s:@@AUTHD_PORT@@:902:g" \
+ -i "${D}${VM_INSTALL_DIR}/lib/vmware/hostd/docroot/client/clients.xml" || die
+ fi
+
+ # install systemd unit files
+ systemd_dounit "${WORKDIR}/systemd-vmware-${SYSTEMD_UNITS_TAG}/"*.{service,target}
+}
+
+pkg_config() {
+ "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+ ewarn ""
+ ewarn "Before you can use vmware workstation, you must configure a default network setup."
+ ewarn "You can do this by running 'emerge --config ${PN}'."
+}
+
+pkg_prerm() {
+ einfo "Stopping ${PN} for safe unmerge"
+ /etc/init.d/vmware stop
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vmware-workstation/vmware-workstation-9.0.3.1410761.ebuild b/app-emulation/vmware-workstation/vmware-workstation-9.0.3.1410761.ebuild
new file mode 100644
index 000000000000..6103fb38e7fd
--- /dev/null
+++ b/app-emulation/vmware-workstation/vmware-workstation-9.0.3.1410761.ebuild
@@ -0,0 +1,491 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils versionator fdo-mime systemd gnome2-utils pam vmware-bundle
+
+MY_PN="VMware-Workstation"
+MY_PV=$(get_version_component_range 1-3)
+PV_MINOR=$(get_version_component_range 3)
+PV_BUILD=$(get_version_component_range 4)
+MY_P="${MY_PN}-${MY_PV}-${PV_BUILD}"
+
+SYSTEMD_UNITS_TAG="gentoo-01"
+
+DESCRIPTION="Emulate a complete PC on your PC without the usual performance overhead of most emulators"
+HOMEPAGE="http://www.vmware.com/products/workstation/"
+BASE_URI="https://softwareupdate.vmware.com/cds/vmw-desktop/ws/${MY_PV}/${PV_BUILD}/linux/core/"
+SRC_URI="
+ x86? ( ${BASE_URI}${MY_P}.i386.bundle.tar )
+ amd64? ( ${BASE_URI}${MY_P}.x86_64.bundle.tar )
+ https://github.com/akhuettel/systemd-vmware/archive/${SYSTEMD_UNITS_TAG}.tar.gz
+ "
+LICENSE="vmware GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="cups doc ovftool server vix vmware-tools"
+RESTRICT="mirror strip"
+
+# vmware-workstation should not use virtual/libc as this is a
+# precompiled binary package thats linked to glibc.
+RDEPEND="dev-cpp/cairomm
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:2.4
+ dev-cpp/libgnomecanvasmm
+ dev-cpp/pangomm
+ dev-libs/atk
+ dev-libs/glib:2
+ dev-libs/icu
+ dev-libs/expat
+ dev-libs/libaio
+ dev-libs/libsigc++
+ dev-libs/libxml2
+ =dev-libs/openssl-0.9.8*
+ dev-libs/xmlrpc-c
+ gnome-base/libgnomecanvas
+ gnome-base/libgtop:2
+ gnome-base/librsvg:2
+ gnome-base/orbit
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/libart_lgpl
+ =media-libs/libpng-1.2*
+ media-libs/libpng
+ net-misc/curl
+ cups? ( net-print/cups )
+ sys-devel/gcc
+ sys-fs/fuse
+ sys-libs/glibc
+ sys-libs/zlib
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/libgksu
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXau
+ x11-libs/libxcb
+ x11-libs/libXcomposite
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXdmcp
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXft
+ x11-libs/libXi
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libXtst
+ x11-libs/pango
+ x11-libs/startup-notification
+ x11-themes/hicolor-icon-theme
+ !app-emulation/vmware-player"
+PDEPEND="~app-emulation/vmware-modules-271.${PV_MINOR}
+ vmware-tools? ( app-emulation/vmware-tools )"
+
+S=${WORKDIR}
+VM_INSTALL_DIR="/opt/vmware"
+VM_DATA_STORE_DIR="/var/lib/vmware/Shared VMs"
+VM_HOSTD_USER="root"
+
+src_unpack() {
+ default
+ local bundle
+ use amd64 && bundle=${MY_P}.x86_64.bundle
+ use x86 && bundle=${MY_P}.i386.bundle
+ local component; for component in \
+ vmware-vmx \
+ vmware-player-app \
+ vmware-player-setup \
+ vmware-workstation \
+ vmware-network-editor \
+ vmware-network-editor-ui \
+ vmware-usbarbitrator \
+ vmware-vprobe
+ do
+ vmware-bundle_extract-bundle-component "${bundle}" "${component}" "${S}"
+ done
+
+ if use server; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-workstation-server #"${S}"
+ fi
+
+ if use vix; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-core vmware-vix
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-vix-lib-Workstation900andvSphere510 vmware-vix
+ fi
+ if use ovftool; then
+ vmware-bundle_extract-bundle-component "${bundle}" vmware-ovftool
+ fi
+}
+
+src_prepare() {
+ rm -f bin/vmware-modconfig
+ rm -rf lib/modules/binary
+ # Bug 459566
+ mv lib/libvmware-netcfg.so lib/lib/
+
+ if use server; then
+ rm -f vmware-workstation-server/bin/{openssl,configure-hostd.sh}
+ fi
+
+ find "${S}" -name '*.a' -delete
+
+# clean_bundled_libs
+}
+
+clean_bundled_libs() {
+ ebegin 'Removing superfluous libraries'
+ cd lib/lib || die
+ ldconfig -p | \
+ sed 's:^\s\+\([^(]*[^( ]\).*=> /.*$:\1:g;t;d' | \
+ fgrep -vx 'libcrypto.so.0.9.8
+libssl.so.0.9.8i
+libgcr.so.0
+libglib-2.0.so.0' |
+ xargs -d'\n' -r rm -rf
+ eend
+}
+
+src_install() {
+ local major_minor=$(get_version_component_range 1-2 "${PV}")
+ local major_minor_revision=$(get_version_component_range 1-3 "${PV}")
+ local build=$(get_version_component_range 4 "${PV}")
+
+ # install the binaries
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r lib/*
+
+ # Bug 432918
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libcrypto.so.0.9.8/libcrypto.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libcrypto.so.0.9.8
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/lib/libssl.so.0.9.8/libssl.so.0.9.8 \
+ "${VM_INSTALL_DIR}"/lib/vmware/lib/libvmwarebase.so.0/libssl.so.0.9.8
+
+ # install the ancillaries
+ insinto /usr
+ doins -r share
+
+ if use cups; then
+ exeinto $(cups-config --serverbin)/filter
+ doexe extras/thnucups
+
+ insinto /etc/cups
+ doins -r etc/cups/*
+ fi
+
+ insinto /etc/xdg
+ doins -r etc/xdg/*
+
+ # install documentation
+ doman man/man1/vmware.1.gz
+
+ if use doc; then
+ dodoc doc/*
+ fi
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/setup
+ doins vmware-config
+
+ # install vmware workstation server
+ if use server; then
+ dosbin sbin/*
+
+ cd "${S}"/vmware-workstation-server
+
+ # install binaries
+ into "${VM_INSTALL_DIR}"/lib/vmware
+ dobin bin/*
+
+ dobin "${FILESDIR}"/configure-hostd.sh
+
+ dobin "${FILESDIR}"/configure-hostd.sh
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware/lib
+ doins -r lib/*
+
+ into "${VM_INSTALL_DIR}"
+ for tool in vmware-{hostd,wssc-adminTool} ; do
+ cat > "${T}/${tool}" <<-EOF
+ #!/usr/bin/env bash
+ set -e
+
+ . /etc/vmware/bootstrap
+
+ exec "${VM_INSTALL_DIR}/lib/vmware/lib/wrapper-gtk24.sh" \\
+ "${VM_INSTALL_DIR}/lib/vmware/lib" \\
+ "${VM_INSTALL_DIR}/lib/vmware/bin/${tool}" \\
+ "${VM_INSTALL_DIR}/lib/vmware/libconf" "\$@"
+ EOF
+ dobin "${T}/${tool}"
+ done
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware
+ doins -r hostd
+
+ # create the configuration
+ insinto /etc/vmware/hostd
+ doins -r config/etc/vmware/hostd/*
+ doins -r etc/vmware/hostd/*
+
+ insinto /etc/vmware/ssl
+ doins etc/vmware/ssl/*
+
+ # pam
+ pamd_mimic_system vmware-authd auth account
+
+ # create directory for shared virtual machines.
+ keepdir "${VM_DATA_STORE_DIR}"
+ keepdir /var/log/vmware
+ fi
+
+ # install vmware-vix
+ if use vix; then
+ cd "${S}"/vmware-vix
+
+ # install the binary
+ into "${VM_INSTALL_DIR}"
+ dobin bin/*
+
+ # install the libraries
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-vix
+ doins -r lib/*
+
+ dosym vmware-vix/libvixAllProducts.so "${VM_INSTALL_DIR}"/lib/libbvixAllProducts.so
+
+ # install headers
+ insinto /usr/include/vmware-vix
+ doins include/*
+
+ if use doc; then
+ dohtml -r doc/*
+ fi
+ fi
+
+ # install ovftool
+ if use ovftool; then
+ cd "${S}"
+
+ insinto "${VM_INSTALL_DIR}"/lib/vmware-ovftool
+ doins -r vmware-ovftool/*
+
+ chmod 0755 "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/{ovftool,ovftool.bin}
+ dosym "${D}${VM_INSTALL_DIR}"/lib/vmware-ovftool/ovftool "${VM_INSTALL_DIR}"/bin/ovftool
+ fi
+
+ # create symlinks for the various tools
+ local tool ; for tool in thnuclnt vmware vmplayer{,-daemon} \
+ vmware-{acetool,enter-serial,gksu,fuseUI,modconfig{,-console},netcfg,tray,unity-helper} ; do
+ dosym appLoader "${VM_INSTALL_DIR}"/lib/vmware/bin/"${tool}"
+ done
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmplayer "${VM_INSTALL_DIR}"/bin/vmplayer
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware "${VM_INSTALL_DIR}"/bin/vmware
+ dosym "${VM_INSTALL_DIR}"/lib/vmware/icu /etc/vmware/icu
+
+ # fix permissions
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/{appLoader,fusermount,launcher.sh,mkisofs,vmware-remotemks}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/lib/{wrapper-gtk24.sh,libgksu2.so.0/gksu-run-helper}
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/setup/vmware-config
+ fperms 4711 "${VM_INSTALL_DIR}"/bin/vmware-mount
+ fperms 4711 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-vmx{,-debug,-stats}
+ if use server; then
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware/bin/vmware-{hostd,wssc-adminTool}
+ fperms 4711 "${VM_INSTALL_DIR}"/sbin/vmware-authd
+ fperms 1777 "${VM_DATA_STORE_DIR}"
+ fi
+ if use vix; then
+ fperms 0755 "${VM_INSTALL_DIR}"/lib/vmware-vix/setup/vmware-config
+ fi
+
+ # create the environment
+ local envd="${T}/90vmware"
+ cat > "${envd}" <<-EOF
+ PATH='${VM_INSTALL_DIR}/bin'
+ ROOTPATH='${VM_INSTALL_DIR}/bin'
+ EOF
+ doenvd "${envd}"
+
+ # create the configuration
+ dodir /etc/vmware
+
+ cat > "${D}"/etc/vmware/bootstrap <<-EOF
+ BINDIR='${VM_INSTALL_DIR}/bin'
+ LIBDIR='${VM_INSTALL_DIR}/lib'
+ EOF
+
+ cat > "${D}"/etc/vmware/config <<-EOF
+ bindir = "${VM_INSTALL_DIR}/bin"
+ libdir = "${VM_INSTALL_DIR}/lib/vmware"
+ initscriptdir = "/etc/init.d"
+ authd.fullpath = "${VM_INSTALL_DIR}/sbin/vmware-authd"
+ gksu.rootMethod = "su"
+ VMCI_CONFED = "yes"
+ VMBLOCK_CONFED = "yes"
+ VSOCK_CONFED = "yes"
+ NETWORKING = "yes"
+ player.product.version = "${major_minor_revision}"
+ product.version = "${major_minor_revision}"
+ product.buildNumber = "${build}"
+ product.name = "VMware Workstation"
+ workstation.product.version = "${major_minor_revision}"
+ EOF
+
+ if use vix; then
+ cat >> "${D}"/etc/vmware/config <<-EOF
+ vmware.fullpath = "${VM_INSTALL_DIR}/bin/vmware"
+ vix.libdir = "${VM_INSTALL_DIR}/lib/vmware-vix"
+ vix.config.version = "1"
+ EOF
+ fi
+
+ if use server; then
+ cat >> "${D}"/etc/vmware/config <<-EOF
+ authd.client.port = "902"
+ authd.proxy.nfc = "vmware-hostd:ha-nfc"
+ authd.soapserver = "TRUE"
+ EOF
+ fi
+
+ # install the init.d script
+ local initscript="${T}/vmware.rc"
+ sed -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ "${FILESDIR}/vmware-${major_minor}.rc" > ${initscript}
+ newinitd "${initscript}" vmware
+
+ if use server; then
+ # install the init.d script
+ local initscript="${T}/vmware-workstation-server.rc"
+ sed -e "s:@@ETCDIR@@:/etc/vmware:g" \
+ -e "s:@@PREFIX@@:${VM_INSTALL_DIR}:g" \
+ -e "s:@@BINDIR@@:${VM_INSTALL_DIR}/bin:g" \
+ -e "s:@@LIBDIR@@:${VM_INSTALL_DIR}/lib/vmware:g" \
+ "${FILESDIR}/vmware-server-${major_minor}.rc" > ${initscript}
+ newinitd "${initscript}" vmware-workstation-server
+ fi
+
+ # fill in variable placeholders
+ sed -e "s:@@LIBCONF_DIR@@:${VM_INSTALL_DIR}/lib/vmware/libconf:g" \
+ -i "${D}${VM_INSTALL_DIR}"/lib/vmware/libconf/etc/{gtk-2.0/{gdk-pixbuf.loaders,gtk.immodules},pango/pango{.modules,rc}}
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/${PN}.desktop"
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmplayer:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/vmware-player.desktop"
+ sed -e "s:@@BINARY@@:${VM_INSTALL_DIR}/bin/vmware-netcfg:g" \
+ -e "/^Encoding/d" \
+ -i "${D}/usr/share/applications/vmware-netcfg.desktop"
+
+ if use server; then
+ # Configuration for vmware-workstation-server
+ local hostdUser="${VM_HOSTD_USER:-root}"
+ sed -e "/ACEDataUser/s:root:${hostdUser}:g" \
+ -i "${D}/etc/vmware/hostd/authorization.xml" || die
+
+ # Shared VMs Path: [standard].
+ sed -e "s:##{DS_NAME}##:standard:g" \
+ -e "s:##{DS_PATH}##:${VM_DATA_STORE_DIR}:g" \
+ -i "${D}/etc/vmware/hostd/datastores.xml" || die
+
+ sed -e "s:##{HTTP_PORT}##:-1:g" \
+ -e "s:##{HTTPS_PORT}##:443:g" \
+ -e "s:##{PIPE_PREFIX}##:/var/run/vmware/:g" \
+ -i "${D}/etc/vmware/hostd/proxy.xml" || die
+
+ # See vmware-workstation-server.py for more details.
+ sed -e "s:##{BUILD_CFGDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{CFGALTDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{CFGDIR}##:/etc/vmware/:g" \
+ -e "s:##{ENABLE_AUTH}##:true:g" \
+ -e "s:##{HOSTDMODE}##:ws:g" \
+ -e "s:##{HOSTD_CFGDIR}##:/etc/vmware/hostd/:g" \
+ -e "s:##{HOSTD_MOCKUP}##:false:g" \
+ -e "s:##{LIBDIR}##:${VM_INSTALL_DIR}/lib/vmware:g" \
+ -e "s:##{LIBDIR_INSTALLED}##:${VM_INSTALL_DIR}/lib/vmware/:g" \
+ -e "s:##{LOGDIR}##:/var/log/vmware/:g" \
+ -e "s:##{LOGLEVEL}##:verbose:g" \
+ -e "s:##{MOCKUP}##:mockup-host-config.xml:g" \
+ -e "s:##{PLUGINDIR}##:./:g" \
+ -e "s:##{SHLIB_PREFIX}##:lib:g" \
+ -e "s:##{SHLIB_SUFFIX}##:.so:g" \
+ -e "s:##{USE_BLKLISTSVC}##:false:g" \
+ -e "s:##{USE_CBRCSVC}##:false:g" \
+ -e "s:##{USE_CIMSVC}##:false:g" \
+ -e "s:##{USE_DIRECTORYSVC}##:false:g" \
+ -e "s:##{USE_DIRECTORYSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_DYNAMIC_PLUGIN_LOADING}##:false:g" \
+ -e "s:##{USE_DYNAMO}##:false:g" \
+ -e "s:##{USE_DYNSVC}##:false:g" \
+ -e "s:##{USE_GUESTSVC}##:false:g" \
+ -e "s:##{USE_HBRSVC}##:false:g" \
+ -e "s:##{USE_HBRSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_HOSTSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_HTTPNFCSVC}##:false:g" \
+ -e "s:##{USE_HTTPNFCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_LICENSESVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_NFCSVC}##:true:g" \
+ -e "s:##{USE_NFCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_OVFMGRSVC}##:true:g" \
+ -e "s:##{USE_PARTITIONSVC}##:false:g" \
+ -e "s:##{USE_SECURESOAP}##:false:g" \
+ -e "s:##{USE_SNMPSVC}##:false:g" \
+ -e "s:##{USE_SOLO_MOCKUP}##:false:g" \
+ -e "s:##{USE_STATSSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VCSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VDISKSVC}##:false:g" \
+ -e "s:##{USE_VDISKSVC_MOCKUP}##:false:g" \
+ -e "s:##{USE_VMSVC_MOCKUP}##:false:g" \
+ -e "s:##{VM_INVENTORY}##:vmInventory.xml:g" \
+ -e "s:##{VM_RESOURCES}##:vmResources.xml:g" \
+ -e "s:##{WEBSERVER_PORT_ENTRY}##::g" \
+ -e "s:##{WORKINGDIR}##:./:g" \
+ -i "${D}/etc/vmware/hostd/config.xml" || die
+
+ sed -e "s:##{ENV_LOCATION}##:/etc/vmware/hostd/env/:g" \
+ -i "${D}/etc/vmware/hostd/environments.xml" || die
+
+ # @@VICLIENT_URL@@=XXX
+ sed -e "s:@@AUTHD_PORT@@:902:g" \
+ -i "${D}${VM_INSTALL_DIR}/lib/vmware/hostd/docroot/client/clients.xml" || die
+ fi
+
+ # install systemd unit files
+ systemd_dounit "${WORKDIR}/systemd-vmware-${SYSTEMD_UNITS_TAG}"/*.{service,target}
+}
+
+pkg_config() {
+ "${VM_INSTALL_DIR}"/bin/vmware-networks --postinstall ${PN},old,new
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ ewarn "/etc/env.d was updated. Please run:"
+ ewarn "env-update && source /etc/profile"
+ ewarn ""
+ ewarn "Before you can use vmware workstation, you must configure a default network setup."
+ ewarn "You can do this by running 'emerge --config ${PN}'."
+}
+
+pkg_prerm() {
+ einfo "Stopping ${PN} for safe unmerge"
+ /etc/init.d/vmware stop
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/app-emulation/vov/Manifest b/app-emulation/vov/Manifest
new file mode 100644
index 000000000000..598de88cd5ec
--- /dev/null
+++ b/app-emulation/vov/Manifest
@@ -0,0 +1 @@
+DIST vov-2.0.0.tar.gz 510667 SHA256 f615cec368999171d911faf539bb32db1ba58d572857b2402efa4be144463bed SHA512 67a3b552dc768dff57ed2b7119ff288f4ef120a5f48279a4a003ff39add051b7fec9f22c3278449c6e96b7b5da1cc40a5fefef7a320fbfceadddf73b317a57a7 WHIRLPOOL 0b5dac1a1d44d9056c9f492d3aa046c11cf7b0acae2c5cb994affb0e4632f67cfa85fa1b8790fa8225c30cfd9434904225e0e7091b31a369a93eaa8995610e80
diff --git a/app-emulation/vov/metadata.xml b/app-emulation/vov/metadata.xml
new file mode 100644
index 000000000000..2abfac6f7358
--- /dev/null
+++ b/app-emulation/vov/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>dlan@gentoo.org</email>
+ <name>Yixun Lan</name>
+ </maintainer>
+ <longdescription>
+ vov (Vov's Obsessive Von-Neumann) is a tool that emulates the behavior of a Von-Neumann machine.
+ It is basically an interpreter, which reads files in the form of memory assignments and executes
+ the encoded instructions. The vov's instructions make you able to perform simple arithmetic data
+ manipulation. It is a very useful tool to see if your programs work and how.
+ </longdescription>
+ <use>
+ <flag name='gprof'>build with profiling support</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/vov/vov-2.0.0.ebuild b/app-emulation/vov/vov-2.0.0.ebuild
new file mode 100644
index 000000000000..78b907941f8e
--- /dev/null
+++ b/app-emulation/vov/vov-2.0.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic
+
+DESCRIPTION="vov (Vov's Obsessive Von-Neumann) is a tool that emulates the behavior of a Von-Neumann machine"
+HOMEPAGE="http://home.gna.org/vov/"
+SRC_URI="http://download.gna.org/vov/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86"
+IUSE="debug gprof"
+
+RDEPEND=""
+DEPEND=">=sys-devel/flex-2.5.33-r3
+ >=sys-apps/sed-4.1.5"
+
+src_unpack()
+{
+ unpack ${A}
+
+ # do no install redundant documentation
+ cd "${S}"
+ sed -i 's/src scripts docs/src scripts/' "${S}/Makefile.in"
+}
+
+src_compile()
+{
+ local fp_support=""
+
+ if use gprof; then
+ filter-flags "-fomit-frame-pointer"
+ fp_support="--enable-frame-pointer"
+ fi
+
+ econf \
+ `use_enable gprof` \
+ `use_enable debug` \
+ ${fp_support} \
+ || die "econf failed"
+
+ emake || die "emake failed"
+}
+
+src_install()
+{
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc AUTHORS README NEWS
+ doman docs/vov.1
+}
diff --git a/app-emulation/vpcs/Manifest b/app-emulation/vpcs/Manifest
new file mode 100644
index 000000000000..cb70521268cf
--- /dev/null
+++ b/app-emulation/vpcs/Manifest
@@ -0,0 +1 @@
+DIST vpcs-0.6-src.tbz 131820 SHA256 cc311b0dea9ea02ef95f26704d73e34d293caa503600a0acca202d577afd3ceb SHA512 a740f264551de9e8dd95de2fbba444d9525f63c4c5473aea6cf1016c99d7866f3d0623f9f934bda7a0b565c23179647734c400ce3bb685fdab8ec6c35f25d671 WHIRLPOOL a4396f11ed64583ee5d0c7a681fb8f05c792b27eaac057b3ad85d63173d7ccdb7cd679e4b0a1a0f2904d64c51d922f75ab08b638053a0364443f4a0661b80fda
diff --git a/app-emulation/vpcs/metadata.xml b/app-emulation/vpcs/metadata.xml
new file mode 100644
index 000000000000..2391c644fe52
--- /dev/null
+++ b/app-emulation/vpcs/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>idella4@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>aaron@flappyport.com</email>
+ <name>Arron Bauman</name>
+ <description>proxy maintainer</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">vpcs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/vpcs/vpcs-0.6.ebuild b/app-emulation/vpcs/vpcs-0.6.ebuild
new file mode 100644
index 000000000000..9385b1d70ad4
--- /dev/null
+++ b/app-emulation/vpcs/vpcs-0.6.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="Simulate up to 9 PCs in place of VMware boxes in a Dynamips network"
+HOMEPAGE="http://vpcs.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${PV}/${P}-src.tbz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S="${S}/src/"
+
+src_prepare() {
+ # move Makefile in place
+ cp Makefile.linux Makefile
+
+ # replace hardcoded CFLAGS with user set CFLAGS
+ # append -fno-strict-aliasing to CFLAGS to suppress QA issues from upstream
+ # add user $LDFLAGS in the front and remove -s that strips binary
+ sed -e "s/-D\$(CPUTYPE)/${CFLAGS} -fno-strict-aliasing/" \
+ -e "s/^LDFLAGS=/LDFLAGS=${LDFLAGS} /" \
+ -e "s/-s //" \
+ -i Makefile || die
+}
+
+src_compile() {
+ emake CC=$(tc-getCC)
+}
+
+src_install() {
+ #put binary in /usr/bin
+ dobin vpcs
+
+ doman ../man/vpcs.1
+}
diff --git a/app-emulation/wine/Manifest b/app-emulation/wine/Manifest
new file mode 100644
index 000000000000..8c0e8d84485c
--- /dev/null
+++ b/app-emulation/wine/Manifest
@@ -0,0 +1,79 @@
+DIST wine-1.6.2.tar.bz2 21252985 SHA256 f0ab9eede5a0ccacbf6e50682649f9377b9199e49cf55641f1787cf72405acbe SHA512 81c83566dc2cab276ab7b9cfb5edc5fbca0f003dcb78044a0197c9a4d9a05a40f9045e5b4981c9219c3c39dab52fe519ef3cb338d79ee01e1fe66e3c056e8397 WHIRLPOOL 7d2d995a9996d63e17ff3ef5871f3818945dcd90c4a22798506f0d0c31ed999462bc5718f5cc562b9da64fdd7af6b240380bfa2901eabd23fb036aebfc7c554c
+DIST wine-1.7.10.tar.bz2 21312974 SHA256 44270e4b97ef930e4e4b59088e6e3972e91e85bacf9a9a4d8712a877c9d5cbdb SHA512 157fe4146df3c174643cc1ac29748778aa90fb9e602b417ad772d3da2af3a86307ca818ded860722513efdba57b85e06a2db2869a69a3f579255829dc3d8ac55 WHIRLPOOL eaba07f65c416ce93b9243df402ad0fb5a2f5e7bce43f40b73941f2ea7baddbcab9ce3a999d9086faeaead7552f5d34234cc3b3f3798db2fb98982ef22a98b71
+DIST wine-1.7.11.tar.bz2 21359534 SHA256 c07d2771ed96c45d428bb11d164c5e4bbe48d6857a0a4cba2e0b73c5f1044f93 SHA512 9743c4cf382b6846d98aa383d9db22cb99bca510ec2db3e9224f10d08095c4a3fe4449b3019d5a6f401458a98696d096a454d00584c667074aed618c47544dcf WHIRLPOOL 38356b5df2c9f5a78b9eb66c6e0f09f7371c57d84f601e6614228b64c629a2c9c222696078d7627df850792a0111e7876fe460c4575bac4accf2f56a391315c6
+DIST wine-1.7.12.tar.bz2 21366705 SHA256 2dcdff7bf8bac2bc10da85e3e632e8add830f22cf416173e53abca4ec580b392 SHA512 7b5be06dd6d71512884bbcc386fb021725125fb95a4493a033624c2b801eaec7fb4be4b70894ee914da138d8e310da3ac49b8a32538ee21d127201cebc44b449 WHIRLPOOL fb04306058403f82df8cf3e88d21d8011bd2e7cdfa4c31f28e64ea0d24393cd6ed8f61724839a1b5cde272ac8dd854c6c6185e7dee8271881b9b3eb1612f4bbe
+DIST wine-1.7.13.tar.bz2 21385204 SHA256 a72fdee6e1898007b38f3b30584f86d996567ad8d2f1cc0fe3a877be0493b9df SHA512 ba01933770c0fbaf056fe252b77eb7f2c160f5455450cace638bc288683fb8f6d97421927ec935795eda9aae500bfeb19e6ca8d632822c345f8bfb34b3d27d15 WHIRLPOOL e500fb6cebee9d87aa0c9ed788df37e2f744c0cb1453a6dc20e447dabd9e1becabb00f93ea9272856aa35015703e98b7512c2e233f98e67143abc80b1ae7f182
+DIST wine-1.7.14.tar.bz2 21444526 SHA256 2df1937e28936ba33e70a42fddcee01097ca0fbdd4dbf2c2f05d8a2ff5263e09 SHA512 0bd3d74b375c14b3f3601a4e590e4dd1808ff60f6d3d87241596ea8649c910968a2e95bd5031d5065253b6b938ce9002bad159c95457578f2cd9c34e06bac8e6 WHIRLPOOL 31b94611bf5d3c9123829fc9375b8c9306b6e044ed07c08ee0f4d5db47f88c38570f98514e45a0bc326d9352abb385375b9587e84fc23a70152f6696793eb622
+DIST wine-1.7.15.tar.bz2 21463370 SHA256 519137adc562d32035fcf7b110d6e65fdd7721af0b176567a2187397c63f1380 SHA512 7ac95fa4c873570ff04c2ab4adca40d3898cb0f0d5bea081208bb8d16787470f75a9f6f20a1f7123eebbf2acd977391ae35b107c59e25fa48ef3b0bcdcb559b6 WHIRLPOOL d114d2022e91c663e33181213260eecf63d10d515167c27e4fca75bd47f3036a02943c5d5f5ee103202732b9b7c2ae2964724bd88892aeec2c15e634132f5aef
+DIST wine-1.7.16.tar.bz2 21478085 SHA256 071ed89d9c76219aa73df6472b99f9f0b35e4977235e2b8e388c11416a2d1c6a SHA512 7baa99280f78eb8881dba470c3a17ab093f9cfb0950eb4dea1a89849ee0794ddda373049fda2fde5551963b231e4548345892e759cf4690ab047c49147fa504e WHIRLPOOL b6ef7a096837d406b0f9a67f6719dae85c12e2f0d00dc9fdcefacd9db5485fccacdfa788e68abf0a279c20daee246ab7d25aeb14f1e96c5bb3187f38550157c1
+DIST wine-1.7.17.tar.bz2 21531865 SHA256 bb6fbd7fd70f9aafba557995d9ce537ded56e750e0a89a062e3318d584a8abef SHA512 32ff77d201200cb8a159395fe5d410b118bf4db16a89a9708128dbb7c25e45457c80d76e2821edf06db99525e5a93b6b1a7ee7166d7972f7ceb7fc47aaf8784b WHIRLPOOL 55f6fe3fced59c6344b2656a22eeba478be4a138ec26c28306316cb0dfdaed0c41f71584dbda683070a1a03a45a010fdd2989a8cb95a81294fa2d8b13c55cbaf
+DIST wine-1.7.18.tar.bz2 21595718 SHA256 dab6d12e620e2097a6838a3f6928f3b2ca3aab0b70521b53107ee1998303d378 SHA512 059f60318508f158cceef029c111c2b11bdf334def95aa96361163358ad7632f87fe0d1d9a05060a5b76ddcb367d8490fd31a1b512ecf7cd01f7be82a8ff8677 WHIRLPOOL 8b2dfdb85a7271a447fc827f4afb697bebc3fa3f52463b0debb1631e3c156fe46b00839d94b7e27be1407009608f54f07acb211c68fb6448f7ad30ccbdacf55d
+DIST wine-1.7.19.tar.bz2 21633142 SHA256 c5ea9b00c9029ecf47a25881b284d8ea02079dfbabc22aa789d6d07e38b32ff2 SHA512 3bf6399027752150469046c3ea51ff0c7e56bca7ed8db7def16c16c41f31c118c5217bb67882b7de88eb710f2af4a89e2858b82071523d5f9cd00ec66dd0348c WHIRLPOOL b125e2ec48801349bc73483527213daee20674a2e93f30f41e6fe138884ec7a4dbe0698b15ed69ed1062f0a045e11526fab8f23ed701147c85ebc1db0afb7f2d
+DIST wine-1.7.20.tar.bz2 21635815 SHA256 9c431b0b96222d0c27a2c2326ed88298ac0dae50ea783ef764c48c4373bf5f15 SHA512 ffc168ff4342fb5d8fb4a4a242c37f91613e983d644bd6b6d8798110b12339806d58d3abca8856855c286e40b9e4344a17fc834731dd03a42ea0743d1f24bd44 WHIRLPOOL 5ad69f9355897b4ce72c18c239dca2909d0c6094ff2c763731834d5b313fe04806648966e9d60408a14c0cf0dcb981587ffc0edaec8af07fe0a138364062fa53
+DIST wine-1.7.21.tar.bz2 21635330 SHA256 a14723104135c21414c61e146144a2c527430057255f8c35a3a7d354e68b9401 SHA512 73db3256d04c681ea7a4524767f9f93c24a4cc96aa901c6fdfd700c7e8968cdb127a110df56f10423cac90aadc783ceafcd0dc571e36ea096c1de03c619164d8 WHIRLPOOL 32bcf10f8665dab43339e79240b534f3fa29087787acd752553b4b717f6c26f8e98d36185f61e928e2c5ef9a3663b9eac7ec42cd9898800ba12efab74c78634c
+DIST wine-1.7.22.tar.bz2 21661089 SHA256 60374c94c64110d58939e716c3ef4916059c691a2953d8340a9a140a208a7c63 SHA512 f4646f85f3e5ff25d299e544f8736390bafab63dbe44c38dfbd78bea3a047fd269dcad67e0beca088aab77464c3aadb5040af9606f57c91cc4e4b0f8e916dd55 WHIRLPOOL c214c9e8a9592b7d17a8942ef14f46fd936674dfcd95838b396176e02b74cbe1e3d295a8183ba76c53987c9f1d55d6b5f3de46df8fb9f6a9547dc934a9b048a9
+DIST wine-1.7.28-gstreamer-v4.patch.bz2 5447 SHA256 64dad250bde6b10d77e688b316217b1b508f3dfb8195a33f6420dc1dfb18ac8a SHA512 65e84d79da9898c3c0508c392182f148384abf8f007c0662c6468414eebb69dec918c6099a3fbff7ffa2dd4a942a1aa1d91dffba494ac37a6f572a7f0162ea0c WHIRLPOOL 0cc7cf63c0f9ed718e2219da01cc05fca0814b0ca98c916141ccb254da91f32ea03ec47c6e106d558d6ca10b3346a9cbd9a1c74ef66cb9983dddd1e50506c940
+DIST wine-1.7.28.tar.bz2 21811422 SHA256 67c3f157b9e720971d1f7dc582e9f0b16879ef660b5ba284a77f8bdfc6fc2313 SHA512 dffbfeb53d9503ec882941c9d01c4b795c6da6046a2eab5d1ccb4db68a07952cfdbb14600869981b050f45247548d459bd054a390af6baecb232dc0c075ec7ab WHIRLPOOL a55e2acc86435f7254220f05871487e7272318a79dbea00fbfe36faebb5ca70281561ece1c8b79db2e59aea070d2f2d7146d94490925f65c641c52d45c82cf2a
+DIST wine-1.7.29.tar.bz2 21823063 SHA256 ae48190d35533197811eeabed989ed9fd3201c44af917107f35ec0bf75b8de62 SHA512 ced6ced1bfdf1b847242399bf54a4a63d0f8a16f3dc1a11c6f2af1baf12d2daa679a5377fe284724b8487cb0573383694c68e363ff2b98230f79c873c4dbbba9 WHIRLPOOL 3db7234f4ba12ea483c0bb8336dcb8becf7bd73298b63700aa7fec61a4723b5bbb7b03b32bd0c8ab1c66b45f6e60bf4dbd30e0da325cf75dc698ca6b69df2993
+DIST wine-1.7.3.tar.bz2 21489049 SHA256 c66c93c2ffec8d1d9922fbaa226b169d62deb77fcbfd0fbd7379b77dbd97d47f SHA512 41109866b259a5f939c9ca4c26ed0a5ca74fa9cafa2f348b83510dd386459c87ac044a6f954f2f83ce00961d866a6e636ed96aa9e94584b7a79486d434b406cc WHIRLPOOL 90e6aed8930e3496701292415ce87f29a87870a1d00ad26d4f3c4adf33cd296093d0ef3d363bf5cead1ebd5ab4e86907ccb015c10d85f6f90d5f48cd81681b0f
+DIST wine-1.7.33.tar.bz2 21908969 SHA256 e3519d6fa2c0bb91e58da38f14f02607cf366a0154ff1effe528966106d49275 SHA512 a9bb47383b88e9c60edef7883c3ce25f5ad0895b67cdb4393c1c3f9b9ab7245e8d8318df193722a7b8c87ff57cd554df53a24c988566d1dce808b939ed731451 WHIRLPOOL 3747cc9df638e7cba5aaff8cb6bfa26e5588ba87e5bdc9d5e3202f30973bc2c06b0d65027f113066dce82d851c1591ce86421ce6e7d90944f5206d341f7ed51d
+DIST wine-1.7.34-gstreamer-v5.patch.bz2 5703 SHA256 c3bb6f669f46d9f2d7ba494a2264cee457349f559d4b0758db80e39eb22f2aee SHA512 e780394e8739a58593d264322c462bfe9040c1cabce93b84d24f09040026368efb4ac34a6a302beb6048d14b4ac835b87a0c515b52c1a0c143aa4e15691eb01b WHIRLPOOL 1befbb0fbd026d6e833c5d72341064dd6e12157e1b7df58e349b9985648bfbc63f70e9cab45b61155515ac65057968e30ba313e71e183b8027153c9392d89192
+DIST wine-1.7.34.tar.bz2 21956792 SHA256 4d5a3b25450fb232aa9d0d0dd859b7d50b8ffb6180f24aefb6eb4e400d32330b SHA512 55d8c42ecd146fb92c1d91737e9c6e51d6cc36682964bfc8ef73a4495edf884d84fddca173d297b7553823abbddaf4dbc115a5474419be0611f2723beab00b6c WHIRLPOOL 8842bc71632b04a736e51eb3a016395a5a72b1798d43d1a3343956854d4fa1d9b973498abca0a28717ae5c2fd947970066820d5606dfdedb67e3235ded3de2ce
+DIST wine-1.7.35.tar.bz2 22005666 SHA256 eb2ef652a302c366d3f6ee9315790f162b1c0913d442cb5a856d9f7d95e31cfb SHA512 52d8947b1cedeead1e9bc559aa234fcb2237db493bc0556a6832968bde495c70d6eb2e4ee81d698e6525982d5373d6421b072af97a6d6b05b05e28b4bf71c9b6 WHIRLPOOL 99f3d2c03c1c1a98913a1925105102ec3f4f8f408168c3c812077feb5e87fbef7f9ac4e672b43ebaa19fe3dd41bd9c376f3b97a152bc7d3924e70f3349d7fa61
+DIST wine-1.7.36.tar.bz2 22010371 SHA256 21aabf3ab2c6055ae66c77647b123c978094f0c135817ceeaeaeebc5d8efe3bd SHA512 c2d9687e1ab0a53ebff6973fdd83e4b54c397e2b51c172b7c58297776228a8bbb3d5321de27aac4b61f756575b60c6534d5e0a9bb4b830d429496b3e8b95b39f WHIRLPOOL 5042e6142839cda3b83fa20e8e418f0da9d57e347b96e241160372af5ef1415a5b7f961ec024cd5a186c93943985ea652fa50e6cbe4fcadade7100f4f5c16139
+DIST wine-1.7.37.tar.bz2 22034021 SHA256 6730ec79bc8d5f61ab90d9cb51daab26a57c1a79e2804e03731f060dea4af305 SHA512 235cdac2c037eaf95ec78634769534dcd10c844bbcd8b8b2f66d457a80779277d4c608d930a10e381a35d33bd30044de7242cd8ce148ecae62085e097e1bccc7 WHIRLPOOL 324dc54ec3a8d1fa661a617708a27435d6f366252deab483238f95f91be351dcfead31f7a3cfa118d66781565dc1a856bf9e10dfef99b915b4845dcd662a7d6d
+DIST wine-1.7.38.tar.bz2 22027786 SHA256 981ee93e7db6b2b8d1ee16999cdff915a9411b1566539edc56137f9cd4d36bc0 SHA512 36793b8b2fd678b9542ff2c32582234a175e9795682b93c0df881dc1adac65dff8d33509511fe7400d8b099880df8d6f13ecc18e0c8b72827d9ac009770ddc81 WHIRLPOOL 646a36cd4f50c3c81fafc95e11e5c8df68e7c14e7b582b6cd7f5f99d3f37afebd9655e8b0c28bb7995c957d87f96913ac13c2fc425075406e32cbf9a23440add
+DIST wine-1.7.39.tar.bz2 22122289 SHA256 6affb007fe772eb5588c584e3bdb62db96d8291c7fc8e75a5fd0bb098391335c SHA512 0eda88c4c092c2d596097548a341f62128dc39ffd6c88c514378639864dfbeedad3cb436065a85981cb2d9399a4cf439d1c301ec651a7e21eac886931218b6f5 WHIRLPOOL 9cb9d99d94e5abecbf5c6717165b58c7c23784aef0a4ffe2edaca2aef63e5706f17aa1102e00424fd849b30598f5d3b8206ea6b473c4337bb486211d7c3daf46
+DIST wine-1.7.4.tar.bz2 21500746 SHA256 517b3465dbf5b516d3fe886c0f9d4f310dc1d4a38ca4e5580c5d66bab3fb6969 SHA512 4267eb43311fe53537a1864a70e88e4bf444b8979dc858725a1170ed06af4e727604a22bafb3deb448eeb62c170ce67ce8eb8082bce040f5488b1a4c4bc6bb95 WHIRLPOOL 7bb14e0dfd4f9a7411e1d5484dba62f8584a0e03997cc3c6192893dccbc7de316eb79a1e5b0ccf96d20e74cf512ebc79e760076ff4882625bc81b410ad8be0bf
+DIST wine-1.7.40.tar.bz2 22183479 SHA256 0d82e639a553765437f9a3f864f383e8e4e1eb0f1dd815263f9fda1c78d5cab6 SHA512 3d812b8eefa14f3fea908345b9a8950e9a409e5e45b38d73105c181bfc3fa5f9ef82a022cffcc2efd45f79220ab9ff139b3729410b7708ed6ff960647761dd61 WHIRLPOOL c9935e5daf077b3bb66209fe572b494ca8250c16f76a13122f61899112559a010344ff9e2046a9132d904b0396e519291eba641ebc8add364dda85becfd5d14b
+DIST wine-1.7.41.tar.bz2 22237972 SHA256 6fa622b1dacb257fab671ddd689439daf6bb1cfb9e632c324db16a5db6372f97 SHA512 e5f040a07fdeea44a5a48630bfb70a81ce6cede462d40aaa55277481faa4176f1f0df290bf7afe7452a695b3457ebc43dde474feca74b48d041cb5bb0a5df85f WHIRLPOOL e8dff1a0543aab21802ce54e231c2be9c9e4aee0bf476db7615a519a7eab25c7f95da0fef4899cbd8c458366bd15ae340ebdd1025136dcc944cca4d1a2ba1e7b
+DIST wine-1.7.42.tar.bz2 22229770 SHA256 5a7f5c82b120bfe1eca572bd8d7a4ede7e6baf330ce3087199eb5cd175233ba2 SHA512 f290860614ad83f0fdf50d3b063f5edf8ea59449d30292ee837531b26a1b5ab871b2f70305c5a132d3727db7471ca67e2aa7356df8b35745bd38602b54a56781 WHIRLPOOL de7292e08201ed9bcab03da2490213abcaa39e44dcd156c19d154c3af9ce74f73ccf079fd2ca4578d0c91b046c21d24e38fe85f47135b6e4b311b8986975c241
+DIST wine-1.7.43.tar.bz2 22246396 SHA256 53d49b9affcb836443cf25111c2906dfcae9ff1fc8170dffbd81755405907822 SHA512 676f3eddff3004044e1ce8b1f9d3023e1a37f8e89db20724f71b18c789c856c7bb5cfc8ec4ea3f7b2ab215e19cd0073b51e14a93a748512b366d472f4da6fe01 WHIRLPOOL b000c218c45a86d995b06900691f2bce580658f8545600c734383032b47c980a1e0d3534ac4e72be786b4c00520e482e999059fbb8437cb704bb707f8d4aea7e
+DIST wine-1.7.44.tar.bz2 22308686 SHA256 d2e3290d4b312d235ab8ac214eaae8f81c751fb610b15b40c2620904bd38d8bb SHA512 55cc555a5f40fe802d6cca65c7bc3d294c10c79dee93e602c4ccefd540002174bc1a1ca8c5cb56311b94782f7b5af7002420c20110fd4c913f1d1bdb380dc82d WHIRLPOOL f9d6b2eb38b78a97c096408775ca36d7d010eb120f1ee59f5da8db93b19e91a4bdd74d337626ab9b81338ddcfc9d58441919975152b1dd1c2379a1a7154467cc
+DIST wine-1.7.45.tar.bz2 22312840 SHA256 a30cef1ee4ceaee4b6c9c2ad96df3b8a8847278246e7727624db314c68adaa23 SHA512 409e7c5b75e5311b02697b993b5d6a5cd08cf7e2e2b4feb295b8a5b88b4edf5034c3bd9feafd208892b05082970a198542e046d31ca3629edd6e505d4bbff45e WHIRLPOOL f662ae6370003f7f31e4be5397fa69b4847581770d2d5d72b6de0ac88617995fb0e3206957075bc7d247cc9f11ae5a29a8e82344fd1c22b480edfc307d25c48f
+DIST wine-1.7.46.tar.bz2 22356320 SHA256 9ab4046cc676de3054f9f2560e7d757b25324f72dd9a9cfed0d4aa48cc87350b SHA512 42710c39436fcd66d2a245da9d8242f3c909c58e0f0178a74562ae9d5360e8dc5908a336633edd8f717fb5c5ba07310fc24a2ec57cb447900ff8f57b59e5ec1d WHIRLPOOL 8ca9a25301559001176eb542defbfae279760a4e758b6563431900608ca4efa1ea01a2f3ea56039c4116052be58ee7c4a8ab6df773c3c6fdd65599e1ed376b60
+DIST wine-1.7.47.tar.bz2 22398577 SHA256 ba74f75aec400dc4b1d64ddc29560e4946837e73cb19d9c231604ff0147bbb2e SHA512 588bc143fc371c013b3565044ac14a22176c63fb79e7798a32cd75ec2dbf6b52a73529638254809aa3a4b3105067e96289b555436099c41622b8ffeb2b97a601 WHIRLPOOL 6545baa254f181fbe7a35b19e319faf7b21b838b91fddcab46ae65d8331407d62b36f78f20a19f97895c5c16059f18b3d23d6659658f8939611b171a408478ef
+DIST wine-1.7.8.tar.bz2 21463503 SHA256 30e17f5f863a09416f3d229666566b318dbb40f683d4ca6630012c60bb511804 SHA512 1fdaddb7909f818050854bf351d20f445cf6a5906b1bcc789c96ee8d5058c90815a91bbbc6444f3e4527748764f03ab5297585c174b433093a3354a827402fea WHIRLPOOL 3b5b18384ff04b80b936160c2c6e03676d69663c023f484981305c9272d0601b74cda5c5f7d56008b3900d702b1a4fe1929f16b1fba304a6480b076ffede663a
+DIST wine-1.7.9.tar.bz2 21323337 SHA256 79f99ecc24696915439c474c4953bb77652ab53f16b41daa4da270fe43279c5a SHA512 29f8aa715ebe47c8a06bd5f6a80cac3fb75b2ca7aa81648cc8aed5461cfd825e4da68b6209ca672dce42b968521cfd9bffffaadd2d85b904b55d99687a1c83d0 WHIRLPOOL 333fee72b2a0e9d6ab8a003712c38166bd27aaff384a2b940c089ecc846f7669c59efbeb5cdc2fc87a46d63b0d29d0335873bb7c22f05913bad430b81990241a
+DIST wine-gentoo-2013.06.24.tar.bz2 85442 SHA256 bfbf6b25e98f717320de2ede467e3628fbc749d936b8449f8477c9dc6f41e04b SHA512 b6819889314f6a6ea16c1332f4b177c43623116763969c31b23b61754cd304dd085f5d3eafbe847159331eb97dddd9b4c10699430129ea4a71da418c1fe175f0 WHIRLPOOL 227e0ac6569736d4ad5813cef49f775dae956f4fc9255de95753d5d3cba1bf6cf3db31d23d3702bb54d2e60c5a6f779b602f0efb2096e4c827c924565b273d00
+DIST wine-gentoo-2015.03.07.tar.bz2 85419 SHA256 f13f93dc49bbc33a294c4d511b6e01aec2d38bff77a1e44d07668291add1ab04 SHA512 bae1d2d5575d340d01f44008104f0e5ec0c4a4982995dec37d501594cd21d07a2b4ad4465c4273646d5bf6521996b4b82471097864be75342abe3e7d478a56bd WHIRLPOOL 0f254dd692e87a1f71dd19f6c1c8c59b8a91b994e75912a2e6e3ba5e875b85119fe497a331a95c2ce33bbf5f064143d23ee00275da92c494227de0807c9abb06
+DIST wine-mono-0.0.8.msi 46967296 SHA256 3dfc23bbc29015e4e538dab8b83cb825d3248a0e5cf3b3318503ee7331115402 SHA512 d3009f2301b0a006136e880025a736f24612faa7a954956896124ec7282d35b678f02658e8be12b1c02ee217e594a2c728a9258c36ccb346b186a4781951adbd WHIRLPOOL 1d4b2e88ebab1f603326a238cc908982c7e135a33340087e8645572838d2b6034764e9fe787bb890792dea4c0531d26f9a6a811a7c200edb99ab82f975179389
+DIST wine-mono-4.5.2.msi 52502528 SHA256 d9124edb41ba4418af10eba519dafb25ab4338c567d25ce0eb4ce1e1b4d7eaad SHA512 73c907f63b73836d5afd0753197358aaea43a74a47800f929ef0627112298256f1fa46d1b9ff297b117468d953cdeab21fb5962db13c5debbcb71004462df609 WHIRLPOOL 18d3544c6753c5a01917bfc1b694f31ce45213108527f13317ec0bb8b2d2339ce41800534967e067cd15cd186ef9e186a5d3252275e443dfa1a6ae3641d4d17c
+DIST wine-mono-4.5.4.msi 53706752 SHA256 20bced7fee01f25279edf07670c5033d25c2c9834a839e7a20410ce1c611d6f2 SHA512 307fab2ac50c4eaa5c3fb8446ceb2df0d95c0a9d7c1e6289ef1ec5cc660fa8fcb26025c9723ce2bc01afcaf7e9c4dd9939d1beba877f4f95f6f80d92d8187221 WHIRLPOOL ccd1fed03158dd309d2a1f88558e5ad0e2e43de5ba61ab82702132bd0cdf75db75dcc1a61b5cb2775fdf0ad51464f34d2b3629538b1737cbedb410b859ef092a
+DIST wine-mono-4.5.6.msi 53705216 SHA256 ac681f737f83742d786706529eb85f4bc8d6bdddd8dcdfa9e2e336b71973bc25 SHA512 4d8df04c1d0da09d1abe423dd271e5dd14a193d607fb54e214d2e340827f7c33829342d1580b6907d7cf466e70993d743c6e1ca9a026d4b6225dd7c1fc8b1386 WHIRLPOOL 9a68e502da0be6768e92d88f2ccace607300f3a331e0f9e1b6d60e9c6c2d4eb635b902f03e13aad73461dd5f0c2691c7b41958356ebb7f445e8def4282c675d3
+DIST wine-staging-1.7.18-1.tar.gz 874958 SHA256 127b1754928297883ab5423c0814c59afa8a60444603b5c3b74ae726e41442e6 SHA512 ac7e59914436cfd58fe1e5edc94956f8470bbf3f517f8e1017ca3d201b872aca6a277bb3074527b614db8123663cadf4d10faeeb048d011d7e81fdfe5c582819 WHIRLPOOL ac1913deddc127c55d90d9f7c5249f2866757fb86295bf61fed8641a39751dbfbf57d3c6234086f8cff9c5b1ec8c45effeef40f5973e9aa8550412134809938a
+DIST wine-staging-1.7.20.tar.gz 887293 SHA256 ac55daab4c6062e7c3f7eadd4ea632ddc01702c1abf859bc4928bb9691cc7d22 SHA512 2f5bd5b3bfe85c0dd0d611fc2512f5f4ecac11d639eb578a7319c01a426b8cf788031fd299ecb5b5ff2c0bb7fa72dcfb1541bb9c987913068843a5b712099fc1 WHIRLPOOL 9c19e8e371e121009bed38ffe0e8789e35a4b9629a39aace1b44b8f830bf1e30c0cbca1c3eae45960373bedde39a912b4e1178b7af942c92263c6e4f278148d0
+DIST wine-staging-1.7.21.tar.gz 883814 SHA256 d107eba41706adf039befe5a584e45225e7ebc502a11257227c378581ec22b96 SHA512 770ed2d46f5975de4a728314c3c38834c20f8c49bc5fa7eee36c870b9708404c157f6e1ac4b9ec9e5799ed3b14f825c0653d30a17d332f6b805c6255da0ddf28 WHIRLPOOL 898db4f1a3606e5645a7a1132e0b83264fa5d7c00f94a14fce067702ec3accb397db93fa0c0449df7962800c44e00825fa1cac55b76b5abe42670ad412d67e21
+DIST wine-staging-1.7.22.tar.gz 888759 SHA256 1aedbae07bb4b436eee680ef19633b99e2e34764803be717c5cf32f1a1e45c3c SHA512 75f1fe0de2c3d488cfd5c4365ab3b8cbbfdc88bda5edf89657c8c372e29b6240977db74a194f94c67748520eff35244be7da3b684c37571b2427a7ef36adf95f WHIRLPOOL 66a45a3e733c453beeefe829df235cde8ebb734abfd40662480eccc65a2134f469e4925b6f7ea8e7b24bee212f7f58783596745e4fe20b2afb6f4c67c80e910d
+DIST wine-staging-1.7.28.tar.gz 8388699 SHA256 2ce3f4329befb33fec80f856105ea9ada7ba3f4bdf6d07edca485d15b55fff34 SHA512 4100d1ba0f9c69108053e367fe603348e1e9da9863f16a027d2a7b576453c8f31e198019f82664ebc74771a8aa429c7a6c068e0ef191c6d00c4ad848533be77f WHIRLPOOL 62e71420c5ce2b42b6e12ba511fcd2e732d7a5df0353670ad3282b5b7b138781f87f697c9482baad604fe0c21f0bfc06e6988058698eef8051955ed0e962a8c4
+DIST wine-staging-1.7.29.tar.gz 8423703 SHA256 27fab2e3a16f1af4580328ec399bd383915cd8827855f7e77d69d8ddddee2ade SHA512 a923c8b46c50f013f2b5f87dc554a9cfeb77b60a8ee7822775f38922a2ef90b30967e2489c77a8f5cecc1771a5b19e81e43e17ca74ff904485e7ea13c115d1d2 WHIRLPOOL 32a0f1c7c7ce71354e2aae5c870caaf2b210f5bc2cfc4ac2ab0a1e14bc2ee913fad5c487cd3cca9cc5fe58482b7b3110bf59c8576b690c68ff5e31fb567b2d59
+DIST wine-staging-1.7.33.tar.gz 8759402 SHA256 30b7ecee549514ecd186689ae8eac15ed37507755025c8272d31e8fd4808b3f2 SHA512 b3b939c8d5af419a9305a16de93486f75197d28bc39be4ca0abdea3e194745bfb401ecf6e092f93c59f68255aa7f051ee847ad3c8521ce87ecbf91abccc900f6 WHIRLPOOL 657bc4d642e1c799c6e0b39ef627c8f6852ab8d511e86f96c54065d87fb144d25a97b1a2572e87a029084d568fda7bbdab7c2ba5255dc07f02691f46e9796960
+DIST wine-staging-1.7.34.tar.gz 8865976 SHA256 9e71b5d3ce0cd8c4c511c375bcdae74de33d96dbda1d1e70fc7eb8708ee018dc SHA512 8c6b269eec6890ac0e724553c7a537c91b2420dc7d2ee96ba6fba911ad959d6b17e71a4e690539f3024450f4a7801be516977b1d1351e5f22820fdd44c78b7b1 WHIRLPOOL 93d32676f7150184ecfd676310c666299c4fc5ee0b0c04d2020ab06f330c982f54fde38c0d8986e51a9515a349d36b4fbf9cb31fefb378671eee8f112eb69fd3
+DIST wine-staging-1.7.35.tar.gz 8896849 SHA256 f1663938c29ab20c493569a5eaba7711a0f0d47cf5e4b9988f97140de2599b16 SHA512 5bc3fa7dcd9a79c2b067ed4b4b1b02a047bb94b4fbfe6f35b8fbb857ed1cda53ea9de18873504025c535197ffd81b0819b422aa3c9ade57a255d01c6696f4e13 WHIRLPOOL 193c1c86abd62b7132ec5984db2ce8d297dae9a4e7ec6a8b99bbd9e2d101d3cc3e5a950ccb7eec30f60d10e1ecd4e3d0ea977e13648f427f0ffb9d09190d13eb
+DIST wine-staging-1.7.36.tar.gz 8966590 SHA256 1debec42e30fd5521498df7935f3eafd863921e353ed25e52c4e844c520bcc25 SHA512 8a059a510e2b60ded80e0cfc9da8aa2c57d3f5669d20e98b5010036f1d6f3522a7277ef83a2bd1b3777395309268f9f29e250e32b0abe85b1f5e80479b413a74 WHIRLPOOL f1622db4d1b6afab76296ae425fef7d26e47d683bf43ea848aae2e9579e91406c4cbbe02b32ebb8e55fbedc67fb5f8a5f8d897eedd3b57e2b05dafe181a87f7f
+DIST wine-staging-1.7.37.tar.gz 9001155 SHA256 db13e8d8f9319afefb73624a9c630b125613102eace9a1ef5e65e8113d65ff3f SHA512 598a98c3368a6a9879243253a6ec33fcbd687701c877b90d1490651a020424cef78bfea9957c83c120bb3cd1139da5008099c6e2fb92a9c3b4978608b957a9fd WHIRLPOOL d85e2b340f137783da661d7636acf4cb0e3f36878b9884450329935651bdd7f67ebc203696c43493170021fe7dd8ff7b5a5aa93883e227ac884ce39405cefd76
+DIST wine-staging-1.7.38.tar.gz 9047747 SHA256 b77fc0913c972c0cb2b3fcc3d7627a838ba05cb876396cab526f518564f2f936 SHA512 125937505308a974840d810beb9df10d57cf488b173836c5debf71a96cc11cd3dfee666960768db361edd3b280858f2e6db5eaa8d81f4b487b7c53a0f8fef13c WHIRLPOOL c5cb14dd7527752a0496e343d7b12a53c9df629c027d746e33ac3c25ad20bfebd22c40ceb31bd5e70d3ea2a9188efe076eceab30c3c3f2d519fb31164f189f5a
+DIST wine-staging-1.7.39.tar.gz 9096658 SHA256 b7b3ba39e2a8829a6fd6aef4b3701dd0009eebc85539ac946e31de6d7fe36649 SHA512 d14780c30303a17f575f22adeab5cc026c2f41520d47dbb7ec70b939252eae656070eb8532cf1a42cca2b1c9c589a44081d12b2647b0d97c3c90b896a7433d23 WHIRLPOOL 8d71a49c3172261e83193ccfe85dfbd94421ee20063f4127ecb328450916cddbea742c59c09c34e10035d9f2fa0df0ebd0d68bbc6e90b92c1aa1a1071a26b055
+DIST wine-staging-1.7.40.tar.gz 9129843 SHA256 d2cafa5e847e1aecb82bb1dd42ea7729f749176c3ddc549c6b422c8ba74b89d5 SHA512 7688f9e2178335b8c1606673921368faa1532c766bf2a60c9be1d9640719acf024122270084afc892195878bfcadb6aea6cbf971a6bb2112260b3840d94ab994 WHIRLPOOL b58e5dcdbbb1632ed8d8bf98c34396c0a8e1d108d557d130ab9aceaa9efd9b9002eef38c7829196eae0736c1002a1e1c723bcdcf0a819e48a1394e615c997262
+DIST wine-staging-1.7.41.tar.gz 9136024 SHA256 c34f773003e25195fd761bbaff517f31deaebb8d46fc94de14b9581728138174 SHA512 89d867b6c869221f441b7bd5cb473f4179c2fa5453ac86df8801838dc5eca64fd2d33c38a73b74972cc2fd97c1f762c1fd60f2857074c71942687cd027e08bdb WHIRLPOOL 91a17eb37ae65ca41e397935994b22b45e4d2eac3b3bbf3cffcfc400084fa83e43ee5e29248a028363430251b1485b499ae37fe2e0668df971d8eb77aa495257
+DIST wine-staging-1.7.42.tar.gz 9146373 SHA256 71dc4b0063446347769234075e7b76e5214a54eccee445a72cb7467bd0a85b3d SHA512 9d8a468e4eb74ec45ca2554d4d6c38e32e8bfdfcb768e4bbe484204fb884bd8194ffadc2fc4dcfa561492e5605667a6aac24704fbff17e2adbf9407dcbc7e3a9 WHIRLPOOL 3560c07b95b8555d81425fa42e689a0040cf62a1a17ec6c2d081c4d4b8acf53176c7041be0db94b438b91b3a20d4994ea127c66e287a75286b0d436cc6466d54
+DIST wine-staging-1.7.43.tar.gz 9181556 SHA256 bed2db992bf7926e8f2cf45c4cbfe37a15e13a10639cd69be290b658f5e5b9f5 SHA512 b2e0ae99acdc77717a00ba1c25274c0d0cc4ff6cfc3d794ed691c9ab5fa320c15f0e3bd793dfee3e9c86985e676608c7a6916eb4c47c94eae907e6c498fe80c8 WHIRLPOOL e010e9c59e7553219f2866884c37014fbb76556fe808aca9d00dcbdb8c0cb111ffccb07bd323ece84261e5cd50e32dedcba9ca4ae3c1d692e64e232e6d561829
+DIST wine-staging-1.7.44.tar.gz 9194166 SHA256 ae2db1fe506c936f9e3c5664584126d58db8305c47b8155c636b8a8843a0ae20 SHA512 e01ff7d458a3162ad19577d127660bcf953c048201a2f98aa23fc5bf19e232af3e155e64e2d0fac33fdf01a9508be6e45a663e4151ee5b50b6ea2ce56a1e0beb WHIRLPOOL 915426aab0142a4142938a119339541f7a72d6a3e1c7fbd46c0dc9ad7178a56951e5a996f4b13f50bf7581a13607d15e3ae9796cd39974e069928c358400cc3f
+DIST wine-staging-1.7.45.tar.gz 9216075 SHA256 06180e1189e8669892e8b3d640810306b0310c508842272eccc65034534e9411 SHA512 051f10237306cac13dcfba0ee3453facbadf821a2eb5751d507bfcf86a936a08a236e1787d025378e3039e0fe91958bbb64b1fa90f5ea1a1b53d1d53788a5eb2 WHIRLPOOL 0277059d933cad1ae3449ec4028e7935f5a73c2790629ed0d0d6321bac0804caeaed282eef9fa1282ab85454123781c8cf2061e0220478685fc76405f3876757
+DIST wine-staging-1.7.46.tar.gz 9204220 SHA256 a3b681f38917889bc6dce3ea3e78e91da75789f212b69fd1a10a5bac329761d3 SHA512 24861e1adf882465c3f9f6e0aee47776dd18418342eff500007d36eacfadc166bdea40a53318c7fce3871742559904a1d757ea9a9c0f0624da678a3e9ea2d400 WHIRLPOOL d091925e99dc830ff1a6e49ec9c6f7cd1fc7e40920be2e4a5a10c4b7bc3a5b2109487eb32c5426f31b22baf53216b9b7caeb1b4faf6be8c2b5ecc8233d4ae198
+DIST wine-staging-1.7.47.tar.gz 9166592 SHA256 75aef17c68d1e54b922529832edadca5951e6a37637aad696cfe5abb93d9ca15 SHA512 b3feb61040a727b50fc3efb08441a800b08b4f7d61a00fc68175a6187486a701cc4737f9543119c32ed0c5f141d73ace396114337082cf7978a3437f4217844a WHIRLPOOL 69bead0fa0748dab8d0480d20052b3a75798d42bc32d55b9b254fba7774dddda48642c4e2f116f2c3d813f97e0827232945b3adaad22a827a43be8de12698bbc
+DIST wine_gecko-2.21-x86.msi 20871680 SHA256 f01fafa6d7aab995c38add77315c4cbc2f32f52d5d6a9350056f42b62d631fd8 SHA512 f4ca9ca5b876dc39e906991e58c6da8ef4103782f83ba781ff27556c0ebdab7fe10c14f0551e900442a5d57a2c619da6e5ed6ed42323edcdd55ce9789c4c83ac WHIRLPOOL d1db97175b047652499c97c968b71c08c5b44774423f22ae626f89b4dde3d03b46295e5caae228f1f8614209e943e8246854b478eef3abb186e8de4c341b0a0d
+DIST wine_gecko-2.21-x86_64.msi 21646336 SHA256 bc370bdc899f66d98f31c4d410a6952aa82c0c9c0a0ec27f2a11243c9b412c3f SHA512 2a48a7697beba4e45816a9eff09e181de353d8c93e02a70108fa77d27136cd5cd75b21c42caa7702a09f86544669ae2bbfc6975b1fc0d7fcb20150a4bc4ea514 WHIRLPOOL 2fce9b9a190a52c173551d47428dd8b8dc54d5878682733e0006a3f06f216cd9f47a88ada49f92fa5697ece8b2942a88f937bd2722b4cb85d2c35c19bda29b85
+DIST wine_gecko-2.24-x86.msi 22373888 SHA256 6e38acae87ea66e2c1e8f2f0afe88f89eed3e6e0b431cd3da38dea814b71202c SHA512 f158d28ca09bc900a2680892e7ac10770e06050a9251e1ec3a953fee0bf9b1c326e166f92fb88a4648297b6587c91a5ef5af35f267bb2ba5f679da4c8fdb6898 WHIRLPOOL bbe7a2572d89dc5e0347ba11b2014bac79fc4427d7551655313a46b147a79c1607b7f46596877c459ddaa0e202337fb3d217429ddd6a4df49ee33b373a788487
+DIST wine_gecko-2.24-x86_64.msi 23608320 SHA256 47557da68bcb2aedaebb93af73275aac96ba23e896bd98f25f2acbfd216d9cc8 SHA512 45ce0dcf42c3e2fe2198092812242e3467b19db4a4946e0b1a2d6327fd48aa936fb85cc1930bace6eaba0c61bff3a6536767ba0a91a0f085f307d1bddd171f0c WHIRLPOOL b6ba7c784d3a79d7afc11f0e12f0372b52b9f194eedfd083abed36a461e7301d2dd936be3be12619364f6ac5aae9cfbfb7fc47141bff92b62826f209365210ec
+DIST wine_gecko-2.34-x86.msi 28269568 SHA256 956c26bf302b1864f4d7cb6caee4fc83d4c1281157731761af6395b876e29ca7 SHA512 abc5a4ef496ee407579cd2f284cbcb03306a08cbf3cc4952f3339286aefb36737d2d641d8e72b10a02a4d71478964e676812452c12ff7cb6aaeaf5210408c358 WHIRLPOOL ef72209b4c63fc81f787644046c5fd168b8a5a4e7e5c8652eb7a78ce3b433d888512bdd5aab6ea07248c9c148175006666cd7a800bcfb2b3a73de3f50d1fab76
+DIST wine_gecko-2.34-x86_64.msi 29802496 SHA256 0f2c1b24c4cd1b3fa3fb3fe31dcd9ee162446b1f3370c0a18c8cb03a0c1a1070 SHA512 6bc69e1c8612533b3f37c16782833bca0e3aaa8ae872fe9f347ee081575c55c03866d6c71a5fb767bf4c3b012ae72f7d9c384d6d25c2584bf349126521e8f463 WHIRLPOOL a03df2c16088cf573c9273a59ba6998455917a49e0bf84028136d0ecff65a91f20edbecec55455b742682dcee5f5e618b8f2e8c15c71625642cd8b67a7774bd0
+DIST wine_gecko-2.36-x86.msi 29718016 SHA256 afa457ce8f9885225b6e549dd6f154713ce15bf063c23e38c1327d2f869e128a SHA512 6099240fb76368ed9bb6b775d5972b6124972ace92ccfe1051caeb8884d9e12d40c35220419f0d02443584bf2d82799dfca8206410d171470ce15903703924f0 WHIRLPOOL 4b8fc20a8b228268f3407ca425427a2d91f81ff9e6f0860d4f3eb156c97e3ec1ea83ca3510ee10bfb37598f91c3323a46ba75eace3334632b26cbd45959dc908
+DIST wine_gecko-2.36-x86_64.msi 31222784 SHA256 701b84004bf584a2dae7c1296121172c933321cb795c3817b64435fd3364ed44 SHA512 814b13268beeac4d0ace4ab62dbc29ccd92fc13a135499b8ea5a14355992d576268e1e401b28906e8379a826159c5bb051ad274a1e64dd0d5424d495f8e10e10 WHIRLPOOL dbd0e275bdca2ff7a1930daa62d23fd438a90f71b0fed1096b34b8d00a3f51cb91468ce61acaa9361a57deb9f3cfe70a21d16fc23de95cb4e0f7f957d4727010
+DIST winepulse-patches-1.7.10.tar.bz2 49205 SHA256 7330b4552b572244bbe99c16005d725eaf382995c986add170474381b90df468 SHA512 ef3a5477bc5803bfba609dc3299a7c07833958628d1aff01d100da57c0d270344ee326649206708c50c2a12b025f987a4e0f1dee9126e52e2778b256c45ba567 WHIRLPOOL b40088d8665f3cc57b4936774ac6dc2e6b005d75aa7c7385248ce35e5cf6e168ae212771f771b68dbf91fc5034b7ba54f907e93283cc2eddaa18e825d9b734a9
+DIST winepulse-patches-1.7.12.tar.bz2 49171 SHA256 6c5b3f46ea1c4615c49ee0f6f65936cf650cce6640f0feb4236c707064a9d392 SHA512 ec41f6024d6e2325f14f8caa15bbe38c8dca6c69beb5343063365f58dd8b7edbbc4d24ad176de72cf0e37acae03eb9769b68fcbd40a672680e06156f4a59b12c WHIRLPOOL de8a33ee784606e76a60166e3e29a1fb748ce4b3af1db136558888bd09bb0a044e4a1a9a61ce3de59d55f93c98575ac8d77c3ff17de4d69cda3b8fbd8f6c33c5
+DIST winepulse-patches-1.7.20.tar.bz2 52583 SHA256 95d0febb72baa73d5faeb82de774b49eaa9e38aa74448ea313c62f6eb1f4faf3 SHA512 9d7108fd2076d9a19dff5e72a25aa57f0946e6d17cfcc07422cce3fca34dfe04521d09cbfe611701781e10ad1f0d00562cba974214a4d189b16f6ded96ef61bf WHIRLPOOL 815d1cbf43b64a7a1a3aae965c6521ee3c6147458913f13236ccec7848340663d8372280f53eed381f3f68969bb06b272c30c605c290e31a678fc8d01575a766
+DIST winepulse-patches-1.7.21.tar.bz2 52679 SHA256 38daf95ea99cf831c56634e1dd4a4ea5fa4c11f570dfbddff06ceb7cd05e7303 SHA512 8feb729461a0e9791eeae11bd354407bdb389aefd1d30454781cd56072deeb507dccf5a825e580194d1a26c2c83b631d38967011c5360c46340dc3ceb7c0096d WHIRLPOOL e5cd496a7a66036825cff73dcdb76d787948b05d604b26042b024f7c9e991f4ea61efbd41a53fe667bd023e04cd5763f806166ab3aa9de757105ee3fbe6f65e8
+DIST winepulse-patches-1.7.3.tar.bz2 49163 SHA256 893dc6251984f6a7306dc8064c50a6a605921094f84feb436c23be3b9e5d077a SHA512 f04b33479c92ce31df74ea49b8582cee2f9d7a4cdf132f212f021da89b19dda8e5a4b0daaec81533b100ef0af023157cf43581ab75fa263da3c1a5d712ec3e9d WHIRLPOOL ae2a599d7bdb49ce77cc56844ff74c7fd62b1f1164e9f7fdec499244fd609799c0fd7421d29ffda7e9fb599962f75c2ebe44ce72e0f0a80677e140f759ab22f9
+DIST winepulse-patches-1.7.4.tar.bz2 49182 SHA256 26cc1ab6d91c45b4d83f07bbd7f43c9824470700a58325f0a1bfc1b76bfe419f SHA512 55095dcd3ebd1560316382ee5f625203589ba8ac2437f7993bee0edf61004d3c0cdba0aabc2e9aed3d195d8eda4088241766dde4c44564e81ea99cc47404cdff WHIRLPOOL 978f3bcc3cc14098b604cd737d9fa6911a5c3b76773a060586ba183a055cdc25e3b436c262c813094c7c2158ae607bcb3020738da16bbe2c48c595728755f98c
+DIST winepulse-patches-1.7.8.tar.bz2 49140 SHA256 0fd31ea7fec8817561a7b304bbfad6bdd014eb566b0c533e15773064bca555ad SHA512 18c88d4da37714d0216c01929eb92c99161fdf7024d8516512fc2585bc8d5a700fb1b5eb9fb667149e104305f366c867973f41b688a04f63e7cce76f5d85389a WHIRLPOOL 60dfeeb1d51c9ea7730ff1e9263d44fbcf3509e6ae68df1e3d30d965999f19525979f64617494bb1c3e1712c7117f30bebfbcbc75b1b08ba1f1e033720b0cacc
diff --git a/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch b/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch
new file mode 100644
index 000000000000..be6ffc56d7cc
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch
@@ -0,0 +1,40 @@
+https://bugs.gentoo.org/show_bug.cgi?id=395615
+
+Explicitly add the required -m32/m64 to *FLAGS; this overrides any
+arch-specific -m* flags that may have been appended by multilib-portage.
+
+Even though -m32/m64 is now added to *FLAGS, -m32/m64 still has to be
+explicitly added to CC and CXX due to wine's build system. For example,
+winegcc saves the build-time value of CC and uses it at runtime.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -133,12 +133,18 @@
+ then
+ CC="$CC -m64"
+ CXX="$CXX -m64"
++ CFLAGS="$CFLAGS -m64"
++ LDFLAGS="$LDFLAGS -m64"
++ CXXFLAGS="$CXXFLAGS -m64"
+ host_cpu="x86_64"
+ notice_platform="64-bit "
+ AC_SUBST(TARGETFLAGS,"-m64")
+ else
+ CC="$CC -m32"
+ CXX="$CXX -m32"
++ CFLAGS="$CFLAGS -m32"
++ LDFLAGS="$LDFLAGS -m32"
++ CXXFLAGS="$CXXFLAGS -m32"
+ host_cpu="i386"
+ notice_platform="32-bit "
+ AC_SUBST(TARGETFLAGS,"-m32")
+@@ -150,6 +156,9 @@
+ then
+ CC="$CC -m32"
+ CXX="$CXX -m32"
++ CFLAGS="$CFLAGS -m32"
++ LDFLAGS="$LDFLAGS -m32"
++ CXXFLAGS="$CXXFLAGS -m32"
+ AC_MSG_CHECKING([whether $CC works])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()],AC_MSG_RESULT([yes]),
+ [AC_MSG_RESULT([no])
diff --git a/app-emulation/wine/files/wine-1.5.17-osmesa-check.patch b/app-emulation/wine/files/wine-1.5.17-osmesa-check.patch
new file mode 100644
index 000000000000..823619271315
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.5.17-osmesa-check.patch
@@ -0,0 +1,38 @@
+From 1ede664b18bd8a88359a3cebb291ad49833ee033 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Tue, 7 Aug 2012 01:29:01 -0400
+Subject: [PATCH] Do not check for libGL symbols when checking libOSMesa
+
+If mesa had been built with shared glapi, glAccum is not available in
+libOSMesa without explicitly linking to libGL. In addition, in
+mesa-8.0.x and earlier, libOSMesa needs to be explicitly linked to
+libglapi if mesa was built with shared glapi, see
+https://bugs.gentoo.org/show_bug.cgi?id=399813
+And in mesa-8.1.x, libOSMesa in addition needs libdl, libpthread, and
+libstdc++, see https://bugs.gentoo.org/show_bug.cgi?id=431832
+---
+ configure.ac | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index cc32c24..275b792 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1128,7 +1128,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
+
+ if test "x$with_osmesa" != "xno"
+ then
+- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[$X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ if test "x$ac_cv_lib_soname_OSMesa" = "x"; then
++ osmesa_save_CC=$CC
++ CC=$CXX
++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[-lglapi -lpthread -ldl $X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ CC=$osmesa_save_CC
++ fi
+ WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"],
+ [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.])
+ fi
+--
+1.8.0
+
diff --git a/app-emulation/wine/files/wine-1.5.26-winegcc.patch b/app-emulation/wine/files/wine-1.5.26-winegcc.patch
new file mode 100644
index 000000000000..2045e343401b
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.5.26-winegcc.patch
@@ -0,0 +1,59 @@
+http://bugs.gentoo.org/260726
+
+diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
+index 16b4165..5c77267 100644
+--- a/tools/winebuild/main.c
++++ b/tools/winebuild/main.c
+@@ -48,10 +48,13 @@ int link_ext_symbols = 0;
+ int force_pointer_size = 0;
+ int unwind_tables = 0;
+
++#undef FORCE_POINTER_SIZE
+ #ifdef __i386__
+ enum target_cpu target_cpu = CPU_x86;
++#define FORCE_POINTER_SIZE
+ #elif defined(__x86_64__)
+ enum target_cpu target_cpu = CPU_x86_64;
++#define FORCE_POINTER_SIZE
+ #elif defined(__powerpc__)
+ enum target_cpu target_cpu = CPU_POWERPC;
+ #elif defined(__arm__)
+@@ -611,6 +614,10 @@ int main(int argc, char **argv)
+ signal( SIGTERM, exit_on_signal );
+ signal( SIGINT, exit_on_signal );
+
++#ifdef FORCE_POINTER_SIZE
++ force_pointer_size = sizeof(size_t);
++#endif
++
+ output_file = stdout;
+ argv = parse_options( argc, argv, spec );
+
+diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
+index 06aa200..c44d2e3 100644
+--- a/tools/winegcc/winegcc.c
++++ b/tools/winegcc/winegcc.c
+@@ -213,10 +213,13 @@ struct options
+ strarray* files;
+ };
+
++#undef FORCE_POINTER_SIZE
+ #ifdef __i386__
+ static const enum target_cpu build_cpu = CPU_x86;
++#define FORCE_POINTER_SIZE
+ #elif defined(__x86_64__)
+ static const enum target_cpu build_cpu = CPU_x86_64;
++#define FORCE_POINTER_SIZE
+ #elif defined(__powerpc__)
+ static const enum target_cpu build_cpu = CPU_POWERPC;
+ #elif defined(__arm__)
+@@ -1258,6 +1261,9 @@ int main(int argc, char **argv)
+ opts.linker_args = strarray_alloc();
+ opts.compiler_args = strarray_alloc();
+ opts.winebuild_args = strarray_alloc();
++#ifdef FORCE_POINTER_SIZE
++ opts.force_pointer_size = sizeof(size_t);
++#endif
+
+ /* determine the processor type */
+ if (strendswith(argv[0], "winecpp")) opts.processor = proc_cpp;
diff --git a/app-emulation/wine/files/wine-1.6-memset-O3.patch b/app-emulation/wine/files/wine-1.6-memset-O3.patch
new file mode 100644
index 000000000000..75372f869141
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.6-memset-O3.patch
@@ -0,0 +1,21 @@
+Avoid "undefined reference to `memset'" error when building with
+USE=custom-cflags and -O3 in CFLAGS with gcc-4.8.
+
+See:
+
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888
+http://bugs.winehq.org/show_bug.cgi?id=33521
+https://bugs.gentoo.org/show_bug.cgi?id=480508
+
+diff --git a/configure.ac b/configure.ac
+index d8033cf..fe7cc7d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1767,6 +1767,7 @@ then
+
+ dnl Check for some compiler flags
+ WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
++ WINE_TRY_CFLAGS([-fno-tree-loop-distribute-patterns])
+ WINE_TRY_CFLAGS([-fno-strict-aliasing])
+ dnl clang needs to be told to fail on unknown options
+ saved_CFLAGS=$CFLAGS
diff --git a/app-emulation/wine/files/wine-1.7.0-freetype-header-location.patch b/app-emulation/wine/files/wine-1.7.0-freetype-header-location.patch
new file mode 100644
index 000000000000..aba4b89860ea
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.0-freetype-header-location.patch
@@ -0,0 +1,351 @@
+From 67f9b6e3c5d2397446d39ab454f691c1ee46d2c0 Mon Sep 17 00:00:00 2001
+From: Alexandre Julliard <julliard@winehq.org>
+Date: Sat, 30 Nov 2013 11:22:25 +0100
+Subject: [PATCH] configure: Update FreeType configure checks for the changed
+ headers location.
+
+---
+ configure | 78 +++++++++++++++------------------------------------
+ configure.ac | 40 +++++++-------------------
+ dlls/gdi32/freetype.c | 62 ++++++++++++++--------------------------
+ include/config.h.in | 33 ----------------------
+ 4 files changed, 54 insertions(+), 159 deletions(-)
+
+diff --git a/configure b/configure
+index 80348f3..9b2f2c2 100755
+--- a/configure
++++ b/configure
+@@ -11419,7 +11419,21 @@ test "$cross_compiling" = yes || FREETYPE_LIBS=${FREETYPE_LIBS:-`(freetype-confi
+ FREETYPE_LIBS=${FREETYPE_LIBS:-"-lfreetype"}
+ ac_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lfreetype" >&5
++for ac_header in ft2build.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default"
++if test "x$ac_cv_header_ft2build_h" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_FT2BUILD_H 1
++_ACEOF
++
++fi
++
++done
++
++ if test "$ac_cv_header_ft2build_h" = "yes"
++ then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lfreetype" >&5
+ $as_echo_n "checking for -lfreetype... " >&6; }
+ if ${ac_cv_lib_soname_freetype+:} false; then :
+ $as_echo_n "(cached) " >&6
+@@ -11461,7 +11475,7 @@ fi
+ if test "x$ac_cv_lib_soname_freetype" = "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+ $as_echo "not found" >&6; }
+- ft_lib=no
++ FREETYPE_LIBS=""
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_freetype" >&5
+ $as_echo "$ac_cv_lib_soname_freetype" >&6; }
+@@ -11470,51 +11484,11 @@ cat >>confdefs.h <<_ACEOF
+ #define SONAME_LIBFREETYPE "$ac_cv_lib_soname_freetype"
+ _ACEOF
+
+- ft_lib=yes
+-fi
+- if test "$ft_lib" = "yes"
+- then
+- for ac_header in ft2build.h \
+- freetype/freetype.h \
+- freetype/ftglyph.h \
+- freetype/fttypes.h \
+- freetype/tttables.h \
+- freetype/ftsnames.h \
+- freetype/ttnameid.h \
+- freetype/ftoutln.h \
+- freetype/ftwinfnt.h \
+- freetype/ftmodapi.h \
+- freetype/ftlcdfil.h
+-do :
+- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_FT2BUILD_H
+-# include <ft2build.h>
+-#endif
+-"
+-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+- cat >>confdefs.h <<_ACEOF
+-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+-_ACEOF
+-
+-fi
+-
+-done
+-
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h. */
+-#include <ft2build.h>
+-#include <freetype/fttrigon.h>
+-_ACEOF
+-if ac_fn_c_try_cpp "$LINENO"; then :
+
+-$as_echo "#define HAVE_FREETYPE_FTTRIGON_H 1" >>confdefs.h
++$as_echo "#define HAVE_FREETYPE 1" >>confdefs.h
+
+- wine_cv_fttrigon=yes
+-else
+- wine_cv_fttrigon=no
+-fi
+-rm -f conftest.err conftest.i conftest.$ac_ext
+- ac_fn_c_check_type "$LINENO" "FT_TrueTypeEngineType" "ac_cv_type_FT_TrueTypeEngineType" "#include <freetype/ftmodapi.h>
++ ac_fn_c_check_type "$LINENO" "FT_TrueTypeEngineType" "ac_cv_type_FT_TrueTypeEngineType" "#include <ft2build.h>
++#include FT_MODULE_H
+ "
+ if test "x$ac_cv_type_FT_TrueTypeEngineType" = xyes; then :
+
+@@ -11525,15 +11499,9 @@ _ACEOF
+
+ fi
+
+- if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
+- then
+-
+-$as_echo "#define HAVE_FREETYPE 1" >>confdefs.h
+-
+- else
+- FREETYPE_LIBS=""
+- fi
++fi
+ else
++ FREETYPE_CFLAGS=""
+ FREETYPE_LIBS=""
+ fi
+ CPPFLAGS=$ac_save_CPPFLAGS
+@@ -11541,14 +11509,14 @@ test -z "$FREETYPE_CFLAGS" || FREETYPE_CFLAGS=`echo " $FREETYPE_CFLAGS" | sed 's
+ test -z "$FREETYPE_LIBS" || FREETYPE_LIBS=`echo " $FREETYPE_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'`
+
+ fi
+-if test "x$ac_cv_header_freetype_freetype_h" != xyes -o "x$wine_cv_fttrigon" != xyes; then :
++if test "x$ac_cv_lib_soname_freetype" = x; then :
+ case "x$with_freetype" in
+ xno) ;;
+ *) as_fn_error $? "FreeType ${notice_platform}development files not found. Fonts will not be built.
+ Use the --without-freetype option if you really want this." "$LINENO" 5 ;;
+ esac
+ fi
+-test "x$ac_cv_header_freetype_freetype_h" = xyes -a "x$wine_cv_fttrigon" = xyes || enable_fonts=${enable_fonts:-no}
++test "x$ac_cv_lib_soname_freetype" = x && enable_fonts=${enable_fonts:-no}
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for parport header/ppdev.h" >&5
+ $as_echo_n "checking for parport header/ppdev.h... " >&6; }
+diff --git a/configure.ac b/configure.ac
+index 81b7027..c4021b4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1463,42 +1463,22 @@ then
+ WINE_PACKAGE_FLAGS(FREETYPE,[freetype2],[-lfreetype],
+ [`(freetype-config --cflags || freetype2-config --cflags) 2>/dev/null`],
+ [`(freetype-config --libs || freetype2-config --libs) 2>/dev/null`],
+- [WINE_CHECK_SONAME(freetype,FT_Init_FreeType,[ft_lib=yes],[ft_lib=no],[$FREETYPE_LIBS])
+- if test "$ft_lib" = "yes"
++ [AC_CHECK_HEADERS([ft2build.h])
++ if test "$ac_cv_header_ft2build_h" = "yes"
+ then
+- AC_CHECK_HEADERS(ft2build.h \
+- freetype/freetype.h \
+- freetype/ftglyph.h \
+- freetype/fttypes.h \
+- freetype/tttables.h \
+- freetype/ftsnames.h \
+- freetype/ttnameid.h \
+- freetype/ftoutln.h \
+- freetype/ftwinfnt.h \
+- freetype/ftmodapi.h \
+- freetype/ftlcdfil.h,,,
+- [#ifdef HAVE_FT2BUILD_H
+-# include <ft2build.h>
+-#endif])
+- AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <ft2build.h>
+-#include <freetype/fttrigon.h>]])],[AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
+- [Define if you have the <freetype/fttrigon.h> header file.])
+- wine_cv_fttrigon=yes],[wine_cv_fttrigon=no])
+- AC_CHECK_TYPES(FT_TrueTypeEngineType,,,[#include <freetype/ftmodapi.h>])
+- dnl Check that we have at least freetype/freetype.h
+- if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
+- then
+- AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
+- else
+- FREETYPE_LIBS=""
+- fi
++ WINE_CHECK_SONAME(freetype,FT_Init_FreeType,
++ [AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
++ AC_CHECK_TYPES(FT_TrueTypeEngineType,,,[#include <ft2build.h>
++#include FT_MODULE_H])],
++ [FREETYPE_LIBS=""],[$FREETYPE_LIBS])
+ else
++ FREETYPE_CFLAGS=""
+ FREETYPE_LIBS=""
+ fi])
+ fi
+-WINE_ERROR_WITH(freetype,[test "x$ac_cv_header_freetype_freetype_h" != xyes -o "x$wine_cv_fttrigon" != xyes],
++WINE_ERROR_WITH(freetype,[test "x$ac_cv_lib_soname_freetype" = x],
+ [FreeType ${notice_platform}development files not found. Fonts will not be built.])
+-test "x$ac_cv_header_freetype_freetype_h" = xyes -a "x$wine_cv_fttrigon" = xyes || enable_fonts=${enable_fonts:-no}
++test "x$ac_cv_lib_soname_freetype" = x && enable_fonts=${enable_fonts:-no}
+
+ dnl **** Check for parport (currently Linux only) ****
+ AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
+diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
+index fb4f2af..e230299 100644
+--- a/dlls/gdi32/freetype.c
++++ b/dlls/gdi32/freetype.c
+@@ -77,6 +77,23 @@
+ #undef SetRectRgn
+ #endif /* HAVE_CARBON_CARBON_H */
+
++#ifdef HAVE_FT2BUILD_H
++#include <ft2build.h>
++#include FT_FREETYPE_H
++#include FT_GLYPH_H
++#include FT_TYPES_H
++#include FT_TRUETYPE_TABLES_H
++#include FT_SFNT_NAMES_H
++#include FT_TRUETYPE_IDS_H
++#include FT_OUTLINE_H
++#include FT_TRIGONOMETRY_H
++#include FT_MODULE_H
++#include FT_WINFONTS_H
++#ifdef FT_LCD_FILTER_H
++#include FT_LCD_FILTER_H
++#endif
++#endif /* HAVE_FT2BUILD_H */
++
+ #include "windef.h"
+ #include "winbase.h"
+ #include "winternl.h"
+@@ -95,43 +112,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(font);
+
+ #ifdef HAVE_FREETYPE
+
+-#ifdef HAVE_FT2BUILD_H
+-#include <ft2build.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FREETYPE_H
+-#include <freetype/freetype.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FTGLYPH_H
+-#include <freetype/ftglyph.h>
+-#endif
+-#ifdef HAVE_FREETYPE_TTTABLES_H
+-#include <freetype/tttables.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FTTYPES_H
+-#include <freetype/fttypes.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FTSNAMES_H
+-#include <freetype/ftsnames.h>
+-#endif
+-#ifdef HAVE_FREETYPE_TTNAMEID_H
+-#include <freetype/ttnameid.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FTOUTLN_H
+-#include <freetype/ftoutln.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FTTRIGON_H
+-#include <freetype/fttrigon.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FTWINFNT_H
+-#include <freetype/ftwinfnt.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FTMODAPI_H
+-#include <freetype/ftmodapi.h>
+-#endif
+-#ifdef HAVE_FREETYPE_FTLCDFIL_H
+-#include <freetype/ftlcdfil.h>
+-#endif
+-
+ #ifndef HAVE_FT_TRUETYPEENGINETYPE
+ typedef enum
+ {
+@@ -186,7 +166,7 @@ MAKE_FUNCPTR(FT_Vector_Transform);
+ MAKE_FUNCPTR(FT_Vector_Unit);
+ static FT_Error (*pFT_Outline_Embolden)(FT_Outline *, FT_Pos);
+ static FT_TrueTypeEngineType (*pFT_Get_TrueType_Engine_Type)(FT_Library);
+-#ifdef HAVE_FREETYPE_FTLCDFIL_H
++#ifdef FT_LCD_FILTER_H
+ static FT_Error (*pFT_Library_SetLcdFilter)(FT_Library, FT_LcdFilter);
+ #endif
+
+@@ -924,7 +904,7 @@ static BOOL is_hinting_enabled(void)
+
+ static BOOL is_subpixel_rendering_enabled( void )
+ {
+-#ifdef HAVE_FREETYPE_FTLCDFIL_H
++#ifdef FT_LCD_FILTER_H
+ static int enabled = -1;
+ if (enabled == -1)
+ {
+@@ -3918,7 +3898,7 @@ static BOOL init_freetype(void)
+ /* Don't warn if these ones are missing */
+ pFT_Outline_Embolden = wine_dlsym(ft_handle, "FT_Outline_Embolden", NULL, 0);
+ pFT_Get_TrueType_Engine_Type = wine_dlsym(ft_handle, "FT_Get_TrueType_Engine_Type", NULL, 0);
+-#ifdef HAVE_FREETYPE_FTLCDFIL_H
++#ifdef FT_LCD_FILTER_H
+ pFT_Library_SetLcdFilter = wine_dlsym(ft_handle, "FT_Library_SetLcdFilter", NULL, 0);
+ #endif
+
+@@ -6706,7 +6686,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
+ case WINE_GGO_HBGR_BITMAP:
+ case WINE_GGO_VRGB_BITMAP:
+ case WINE_GGO_VBGR_BITMAP:
+-#ifdef HAVE_FREETYPE_FTLCDFIL_H
++#ifdef FT_LCD_FILTER_H
+ {
+ switch (ft_face->glyph->format)
+ {
+diff --git a/include/config.h.in b/include/config.h.in
+index a14db5b..79f8b45 100644
+--- a/include/config.h.in
++++ b/include/config.h.in
+@@ -132,39 +132,6 @@
+ /* Define if FreeType 2 is installed */
+ #undef HAVE_FREETYPE
+
+-/* Define to 1 if you have the <freetype/freetype.h> header file. */
+-#undef HAVE_FREETYPE_FREETYPE_H
+-
+-/* Define to 1 if you have the <freetype/ftglyph.h> header file. */
+-#undef HAVE_FREETYPE_FTGLYPH_H
+-
+-/* Define to 1 if you have the <freetype/ftlcdfil.h> header file. */
+-#undef HAVE_FREETYPE_FTLCDFIL_H
+-
+-/* Define to 1 if you have the <freetype/ftmodapi.h> header file. */
+-#undef HAVE_FREETYPE_FTMODAPI_H
+-
+-/* Define to 1 if you have the <freetype/ftoutln.h> header file. */
+-#undef HAVE_FREETYPE_FTOUTLN_H
+-
+-/* Define to 1 if you have the <freetype/ftsnames.h> header file. */
+-#undef HAVE_FREETYPE_FTSNAMES_H
+-
+-/* Define if you have the <freetype/fttrigon.h> header file. */
+-#undef HAVE_FREETYPE_FTTRIGON_H
+-
+-/* Define to 1 if you have the <freetype/fttypes.h> header file. */
+-#undef HAVE_FREETYPE_FTTYPES_H
+-
+-/* Define to 1 if you have the <freetype/ftwinfnt.h> header file. */
+-#undef HAVE_FREETYPE_FTWINFNT_H
+-
+-/* Define to 1 if you have the <freetype/ttnameid.h> header file. */
+-#undef HAVE_FREETYPE_TTNAMEID_H
+-
+-/* Define to 1 if you have the <freetype/tttables.h> header file. */
+-#undef HAVE_FREETYPE_TTTABLES_H
+-
+ /* Define to 1 if the system has the type `fsblkcnt_t'. */
+ #undef HAVE_FSBLKCNT_T
+
+--
+1.9.1
+
diff --git a/app-emulation/wine/files/wine-1.7.12-osmesa-check.patch b/app-emulation/wine/files/wine-1.7.12-osmesa-check.patch
new file mode 100644
index 000000000000..7cafcd4e6dc8
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.12-osmesa-check.patch
@@ -0,0 +1,38 @@
+From 6932b9a17c4f64c13f7060895d46334bc7022430 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Tue, 7 Aug 2012 01:29:01 -0400
+Subject: [PATCH] Do not check for libGL symbols when checking libOSMesa
+
+If mesa had been built with shared glapi, glAccum is not available in
+libOSMesa without explicitly linking to libGL. In addition, in
+mesa-8.0.x and earlier, libOSMesa needs to be explicitly linked to
+libglapi if mesa was built with shared glapi, see
+https://bugs.gentoo.org/show_bug.cgi?id=399813
+And in mesa-8.1.x, libOSMesa in addition needs libdl, libpthread, and
+libstdc++, see https://bugs.gentoo.org/show_bug.cgi?id=431832
+---
+ configure.ac | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index de807d2..a2e8684 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1233,7 +1233,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
+
+ if test "x$with_osmesa" != "xno"
+ then
+- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS -lm $X_EXTRA_LIBS])
++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[$X_LIBS -lm $X_EXTRA_LIBS])
++ if test "x$ac_cv_lib_soname_OSMesa" = "x"; then
++ osmesa_save_CC=$CC
++ CC=$CXX
++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[-lglapi -lpthread -ldl $X_LIBS -lm $X_EXTRA_LIBS])
++ CC=$osmesa_save_CC
++ fi
+ WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"],
+ [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.])
+ fi
+--
+1.8.5.3
+
diff --git a/app-emulation/wine/files/wine-1.7.19-makefile-race-cond.patch b/app-emulation/wine/files/wine-1.7.19-makefile-race-cond.patch
new file mode 100644
index 000000000000..294b5ae93943
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.19-makefile-race-cond.patch
@@ -0,0 +1,15 @@
+diff --git a/Makefile.in b/Makefile.in
+index 5c163b8..b600cf7 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -52,7 +52,8 @@ __tooldeps__: libs/port libs/wine libs/wpp
+ __builddeps__: __tooldeps__ include
+ .PHONY: depend check test testclean crosstest __tooldeps__ __builddeps__
+
+-loader server: libs/port libs/wine tools
++loader: libs/port libs/wine tools
++server: libs/port libs/wine tools include
+ fonts: tools/sfnt2fon
+ include: tools tools/widl
+ libs/wine tools: libs/port
+
diff --git a/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch b/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch
new file mode 100644
index 000000000000..e20ea2c28dcd
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch
@@ -0,0 +1,38 @@
+From b7eb1ff48dd1210aa3e1002afc503d5df75d50b9 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Tue, 7 Aug 2012 01:29:01 -0400
+Subject: [PATCH] Do not check for libGL symbols when checking libOSMesa
+
+If mesa had been built with shared glapi, glAccum is not available in
+libOSMesa without explicitly linking to libGL. In addition, in
+mesa-8.0.x and earlier, libOSMesa needs to be explicitly linked to
+libglapi if mesa was built with shared glapi, see
+https://bugs.gentoo.org/show_bug.cgi?id=399813
+And in mesa-8.1.x, libOSMesa in addition needs libdl, libpthread, and
+libstdc++, see https://bugs.gentoo.org/show_bug.cgi?id=431832
+---
+ configure.ac | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 66b4dd6..0303d87 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1213,7 +1213,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
+
+ if test "x$with_osmesa" != "xno"
+ then
+- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[$X_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ if test "x$ac_cv_lib_soname_OSMesa" = "x"; then
++ osmesa_save_CC=$CC
++ CC=$CXX
++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[-lglapi -lpthread -ldl $X_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ CC=$osmesa_save_CC
++ fi
+ WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"],
+ [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.])
+ fi
+--
+1.8.3.2
+
diff --git a/app-emulation/wine/files/wine-1.7.38-gstreamer-v5-staging-post.patch b/app-emulation/wine/files/wine-1.7.38-gstreamer-v5-staging-post.patch
new file mode 100644
index 000000000000..3d653993385c
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.38-gstreamer-v5-staging-post.patch
@@ -0,0 +1,58 @@
+From 695c19cdd2fc24aaa7ed89976c4965b376707131 Mon Sep 17 00:00:00 2001
+From: Sebastian Lackner <sebastian@fds-team.de>
+Date: Wed, 25 Feb 2015 22:45:42 +0100
+Subject: ntdll: Fix race-condition when threads are killed during shutdown.
+
+When exit_thread is executed, nb_threads is decremented before the thread is
+fully shutdown. When another thread runs ExitProcess() this will cause a SIGQUIT
+signal to all threads, effectively decrementing nb_threads twice. The process
+will terminate with a wrong exitcode then because the refcount reaches zero too
+early.
+
+Currently Wine has no locking protection of LdrShutdownProcess(), so it can
+only be executed safely when all other threads have terminated before. Most
+likely there are more Wine bugs in this area, but the attached patch should
+fix the most critical one (messed up refcounting of threads) for now.
+
+[Alexandre Rostovtsev <tetromino@gentoo.org> : rebase to be applied after
+ Maarten Lankhorst's "override pthreads to fix gstreamer v5" patch.]
+---
+ dlls/ntdll/thread.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
+index 4f181dc..1bdbcbf 100755
+--- a/dlls/ntdll/thread.c
++++ b/dlls/ntdll/thread.c
+@@ -461,6 +461,7 @@ static void exit_thread_common( int status )
+ static void *prev_teb;
+ TEB *teb;
+ #endif
++ sigset_t sigset;
+
+ if (status) /* send the exit code to the server (0 is already the default) */
+ {
+@@ -473,7 +474,7 @@ static void exit_thread_common( int status )
+ SERVER_END_REQ;
+ }
+
+- if (interlocked_xchg_add( &nb_threads, -1 ) <= 1)
++ if (interlocked_xchg_add( &nb_threads, 0 ) <= 1)
+ {
+ LdrShutdownProcess();
+ exit( status );
+@@ -499,6 +500,11 @@ static void exit_thread_common( int status )
+ reap_thread(NtCurrentTeb());
+ #endif
+
++ sigemptyset( &sigset );
++ sigaddset( &sigset, SIGQUIT );
++ pthread_sigmask( SIG_BLOCK, &sigset, NULL );
++ if (interlocked_xchg_add( &nb_threads, -1 ) <= 1) _exit( status );
++
+ close( ntdll_get_thread_data()->wait_fd[0] );
+ close( ntdll_get_thread_data()->wait_fd[1] );
+ close( ntdll_get_thread_data()->reply_fd );
+--
+2.3.1
+
diff --git a/app-emulation/wine/files/wine-1.7.38-gstreamer-v5-staging-pre.patch b/app-emulation/wine/files/wine-1.7.38-gstreamer-v5-staging-pre.patch
new file mode 100644
index 000000000000..eee42ff900f8
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.38-gstreamer-v5-staging-pre.patch
@@ -0,0 +1,48 @@
+From 0d92921d264d5d0d1041c66353f022f1bc88577f Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Sun, 8 Mar 2015 00:10:31 -0500
+Subject: [PATCH] Revert "ntdll: Fix race-condition when threads are killed
+ during shutdown."
+
+This reverts Sebastian Lackner's Wine-Staging patch to allow Maarten
+Lankhorst's "override pthreads to fix gstreamer v5" to apply
+---
+ dlls/ntdll/thread.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
+index 74e64c9..3696c8e 100644
+--- a/dlls/ntdll/thread.c
++++ b/dlls/ntdll/thread.c
+@@ -370,7 +370,6 @@ void terminate_thread( int status )
+ void exit_thread( int status )
+ {
+ static void *prev_teb;
+- sigset_t sigset;
+ TEB *teb;
+
+ if (status) /* send the exit code to the server (0 is already the default) */
+@@ -384,7 +383,7 @@ void exit_thread( int status )
+ SERVER_END_REQ;
+ }
+
+- if (interlocked_xchg_add( &nb_threads, 0 ) <= 1)
++ if (interlocked_xchg_add( &nb_threads, -1 ) <= 1)
+ {
+ LdrShutdownProcess();
+ exit( status );
+@@ -406,11 +405,6 @@ void exit_thread( int status )
+ }
+ }
+
+- sigemptyset( &sigset );
+- sigaddset( &sigset, SIGQUIT );
+- pthread_sigmask( SIG_BLOCK, &sigset, NULL );
+- if (interlocked_xchg_add( &nb_threads, -1 ) <= 1) _exit( status );
+-
+ close( ntdll_get_thread_data()->wait_fd[0] );
+ close( ntdll_get_thread_data()->wait_fd[1] );
+ close( ntdll_get_thread_data()->reply_fd );
+--
+2.3.1
+
diff --git a/app-emulation/wine/files/wine-1.7.39-gstreamer-v5-staging-post.patch b/app-emulation/wine/files/wine-1.7.39-gstreamer-v5-staging-post.patch
new file mode 100644
index 000000000000..25eb2357f9b3
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.39-gstreamer-v5-staging-post.patch
@@ -0,0 +1,38 @@
+From b97783fd33b4d9897c149d7a14747aa4969bd9e9 Mon Sep 17 00:00:00 2001
+From: Sebastian Lackner <sebastian@fds-team.de>
+Date: Thu, 19 Mar 2015 07:56:04 +0100
+Subject: Reapply various changes conflicting with Maarten Lankhorst's
+ gstreamer hack v5.
+
+---
+ dlls/ntdll/thread.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
+index 1e7f231..cf0461d 100644
+--- a/dlls/ntdll/thread.c
++++ b/dlls/ntdll/thread.c
+@@ -461,6 +461,8 @@ static void exit_thread_common( int status )
+ static void *prev_teb;
+ TEB *teb;
+ #endif
++ shmlocal_t *shmlocal;
++ sigset_t sigset;
+
+ if (status) /* send the exit code to the server (0 is already the default) */
+ {
+@@ -502,6 +504,11 @@ static void exit_thread_common( int status )
+ reap_thread(NtCurrentTeb());
+ #endif
+
++ sigemptyset( &sigset );
++ sigaddset( &sigset, SIGQUIT );
++ pthread_sigmask( SIG_BLOCK, &sigset, NULL );
++ if (interlocked_xchg_add( &nb_threads, -1 ) <= 1) _exit( status );
++
+ close( ntdll_get_thread_data()->wait_fd[0] );
+ close( ntdll_get_thread_data()->wait_fd[1] );
+ close( ntdll_get_thread_data()->reply_fd );
+--
+2.3.2
+
diff --git a/app-emulation/wine/files/wine-1.7.39-gstreamer-v5-staging-pre.patch b/app-emulation/wine/files/wine-1.7.39-gstreamer-v5-staging-pre.patch
new file mode 100644
index 000000000000..81aa699be94c
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.39-gstreamer-v5-staging-pre.patch
@@ -0,0 +1,40 @@
+From 1527fb44c331f2c61224514beb758895a5f85c8d Mon Sep 17 00:00:00 2001
+From: Sebastian Lackner <sebastian@fds-team.de>
+Date: Thu, 19 Mar 2015 07:51:48 +0100
+Subject: Revert various changes conflicting with Maarten Lankhorst's gstreamer
+ hack v5.
+
+Note: These changes have to be reapplied with the corresponding -post patchset
+afterwards.
+---
+ dlls/ntdll/thread.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
+index 30a4720..843be0f 100644
+--- a/dlls/ntdll/thread.c
++++ b/dlls/ntdll/thread.c
+@@ -385,8 +385,6 @@ void terminate_thread( int status )
+ void exit_thread( int status )
+ {
+ static void *prev_teb;
+- shmlocal_t *shmlocal;
+- sigset_t sigset;
+ TEB *teb;
+
+ if (status) /* send the exit code to the server (0 is already the default) */
+@@ -425,11 +423,6 @@ void exit_thread( int status )
+ }
+ }
+
+- sigemptyset( &sigset );
+- sigaddset( &sigset, SIGQUIT );
+- pthread_sigmask( SIG_BLOCK, &sigset, NULL );
+- if (interlocked_xchg_add( &nb_threads, -1 ) <= 1) _exit( status );
+-
+ close( ntdll_get_thread_data()->wait_fd[0] );
+ close( ntdll_get_thread_data()->wait_fd[1] );
+ close( ntdll_get_thread_data()->reply_fd );
+--
+2.3.2
+
diff --git a/app-emulation/wine/files/wine-1.7.45-libunwind-osx-only.patch b/app-emulation/wine/files/wine-1.7.45-libunwind-osx-only.patch
new file mode 100644
index 000000000000..e7a7905589ca
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.45-libunwind-osx-only.patch
@@ -0,0 +1,64 @@
+From 36a9f9dd05c3b9df77c44c91663e9bd6cae1c848 Mon Sep 17 00:00:00 2001
+From: Ken Thomases <ken@codeweavers.com>
+Date: Mon, 15 Jun 2015 20:42:33 -0500
+Subject: [PATCH 1/1] configure: Only check for libunwind.h on OS X.
+
+---
+ configure | 13 ++++++++++++-
+ configure.ac | 2 +-
+ 2 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index a104097..c0951db 100755
+--- a/configure
++++ b/configure
+@@ -6626,7 +6626,6 @@ for ac_header in \
+ lber.h \
+ ldap.h \
+ libproc.h \
+- libunwind.h \
+ link.h \
+ linux/cdrom.h \
+ linux/compiler.h \
+@@ -7849,6 +7848,18 @@ uninstall::
+ ;;
+
+ darwin*|macosx*)
++ for ac_header in libunwind.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "libunwind.h" "ac_cv_header_libunwind_h" "$ac_includes_default"
++if test "x$ac_cv_header_libunwind_h" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBUNWIND_H 1
++_ACEOF
++
++fi
++
++done
++
+ LIBEXT="dylib"
+ DLLFLAGS="$DLLFLAGS -fPIC"
+ LIBWINE_LDFLAGS="-multiply_defined suppress"
+diff --git a/configure.ac b/configure.ac
+index df28b27..f9df3f0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -424,7 +424,6 @@ AC_CHECK_HEADERS(\
+ lber.h \
+ ldap.h \
+ libproc.h \
+- libunwind.h \
+ link.h \
+ linux/cdrom.h \
+ linux/compiler.h \
+@@ -751,6 +750,7 @@ uninstall::
+ ;;
+
+ darwin*|macosx*)
++ AC_CHECK_HEADERS(libunwind.h)
+ LIBEXT="dylib"
+ DLLFLAGS="$DLLFLAGS -fPIC"
+ LIBWINE_LDFLAGS="-multiply_defined suppress"
+--
+1.9.1
+
diff --git a/app-emulation/wine/files/wine-1.7.47-critical-security-cookie-fix.patch b/app-emulation/wine/files/wine-1.7.47-critical-security-cookie-fix.patch
new file mode 100644
index 000000000000..9168654a841f
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.47-critical-security-cookie-fix.patch
@@ -0,0 +1,82 @@
+From: Erich E. Hoover <erich.e.hoover@wine-staging.com>
+Date: Fri, 10 Jul 2015 20:52:33 +0000 (-0600)
+Subject: ntdll: Only set the security cookie if it has not already been set.
+X-Git-Url: http://source.winehq.org/git/wine.git/commitdiff_plain/e9d7cf99ada80ea8345c301481c63a24780f2b63
+
+ntdll: Only set the security cookie if it has not already been set.
+---
+
+diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
+index 410e060..ff947da 100644
+--- a/dlls/ntdll/virtual.c
++++ b/dlls/ntdll/virtual.c
+@@ -61,6 +61,12 @@ WINE_DECLARE_DEBUG_CHANNEL(module);
+ #define MAP_NORESERVE 0
+ #endif
+
++#ifdef _WIN64
++#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
++#endif
++#define DEFAULT_SECURITY_COOKIE_32 0xbb40e64e
++#define DEFAULT_SECURITY_COOKIE_16 (DEFAULT_SECURITY_COOKIE_32 >> 16)
++
+ /* File view */
+ struct file_view
+ {
+@@ -1053,6 +1059,36 @@ static NTSTATUS stat_mapping_file( struct file_view *view, struct stat *st )
+ return status;
+ }
+
++/***********************************************************************
++ * set_security_cookie
++ *
++ * Create a random security cookie for buffer overflow protection. Make
++ * sure it does not accidentally match the default cookie value.
++ */
++static void set_security_cookie(ULONG_PTR *cookie)
++{
++ static ULONG seed;
++
++ if (!cookie) return;
++ if (!seed) seed = NtGetTickCount() ^ GetCurrentProcessId();
++ while (1)
++ {
++ if (*cookie == DEFAULT_SECURITY_COOKIE_16)
++ *cookie = RtlRandom( &seed ) >> 16; /* leave the high word clear */
++ else if (*cookie == DEFAULT_SECURITY_COOKIE_32)
++ *cookie = RtlRandom( &seed );
++#ifdef DEFAULT_SECURITY_COOKIE_64
++ else if (*cookie == DEFAULT_SECURITY_COOKIE_64)
++ {
++ *cookie = RtlRandom( &seed );
++ /* fill up, but keep the highest word clear */
++ *cookie ^= (ULONG_PTR)RtlRandom( &seed ) << 16;
++ }
++#endif
++ else
++ break;
++ }
++}
+
+ /***********************************************************************
+ * map_image
+@@ -1285,18 +1321,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
+ loadcfg = RtlImageDirectoryEntryToData( (HMODULE)ptr, TRUE,
+ IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &loadcfg_size );
+ if (loadcfg && loadcfg_size >= sizeof(*loadcfg))
+- {
+- static ULONG seed;
+- ULONG_PTR *cookie = (ULONG_PTR *)loadcfg->SecurityCookie;
+-
+- if (!seed) seed = NtGetTickCount() ^ GetCurrentProcessId();
+- if (cookie)
+- {
+- *cookie = RtlRandom( &seed );
+- if (sizeof(ULONG_PTR) > sizeof(ULONG)) /* fill up, but keep the highest word clear */
+- *cookie ^= (ULONG_PTR)RtlRandom( &seed ) << 16;
+- }
+- }
++ set_security_cookie((ULONG_PTR *)loadcfg->SecurityCookie);
+
+ /* set the image protections */
+
diff --git a/app-emulation/wine/files/wine-gcc-4.9-null-pointer.patch b/app-emulation/wine/files/wine-gcc-4.9-null-pointer.patch
new file mode 100644
index 000000000000..213f2c6c52c7
--- /dev/null
+++ b/app-emulation/wine/files/wine-gcc-4.9-null-pointer.patch
@@ -0,0 +1,35 @@
+From deb274226783ab886bdb44876944e156757efe2b Mon Sep 17 00:00:00 2001
+From: Daniel Beitler <dan@dablabs.com>
+Date: Sun, 18 May 2014 13:27:42 -0400
+Subject: [PATCH] msi: Prevent call to memset with a null pointer in
+ get_tablecolumns function.
+
+---
+ dlls/msi/table.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dlls/msi/table.c b/dlls/msi/table.c
+index 8012369..9ed9421 100644
+--- a/dlls/msi/table.c
++++ b/dlls/msi/table.c
+@@ -671,7 +671,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
+ /* Note: _Columns table doesn't have non-persistent data */
+
+ /* if maxcount is non-zero, assume it's exactly right for this table */
+- memset( colinfo, 0, maxcount * sizeof(*colinfo) );
++ if (colinfo) memset( colinfo, 0, maxcount * sizeof(*colinfo) );
+ count = table->row_count;
+ for (i = 0; i < count; i++)
+ {
+@@ -684,7 +684,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
+ /* check the column number is in range */
+ if (col < 1 || col > maxcount)
+ {
+- ERR("column %d out of range\n", col);
++ ERR("column %d out of range (maxcount: %d)\n", col, maxcount);
+ continue;
+ }
+ /* check if this column was already set */
+--
+1.9.1
+
diff --git a/app-emulation/wine/metadata.xml b/app-emulation/wine/metadata.xml
new file mode 100644
index 000000000000..fbf2c5b68295
--- /dev/null
+++ b/app-emulation/wine/metadata.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>wine</herd>
+ <longdescription>
+Wine is an Open Source implementation of the Windows API on top of X and Unix.
+
+Think of Wine as a compatibility layer for running Windows programs. Wine does not require Microsoft Windows, as it is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code, however Wine can optionally use native Windows DLLs if they are available. Wine provides both a development toolkit for porting Windows source code to Unix as well as a program loader, allowing many unmodified Windows programs to run on x86-based Unixes, including Linux, FreeBSD, and Solaris.
+ </longdescription>
+ <use>
+ <flag name="capi">Enable ISDN support via CAPI</flag>
+ <flag name="custom-cflags">Bypass strip-flags; use at your own peril</flag>
+ <flag name="dos">Pull in <pkg>games-emulation/dosbox</pkg> to run DOS applications</flag>
+ <flag name="gecko">Add support for the Gecko engine when using iexplore</flag>
+ <flag name="mono">Add support for .NET using Wine's Mono add-on</flag>
+ <flag name="netapi">Use libnetapi from <pkg>net-fs/samba</pkg> to support Windows networks in netapi32.dll</flag>
+ <flag name="opencl">Enable OpenCL support</flag>
+ <flag name="osmesa">Add support for OpenGL in bitmaps using libOSMesa</flag>
+ <flag name="pcap">Support packet capture software (e.g. wireshark)</flag>
+ <flag name="perl">Install helpers written in perl (winedump/winemaker)</flag>
+ <flag name="pipelight">Apply unofficial Wine-Staging patches for Pipelight/Silverlight support</flag>
+ <flag name="prelink">Run prelink on DLLs during build -- do not disable if you do not know what this means as it can break things at runtime</flag>
+ <flag name="realtime">Pull in <pkg>sys-auth/rtkit</pkg> for low-latency pulseaudio support</flag>
+ <flag name="run-exes">Use Wine to open and run .EXE and .MSI files</flag>
+ <flag name="s3tc">Pull in <pkg>media-libs/libtxc_dxtn</pkg> for DXTn texture compression, needed for many games</flag>
+ <flag name="samba">Add support for NTLM auth. see
+ http://wiki.winehq.org/NtlmAuthSetupGuide and
+ http://wiki.winehq.org/NtlmSigningAndSealing</flag>
+ <flag name="staging">Apply unofficial Wine-Staging patches for advanced feature support that haven't made it into upstream Wine yet</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">wine-compholio/wine-staging</remote-id>
+ <remote-id type="sourceforge">wine</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/wine/wine-1.6.2-r1.ebuild b/app-emulation/wine/wine-1.6.2-r1.ebuild
new file mode 100644
index 000000000000..7d6275dd37cb
--- /dev/null
+++ b/app-emulation/wine/wine-1.6.2-r1.ebuild
@@ -0,0 +1,368 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.21"
+MV="0.0.8"
+PULSE_PATCHES="winepulse-patches-1.7.8"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.6.2.ebuild b/app-emulation/wine/wine-1.6.2.ebuild
new file mode 100644
index 000000000000..013b8def3f52
--- /dev/null
+++ b/app-emulation/wine/wine-1.6.2.ebuild
@@ -0,0 +1,376 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-multilib eutils fdo-mime flag-o-matic gnome2-utils l10n multilib pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git"
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* amd64 x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.21"
+MV="0.0.8"
+PULSE_PATCHES="winepulse-patches-1.7.8"
+WINE_GENTOO="wine-gentoo-2013.06.24"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg lcms ldap +mono mp3 ncurses nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+NATIVE_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0 )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:= )
+ udisks? ( sys-apps/dbus )
+ fontconfig? ( media-libs/fontconfig:= )
+ gphoto2? ( media-libs/libgphoto2:= )
+ openal? ( media-libs/openal:= )
+ gstreamer? ( media-libs/gstreamer:0.10 media-libs/gst-plugins-base:0.10 )
+ X? (
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXrandr
+ x11-libs/libXi
+ x11-libs/libXxf86vm
+ )
+ xinerama? ( x11-libs/libXinerama )
+ alsa? ( media-libs/alsa-lib )
+ cups? ( net-print/cups:= )
+ opencl? ( virtual/opencl )
+ opengl? (
+ virtual/glu
+ virtual/opengl
+ )
+ gsm? ( media-sound/gsm:= )
+ jpeg? ( virtual/jpeg:0= )
+ ldap? ( net-nds/openldap:= )
+ lcms? ( media-libs/lcms:2= )
+ mp3? ( >=media-sound/mpg123-1.5.0 )
+ nls? ( sys-devel/gettext )
+ odbc? ( dev-db/unixODBC:= )
+ osmesa? ( media-libs/mesa[osmesa] )
+ pulseaudio? ( media-sound/pulseaudio )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )
+ scanner? ( media-gfx/sane-backends:= )
+ ssl? ( net-libs/gnutls:= )
+ png? ( media-libs/libpng:0= )
+ v4l? ( media-libs/libv4l )
+ xcomposite? ( x11-libs/libXcomposite )"
+
+COMMON_DEPEND="
+ !amd64? ( ${NATIVE_DEPEND} )
+ amd64? (
+ abi_x86_64? ( ${NATIVE_DEPEND} )
+ abi_x86_32? (
+ truetype? ( >=media-libs/freetype-2.5.0.1[abi_x86_32(-)] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3[abi_x86_32(-)] )
+ udisks? ( >=sys-apps/dbus-1.6.18-r1[abi_x86_32(-)] )
+ fontconfig? ( >=media-libs/fontconfig-2.10.92[abi_x86_32(-)] )
+ gphoto2? ( >=media-libs/libgphoto2-2.5.3.1[abi_x86_32(-)] )
+ openal? ( >=media-libs/openal-1.15.1[abi_x86_32(-)] )
+ gstreamer? (
+ >=media-libs/gstreamer-0.10.36-r2:0.10[abi_x86_32(-)]
+ >=media-libs/gst-plugins-base-0.10.36:0.10[abi_x86_32(-)]
+ )
+ X? (
+ >=x11-libs/libXcursor-1.1.14[abi_x86_32(-)]
+ >=x11-libs/libXext-1.3.2[abi_x86_32(-)]
+ >=x11-libs/libXrandr-1.4.2[abi_x86_32(-)]
+ >=x11-libs/libXi-1.7.2[abi_x86_32(-)]
+ >=x11-libs/libXxf86vm-1.1.3[abi_x86_32(-)]
+ )
+ xinerama? ( >=x11-libs/libXinerama-1.1.3[abi_x86_32(-)] )
+ alsa? ( >=media-libs/alsa-lib-1.0.27.2[abi_x86_32(-)] )
+ cups? ( >=net-print/cups-1.7.1-r1[abi_x86_32(-)] )
+ opencl? ( >=virtual/opencl-0-r3[abi_x86_32(-)] )
+ opengl? (
+ >=virtual/glu-9.0-r1[abi_x86_32(-)]
+ >=virtual/opengl-7.0-r1[abi_x86_32(-)]
+ )
+ gsm? ( >=media-sound/gsm-1.0.13-r1[abi_x86_32(-)] )
+ jpeg? ( >=virtual/jpeg-0-r2:0[abi_x86_32(-)] )
+ ldap? ( >=net-nds/openldap-2.4.38-r1:=[abi_x86_32(-)] )
+ lcms? ( >=media-libs/lcms-2.5:2[abi_x86_32(-)] )
+ mp3? ( >=media-sound/mpg123-1.15.4[abi_x86_32(-)] )
+ nls? ( >=sys-devel/gettext-0.18.3.2[abi_x86_32(-)] )
+ odbc? ( >=dev-db/unixODBC-2.3.2:=[abi_x86_32(-)] )
+ osmesa? ( >=media-libs/mesa-9.1.6[osmesa,abi_x86_32(-)] )
+ pulseaudio? ( >=media-sound/pulseaudio-5.0[abi_x86_32(-)] )
+ xml? (
+ >=dev-libs/libxml2-2.9.1-r4[abi_x86_32(-)]
+ >=dev-libs/libxslt-1.1.28-r1[abi_x86_32(-)]
+ )
+ scanner? ( >=media-gfx/sane-backends-1.0.23:=[abi_x86_32(-)] )
+ ssl? ( >=net-libs/gnutls-2.12.23-r6:=[abi_x86_32(-)] )
+ png? ( >=media-libs/libpng-1.6.10:0[abi_x86_32(-)] )
+ v4l? ( >=media-libs/libv4l-0.9.5[abi_x86_32(-)] )
+ xcomposite? ( >=x11-libs/libXcomposite-0.4.4-r1[abi_x86_32(-)] )
+ )
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ amd64? ( abi_x86_32? ( !abi_x86_64? ( ${NATIVE_DEPEND} ) ) )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+do_configure() {
+ local myeconfargs=( "${myeconfargs[@]}" )
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myeconfargs+=( --enable-win64 )
+ else
+ myeconfargs+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ autotools-utils_src_configure
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ local myeconfargs=( # common
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_with mp3 mpg123)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myeconfargs+=( --with-pulse )
+
+ if use amd64 && use abi_x86_32; then
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+ fi
+
+ multilib_parallel_foreach_abi do_configure
+}
+
+src_compile() {
+ autotools-multilib_src_compile depend
+ autotools-multilib_src_compile all
+}
+
+src_test() {
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ multilib_toolchain_setup x86
+ local BUILD_DIR="${S}-${ABI}"
+ cd "${BUILD_DIR}" || die
+ WINEPREFIX="${T}/.wine-${ABI}" Xemake test
+}
+
+src_install() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS=( "${DOCS[@]}" ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+ autotools-multilib_src_install
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.10-r1.ebuild b/app-emulation/wine/wine-1.7.10-r1.ebuild
new file mode 100644
index 000000000000..721c4a54f8b8
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.10-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.10"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.11-r1.ebuild b/app-emulation/wine/wine-1.7.11-r1.ebuild
new file mode 100644
index 000000000000..721c4a54f8b8
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.11-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.10"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.12-r1.ebuild b/app-emulation/wine/wine-1.7.12-r1.ebuild
new file mode 100644
index 000000000000..398f2f235049
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.12-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.12"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.13-r1.ebuild b/app-emulation/wine/wine-1.7.13-r1.ebuild
new file mode 100644
index 000000000000..398f2f235049
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.13-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.12"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.14-r1.ebuild b/app-emulation/wine/wine-1.7.14-r1.ebuild
new file mode 100644
index 000000000000..398f2f235049
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.14-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.12"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.15-r1.ebuild b/app-emulation/wine/wine-1.7.15-r1.ebuild
new file mode 100644
index 000000000000..398f2f235049
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.15-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.12"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.16-r1.ebuild b/app-emulation/wine/wine-1.7.16-r1.ebuild
new file mode 100644
index 000000000000..398f2f235049
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.16-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.12"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.17-r1.ebuild b/app-emulation/wine/wine-1.7.17-r1.ebuild
new file mode 100644
index 000000000000..398f2f235049
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.17-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.12"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.18-r1.ebuild b/app-emulation/wine/wine-1.7.18-r1.ebuild
new file mode 100644
index 000000000000..398f2f235049
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.18-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.12"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.19-r2.ebuild b/app-emulation/wine/wine-1.7.19-r2.ebuild
new file mode 100644
index 000000000000..e8e0c0b43a85
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.19-r2.ebuild
@@ -0,0 +1,415 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+STAGING_P="wine-staging-1.7.18-1"
+STAGING_DIR="${WORKDIR}/wine-staging-1.7.19"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+PULSE_PATCHES="winepulse-patches-1.7.12"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ if use staging; then
+ # we use a separate pulseaudio patchset
+ rm -r "${STAGING_DIR}/patches/06-winepulse" || die
+ # ... and need special tools for binary patches
+ mv "${STAGING_DIR}/patches/10-Missing_Fonts" "${T}" || die
+ if ! use pipelight; then
+ rm -r "${STAGING_DIR}/patches/97-Pipelight" || die
+ fi
+ fi
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local f
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ PATCHES+=(
+ "${FILESDIR}/wine-1.7.19-makefile-race-cond.patch"
+ "${STAGING_DIR}/patches"/*/*.patch #507950
+ "${STAGING_DIR}/patches/patch-list.patch"
+ )
+ # epatch doesn't support binary patches
+ ebegin "Applying Staging font patches"
+ for f in "${T}/10-Missing_Fonts"/*.patch; do
+ "${STAGING_DIR}/debian/tools/gitapply.sh" < "${f}" || die "Failed to apply Compholio font patches"
+ done
+ eend
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+ use staging && myconf+=( --with-xattr )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.20-r1.ebuild b/app-emulation/wine/wine-1.7.20-r1.ebuild
new file mode 100644
index 000000000000..af857ee80075
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.20-r1.ebuild
@@ -0,0 +1,417 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+PULSE_PATCHES="winepulse-patches-1.7.20"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ gstreamer? ( pulseaudio )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ osmesa? ( opengl )" #286560
+# winepulse patches needed for gstreamer due to http://bugs.winehq.org/show_bug.cgi?id=30557
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ if use staging; then
+ # we use a separate pulseaudio patchset
+ rm -r "${STAGING_DIR}/patches/06-winepulse" || die
+ # ... and need special tools for binary patches
+ mv "${STAGING_DIR}/patches/10-Missing_Fonts" "${T}" || die
+ if ! use pipelight; then
+ rm -r "${STAGING_DIR}/patches/97-Pipelight" || die
+ fi
+ fi
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local f
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ PATCHES+=(
+ "${FILESDIR}/wine-1.7.19-makefile-race-cond.patch"
+ "${STAGING_DIR}/patches"/*/*.patch #507950
+ "${STAGING_DIR}/patches/patch-list.patch"
+ )
+ # epatch doesn't support binary patches
+ ebegin "Applying Staging font patches"
+ for f in "${T}/10-Missing_Fonts"/*.patch; do
+ "${STAGING_DIR}/debian/tools/gitapply.sh" < "${f}" || die "Failed to apply Compholio font patches"
+ done
+ eend
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+ use staging && myconf+=( --with-xattr )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.21-r1.ebuild b/app-emulation/wine/wine-1.7.21-r1.ebuild
new file mode 100644
index 000000000000..2f82806743f3
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.21-r1.ebuild
@@ -0,0 +1,424 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+PULSE_PATCHES="winepulse-patches-1.7.21"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ gstreamer? ( pulseaudio )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ osmesa? ( opengl )" #286560
+# winepulse patches needed for gstreamer due to http://bugs.winehq.org/show_bug.cgi?id=30557
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ if use staging; then
+ # we use a separate pulseaudio patchset
+ rm -r "${STAGING_DIR}/patches/06-winepulse" || die
+ # ... and need special tools for binary patches
+ mv "${STAGING_DIR}/patches/10-Missing_Fonts" "${T}" || die
+ if ! use pipelight; then
+ rm -r "${STAGING_DIR}/patches/97-Pipelight" || die
+ fi
+ fi
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local f
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "../${PULSE_PATCHES}"/gstreamer/*.patch )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ PATCHES+=(
+ "${FILESDIR}/wine-1.7.19-makefile-race-cond.patch"
+ "${STAGING_DIR}/patches"/*/*.patch #507950
+ "${STAGING_DIR}/patches/patch-list.patch"
+ )
+ # epatch doesn't support binary patches
+ ebegin "Applying Staging font patches"
+ for f in "${T}/10-Missing_Fonts"/*.patch; do
+ "${STAGING_DIR}/debian/tools/gitapply.sh" < "${f}" || die "Failed to apply Compholio font patches"
+ done
+ eend
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+ use staging && myconf+=( --with-xattr )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.22-r1.ebuild b/app-emulation/wine/wine-1.7.22-r1.ebuild
new file mode 100644
index 000000000000..2f82806743f3
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.22-r1.ebuild
@@ -0,0 +1,424 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+PULSE_PATCHES="winepulse-patches-1.7.21"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ gstreamer? ( pulseaudio )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ osmesa? ( opengl )" #286560
+# winepulse patches needed for gstreamer due to http://bugs.winehq.org/show_bug.cgi?id=30557
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ if use staging; then
+ # we use a separate pulseaudio patchset
+ rm -r "${STAGING_DIR}/patches/06-winepulse" || die
+ # ... and need special tools for binary patches
+ mv "${STAGING_DIR}/patches/10-Missing_Fonts" "${T}" || die
+ if ! use pipelight; then
+ rm -r "${STAGING_DIR}/patches/97-Pipelight" || die
+ fi
+ fi
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local f
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "../${PULSE_PATCHES}"/gstreamer/*.patch )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ PATCHES+=(
+ "${FILESDIR}/wine-1.7.19-makefile-race-cond.patch"
+ "${STAGING_DIR}/patches"/*/*.patch #507950
+ "${STAGING_DIR}/patches/patch-list.patch"
+ )
+ # epatch doesn't support binary patches
+ ebegin "Applying Staging font patches"
+ for f in "${T}/10-Missing_Fonts"/*.patch; do
+ "${STAGING_DIR}/debian/tools/gitapply.sh" < "${f}" || die "Failed to apply Compholio font patches"
+ done
+ eend
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+ use staging && myconf+=( --with-xattr )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.28-r1.ebuild b/app-emulation/wine/wine-1.7.28-r1.ebuild
new file mode 100644
index 000000000000..35b3e88e756b
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.28-r1.ebuild
@@ -0,0 +1,427 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.28-gstreamer-v4"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local f
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+
+ local STAGING_MAKE_ARGS="-W fonts-Missing_Fonts.ok"
+
+ use pipelight || STAGING_MAKE_ARGS="${STAGING_MAKE_ARGS} -W winepulse-PulseAudio_Support.ok"
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ # epatch doesn't support binary patches and we ship our own pulse patches
+ emake -C "${STAGING_DIR}/patches" \
+ $(echo ${STAGING_MAKE_ARGS}) \
+ series
+
+ PATCHES+=( $(sed -e "s:^:${STAGING_DIR}/patches/:" \
+ "${STAGING_DIR}/patches/series") )
+
+ # epatch doesn't support binary patches
+ ebegin "Applying Wine-Staging font patches"
+ for f in "${STAGING_DIR}/patches/fonts-Missing_Fonts"/*.patch; do
+ "${STAGING_DIR}/debian/tools/gitapply.sh" < "${f}" \
+ || die "Failed to apply ${f}"
+ done
+ eend
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.29-r1.ebuild b/app-emulation/wine/wine-1.7.29-r1.ebuild
new file mode 100644
index 000000000000..35b3e88e756b
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.29-r1.ebuild
@@ -0,0 +1,427 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.28-gstreamer-v4"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local f
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+
+ local STAGING_MAKE_ARGS="-W fonts-Missing_Fonts.ok"
+
+ use pipelight || STAGING_MAKE_ARGS="${STAGING_MAKE_ARGS} -W winepulse-PulseAudio_Support.ok"
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ # epatch doesn't support binary patches and we ship our own pulse patches
+ emake -C "${STAGING_DIR}/patches" \
+ $(echo ${STAGING_MAKE_ARGS}) \
+ series
+
+ PATCHES+=( $(sed -e "s:^:${STAGING_DIR}/patches/:" \
+ "${STAGING_DIR}/patches/series") )
+
+ # epatch doesn't support binary patches
+ ebegin "Applying Wine-Staging font patches"
+ for f in "${STAGING_DIR}/patches/fonts-Missing_Fonts"/*.patch; do
+ "${STAGING_DIR}/debian/tools/gitapply.sh" < "${f}" \
+ || die "Failed to apply ${f}"
+ done
+ eend
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.3-r1.ebuild b/app-emulation/wine/wine-1.7.3-r1.ebuild
new file mode 100644
index 000000000000..180ee2cf3799
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.3-r1.ebuild
@@ -0,0 +1,369 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="0.0.8"
+PULSE_PATCHES="winepulse-patches-1.7.3"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-1.7.0-freetype-header-location.patch #539830
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.33-r1.ebuild b/app-emulation/wine/wine-1.7.33-r1.ebuild
new file mode 100644
index 000000000000..f5149d6d1cd0
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.33-r1.ebuild
@@ -0,0 +1,430 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.34"
+MV="4.5.4"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.28-gstreamer-v4"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ s3tc? ( media-libs/libtxc_dxtn[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local f
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+
+ local STAGING_MAKE_ARGS="-W fonts-Missing_Fonts.ok"
+
+ use pipelight || STAGING_MAKE_ARGS="${STAGING_MAKE_ARGS} -W Pipelight.ok"
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ # epatch doesn't support binary patches and we ship our own pulse patches
+ emake -C "${STAGING_DIR}/patches" \
+ $(echo ${STAGING_MAKE_ARGS}) \
+ series
+
+ PATCHES+=( $(sed -e "s:^:${STAGING_DIR}/patches/:" \
+ "${STAGING_DIR}/patches/series") )
+
+ # epatch doesn't support binary patches
+ ebegin "Applying Wine-Staging font patches"
+ for f in "${STAGING_DIR}/patches/fonts-Missing_Fonts"/*.patch; do
+ "${STAGING_DIR}/debian/tools/gitapply.sh" < "${f}" \
+ || die "Failed to apply ${f}"
+ done
+ eend
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with s3tc txc_dxtn)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.34.ebuild b/app-emulation/wine/wine-1.7.34.ebuild
new file mode 100644
index 000000000000..1a98e86da9e4
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.34.ebuild
@@ -0,0 +1,427 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.34"
+MV="4.5.4"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ s3tc? ( media-libs/libtxc_dxtn[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ # Apply temporary patch to wine-staging to allow for epatch as a backend to wine-staging's new patch script
+ pushd "${STAGING_DIR}"
+ epatch "${FILESDIR}"/wine-staging-gentoo-epatch-support.patch
+ popd
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with s3tc txc_dxtn)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.35.ebuild b/app-emulation/wine/wine-1.7.35.ebuild
new file mode 100644
index 000000000000..991374736da0
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.35.ebuild
@@ -0,0 +1,422 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.34"
+MV="4.5.4"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ s3tc? ( media-libs/libtxc_dxtn[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with s3tc txc_dxtn)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.36.ebuild b/app-emulation/wine/wine-1.7.36.ebuild
new file mode 100644
index 000000000000..b0ed2dd66aad
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.36.ebuild
@@ -0,0 +1,421 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.34"
+MV="4.5.4"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ s3tc? ( media-libs/libtxc_dxtn[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with s3tc txc_dxtn)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.37.ebuild b/app-emulation/wine/wine-1.7.37.ebuild
new file mode 100644
index 000000000000..d0c75483f2e4
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.37.ebuild
@@ -0,0 +1,424 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.34"
+MV="4.5.4"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.38-r1.ebuild b/app-emulation/wine/wine-1.7.38-r1.ebuild
new file mode 100644
index 000000000000..df03a2013cd1
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.38-r1.ebuild
@@ -0,0 +1,434 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch prevents the gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.38-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.38-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.39-r1.ebuild b/app-emulation/wine/wine-1.7.39-r1.ebuild
new file mode 100644
index 000000000000..6705349e0602
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.39-r1.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.4-r1.ebuild b/app-emulation/wine/wine-1.7.4-r1.ebuild
new file mode 100644
index 000000000000..2d53b2ee5da6
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.4-r1.ebuild
@@ -0,0 +1,369 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="0.0.8"
+PULSE_PATCHES="winepulse-patches-1.7.4"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-1.7.0-freetype-header-location.patch #539830
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.40-r1.ebuild b/app-emulation/wine/wine-1.7.40-r1.ebuild
new file mode 100644
index 000000000000..6705349e0602
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.40-r1.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.41.ebuild b/app-emulation/wine/wine-1.7.41.ebuild
new file mode 100644
index 000000000000..6705349e0602
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.41.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.42.ebuild b/app-emulation/wine/wine-1.7.42.ebuild
new file mode 100644
index 000000000000..6705349e0602
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.42.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.43.ebuild b/app-emulation/wine/wine-1.7.43.ebuild
new file mode 100644
index 000000000000..6705349e0602
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.43.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.44.ebuild b/app-emulation/wine/wine-1.7.44.ebuild
new file mode 100644
index 000000000000..6705349e0602
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.44.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.45.ebuild b/app-emulation/wine/wine-1.7.45.ebuild
new file mode 100644
index 000000000000..ec49c87428f2
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.45.ebuild
@@ -0,0 +1,430 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-1.7.45-libunwind-osx-only.patch # only applies to this version
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.46.ebuild b/app-emulation/wine/wine-1.7.46.ebuild
new file mode 100644
index 000000000000..6705349e0602
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.46.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.47.ebuild b/app-emulation/wine/wine-1.7.47.ebuild
new file mode 100644
index 000000000000..4bb95bf5bcdc
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.47.ebuild
@@ -0,0 +1,438 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-1.7.47-critical-security-cookie-fix.patch # only necessary for this version, upstream #38895
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ STAGING_EXCLUDE="${STAGING_EXCLUDE} -W ntdll-Revert_Security_Cookie" # only necessary in this version
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.8-r1.ebuild b/app-emulation/wine/wine-1.7.8-r1.ebuild
new file mode 100644
index 000000000000..0ca1fd9741e6
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.8-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.8"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-1.7.9-r1.ebuild b/app-emulation/wine/wine-1.7.9-r1.ebuild
new file mode 100644
index 000000000000..0ca1fd9741e6
--- /dev/null
+++ b/app-emulation/wine/wine-1.7.9-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.24"
+MV="4.5.2"
+PULSE_PATCHES="winepulse-patches-1.7.8"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-gcc-4.9-null-pointer.patch #543446
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myconf+=( --with-pulse )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/wine-9999.ebuild b/app-emulation/wine/wine-9999.ebuild
new file mode 100644
index 000000000000..6705349e0602
--- /dev/null
+++ b/app-emulation/wine/wine-9999.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.36"
+MV="4.5.6"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.7.34-gstreamer-v5"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ gstreamer? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${GST_P}.patch.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+ STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+ SRC_URI="${SRC_URI}
+ staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )
+ pulseaudio? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png +prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ pipelight? ( staging )
+ s3tc? ( staging )
+ vaapi? ( staging )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
+ )
+ X? (
+ x11-libs/libXcursor[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXi[${MULTILIB_USEDEP}]
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+ )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
+ gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+ lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+ nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+ odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+ pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
+ scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+ vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-db-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+ !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-opengl-20140508-r1
+ !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-sdl-20140508-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-soundlibs-20140508
+ !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+ !<app-emulation/emul-linux-x86-xlibs-20140508
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+ staging? ( dev-lang/perl dev-perl/XML-Simple )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ # bug #549768
+ if [[ $(gcc-major-version) = 5 ]]; then
+ eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ if use staging || use pulseaudio; then
+ EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+ unset ${PN}_LIVE_REPO;
+ EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ fi
+ else
+ unpack ${MY_P}.tar.bz2
+ use staging || use pulseaudio && unpack "${STAGING_P}.tar.gz"
+ fi
+
+ unpack "${WINE_GENTOO}.tar.bz2"
+ use gstreamer && unpack "${GST_P}.patch.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ )
+ if use gstreamer; then
+ # See http://bugs.winehq.org/show_bug.cgi?id=30557
+ ewarn "Applying experimental patch to fix GStreamer support. Note that"
+ ewarn "this patch has been reported to cause crashes in certain games."
+
+ # Wine-Staging 1.7.38 "ntdll: Fix race-condition when threads are killed
+ # during shutdown" patch and "Added patch to implement shared memory
+ # wineserver communication for various user32 functions" prevents the
+ # gstreamer patch from applying cleanly.
+ # So undo the staging patch, apply gstreamer, then re-apply rebased staging
+ # patch on top.
+ if use staging; then
+ PATCHES+=(
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-pre.patch"
+ "${WORKDIR}/${GST_P}.patch"
+ "${FILESDIR}/${PN}-1.7.39-gstreamer-v5-staging-post.patch" )
+ else
+ PATCHES+=( "${WORKDIR}/${GST_P}.patch" )
+ fi
+ fi
+ if use staging; then
+ ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
+ ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
+ ewarn "unless you can reproduce them with USE=-staging"
+
+ local STAGING_EXCLUDE=""
+ use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+ # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ ebegin "Running Wine-Staging patch installer"
+ (
+ set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ cd "${STAGING_DIR}/patches"
+ source "${STAGING_DIR}/patches/patchinstall.sh"
+ )
+ eend $?
+ elif use pulseaudio; then
+ PATCHES+=( "${STAGING_DIR}/patches/winepulse-PulseAudio_Support"/*.patch )
+ fi
+ autotools-utils_src_prepare
+
+ # Modification of the server protocol requires regenerating the server requests
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_enable gecko mshtml)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_enable mono mscoree)
+ $(use_with mp3 mpg123)
+ $(use_with netapi)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with pcap)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ if use pulseaudio || use staging; then
+ myconf+=( $(use_with pulseaudio pulse) )
+ fi
+ use staging && myconf+=(
+ --with-xattr
+ $(use_with vaapi va)
+ )
+
+ local PKG_CONFIG AR RANLIB
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myconf+=( --enable-win64 )
+ else
+ myconf+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+ emake depend
+}
+
+multilib_src_test() {
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ if [[ ${ABI} == x86 ]]; then
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ WINEPREFIX="${T}/.wine-${ABI}" \
+ Xemake test
+ fi
+}
+
+multilib_src_install_all() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ local l
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+
+ einstalldocs
+ prune_libtool_files --all
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+
+ if ! use gecko; then
+ ewarn "Without Wine Gecko, wine prefixes will not have a default"
+ ewarn "implementation of iexplore. Many older windows applications"
+ ewarn "rely upon the existence of an iexplore implementation, so"
+ ewarn "you will likely need to install an external one, like via winetricks"
+ fi
+ if ! use mono; then
+ ewarn "Without Wine Mono, wine prefixes will not have a default"
+ ewarn "implementation of .NET. Many windows applications rely upon"
+ ewarn "the existence of a .NET implementation, so you will likely need"
+ ewarn "to install an external one, like via winetricks"
+ fi
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/winetricks/Manifest b/app-emulation/winetricks/Manifest
new file mode 100644
index 000000000000..4ff65142ce81
--- /dev/null
+++ b/app-emulation/winetricks/Manifest
@@ -0,0 +1,2 @@
+DIST winetricks-20150706.tar.gz 171118 SHA256 989290d0a6b2a51da69b348e986ec67de48c625ca461b2da928884f17d834c4e SHA512 8cb021463c0fbf5f96bab98d61fbe6fe630ddb2b72d97aee30eb14ea617b0214f196025e2b854d6a3d0de53f84ea66ed8b05cf16d46496376b4109b686cc029c WHIRLPOOL 650250025efbf1a8fb3ac6319eb164dfe60530626911628bd4c829a76c7994336f8080fa1b40f50ae3da22b0698ef0944fa37bb222087fde17ae14dc913efa3a
+DIST winetricks-gentoo-2012.11.24.tar.bz2 6398 SHA256 dded8c294cc5c2e71e4a5d1531ab165178cf3d2d1d890d0656368c2e499bfeb9 SHA512 59c93b73f3a7b2d11aefcde2ff66659ff1de21ad4b5f232f4b60572f3a48b15a6c49f369b1696862bf1b33fde190bf5598945e9536fb41ddec42d8def4d2be2a WHIRLPOOL 268da9e06712a678fbbcfff8eac1fca364b5e46f0a9c48a591eb88f03260b1a55f203eb2908bfe1f0a534b77c866127ff6f7049b0e43fe8abeaaa26fe55de75b
diff --git a/app-emulation/winetricks/metadata.xml b/app-emulation/winetricks/metadata.xml
new file mode 100644
index 000000000000..6cb30b92d9a2
--- /dev/null
+++ b/app-emulation/winetricks/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>wine</herd>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>np.hardass@gmail.com</email>
+ <name>NP-Hardass</name>
+ <description>Proxied co-maintainer</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">winetricks</remote-id>
+ <remote-id type="github">Winetricks/winetricks</remote-id>
+ </upstream>
+ <use>
+ <flag name="rar">Pull in <pkg>app-arch/unrar</pkg> for extraction of
+ rar-compressed game files</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/winetricks/winetricks-20150706.ebuild b/app-emulation/winetricks/winetricks-20150706.ebuild
new file mode 100644
index 000000000000..e5bd6ebf1843
--- /dev/null
+++ b/app-emulation/winetricks/winetricks-20150706.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit gnome2-utils eutils
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://github.com/Winetricks/${PN}.git"
+ inherit git-r3
+ SRC_URI=""
+else
+ SRC_URI="https://github.com/Winetricks/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+wtg=winetricks-gentoo-2012.11.24
+SRC_URI="${SRC_URI}
+ gtk? ( http://dev.gentoo.org/~tetromino/distfiles/wine/${wtg}.tar.bz2 )
+ kde? ( http://dev.gentoo.org/~tetromino/distfiles/wine/${wtg}.tar.bz2 )"
+
+DESCRIPTION="Easy way to install DLLs needed to work around problems in Wine"
+HOMEPAGE="http://winetricks.org http://wiki.winehq.org/winetricks"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+IUSE="gtk kde rar"
+
+DEPEND=""
+RDEPEND="app-arch/cabextract
+ app-arch/p7zip
+ app-arch/unzip
+ app-emulation/wine
+ net-misc/wget
+ x11-misc/xdg-utils
+ gtk? ( gnome-extra/zenity )
+ kde? ( kde-apps/kdialog )
+ rar? ( app-arch/unrar )"
+
+# Uses non-standard "Wine" category, which is provided by app-emulation/wine; #451552
+QA_DESKTOP_FILE="usr/share/applications/winetricks.desktop"
+
+# Tests require network access and run wine, which is unreliable from a portage environment
+RESTRICT="test"
+
+src_unpack() {
+ if [[ ${PV} == "99999999" ]] ; then
+ git-r3_src_unpack
+ if use gtk || use kde; then
+ unpack ${wtg}.tar.bz2
+ fi
+ else
+ default
+ fi
+}
+
+src_install() {
+ default
+ if use gtk || use kde; then
+ cd "${WORKDIR}/${wtg}" || die
+ domenu winetricks.desktop
+ insinto /usr/share/icons/hicolor/scalable/apps
+ doins wine-winetricks.svg
+ fi
+}
+
+pkg_preinst() {
+ if use gtk || use kde; then
+ gnome2_icon_savelist
+ fi
+}
+
+pkg_postinst() {
+ if use gtk || use kde; then
+ gnome2_icon_cache_update
+ fi
+}
+
+pkg_postrm() {
+ if use gtk || use kde; then
+ gnome2_icon_cache_update
+ fi
+}
diff --git a/app-emulation/winetricks/winetricks-99999999.ebuild b/app-emulation/winetricks/winetricks-99999999.ebuild
new file mode 100644
index 000000000000..e5bd6ebf1843
--- /dev/null
+++ b/app-emulation/winetricks/winetricks-99999999.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit gnome2-utils eutils
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://github.com/Winetricks/${PN}.git"
+ inherit git-r3
+ SRC_URI=""
+else
+ SRC_URI="https://github.com/Winetricks/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+wtg=winetricks-gentoo-2012.11.24
+SRC_URI="${SRC_URI}
+ gtk? ( http://dev.gentoo.org/~tetromino/distfiles/wine/${wtg}.tar.bz2 )
+ kde? ( http://dev.gentoo.org/~tetromino/distfiles/wine/${wtg}.tar.bz2 )"
+
+DESCRIPTION="Easy way to install DLLs needed to work around problems in Wine"
+HOMEPAGE="http://winetricks.org http://wiki.winehq.org/winetricks"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+IUSE="gtk kde rar"
+
+DEPEND=""
+RDEPEND="app-arch/cabextract
+ app-arch/p7zip
+ app-arch/unzip
+ app-emulation/wine
+ net-misc/wget
+ x11-misc/xdg-utils
+ gtk? ( gnome-extra/zenity )
+ kde? ( kde-apps/kdialog )
+ rar? ( app-arch/unrar )"
+
+# Uses non-standard "Wine" category, which is provided by app-emulation/wine; #451552
+QA_DESKTOP_FILE="usr/share/applications/winetricks.desktop"
+
+# Tests require network access and run wine, which is unreliable from a portage environment
+RESTRICT="test"
+
+src_unpack() {
+ if [[ ${PV} == "99999999" ]] ; then
+ git-r3_src_unpack
+ if use gtk || use kde; then
+ unpack ${wtg}.tar.bz2
+ fi
+ else
+ default
+ fi
+}
+
+src_install() {
+ default
+ if use gtk || use kde; then
+ cd "${WORKDIR}/${wtg}" || die
+ domenu winetricks.desktop
+ insinto /usr/share/icons/hicolor/scalable/apps
+ doins wine-winetricks.svg
+ fi
+}
+
+pkg_preinst() {
+ if use gtk || use kde; then
+ gnome2_icon_savelist
+ fi
+}
+
+pkg_postinst() {
+ if use gtk || use kde; then
+ gnome2_icon_cache_update
+ fi
+}
+
+pkg_postrm() {
+ if use gtk || use kde; then
+ gnome2_icon_cache_update
+ fi
+}
diff --git a/app-emulation/x48/Manifest b/app-emulation/x48/Manifest
new file mode 100644
index 000000000000..51ebcbff2b58
--- /dev/null
+++ b/app-emulation/x48/Manifest
@@ -0,0 +1 @@
+DIST x48-0.6.4.tar.bz2 227991 SHA256 dd42fb3dfde860abb758f8e6d5ccd01845bbf0dcd808b87786eec3ef7091067f SHA512 60fdba1171a02e4a5f9bcefb29fff9398fdbda50553c3d3b952fab0b4ebf87b219d4615139ca3673b1c61ff6d6559aab3e93218334aa6cdb442d4861347138ce WHIRLPOOL ff2ec2d5930d677a4cde53d8edeec564dea6fff342b2b41059424ad42314e682e412675f98aba7439eb125cf255ee841032e79226f8536e34a2ae4353aa3c2d1
diff --git a/app-emulation/x48/metadata.xml b/app-emulation/x48/metadata.xml
new file mode 100644
index 000000000000..52455208f60b
--- /dev/null
+++ b/app-emulation/x48/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>nimiux@gentoo.org</email>
+ <name>Chema Alonso</name>
+ </maintainer>
+ <longdescription lang="en">
+ The x48 package is an emulator of the Saturn Processor and the I/O of an
+ HP48 calculator.
+ </longdescription>
+ <longdescription lang="es">
+ El paquete x48 es un emulador del procesador Saturn y de la E/S de una
+ calculadora HP48.
+ </longdescription>
+ <use>
+ <flag name="readline">Enables support for libreadline</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">x48.berlios</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/x48/x48-0.6.4.ebuild b/app-emulation/x48/x48-0.6.4.ebuild
new file mode 100644
index 000000000000..17dad066fc03
--- /dev/null
+++ b/app-emulation/x48/x48-0.6.4.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools
+
+DESCRIPTION="HP48 Calculator Emulator"
+HOMEPAGE="http://x48.berlios.de/"
+SRC_URI="mirror://sourceforge/x48.berlios/${P}.tar.bz2"
+LICENSE="GPL-3"
+
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86"
+IUSE="readline"
+
+RDEPEND="x11-libs/libX11
+ x11-libs/libXext
+ readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ x11-libs/libXt"
+
+src_unpack() {
+ mkdir -p "${S}"
+ cd "${S}"
+ unpack ${A}
+}
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable readline)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ insinto /usr/share/"${PN}"/romdump
+ doins -r romdump/{README,ROMDump*}
+ dodoc AUTHORS README ChangeLog
+}
+
+pkg_postinst() {
+ elog "The X48 emulator requires an HP48 ROM image to run."
+ elog
+ elog "If you own an HP-48 calculator, you can use the ROMDump utility"
+ elog "included with this package to obtain it from your calculator."
+ elog "The instructions of how to do this are included in the package."
+ elog
+ elog "Alternatively, HP has provided the ROM images for non-commercial"
+ elog "use only."
+ elog
+ elog "Due to confusion over the legal status of these ROMs you must"
+ elog "manually download one from http://www.hpcalc.org/hp48/pc/emulators/"
+ elog
+ elog "If you do not know which one to use, try 'HP 48GX Revision R ROM.'"
+ elog
+ elog "Once you have a ROM, you will need to install it by running:"
+ elog
+ elog "x48 -rom gxrom-r"
+ elog
+ elog "You will only have to do this the first time you run X48. The"
+ elog "ROM will be stored in ~/.hp48/rom for future runs."
+}
diff --git a/app-emulation/xe-guest-utilities/Manifest b/app-emulation/xe-guest-utilities/Manifest
new file mode 100644
index 000000000000..b83eaa54b7b3
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/Manifest
@@ -0,0 +1,3 @@
+DIST xe-guest-utilities-5.6.0-595.src.rpm 454569 SHA256 88082b9703b7af5eda345b471bef9f2a8a4bdc0ab6acc7e6b6a623a9d03e4516 SHA512 967f7708f074f4382c95a823e24dcf07c677e44d75a97e57078d63284584c85d2acf24e0a4b58ec2f26ba034ccaa1baad5793391f736fa4d72c04f7511bd78aa WHIRLPOOL cac2562b598ca49dfacd5146197f293b14fed56038275e1af1253dd299dab6d67dd413fda17de6fa872657fc49d1b1bdfdddd976d5d78df50db61d1f4b94e752
+DIST xe-guest-utilities-6.1.0-1033.src.rpm 554621 SHA256 a9b210dc8a7e9a2efc13bc2db3459242dba509df1b5468e7fa48ac3fe801d594 SHA512 65ab85974fb5e73619aa3bac22c861cf989d6256e4f856da3c14767a0e8fe8f1c34713db32166c6f901c589e61f2fcc3c285bd8eded4925daa829e4adb07e9e2 WHIRLPOOL 6a4af1bd3c50650a71d28c8f6b00231da30c6db2bd424485ae0cba5edf51b22ef78890f40f34c2bb85e6597feca11cc7a858415e69eb090ce779d275949bd45d
+DIST xe-guest-utilities-6.2.0-1120.src.rpm 566881 SHA256 8aabd8770a69684b9f5ab601f7e2b204763c3ab2c71f1e9c60a5374ebdad11e1 SHA512 b945b3bf8175816b41b3a07a7dd8f0d9d2fdb1a7144448a5bb7fb4b6729736c67cea88fd45031df41abdd99416addb17fa1ee9cfe1fc76acf610cde3b3213880 WHIRLPOOL 80b2612d4db43ef6c43282b283eb9f8cb74517e02f1473e93bb2a62e02c65adfae09459805aa98577e8548727d1adb5b43d1f30d7280e178cd713e994a67a7a3
diff --git a/app-emulation/xe-guest-utilities/files/xe-daemon.initd b/app-emulation/xe-guest-utilities/files/xe-daemon.initd
new file mode 100644
index 000000000000..0ce568dbf396
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/files/xe-daemon.initd
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+start() {
+ einfo "Detecting Linux distribution version"
+ /usr/sbin/xe-linux-distribution /var/cache/xe-linux-distribution
+
+ ebegin "Starting xe daemon"
+ start-stop-daemon --start --exec /usr/sbin/xe-daemon \
+ --pidfile /var/run/xe-daemon.pid \
+ --background \
+ -- -p /var/run/xe-daemon.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping xe daemon"
+ start-stop-daemon --stop --exec /usr/sbin/xe-daemon \
+ --pidfile /var/run/xe-daemon.pid
+ eend $?
+}
diff --git a/app-emulation/xe-guest-utilities/files/xe-guest-utilities-5.6.100_p651-gentoo.patch b/app-emulation/xe-guest-utilities/files/xe-guest-utilities-5.6.100_p651-gentoo.patch
new file mode 100644
index 000000000000..ee9b86e91396
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/files/xe-guest-utilities-5.6.100_p651-gentoo.patch
@@ -0,0 +1,35 @@
+--- usr/sbin/xe-linux-distribution.orig 2011-04-18 10:56:30.000000000 -0500
++++ usr/sbin/xe-linux-distribution 2013-12-31 01:35:51.995831278 -0600
+@@ -249,6 +249,24 @@
+ write_to_output "${distro}" "${major}" "${minor}" "${description}"
+ }
+
++identify_gentoo()
++{
++ gentoo_release="$1"
++ if [ ! -e "${gentoo_release}" ] ; then
++ return 1
++ fi
++ distro="gentoo"
++ eval $(cat ${gentoo_release} | awk '{ print "release=" $5 }' )
++ if [ -z "${release}" ] ; then
++ return 1
++ fi
++ eval $(echo $release | awk -F. -- '{ print "major=" $1 ; print "minor=" $2 }' )
++ if [ -z "${major}" -o -z "$minor" ] ; then
++ return 1
++ fi
++ write_to_output "${distro}" "${major}" "${minor}" "${distro}"
++}
++
+ if [ $# -eq 1 ] ; then
+ exec 1>"$1"
+ fi
+@@ -258,6 +276,7 @@
+ identify_sles /etc/SuSE-release && exit 0
+ identify_lsb lsb_release && exit 0
+ identify_debian /etc/debian_version && exit 0
++ identify_gentoo /etc/gentoo-release && exit 0
+
+ if [ $# -eq 1 ] ; then
+ rm -f "$1"
diff --git a/app-emulation/xe-guest-utilities/files/xe-guest-utilities-5.6.100_p651-update-guest-attrs.patch b/app-emulation/xe-guest-utilities/files/xe-guest-utilities-5.6.100_p651-update-guest-attrs.patch
new file mode 100644
index 000000000000..c60994effa65
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/files/xe-guest-utilities-5.6.100_p651-update-guest-attrs.patch
@@ -0,0 +1,11 @@
+--- usr/sbin/xe-update-guest-attrs.orig 2011-04-18 10:56:30.000000000 -0500
++++ usr/sbin/xe-update-guest-attrs 2013-12-31 04:34:57.750083257 -0600
+@@ -172,7 +172,7 @@
+ # collisions:0 txqueuelen:0
+ # RX bytes:3604609 (3.4 MiB) TX bytes:3604609 (3.4 MiB)
+
+-eval $(/sbin/ifconfig | \
++eval $(/bin/ifconfig | \
+ sed -n -e '/^[0-9a-z][0-9a-z]*\:/,/^$/d' \
+ -e 's/^\([0-9a-z][0-9a-z]*\) .*/ifs="\$ifs \1"; current="\1"; /gp;' \
+ -e 's/ *inet addr:\('$IPADDR_RE'\) .*/eval inet_\${current}="\1"; /gp;')
diff --git a/app-emulation/xe-guest-utilities/files/xe-guest-utilities-6.2.0_p1120-Guest-Attributes.patch b/app-emulation/xe-guest-utilities/files/xe-guest-utilities-6.2.0_p1120-Guest-Attributes.patch
new file mode 100644
index 000000000000..d431cdfcf999
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/files/xe-guest-utilities-6.2.0_p1120-Guest-Attributes.patch
@@ -0,0 +1,127 @@
+--- usr/sbin/xe-update-guest-attrs.orig 2013-06-14 07:57:18.000000000 -0500
++++ usr/sbin/xe-update-guest-attrs 2014-04-19 13:38:14.627477193 -0500
+@@ -1,6 +1,7 @@
+ #!/bin/sh
+
+ # Copyright (C) 2009 Citrix Systems Inc.
++# Copyright (C) 2014 Christopher J. Camisa
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+@@ -51,10 +52,10 @@
+
+ # parse command line opts
+
+-MEMORY_MODE=0 # do not update memory stats
+-while [ $# -ge 1 ] ; do
++MEMORY_MODE=0 # do not update memory stats
++while [ $# -ge 1 ] ; do
+ if [ "$1" = "--memory" ] ; then
+- MEMORY_MODE=1 # update only memory stats
++ MEMORY_MODE=1 # update only memory stats
+ fi
+ shift
+ done
+@@ -71,12 +72,12 @@
+ fi
+ else
+ # cache does not exist
+- if [ -e $cache ] ; then
++ if [ -e $cache ] ; then
+ # something (directory?) in its way
+ rm -rf $cache
+ fi
+ fi
+-
++
+ # try to write and update cache if successful
+ if $XENSTORE write "$key" "$newval" ; then
+ mkdir -p $(dirname "$cache")
+@@ -119,8 +120,8 @@
+ xenstore_list_interfaces_cached() {
+ topdir=$XS_CACHE/attr
+ if [ -d $topdir ] ; then
+- cd $topdir
+- for dir in * ; do
++ cd $topdir
++ for dir in * ; do
+ [ -f $dir/ip ] && echo $dir
+ done
+ fi
+@@ -131,7 +132,7 @@
+ eval $(cat /proc/meminfo | \
+ sed -n -e 's/MemTotal\: *\([0-9]*\)[^$]*/memtotal=\1/gp;' \
+ -e 's/MemFree\: *\([0-9]*\)[^$]*/memfree=\1/gp;')
+-
++
+ xenstore_write_cached "data/meminfo_total" "${memtotal}"
+ xenstore_write_cached "data/meminfo_free" "${memfree}"
+ fi
+@@ -140,17 +141,17 @@
+
+ # e.g.
+ # $ ip addr show
+-# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
++# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
+ # link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
+ # inet 127.0.0.1/8 scope host lo
+-# inet6 ::1/128 scope host
++# inet6 ::1/128 scope host
+ # valid_lft forever preferred_lft forever
+ # 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
+ # link/ether 00:13:20:95:e8:74 brd ff:ff:ff:ff:ff:ff
+ # inet 172.31.0.57/20 brd 172.31.15.255 scope global eth0
+-# inet6 fe80::213:20ff:fe95:e874/64 scope link
++# inet6 fe80::213:20ff:fe95:e874/64 scope link
+ # valid_lft forever preferred_lft forever
+-# 3: sit0: <NOARP> mtu 1480 qdisc noop
++# 3: sit0: <NOARP> mtu 1480 qdisc noop
+ # link/sit 0.0.0.0 brd 0.0.0.0
+
+ #eval $(ip addr show | \
+@@ -158,26 +159,26 @@
+ # -e 's/^[[:space:]]\{4\}inet \('${IPADDR_RE}'\)\/.*/eval inet_\${current}="\1"; /gp;')
+
+ # e.g.
+-# eth0 Link encap:Ethernet HWaddr 00:13:20:95:E8:74
++# eth0 Link encap:Ethernet HWaddr 00:13:20:95:E8:74
+ # inet addr:172.31.0.57 Bcast:172.31.15.255 Mask:255.255.240.0
+ # inet6 addr: fe80::213:20ff:fe95:e874/64 Scope:Link
+ # UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
+ # RX packets:98001128 errors:0 dropped:0 overruns:0 frame:0
+ # TX packets:87728920 errors:0 dropped:0 overruns:0 carrier:0
+-# collisions:0 txqueuelen:1000
++# collisions:0 txqueuelen:1000
+ # RX bytes:35864034092 (33.4 GiB) TX bytes:27544025180 (25.6 GiB)
+-# Interrupt:177
+-#
+-# lo Link encap:Local Loopback
++# Interrupt:177
++#
++# lo Link encap:Local Loopback
+ # inet addr:127.0.0.1 Mask:255.0.0.0
+ # inet6 addr: ::1/128 Scope:Host
+ # UP LOOPBACK RUNNING MTU:16436 Metric:1
+ # RX packets:32928 errors:0 dropped:0 overruns:0 frame:0
+ # TX packets:32928 errors:0 dropped:0 overruns:0 carrier:0
+-# collisions:0 txqueuelen:0
++# collisions:0 txqueuelen:0
+ # RX bytes:3604609 (3.4 MiB) TX bytes:3604609 (3.4 MiB)
+
+-ifs=`/sbin/ifconfig | sed -n -e 's/^\([a-z0-9]\+\).*/name \1/p' \
++ifs=`/bin/ifconfig | sed -n -e 's/^\([a-z0-9]\+\).*/name \1/p' \
+ -e 's/.*inet addr:\('$IPADDR_RE'\) .*/ipv4 \1/p' \
+ -e 's+.*inet6 addr: \('$IPADDR6_RE'\)/.*+ipv6 \1+p' | \
+ while read tag value; do
+@@ -225,9 +226,9 @@
+ # build time addons
+ xenstore_write_cached "attr/PVAddons/MajorVersion" "6"
+ xenstore_write_cached "attr/PVAddons/MinorVersion" "2"
+-xenstore_write_cached "attr/PVAddons/MicroVersion" "0"
++xenstore_write_cached "attr/PVAddons/MicroVersion" "0"
+ xenstore_write_cached "attr/PVAddons/BuildVersion" "70442"
+-xenstore_write_cached "attr/PVAddons/Installed" "1"
++xenstore_write_cached "attr/PVAddons/Installed" "1"
+
+ # update xenstore if necessary
+ if [ $XENSTORE_UPDATED -eq 1 ] ; then
diff --git a/app-emulation/xe-guest-utilities/files/xe-guest-utilities-6.2.0_p1120-Linux-Distribution.patch b/app-emulation/xe-guest-utilities/files/xe-guest-utilities-6.2.0_p1120-Linux-Distribution.patch
new file mode 100644
index 000000000000..45b0bbc56c69
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/files/xe-guest-utilities-6.2.0_p1120-Linux-Distribution.patch
@@ -0,0 +1,77 @@
+--- usr/sbin/xe-linux-distribution.orig 2013-06-14 07:57:18.000000000 -0500
++++ usr/sbin/xe-linux-distribution 2014-04-19 13:54:13.270477193 -0500
+@@ -1,6 +1,7 @@
+ #! /bin/sh
+
+ # Copyright (C) 2009 Citrix Systems Inc.
++# Copyright (C) 2014 Christopher J. Camisa
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+@@ -68,7 +69,7 @@
+ eval $(awk -F. '/^[0-9]*\.[0-9]*/ \
+ { print "major="$1 ; print "minor="$2 ; exit 0 }' \
+ "${debian_version}")
+-
++
+ if [ -z "${major}" ] && [ -z "${minor}" ] && ! grep -q /sid "${debian_version}" ; then
+ return 1
+ fi
+@@ -118,7 +119,7 @@
+ # Enterprise Linux Enterprise Linux Server release 5 (Carthage)
+ # Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
+ # Oracle Linux Server release 5.6
+-
++
+ if [ ! -f "${redhat_release}" ] ; then
+ return 1
+ fi
+@@ -236,7 +237,7 @@
+ if [ ! -x "${lsb_release}" ] ; then
+ return 1
+ fi
+-
++
+ distro=$(${lsb_release} --short --id | tr 'A-Z' 'a-z')
+ description=$(${lsb_release} --short --description | sed -e 's/^"\(.*\)"$/\1/g')
+ release=$(${lsb_release} --short --release)
+@@ -254,6 +255,31 @@
+ write_to_output "${distro}" "${major}" "${minor}" "${description}"
+ }
+
++identify_gentoo()
++{
++ gentoo_release="$1"
++
++ if [ ! -e "${gentoo_release}" ] ; then
++ return 1
++ fi
++
++ distro="gentoo"
++
++ eval $(cat ${gentoo_release} | awk '{ print "release=" $5 }' )
++
++ if [ -z "${release}" ] ; then
++ return 1
++ fi
++
++ eval $(echo $release | awk -F. -- '{ print "major=" $1 ; print "minor=" $2 }' )
++
++ if [ -z "${major}" -o -z "$minor" ] ; then
++ return 1
++ fi
++
++ write_to_output "${distro}" "${major}" "${minor}" "${distro}"
++}
++
+ if [ $# -eq 1 ] ; then
+ exec 1>"$1"
+ fi
+@@ -265,6 +291,7 @@
+ identify_sles /etc/SuSE-release && exit 0
+ identify_lsb lsb_release && exit 0
+ identify_debian /etc/debian_version && exit 0
++ identify_gentoo /etc/gentoo-release && exit 0
+
+ if [ $# -eq 1 ] ; then
+ rm -f "$1"
diff --git a/app-emulation/xe-guest-utilities/metadata.xml b/app-emulation/xe-guest-utilities/metadata.xml
new file mode 100644
index 000000000000..b3d0d6c19577
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>openstack</herd>
+<herd>virtualization</herd>
+<herd>xen</herd>
+<maintainer>
+ <email>chris@camisa.org</email>
+ <name>Christopher J. Camisa</name>
+ <description>proxy maintainer</description>
+</maintainer>
+<maintainer>
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+<longdescription>XenServer Virtual Machine Tools</longdescription>
+<use>
+ <flag name="xenstore">Use xenstore binaries bundled by Citrix instead of building app-emulation/xen-tools</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/xe-guest-utilities/xe-guest-utilities-5.6.0_p595.ebuild b/app-emulation/xe-guest-utilities/xe-guest-utilities-5.6.0_p595.ebuild
new file mode 100644
index 000000000000..cf272c4da64f
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/xe-guest-utilities-5.6.0_p595.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils rpm linux-info
+DESCRIPTION="XenServer Virtual Machine Tools"
+HOMEPAGE="http://www.citrix.com/"
+PV_BASE=${PV/_*}
+PV_FULL=${PV/_p/-}
+SRC_URI="http://updates.vmd.citrix.com/XenServer/${PV_BASE}/rhel4x/SRPMS/xe-guest-utilities-${PV_FULL}.src.rpm"
+LICENSE="LGPL-3 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="xenstore"
+DEPEND="app-arch/rpm2targz"
+RDEPEND="
+ !xenstore? ( app-emulation/xen-tools )
+ xenstore? ( !app-emulation/xen-tools )"
+S=${WORKDIR}
+CONFIG_CHECK="~XEN_COMPAT_XENFS ~XENFS"
+QA_PREBUILT="usr/bin/xenstore* usr/bin/xeninfo"
+
+src_unpack() {
+ rpm_src_unpack ${A}
+ # Upstream includes xenstore-sources.tar.bz2
+ # but it is NOT the complete source :-(
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-5.6.100_p651-gentoo.patch
+ epatch "${FILESDIR}"/${PN}-5.6.100_p651-update-guest-attrs.patch
+}
+
+src_install() {
+ newinitd "${FILESDIR}/xe-daemon.initd" xe-daemon
+ dosbin xe-daemon
+ dosbin xe-linux-distribution
+ dosbin xe-update-guest-attrs
+ insinto /lib/udev/rules.d
+ newins xen-vcpu-hotplug.rules 10-xen-vcpu-hotplug.rules
+
+ if use xenstore; then
+ dobin usr/bin/xeninfo
+ dobin usr/bin/xenstore
+ dobin usr/bin/xenstore-*
+ fi
+}
+
+pkg_postinst() {
+ if [ ! -e /etc/runlevels/boot/xe-daemon ]; then
+ elog "To start the xe-daemon automatically by default"
+ elog "you should add it to the boot runlevel :"
+ elog "'rc-update add xe-daemon boot'"
+ elog
+ fi
+}
diff --git a/app-emulation/xe-guest-utilities/xe-guest-utilities-6.1.0_p1033.ebuild b/app-emulation/xe-guest-utilities/xe-guest-utilities-6.1.0_p1033.ebuild
new file mode 100644
index 000000000000..21d0af88ef6e
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/xe-guest-utilities-6.1.0_p1033.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils rpm linux-info
+DESCRIPTION="XenServer Virtual Machine Tools"
+HOMEPAGE="http://www.citrix.com/"
+PV_BASE=${PV/_*}
+PV_FULL=${PV/_p/-}
+SRC_URI="http://updates.vmd.citrix.com/XenServer/${PV_BASE}/rhel4x/SRPMS/xe-guest-utilities-${PV_FULL}.src.rpm"
+LICENSE="LGPL-3 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="xenstore"
+DEPEND="app-arch/rpm2targz"
+RDEPEND="
+ !xenstore? ( app-emulation/xen-tools )
+ xenstore? ( !app-emulation/xen-tools )"
+S=${WORKDIR}
+CONFIG_CHECK="~XEN_COMPAT_XENFS ~XENFS"
+QA_PREBUILT="usr/bin/xenstore* usr/bin/xeninfo"
+
+src_unpack() {
+ rpm_src_unpack ${A}
+ # Upstream includes xenstore-sources.tar.bz2
+ # but it is NOT the complete source :-(
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-6.2.0_p1120-Guest-Attributes.patch
+ epatch "${FILESDIR}"/${PN}-6.2.0_p1120-Linux-Distribution.patch
+}
+
+src_install() {
+ newinitd "${FILESDIR}/xe-daemon.initd" xe-daemon
+ dosbin xe-daemon
+ dosbin xe-linux-distribution
+ dosbin xe-update-guest-attrs
+ insinto /lib/udev/rules.d
+ newins xen-vcpu-hotplug.rules 10-xen-vcpu-hotplug.rules
+
+ if use xenstore; then
+ dobin usr/bin/xeninfo
+ dobin usr/bin/xenstore
+ dobin usr/bin/xenstore-*
+ fi
+}
+
+pkg_postinst() {
+ if [ ! -e /etc/runlevels/boot/xe-daemon ]; then
+ elog "To start the xe-daemon automatically by default"
+ elog "you should add it to the boot runlevel :"
+ elog "'rc-update add xe-daemon boot'"
+ elog
+ fi
+}
diff --git a/app-emulation/xe-guest-utilities/xe-guest-utilities-6.2.0_p1120.ebuild b/app-emulation/xe-guest-utilities/xe-guest-utilities-6.2.0_p1120.ebuild
new file mode 100644
index 000000000000..21d0af88ef6e
--- /dev/null
+++ b/app-emulation/xe-guest-utilities/xe-guest-utilities-6.2.0_p1120.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils rpm linux-info
+DESCRIPTION="XenServer Virtual Machine Tools"
+HOMEPAGE="http://www.citrix.com/"
+PV_BASE=${PV/_*}
+PV_FULL=${PV/_p/-}
+SRC_URI="http://updates.vmd.citrix.com/XenServer/${PV_BASE}/rhel4x/SRPMS/xe-guest-utilities-${PV_FULL}.src.rpm"
+LICENSE="LGPL-3 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="xenstore"
+DEPEND="app-arch/rpm2targz"
+RDEPEND="
+ !xenstore? ( app-emulation/xen-tools )
+ xenstore? ( !app-emulation/xen-tools )"
+S=${WORKDIR}
+CONFIG_CHECK="~XEN_COMPAT_XENFS ~XENFS"
+QA_PREBUILT="usr/bin/xenstore* usr/bin/xeninfo"
+
+src_unpack() {
+ rpm_src_unpack ${A}
+ # Upstream includes xenstore-sources.tar.bz2
+ # but it is NOT the complete source :-(
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-6.2.0_p1120-Guest-Attributes.patch
+ epatch "${FILESDIR}"/${PN}-6.2.0_p1120-Linux-Distribution.patch
+}
+
+src_install() {
+ newinitd "${FILESDIR}/xe-daemon.initd" xe-daemon
+ dosbin xe-daemon
+ dosbin xe-linux-distribution
+ dosbin xe-update-guest-attrs
+ insinto /lib/udev/rules.d
+ newins xen-vcpu-hotplug.rules 10-xen-vcpu-hotplug.rules
+
+ if use xenstore; then
+ dobin usr/bin/xeninfo
+ dobin usr/bin/xenstore
+ dobin usr/bin/xenstore-*
+ fi
+}
+
+pkg_postinst() {
+ if [ ! -e /etc/runlevels/boot/xe-daemon ]; then
+ elog "To start the xe-daemon automatically by default"
+ elog "you should add it to the boot runlevel :"
+ elog "'rc-update add xe-daemon boot'"
+ elog
+ fi
+}
diff --git a/app-emulation/xen-pvgrub/Manifest b/app-emulation/xen-pvgrub/Manifest
new file mode 100644
index 000000000000..28309594b4ae
--- /dev/null
+++ b/app-emulation/xen-pvgrub/Manifest
@@ -0,0 +1,8 @@
+DIST grub-0.97.tar.gz 971783 SHA256 4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b SHA512 c2bc9ffc8583aeae71cee9ddcc4418969768d4e3764d47307da54f93981c0109fb07d84b061b3a3628bd00ba4d14a54742bc04848110eb3ae8ca25dbfbaabadb WHIRLPOOL 0ad7f5dc035e2a3ad5fd29b6388f06fd12a8cc694117b4cbd42b5302433aa522db23566222d35219fe17fb95edb5090553156198507f70208eda5d858fd52dd5
+DIST lwip-1.3.0.tar.gz 398933 SHA256 772e4d550e07826665ed0528c071dd5404ef7dbe1825a38c8adbc2a00bca948f SHA512 1465b58279af1647f909450e394fe002ca165f0ff4a0254bfa9fe0e64316f50facdde2729d79a4e632565b4500cf4d6c74192ac0dd3bc9fe09129bbd67ba089d WHIRLPOOL 63bdd9eb70f168ba2006a8f4bbe166b68528abe8364b23cdc1d468ccc4b137bb3447bf90695920f016e09d53d3b93ccf6e3697b3c46840f00b794789cb424acc
+DIST newlib-1.16.0.tar.gz 12024353 SHA256 db426394965c48c1d29023e1cc6d965ea6b9a9035d8a849be2750ca4659a3d07 SHA512 40eb96bbc6736a16b6399e0cdb73e853d0d90b685c967e77899183446664d64570277a633fdafdefc351b46ce210a99115769a1d9f47ac749d7e82837d4d1ac3 WHIRLPOOL 47f7afd525f482d79d9e964f0e75ee8a77e59551bd19cd94f9b95ac3af9406afa381c9d8d224f76eb568441ab613b2b194f8e5be50aa222f9ed2d9b9761829db
+DIST pciutils-2.2.9.tar.bz2 212265 SHA256 f60ae61cfbd5da1d849d0beaa21f593c38dac9359f0b3ddc612f447408265b24 SHA512 2b3d98d027e46d8c08037366dde6f0781ca03c610ef2b380984639e4ef39899ed8d8b8e4cd9c9dc54df101279b95879bd66bfd4d04ad07fef41e847ea7ae32b5 WHIRLPOOL ce801947fcf7ba0b56710029f25e746d3e03a80699af9d3570efcd417b12b546264f286b2e78b1402cca766c08e35bdd0ff0a692ab4ad419295f00bcfe91130e
+DIST polarssl-1.1.4-gpl.tgz 611340 SHA256 2d29fd04a0d0ba29dae6bd29fb418944c08d3916665dcca74afb297ef37584b6 SHA512 88da614e4d3f4409c4fd3bb3e44c7587ba051e3fed4e33d526069a67e8180212e1ea22da984656f50e290049f60ddca65383e5983c0f8884f648d71f698303ad WHIRLPOOL 39448c00dda142a836a78381b446c7b586272a44d8afc867a7ea702228f105bb2adffe757bd6c23af090cff64ef32e7af0c373dccc5145ff4c11552cf3f28383
+DIST xen-4.2.5.tar.gz 15671925 SHA256 3cf440866315e8085050eb0586f0447b6b47a08dbed6a72226bf5ed5d89ec567 SHA512 42c0fc241952fc55fc44480fb6752b004b54ae40e946159ec047adf229b65cbfbd810271d01b064ad8fdbddb73c640dcdcb6bc19f91e8968829889c129920dac WHIRLPOOL 762a91c0111892b33e6bd3e7f7714709b04697ad7c2b0919fef6cc9570a343a77fd5a2b82833e75dac9d12d4e41acdcf0743b0d593595910ddd326f5cd721368
+DIST xen-4.5.1.tar.gz 18410400 SHA256 668c11d4fca67ac44329e369f810356eacd37b28d28fb96e66aac77f3c5e1371 SHA512 9436243e26bc64bc836a179abdc3a6b1b6fa9d3f2170453092c18be71fa62e18cd4465a9154c0f28a7ac8d69d08361ba1defef240a51197f058c012c3855ba04 WHIRLPOOL 71d8559f86683dd9fb3eb09d3f602de227f281fbd3c8cc258bfdb67c425d9e7c4d21cb0284c123e4263262c1b821fea6d28109861ce60d627f6426d352808d99
+DIST zlib-1.2.3.tar.gz 496597 SHA256 1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e SHA512 021b958fcd0d346c4ba761bcf0cc40f3522de6186cf5a0a6ea34a70504ce9622b1c2626fce40675bc8282cf5f5ade18473656abc38050f72f5d6480507a2106e WHIRLPOOL 8fd7010faf6a48a9c7ff4bcfe3ce4fe9061eb541259e0a2d0def214e8c4becf2b22e8d6f96f65ca827abffeaa9d96e95ed2402844f99835f7b079fc9f3e84276
diff --git a/app-emulation/xen-pvgrub/files/newlib-implicits.patch b/app-emulation/xen-pvgrub/files/newlib-implicits.patch
new file mode 100644
index 000000000000..73c04931b31d
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/newlib-implicits.patch
@@ -0,0 +1,149 @@
+diff -ur newlib-1.16.0.orig/newlib/libc/stdlib/wcstoull.c newlib-1.16.0/newlib/libc/stdlib/wcstoull.c
+--- newlib/libc/stdlib/wcstoull.c 2007-07-07 04:03:28.000000000 +0800
++++ newlib/libc/stdlib/wcstoull.c 2012-12-02 14:19:40.905136553 +0800
+@@ -124,7 +124,7 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <reent.h>
+-
++#include <wchar.h>
+ #ifndef _REENT_ONLY
+
+ unsigned long long
+diff -ur newlib-1.16.0.orig/newlib/doc/makedoc.c
+newlib-1.16.0/newlib/doc/makedoc.c
+--- newlib/doc/makedoc.c 2007-01-03 01:59:59.000000000 +0900
++++ newlib/doc/makedoc.c 2012-12-02 16:53:42.700289294 +0800
+@@ -39,7 +39,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <ctype.h>
+-
++#include <string.h>
+ #define DEF_SIZE 5000
+ #define STACK 50
+
+diff -ur newlib-1.16.0.orig/newlib/libc/reent/lseek64r.c newlib-1.16.0/newlib/libc/reent/lseek64r.c
+--- newlib/libc/reent/lseek64r.c 2003-06-04 03:48:07.000000000 +0800
++++ newlib/libc/reent/lseek64r.c 2012-12-02 18:29:45.435760985 +0800
+@@ -1,8 +1,8 @@
+ /* Reentrant versions of lseek system call. */
+
+-#include <reent.h>
++#include "../include/reent.h"
+ #include <unistd.h>
+-#include <_syslist.h>
++#include "../include/_syslist.h"
+
+ /* Some targets provides their own versions of this functions. Those
+ targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
+diff -ur newlib-1.16.0.orig/newlib/libc/stdio64/fseeko64.c newlib-1.16.0/newlib/libc/stdio64/fseeko64.c
+--- newlib/libc/stdio64/fseeko64.c 2007-07-14 04:37:53.000000000 +0800
++++ newlib/libc/stdio64/fseeko64.c 2012-12-02 18:26:29.955778906 +0800
+@@ -119,7 +119,7 @@
+ ptr->_errno = EOVERFLOW;
+ return EOF;
+ }
+- return (_off64_t) _fseeko_r (ptr, fp, offset, whence);
++ return (_off64_t) _fseeko64_r (ptr, fp, offset, whence);
+ }
+
+ /* Make sure stdio is set up. */
+
+diff -ur newlib-1.16.0.orig/newlib/libc/reent/fstat64r.c newlib-1.16.0/newlib/libc/reent/fstat64r.c
+--- newlib/libc/reent/fstat64r.c 2012-12-03 13:17:26.569703981 +0800
++++ newlib/libc/reent/fstat64r.c 2003-06-04 03:48:07.000000000 +0800
+@@ -1,10 +1,10 @@
+ /* Reentrant versions of fstat system call. This implementation just
+ calls the fstat system call. */
+
+-#include <reent.h>
++#include "../include/reent.h">
+ #include <unistd.h>
+ #include <sys/stat.h>
+-#include <_syslist.h>
++#include "../include/_syslist.h"
+
+ #ifdef __LARGE64_FILES
+
+diff -ur newlib-1.16.0.orig/libgloss/i386/cygmon-gmon.c newlib-1.16.0/libgloss/i386/cygmon-gmon.c
+--- libgloss/i386/cygmon-gmon.c 2002-10-26 03:18:46.000000000 +0800
++++ libgloss/i386/cygmon-gmon.c 2012-12-03 14:38:41.454257066 +0800
+@@ -68,6 +68,9 @@
+
+ #include "cygmon-gmon.h"
+
++#include <unistd.h>
++#include <stdlib.h>
++#include <strings.h>
+ /*
+ * froms is actually a bunch of unsigned shorts indexing tos
+ */
+@@ -78,6 +78,8 @@
+ static char *s_lowpc = 0;
+ static char *s_highpc = 0;
+ static unsigned long s_textsize = 0;
++extern void profil_write(int, char*, int);
++extern int moncontrol (int);
+
+ static int ssiz;
+ static char *sbuf;
+diff -ur newlib-1.16.0.orig/newlib/libc/include/_syslist.h
+newlib-1.16.0/newlib/libc/include/_syslist.h
+--- newlib/libc/include/_syslist.h 2005-08-23 05:13:35.000000000 +0800
++++ newlib/libc/include/_syslist.h 2012-12-03 17:20:03.092369483 +0800
+@@ -2,6 +2,7 @@
+ and only provide C names, so that we end up in violation of ANSI */
+ #ifndef __SYSLIST_H
+ #define __SYSLIST_H
++#include <sys/types.h>
+
+ #ifdef MISSING_SYSCALL_NAMES
+ #define _close close
+
+#diff -ur newlib-1.16.0.orig/newlib/libc/Makefile.in newlib-1.16.0/newlib/libc/Makefile.in
+#--- newlib/libc/Makefile.in 2007-05-25 01:33:30.000000000 +0800
+#+++ newlib/libc/Makefile.in 2012-12-03 21:52:05.621873084 +0800
+diff -ur newlib-1.16.0.orig/newlib/libc/stdio64/ftello64.c newlib-1.16.0/newlib/libc/stdio64/ftello64.c
+--- newlib/libc/stdio64/ftello64.c 2007-07-14 04:37:53.000000000 +0800
++++ newlib/libc/stdio64/ftello64.c 2012-12-04 18:34:46.491509484 +0800
+@@ -93,7 +93,7 @@
+
+ /* Only do 64-bit tell on large file. */
+ if (!(fp->_flags & __SL64))
+- return (_off64_t) _ftello_r (ptr, fp);
++ return (_off64_t) _ftello64_r (ptr, fp);
+
+ /* Ensure stdio is set up. */
+
+diff -ur newlib-1.16.0.orig/newlib/libc/reent/open64r.c newlib-1.16.0/newlib/libc/reent/open64r.c
+--- newlib/libc/reent/open64r.c 2002-08-27 02:56:06.000000000 +0800
++++ newlib/libc/reent/open64r.c 2012-12-04 20:06:10.044006769 +0800
+@@ -1,8 +1,8 @@
+ /* Reentrant versions of open system call. */
+
+-#include <reent.h>
++#include "../include/reent.h">
+ #include <unistd.h>
+-#include <fcntl.h>
++#include <sys/_default_fcntl.h>
+ #include <_syslist.h>
+
+ #ifdef __LARGE64_FILES
+diff -ur newlib-1.16.0.orig/newlib/libc/reent/signalr.c newlib-1.16.0/newlib/libc/reent/signalr.c
+--- newlib/libc/reent/signalr.c 2012-12-05 07:33:25.623393126 +0800
++++ newlib/libc/reent/signalr.c 2012-12-05 07:34:03.943389613 +0800
+@@ -1,10 +1,10 @@
+ /* Reentrant versions of syscalls need to support signal/raise.
+ These implementations just call the usual system calls. */
+
+-#include <reent.h>
++#include "../include/reent.h"
+ #include <signal.h>
+ #include <unistd.h>
+-#include <_syslist.h>
++#include "../include/_syslist.h"
+
+ /* Some targets provides their own versions of these functions. Those
+ targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
+
diff --git a/app-emulation/xen-pvgrub/files/xen-4-fix_dotconfig-gcc.patch b/app-emulation/xen-pvgrub/files/xen-4-fix_dotconfig-gcc.patch
new file mode 100644
index 000000000000..4e08a30f323e
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4-fix_dotconfig-gcc.patch
@@ -0,0 +1,245 @@
+# Fix gcc-4.6
+diff -ur xen-4.2.0.orig/extras/mini-os/minios.mk xen-4.2.0/extras/mini-os/minios.mk
+--- extras/mini-os/minios.mk 2012-09-17 18:21:17.000000000 +0800
++++ extras/mini-os/minios.mk 2012-12-05 14:01:10.653260260 +0800
+@@ -6,7 +6,7 @@
+
+ # Define some default flags.
+ # NB. '-Wcast-qual' is nasty, so I omitted it.
+-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
++DEF_CFLAGS += -fno-builtin -Wall -Wredundant-decls -Wno-format -Wno-redundant-decls
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+diff -ur xen-4.2.0.orig/tools/libxc/Makefile xen-4.2.0/tools/libxc/Makefile
+--- tools/libxc/Makefile 2012-09-17 18:21:18.000000000 +0800
++++ tools/libxc/Makefile 2012-12-05 14:01:10.653260260 +0800
+@@ -73,7 +73,7 @@
+
+ -include $(XEN_TARGET_ARCH)/Makefile
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ CFLAGS += -I. $(CFLAGS_xeninclude)
+
+ # Needed for posix_fadvise64() in xc_linux.c
+# Drop .config
+diff -ur xen-4.2.0.orig/Config.mk xen-4.2.0/Config.mk
+--- Config.mk 2012-09-17 18:23:12.000000000 +0800
++++ Config.mk 2012-12-05 14:01:10.641260261 +0800
+@@ -7,7 +7,6 @@ Drop .config
+ # fallback for older make
+ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
+--include $(XEN_ROOT)/.config
+
+ # A debug build of Xen and tools?
+ debug ?= n
+@@ -24,7 +24,7 @@
+
+ # Tools to run on system hosting the build
+ HOSTCC = gcc
+-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS = -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
+
+ DISTDIR ?= $(XEN_ROOT)/dist
+@@ -156,7 +156,7 @@
+
+ CFLAGS += -std=gnu99
+
+-CFLAGS += -Wall -Wstrict-prototypes
++CFLAGS += -Wstrict-prototypes
+
+ # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
+ # and is over-zealous with the printf format lint
+diff -ur xen-4.2.1.orig/tools/blktap2/drivers/Makefile xen-4.2.1/tools/blktap2/drivers/Makefile
+--- tools/blktap2/drivers/Makefile 2012-12-17 23:00:11.000000000 +0800
++++ tools/blktap2/drivers/Makefile 2013-01-30 12:31:43.539941099 +0800
+@@ -9,7 +9,7 @@
+ LOCK_UTIL = lock-util
+ INST_DIR = $(SBINDIR)
+
+-CFLAGS += -Werror -g
++CFLAGS += -g
+ CFLAGS += -Wno-unused
+ CFLAGS += -fno-strict-aliasing
+ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
+diff -ur xen-4.2.1.orig/tools/debugger/gdbsx/Rules.mk xen-4.2.1/tools/debugger/gdbsx/Rules.mk
+--- tools/debugger/gdbsx/Rules.mk 2012-12-17 23:00:22.000000000 +0800
++++ tools/debugger/gdbsx/Rules.mk 2013-01-30 12:31:43.516941098 +0800
+@@ -1,4 +1,4 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ # (gcc 4.3x and later) -Wconversion -Wno-sign-conversion
+diff -ur xen-4.2.1.orig/tools/debugger/xenitp/Makefile xen-4.2.1/tools/debugger/xenitp/Makefile
+--- tools/debugger/xenitp/Makefile 2012-12-17 23:00:22.000000000 +0800
++++ tools/debugger/xenitp/Makefile 2013-01-30 12:31:43.516941098 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-#CFLAGS += -Werror -g -O0
++#CFLAGS += -g -O0
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+
+diff -ur xen-4.2.1.orig/tools/libaio/harness/Makefile xen-4.2.1/tools/libaio/harness/Makefile
+--- tools/libaio/harness/Makefile 2012-12-17 23:00:35.000000000 +0800
++++ tools/libaio/harness/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -4,7 +4,7 @@
+ HARNESS_SRCS:=main.c
+ # io_queue.c
+
+-CFLAGS=-Wall -Werror -g -O -laio
++CFLAGS=-Wall -g -O -laio
+ #-lpthread -lrt
+
+ all: $(PROGS)
+diff -ur xen-4.2.1.orig/tools/libfsimage/Rules.mk xen-4.2.1/tools/libfsimage/Rules.mk
+--- tools/libfsimage/Rules.mk 2012-12-17 23:00:36.000000000 +0800
++++ tools/libfsimage/Rules.mk 2013-01-30 12:31:43.515941097 +0800
+@@ -1,7 +1,7 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+ CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+-CFLAGS += -Werror -D_GNU_SOURCE
++CFLAGS += -D_GNU_SOURCE
+ LDFLAGS += -L../common/
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+diff -ur xen-4.2.1.orig/tools/libxl/Makefile xen-4.2.1/tools/libxl/Makefile
+--- tools/libxl/Makefile 2012-12-17 23:01:08.000000000 +0800
++++ tools/libxl/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -11,7 +11,7 @@
+ XLUMAJOR = 1.0
+ XLUMINOR = 1
+
+-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
++CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+ CFLAGS += -I. -fPIC
+
+diff -ur xen-4.2.1.orig/tools/qemu-xen/pc-bios/optionrom/Makefile xen-4.2.1/tools/qemu-xen/pc-bios/optionrom/Makefile
+--- tools/qemu-xen/pc-bios/optionrom/Makefile 2012-09-11 02:10:52.000000000 +0800
++++ tools/qemu-xen/pc-bios/optionrom/Makefile 2013-01-30 12:31:43.528941098 +0800
+@@ -9,7 +9,7 @@
+
+ .PHONY : all clean build-all
+
+-CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
++CFLAGS := -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-builtin
+ CFLAGS += -I$(SRC_PATH)
+ CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
+ QEMU_CFLAGS = $(CFLAGS)
+diff -ur xen-4.2.1.orig/tools/vtpm/Rules.mk xen-4.2.1/tools/vtpm/Rules.mk
+--- tools/vtpm/Rules.mk 2012-12-17 23:01:35.000000000 +0800
++++ tools/vtpm/Rules.mk 2013-01-30 12:31:43.515941097 +0800
+@@ -6,7 +6,7 @@
+ #
+
+ # General compiler flags
+-CFLAGS = -Werror -g3
++CFLAGS = -g3
+
+ # Generic project files
+ HDRS = $(wildcard *.h)
+diff -ur xen-4.2.1.orig/tools/vtpm_manager/Rules.mk xen-4.2.1/tools/vtpm_manager/Rules.mk
+--- tools/vtpm_manager/Rules.mk 2012-12-17 23:01:35.000000000 +0800
++++ tools/vtpm_manager/Rules.mk 2013-01-30 12:31:43.511941097 +0800
+@@ -6,7 +6,7 @@
+ #
+
+ # General compiler flags
+-CFLAGS = -Werror -g3
++CFLAGS = -g3
+
+ # Generic project files
+ HDRS = $(wildcard *.h)
+diff -ur xen-4.2.1.orig/tools/xenstat/xentop/Makefile xen-4.2.1/tools/xenstat/xentop/Makefile
+--- tools/xenstat/xentop/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/xenstat/xentop/Makefile 2013-01-30 12:31:43.535941098 +0800
+@@ -18,7 +18,7 @@
+ all install xentop:
+ else
+
+-CFLAGS += -DGCC_PRINTF -Wall -Werror $(CFLAGS_libxenstat)
++CFLAGS += -DGCC_PRINTF -Wall $(CFLAGS_libxenstat)
+ LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
+ CFLAGS += -DHOST_$(XEN_OS)
+
+diff -ur xen-4.2.1.orig/xen/arch/arm/Rules.mk xen-4.2.1/xen/arch/arm/Rules.mk
+--- xen/arch/arm/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/arm/Rules.mk 2013-01-30 12:31:43.498941097 +0800
+@@ -9,7 +9,7 @@
+ HAS_DEVICE_TREE := y
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+
+ # Prevent floating-point variables from creeping into Xen.
+diff -ur xen-4.2.1.orig/xen/arch/x86/Rules.mk xen-4.2.1/xen/arch/x86/Rules.mk
+--- xen/arch/x86/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/x86/Rules.mk 2013-01-30 12:31:43.490941096 +0800
+@@ -24,7 +24,7 @@
+ endif
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
+diff -ur xen-4.2.1.orig/xen/include/Makefile xen-4.2.1/xen/include/Makefile
+--- xen/include/Makefile 2012-12-17 23:01:55.000000000 +0800
++++ xen/include/Makefile 2013-01-30 12:31:43.502941097 +0800
+@@ -78,7 +78,7 @@
+ all: headers.chk
+
+ headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
+- for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
++ for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
+ mv $@.new $@
+
+ endif
+diff -ur xen-4.2.1.orig/tools/tests/mce-test/tools/Makefile xen-4.2.1/tools/tests/mce-test/tools/Makefile
+--- tools/tests/mce-test/tools/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mce-test/tools/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_libxenstore)
+diff -ur xen-4.2.1.orig/tools/tests/mem-sharing/Makefile xen-4.2.1/tools/tests/mem-sharing/Makefile
+--- tools/tests/mem-sharing/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mem-sharing/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.2.1.orig/tools/tests/xen-access/Makefile xen-4.2.1/tools/tests/xen-access/Makefile
+--- tools/tests/xen-access/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/xen-access/Makefile 2013-01-30 13:01:44.891020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+
diff --git a/app-emulation/xen-pvgrub/files/xen-4.2.1-externals.patch b/app-emulation/xen-pvgrub/files/xen-4.2.1-externals.patch
new file mode 100644
index 000000000000..f2525ae1b505
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4.2.1-externals.patch
@@ -0,0 +1,83 @@
+# Patch Makefile to patch insource newlib,
+# Prevent internal downloading of external packages
+diff -ur xen-4.2.0.orig/stubdom/Makefile xen-4.2.0/stubdom/Makefile
+--- stubdom/Makefile 2012-09-17 18:21:17.000000000 +0800
++++ stubdom/Makefile 2012-12-05 14:01:10.694260256 +0800
+@@ -95,12 +95,13 @@
+ ##############
+
+ newlib-$(NEWLIB_VERSION).tar.gz:
+- $(WGET) $(NEWLIB_URL)/$@
++# $(WGET) $(NEWLIB_URL)/$@
+
+ newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
+ tar xzf $<
+ patch -d $@ -p0 < newlib.patch
+ patch -d $@ -p0 < newlib-chk.patch
++ patch -d $@ -p0 < newlib-implicits.patch
+ patch -d $@ -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
+ find $@ -type f | xargs perl -i.bak \
+ -pe 's/\b_(tzname|daylight|timezone)\b/$$1/g'
+@@ -110,7 +110,7 @@
+ $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
+ mkdir -p newlib-$(XEN_TARGET_ARCH)
+ ( cd newlib-$(XEN_TARGET_ARCH) && \
+- CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
++ CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) LDFLAGS= RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
+ $(MAKE) DESTDIR= && \
+ $(MAKE) DESTDIR= install )
+
+@@ -121,7 +122,7 @@
+ ############
+
+ zlib-$(ZLIB_VERSION).tar.gz:
+- $(WGET) $(ZLIB_URL)/$@
++# $(WGET) $(ZLIB_URL)/$@
+
+ zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz
+ tar xzf $<
+@@ -130,7 +130,7 @@
+ cross-zlib: $(ZLIB_STAMPFILE)
+ $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+ ( cd $< && \
+- CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
++ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC="$(CC)" ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
+ $(MAKE) DESTDIR= libz.a && \
+ $(MAKE) DESTDIR= install )
+
+@@ -141,7 +142,7 @@
+ ##############
+
+ pciutils-$(LIBPCI_VERSION).tar.bz2:
+- $(WGET) $(LIBPCI_URL)/$@
++# $(WGET) $(LIBPCI_URL)/$@
+
+ pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
+ tar xjf $<
+@@ -169,7 +170,7 @@
+ ######
+
+ lwip-$(LWIP_VERSION).tar.gz:
+- $(WGET) $(LWIP_URL)/$@
++# $(WGET) $(LWIP_URL)/$@
+
+ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
+ tar xzf $<
+@@ -325,7 +326,7 @@
+ ######
+
+ grub-$(GRUB_VERSION).tar.gz:
+- $(WGET) $(GRUB_URL)/$@
++#$(WGET) $(GRUB_URL)/$@
+
+ grub-upstream: grub-$(GRUB_VERSION).tar.gz
+ tar xzf $<
+@@ -392,7 +393,7 @@
+ $(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+ $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/ioemu-stubdom.gz"
+
+-install-grub: pv-grub
++install-grub:
+ $(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+ $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
+
diff --git a/app-emulation/xen-pvgrub/files/xen-4.3-externals.patch b/app-emulation/xen-pvgrub/files/xen-4.3-externals.patch
new file mode 100644
index 000000000000..0d8956fac098
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4.3-externals.patch
@@ -0,0 +1,75 @@
+diff -ur xen-4.3.0.orig/stubdom/Makefile xen-4.3.0/stubdom/Makefile
+--- stubdom/Makefile 2013-07-09 18:46:56.000000000 +0800
++++ stubdom/Makefile 2013-07-21 16:07:08.094663570 +0800
+@@ -68,12 +68,12 @@
+ ##############
+
+ newlib-$(NEWLIB_VERSION).tar.gz:
+- $(FETCHER) $@ $(NEWLIB_URL)/$@
+
+ newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
+ tar xzf $<
+ patch -d $@ -p0 < newlib.patch
+ patch -d $@ -p0 < newlib-chk.patch
++ patch -d $@ -p0 < newlib-implicits.patch
+ patch -d $@ -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
+ find $@ -type f | xargs perl -i.bak \
+ -pe 's/\b_(tzname|daylight|timezone)\b/$$1/g'
+@@ -85,7 +85,7 @@
+ $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
+ mkdir -p newlib-$(XEN_TARGET_ARCH)
+ ( cd newlib-$(XEN_TARGET_ARCH) && \
+- CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
++ CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) LDFLAGS= RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
+ $(MAKE) DESTDIR= && \
+ $(MAKE) DESTDIR= install )
+
+@@ -94,7 +94,6 @@
+ ############
+
+ zlib-$(ZLIB_VERSION).tar.gz:
+- $(FETCHER) $@ $(ZLIB_URL)/$@
+
+ zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz
+ tar xzf $<
+@@ -105,7 +104,7 @@
+ cross-zlib: $(ZLIB_STAMPFILE)
+ $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+ ( cd $< && \
+- CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
++ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC="$(CC)" ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
+ $(MAKE) DESTDIR= libz.a && \
+ $(MAKE) DESTDIR= install )
+
+@@ -114,7 +113,6 @@
+ ##############
+
+ pciutils-$(LIBPCI_VERSION).tar.bz2:
+- $(FETCHER) $@ $(LIBPCI_URL)/$@
+
+ pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
+ tar xjf $<
+@@ -142,7 +140,6 @@
+ ######
+
+ lwip-$(LWIP_VERSION).tar.gz:
+- $(FETCHER) $@ $(LWIP_URL)/$@
+
+ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
+ tar xzf $<
+@@ -180,7 +177,6 @@
+ # cross-polarssl
+ #############
+ polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+- $(FETCHER) $@ $(POLARSSL_URL)/$@
+
+ polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+ tar xzf $<
+@@ -385,7 +382,6 @@
+ ######
+
+ grub-$(GRUB_VERSION).tar.gz:
+- $(FETCHER) $@ $(GRUB_URL)/$@
+
+ grub-upstream: grub-$(GRUB_VERSION).tar.gz
+ tar xzf $<
diff --git a/app-emulation/xen-pvgrub/files/xen-4.3-fix_dotconfig-gcc.patch b/app-emulation/xen-pvgrub/files/xen-4.3-fix_dotconfig-gcc.patch
new file mode 100644
index 000000000000..588be7469760
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4.3-fix_dotconfig-gcc.patch
@@ -0,0 +1,220 @@
+# Fix gcc-4.6
+diff -ur xen-4.2.0.orig/extras/mini-os/minios.mk xen-4.2.0/extras/mini-os/minios.mk
+--- extras/mini-os/minios.mk 2012-09-17 18:21:17.000000000 +0800
++++ extras/mini-os/minios.mk 2012-12-05 14:01:10.653260260 +0800
+@@ -6,7 +6,7 @@
+
+ # Define some default flags.
+ # NB. '-Wcast-qual' is nasty, so I omitted it.
+-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
++DEF_CFLAGS += -fno-builtin -Wall -Wredundant-decls -Wno-format -Wno-redundant-decls
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+diff -ur xen-4.2.0.orig/tools/libxc/Makefile xen-4.2.0/tools/libxc/Makefile
+--- tools/libxc/Makefile 2012-09-17 18:21:18.000000000 +0800
++++ tools/libxc/Makefile 2012-12-05 14:01:10.653260260 +0800
+@@ -85,7 +85,7 @@
+
+ -include $(XEN_TARGET_ARCH)/Makefile
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ CFLAGS += -I. $(CFLAGS_xeninclude)
+
+ # Needed for posix_fadvise64() in xc_linux.c
+# Drop .config
+diff -ur xen-4.2.0.orig/Config.mk xen-4.2.0/Config.mk
+--- Config.mk 2012-09-17 18:23:12.000000000 +0800
++++ Config.mk 2012-12-05 14:01:10.641260261 +0800
+@@ -7,7 +7,6 @@ Drop .config
+ # fallback for older make
+ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
+--include $(XEN_ROOT)/.config
+
+ # A debug build of Xen and tools?
+ debug ?= n
+@@ -24,7 +24,7 @@
+
+ # Tools to run on system hosting the build
+ HOSTCC = gcc
+-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS = -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
+
+ DISTDIR ?= $(XEN_ROOT)/dist
+@@ -156,7 +156,7 @@
+
+ CFLAGS += -std=gnu99
+
+-CFLAGS += -Wall -Wstrict-prototypes
++CFLAGS += -Wstrict-prototypes
+
+ # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
+ # and is over-zealous with the printf format lint
+diff -ur xen-4.2.1.orig/tools/blktap2/drivers/Makefile xen-4.2.1/tools/blktap2/drivers/Makefile
+--- tools/blktap2/drivers/Makefile 2012-12-17 23:00:11.000000000 +0800
++++ tools/blktap2/drivers/Makefile 2013-01-30 12:31:43.539941099 +0800
+@@ -9,7 +9,7 @@
+ LOCK_UTIL = lock-util
+ INST_DIR = $(SBINDIR)
+
+-CFLAGS += -Werror -g
++CFLAGS += -g
+ CFLAGS += -Wno-unused
+ CFLAGS += -fno-strict-aliasing
+ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
+diff -ur xen-4.2.1.orig/tools/debugger/gdbsx/Rules.mk xen-4.2.1/tools/debugger/gdbsx/Rules.mk
+--- tools/debugger/gdbsx/Rules.mk 2012-12-17 23:00:22.000000000 +0800
++++ tools/debugger/gdbsx/Rules.mk 2013-01-30 12:31:43.516941098 +0800
+@@ -1,4 +1,4 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ # (gcc 4.3x and later) -Wconversion -Wno-sign-conversion
+diff -ur xen-4.2.1.orig/tools/libaio/harness/Makefile xen-4.2.1/tools/libaio/harness/Makefile
+--- tools/libaio/harness/Makefile 2012-12-17 23:00:35.000000000 +0800
++++ tools/libaio/harness/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -4,7 +4,7 @@
+ HARNESS_SRCS:=main.c
+ # io_queue.c
+
+-CFLAGS=-Wall -Werror -g -O -laio
++CFLAGS=-Wall -g -O -laio
+ #-lpthread -lrt
+
+ all: $(PROGS)
+diff -ur xen-4.2.1.orig/tools/libfsimage/Rules.mk xen-4.2.1/tools/libfsimage/Rules.mk
+--- tools/libfsimage/Rules.mk 2012-12-17 23:00:36.000000000 +0800
++++ tools/libfsimage/Rules.mk 2013-01-30 12:31:43.515941097 +0800
+@@ -1,7 +1,7 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+ CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+-CFLAGS += -Werror -D_GNU_SOURCE
++CFLAGS += -D_GNU_SOURCE
+ LDFLAGS += -L../common/
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+diff -ur xen-4.2.1.orig/tools/libxl/Makefile xen-4.2.1/tools/libxl/Makefile
+--- tools/libxl/Makefile 2012-12-17 23:01:08.000000000 +0800
++++ tools/libxl/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -11,7 +11,7 @@
+ XLUMAJOR = 1.0
+ XLUMINOR = 1
+
+-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
++CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+ CFLAGS += -I. -fPIC
+
+diff -ur xen-4.2.1.orig/tools/qemu-xen/pc-bios/optionrom/Makefile xen-4.2.1/tools/qemu-xen/pc-bios/optionrom/Makefile
+--- tools/qemu-xen/pc-bios/optionrom/Makefile 2012-09-11 02:10:52.000000000 +0800
++++ tools/qemu-xen/pc-bios/optionrom/Makefile 2013-01-30 12:31:43.528941098 +0800
+@@ -9,7 +9,7 @@
+
+ .PHONY : all clean build-all
+
+-CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
++CFLAGS := -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-builtin
+ CFLAGS += -I$(SRC_PATH)
+ CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
+ QEMU_CFLAGS = $(CFLAGS)
+diff -ur xen-4.2.1.orig/tools/xenstat/xentop/Makefile xen-4.2.1/tools/xenstat/xentop/Makefile
+--- tools/xenstat/xentop/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/xenstat/xentop/Makefile 2013-01-30 12:31:43.535941098 +0800
+@@ -18,7 +18,7 @@
+ all install xentop:
+ else
+
+-CFLAGS += -DGCC_PRINTF -Wall -Werror $(CFLAGS_libxenstat)
++CFLAGS += -DGCC_PRINTF -Wall $(CFLAGS_libxenstat)
+ LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
+ CFLAGS += -DHOST_$(XEN_OS)
+
+diff -ur xen-4.2.1.orig/xen/arch/arm/Rules.mk xen-4.2.1/xen/arch/arm/Rules.mk
+--- xen/arch/arm/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/arm/Rules.mk 2013-01-30 12:31:43.498941097 +0800
+@@ -9,7 +9,7 @@
+ HAS_DEVICE_TREE := y
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+
+ # Prevent floating-point variables from creeping into Xen.
+diff -ur xen-4.2.1.orig/xen/arch/x86/Rules.mk xen-4.2.1/xen/arch/x86/Rules.mk
+--- xen/arch/x86/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/x86/Rules.mk 2013-01-30 12:31:43.490941096 +0800
+@@ -24,7 +24,7 @@
+ endif
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
+diff -ur xen-4.2.1.orig/xen/include/Makefile xen-4.2.1/xen/include/Makefile
+--- xen/include/Makefile 2012-12-17 23:01:55.000000000 +0800
++++ xen/include/Makefile 2013-01-30 12:31:43.502941097 +0800
+@@ -78,7 +78,7 @@
+ all: headers.chk
+
+ headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
+- for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
++ for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
+ mv $@.new $@
+
+ endif
+diff -ur xen-4.2.1.orig/tools/tests/mce-test/tools/Makefile xen-4.2.1/tools/tests/mce-test/tools/Makefile
+--- tools/tests/mce-test/tools/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mce-test/tools/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_libxenstore)
+diff -ur xen-4.2.1.orig/tools/tests/mem-sharing/Makefile xen-4.2.1/tools/tests/mem-sharing/Makefile
+--- tools/tests/mem-sharing/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mem-sharing/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.2.1.orig/tools/tests/xen-access/Makefile xen-4.2.1/tools/tests/xen-access/Makefile
+--- tools/tests/xen-access/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/xen-access/Makefile 2013-01-30 13:01:44.891020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+diff -ur xen-4.3.0.orig/tools/firmware/Rules.mk xen-4.3.0/tools/firmware/Rules.mk
+--- tools/firmware/Rules.mk 2013-07-09 18:46:56.000000000 +0800
++++ ttools/firmware/Rules.mk 2013-07-20 20:28:57.811836505 +0800
+@@ -11,8 +11,6 @@
+ CFLAGS += -DNDEBUG
+ endif
+
+-CFLAGS += -Werror
+-
+ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
+
+ # Extra CFLAGS suitable for an embedded type of environment.
diff --git a/app-emulation/xen-pvgrub/files/xen-4.4-fix_dotconfig-gcc.patch b/app-emulation/xen-pvgrub/files/xen-4.4-fix_dotconfig-gcc.patch
new file mode 100644
index 000000000000..5bba0fdab3ee
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4.4-fix_dotconfig-gcc.patch
@@ -0,0 +1,171 @@
+diff -ur xen-4.4.0.orig/Config.mk xen-4.4.0/Config.mk
+--- xen-4.4.0.orig/Config.mk 2014-03-10 18:47:38.000000000 +0800
++++ xen-4.4.0/Config.mk 2014-03-23 21:54:07.327717400 +0800
+@@ -13,8 +13,6 @@
+ # fallback for older make
+ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
+--include $(XEN_ROOT)/.config
+-
+ # A debug build of Xen and tools?
+ debug ?= n
+ debug_symbols ?= $(debug)
+@@ -36,7 +34,7 @@
+
+ # Tools to run on system hosting the build
+ HOSTCC = gcc
+-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS = -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
+
+ DISTDIR ?= $(XEN_ROOT)/dist
+@@ -187,7 +185,7 @@
+
+ CFLAGS += -std=gnu99
+
+-CFLAGS += -Wall -Wstrict-prototypes
++CFLAGS += -Wstrict-prototypes
+
+ # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
+ # and is over-zealous with the printf format lint
+diff -ur xen-4.4.0.orig/extras/mini-os/minios.mk xen-4.4.0/extras/mini-os/minios.mk
+--- xen-4.4.0.orig/extras/mini-os/minios.mk 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/extras/mini-os/minios.mk 2014-03-23 21:48:41.110722054 +0800
+@@ -6,7 +6,7 @@
+
+ # Define some default flags.
+ # NB. '-Wcast-qual' is nasty, so I omitted it.
+-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
++DEF_CFLAGS += -fno-builtin -Wall -Wredundant-decls -Wno-format -Wno-redundant-decls
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+diff -ur xen-4.4.0.orig/tools/blktap2/drivers/Makefile xen-4.4.0/tools/blktap2/drivers/Makefile
+--- xen-4.4.0.orig/tools/blktap2/drivers/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/blktap2/drivers/Makefile 2014-03-23 21:55:52.215715903 +0800
+@@ -9,7 +9,7 @@
+ LOCK_UTIL = lock-util
+ INST_DIR = $(SBINDIR)
+
+-CFLAGS += -Werror -g
++CFLAGS += -g
+ CFLAGS += -Wno-unused
+ CFLAGS += -fno-strict-aliasing
+ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
+diff -ur xen-4.4.0.orig/tools/debugger/gdbsx/Rules.mk xen-4.4.0/tools/debugger/gdbsx/Rules.mk
+--- xen-4.4.0.orig/tools/debugger/gdbsx/Rules.mk 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/debugger/gdbsx/Rules.mk 2014-03-23 21:56:21.399715487 +0800
+@@ -1,4 +1,4 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ # (gcc 4.3x and later) -Wconversion -Wno-sign-conversion
+diff -ur xen-4.4.0.orig/tools/firmware/Rules.mk xen-4.4.0/tools/firmware/Rules.mk
+--- xen-4.4.0.orig/tools/firmware/Rules.mk 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/firmware/Rules.mk 2014-03-23 22:30:36.056686174 +0800
+@@ -11,7 +11,7 @@
+ CFLAGS += -DNDEBUG
+ endif
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
+
+diff -ur xen-4.4.0.orig/tools/libfsimage/Rules.mk xen-4.4.0/tools/libfsimage/Rules.mk
+--- xen-4.4.0.orig/tools/libfsimage/Rules.mk 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/libfsimage/Rules.mk 2014-03-23 21:57:21.767714626 +0800
+@@ -1,7 +1,7 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+ CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+-CFLAGS += -Werror -D_GNU_SOURCE
++CFLAGS += -D_GNU_SOURCE
+ LDFLAGS += -L../common/
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+diff -ur xen-4.4.0.orig/tools/libxc/Makefile xen-4.4.0/tools/libxc/Makefile
+--- xen-4.4.0.orig/tools/libxc/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/libxc/Makefile 2014-03-23 21:49:37.919721243 +0800
+@@ -87,7 +87,7 @@
+
+ -include $(XEN_TARGET_ARCH)/Makefile
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ CFLAGS += -I. $(CFLAGS_xeninclude)
+
+ # Needed for posix_fadvise64() in xc_linux.c
+diff -ur xen-4.4.0.orig/tools/libxl/Makefile xen-4.4.0/tools/libxl/Makefile
+--- xen-4.4.0.orig/tools/libxl/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/libxl/Makefile 2014-03-23 21:58:09.983713938 +0800
+@@ -11,7 +11,7 @@
+ XLUMAJOR = 4.3
+ XLUMINOR = 0
+
+-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
++CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+ CFLAGS += -I. -fPIC
+
+diff -ur xen-4.4.0.orig/tools/qemu-xen/pc-bios/optionrom/Makefile xen-4.4.0/tools/qemu-xen/pc-bios/optionrom/Makefile
+--- xen-4.4.0.orig/tools/qemu-xen/pc-bios/optionrom/Makefile 2014-02-06 00:59:14.000000000 +0800
++++ xen-4.4.0/tools/qemu-xen/pc-bios/optionrom/Makefile 2014-03-23 21:59:13.175713036 +0800
+@@ -9,7 +9,7 @@
+
+ .PHONY : all clean build-all
+
+-CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
++CFLAGS := -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-builtin
+ CFLAGS += -I$(SRC_PATH)
+ CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
+ QEMU_CFLAGS = $(CFLAGS)
+diff -ur xen-4.4.0.orig/tools/tests/mce-test/tools/Makefile xen-4.4.0/tools/tests/mce-test/tools/Makefile
+--- xen-4.4.0.orig/tools/tests/mce-test/tools/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/tests/mce-test/tools/Makefile 2014-03-23 22:28:45.160687756 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_libxenstore)
+diff -ur xen-4.4.0.orig/tools/tests/mem-sharing/Makefile xen-4.4.0/tools/tests/mem-sharing/Makefile
+--- xen-4.4.0.orig/tools/tests/mem-sharing/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/tests/mem-sharing/Makefile 2014-03-23 22:29:15.472687324 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.4.0.orig/tools/tests/xen-access/Makefile xen-4.4.0/tools/tests/xen-access/Makefile
+--- xen-4.4.0.orig/tools/tests/xen-access/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/tests/xen-access/Makefile 2014-03-23 22:30:02.064686659 +0800
+@@ -1,8 +1,6 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
+-
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.4.0.orig/tools/xenstat/xentop/Makefile xen-4.4.0/tools/xenstat/xentop/Makefile
+--- xen-4.4.0.orig/tools/xenstat/xentop/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/xenstat/xentop/Makefile 2014-03-23 22:23:59.944691825 +0800
+@@ -18,7 +18,7 @@
+ all install xentop:
+ else
+
+-CFLAGS += -DGCC_PRINTF -Wall -Werror $(CFLAGS_libxenstat)
++CFLAGS += -DGCC_PRINTF -Wall $(CFLAGS_libxenstat)
+ LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
+ CFLAGS += -DHOST_$(XEN_OS)
+
diff --git a/app-emulation/xen-pvgrub/files/xen-pvgrub-4-qa.patch b/app-emulation/xen-pvgrub/files/xen-pvgrub-4-qa.patch
new file mode 100644
index 000000000000..33d56db54e60
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-pvgrub-4-qa.patch
@@ -0,0 +1,35 @@
+This includes a few headers to fix some missing function declarations.
+
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+diff --git a/stubdom/grub/config.h b/stubdom/grub/config.h
+index 1649d51..15a6583 100644
+--- a/stubdom/grub/config.h
++++ b/stubdom/grub/config.h
+@@ -2,6 +2,7 @@
+ #undef putchar
+ #include <ctype.h>
+ #include <string.h>
++#include <kernel.h>
+ #define debug _debug
+ #define grub_halt(a) do_exit()
+ #define printf grub_printf
+diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
+index 2a6fa54..e65db6d 100644
+--- a/xen/include/xen/libelf.h
++++ b/xen/include/xen/libelf.h
+@@ -39,11 +39,13 @@ typedef int elf_negerrnoval; /* 0: ok; -EFOO: error */
+ #ifdef __XEN__
+ #include <public/elfnote.h>
+ #include <public/features.h>
++#include <xen/string.h>
+ #else
+ #include <xen/elfnote.h>
+ #include <xen/features.h>
+
+ #include <stdarg.h>
++#include <string.h>
+
+ struct elf_binary;
+ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
+
diff --git a/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2-jserver.patch b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2-jserver.patch
new file mode 100644
index 000000000000..514fd0575b23
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2-jserver.patch
@@ -0,0 +1,32 @@
+diff -ur xen-4.2.0.orig/tools/tests/x86_emulator/Makefile xen-4.2.0/tools/tests/x86_emulator/Makefile
+--- tools/tests/x86_emulator/Makefile 2012-09-17 18:21:19.000000000 +0800
++++ tools/tests/x86_emulator/Makefile 2012-11-24 05:06:24.355778737 +0800
+@@ -14,13 +14,13 @@
+ .PHONY: blowfish.h
+ blowfish.h:
+ rm -f blowfish.bin
+- XEN_TARGET_ARCH=x86_32 make -f blowfish.mk all
++ XEN_TARGET_ARCH=x86_32 $(MAKE) -f blowfish.mk all
+ (echo "static unsigned int blowfish32_code[] = {"; \
+ od -v -t x blowfish.bin | sed 's/^[0-9]* /0x/' | sed 's/ /, 0x/g' | sed 's/$$/,/';\
+ echo "};") >$@
+ rm -f blowfish.bin
+ ifeq ($(XEN_COMPILE_ARCH),x86_64)
+- XEN_TARGET_ARCH=x86_64 make -f blowfish.mk all
++ XEN_TARGET_ARCH=x86_64 $(MAKE) -f blowfish.mk all
+ (echo "static unsigned int blowfish64_code[] = {"; \
+ od -v -t x blowfish.bin | sed 's/^[0-9]* /0x/' | sed 's/ /, 0x/g' | sed 's/$$/,/';\
+ echo "};") >>$@
+
+diff -ur xen-4.2.0.orig/tools/firmware/vgabios/Makefile xen-4.2.0/tools/firmware/vgabios/Makefile
+--- tools/firmware/vgabios/Makefile 2013-02-04 13:56:50.973533544 +0800
++++ tools/firmware/vgabios/Makefile 2013-02-04 13:57:21.380535958 +0800
+@@ -27,7 +27,7 @@
+
+ .PHONY: release
+ release:
+- VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" make bios cirrus-bios
++ VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" $(MAKE) bios cirrus-bios
+ /bin/rm -f *.o *.s *.ld86 \
+ temp.awk.* vgabios.*.orig _vgabios_.*.c core *.bak .#*
+ cp VGABIOS-lgpl-latest.bin ../$(RELEASE).bin
diff --git a/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2.3-qa.patch b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2.3-qa.patch
new file mode 100644
index 000000000000..ea693666f022
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2.3-qa.patch
@@ -0,0 +1,34 @@
+This includes a few headers to fix some missing function declarations.
+
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+diff --git a/stubdom/grub/config.h b/stubdom/grub/config.h
+index 1649d51..15a6583 100644
+--- a/stubdom/grub/config.h
++++ b/stubdom/grub/config.h
+@@ -2,6 +2,7 @@
+ #undef putchar
+ #include <ctype.h>
+ #include <string.h>
++#include <kernel.h>
+ #define debug _debug
+ #define grub_halt(a) do_exit()
+ #define printf grub_printf
+diff -ur xen-4.2.3.orig/xen/include/xen/libelf.h xen-4.2.3/xen/include/xen/libelf.h
+--- xen-4.2.3.orig/xen/include/xen/libelf.h 2013-09-09 20:27:41.000000000 +0800
++++ xen-4.2.3/xen/include/xen/libelf.h 2014-02-15 13:42:24.491435783 +0800
+@@ -37,12 +37,14 @@
+ #ifdef __XEN__
+ #include <public/elfnote.h>
+ #include <public/features.h>
++#include <xen/string.h>
+ #include <xen/stdbool.h>
+ #else
+ #include <xen/elfnote.h>
+ #include <xen/features.h>
+
+ #include <stdarg.h>
++#include <string.h>
+ #include <stdbool.h>
+
+ struct elf_binary;
diff --git a/app-emulation/xen-pvgrub/files/xen-pvgrub-4.3.1-qa.patch b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.3.1-qa.patch
new file mode 100644
index 000000000000..f5cb3d2a3032
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.3.1-qa.patch
@@ -0,0 +1,30 @@
+diff -ur xen-4.3.1.orig/stubdom/grub/config.h xen-4.3.1/stubdom/grub/config.h
+--- stubdom/grub/config.h 2013-10-30 16:18:28.000000000 +0800
++++ stubdom/grub/config.h 2013-12-09 17:12:14.209783970 +0800
+@@ -2,6 +2,7 @@
+ #undef putchar
+ #include <ctype.h>
+ #include <string.h>
++#include <kernel.h>
+ #define debug _debug
+ #define grub_halt(a) do_exit()
+ #define printf grub_printf
+diff -ur xen-4.3.1.orig/xen/include/xen/libelf.h xen-4.3.1/xen/include/xen/libelf.h
+--- xen/include/xen/libelf.h 2013-10-30 16:18:28.000000000 +0800
++++ xen/include/xen/libelf.h 2013-12-09 17:14:09.249788085 +0800
+@@ -37,6 +37,7 @@
+ #ifdef __XEN__
+ #include <public/elfnote.h>
+ #include <public/features.h>
++#include <xen/string.h>
+ #include <xen/stdbool.h>
+ #else
+ #include <xen/elfnote.h>
+@@ -44,6 +45,7 @@
+
+ #include <stdarg.h>
+ #include <stdbool.h>
++#include <string.h>
+
+ struct elf_binary;
+ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
diff --git a/app-emulation/xen-pvgrub/metadata.xml b/app-emulation/xen-pvgrub/metadata.xml
new file mode 100644
index 000000000000..cc9d568a3360
--- /dev/null
+++ b/app-emulation/xen-pvgrub/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>xen</herd>
+</pkgmetadata>
diff --git a/app-emulation/xen-pvgrub/xen-pvgrub-4.2.5.ebuild b/app-emulation/xen-pvgrub/xen-pvgrub-4.2.5.ebuild
new file mode 100644
index 000000000000..3f02a0d7ae1d
--- /dev/null
+++ b/app-emulation/xen-pvgrub/xen-pvgrub-4.2.5.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='xml,threads'
+
+inherit flag-o-matic eutils multilib python-single-r1 toolchain-funcs
+
+XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
+LIBPCI_URL=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
+GRUB_URL=mirror://gnu-alpha/grub
+
+UPSTREAM_VER=
+GENTOO_VER=
+
+[[ -n ${UPSTREAM_VER} ]] && \
+ UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-pvgrub/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
+[[ -n ${GENTOO_VER} ]] && \
+ GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-pvgrub/}-gentoo-patches-${GENTOO_VER}.tar.xz"
+
+SRC_URI="
+ http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
+ $GRUB_URL/grub-0.97.tar.gz
+ $XEN_EXTFILES_URL/zlib-1.2.3.tar.gz
+ $LIBPCI_URL/pciutils-2.2.9.tar.bz2
+ $XEN_EXTFILES_URL/lwip-1.3.0.tar.gz
+ $XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz
+ ${UPSTREAM_PATCHSET_URI}
+ ${GENTOO_PATCHSET_URI}
+ "
+
+S="${WORKDIR}/xen-${PV}"
+
+DESCRIPTION="allows to boot Xen domU kernels from a menu.lst laying inside guest filesystem"
+HOMEPAGE="http://xen.org/"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="custom-cflags"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="sys-devel/gettext
+ sys-devel/bin86"
+
+RDEPEND=">=app-emulation/xen-4.2.1"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+retar-externals() {
+ # Purely to unclutter src_prepare
+ local set="grub-0.97.tar.gz lwip-1.3.0.tar.gz newlib-1.16.0.tar.gz zlib-1.2.3.tar.gz"
+
+ # epatch can't patch in $WORKDIR, requires a sed; Bug #455194. Patchable, but sed informative
+ sed -e s':AR=${AR-"ar rc"}:AR=${AR-"ar"}:' \
+ -i "${WORKDIR}"/zlib-1.2.3/configure
+ sed -e 's:^AR=ar rc:AR=ar:' \
+ -e s':$(AR) $@:$(AR) rc $@:' \
+ -i "${WORKDIR}"/zlib-1.2.3/{Makefile,Makefile.in}
+ einfo "zlib Makefile edited"
+
+ cd "${WORKDIR}"
+ tar czp zlib-1.2.3 -f zlib-1.2.3.tar.gz
+ tar czp grub-0.97 -f grub-0.97.tar.gz
+ tar czp lwip -f lwip-1.3.0.tar.gz
+ tar czp newlib-1.16.0 -f newlib-1.16.0.tar.gz
+ mv $set "${S}"/stubdom/
+ einfo "tarballs moved to source"
+}
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${UPSTREAM_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-upstream
+ fi
+
+ # Gentoo's patchset
+ if [[ -n ${GENTOO_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-gentoo
+ fi
+
+ # 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 custom-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 {} \;
+ fi
+
+ # Patch the unmergeable newlib, fix most of the leftover gcc QA issues
+ cp "${FILESDIR}"/newlib-implicits.patch stubdom || die
+
+ # Patch stubdom/Makefile to patch insource newlib & prevent internal downloading
+ epatch "${FILESDIR}"/${PN/-pvgrub/}-4.2.1-externals.patch
+
+ # Drop .config and Fix gcc-4.6
+ epatch "${FILESDIR}"/${PN/-pvgrub/}-4-fix_dotconfig-gcc.patch
+
+ # fix jobserver in Makefile
+ epatch "${FILESDIR}"/${PN}-4.2-jserver.patch
+
+ # gcc warnings/QA fix
+ epatch "${FILESDIR}"/${PN}-4.2.3-qa.patch
+
+ #Substitute for internal downloading. pciutils copied only due to the only .bz2
+ cp "${DISTDIR}"/pciutils-2.2.9.tar.bz2 ./stubdom/ || die "pciutils not copied to stubdom"
+ retar-externals || die "re-tar procedure failed"
+}
+
+src_compile() {
+ use custom-cflags || unset CFLAGS
+ if test-flag-CC -fno-strict-overflow; then
+ append-flags -fno-strict-overflow
+ fi
+
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" -C tools/include
+
+ if use x86; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub
+ elif use amd64; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_64" -C stubdom pv-grub
+ if has_multilib_profile; then
+ multilib_toolchain_setup x86
+ emake CC="$(tc-getCC)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub
+ fi
+ fi
+}
+
+src_install() {
+ if use x86; then
+ emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub
+ fi
+ if use amd64; then
+ emake XEN_TARGET_ARCH="x86_64" DESTDIR="${D}" -C stubdom install-grub
+ if has_multilib_profile; then
+ emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub
+ fi
+ fi
+}
+
+pkg_postinst() {
+ elog "Official Xen Guide and the offical wiki page:"
+ elog "http://www.gentoo.org/doc/en/xen-guide.xml"
+ elog "http://wiki.xen.org/wiki/Main_Page"
+}
diff --git a/app-emulation/xen-pvgrub/xen-pvgrub-4.5.1.ebuild b/app-emulation/xen-pvgrub/xen-pvgrub-4.5.1.ebuild
new file mode 100644
index 000000000000..8e1c138209c3
--- /dev/null
+++ b/app-emulation/xen-pvgrub/xen-pvgrub-4.5.1.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='xml,threads'
+
+inherit flag-o-matic eutils multilib python-single-r1 toolchain-funcs
+
+XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
+LIBPCI_URL=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
+GRUB_URL=mirror://gnu-alpha/grub
+SRC_URI="
+ http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
+ $GRUB_URL/grub-0.97.tar.gz
+ $XEN_EXTFILES_URL/zlib-1.2.3.tar.gz
+ $LIBPCI_URL/pciutils-2.2.9.tar.bz2
+ $XEN_EXTFILES_URL/lwip-1.3.0.tar.gz
+ $XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz
+ $XEN_EXTFILES_URL/polarssl-1.1.4-gpl.tgz"
+
+S="${WORKDIR}/xen-${PV}"
+
+DESCRIPTION="allows to boot Xen domU kernels from a menu.lst laying inside guest filesystem"
+HOMEPAGE="http://xen.org/"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 -x86"
+IUSE="custom-cflags"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="sys-devel/gettext
+ sys-devel/bin86
+ sys-apps/texinfo"
+
+RDEPEND=">=app-emulation/xen-4.2.1"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+retar-externals() {
+ # Purely to unclutter src_prepare
+ local set="grub-0.97.tar.gz lwip-1.3.0.tar.gz newlib-1.16.0.tar.gz polarssl-1.1.4-gpl.tgz zlib-1.2.3.tar.gz"
+
+ # epatch can't patch in $WORKDIR, requires a sed; Bug #455194. Patchable, but sed informative
+ sed -e s':AR=${AR-"ar rc"}:AR=${AR-"ar"}:' \
+ -i "${WORKDIR}"/zlib-1.2.3/configure
+ sed -e 's:^AR=ar rc:AR=ar:' \
+ -e s':$(AR) $@:$(AR) rc $@:' \
+ -i "${WORKDIR}"/zlib-1.2.3/{Makefile,Makefile.in}
+ einfo "zlib Makefile edited"
+
+ cd "${WORKDIR}"
+ tar czp zlib-1.2.3 -f zlib-1.2.3.tar.gz
+ tar czp grub-0.97 -f grub-0.97.tar.gz
+ tar czp lwip -f lwip-1.3.0.tar.gz
+ tar czp newlib-1.16.0 -f newlib-1.16.0.tar.gz
+ tar czp polarssl-1.1.4 -f polarssl-1.1.4-gpl.tgz
+ mv $set "${S}"/stubdom/
+ einfo "tarballs moved to source"
+}
+
+src_prepare() {
+ # 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 custom-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 {} \;
+ fi
+
+ # Patch the unmergeable newlib, fix most of the leftover gcc QA issues
+ cp "${FILESDIR}"/newlib-implicits.patch stubdom || die
+
+ # Patch stubdom/Makefile to patch insource newlib & prevent internal downloading
+ epatch "${FILESDIR}"/${PN/-pvgrub/}-4.3-externals.patch
+
+ # fix jobserver in Makefile
+ epatch "${FILESDIR}"/${PN}-4.2-jserver.patch
+
+ #Substitute for internal downloading. pciutils copied only due to the only .bz2
+ cp "${DISTDIR}"/pciutils-2.2.9.tar.bz2 ./stubdom/ || die "pciutils not copied to stubdom"
+ retar-externals || die "re-tar procedure failed"
+}
+
+src_configure() {
+ local myconf="--prefix=${PREFIX}/usr \
+ --libdir=${PREFIX}/usr/$(get_libdir) \
+ --libexecdir=${PREFIX}/usr/libexec \
+ --disable-werror \
+ --disable-xen"
+
+ econf ${myconf}
+}
+
+src_compile() {
+ use custom-cflags || unset CFLAGS
+ if test-flag-CC -fno-strict-overflow; then
+ append-flags -fno-strict-overflow
+ fi
+
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" -C tools/include
+
+ if use x86; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub
+ elif use amd64; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_64" -C stubdom pv-grub
+ if has_multilib_profile; then
+ multilib_toolchain_setup x86
+ emake CC="$(tc-getCC)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub
+ fi
+ fi
+}
+
+src_install() {
+ if use x86; then
+ emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub
+ fi
+ if use amd64; then
+ emake XEN_TARGET_ARCH="x86_64" DESTDIR="${D}" -C stubdom install-grub
+ if has_multilib_profile; then
+ emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub
+ fi
+ fi
+}
+
+pkg_postinst() {
+ elog "Official Xen Guide and the offical wiki page:"
+ elog "https://wiki.gentoo.org/wiki/Xen"
+ elog "http://wiki.xen.org/wiki/Main_Page"
+}
diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
new file mode 100644
index 000000000000..e42d51c6de38
--- /dev/null
+++ b/app-emulation/xen-tools/Manifest
@@ -0,0 +1,11 @@
+DIST ovmf-20150629.tar.bz2 24265640 SHA256 9f316dc44e192fa9d5d7486cf1dae3f3094ab4f20f282f80d6251632c2cd6118 SHA512 b15a896b5222b920a500ec8a1eba5d670505441ffd02accf9b6c0deb9a12c1c5513a016f91eae5cb33f75ee9f28435dc957686e6ce8b5d0744c11a7d7262fffd WHIRLPOOL 8db4360dcb85f183dbd827f7381787c84065f94eaf746068b11ef7b30412b16cc0ba75effb04f01dea5f4f67967721f7aca11a2550035e95c59645c7964526ac
+DIST seabios-1.6.3.2.tar.gz 422376 SHA256 888aafe37ef3d1f502a73518a5e4dd0e9373ce4cd41681c354771314f1e41dd7 SHA512 c54431d8e81d25b74427696da689e90d3ab68c7c1be1dec05c81658d28b650f53daa34dcee2da826c1cf5d5d39396b12b0b16ea20ed6fd89de8f732163c8cca5 WHIRLPOOL 826c0e034ca46291661faa363189ee6cf56098cabc39f8fc84d2c442cc2da2174c2fa027cc11e11a7c3fed619f2e524f2aee804d9836d256448cdad28631d69a
+DIST seabios-1.7.5.tar.gz 537566 SHA256 858d9eda4ad91efa1c45a5a401d560ef9ca8dd172f03b0a106f06661c252dc51 SHA512 ecf5fb9ac44dde6e4ac00baa6c920dde51b923f23dd74e62c5a02eceaf235e57b885975c5a8bd0927e268115c72bd1143a080fdfd4eff4e168ebeaa30436280e WHIRLPOOL 5e1e99b3bd82a8607c5986fde4592c7437bec4bd78abd5873710f6c431d075436725e8d0d32e9f0dd2921c9d84b8613108b21d31c5309a73e337ead7adf35e90
+DIST xen-4.2.5-upstream-patches-9.tar.xz 23208 SHA256 2206e9a8aeeed207abbae995c5d2baa14d5f0da4120ae44f2de733ecf7ea5af1 SHA512 8a2edaba48002449a521edf2ae078ffe1b3db4f491a85b063886a147a0be3ec7fdb819ce84c90cdae80ed34c10ab2d637506700be10052a67be6ef128fa40fb1 WHIRLPOOL 037820e0fad60d1f7ed054efa797585c992d08f1ffd533705c515ad289f8cdddc72b97f2a3d75ebd683c6bb6988d7285452b4f3cebbe9a879f701156e387ff3b
+DIST xen-4.2.5.tar.gz 15671925 SHA256 3cf440866315e8085050eb0586f0447b6b47a08dbed6a72226bf5ed5d89ec567 SHA512 42c0fc241952fc55fc44480fb6752b004b54ae40e946159ec047adf229b65cbfbd810271d01b064ad8fdbddb73c640dcdcb6bc19f91e8968829889c129920dac WHIRLPOOL 762a91c0111892b33e6bd3e7f7714709b04697ad7c2b0919fef6cc9570a343a77fd5a2b82833e75dac9d12d4e41acdcf0743b0d593595910ddd326f5cd721368
+DIST xen-4.5.1-upstream-patches-0.tar.xz 18236 SHA256 95910023cb99f11b4df6d57d82000bbd67714d4ed0700e152619c5b82c1bc6e5 SHA512 531e5bbe6b9920a58361f11bb1bb6df65ebaf01e3af13f9aca018e8512727d950009257dfc9b3d0b0f847968da499cf9423716de8a04869cec6f92f5274462e2 WHIRLPOOL 3e6dda862d1bbe736b85422117148c3db91a308a58eb1476e27bbb7355ea7793269cdfc489697c9e5eea5f0ac5319df5c88f2707b10c9a96b8142927a4169819
+DIST xen-4.5.1.tar.gz 18410400 SHA256 668c11d4fca67ac44329e369f810356eacd37b28d28fb96e66aac77f3c5e1371 SHA512 9436243e26bc64bc836a179abdc3a6b1b6fa9d3f2170453092c18be71fa62e18cd4465a9154c0f28a7ac8d69d08361ba1defef240a51197f058c012c3855ba04 WHIRLPOOL 71d8559f86683dd9fb3eb09d3f602de227f281fbd3c8cc258bfdb67c425d9e7c4d21cb0284c123e4263262c1b821fea6d28109861ce60d627f6426d352808d99
+DIST xen-gentoo-patches-1.tar.xz 23044 SHA256 dcff35bbc4b6946473c9b55ad595a5fea88e8dac1bd977cbe18a644b2cced2e0 SHA512 a4c66382d44112e7be09711e3ecf0f8ebd9a30b29e04d8aca536430172bdd111ab8bab7700433e0dc35165f876eb7e9cd2e554d74ce2a166fb2dfd4de482cb7a WHIRLPOOL d0443e1501ac813ac3226df32a6b050c03302c3d74e3b3bd1293ab4ad929b5c314cc0eac13505ce8a826ee357117e8eeaf0713fd8b9c55f40296966fda082c2e
+DIST xen-gentoo-patches-4.tar.xz 23632 SHA256 5cdb0f93ee32d0a5fc4fc7282270ace73acfdc4df694f7b29c1135180d902049 SHA512 3006ce4cd67e80a9f79d9ba3814a64704b0d762159a439a140b1ec0a2699473cd5537950f0913b55f8f7e3d0fd2e9861f3199793120d8d2502aa3f8ef7816c8f WHIRLPOOL 4a921103df2825ccd8b0481708e7cd692fa45d5aadae286c1522c144a1576920e7d3567648565bb9af85bb6bb597ea9d0ec04ea6abd2115db4caf7e739717b1a
+DIST xen-ovmf-patches-1.tar.xz 4724 SHA256 d14e98e62c78c9f4b8a7e7b4a04de6dabf300f393eff44154d06f93aa43d7703 SHA512 a17467762f6d92018ff9bce783ce148039f23159405e801ec2aef4c3db72c3976c6f1e41d8c2a2cb704a9654556a2050302f284cfe8e32f28f393b8e2c6d2f1c WHIRLPOOL de53ad07f20aa14fe76d974db92d5b6808f0a2dd26a627b818914990add7adad8e6135d42641819dc22947031981c5815bae5aeeed0f28785c90beda0a6ff6c8
+DIST xen-security-patches-6.tar.xz 24780 SHA256 b41422583e5f7b4c85b82d89ab66f3e0fa8de8fdb2ae42aa3da40822e9507ef5 SHA512 c58831eb5e26a78a3072623b83bad125ddd4cd67c0075a708be81a7f50ee936cd2e5832a9b88129e11ec81ebafc9cfbc339fb8296d6f4b44c04630b349c4a621 WHIRLPOOL edecaefef0b6dd1a10c479362362640d9bd7a43623085c1f20b1171c65746220d7fdfd0e20892f60ea7d2f6052389da2a1d3c0179a88d7c4d52b3aa33cbef05e
diff --git a/app-emulation/xen-tools/files/gentoo-patches.conf b/app-emulation/xen-tools/files/gentoo-patches.conf
new file mode 100644
index 000000000000..696ff1814817
--- /dev/null
+++ b/app-emulation/xen-tools/files/gentoo-patches.conf
@@ -0,0 +1,135 @@
+# Drop .config, fixes to gcc-4.6
+_gx001=" xen-4-fix_dotconfig-gcc.patch"
+_gx020=" xen-4.3-fix_dotconfig-gcc.patch"
+
+# Fix texi2html build error with new texi2html, qemu.doc.html
+_gx002=" xen-tools-4-docfix.patch"
+_gx003=" xen-tools-4-qemu-xen-doc.patch"
+
+_gx004=" xen-tools-4.2-pod-utf8-chars.patch"
+_gx005=" xen-tools-4.2-pod-docs.patch"
+_gx006=" xen-tools-4.2-pod-xl.patch"
+
+# Fix network broadcast on bridged networks
+_gx007=" xen-tools-3.4.0-network-bridge-broadcast.patch"
+
+# Bug 496708
+_gx008=" xen-tools-4-unbundle-ipxe.patch"
+#use system-seabios && epatch "${FILESDIR}"/${PN}-4-unbundle-seabios.patch
+
+# Fix bridge by idella4, bug #362575
+_gx009=" xen-tools-4.1.1-bridge.patch"
+
+# Conditional patch, fix in ebuild
+# Don't build ipxe with pie on hardened, Bug #360805
+#if gcc-specs-pie; then
+# epatch "${FILESDIR}"/ipxe-nopie.patch
+#fi
+
+# Prevent double stripping of files at install
+_gx010=" xen-4.2.0-nostrip.patch"
+_gx024+=" xen-4.4-nostrip.patch"
+
+# fix jobserver in Makefile
+_gx011=" xen-4.2.0-jserver.patch"
+_gx021=" xen-4.3-jserver.patch"
+
+# add missing header, Bug #467200
+_gx012=" xen-4-ulong.patch"
+_gx013=" xen-tools-4.2-xen_disk_leak.patch"
+
+# Set dom0-min-mem to kb; Bug #472982
+_gx014=" xen-4.2-configsxp.patch"
+
+# Bug 463840
+_gx015=" xen-tools-4.2.2-install.patch"
+_gx016=" xen-tools-4.2.2-rt-link.patch"
+
+# Bug 379537
+_gx017=" fix-gold-ld.patch"
+
+# Bug 510976
+_gx018=" xen-tools-4.2.4-udev-rules.patch"
+
+# bundled seabios
+_gx019=" xen-tools-4-anti-seabios-download.patch"
+_gx032=" xen-tools-4.5-anti-seabios-download.patch"
+
+# Bug 477676
+_gx022=" xen-tools-4.3-ar-cc.patch"
+
+# Prevent file collision with qemu package Bug 478064
+_gx023=" qemu-bridge.patch"
+_gx025=" xen-4.4-qemu-bridge.patch"
+_gx031=" xen-4.5-qemu-bridge.patch"
+#mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
+
+_gx026=" xen-tools-4.4-api-fix.patch"
+
+# Fix po file collision with app-emulation/qemu, while USE=qemu is enabled, Bug 508302
+_gx027=" xen-tools-4-qemu-fix-po-collision.patch"
+
+# Fix build failure with ncurses[tinfo], bug 526526
+_gx028=" xen-tools-4.4.1-tinfo.patch"
+
+# Don't download ovmf, use pre-released
+_gx029=" xen-tools-4-anti-ovmf-download.patch"
+
+# fix build err while using gcc-4.5.x, c99
+_gx033=" xen-tools-4.4.2-gcc99.patch"
+_gx034=" xen-tools-4.5.0-gcc99.patch"
+
+# xen-tools-4.2.5 patches set
+_gpv_xen_tools_425_0="
+${_gx001} ${_gx002} ${_gx003} ${_gx004} ${_gx005}
+${_gx006} ${_gx007} ${_gx008} ${_gx009} ${_gx010}
+${_gx011} ${_gx012} ${_gx013} ${_gx014} ${_gx015}
+${_gx016} ${_gx017} ${_gx018} ${_gx019}
+"
+
+# xen-tools-4.4.1 patches set
+_gpv_xen_tools_441_2="
+${_gx007} ${_gx008} ${_gx009}
+${_gx024} ${_gx021} ${_gx014}
+${_gx022} ${_gx017} ${_gx025}
+${_gx026} ${_gx027} ${_gx019}
+${_gx028} ${_gx029}
+"
+
+# xen-tools-4.4.2 patches set
+_gpv_xen_tools_442_0="
+${_gx007} ${_gx008} ${_gx009}
+${_gx024} ${_gx021} ${_gx014}
+${_gx022} ${_gx017} ${_gx025}
+${_gx026} ${_gx027} ${_gx019}
+${_gx028} ${_gx029}
+"
+_gpv_xen_tools_442_1="
+${_gx007} ${_gx008} ${_gx009}
+${_gx024} ${_gx021} ${_gx014}
+${_gx022} ${_gx017} ${_gx025}
+${_gx026} ${_gx027} ${_gx019}
+${_gx028} ${_gx029} ${_gx033}
+"
+
+# xen-tools-4.5.0 patches set
+_gpv_xen_tools_450_0="
+${_gx008} ${_gx024} ${_gx021}
+${_gx022} ${_gx017} ${_gx031}
+${_gx027} ${_gx032}
+${_gx028} ${_gx029}
+"
+_gpv_xen_tools_450_1="
+${_gx008} ${_gx024} ${_gx021}
+${_gx022} ${_gx017} ${_gx031}
+${_gx027} ${_gx032}
+${_gx028} ${_gx029} ${_gx034}
+"
+
+# xen-tools-4.5.1 patches set
+_gpv_xen_tools_451_0="
+${_gx008} ${_gx024} ${_gx021}
+${_gx022} ${_gx017} ${_gx031}
+${_gx027} ${_gx032}
+${_gx028} ${_gx029} ${_gx034}
+"
diff --git a/app-emulation/xen-tools/files/stubs-32.h b/app-emulation/xen-tools/files/stubs-32.h
new file mode 100644
index 000000000000..a421528deb74
--- /dev/null
+++ b/app-emulation/xen-tools/files/stubs-32.h
@@ -0,0 +1,20 @@
+/* This file is automatically generated.
+ It defines a symbol `__stub_FUNCTION' for each function
+ in the C library which is a stub, meaning it will fail
+ every time called, usually setting errno to ENOSYS. */
+
+#ifdef _LIBC
+ #error Applications may not define the macro _LIBC
+#endif
+
+#define __stub_chflags
+#define __stub_fattach
+#define __stub_fchflags
+#define __stub_fdetach
+#define __stub_gtty
+#define __stub_lchmod
+#define __stub_revoke
+#define __stub_setlogin
+#define __stub_sigreturn
+#define __stub_sstk
+#define __stub_stty
diff --git a/app-emulation/xen-tools/files/xen-consoles.logrotate b/app-emulation/xen-tools/files/xen-consoles.logrotate
new file mode 100644
index 000000000000..c6445239b42f
--- /dev/null
+++ b/app-emulation/xen-tools/files/xen-consoles.logrotate
@@ -0,0 +1,5 @@
+/var/log/xen-consoles/*.log {
+ rotate 7
+ missingok
+ compress
+}
diff --git a/app-emulation/xen-tools/files/xencommons.confd b/app-emulation/xen-tools/files/xencommons.confd
new file mode 100644
index 000000000000..b9e22482966f
--- /dev/null
+++ b/app-emulation/xen-tools/files/xencommons.confd
@@ -0,0 +1,4 @@
+# /etc/conf.d/xencommons
+
+# Load xen's kernel modules, and this will override defaults
+XEN_KERNEL_MODULES=""
diff --git a/app-emulation/xen-tools/files/xencommons.initd b/app-emulation/xen-tools/files/xencommons.initd
new file mode 100644
index 000000000000..0ce192fae927
--- /dev/null
+++ b/app-emulation/xen-tools/files/xencommons.initd
@@ -0,0 +1,80 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before xenstored
+}
+
+is_privileged_domain() {
+ grep -qsE '^control_d$' /proc/xen/capabilities
+ return $?
+}
+
+handle_kernel_modules() {
+ local XEN_DEFAULT_KERNEL_MODULES="
+ xen-evtchn
+ xen-gntdev
+ xen-gntalloc
+ xen-blkback
+ xen-netback
+ xen-pciback
+ gntdev
+ netbk
+ blkbk
+ xen-scsibk
+ usbbk
+ pciback
+ xen-acpi-processor
+ blktap2
+ blktap
+ "
+
+ [ "$1" = "remove" ] && OPTS="-r"
+
+ XEN_KERNEL_MODULES="${XEN_KERNEL_MODULES:-${XEN_DEFAULT_KERNEL_MODULES}}"
+ for i in ${XEN_KERNEL_MODULES}; do
+ modprobe ${OPTS} $i 2>/dev/null
+ done
+ return 0
+}
+
+start() {
+ ebegin "Starting xencommons daemon"
+
+ # not running in Xen dom0 or domU
+ if [ ! -d /proc/xen ]; then
+ eend 1 "Not running in Xen mode"
+ return 1
+ fi
+
+ # mount xenfs in dom0 or domU with a pv_ops kernel
+ if ! test -f /proc/xen/capabilities && \
+ ! grep '^xenfs ' /proc/mounts >/dev/null;
+ then
+ mount -t xenfs xenfs /proc/xen
+ fi
+
+ if ! is_privileged_domain; then
+ eend 1 "Not running on a privileged domain. xencommons not started"
+ return 1
+ fi
+
+ handle_kernel_modules
+
+ eend $? "Failed to start xencommons"
+}
+
+stop () {
+ ebegin "Stopping xencommons"
+ if ! is_privileged_domain; then
+ eend 1 "Not running on a privileged domain. xencommons not started"
+ return 1
+ fi
+
+ handle_kernel_modules remove
+
+ eend $? "Failed to stop xencommons"
+}
+
diff --git a/app-emulation/xen-tools/files/xenconsoled.confd b/app-emulation/xen-tools/files/xenconsoled.confd
new file mode 100644
index 000000000000..b2e194bde46f
--- /dev/null
+++ b/app-emulation/xen-tools/files/xenconsoled.confd
@@ -0,0 +1,2 @@
+# /etc/conf.d/xenstored
+XENCONSOLED_OPTS=""
diff --git a/app-emulation/xen-tools/files/xenconsoled.initd b/app-emulation/xen-tools/files/xenconsoled.initd
new file mode 100644
index 000000000000..342af408b0dd
--- /dev/null
+++ b/app-emulation/xen-tools/files/xenconsoled.initd
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need xenstored
+ after lvm
+}
+
+# bug #498720
+shutdown_all_domU() {
+ # Note: shutdown all domU, including manually started ones
+ local V=$(xl info| awk "/xen_minor/ { print \$3 }")
+ # 4.2.2 do not support "-a" option
+ [ $V -gt 2 ] && xl shutdown -a -w >/dev/null
+}
+
+start() {
+ ebegin "Starting xenconsoled daemon"
+ start-stop-daemon --start --exec /usr/sbin/xenconsoled \
+ --pidfile /run/xenconsoled.pid \
+ -- --pid-file=/run/xenconsoled.pid \
+ ${XENCONSOLED_OPTS}
+ eend $*
+}
+
+stop() {
+ ebegin "Stopping xenconsoled daemon"
+ shutdown_all_domU
+ start-stop-daemon --stop --exec /usr/sbin/xenconsoled \
+ --pidfile /run/xenconsoled.pid
+ eend $*
+}
diff --git a/app-emulation/xen-tools/files/xendomains-screen.confd b/app-emulation/xen-tools/files/xendomains-screen.confd
new file mode 100644
index 000000000000..e75e19d3be74
--- /dev/null
+++ b/app-emulation/xen-tools/files/xendomains-screen.confd
@@ -0,0 +1,25 @@
+# /etc/conf.d/xendomains
+
+# Directory of domains to boot. AUTODIR should contain one or more symlinks
+# to domain config files in /etc/xen
+# AUTODIR=/etc/xen/auto
+
+# Send shutdown commands to all domains in parallel instead of waiting for
+# each to shutdown individually
+# PARALLEL_SHUTDOWN=yes
+
+# When SCREEN="yes", domains in AUTODIR have their consoles connected to a
+# screen session named SCREEN_NAME, with output logged to individual files
+# named after each domain and written to /var/log/xen-consoles/ . These files
+# are rotated (using app-admin/logrotate) every time xendomains is started.
+
+SCREEN="yes"
+SCREEN_NAME="xen"
+
+# Number of seconds between writes to screen's logfiles.
+#
+# Lower values mean more disk activity and hence a possible performance
+# impact, but higher values mean a greater chance of loosing some output
+# in the event of a crash.
+
+SCREEN_LOG_INTERVAL="1"
diff --git a/app-emulation/xen-tools/files/xendomains.confd b/app-emulation/xen-tools/files/xendomains.confd
new file mode 100644
index 000000000000..90c1f5256c62
--- /dev/null
+++ b/app-emulation/xen-tools/files/xendomains.confd
@@ -0,0 +1,9 @@
+# /etc/conf.d/xendomains
+
+# Directory of domains to boot. AUTODIR should contain one or more symlinks
+# to domain config files in /etc/xen
+AUTODIR=/etc/xen/auto
+
+# Send shutdown commands to all domains in parallel instead of waiting for
+# each to shutdown individually
+PARALLEL_SHUTDOWN=yes
diff --git a/app-emulation/xen-tools/files/xendomains.initd-r2 b/app-emulation/xen-tools/files/xendomains.initd-r2
new file mode 100644
index 000000000000..899a9b8a94e0
--- /dev/null
+++ b/app-emulation/xen-tools/files/xendomains.initd-r2
@@ -0,0 +1,118 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="status"
+
+depend() {
+ need xenstored
+ after dhcp xend xenconsoled
+}
+
+get_domname() {
+ local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1)
+
+ if [ -z ${name_from_file} ] ; then
+ basename "${1}"
+ else
+ echo ${name_from_file}
+ fi
+}
+
+is_running() {
+ /usr/sbin/xl list "${1}" >/dev/null 2>&1
+}
+
+using_screen() {
+ [ "${SCREEN}" = "yes" -o "${SCREEN}" = "YES" ]
+}
+
+set_screen_cmd() {
+ screen_cmd="screen -c ${SCREENRC:-/dev/null} -q -r ${SCREEN_NAME:=xen} -X"
+}
+
+start() {
+ set_screen_cmd
+
+ einfo "Starting Xen domains from ${AUTODIR:=/etc/xen/auto}"
+ if using_screen ; then
+ ebegin "Creating screen session to hold domain consoles"
+ ( screen -c ${SCREENRC:-/dev/null} -d -m -S ${SCREEN_NAME} -t dom0 \
+ && sleep 5 \
+ && ${screen_cmd} zombie dr \
+ && logrotate -f /etc/xen/xen-consoles.logrotate \
+ && ${screen_cmd} logfile /var/log/xen-consoles/%t.log \
+ && ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \
+ && ${screen_cmd} log on \
+ && ${screen_cmd} deflog on ) >/dev/null
+ if [ $? -ne 0 ] ; then
+ eend 1
+ return 1
+ else
+ eend
+ fi
+ fi
+ # Create all domains with config files in AUTODIR.
+ for dom in $(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort); do
+ name=$(get_domname ${dom})
+ if ! is_running ${name} ; then
+ ebegin " Starting domain ${name}"
+ if using_screen ; then
+ ${screen_cmd} screen -t ${name} xl create ${dom} -c
+ else
+ xl create --quiet ${dom}
+ fi
+ eend $?
+ else
+ einfo " Not starting domain ${name} - already running"
+ fi
+ done
+}
+
+stop() {
+ set_screen_cmd
+
+ einfo "Shutting down Xen domains from ${AUTODIR:=/etc/xen/auto}"
+ # Stop all domains with config files in AUTODIR.
+ DOMAINS="$(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort -r)"
+
+ if [ "$PARALLEL_SHUTDOWN" = "yes" ] ; then
+ for dom in $DOMAINS ; do
+ name=$(get_domname ${dom})
+ if is_running ${name} ; then
+ ebegin " Asking domain ${name} to shutdown in the background..."
+ xl shutdown -w ${name} >/dev/null &
+ else
+ einfo " Not stopping domain ${name} - not running"
+ fi
+ done
+ einfo " Waiting for shutdown of domains that are still running"
+ wait
+ eend $?
+ else
+ for dom in $DOMAINS ; do
+ name=$(get_domname ${dom})
+ if is_running ${name} ; then
+ ebegin " Waiting for domain ${name} to shutdown"
+ xl shutdown -w ${name} >/dev/null
+ eend $?
+ else
+ einfo " Not stopping domain ${name} - not running"
+ fi
+ done
+ fi
+ if using_screen ; then
+ if ${screen_cmd} sleep 0 >/dev/null 2>&1 ; then
+ ebegin "Closing screen session ${SCREEN_NAME}"
+ ${screen_cmd} quit
+ eend $?
+ else
+ eend 0
+ fi
+ fi
+}
+
+status() {
+ /usr/sbin/xl list
+}
diff --git a/app-emulation/xen-tools/files/xenqemudev.confd b/app-emulation/xen-tools/files/xenqemudev.confd
new file mode 100644
index 000000000000..5b49520aa0ee
--- /dev/null
+++ b/app-emulation/xen-tools/files/xenqemudev.confd
@@ -0,0 +1,7 @@
+# /etc/conf.d/xenqemudev
+
+# To enable QEMU file backend, set to 'yes'
+XENQEMUDEV_FILE_BACKEND_ENABLE=""
+
+# Common options for xenqemudev
+XENQEMUDEV_OPTS=""
diff --git a/app-emulation/xen-tools/files/xenqemudev.initd b/app-emulation/xen-tools/files/xenqemudev.initd
new file mode 100644
index 000000000000..07dadebcd1e1
--- /dev/null
+++ b/app-emulation/xen-tools/files/xenqemudev.initd
@@ -0,0 +1,85 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need xencommons xenstored xenconsoled
+}
+
+is_privileged_domain() {
+ grep -qsE '^control_d$' /proc/xen/capabilities
+ return $?
+}
+
+xen_setvars() {
+ . /etc/xen/scripts/hotplugpath.sh
+
+ XENQEMUDEV_PIDFILE=/run/xenqemudev.pid
+
+ # xen-4.5 change the path
+ XEN_QEMU="${LIBEXEC}/qemu-system-i386"
+ [ -e ${XEN_QEMU} ] && return
+ XEN_QEMU="${LIBEXEC_BIN}/qemu-system-i386"
+}
+
+xen_qemu_start() {
+ if [ -z "${XENQEMUDEV_FILE_BACKEND_ENABLE}" ]; then
+ ewarn " QEMU disk backend not enabled"
+ ewarn " enable XENQEMUDEV_FILE_BACKEND_ENABLE in /etc/conf.d/xenqemudev"
+ return 1
+ fi
+
+ xen_setvars
+
+ if [ ! -c /dev/xen/gntdev ]; then
+ einfo " Xen gntdev driver not loaded"
+ return 1
+ fi
+
+ if [ -e "${XEN_QEMU}" ]; then
+ einfo " Starting QEMU as disk backend for dom0"
+
+ XENQEMUDEV_DEFAULT_OPTS="-xen-domid 0 -xen-attach -name dom0 \
+ -nographic -M xenpv -daemonize \
+ -monitor /dev/null -serial /dev/null -parallel /dev/null"
+
+ XENQEMUDEV_OPTS=${XENQEMUDEV_OPTS:-${XENQEMUDEV_DEFAULT_OPTS}}
+
+ start-stop-daemon --start --exec ${XEN_QEMU} \
+ --pidfile ${XENQEMUDEV_PIDFILE} \
+ -- -pidfile ${XENQEMUDEV_PIDFILE} \
+ ${XENQEMUDEV_OPTS}
+ return $?
+ fi
+}
+
+start() {
+ ebegin "Starting xenqemudev daemon"
+
+ # not running in Xen dom0 or domU
+ if [ ! -d /proc/xen ]; then
+ eend 1 "Not running in Xen mode"
+ return 1
+ fi
+
+ if ! is_privileged_domain; then
+ eend 1 "Not running on a privileged domain. xenqemudev not started"
+ return 1
+ fi
+
+ xen_qemu_start
+
+ eend $? "Failed to start xenqemudev"
+}
+
+stop () {
+ ebegin "Stopping xenqemudev"
+
+ xen_setvars
+
+ start-stop-daemon --stop --exec ${XEN_QEMU} \
+ --pidfile ${XENQEMUDEV_PIDFILE}
+
+ eend $? "Stopping xenqemudev, as it cannot be restarted."
+}
diff --git a/app-emulation/xen-tools/files/xenstored.confd b/app-emulation/xen-tools/files/xenstored.confd
new file mode 100644
index 000000000000..31b9293aa328
--- /dev/null
+++ b/app-emulation/xen-tools/files/xenstored.confd
@@ -0,0 +1,2 @@
+# /etc/conf.d/xenstored
+XENSTORED_OPTS=""
diff --git a/app-emulation/xen-tools/files/xenstored.initd b/app-emulation/xen-tools/files/xenstored.initd
new file mode 100755
index 000000000000..05bcbb2725c2
--- /dev/null
+++ b/app-emulation/xen-tools/files/xenstored.initd
@@ -0,0 +1,44 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ before xendomains xend sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
+ need xencommons
+}
+
+xenstored_dir_check() {
+ # create dir dynamically
+ local i
+ for i in /var/lock/subsys /run/xen /run/xend/boot /run/xenstored; do
+ [ -x $i ] || mkdir -p $i
+ done
+}
+
+start() {
+ ebegin "Starting xenstored daemon"
+ xenstored_dir_check
+ start-stop-daemon --start --exec /usr/sbin/xenstored \
+ --pidfile /run/xenstored.pid \
+ -- --pid-file=/run/xenstored.pid \
+ $XENSTORED_OPTS
+ until xenstore-exists / || $((15 < ++i))
+ do
+ echo -n .
+ sleep 1
+ done
+ einfo "Setting domain0 name record"
+ /usr/bin/xenstore-write "/local/domain/0/name" "Domain-0"
+ local V=$(xl info| awk "/xen_minor/ { print \$3 }")
+ [ $V -ge 4 ] && /usr/bin/xenstore-write "/local/domain/0/domid" 0
+
+ eend $*
+}
+
+stop() {
+ ebegin "Stopping xenstored daemon"
+ start-stop-daemon --stop --exec /usr/sbin/xenstored \
+ --pidfile /run/xenstored.pid
+ eend $?
+}
+
diff --git a/app-emulation/xen-tools/metadata.xml b/app-emulation/xen-tools/metadata.xml
new file mode 100644
index 000000000000..dfd18d1ce581
--- /dev/null
+++ b/app-emulation/xen-tools/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>xen</herd>
+ <use>
+ <flag name='api'>Build the C libxenapi bindings</flag>
+ <flag name='flask'>Enable the Flask XSM module from NSA</flag>
+ <flag name='hvm'>Enable support for hardware based virtualization (VT-x,AMD-v)</flag>
+ <flag name='qemu'>Enable IOEMU support via the use of qemu-dm</flag>
+ <flag name='pygrub'>Install the pygrub boot loader</flag>
+ <flag name='screen'>Enable support for running domain U console in an <pkg>app-misc/screen</pkg> session</flag>
+ <flag name='system-qemu'>Using <pkg>app-emulation/qemu</pkg> instead of the bundled one</flag>
+ <flag name='system-seabios'>Using <pkg>sys-firmware/seabios</pkg> instead of the bundled one</flag>
+ <flag name='ocaml'>Enable support for the ocaml language</flag>
+ <flag name='ovmf'>Enable support to boot UEFI guest vm, needed by hvm</flag>
+ <flag name='pam'>Enable pam support</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/xen-tools/xen-tools-4.2.5-r10.ebuild b/app-emulation/xen-tools/xen-tools-4.2.5-r10.ebuild
new file mode 100644
index 000000000000..852e499aec22
--- /dev/null
+++ b/app-emulation/xen-tools/xen-tools-4.2.5-r10.ebuild
@@ -0,0 +1,391 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='xml,threads'
+
+if [[ $PV == *9999 ]]; then
+ KEYWORDS=""
+ REPO="xen-unstable.hg"
+ EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
+ S="${WORKDIR}/${REPO}"
+ live_eclass="mercurial"
+else
+ KEYWORDS="amd64 x86"
+ UPSTREAM_VER=9
+ SECURITY_VER=6
+ # xen-tools's gentoo patches tarball
+ GENTOO_VER=1
+ # xen-tools's gentoo patches version which apply to this specific ebuild
+ GENTOO_GPV=0
+ SEABIOS_VER=1.6.3.2
+
+ [[ -n ${UPSTREAM_VER} ]] && \
+ UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
+ [[ -n ${SECURITY_VER} ]] && \
+ SECURITY_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz"
+ [[ -n ${GENTOO_VER} ]] && \
+ GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools/}-gentoo-patches-${GENTOO_VER}.tar.xz"
+
+ SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
+ http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
+ http://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
+ ${UPSTREAM_PATCHSET_URI}
+ ${SECURITY_PATCHSET_URI}
+ ${GENTOO_PATCHSET_URI}"
+ S="${WORKDIR}/xen-${PV}"
+fi
+
+inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs udev ${live_eclass}
+
+DESCRIPTION="Xend daemon and tools"
+HOMEPAGE="http://xen.org/"
+DOCS=( README docs/README.xen-bugtool )
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="api custom-cflags debug doc flask hvm qemu ocaml pygrub screen static-libs system-seabios"
+
+REQUIRED_USE="hvm? ( qemu )
+ ${PYTHON_REQUIRED_USE}"
+
+DEPEND="dev-libs/lzo:2
+ dev-libs/glib:2
+ dev-libs/yajl
+ dev-libs/libgcrypt:0
+ dev-python/lxml[${PYTHON_USEDEP}]
+ dev-python/pypam[${PYTHON_USEDEP}]
+ sys-libs/zlib
+ sys-power/iasl
+ system-seabios? ( sys-firmware/seabios )
+ sys-firmware/ipxe
+ dev-ml/findlib
+ hvm? ( media-libs/libsdl )
+ ${PYTHON_DEPS}
+ api? ( dev-libs/libxml2
+ net-misc/curl )
+ ${PYTHON_DEPS}
+ pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )
+ sys-devel/bin86
+ sys-devel/dev86
+ dev-lang/perl
+ app-misc/pax-utils
+ doc? (
+ app-doc/doxygen
+ dev-tex/latex2html[png,gif]
+ media-gfx/transfig
+ media-gfx/graphviz
+ dev-tex/xcolor
+ dev-texlive/texlive-latexextra
+ virtual/latex-base
+ dev-tex/latexmk
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-latexrecommended
+ )
+ hvm? ( x11-proto/xproto
+ !net-libs/libiscsi )"
+RDEPEND="sys-apps/iproute2
+ net-misc/bridge-utils
+ ocaml? ( >=dev-lang/ocaml-4 )
+ screen? (
+ app-misc/screen
+ app-admin/logrotate
+ )
+ virtual/udev"
+
+# hvmloader is used to bootstrap a fully virtualized kernel
+# Approved by QA team in bug #144032
+QA_WX_LOAD="usr/lib/xen/boot/hvmloader"
+
+RESTRICT="test"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ export "CONFIG_LOMOUNT=y"
+
+ #bug 522642, disable compile tools/tests
+ export "CONFIG_TESTS=n"
+
+ if has_version dev-libs/libgcrypt:0; then
+ export "CONFIG_GCRYPT=y"
+ fi
+
+ if use qemu; then
+ export "CONFIG_IOEMU=y"
+ else
+ export "CONFIG_IOEMU=n"
+ fi
+
+ 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"
+ else
+ die "Unsupported architecture!"
+ fi
+ fi
+
+ use api && export "LIBXENAPI_BINDINGS=y"
+ use flask && export "FLASK_ENABLE=y"
+}
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${UPSTREAM_VER} ]]; then
+ einfo "Try to apply Xen Upstream patcheset"
+ 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 patcheset"
+ source "${WORKDIR}"/patches-security/${PV}.conf
+ # apply main xen patches
+ for i in ${XEN_SECURITY_MAIN}; do
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-security/xen/$i
+ done
+
+ # apply qemu-traditional patches
+ pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
+ for i in ${XEN_SECURITY_QEMUT}; do
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-security/qemut/$i
+ done
+ popd > /dev/null
+
+ # apply qemu-xen/upstream patches
+ pushd "${S}"/tools/qemu-xen/ > /dev/null
+ for i in ${XEN_SECURITY_QEMUU}; do
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-security/qemuu/$i
+ done
+ popd > /dev/null
+ fi
+
+ # Gentoo's patchset
+ if [[ -n ${GENTOO_VER} && -n ${GENTOO_GPV} ]]; then
+ einfo "Try to apply Gentoo specific patcheset"
+ source "${FILESDIR}"/gentoo-patches.conf
+ _gpv=_gpv_${PN/-/_}_${PV//./}_${GENTOO_GPV}
+ for i in ${!_gpv}; do
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-gentoo/$i
+ done
+ fi
+
+ use system-seabios && epatch "${WORKDIR}"/patches-gentoo/${PN}-4-unbundle-seabios.patch
+
+ if gcc-specs-pie; then
+ epatch "${WORKDIR}"/patches-gentoo/ipxe-nopie.patch
+ fi
+
+ # 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"
+ fi
+
+ if ! use pygrub; then
+ sed -e '/^SUBDIRS-$(PYTHON_TOOLS) += pygrub$/d' -i tools/Makefile || die
+ fi
+
+ # Disable hvm support on systems that don't support x86_32 binaries.
+ if ! use hvm; then
+ sed -e '/^CONFIG_IOEMU := y$/d' -i config/*.mk || die
+ 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
+
+ # Don't bother with qemu, only needed for fully virtualised guests
+ if ! use qemu; then
+ sed -e "/^CONFIG_IOEMU := y$/d" -i config/*.mk || die
+ sed -e "s:install-tools\: tools/ioemu-dir:install-tools\: :g" -i Makefile || die
+ fi
+
+ 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
+
+ # 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
+
+ # Bug 445986
+ sed -e 's:$(MAKE) PYTHON=$(PYTHON) subdirs-$@:LC_ALL=C "$(MAKE)" PYTHON=$(PYTHON) subdirs-$@:' -i tools/firmware/Makefile || die
+
+ # fix QA warning, create /var/run/, /var/lock dynamically
+ sed -i -e "/\$(INSTALL_DIR) \$(DESTDIR)\$(XEN_RUN_DIR)/d" \
+ tools/libxl/Makefile || die
+
+ sed -i -e "/\/var\/run\//d" \
+ tools/xenstore/Makefile \
+ tools/pygrub/Makefile || die
+
+ sed -i -e "/\/var\/lock\/subsys/d" \
+ tools/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 || die
+
+ epatch_user
+}
+
+src_compile() {
+ export VARTEXFONTS="${T}/fonts"
+ local myopt
+ use debug && myopt="${myopt} debug=y"
+
+ use custom-cflags || unset CFLAGS
+ if test-flag-CC -fno-strict-overflow; then
+ append-flags -fno-strict-overflow
+ fi
+
+ unset LDFLAGS
+ unset CFLAGS
+ emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
+
+ use doc && emake -C docs txt html
+ emake -C docs man-pages
+}
+
+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}" install-tools \
+ XEN_PYTHON_NATIVE_INSTALL=y install-tools
+ # Fix the remaining Python shebangs.
+ python_fix_shebang "${ED}"
+
+ # Remove RedHat-specific stuff
+ rm -rf "${D}"tmp || die
+
+ # uncomment lines in xl.conf
+ sed -e 's:^#autoballoon=1:autoballoon=1:' \
+ -e 's:^#lockfile="/var/lock/xl":lockfile="/var/lock/xl":' \
+ -e 's:^#vifscript="vif-bridge":vifscript="vif-bridge":' \
+ -i tools/examples/xl.conf || die
+
+ if use doc; then
+ emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
+
+ dohtml -r docs/
+ docinto pdf
+ dodoc ${DOCS[@]}
+ [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
+ fi
+
+ rm -rf "${D}"/usr/share/doc/xen/
+ doman docs/man?/*
+
+ 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 xenstored
+ newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
+ newinitd "${FILESDIR}"/xencommons.initd xencommons
+ newconfd "${FILESDIR}"/xencommons.confd xencommons
+
+ if use screen; then
+ cat "${FILESDIR}"/xendomains-screen.confd >> "${ED}"/etc/conf.d/xendomains || die
+ cp "${FILESDIR}"/xen-consoles.logrotate "${ED}"/etc/xen/ || die
+ keepdir /var/log/xen-consoles
+ fi
+
+ if [[ "${ARCH}" == 'amd64' ]] && use qemu; then
+ mkdir -p "${D}"usr/$(get_libdir)/xen/bin || die
+ mv "${D}"usr/lib/xen/bin/qemu* "${D}"usr/$(get_libdir)/xen/bin/ || die
+ 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
+
+ # xend expects these to exist
+ keepdir /var/lib/xenstored /var/xen/dump /var/lib/xen /var/log/xen
+
+ # for xendomains
+ keepdir /etc/xen/auto
+
+ # Temp QA workaround
+ dodir "$(get_udevdir)"
+ mv "${D}"/etc/udev/* "${D}/$(get_udevdir)"
+ rm -rf "${D}"/etc/udev
+
+ # 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 "http://www.gentoo.org/doc/en/xen-gu"${D}"usr/ide.xml"
+ elog "http://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"
+
+ # TODO: we need to have the current Python slot here.
+ if ! has_version "dev-lang/python[ncurses]"; then
+ echo
+ ewarn "NB: Your dev-lang/python is built without USE=ncurses."
+ ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
+ fi
+
+ if has_version "sys-apps/iproute2[minimal]"; then
+ echo
+ ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
+ ewarn "will not work until you rebuild iproute2 without USE=minimal."
+ fi
+
+ 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 grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
+ echo
+ elog "xensv is broken upstream (Gentoo bug #142011)."
+ elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
+ fi
+}
diff --git a/app-emulation/xen-tools/xen-tools-4.5.1-r3.ebuild b/app-emulation/xen-tools/xen-tools-4.5.1-r3.ebuild
new file mode 100644
index 000000000000..d24a5b87d348
--- /dev/null
+++ b/app-emulation/xen-tools/xen-tools-4.5.1-r3.ebuild
@@ -0,0 +1,458 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_PV=${PV/_/-}
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='xml,threads'
+
+if [[ $PV == *9999 ]]; then
+ KEYWORDS=""
+ REPO="xen-unstable.hg"
+ EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
+ S="${WORKDIR}/${REPO}"
+ live_eclass="mercurial"
+else
+ KEYWORDS="amd64 ~arm ~arm64 -x86"
+ UPSTREAM_VER=0
+ SECURITY_VER=6
+ # xen-tools's gentoo patches tarball
+ GENTOO_VER=4
+ # xen-tools's gentoo patches version which apply to this specific ebuild
+ GENTOO_GPV=0
+ # xen-tools ovmf's patches
+ OVMF_VER=1
+
+ SEABIOS_VER=1.7.5
+ OVMF_PV=20150629
+
+ [[ -n ${UPSTREAM_VER} ]] && \
+ UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-tools/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
+ [[ -n ${SECURITY_VER} ]] && \
+ SECURITY_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz"
+ [[ -n ${GENTOO_VER} ]] && \
+ GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-gentoo-patches-${GENTOO_VER}.tar.xz"
+ [[ -n ${OVMF_VER} ]] && \
+ OVMF_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN/-tools}-ovmf-patches-${OVMF_VER}.tar.xz"
+
+ SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/xen-${MY_PV}.tar.gz
+ http://code.coreboot.org/p/seabios/downloads/get/seabios-${SEABIOS_VER}.tar.gz
+ http://dev.gentoo.org/~dlan/distfiles/seabios-${SEABIOS_VER}.tar.gz
+ ovmf? ( http://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
+
+inherit bash-completion-r1 eutils flag-o-matic multilib python-single-r1 toolchain-funcs udev ${live_eclass}
+
+DESCRIPTION="Xend daemon and tools"
+HOMEPAGE="http://xen.org/"
+DOCS=( README docs/README.xen-bugtool )
+
+LICENSE="GPL-2"
+SLOT="0"
+# 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 qemu ocaml ovmf +pam python pygrub screen static-libs system-qemu system-seabios"
+
+REQUIRED_USE="hvm? ( || ( qemu system-qemu ) )
+ ${PYTHON_REQUIRED_USE}
+ pygrub? ( python )
+ ovmf? ( hvm )
+ qemu? ( !system-qemu )"
+
+COMMON_DEPEND="
+ dev-libs/lzo:2
+ dev-libs/glib:2
+ dev-libs/yajl
+ dev-libs/libaio
+ dev-libs/libgcrypt:0
+ sys-libs/zlib
+"
+
+DEPEND="${COMMON_DEPEND}
+ dev-python/lxml[${PYTHON_USEDEP}]
+ pam? ( dev-python/pypam[${PYTHON_USEDEP}] )
+ hvm? ( media-libs/libsdl )
+ ${PYTHON_DEPS}
+ api? ( dev-libs/libxml2
+ net-misc/curl )
+ pygrub? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/ncurses} )
+ ovmf? ( ${PYTHON_DEPS//${PYTHON_REQ_USE}/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
+ dev-python/markdown[${PYTHON_USEDEP}]
+ doc? (
+ app-doc/doxygen
+ dev-tex/latex2html[png,gif]
+ media-gfx/graphviz
+ dev-tex/xcolor
+ media-gfx/transfig
+ dev-texlive/texlive-latexextra
+ virtual/latex-base
+ dev-tex/latexmk
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-pictures
+ dev-texlive/texlive-latexrecommended
+ )
+ hvm? ( x11-proto/xproto
+ !net-libs/libiscsi )
+ qemu? ( x11-libs/pixman )
+ system-qemu? ( app-emulation/qemu[xen] )
+ ocaml? ( dev-ml/findlib
+ >=dev-lang/ocaml-4 )"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/iproute2
+ net-misc/bridge-utils
+ screen? (
+ app-misc/screen
+ app-admin/logrotate
+ )
+ virtual/udev"
+
+# hvmloader is used to bootstrap a fully virtualized kernel
+# Approved by QA team in bug #144032
+QA_WX_LOAD="usr/lib/xen/boot/hvmloader
+ usr/share/qemu-xen/qemu/s390-ccw.img"
+
+RESTRICT="test"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ export "CONFIG_LOMOUNT=y"
+
+ #bug 522642, disable compile tools/tests
+ export "CONFIG_TESTS=n"
+
+ if has_version dev-libs/libgcrypt:0; then
+ export "CONFIG_GCRYPT=y"
+ fi
+
+ 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() {
+ # Upstream's patchset
+ if [[ -n ${UPSTREAM_VER} ]]; then
+ einfo "Try to apply Xen Upstream patcheset"
+ 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 patcheset"
+ source "${WORKDIR}"/patches-security/${PV}.conf
+ # apply main xen patches
+ for i in ${XEN_SECURITY_MAIN}; do
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-security/xen/$i
+ done
+
+ # apply qemu-traditional patches
+ pushd "${S}"/tools/qemu-xen-traditional/ > /dev/null
+ for i in ${XEN_SECURITY_QEMUT}; do
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-security/qemut/$i
+ done
+ popd > /dev/null
+
+ # apply qemu-xen/upstream patches
+ pushd "${S}"/tools/qemu-xen/ > /dev/null
+ for i in ${XEN_SECURITY_QEMUU}; do
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-security/qemuu/$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 patcheset"
+ source "${FILESDIR}"/gentoo-patches.conf
+ _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 [[ -n ${OVMF_VER} ]] && use ovmf; then
+ einfo "Try to apply Ovmf patcheset"
+ pushd "${WORKDIR}"/ovmf-*/ > /dev/null
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-p1" \
+ epatch "${WORKDIR}"/patches-ovmf
+ popd > /dev/null
+ 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 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"
+ 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
+
+ # Don't bother with qemu, only needed for fully virtualised guests
+ if ! use qemu; then
+ 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
+
+ # 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
+
+ # use /var instead of /var/lib, consistat with previous ebuild
+ sed -i -e "/XEN_LOCK_DIR=/s/\$localstatedir/\/var/g" \
+ m4/paths.m4 configure tools/configure || die
+ # use /run instead of /var/run
+ sed -i -e "/XEN_RUN_DIR=/s/\$localstatedir//g" \
+ m4/paths.m4 configure tools/configure || die
+
+ # 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
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf="--prefix=${PREFIX}/usr \
+ --libdir=${PREFIX}/usr/$(get_libdir) \
+ --libexecdir=${PREFIX}/usr/libexec \
+ --disable-werror \
+ --disable-xen \
+ --enable-tools \
+ --enable-docs \
+ $(use_with system-qemu) \
+ $(use_enable pam) \
+ $(use_enable api xenapi) \
+ $(use_enable ovmf) \
+ $(use_enable ocaml ocamltools) \
+ "
+ use system-seabios && myconf+=" --with-system-seabios=/usr/share/seabios/bios.bin"
+ use qemu || myconf+=" --with-system-qemu"
+ use amd64 && myconf+=" --enable-qemu-traditional"
+ econf ${myconf}
+}
+
+src_compile() {
+ export VARTEXFONTS="${T}/fonts"
+ local myopt
+ use debug && myopt="${myopt} debug=y"
+
+ use custom-cflags || unset CFLAGS
+ if test-flag-CC -fno-strict-overflow; then
+ append-flags -fno-strict-overflow
+ fi
+
+ unset LDFLAGS
+ unset CFLAGS
+ emake V=1 CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" -C tools ${myopt}
+
+ use doc && emake -C docs txt html
+ emake -C docs man-pages
+}
+
+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
+
+ # Fix the remaining Python shebangs.
+ python_fix_shebang "${D}"
+
+ # Remove RedHat-specific stuff
+ rm -rf "${D}"tmp || die
+
+ if use doc; then
+ emake DESTDIR="${D}" DOCDIR="/usr/share/doc/${PF}" install-docs
+
+ dohtml -r docs/
+ docinto pdf
+ dodoc ${DOCS[@]}
+ [ -d "${D}"/usr/share/doc/xen ] && mv "${D}"/usr/share/doc/xen/* "${D}"/usr/share/doc/${PF}/html
+ fi
+
+ rm -rf "${D}"/usr/share/doc/xen/
+ doman docs/man?/*
+
+ 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 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
+
+ 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
+
+ # Temp QA workaround
+ dodir "$(get_udevdir)"
+ mv "${D}"/etc/udev/* "${D}/$(get_udevdir)"
+ rm -rf "${D}"/etc/udev
+
+ # 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 "http://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"
+
+ # TODO: we need to have the current Python slot here.
+ if ! has_version "dev-lang/python[ncurses]"; then
+ echo
+ ewarn "NB: Your dev-lang/python is built without USE=ncurses."
+ ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
+ fi
+
+ if has_version "sys-apps/iproute2[minimal]"; then
+ echo
+ ewarn "Your sys-apps/iproute2 is built with USE=minimal. Networking"
+ ewarn "will not work until you rebuild iproute2 without USE=minimal."
+ fi
+
+ 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
+
+ if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
+ echo
+ elog "xensv is broken upstream (Gentoo bug #142011)."
+ elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
+ fi
+}
diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest
new file mode 100644
index 000000000000..0f7dc989f572
--- /dev/null
+++ b/app-emulation/xen/Manifest
@@ -0,0 +1,4 @@
+DIST xen-4.2.5-upstream-patches-9.tar.xz 23208 SHA256 2206e9a8aeeed207abbae995c5d2baa14d5f0da4120ae44f2de733ecf7ea5af1 SHA512 8a2edaba48002449a521edf2ae078ffe1b3db4f491a85b063886a147a0be3ec7fdb819ce84c90cdae80ed34c10ab2d637506700be10052a67be6ef128fa40fb1 WHIRLPOOL 037820e0fad60d1f7ed054efa797585c992d08f1ffd533705c515ad289f8cdddc72b97f2a3d75ebd683c6bb6988d7285452b4f3cebbe9a879f701156e387ff3b
+DIST xen-4.2.5.tar.gz 15671925 SHA256 3cf440866315e8085050eb0586f0447b6b47a08dbed6a72226bf5ed5d89ec567 SHA512 42c0fc241952fc55fc44480fb6752b004b54ae40e946159ec047adf229b65cbfbd810271d01b064ad8fdbddb73c640dcdcb6bc19f91e8968829889c129920dac WHIRLPOOL 762a91c0111892b33e6bd3e7f7714709b04697ad7c2b0919fef6cc9570a343a77fd5a2b82833e75dac9d12d4e41acdcf0743b0d593595910ddd326f5cd721368
+DIST xen-4.5.1.tar.gz 18410400 SHA256 668c11d4fca67ac44329e369f810356eacd37b28d28fb96e66aac77f3c5e1371 SHA512 9436243e26bc64bc836a179abdc3a6b1b6fa9d3f2170453092c18be71fa62e18cd4465a9154c0f28a7ac8d69d08361ba1defef240a51197f058c012c3855ba04 WHIRLPOOL 71d8559f86683dd9fb3eb09d3f602de227f281fbd3c8cc258bfdb67c425d9e7c4d21cb0284c123e4263262c1b821fea6d28109861ce60d627f6426d352808d99
+DIST xen-security-patches-3.tar.xz 17028 SHA256 fb6301beb9a5c2d1e5d4de8783d8670e382b1bef48ec61e73d2d9be6901d289f SHA512 787fee8f7822577c6de91c4cf4d56d0e73ce46bac5524537ff66a718b6d7eae9d362265515743e8577b2c75f2841baed9837f71467b3b7b91a3111220da5f236 WHIRLPOOL 5c136289e654776bf918fe125fbecba7dac0929b236f7ae8158026a6bd6be12bc786a5ec96cb4022c18a5e7ffde82155deb57eb9639600e4c42c9c209f4a2ed6
diff --git a/app-emulation/xen/files/xen-4-fix_dotconfig-gcc.patch b/app-emulation/xen/files/xen-4-fix_dotconfig-gcc.patch
new file mode 100644
index 000000000000..c0dbd20ece46
--- /dev/null
+++ b/app-emulation/xen/files/xen-4-fix_dotconfig-gcc.patch
@@ -0,0 +1,37 @@
+# Fix gcc-4.6
+diff -ur xen-4.2.0.orig/extras/mini-os/minios.mk xen-4.2.0/extras/mini-os/minios.mk
+--- extras/mini-os/minios.mk 2012-09-17 18:21:17.000000000 +0800
++++ extras/mini-os/minios.mk 2012-12-05 14:01:10.653260260 +0800
+@@ -6,7 +6,7 @@
+
+ # Define some default flags.
+ # NB. '-Wcast-qual' is nasty, so I omitted it.
+-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
++DEF_CFLAGS += -fno-builtin -Wall -Wredundant-decls -Wno-format -Wno-redundant-decls
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+diff -ur xen-4.2.0.orig/tools/libxc/Makefile xen-4.2.0/tools/libxc/Makefile
+--- tools/libxc/Makefile 2012-09-17 18:21:18.000000000 +0800
++++ tools/libxc/Makefile 2012-12-05 14:01:10.653260260 +0800
+@@ -73,7 +73,7 @@
+
+ -include $(XEN_TARGET_ARCH)/Makefile
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ CFLAGS += -I. $(CFLAGS_xeninclude)
+
+ # Needed for posix_fadvise64() in xc_linux.c
+# Drop .config
+diff -ur xen-4.2.0.orig/Config.mk xen-4.2.0/Config.mk
+--- Config.mk 2012-09-17 18:23:12.000000000 +0800
++++ Config.mk 2012-12-05 14:01:10.641260261 +0800
+@@ -7,7 +7,6 @@
+ # fallback for older make
+ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
+--include $(XEN_ROOT)/.config
+
+ # A debug build of Xen and tools?
+ debug ?= n
diff --git a/app-emulation/xen/files/xen-4.2-efi.patch b/app-emulation/xen/files/xen-4.2-efi.patch
new file mode 100644
index 000000000000..6e38aaa985df
--- /dev/null
+++ b/app-emulation/xen/files/xen-4.2-efi.patch
@@ -0,0 +1,33 @@
+diff -ur xen-4.2.0.orig/xen/arch/x86/Makefile xen-4.2.0/xen/arch/x86/Makefile
+--- xen/arch/x86/Makefile 2012-09-17 18:21:19.000000000 +0800
++++ xen/arch/x86/Makefile 2013-02-23 20:37:30.679918815 +0800
+@@ -112,7 +112,7 @@
+ $(@D)/.$(@F).1.o -o $@
+ rm -f $(@D)/.$(@F).[0-9]*
+
+-EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
++EFI_LDFLAGS = -mi386pep $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
+ EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug
+ EFI_LDFLAGS += --section-alignment=0x200000 --file-alignment=0x20
+ EFI_LDFLAGS += --major-image-version=$(XEN_VERSION)
+--- xen/Makefile 2013-03-07 14:34:01.819453278 +0000
++++ xen/Makefile 2013-03-07 15:56:44.753044655 +0000
+@@ -31,9 +31,15 @@
+ _install: $(TARGET).gz
+ [ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
+ $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
+- ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
+- ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
+- ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
++ if [ 'x$(EFI_VENDOR)' == 'x' ]; then \
++ ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz; \
++ ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz; \
++ ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz; \
++ else \
++ cp $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz; \
++ cp $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz; \
++ cp $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz; \
++ fi; \
+ $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
+ if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
+ [ -d $(DESTDIR)$(EFI_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(EFI_DIR); \
diff --git a/app-emulation/xen/files/xen-4.3-fix_dotconfig-gcc.patch b/app-emulation/xen/files/xen-4.3-fix_dotconfig-gcc.patch
new file mode 100644
index 000000000000..588be7469760
--- /dev/null
+++ b/app-emulation/xen/files/xen-4.3-fix_dotconfig-gcc.patch
@@ -0,0 +1,220 @@
+# Fix gcc-4.6
+diff -ur xen-4.2.0.orig/extras/mini-os/minios.mk xen-4.2.0/extras/mini-os/minios.mk
+--- extras/mini-os/minios.mk 2012-09-17 18:21:17.000000000 +0800
++++ extras/mini-os/minios.mk 2012-12-05 14:01:10.653260260 +0800
+@@ -6,7 +6,7 @@
+
+ # Define some default flags.
+ # NB. '-Wcast-qual' is nasty, so I omitted it.
+-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
++DEF_CFLAGS += -fno-builtin -Wall -Wredundant-decls -Wno-format -Wno-redundant-decls
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+diff -ur xen-4.2.0.orig/tools/libxc/Makefile xen-4.2.0/tools/libxc/Makefile
+--- tools/libxc/Makefile 2012-09-17 18:21:18.000000000 +0800
++++ tools/libxc/Makefile 2012-12-05 14:01:10.653260260 +0800
+@@ -85,7 +85,7 @@
+
+ -include $(XEN_TARGET_ARCH)/Makefile
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ CFLAGS += -I. $(CFLAGS_xeninclude)
+
+ # Needed for posix_fadvise64() in xc_linux.c
+# Drop .config
+diff -ur xen-4.2.0.orig/Config.mk xen-4.2.0/Config.mk
+--- Config.mk 2012-09-17 18:23:12.000000000 +0800
++++ Config.mk 2012-12-05 14:01:10.641260261 +0800
+@@ -7,7 +7,6 @@ Drop .config
+ # fallback for older make
+ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
+--include $(XEN_ROOT)/.config
+
+ # A debug build of Xen and tools?
+ debug ?= n
+@@ -24,7 +24,7 @@
+
+ # Tools to run on system hosting the build
+ HOSTCC = gcc
+-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS = -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
+
+ DISTDIR ?= $(XEN_ROOT)/dist
+@@ -156,7 +156,7 @@
+
+ CFLAGS += -std=gnu99
+
+-CFLAGS += -Wall -Wstrict-prototypes
++CFLAGS += -Wstrict-prototypes
+
+ # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
+ # and is over-zealous with the printf format lint
+diff -ur xen-4.2.1.orig/tools/blktap2/drivers/Makefile xen-4.2.1/tools/blktap2/drivers/Makefile
+--- tools/blktap2/drivers/Makefile 2012-12-17 23:00:11.000000000 +0800
++++ tools/blktap2/drivers/Makefile 2013-01-30 12:31:43.539941099 +0800
+@@ -9,7 +9,7 @@
+ LOCK_UTIL = lock-util
+ INST_DIR = $(SBINDIR)
+
+-CFLAGS += -Werror -g
++CFLAGS += -g
+ CFLAGS += -Wno-unused
+ CFLAGS += -fno-strict-aliasing
+ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
+diff -ur xen-4.2.1.orig/tools/debugger/gdbsx/Rules.mk xen-4.2.1/tools/debugger/gdbsx/Rules.mk
+--- tools/debugger/gdbsx/Rules.mk 2012-12-17 23:00:22.000000000 +0800
++++ tools/debugger/gdbsx/Rules.mk 2013-01-30 12:31:43.516941098 +0800
+@@ -1,4 +1,4 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ # (gcc 4.3x and later) -Wconversion -Wno-sign-conversion
+diff -ur xen-4.2.1.orig/tools/libaio/harness/Makefile xen-4.2.1/tools/libaio/harness/Makefile
+--- tools/libaio/harness/Makefile 2012-12-17 23:00:35.000000000 +0800
++++ tools/libaio/harness/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -4,7 +4,7 @@
+ HARNESS_SRCS:=main.c
+ # io_queue.c
+
+-CFLAGS=-Wall -Werror -g -O -laio
++CFLAGS=-Wall -g -O -laio
+ #-lpthread -lrt
+
+ all: $(PROGS)
+diff -ur xen-4.2.1.orig/tools/libfsimage/Rules.mk xen-4.2.1/tools/libfsimage/Rules.mk
+--- tools/libfsimage/Rules.mk 2012-12-17 23:00:36.000000000 +0800
++++ tools/libfsimage/Rules.mk 2013-01-30 12:31:43.515941097 +0800
+@@ -1,7 +1,7 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+ CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+-CFLAGS += -Werror -D_GNU_SOURCE
++CFLAGS += -D_GNU_SOURCE
+ LDFLAGS += -L../common/
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+diff -ur xen-4.2.1.orig/tools/libxl/Makefile xen-4.2.1/tools/libxl/Makefile
+--- tools/libxl/Makefile 2012-12-17 23:01:08.000000000 +0800
++++ tools/libxl/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -11,7 +11,7 @@
+ XLUMAJOR = 1.0
+ XLUMINOR = 1
+
+-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
++CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+ CFLAGS += -I. -fPIC
+
+diff -ur xen-4.2.1.orig/tools/qemu-xen/pc-bios/optionrom/Makefile xen-4.2.1/tools/qemu-xen/pc-bios/optionrom/Makefile
+--- tools/qemu-xen/pc-bios/optionrom/Makefile 2012-09-11 02:10:52.000000000 +0800
++++ tools/qemu-xen/pc-bios/optionrom/Makefile 2013-01-30 12:31:43.528941098 +0800
+@@ -9,7 +9,7 @@
+
+ .PHONY : all clean build-all
+
+-CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
++CFLAGS := -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-builtin
+ CFLAGS += -I$(SRC_PATH)
+ CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
+ QEMU_CFLAGS = $(CFLAGS)
+diff -ur xen-4.2.1.orig/tools/xenstat/xentop/Makefile xen-4.2.1/tools/xenstat/xentop/Makefile
+--- tools/xenstat/xentop/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/xenstat/xentop/Makefile 2013-01-30 12:31:43.535941098 +0800
+@@ -18,7 +18,7 @@
+ all install xentop:
+ else
+
+-CFLAGS += -DGCC_PRINTF -Wall -Werror $(CFLAGS_libxenstat)
++CFLAGS += -DGCC_PRINTF -Wall $(CFLAGS_libxenstat)
+ LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
+ CFLAGS += -DHOST_$(XEN_OS)
+
+diff -ur xen-4.2.1.orig/xen/arch/arm/Rules.mk xen-4.2.1/xen/arch/arm/Rules.mk
+--- xen/arch/arm/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/arm/Rules.mk 2013-01-30 12:31:43.498941097 +0800
+@@ -9,7 +9,7 @@
+ HAS_DEVICE_TREE := y
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+
+ # Prevent floating-point variables from creeping into Xen.
+diff -ur xen-4.2.1.orig/xen/arch/x86/Rules.mk xen-4.2.1/xen/arch/x86/Rules.mk
+--- xen/arch/x86/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/x86/Rules.mk 2013-01-30 12:31:43.490941096 +0800
+@@ -24,7 +24,7 @@
+ endif
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
+diff -ur xen-4.2.1.orig/xen/include/Makefile xen-4.2.1/xen/include/Makefile
+--- xen/include/Makefile 2012-12-17 23:01:55.000000000 +0800
++++ xen/include/Makefile 2013-01-30 12:31:43.502941097 +0800
+@@ -78,7 +78,7 @@
+ all: headers.chk
+
+ headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
+- for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
++ for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
+ mv $@.new $@
+
+ endif
+diff -ur xen-4.2.1.orig/tools/tests/mce-test/tools/Makefile xen-4.2.1/tools/tests/mce-test/tools/Makefile
+--- tools/tests/mce-test/tools/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mce-test/tools/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_libxenstore)
+diff -ur xen-4.2.1.orig/tools/tests/mem-sharing/Makefile xen-4.2.1/tools/tests/mem-sharing/Makefile
+--- tools/tests/mem-sharing/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mem-sharing/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.2.1.orig/tools/tests/xen-access/Makefile xen-4.2.1/tools/tests/xen-access/Makefile
+--- tools/tests/xen-access/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/xen-access/Makefile 2013-01-30 13:01:44.891020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+diff -ur xen-4.3.0.orig/tools/firmware/Rules.mk xen-4.3.0/tools/firmware/Rules.mk
+--- tools/firmware/Rules.mk 2013-07-09 18:46:56.000000000 +0800
++++ ttools/firmware/Rules.mk 2013-07-20 20:28:57.811836505 +0800
+@@ -11,8 +11,6 @@
+ CFLAGS += -DNDEBUG
+ endif
+
+-CFLAGS += -Werror
+-
+ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
+
+ # Extra CFLAGS suitable for an embedded type of environment.
diff --git a/app-emulation/xen/files/xen-4.4-efi.patch b/app-emulation/xen/files/xen-4.4-efi.patch
new file mode 100644
index 000000000000..c584d141d4f2
--- /dev/null
+++ b/app-emulation/xen/files/xen-4.4-efi.patch
@@ -0,0 +1,36 @@
+diff --git a/xen/Makefile b/xen/Makefile
+index 39839a3..d2603f0 100644
+--- a/xen/Makefile
++++ b/xen/Makefile
+@@ -38,9 +38,15 @@ _install: Z=$(CONFIG_XEN_INSTALL_SUFFIX)
+ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
+ [ -d $(D)/boot ] || $(INSTALL_DIR) $(D)/boot
+ $(INSTALL_DATA) $(TARGET)$(Z) $(D)/boot/$(T)-$(XEN_FULLVERSION)$(Z)
+- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z)
+- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)-$(XEN_VERSION)$(Z)
+- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)$(Z)
++ if [ 'x$(EFI_VENDOR)' == 'x' ]; then \
++ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z); \
++ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)-$(XEN_VERSION)$(Z);\
++ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)/boot/$(T)$(Z); \
++ else \
++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)/boot/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z); \
++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)/boot/$(T)-$(XEN_VERSION)$(Z);\
++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)/boot/$(T)$(Z); \
++ fi; \
+ $(INSTALL_DATA) $(TARGET)-syms $(D)/boot/$(T)-syms-$(XEN_FULLVERSION)
+ if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
+ [ -d $(D)$(EFI_DIR) ] || $(INSTALL_DIR) $(D)$(EFI_DIR); \
+diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
+index d502bdf..a2121b0 100644
+--- a/xen/arch/x86/Makefile
++++ b/xen/arch/x86/Makefile
+@@ -112,7 +112,7 @@ $(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o
+ $(@D)/.$(@F).1.o -o $@
+ rm -f $(@D)/.$(@F).[0-9]*
+
+-EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
++EFI_LDFLAGS = -mi386pep $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
+ EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug
+ EFI_LDFLAGS += --section-alignment=0x200000 --file-alignment=0x20
+ EFI_LDFLAGS += --major-image-version=$(XEN_VERSION)
diff --git a/app-emulation/xen/files/xen-4.5-efi.patch b/app-emulation/xen/files/xen-4.5-efi.patch
new file mode 100644
index 000000000000..76ff44adc562
--- /dev/null
+++ b/app-emulation/xen/files/xen-4.5-efi.patch
@@ -0,0 +1,37 @@
+diff --git a/xen/Makefile b/xen/Makefile
+index 39839a3..d2603f0 100644
+--- a/xen/Makefile
++++ b/xen/Makefile
+@@ -38,9 +38,15 @@ _install: Z=$(CONFIG_XEN_INSTALL_SUFFIX)
+ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX)
+ [ -d $(D)/boot ] || $(INSTALL_DIR) $(D)/boot
+ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_FULLVERSION)$(Z)
+- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z)
+- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z)
+- ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z)
++ if [ 'x$(EFI_VENDOR)' == 'x' ]; then \
++ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z); \
++ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z);\
++ ln -f -s $(T)-$(XEN_FULLVERSION)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z); \
++ else \
++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION).$(XEN_SUBVERSION)$(Z); \
++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)-$(XEN_VERSION)$(Z);\
++ $(INSTALL_DATA) $(TARGET)$(Z) $(D)$(BOOT_DIR)/$(T)$(Z); \
++ fi; \
+ $(INSTALL_DATA) $(TARGET)-syms $(D)$(BOOT_DIR)/$(T)-syms-$(XEN_FULLVERSION)
+ if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \
+ [ -d $(D)$(EFI_DIR) ] || $(INSTALL_DIR) $(D)$(EFI_DIR); \
+diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
+index d502bdf..a2121b0 100644
+--- a/xen/arch/x86/Makefile
++++ b/xen/arch/x86/Makefile
+@@ -112,7 +112,7 @@ $(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o
+ $(@D)/.$(@F).1.o -o $@
+ rm -f $(@D)/.$(@F).[0-9]*
+
+-EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
++EFI_LDFLAGS = -mi386pep $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
+ EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug
+ EFI_LDFLAGS += --section-alignment=0x200000 --file-alignment=0x20
+ EFI_LDFLAGS += --major-image-version=$(XEN_VERSION)
+
diff --git a/app-emulation/xen/metadata.xml b/app-emulation/xen/metadata.xml
new file mode 100644
index 000000000000..67c5e0f5daf2
--- /dev/null
+++ b/app-emulation/xen/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>xen</herd>
+ <use>
+ <flag name='flask'>Enable the Flask XSM module from NSA</flag>
+ <flag name='pae'>Enable support for PAE kernels (usually x86-32 with >4GB memory)</flag>
+ <flag name='xsm'>Enable the Xen Security Modules (XSM)</flag>
+ <flag name='efi'>Adds efi boot support, requires LDFLAG -melf_x86_64 for amd64</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/xen/xen-4.2.5-r11.ebuild b/app-emulation/xen/xen-4.2.5-r11.ebuild
new file mode 100644
index 000000000000..633e45ffddc2
--- /dev/null
+++ b/app-emulation/xen/xen-4.2.5-r11.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+if [[ $PV == *9999 ]]; then
+ KEYWORDS=""
+ REPO="xen-unstable.hg"
+ EHG_REPO_URI="http://xenbits.xensource.com/${REPO}"
+ S="${WORKDIR}/${REPO}"
+ live_eclass="mercurial"
+else
+ KEYWORDS="amd64 x86"
+ UPSTREAM_VER=9
+ SECURITY_VER=3
+ GENTOO_VER=
+
+ [[ -n ${UPSTREAM_VER} ]] && \
+ UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
+ [[ -n ${SECURITY_VER} ]] && \
+ SECURITY_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
+ [[ -n ${GENTOO_VER} ]] && \
+ GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
+ SRC_URI="http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
+ ${UPSTREAM_PATCHSET_URI}
+ ${SECURITY_PATCHSET_URI}
+ ${GENTOO_PATCHSET_URI}"
+fi
+
+inherit mount-boot flag-o-matic python-any-r1 toolchain-funcs eutils ${live_eclass}
+
+DESCRIPTION="The Xen virtual machine monitor"
+HOMEPAGE="http://xen.org/"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug efi flask pae xsm"
+
+DEPEND="${PYTHON_DEPS}
+ efi? ( >=sys-devel/binutils-2.22[multitarget] )
+ !efi? ( >=sys-devel/binutils-2.22[-multitarget] )"
+RDEPEND=""
+PDEPEND="~app-emulation/xen-tools-${PV}"
+
+RESTRICT="test"
+
+# Approved by QA team in bug #144032
+QA_WX_LOAD="boot/xen-syms-${PV}"
+
+REQUIRED_USE="
+ flask? ( xsm )
+ "
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+ 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"
+ else
+ die "Unsupported architecture!"
+ fi
+ fi
+
+ if use flask ; then
+ export "XSM_ENABLE=y"
+ export "FLASK_ENABLE=y"
+ elif use xsm ; then
+ export "XSM_ENABLE=y"
+ fi
+}
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${UPSTREAM_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-p1" \
+ epatch "${WORKDIR}"/patches-upstream
+ fi
+
+ # Security patchset
+ if [[ -n ${SECURITY_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-p1" \
+ epatch "${WORKDIR}/patches-security/${PV}"
+ fi
+
+ # Gentoo's patchset
+ if [[ -n ${GENTOO_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-gentoo
+ fi
+
+ # Drop .config and fix gcc-4.6
+ epatch "${FILESDIR}"/${PN/-pvgrub/}-4-fix_dotconfig-gcc.patch
+
+ if use efi; then
+ epatch "${FILESDIR}"/${PN}-4.2-efi.patch
+ export EFI_VENDOR="gentoo"
+ export EFI_MOUNTPOINT="boot"
+ fi
+
+ # 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 custom-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"
+ fi
+
+ # not strictly necessary to fix this
+ sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
+
+ epatch_user
+}
+
+src_configure() {
+ use debug && myopt="${myopt} debug=y"
+ use pae && myopt="${myopt} pae=y"
+
+ if use custom-cflags; then
+ filter-flags -fPIE -fstack-protector
+ replace-flags -O3 -O2
+ else
+ unset CFLAGS
+ fi
+}
+
+src_compile() {
+ # Send raw LDFLAGS so that --as-needed works
+ emake CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
+}
+
+src_install() {
+ local myopt
+ use debug && myopt="${myopt} debug=y"
+ use pae && myopt="${myopt} pae=y"
+
+ # The 'make install' doesn't 'mkdir -p' the subdirs
+ if use efi; then
+ mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
+ fi
+
+ emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
+}
+
+pkg_postinst() {
+ elog "Official Xen Guide and the unoffical wiki page:"
+ elog " https://wiki.gentoo.org/wiki/Xen"
+ elog " http://en.gentoo-wiki.com/wiki/Xen/"
+
+ use pae && ewarn "This is a PAE build of Xen. It will *only* boot PAE kernels!"
+ use efi && einfo "The efi executable is installed in boot/efi/gentoo"
+}
diff --git a/app-emulation/xen/xen-4.5.1.ebuild b/app-emulation/xen/xen-4.5.1.ebuild
new file mode 100644
index 000000000000..51fa93a7738f
--- /dev/null
+++ b/app-emulation/xen/xen-4.5.1.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${PV/_/-}
+
+if [[ $PV == *9999 ]]; then
+ KEYWORDS=""
+ EGIT_REPO_URI="git://xenbits.xen.org/${PN}.git"
+ live_eclass="git-2"
+else
+ KEYWORDS="amd64 ~arm ~arm64 -x86"
+ UPSTREAM_VER=
+ SECURITY_VER=
+ GENTOO_VER=
+
+ [[ -n ${UPSTREAM_VER} ]] && \
+ UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
+ [[ -n ${SECURITY_VER} ]] && \
+ SECURITY_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
+ [[ -n ${GENTOO_VER} ]] && \
+ GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
+ SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/${MY_P}.tar.gz
+ ${UPSTREAM_PATCHSET_URI}
+ ${SECURITY_PATCHSET_URI}
+ ${GENTOO_PATCHSET_URI}"
+
+fi
+
+inherit mount-boot flag-o-matic python-any-r1 toolchain-funcs eutils ${live_eclass}
+
+DESCRIPTION="The Xen virtual machine monitor"
+HOMEPAGE="http://xen.org/"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug efi flask xsm"
+
+DEPEND="${PYTHON_DEPS}
+ efi? ( >=sys-devel/binutils-2.22[multitarget] )
+ !efi? ( >=sys-devel/binutils-2.22[-multitarget] )"
+RDEPEND=""
+PDEPEND="~app-emulation/xen-tools-${PV}"
+
+RESTRICT="test"
+
+# Approved by QA team in bug #144032
+QA_WX_LOAD="boot/xen-syms-${PV}"
+
+REQUIRED_USE="flask? ( xsm )
+ arm? ( debug )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+ 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
+
+ if use flask ; then
+ export "XSM_ENABLE=y"
+ export "FLASK_ENABLE=y"
+ elif use xsm ; then
+ export "XSM_ENABLE=y"
+ fi
+}
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${UPSTREAM_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-p1" \
+ epatch "${WORKDIR}"/patches-upstream
+ fi
+
+ # Security patchset
+ if [[ -n ${SECURITY_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-p1" \
+ epatch "${WORKDIR}/patches-security/${PV}"
+ fi
+
+ # Gentoo's patchset
+ if [[ -n ${GENTOO_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-gentoo
+ fi
+
+ # Drop .config
+ sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
+
+ if use efi; then
+ epatch "${FILESDIR}"/${PN}-4.5-efi.patch
+ export EFI_VENDOR="gentoo"
+ export EFI_MOUNTPOINT="boot"
+ fi
+
+ # 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 custom-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"
+ fi
+
+ # remove -Werror for gcc-4.6's sake
+ find "${S}" -name 'Makefile*' -o -name '*.mk' -o -name 'common.make' | \
+ xargs sed -i 's/ *-Werror */ /'
+ # not strictly necessary to fix this
+ sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
+
+ epatch_user
+}
+
+src_configure() {
+ use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
+
+ use debug && myopt="${myopt} debug=y"
+
+ if use custom-cflags; then
+ filter-flags -fPIE -fstack-protector
+ replace-flags -O3 -O2
+ else
+ unset CFLAGS
+ fi
+}
+
+src_compile() {
+ # Send raw LDFLAGS so that --as-needed works
+ emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
+}
+
+src_install() {
+ local myopt
+ use debug && myopt="${myopt} debug=y"
+
+ # The 'make install' doesn't 'mkdir -p' the subdirs
+ if use efi; then
+ mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
+ fi
+
+ emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
+}
+
+pkg_postinst() {
+ elog "Official Xen Guide and the unoffical wiki page:"
+ elog " https://wiki.gentoo.org/wiki/Xen"
+ elog " http://en.gentoo-wiki.com/wiki/Xen/"
+
+ use efi && einfo "The efi executable is installed in boot/efi/gentoo"
+}
diff --git a/app-emulation/xtrs/Manifest b/app-emulation/xtrs/Manifest
new file mode 100644
index 000000000000..c1505d635ca2
--- /dev/null
+++ b/app-emulation/xtrs/Manifest
@@ -0,0 +1,3 @@
+DIST ld4-631.zip 106955 SHA256 06a093c42bd5c10b431239d52c1beb1360cc41dd09fa3849ed19fbc0706f1f1d SHA512 8c6a24bc0af9326b5b935d7cdb1932b4cb714ab336167fed36f4f6d976cd80fe1d4d6a76e6374366fdc3fce623b2bdd6f9059a964bd6d29f59d6a052a1924c4a WHIRLPOOL 6ecdfc85c2415976f564579f7403bccf37865183e4a62372e9fdb9189ff1923ee56b3dcc779a8cad398c0465c8ebe1daaa1b22bf7213ae0ad81d1dbc4c83a782
+DIST ld4-631l.xd3 692 SHA256 5632011428c48169a70408c4c70e00bfb496005d615895a76a6d81a4e787055c SHA512 401d36fdfbceaf90673c5e9f821d26aa0a58b901d7e950d34361e5cde3252a070ff902019fcc1eb820fb1b2d3277e4c1da57ccc442ee407b0be4e5ca26dc2d13 WHIRLPOOL fc1fcbdde453dfd03409fed5978eadad5969c59cbab486a8de315a303fcd0a236a1d18356b3373cef6b27e9234053730db76a90cc79ded977522ee5fc487fb2a
+DIST xtrs-4.9d.tar.gz 455355 SHA256 d309b83cf6fee5acfc063401c4506974647154841f37aa18cf145811575234d4 SHA512 5d6a2e1d4c2f2df63eaec8d015ea9e485615d82b7923af5c03c394862a31b1e6be2329aca18c0fa0c7d6b984164bb9b4d18f94a3d8cd140a683c5197ddff2249 WHIRLPOOL 9776dce7365e61b95c8921f22bb752ad0c77af3467c991436b578c3e18e34a431a237526ee893612e954efc517890b28d7726f2f118ea9e64fdd37f90a969d8d
diff --git a/app-emulation/xtrs/metadata.xml b/app-emulation/xtrs/metadata.xml
new file mode 100644
index 000000000000..8f00a04f28e4
--- /dev/null
+++ b/app-emulation/xtrs/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>ulm@gentoo.org</email>
+</maintainer>
+<longdescription>
+ xtrs is a Radio Shack TRS-80 Model I/III/4/4P emulator for Unix and the
+ X Window System. It includes lower case, the real time clock, hi-res
+ graphics, serial port, parallel printer, mouse, cassette, sound and music
+ output, 5" and 8" floppy disk drives in single and double density, and
+ even hard disk drives. The emulated floppy and hard disk file formats
+ are compatible with the popular MSDOS-based emulators by Jeff Vavasour,
+ Matthew Reed, and David Keil, and (if you choose a capable enough file
+ format), all features of the original TRS-80 floppy disk controller are
+ emulated. Under Linux, physical floppy disk drives are also supported.
+ Physical cassettes can be read and written too. The user interface is a
+ bit spartan, but it gets the job done.
+</longdescription>
+<use>
+ <flag name='ls-dos'>Install LS-DOS disk images for Model 4P</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/xtrs/xtrs-4.9d-r3.ebuild b/app-emulation/xtrs/xtrs-4.9d-r3.ebuild
new file mode 100644
index 000000000000..cec4b2e0f8e8
--- /dev/null
+++ b/app-emulation/xtrs/xtrs-4.9d-r3.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic toolchain-funcs readme.gentoo
+
+DESCRIPTION="Radio Shack TRS-80 emulator"
+HOMEPAGE="http://www.tim-mann.org/xtrs.html"
+SRC_URI="http://www.tim-mann.org/trs80/${P}.tar.gz
+ ls-dos? (
+ http://www.tim-mann.org/trs80/ld4-631.zip
+ http://dev.gentoo.org/~ulm/distfiles/ld4-631l.xd3
+ )"
+
+LICENSE="xtrs ls-dos? ( freedist )"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~x86-fbsd"
+IUSE="ls-dos"
+RESTRICT="ls-dos? ( bindist )"
+
+RDEPEND="sys-libs/ncurses
+ sys-libs/readline:0
+ >=x11-libs/libX11-1.0.0"
+DEPEND="${RDEPEND}
+ ls-dos? ( app-arch/unzip dev-util/xdelta:3 )"
+
+src_prepare() {
+ sed -i -e 's/$(CC) -o/$(CC) $(LDFLAGS) -o/' Makefile || die
+ if use ls-dos; then
+ cd "${WORKDIR}" || die
+ xdelta3 -d -s ld4-631.dsk "${DISTDIR}"/ld4-631l.xd3 out.dsk || die
+ mv out.dsk ld4-631.dsk || die
+ fi
+}
+
+src_compile() {
+ use ppc && append-flags -Dbig_endian
+ emake CC="$(tc-getCC)" DEBUG="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dodir /usr/bin /usr/share/xtrs/disks /usr/share/man/man1
+ emake PREFIX="${D}"/usr install
+
+ insopts -m0444
+ insinto /usr/share/xtrs/disks
+ doins cpmutil.dsk utility.dsk
+
+ if use ls-dos; then
+ doins "${WORKDIR}"/ld4-631.dsk
+ dosym disks/ld4-631.dsk /usr/share/xtrs/disk4p-0
+ dosym disks/utility.dsk /usr/share/xtrs/disk4p-1
+ fi
+
+ dodoc ChangeLog README xtrsrom4p.README cpmutil.html dskspec.html
+
+ DOC_CONTENTS="For copyright reasons, xtrs does not include actual ROM
+ images. Because of this, unless you supply your own ROM, xtrs will
+ not function in any mode except 'Model 4p' mode (a minimal free ROM
+ is included for this), which can be run like this:
+ \n\nxtrs -model 4p -diskdir /usr/share/xtrs
+ \n\nIf you already own a copy of the ROM software (e.g., if you have
+ a TRS-80 with this ROM), then you can make yourself a copy of this
+ for use with xtrs, using utilities available on the web. To load
+ your own ROM, specify the '-romfile' option, or the 'Xtrs.romfile'
+ X resource. ROM files can be in Intel hex or binary format."
+ readme.gentoo_create_doc
+}