summaryrefslogtreecommitdiff
path: root/sys-libs
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/argp-standalone/Manifest7
-rw-r--r--sys-libs/argp-standalone/argp-standalone-1.3-r2.ebuild40
-rw-r--r--sys-libs/argp-standalone/files/argp-standalone-1.3-shared.patch49
-rw-r--r--sys-libs/argp-standalone/files/argp-standalone-1.3-throw-in-funcdef.patch79
-rw-r--r--sys-libs/argp-standalone/metadata.xml16
-rw-r--r--sys-libs/binutils-libs/Manifest19
-rw-r--r--sys-libs/binutils-libs/binutils-libs-2.25.1-r2.ebuild91
-rw-r--r--sys-libs/binutils-libs/binutils-libs-2.27.ebuild94
-rw-r--r--sys-libs/binutils-libs/binutils-libs-2.28-r1.ebuild95
-rw-r--r--sys-libs/binutils-libs/binutils-libs-2.28.1.ebuild95
-rw-r--r--sys-libs/binutils-libs/binutils-libs-2.29.1.ebuild96
-rw-r--r--sys-libs/binutils-libs/binutils-libs-2.29.ebuild95
-rw-r--r--sys-libs/binutils-libs/metadata.xml15
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest10
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild127
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.0.ebuild126
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.9999.ebuild134
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild141
-rw-r--r--sys-libs/compiler-rt-sanitizers/metadata.xml7
-rw-r--r--sys-libs/compiler-rt/Manifest8
-rw-r--r--sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild144
-rw-r--r--sys-libs/compiler-rt/compiler-rt-5.0.0.ebuild97
-rw-r--r--sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild99
-rw-r--r--sys-libs/compiler-rt/compiler-rt-9999.ebuild101
-rw-r--r--sys-libs/compiler-rt/metadata.xml11
-rw-r--r--sys-libs/cracklib/Manifest7
-rw-r--r--sys-libs/cracklib/cracklib-2.9.6-r1.ebuild105
-rw-r--r--sys-libs/cracklib/files/cracklib-2.9.6-CVE-2016-6318.patch108
-rw-r--r--sys-libs/cracklib/files/cracklib-2.9.6-fix-long-word-bufferoverflow.patch43
-rw-r--r--sys-libs/cracklib/metadata.xml12
-rw-r--r--sys-libs/csu/Manifest8
-rw-r--r--sys-libs/csu/csu-79.ebuild44
-rw-r--r--sys-libs/csu/csu-85.ebuild51
-rw-r--r--sys-libs/csu/files/csu-85-arm-availability.patch18
-rw-r--r--sys-libs/csu/metadata.xml8
-rw-r--r--sys-libs/cygwin-crypt/Manifest3
-rw-r--r--sys-libs/cygwin-crypt/cygwin-crypt-1.4.ebuild41
-rw-r--r--sys-libs/cygwin-crypt/metadata.xml13
-rw-r--r--sys-libs/db/Manifest88
-rw-r--r--sys-libs/db/db-1.85-r3.ebuild50
-rw-r--r--sys-libs/db/db-3.2.9_p2.ebuild182
-rw-r--r--sys-libs/db/db-4.2.52_p5-r1.ebuild165
-rw-r--r--sys-libs/db/db-4.3.29_p1-r1.ebuild168
-rw-r--r--sys-libs/db/db-4.4.20_p4-r1.ebuild162
-rw-r--r--sys-libs/db/db-4.5.20_p2-r1.ebuild175
-rw-r--r--sys-libs/db/db-4.6.21_p4.ebuild168
-rw-r--r--sys-libs/db/db-4.7.25_p4.ebuild159
-rw-r--r--sys-libs/db/db-4.8.30-r2.ebuild180
-rw-r--r--sys-libs/db/db-5.1.29-r1.ebuild203
-rw-r--r--sys-libs/db/db-5.3.28-r2.ebuild232
-rw-r--r--sys-libs/db/db-5.3.28-r3.ebuild234
-rw-r--r--sys-libs/db/db-6.0.35-r1.ebuild232
-rw-r--r--sys-libs/db/db-6.0.35.ebuild230
-rw-r--r--sys-libs/db/db-6.1.29-r1.ebuild232
-rw-r--r--sys-libs/db/db-6.1.29.ebuild230
-rw-r--r--sys-libs/db/db-6.2.23-r1.ebuild237
-rw-r--r--sys-libs/db/db-6.2.23.ebuild235
-rw-r--r--sys-libs/db/db-6.2.32-r1.ebuild237
-rw-r--r--sys-libs/db/db-6.2.32.ebuild235
-rw-r--r--sys-libs/db/files/db-1.85-gentoo-paths.patch29
-rw-r--r--sys-libs/db/files/db-3.2.9-fix-dep-link.patch26
-rw-r--r--sys-libs/db/files/db-3.2.9-gcc43.patch16
-rw-r--r--sys-libs/db/files/db-4.0.14-fix-dep-link.patch38
-rw-r--r--sys-libs/db/files/db-4.2-jni-check-prefix-first.patch30
-rw-r--r--sys-libs/db/files/db-4.2-libtool.patch20
-rw-r--r--sys-libs/db/files/db-4.2-listen-to-java-options.patch10
-rw-r--r--sys-libs/db/files/db-4.2.52_p2-TXN.patch68
-rw-r--r--sys-libs/db/files/db-4.3-jni-check-prefix-first.patch30
-rw-r--r--sys-libs/db/files/db-4.3-libtool.patch47
-rw-r--r--sys-libs/db/files/db-4.3-listen-to-java-options.patch10
-rw-r--r--sys-libs/db/files/db-4.3.27-fix-dep-link.patch38
-rw-r--r--sys-libs/db/files/db-4.4-libtool.patch47
-rw-r--r--sys-libs/db/files/db-4.5-libtool.patch47
-rw-r--r--sys-libs/db/files/db-4.6-jni-check-prefix-first.patch30
-rw-r--r--sys-libs/db/files/db-4.6-libtool.patch47
-rw-r--r--sys-libs/db/files/db-4.8-libtool.patch65
-rw-r--r--sys-libs/db/files/db-4.8.24-java-manifest-location.patch12
-rw-r--r--sys-libs/db/files/db-4.8.30-rename-atomic-compare-exchange.patch22
-rw-r--r--sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch22
-rw-r--r--sys-libs/db/files/db-5.2.28-sqlite-configure-path.patch12
-rw-r--r--sys-libs/db/files/db-6.0.20-test-link.patch38
-rw-r--r--sys-libs/db/files/db-6.0.35-sqlite-configure-path.patch11
-rw-r--r--sys-libs/db/files/db-6.1.19-sqlite-configure-path.patch10
-rw-r--r--sys-libs/db/files/db-6.2-jni-check-prefix-first.patch38
-rw-r--r--sys-libs/db/files/db-6.2.32-jni-check-prefix-first.patch44
-rw-r--r--sys-libs/db/metadata.xml29
-rw-r--r--sys-libs/e2fsprogs-libs/Manifest10
-rw-r--r--sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.3.ebuild68
-rw-r--r--sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.5.ebuild68
-rw-r--r--sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.6.ebuild68
-rw-r--r--sys-libs/e2fsprogs-libs/files/e2fsprogs-libs-1.42.13-fix-build-cflags.patch13
-rw-r--r--sys-libs/e2fsprogs-libs/metadata.xml11
-rw-r--r--sys-libs/efivar/Manifest7
-rw-r--r--sys-libs/efivar/efivar-30.ebuild49
-rw-r--r--sys-libs/efivar/efivar-31.ebuild37
-rw-r--r--sys-libs/efivar/metadata.xml11
-rw-r--r--sys-libs/fortify-headers/Manifest8
-rw-r--r--sys-libs/fortify-headers/fortify-headers-0.6.ebuild27
-rw-r--r--sys-libs/fortify-headers/fortify-headers-0.7.ebuild27
-rw-r--r--sys-libs/fortify-headers/fortify-headers-9999.ebuild27
-rw-r--r--sys-libs/fortify-headers/metadata.xml8
-rw-r--r--sys-libs/freeipmi/Manifest19
-rw-r--r--sys-libs/freeipmi/files/bmc-watchdog.confd44
-rw-r--r--sys-libs/freeipmi/files/bmc-watchdog.initd.419
-rw-r--r--sys-libs/freeipmi/files/freeipmi-1.1.1-strictaliasing.patch13
-rw-r--r--sys-libs/freeipmi/files/freeipmi.icinga4
-rw-r--r--sys-libs/freeipmi/files/ipmidetectd.confd5
-rw-r--r--sys-libs/freeipmi/files/ipmiseld.confd5
-rw-r--r--sys-libs/freeipmi/freeipmi-1.2.2.ebuild81
-rw-r--r--sys-libs/freeipmi/freeipmi-1.4.3.ebuild95
-rw-r--r--sys-libs/freeipmi/freeipmi-1.4.8.ebuild92
-rw-r--r--sys-libs/freeipmi/freeipmi-1.5.6.ebuild91
-rw-r--r--sys-libs/freeipmi/freeipmi-1.5.7.ebuild91
-rw-r--r--sys-libs/freeipmi/metadata.xml14
-rw-r--r--sys-libs/fts-standalone/Manifest7
-rw-r--r--sys-libs/fts-standalone/fts-standalone-0.2-r1.ebuild26
-rw-r--r--sys-libs/fts-standalone/fts-standalone-1.2.7.ebuild37
-rw-r--r--sys-libs/fts-standalone/metadata.xml11
-rw-r--r--sys-libs/gdbm/Manifest10
-rw-r--r--sys-libs/gdbm/gdbm-1.11.ebuild71
-rw-r--r--sys-libs/gdbm/gdbm-1.12.ebuild71
-rw-r--r--sys-libs/gdbm/gdbm-1.13.ebuild72
-rw-r--r--sys-libs/gdbm/metadata.xml12
-rw-r--r--sys-libs/glibc/Manifest63
-rw-r--r--sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c315
-rw-r--r--sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch30
-rw-r--r--sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch274
-rw-r--r--sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch42
-rw-r--r--sys-libs/glibc/files/2.18/glibc-2.18-gentoo-chk_fail.c314
-rw-r--r--sys-libs/glibc/files/2.18/glibc-2.18-gentoo-stack_chk_fail.c322
-rw-r--r--sys-libs/glibc/files/2.18/glibc-2.18-hardened-inittls-nosysenter.patch277
-rw-r--r--sys-libs/glibc/files/2.19/glibc-2.19-hardened-configure-picdefault.patch30
-rw-r--r--sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch32
-rw-r--r--sys-libs/glibc/files/2.20/glibc-2.20-gentoo-chk_fail.c299
-rw-r--r--sys-libs/glibc/files/2.20/glibc-2.20-gentoo-stack_chk_fail.c2
-rw-r--r--sys-libs/glibc/files/2.20/glibc-2.20-hardened-inittls-nosysenter.patch306
-rw-r--r--sys-libs/glibc/files/2.25/glibc-2.25-gentoo-chk_fail.c303
-rw-r--r--sys-libs/glibc/files/2.6/glibc-2.6-gentoo-stack_chk_fail.c321
-rw-r--r--sys-libs/glibc/files/nscd63
-rw-r--r--sys-libs/glibc/files/nscd.service15
-rw-r--r--sys-libs/glibc/files/nscd.tmpfilesd4
-rw-r--r--sys-libs/glibc/files/nsswitch.conf23
-rw-r--r--sys-libs/glibc/glibc-2.17.ebuild162
-rw-r--r--sys-libs/glibc/glibc-2.18-r1.ebuild162
-rw-r--r--sys-libs/glibc/glibc-2.19-r1.ebuild163
-rw-r--r--sys-libs/glibc/glibc-2.20-r2.ebuild150
-rw-r--r--sys-libs/glibc/glibc-2.21-r2.ebuild150
-rw-r--r--sys-libs/glibc/glibc-2.22-r4.ebuild149
-rw-r--r--sys-libs/glibc/glibc-2.23-r3.ebuild154
-rw-r--r--sys-libs/glibc/glibc-2.23-r4.ebuild155
-rw-r--r--sys-libs/glibc/glibc-2.24-r4.ebuild155
-rw-r--r--sys-libs/glibc/glibc-2.25-r4.ebuild150
-rw-r--r--sys-libs/glibc/glibc-2.25-r5.ebuild151
-rw-r--r--sys-libs/glibc/glibc-2.25-r7.ebuild151
-rw-r--r--sys-libs/glibc/glibc-2.26-r1.ebuild795
-rw-r--r--sys-libs/glibc/glibc-2.26-r2.ebuild796
-rw-r--r--sys-libs/glibc/glibc-9999.ebuild796
-rw-r--r--sys-libs/glibc/metadata.xml19
-rw-r--r--sys-libs/gpm/Manifest11
-rw-r--r--sys-libs/gpm/files/gpm-1.20.7-glibc-2.26.patch12
-rw-r--r--sys-libs/gpm/files/gpm-1.20.7-sysmacros.patch30
-rw-r--r--sys-libs/gpm/files/gpm.conf.d23
-rw-r--r--sys-libs/gpm/files/gpm.rc6-228
-rw-r--r--sys-libs/gpm/files/gpm.service12
-rw-r--r--sys-libs/gpm/gpm-1.20.7-r2.ebuild100
-rw-r--r--sys-libs/gpm/metadata.xml8
-rw-r--r--sys-libs/gwenhywfar/Manifest12
-rw-r--r--sys-libs/gwenhywfar/gwenhywfar-4.12.0_beta.ebuild59
-rw-r--r--sys-libs/gwenhywfar/gwenhywfar-4.13.1.ebuild59
-rw-r--r--sys-libs/gwenhywfar/gwenhywfar-4.15.3-r1.ebuild62
-rw-r--r--sys-libs/gwenhywfar/gwenhywfar-4.15.3.ebuild59
-rw-r--r--sys-libs/gwenhywfar/gwenhywfar-4.3.3.ebuild57
-rw-r--r--sys-libs/gwenhywfar/metadata.xml10
-rw-r--r--sys-libs/kpmcore/Manifest6
-rw-r--r--sys-libs/kpmcore/kpmcore-3.1.2.ebuild35
-rw-r--r--sys-libs/kpmcore/kpmcore-3.2.0.ebuild33
-rw-r--r--sys-libs/kpmcore/metadata.xml8
-rw-r--r--sys-libs/ldb/Manifest17
-rw-r--r--sys-libs/ldb/files/ldb-1.1.24-optional-python.patch72
-rw-r--r--sys-libs/ldb/files/ldb-1.1.27-optional_packages.patch92
-rw-r--r--sys-libs/ldb/files/ldb-1.1.29-disable-python.patch48
-rw-r--r--sys-libs/ldb/files/ldb-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch17
-rw-r--r--sys-libs/ldb/files/ldb-1.1.31-optional_packages.patch57
-rw-r--r--sys-libs/ldb/files/ldb-1.1.31-talloc-disable-python.patch34
-rw-r--r--sys-libs/ldb/ldb-1.1.26.ebuild97
-rw-r--r--sys-libs/ldb/ldb-1.1.29-r1.ebuild102
-rw-r--r--sys-libs/ldb/ldb-1.1.31.ebuild104
-rw-r--r--sys-libs/ldb/ldb-1.2.2.ebuild102
-rw-r--r--sys-libs/ldb/metadata.xml8
-rw-r--r--sys-libs/lib-compat-loki/Manifest5
-rw-r--r--sys-libs/lib-compat-loki/lib-compat-loki-0.2-r1.ebuild39
-rw-r--r--sys-libs/lib-compat-loki/metadata.xml8
-rw-r--r--sys-libs/lib-compat/Manifest7
-rw-r--r--sys-libs/lib-compat/lib-compat-1.4.2-r1.ebuild30
-rw-r--r--sys-libs/lib-compat/lib-compat-1.5.ebuild16
-rw-r--r--sys-libs/lib-compat/metadata.xml8
-rw-r--r--sys-libs/libaal/Manifest8
-rw-r--r--sys-libs/libaal/libaal-1.0.5-r1.ebuild36
-rw-r--r--sys-libs/libaal/libaal-1.0.5.ebuild47
-rw-r--r--sys-libs/libaal/libaal-1.0.6.ebuild38
-rw-r--r--sys-libs/libaal/metadata.xml15
-rw-r--r--sys-libs/libapparmor/Manifest6
-rw-r--r--sys-libs/libapparmor/files/libapparmor-2.10-symbol_visibility.patch13
-rw-r--r--sys-libs/libapparmor/libapparmor-2.11.0-r1.ebuild95
-rw-r--r--sys-libs/libapparmor/metadata.xml14
-rw-r--r--sys-libs/libavc1394/Manifest8
-rw-r--r--sys-libs/libavc1394/libavc1394-0.5.3.ebuild20
-rw-r--r--sys-libs/libavc1394/libavc1394-0.5.4-r1.ebuild21
-rw-r--r--sys-libs/libavc1394/libavc1394-0.5.4.ebuild19
-rw-r--r--sys-libs/libavc1394/metadata.xml11
-rw-r--r--sys-libs/libblockdev/Manifest5
-rw-r--r--sys-libs/libblockdev/libblockdev-2.12.ebuild82
-rw-r--r--sys-libs/libblockdev/libblockdev-2.13.ebuild82
-rw-r--r--sys-libs/libblockdev/metadata.xml17
-rw-r--r--sys-libs/libcap-ng/Manifest5
-rw-r--r--sys-libs/libcap-ng/libcap-ng-0.7.8.ebuild100
-rw-r--r--sys-libs/libcap-ng/metadata.xml14
-rw-r--r--sys-libs/libcap/Manifest15
-rw-r--r--sys-libs/libcap/files/libcap-2.20-ignore-RAISE_SETFCAP-install-failures.patch29
-rw-r--r--sys-libs/libcap/files/libcap-2.21-include.patch10
-rw-r--r--sys-libs/libcap/files/libcap-2.22-no-perl.patch54
-rw-r--r--sys-libs/libcap/files/libcap-2.24-build-system-fixes.patch163
-rw-r--r--sys-libs/libcap/files/libcap-2.24-setcap-errno.patch45
-rw-r--r--sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch153
-rw-r--r--sys-libs/libcap/files/libcap-2.25-gperf.patch20
-rw-r--r--sys-libs/libcap/files/libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch33
-rw-r--r--sys-libs/libcap/libcap-2.24-r2.ebuild72
-rw-r--r--sys-libs/libcap/libcap-2.25.ebuild77
-rw-r--r--sys-libs/libcap/metadata.xml8
-rw-r--r--sys-libs/libchipcard/Manifest5
-rw-r--r--sys-libs/libchipcard/libchipcard-5.0.2.ebuild43
-rw-r--r--sys-libs/libchipcard/metadata.xml5
-rw-r--r--sys-libs/libcxx/Manifest22
-rw-r--r--sys-libs/libcxx/files/Makefile38
-rw-r--r--sys-libs/libcxx/files/libcxx-3.8.1-musl-support.patch15
-rw-r--r--sys-libs/libcxx/files/libcxx-3.9-cmake-link-flags.patch23
-rw-r--r--sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch196
-rwxr-xr-xsys-libs/libcxx/files/prepare_snapshot.sh16
-rw-r--r--sys-libs/libcxx/libcxx-3.7.1.ebuild169
-rw-r--r--sys-libs/libcxx/libcxx-3.8.1.ebuild176
-rw-r--r--sys-libs/libcxx/libcxx-3.9.0.ebuild216
-rw-r--r--sys-libs/libcxx/libcxx-3.9.1.ebuild216
-rw-r--r--sys-libs/libcxx/libcxx-4.0.1.ebuild199
-rw-r--r--sys-libs/libcxx/libcxx-5.0.0.ebuild199
-rw-r--r--sys-libs/libcxx/libcxx-5.0.9999.ebuild211
-rw-r--r--sys-libs/libcxx/libcxx-9999.ebuild208
-rw-r--r--sys-libs/libcxx/metadata.xml21
-rw-r--r--sys-libs/libcxxabi/Manifest18
-rw-r--r--sys-libs/libcxxabi/files/libcxxabi-3.9.0-cmake-path.patch34
-rw-r--r--sys-libs/libcxxabi/files/libcxxabi-3.9.0-test-unwind.patch37
-rw-r--r--sys-libs/libcxxabi/libcxxabi-3.9.0.ebuild98
-rw-r--r--sys-libs/libcxxabi/libcxxabi-3.9.1.ebuild98
-rw-r--r--sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild94
-rw-r--r--sys-libs/libcxxabi/libcxxabi-5.0.0.ebuild91
-rw-r--r--sys-libs/libcxxabi/libcxxabi-5.0.9999.ebuild96
-rw-r--r--sys-libs/libcxxabi/libcxxabi-9999.ebuild96
-rw-r--r--sys-libs/libcxxabi/metadata.xml10
-rw-r--r--sys-libs/libcxxrt/Manifest15
-rw-r--r--sys-libs/libcxxrt/files/Makefile23
-rw-r--r--sys-libs/libcxxrt/files/Makefile.test7
-rwxr-xr-xsys-libs/libcxxrt/files/prepare_snapshot.sh16
-rw-r--r--sys-libs/libcxxrt/libcxxrt-0.0_p20140322.ebuild70
-rw-r--r--sys-libs/libcxxrt/libcxxrt-0.0_p20150423-r1.ebuild71
-rw-r--r--sys-libs/libcxxrt/libcxxrt-0.0_p20160922.ebuild71
-rw-r--r--sys-libs/libcxxrt/libcxxrt-0.0_p20170515.ebuild71
-rw-r--r--sys-libs/libcxxrt/libcxxrt-9999.ebuild71
-rw-r--r--sys-libs/libcxxrt/metadata.xml22
-rw-r--r--sys-libs/libfaketime/Manifest6
-rw-r--r--sys-libs/libfaketime/libfaketime-0.9.6-r1.ebuild32
-rw-r--r--sys-libs/libfaketime/libfaketime-0.9.6-r2.ebuild52
-rw-r--r--sys-libs/libfaketime/metadata.xml19
-rw-r--r--sys-libs/libhugetlbfs/Manifest14
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.20-noexec-stack.patch135
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch31
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch44
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.9-build.patch31
-rw-r--r--sys-libs/libhugetlbfs/libhugetlbfs-2.18.ebuild146
-rw-r--r--sys-libs/libhugetlbfs/libhugetlbfs-2.19-r1.ebuild164
-rw-r--r--sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild148
-rw-r--r--sys-libs/libhugetlbfs/libhugetlbfs-2.20.ebuild166
-rw-r--r--sys-libs/libhugetlbfs/metadata.xml15
-rw-r--r--sys-libs/libhx/Manifest9
-rw-r--r--sys-libs/libhx/files/libhx-3.22-no-lyx.patch12
-rw-r--r--sys-libs/libhx/libhx-3.16.ebuild30
-rw-r--r--sys-libs/libhx/libhx-3.22-r1.ebuild40
-rw-r--r--sys-libs/libhx/libhx-3.22.ebuild30
-rw-r--r--sys-libs/libhx/metadata.xml14
-rw-r--r--sys-libs/libieee1284/Manifest6
-rw-r--r--sys-libs/libieee1284/libieee1284-0.2.11-r4.ebuild48
-rw-r--r--sys-libs/libieee1284/libieee1284-0.2.11-r5.ebuild48
-rw-r--r--sys-libs/libieee1284/metadata.xml11
-rw-r--r--sys-libs/libixp/Manifest5
-rw-r--r--sys-libs/libixp/libixp-0.5_p20110208-r3.ebuild49
-rw-r--r--sys-libs/libixp/metadata.xml5
-rw-r--r--sys-libs/libkudzu/Manifest7
-rw-r--r--sys-libs/libkudzu/files/kudzu-1.2.57.1-sbusfix.patch72
-rw-r--r--sys-libs/libkudzu/files/kudzu-1.2.57.1-sparc-keyboard.patch195
-rw-r--r--sys-libs/libkudzu/libkudzu-1.2.57.1.ebuild61
-rw-r--r--sys-libs/libkudzu/metadata.xml8
-rw-r--r--sys-libs/libmath++/Manifest5
-rw-r--r--sys-libs/libmath++/libmath++-0.0.4-r1.ebuild49
-rw-r--r--sys-libs/libmath++/metadata.xml8
-rw-r--r--sys-libs/libnih/Manifest8
-rw-r--r--sys-libs/libnih/files/libnih-1.0.3-optional-dbus.patch40
-rw-r--r--sys-libs/libnih/files/libnih-1.0.3-pkg-config.patch56
-rw-r--r--sys-libs/libnih/files/libnih-1.0.3-signal-race.patch60
-rw-r--r--sys-libs/libnih/libnih-1.0.3-r3.ebuild49
-rw-r--r--sys-libs/libnih/metadata.xml11
-rw-r--r--sys-libs/libomp/Manifest21
-rw-r--r--sys-libs/libomp/files/4.0.1/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch94
-rw-r--r--sys-libs/libomp/files/libomp-3.7.0-no_compat_symlinks.patch17
-rw-r--r--sys-libs/libomp/files/libomp-3.7.0-os_detection.patch19
-rw-r--r--sys-libs/libomp/files/libomp-3.9.0-musl-strerror_r.patch35
-rw-r--r--sys-libs/libomp/files/libomp-3.9.0-optional-aliases.patch63
-rw-r--r--sys-libs/libomp/libomp-3.7.1.ebuild57
-rw-r--r--sys-libs/libomp/libomp-3.8.1.ebuild57
-rw-r--r--sys-libs/libomp/libomp-3.9.0.ebuild49
-rw-r--r--sys-libs/libomp/libomp-3.9.1.ebuild49
-rw-r--r--sys-libs/libomp/libomp-4.0.1.ebuild79
-rw-r--r--sys-libs/libomp/libomp-5.0.0.ebuild73
-rw-r--r--sys-libs/libomp/libomp-5.0.9999.ebuild74
-rw-r--r--sys-libs/libomp/libomp-9999.ebuild77
-rw-r--r--sys-libs/libomp/metadata.xml16
-rw-r--r--sys-libs/libosinfo/Manifest6
-rw-r--r--sys-libs/libosinfo/libosinfo-1.0.0-r1.ebuild57
-rw-r--r--sys-libs/libosinfo/libosinfo-1.0.0.ebuild49
-rw-r--r--sys-libs/libosinfo/metadata.xml8
-rw-r--r--sys-libs/libraw1394/Manifest9
-rw-r--r--sys-libs/libraw1394/libraw1394-2.1.0-r1.ebuild21
-rw-r--r--sys-libs/libraw1394/libraw1394-2.1.1.ebuild21
-rw-r--r--sys-libs/libraw1394/libraw1394-2.1.2.ebuild21
-rw-r--r--sys-libs/libraw1394/metadata.xml8
-rw-r--r--sys-libs/librtas/Manifest11
-rw-r--r--sys-libs/librtas/files/librtas-1.3.6-symlink.patch24
-rw-r--r--sys-libs/librtas/files/librtas-1.3.8-symlink.patch20
-rw-r--r--sys-libs/librtas/librtas-1.3.13.ebuild20
-rw-r--r--sys-libs/librtas/librtas-1.3.6.ebuild21
-rw-r--r--sys-libs/librtas/librtas-1.3.8.ebuild21
-rw-r--r--sys-libs/librtas/metadata.xml11
-rw-r--r--sys-libs/libseccomp/Manifest9
-rw-r--r--sys-libs/libseccomp/libseccomp-2.3.0.ebuild39
-rw-r--r--sys-libs/libseccomp/libseccomp-2.3.1.ebuild39
-rw-r--r--sys-libs/libseccomp/libseccomp-2.3.2.ebuild39
-rw-r--r--sys-libs/libseccomp/metadata.xml11
-rw-r--r--sys-libs/libselinux/Manifest14
-rw-r--r--sys-libs/libselinux/files/0005-use-ruby-include-with-rubylibver.patch12
-rw-r--r--sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch69
-rw-r--r--sys-libs/libselinux/files/libselinux-2.5-0001-only-mount-proc-if-necessary.patch54
-rw-r--r--sys-libs/libselinux/files/libselinux-2.5-0002-Avoid-mounting-proc-outside-of-selinux_init_load_pol.patch129
-rw-r--r--sys-libs/libselinux/files/libselinux-2.5-0003-Change-the-location-of-_selinux.so.patch44
-rw-r--r--sys-libs/libselinux/files/libselinux-2.6-0007-build-related-fixes-bug-500674.patch91
-rw-r--r--sys-libs/libselinux/libselinux-2.6.ebuild154
-rw-r--r--sys-libs/libselinux/libselinux-2.7.ebuild150
-rw-r--r--sys-libs/libselinux/libselinux-9999.ebuild150
-rw-r--r--sys-libs/libselinux/metadata.xml19
-rw-r--r--sys-libs/libsemanage/Manifest11
-rw-r--r--sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch35
-rw-r--r--sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-genhomedircon-only-set-MLS-level-if-MLS-.patch38
-rw-r--r--sys-libs/libsemanage/files/libsemanage-2.6-build-paths.patch35
-rw-r--r--sys-libs/libsemanage/libsemanage-2.6.ebuild134
-rw-r--r--sys-libs/libsemanage/libsemanage-2.7.ebuild137
-rw-r--r--sys-libs/libsemanage/libsemanage-9999.ebuild137
-rw-r--r--sys-libs/libsemanage/metadata.xml12
-rw-r--r--sys-libs/libsepol/Manifest8
-rw-r--r--sys-libs/libsepol/libsepol-2.6.ebuild48
-rw-r--r--sys-libs/libsepol/libsepol-2.7.ebuild48
-rw-r--r--sys-libs/libsepol/libsepol-9999.ebuild48
-rw-r--r--sys-libs/libsepol/metadata.xml12
-rw-r--r--sys-libs/libservicelog/Manifest13
-rw-r--r--sys-libs/libservicelog/files/libservicelog-1.0.1.patch10
-rw-r--r--sys-libs/libservicelog/files/libservicelog-1.1.11.patch9
-rw-r--r--sys-libs/libservicelog/libservicelog-1.0.1.ebuild32
-rw-r--r--sys-libs/libservicelog/libservicelog-1.1.11.ebuild32
-rw-r--r--sys-libs/libservicelog/libservicelog-1.1.15.ebuild34
-rw-r--r--sys-libs/libservicelog/libservicelog-1.1.16.ebuild34
-rw-r--r--sys-libs/libservicelog/metadata.xml11
-rw-r--r--sys-libs/libsmbios/Manifest13
-rw-r--r--sys-libs/libsmbios/files/libsmbios-2.2.28-cppunit-tests.patch10
-rw-r--r--sys-libs/libsmbios/files/libsmbios-2.3.0-doxygen_target.patch16
-rw-r--r--sys-libs/libsmbios/files/libsmbios-2.3.3-doxygen_target.patch19
-rw-r--r--sys-libs/libsmbios/files/libsmbios-fix-pie.patch29
-rw-r--r--sys-libs/libsmbios/libsmbios-2.3.0-r1.ebuild76
-rw-r--r--sys-libs/libsmbios/libsmbios-2.3.2.ebuild81
-rw-r--r--sys-libs/libsmbios/libsmbios-2.3.3.ebuild78
-rw-r--r--sys-libs/libsmbios/metadata.xml14
-rw-r--r--sys-libs/libspe2/Manifest8
-rw-r--r--sys-libs/libspe2/files/spe.rc638
-rw-r--r--sys-libs/libspe2/libspe2-2.2.80_p95-r1.ebuild66
-rw-r--r--sys-libs/libspe2/libspe2-2.3.0_p135.ebuild67
-rw-r--r--sys-libs/libspe2/metadata.xml10
-rw-r--r--sys-libs/libstatgrab/Manifest8
-rw-r--r--sys-libs/libstatgrab/files/libstatgrab-0.91-tinfo.patch43
-rw-r--r--sys-libs/libstatgrab/libstatgrab-0.17.ebuild31
-rw-r--r--sys-libs/libstatgrab/libstatgrab-0.91.ebuild42
-rw-r--r--sys-libs/libstatgrab/metadata.xml5
-rw-r--r--sys-libs/libstdc++-v3-bin/Manifest6
-rw-r--r--sys-libs/libstdc++-v3-bin/libstdc++-v3-bin-3.3.6.ebuild21
-rw-r--r--sys-libs/libstdc++-v3-bin/metadata.xml8
-rw-r--r--sys-libs/libstdc++-v3/Manifest6
-rw-r--r--sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r1.ebuild182
-rw-r--r--sys-libs/libstdc++-v3/metadata.xml8
-rw-r--r--sys-libs/libtermcap-compat/Manifest10
-rw-r--r--sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r2.ebuild63
-rw-r--r--sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r3.ebuild49
-rw-r--r--sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r4.ebuild53
-rw-r--r--sys-libs/libtermcap-compat/metadata.xml8
-rw-r--r--sys-libs/libudev-compat/Manifest4
-rw-r--r--sys-libs/libudev-compat/files/udev_old.c37
-rw-r--r--sys-libs/libudev-compat/libudev-compat-186.ebuild47
-rw-r--r--sys-libs/libudev-compat/metadata.xml8
-rw-r--r--sys-libs/libunwind/Manifest15
-rw-r--r--sys-libs/libunwind/files/libunwind-1.1-fix-CVE-2015-3239.patch15
-rw-r--r--sys-libs/libunwind/files/libunwind-1.1-lzma.patch63
-rw-r--r--sys-libs/libunwind/files/libunwind-1.2-coredump-regs.patch16
-rw-r--r--sys-libs/libunwind/files/libunwind-1.2-ia64-missing.patch93
-rw-r--r--sys-libs/libunwind/files/libunwind-1.2-ia64-ptrace-coredump.patch34
-rw-r--r--sys-libs/libunwind/files/libunwind-1.2-ia64-undwarf.patch17
-rw-r--r--sys-libs/libunwind/libunwind-1.1-r1.ebuild72
-rw-r--r--sys-libs/libunwind/libunwind-1.2.1.ebuild100
-rw-r--r--sys-libs/libunwind/libunwind-1.2.ebuild101
-rw-r--r--sys-libs/libunwind/metadata.xml12
-rw-r--r--sys-libs/libutempter/Manifest5
-rw-r--r--sys-libs/libutempter/libutempter-1.1.6-r2.ebuild69
-rw-r--r--sys-libs/libutempter/metadata.xml12
-rw-r--r--sys-libs/libuuid/Manifest4
-rw-r--r--sys-libs/libuuid/libuuid-1.0.3.ebuild32
-rw-r--r--sys-libs/libuuid/metadata.xml18
-rw-r--r--sys-libs/libvpd/Manifest9
-rw-r--r--sys-libs/libvpd/libvpd-2.1.3.ebuild32
-rw-r--r--sys-libs/libvpd/libvpd-2.2.4.ebuild35
-rw-r--r--sys-libs/libvpd/libvpd-2.2.5.ebuild35
-rw-r--r--sys-libs/libvpd/metadata.xml11
-rw-r--r--sys-libs/libxcrypt/Manifest8
-rw-r--r--sys-libs/libxcrypt/files/libxcrypt-2.4-glibc-2.16.patch40
-rw-r--r--sys-libs/libxcrypt/libxcrypt-2.0.ebuild15
-rw-r--r--sys-libs/libxcrypt/libxcrypt-2.4.ebuild28
-rw-r--r--sys-libs/libxcrypt/metadata.xml13
-rw-r--r--sys-libs/llvm-libunwind/Manifest16
-rw-r--r--sys-libs/llvm-libunwind/files/libunwind-3.8-cmake.patch82
-rw-r--r--sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch43
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-3.8.1.ebuild41
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-3.9.0-r1.ebuild49
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-3.9.1.ebuild49
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-4.0.1.ebuild46
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-5.0.0.ebuild46
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-5.0.9999.ebuild47
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-9999.ebuild46
-rw-r--r--sys-libs/llvm-libunwind/metadata.xml10
-rw-r--r--sys-libs/lrmi/Manifest7
-rw-r--r--sys-libs/lrmi/files/lrmi-0.10-kernel-2.6.26.patch18
-rw-r--r--sys-libs/lrmi/files/lrmi-0.10-ldflags.patch26
-rw-r--r--sys-libs/lrmi/lrmi-0.10-r1.ebuild36
-rw-r--r--sys-libs/lrmi/metadata.xml11
-rw-r--r--sys-libs/lwp/Manifest10
-rw-r--r--sys-libs/lwp/files/lwp-2.0-amd64.patch28
-rw-r--r--sys-libs/lwp/lwp-2.2.ebuild32
-rw-r--r--sys-libs/lwp/lwp-2.6-r1.ebuild19
-rw-r--r--sys-libs/lwp/lwp-2.8.ebuild23
-rw-r--r--sys-libs/lwp/metadata.xml5
-rw-r--r--sys-libs/mars/Manifest5
-rw-r--r--sys-libs/mars/mars-1.0.1.ebuild41
-rw-r--r--sys-libs/mars/metadata.xml7
-rw-r--r--sys-libs/metadata.xml32
-rw-r--r--sys-libs/mtdev/Manifest7
-rw-r--r--sys-libs/mtdev/metadata.xml11
-rw-r--r--sys-libs/mtdev/mtdev-1.1.4.ebuild24
-rw-r--r--sys-libs/mtdev/mtdev-1.1.5.ebuild24
-rw-r--r--sys-libs/musl-nscd/Manifest6
-rw-r--r--sys-libs/musl-nscd/files/nscd.initd59
-rw-r--r--sys-libs/musl-nscd/files/nscd.service15
-rw-r--r--sys-libs/musl-nscd/files/nscd.tmpfilesd4
-rw-r--r--sys-libs/musl-nscd/metadata.xml14
-rw-r--r--sys-libs/musl-nscd/musl-nscd-9999.ebuild29
-rw-r--r--sys-libs/musl/Manifest15
-rw-r--r--sys-libs/musl/files/getent45
-rw-r--r--sys-libs/musl/files/ldconfig.in144
-rw-r--r--sys-libs/musl/files/musl-1.1.15-CVE.patch68
-rw-r--r--sys-libs/musl/files/musl-1.1.15-assert.patch43
-rw-r--r--sys-libs/musl/metadata.xml15
-rw-r--r--sys-libs/musl/musl-1.1.15-r2.ebuild121
-rw-r--r--sys-libs/musl/musl-1.1.16.ebuild116
-rw-r--r--sys-libs/musl/musl-9999.ebuild116
-rw-r--r--sys-libs/ncurses/Manifest19
-rw-r--r--sys-libs/ncurses/files/ncurses-5.7-nongnu.patch11
-rw-r--r--sys-libs/ncurses/files/ncurses-5.8-gfbsd.patch24
-rw-r--r--sys-libs/ncurses/files/ncurses-5.9-fix-clang-build.patch44
-rw-r--r--sys-libs/ncurses/files/ncurses-5.9-gcc-5.patch46
-rw-r--r--sys-libs/ncurses/files/ncurses-5.9-no-I-usr-include.patch45
-rw-r--r--sys-libs/ncurses/files/ncurses-5.9-pkg-config.patch26
-rw-r--r--sys-libs/ncurses/files/ncurses-5.9-rxvt-unicode-9.15.patch191
-rw-r--r--sys-libs/ncurses/files/ncurses-6.0-cppflags-cross.patch35
-rw-r--r--sys-libs/ncurses/files/ncurses-6.0-gfbsd.patch24
-rw-r--r--sys-libs/ncurses/files/ncurses-6.0-pkg-config.patch14
-rw-r--r--sys-libs/ncurses/files/ncurses-6.0-rxvt-unicode-9.15.patch191
-rw-r--r--sys-libs/ncurses/files/ncurses-6.0-ticlib.patch15
-rw-r--r--sys-libs/ncurses/metadata.xml17
-rw-r--r--sys-libs/ncurses/ncurses-5.9-r101.ebuild201
-rw-r--r--sys-libs/ncurses/ncurses-6.0-r1.ebuild289
-rw-r--r--sys-libs/netbsd-csu/Manifest3
-rw-r--r--sys-libs/netbsd-csu/metadata.xml7
-rw-r--r--sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild130
-rw-r--r--sys-libs/newlib/Manifest19
-rw-r--r--sys-libs/newlib/files/newlib-2.1.0-msp430-destdir.patch41
-rw-r--r--sys-libs/newlib/metadata.xml11
-rw-r--r--sys-libs/newlib/newlib-2.0.0.ebuild69
-rw-r--r--sys-libs/newlib/newlib-2.1.0.ebuild74
-rw-r--r--sys-libs/newlib/newlib-2.2.0.20150423.ebuild81
-rw-r--r--sys-libs/newlib/newlib-2.2.0.ebuild82
-rw-r--r--sys-libs/newlib/newlib-2.3.0.20160104.ebuild81
-rw-r--r--sys-libs/newlib/newlib-2.4.0.ebuild86
-rw-r--r--sys-libs/newlib/newlib-2.5.0.ebuild82
-rw-r--r--sys-libs/newlib/newlib-9999.ebuild82
-rw-r--r--sys-libs/nss-usrfiles/Manifest5
-rw-r--r--sys-libs/nss-usrfiles/metadata.xml11
-rw-r--r--sys-libs/nss-usrfiles/nss-usrfiles-2.18.1.ebuild31
-rw-r--r--sys-libs/nss_wrapper/Manifest7
-rw-r--r--sys-libs/nss_wrapper/metadata.xml12
-rw-r--r--sys-libs/nss_wrapper/nss_wrapper-1.1.2.ebuild24
-rw-r--r--sys-libs/nss_wrapper/nss_wrapper-1.1.3.ebuild24
-rw-r--r--sys-libs/ntdb/Manifest5
-rw-r--r--sys-libs/ntdb/metadata.xml12
-rw-r--r--sys-libs/ntdb/ntdb-1.0-r1.ebuild52
-rw-r--r--sys-libs/obstack-standalone/Manifest3
-rw-r--r--sys-libs/obstack-standalone/metadata.xml15
-rw-r--r--sys-libs/obstack-standalone/obstack-standalone-1.1.ebuild37
-rw-r--r--sys-libs/openipmi/Manifest11
-rw-r--r--sys-libs/openipmi/files/openipmi-2.0.16-pthreads.patch12
-rw-r--r--sys-libs/openipmi/files/openipmi-2.0.21-tinfo.patch18
-rw-r--r--sys-libs/openipmi/metadata.xml11
-rw-r--r--sys-libs/openipmi/openipmi-2.0.18-r1.ebuild97
-rw-r--r--sys-libs/openipmi/openipmi-2.0.22.ebuild104
-rw-r--r--sys-libs/openipmi/openipmi-2.0.23_rc1.ebuild104
-rw-r--r--sys-libs/pam/Manifest10
-rw-r--r--sys-libs/pam/metadata.xml29
-rw-r--r--sys-libs/pam/pam-1.2.1-r1.ebuild204
-rw-r--r--sys-libs/pam/pam-1.2.1.ebuild201
-rw-r--r--sys-libs/pam/pam-1.3.0.ebuild196
-rw-r--r--sys-libs/pinktrace/Manifest3
-rw-r--r--sys-libs/pinktrace/metadata.xml8
-rw-r--r--sys-libs/pinktrace/pinktrace-0.9.3.ebuild29
-rw-r--r--sys-libs/pwdb/Manifest7
-rw-r--r--sys-libs/pwdb/files/pwdb-0.62-build.patch114
-rw-r--r--sys-libs/pwdb/files/pwdb-0.62-selinux.patch443
-rw-r--r--sys-libs/pwdb/metadata.xml8
-rw-r--r--sys-libs/pwdb/pwdb-0.62.ebuild57
-rw-r--r--sys-libs/readline/Manifest48
-rw-r--r--sys-libs/readline/files/readline-5.0-no_rpath.patch13
-rw-r--r--sys-libs/readline/files/readline-5.2-no-ignore-shlib-errors.patch24
-rw-r--r--sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch14
-rw-r--r--sys-libs/readline/files/readline-6.3-fix-long-prompt-vi-search.patch26
-rw-r--r--sys-libs/readline/files/readline-6.3-read-eof.patch54
-rw-r--r--sys-libs/readline/files/readline-7.0-headers.patch24
-rw-r--r--sys-libs/readline/files/readline-7.0-missing-echo-proto.patch14
-rw-r--r--sys-libs/readline/metadata.xml11
-rw-r--r--sys-libs/readline/readline-4.3_p5.ebuild64
-rw-r--r--sys-libs/readline/readline-5.2_p14.ebuild65
-rw-r--r--sys-libs/readline/readline-6.3_p8-r3.ebuild167
-rw-r--r--sys-libs/readline/readline-7.0_p3.ebuild163
-rw-r--r--sys-libs/rvm/Manifest7
-rw-r--r--sys-libs/rvm/metadata.xml5
-rw-r--r--sys-libs/rvm/rvm-1.12.ebuild23
-rw-r--r--sys-libs/rvm/rvm-1.17-r1.ebuild19
-rw-r--r--sys-libs/slang/Manifest10
-rw-r--r--sys-libs/slang/files/slang-2.2.3-slsh-libs.patch11
-rw-r--r--sys-libs/slang/files/slang-2.2.4-memset.patch32
-rw-r--r--sys-libs/slang/files/slang-2.3.1-slsh-libs.patch11
-rw-r--r--sys-libs/slang/metadata.xml8
-rw-r--r--sys-libs/slang/slang-2.3.0.ebuild74
-rw-r--r--sys-libs/slang/slang-2.3.1a.ebuild78
-rw-r--r--sys-libs/suacomp/Manifest7
-rw-r--r--sys-libs/suacomp/files/suacomp-0.6.14-strtoll.patch44
-rw-r--r--sys-libs/suacomp/metadata.xml16
-rw-r--r--sys-libs/suacomp/suacomp-0.6.14.ebuild63
-rw-r--r--sys-libs/suacomp/suacomp-9999.ebuild59
-rw-r--r--sys-libs/system-config-base/Manifest6
-rw-r--r--sys-libs/system-config-base/files/1-r1-pam-0.99.8.0-r2-compat.patch11
-rw-r--r--sys-libs/system-config-base/files/config-util8
-rw-r--r--sys-libs/system-config-base/metadata.xml5
-rw-r--r--sys-libs/system-config-base/system-config-base-1-r1.ebuild39
-rw-r--r--sys-libs/talloc/Manifest9
-rw-r--r--sys-libs/talloc/metadata.xml15
-rw-r--r--sys-libs/talloc/talloc-2.1.10.ebuild92
-rw-r--r--sys-libs/talloc/talloc-2.1.5.ebuild82
-rw-r--r--sys-libs/talloc/talloc-2.1.9.ebuild92
-rw-r--r--sys-libs/tapi/Manifest7
-rw-r--r--sys-libs/tapi/files/tapi-1.30-allow-all-clients.patch17
-rw-r--r--sys-libs/tapi/files/tapi-1.30-llvm-config.patch11
-rw-r--r--sys-libs/tapi/files/tapi-1.30-llvm-new-error-api.patch65
-rw-r--r--sys-libs/tapi/files/tapi-1.30-llvm-out-of-tree.patch10
-rw-r--r--sys-libs/tapi/metadata.xml8
-rw-r--r--sys-libs/tapi/tapi-1.30.ebuild37
-rw-r--r--sys-libs/tdb/Manifest11
-rw-r--r--sys-libs/tdb/metadata.xml12
-rw-r--r--sys-libs/tdb/tdb-1.3.13.ebuild60
-rw-r--r--sys-libs/tdb/tdb-1.3.14.ebuild60
-rw-r--r--sys-libs/tdb/tdb-1.3.15.ebuild60
-rw-r--r--sys-libs/tdb/tdb-1.3.8.ebuild59
-rw-r--r--sys-libs/tevent/Manifest12
-rw-r--r--sys-libs/tevent/files/talloc-disable-python.patch34
-rw-r--r--sys-libs/tevent/metadata.xml12
-rw-r--r--sys-libs/tevent/tevent-0.9.28.ebuild55
-rw-r--r--sys-libs/tevent/tevent-0.9.31-r1.ebuild60
-rw-r--r--sys-libs/tevent/tevent-0.9.32.ebuild60
-rw-r--r--sys-libs/tevent/tevent-0.9.33.ebuild66
-rw-r--r--sys-libs/timezone-data/Manifest10
-rw-r--r--sys-libs/timezone-data/files/timezone-data-2016g-makefile.patch81
-rw-r--r--sys-libs/timezone-data/metadata.xml19
-rw-r--r--sys-libs/timezone-data/timezone-data-2017a.ebuild156
-rw-r--r--sys-libs/timezone-data/timezone-data-2017b.ebuild160
-rw-r--r--sys-libs/uclibc-ng/Manifest20
-rw-r--r--sys-libs/uclibc-ng/files/uclibc-compat-r1.patch15
-rw-r--r--sys-libs/uclibc-ng/files/uclibc-ng-update-reboot_h.patch41
-rw-r--r--sys-libs/uclibc-ng/metadata.xml22
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-1.0.19.ebuild408
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-1.0.20.ebuild410
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-1.0.22.ebuild411
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-1.0.23.ebuild411
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-1.0.24-r1.ebuild412
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-1.0.24.ebuild411
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-1.0.25.ebuild410
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-1.0.26.ebuild411
-rw-r--r--sys-libs/uclibc-ng/uclibc-ng-9999.ebuild410
-rw-r--r--sys-libs/uclibc/Manifest8
-rw-r--r--sys-libs/uclibc/metadata.xml33
-rw-r--r--sys-libs/uclibc/uclibc-0.9.33.2-r15.ebuild355
-rw-r--r--sys-libs/uclibc/uclibc-0.9.33.9999.ebuild354
-rw-r--r--sys-libs/uclibc/uclibc-9999.ebuild353
-rw-r--r--sys-libs/uid_wrapper/Manifest8
-rw-r--r--sys-libs/uid_wrapper/metadata.xml12
-rw-r--r--sys-libs/uid_wrapper/uid_wrapper-1.2.1.ebuild31
-rw-r--r--sys-libs/uid_wrapper/uid_wrapper-1.2.4.ebuild18
-rw-r--r--sys-libs/zlib/Manifest7
-rw-r--r--sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch67
-rw-r--r--sys-libs/zlib/metadata.xml14
-rw-r--r--sys-libs/zlib/zlib-1.2.11-r1.ebuild126
-rw-r--r--sys-libs/zlib/zlib-1.2.11.ebuild124
636 files changed, 42226 insertions, 0 deletions
diff --git a/sys-libs/argp-standalone/Manifest b/sys-libs/argp-standalone/Manifest
new file mode 100644
index 000000000000..a7199baab2aa
--- /dev/null
+++ b/sys-libs/argp-standalone/Manifest
@@ -0,0 +1,7 @@
+AUX argp-standalone-1.3-shared.patch 1407 SHA256 7cbe26fac7eaf6f9859e03037b38f38bf9ccb6301a0766baa8411d1458fba2f7 SHA512 2ee3386b1f63d64abff6a6b58dd7d0a7724bc07fd20f3f9daf24de1abb39d1ef35e3c616926fe3e939ccd491e84a82373e9554566a78683c3622494be2071d72 WHIRLPOOL bee3f21e8231dee99169e5590e79846399812594a05c624391c123d01126e97733795a2e92b6fbc161a8168648d2d19aed12ca41da6844a6c3b01be295679a45
+AUX argp-standalone-1.3-throw-in-funcdef.patch 2500 SHA256 46b9b6c8dba584694ae9fc17c5fa301056500128f1f0c548360574afe6b3a184 SHA512 5e4cdeeb16e6a4fb46a00ab95f3da9276ee554eec00bb2a05da7467961234ba3f9a630aafa7ceb5feb429a84ece8bf03b869fa996b86468f4716935a914c79a4 WHIRLPOOL 6793f3fa293faf810dc9374354a6346cdf7f9a687c8423229a0d6c4e54eae69d2949ba0c80b74f278d26f7b829e82653f05668aa48c98d335389dc3b1062f567
+DIST argp-standalone-1.3.tar.gz 130255 SHA256 dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be SHA512 58c3feb8852b90248fff39e49b5019bd0dcf646790c3eaf70c3262eb81dda31a61dc0a45963c7b4a010e80fc14b37288dcb3b3ef48d02f2d33dd72c1c62e62d9 WHIRLPOOL aedcf1ae31ea9484ca10fe028490624b5e17ae2b484f6e31effdc5119aea6affb6f61140bd10ac28c5395f0374df0c46a1d35ed6b7cdea7ce02fd7a4781db456
+EBUILD argp-standalone-1.3-r2.ebuild 802 SHA256 ac25a09312c5432cdb9a7c7f4a05b0a408c75e64cff6a14228d34110a7de9fc9 SHA512 d4f92f4987fd7a7f4e9a5ded04abbdb4c5310fd32c82293de047fed08c62fb372e732ec1637308a2df654c0937084b49c7d2bd4ecbe71af3184072a022b2b047 WHIRLPOOL cecbc3a5f664f8be5fe0920727f0e835a115347e150e2bdb2ba16d05cadc40e022f064279f442b62e0ba6f5c623091b6a8f4cd100ee6b7c2d8a404a89aa7acda
+MISC ChangeLog 2816 SHA256 7607cb854bcc3cb11888b262b18397bdf5036d1f88aefdbdff2caa05188c4282 SHA512 223db76fdaa8fa7b3a949845da055bedc449da2cc73051886ee3e726fb0aa868577a3a167960ce4a3c2b9c9f2b1b1bbe8aa381a7bb75c46bad2324a9985863e8 WHIRLPOOL 22e1f214cf98ad1b9ecf210d640125c1c55ede4b0d55362e6cc164ca5fc30e7b940827b2adde1a3b6d17758ca93c333cbc7b31962442944f653f89ff033f0480
+MISC ChangeLog-2015 810 SHA256 a621e86459eef52a306cf4702445908363f43c24f7cd7cde2feebffde5f74dc1 SHA512 8165cbb88078d2bd979171d140d90efd122d2dce80414c098e0029e625252cbd3154a3a264a5111903c277026cd8a15e792dcc1d5e0b2231c24ace7b06263101 WHIRLPOOL db5b081fa9f97f910a971c4462059a31d66dc34d3dd4ba04dd3dd6989f612a145abb172c2f5ebe044182491d0a52a29fb68503ddae6cec2de7d88862765e05a1
+MISC metadata.xml 478 SHA256 93f5fd669f95a493cfdc77b4c7178caead7245981dc785caab2b4588c10066f1 SHA512 ee39a1ed0a46fcc737755bbe74f7390c9fe1606f8db738d7c9ebc9b99f43e162a7dc35c0c04dacbb967434eab186904cf67bbe773365a0457a7884157f332986 WHIRLPOOL 4625c16fc6e11b31a35032f2aae5ac6e2adbe4d78deb0fb4c0bbddd7c26b5d6218d45efc1105f2e2d2aafd33c06aac41e0bee24783330507864857695994f935
diff --git a/sys-libs/argp-standalone/argp-standalone-1.3-r2.ebuild b/sys-libs/argp-standalone/argp-standalone-1.3-r2.ebuild
new file mode 100644
index 000000000000..6e23f64515a6
--- /dev/null
+++ b/sys-libs/argp-standalone/argp-standalone-1.3-r2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="Standalone argp library for use with uclibc"
+HOMEPAGE="http://www.lysator.liu.se/~nisse/misc/"
+SRC_URI="http://www.lysator.liu.se/~nisse/misc/argp-standalone-1.3.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 ~m68k ~mips ~ppc ~s390 ~sh x86"
+IUSE="static-libs"
+
+DEPEND="!sys-libs/glibc"
+
+PATCHES=(
+ "${FILESDIR}/${P}-throw-in-funcdef.patch"
+ "${FILESDIR}/${P}-shared.patch"
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ append-cflags "-fgnu89-inline"
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+ insinto /usr/include
+ doins argp.h
+}
diff --git a/sys-libs/argp-standalone/files/argp-standalone-1.3-shared.patch b/sys-libs/argp-standalone/files/argp-standalone-1.3-shared.patch
new file mode 100644
index 000000000000..7164103f8a7d
--- /dev/null
+++ b/sys-libs/argp-standalone/files/argp-standalone-1.3-shared.patch
@@ -0,0 +1,49 @@
+--- a/Makefile.am 2009-05-28 15:19:50.000000000 +0200
++++ b/Makefile.am 2009-05-28 15:30:57.000000000 +0200
+@@ -21,20 +21,20 @@
+ AUTOMAKE_OPTIONS = foreign
+ SUBDIRS = . testsuite
+
+-LIBOBJS = @LIBOBJS@
++LTLIBOBJS = @LTLIBOBJS@
+
+-noinst_LIBRARIES = libargp.a
++lib_LTLIBRARIES = libargp.la
+ noinst_PROGRAMS = argp-test
+ noinst_HEADERS = argp.h argp-fmtstream.h argp-namefrob.h # argp-comp.h
+
+ EXTRA_DIST = mempcpy.c strchrnul.c strndup.c Versions
+
+ # Leaves out argp-fs-xinl.c and argp-xinl.c
+-libargp_a_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c \
++libargp_la_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c \
+ argp-help.c argp-parse.c argp-pv.c \
+ argp-pvh.c
+
+-libargp_a_LIBADD = $(LIBOBJS)
++libargp_la_LIBADD = $(LTLIBOBJS)
+
+-argp_test_LDADD = libargp.a
++argp_test_LDADD = libargp.la
+
+--- a/configure.ac 2009-05-28 15:20:01.000000000 +0200
++++ b/configure.ac 2009-05-28 15:21:06.000000000 +0200
+@@ -17,6 +17,7 @@
+ AC_PROG_MAKE_SET
+ AC_PROG_RANLIB
+ AM_PROG_CC_STDC
++AC_PROG_LIBTOOL
+
+ if test "x$am_cv_prog_cc_stdc" = xno ; then
+ AC_ERROR([the C compiler doesn't handle ANSI-C])
+--- a/testsuite/Makefile.am 2009-05-28 15:21:33.000000000 +0200
++++ b/testsuite/Makefile.am 2009-05-28 15:21:41.000000000 +0200
+@@ -5,7 +5,7 @@
+
+ noinst_PROGRAMS = $(TS_PROGS) ex1 ex3 ex4
+
+-LDADD = ../libargp.a
++LDADD = -L../.libs -largp
+
+ EXTRA_DIST = $(TS_SH) run-tests
+ CLEANFILES = test.out
diff --git a/sys-libs/argp-standalone/files/argp-standalone-1.3-throw-in-funcdef.patch b/sys-libs/argp-standalone/files/argp-standalone-1.3-throw-in-funcdef.patch
new file mode 100644
index 000000000000..4a90751e1e62
--- /dev/null
+++ b/sys-libs/argp-standalone/files/argp-standalone-1.3-throw-in-funcdef.patch
@@ -0,0 +1,79 @@
+# --- T2-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+#
+# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone
+# Copyright (C) 2006 The T2 SDE Project
+#
+# More information can be found in the files COPYING and README.
+#
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- T2-COPYRIGHT-NOTE-END ---
+
+
+No __THROW in function implementation.
+ --jsaw
+
+--- argp-standalone-1.4-test2/argp.h.orig 2006-01-06 02:29:59.000000000 +0100
++++ argp-standalone-1.4-test2/argp.h 2006-01-06 02:41:10.000000000 +0100
+@@ -560,17 +560,17 @@
+ # endif
+
+ # ifndef ARGP_EI
+-# define ARGP_EI extern __inline__
++# define ARGP_EI extern inline
+ # endif
+
+ ARGP_EI void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+
+ ARGP_EI int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt)
+ {
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+@@ -582,7 +582,7 @@
+ }
+
+ ARGP_EI int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt)
+ {
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
+--- argp-standalone-1.4-test2/argp-parse.c.orig 2006-01-06 02:47:48.000000000 +0100
++++ argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.000000000 +0100
+@@ -1290,13 +1290,13 @@
+ /* Defined here, in case a user is not inlining the definitions in
+ * argp.h */
+ void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+
+ int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt)
+ {
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+@@ -1310,7 +1310,7 @@
+ }
+
+ int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt)
+ {
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
diff --git a/sys-libs/argp-standalone/metadata.xml b/sys-libs/argp-standalone/metadata.xml
new file mode 100644
index 000000000000..a816908ca930
--- /dev/null
+++ b/sys-libs/argp-standalone/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 type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>gentoo@wildgooses.com</email>
+ <name>Ed Wildgoose</name>
+ </maintainer>
+<maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/binutils-libs/Manifest b/sys-libs/binutils-libs/Manifest
new file mode 100644
index 000000000000..53ee8d388405
--- /dev/null
+++ b/sys-libs/binutils-libs/Manifest
@@ -0,0 +1,19 @@
+DIST binutils-2.25.1-patches-1.1.tar.xz 18724 SHA256 3d4c0ab2d45d3a952f60246fa5a4353f057c03110130b50e3b2103bd49c345fa SHA512 209c55bf26b51d8c513b40abd2d95f687159c4e964a6c732924f277d04c97323c427fe452c63d5ec6962dcd8892d6d5d807ba88826739425bce6812a31f573dd WHIRLPOOL 2b650af352183d2b58abaee955b223606d63bd5f22a73360e79af1d3b575c5ea385f90be92348ec850534d96f7b6632b1e494f314ec1655eedc26108e849aab7
+DIST binutils-2.25.1.tar.bz2 24163561 SHA256 b5b14added7d78a8d1ca70b5cb75fef57ce2197264f4f5835326b0df22ac9f22 SHA512 0b36dda0e6d32cd25613c0e64b56b28312515c54d6a159efd3db9a86717f114ab0a0a1f69d08975084d55713ebaeab64e4085c9b3d1c3fa86712869f80eb954d WHIRLPOOL daa804331ee880296c2fe29fd9b8a52cc695629d4bbe0b9889d96ffc54d330f00fac3f3cb12b3aaf6b7505521ef499c53760912cd7c9bb54f2d5e288224bd1eb
+DIST binutils-2.27-patches-1.0.tar.xz 8852 SHA256 07be45786e1e56498aad2c52a43d4104ccd0ded3c6a84a930486bc418d7fa36d SHA512 489b5fff87886682d8e98eafa2f082e6dcf811d2a693b6c41d76bd1ac50815a6e7d26fb7c9e3811c2d8e0e1dc307557e6ffe46d1d0f7caeb581060cf14bda899 WHIRLPOOL cf73342292a6dd8450a420f62a6a28e1ae38eed2c0b62643619ac002f3e9233ba5a0df19deb862167e88bd2c4a7ef4e002fe4d76f971eba876014d145dc30171
+DIST binutils-2.27.tar.bz2 26099568 SHA256 369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88 SHA512 cf276f84935312361a2ca077e04d0b469d23a3aed979d8ba5d92ea590904ffb2c2e7ed12cc842822bfc402836be86f479660cef3791aa62f3753d8a1a6f564cb WHIRLPOOL d3204b4900529f697285fb1fe622ecc949c43f064e6b83a1cecb1ea8810a214842c729266c9a44537dc0a86d6d2b3ac100f54c721cc284e54f9d6feb90930d15
+DIST binutils-2.28-patches-1.2.tar.xz 17572 SHA256 d3fd98b218b0469f216a65676fdc899b9d777ea2d2f4b83af3d7fa6bbd36ca41 SHA512 00453fc1e3290868c23e2ca32214b5229fca23d4a551e4e136a62946b584992e9ef3f3e07819e35fb4eb83f083145330078db2631d5a089da7b5129d234aa856 WHIRLPOOL e52ca6eb5cc03fb0c3ebe27366019d38628a88d949dff873dc646ea1354ec432080818ddb212a6e94148bee3b230288eb245a5472c9c6e6ae9a5bdd162578cc4
+DIST binutils-2.28.1-patches-1.0.tar.xz 19772 SHA256 50cfce6ef7f546dcdb983a8b632507b5cdd51095e4acf1f15bfcd68027d438a4 SHA512 c2c7d22e1013e79040c4dcb4d70649e78a070976ba3a4bc2ceb4805827b9d93eea1805c85db4fcb6b31be5218c3d7b42a4990437a7c01dc01fd7e9dedb606828 WHIRLPOOL 2369fce643cc9b83724b486521621d744de0eaf3d95fdd34c7f1c785bc400f3ed31ae6105001870f33539664d84dd9caae854725e20007f136929d2ece755247
+DIST binutils-2.28.1.tar.bz2 28120394 SHA256 6924999be62d4464458eb53c11f27277cfb63755df8c1cd47b8d15d02c1942ea SHA512 5ec5212497b0fa8324f6a0884c284cb71c01942bbd39356d1ae745a5c9d97274c10f9d9c723f4bef6f0217662dfcd0c36e4e955a7599b11217658dc7b97553eb WHIRLPOOL 5c616f719827e5da7db23e89c761323cd4828b4779e79c3983d3ea429bce57ed40219982c478237b4dd728b77bae0a6447d912d96490ed1f5fc279ba5fd73bc6
+DIST binutils-2.28.tar.bz2 26556365 SHA256 6297433ee120b11b4b0a1c8f3512d7d73501753142ab9e2daa13c5a3edd32a72 SHA512 ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd WHIRLPOOL 7fb876668c4fd8b10641fb8d831e7d23723ccb9b1051650c76a3a99696d37d120ef969e3c1cc144b0ffd765ef8e8698fe553c39cc65d0b9499a87d4886d6419d
+DIST binutils-2.29-patches-1.0.tar.xz 7548 SHA256 8ce4d1ea1224a305c4e36529e02dba87306075638ba0415b69ceeccedc77cd6e SHA512 5375bfb1b796b7692cf2adfc41bd2ae2e6dc19ff497db5f6beb35a456981b3adb8552ef14f32382faf655aa40da86c2d44177a658ec71e1c0e228dc27a4f2e18 WHIRLPOOL 73d2b78ea18e3427442bcb24440f671c1d35c0b559bf2141f30052b2bb8d6a8a6e29994cac741e4e50071c716d761f32b36358487a176d67e8cd226dfaaeafc2
+DIST binutils-2.29.1.tar.bz2 29123355 SHA256 1509dff41369fb70aed23682351b663b56db894034773e6dbf7d5d6071fc55cc SHA512 4063d34555526922376ccceb3f14b43e287442e82a8038cf50f4f51ad97d438c672c0e310ca4b856c9aff5aa9911073e256e8298a7a3f1844eeb60b90d955592 WHIRLPOOL 55bf62434bb00b9a355f8d7138c97b6d984eed3a83d7eb37137cf3ab8efcc8e536415d68eba375ae0ab30743f5b3014a664f7d3c773ed55da40c8814691e04d8
+DIST binutils-2.29.tar.bz2 29073316 SHA256 29a29549869039aad75fdf507ac30366da5ad0b974fbff4a8e7148dbf4f40ebf SHA512 8148587d7e4f14ebcbcb3f984b116deaae5d4008228628acde14bc242a64a4b53faf1f6077a2c4ca4750e2f254b698ba506bd657f79e1202e87e7029b0069337 WHIRLPOOL 62b3e9ff6f85f8f4a13b71361f5abc4081a70de560931dcaaece1daef04c6bc7d3e0085cbacff0abbb750c4779863d45bc0d8d17273965472992c6b61b5cab20
+EBUILD binutils-libs-2.25.1-r2.ebuild 2737 SHA256 dc287dfc75930e05a4b093910afe8691c1b62416a214fa462f1d52393191daa2 SHA512 e74c54f9a73d1f0193879fd181ec42951e24c89a0458461293982c19999e86d0c99ce6417bb53261763ea5012526e566b1adb5fef4f68a5d540489b9c0f78018 WHIRLPOOL e73510acb481ce1331b840375714ef3d6af7dfc9a8128322d6eef7f5758c53df8687a284cdd5f38df25045c6aa6d93667aeca98bcd1333a7cc428084bf9d8075
+EBUILD binutils-libs-2.27.ebuild 2859 SHA256 174df4582ed73d0c4338234654cb420d3498d88c65089a808b9551171c14b2d8 SHA512 f0307817eed7b1fa5559543027d5e8ad3609021a92e06ee810e8008da9bfdba9559fd29d44cd961a40df735b4b78c38ba1156415b5f63d2ab43283b515a09bd0 WHIRLPOOL 64ca7992e22e2d7ef152c6d11f5e0181c6be3ef7dd101d53575d308a88ded765ccb72df6a5c244855c4b60e967fae2e6702107d04437ac5b7edd02ff72c35bfc
+EBUILD binutils-libs-2.28-r1.ebuild 2887 SHA256 a70a6774e4d75cf84a20e4b36065b3bb1976c4db0c5ef99367755f633d5ec9c8 SHA512 edf4d674c1edc733d4af0efd9c16d5ef5f72f0247a2cadbeb2d475a180fb244c2ed1c1e841be3835bf57e50c51cc353dbd1e0213aaeac4055f9d732ed8b98693 WHIRLPOOL f9ec43dfa3060a717a1c9aa9d140a1ca469f9672b082c190cf55abd93e353084004ccde82943c7139897c9d35f02ed77d8a617e4e122ed1a75dc49041d8679ca
+EBUILD binutils-libs-2.28.1.ebuild 2884 SHA256 48e3af891fcca61715264c2054c1e145ef910b4e5d0d9fba97d830d4a0579340 SHA512 d9679950c09f4381d441772b5c1906aa517399fac42eadf5a778c2fb40e72fd7846b04059c5f3331fbb4eb5dba2e50adc7281bfb55febbdd150b6dfceb1a45b8 WHIRLPOOL 0f1795e3164eebcf886dc84ffa918a527c028d4bb702ae79602280c140bb5ea0bb56fb8a3b738ba395a5cfbe624f932dab0f2a87292cb050f2a30bfe230c1d10
+EBUILD binutils-libs-2.29.1.ebuild 2930 SHA256 526abf1acd886909045b36f959bff6e941826afe393ea6f694f4625c4c97026e SHA512 7f7c2b5dfe115683960cabc72fb7dfbbee2cc8f28dbfead51fba0d9b7be782f324fbb91b76d0c275ab4b980e97bc85cd43e54e1adb879992672947de442be791 WHIRLPOOL 3beb65293962e917d452a96c1f702fe01e4795001fcdde670e40a5a6be2a92dc4fa86060b57714092d9b829734c99c2d5187e6ad2667103ab1f729cc057717ea
+EBUILD binutils-libs-2.29.ebuild 2881 SHA256 c08237874dbbd5aaf04796e7c03ed789cf098def66b80828c0a86bff7ec4b3a8 SHA512 dcef5b8109859dc42221853c9cd48e007bfab8280aae862439b78fc72dff12df7349329ff4bb4ba94795bdc312891603fc65aaf18e38e0c82b9807c8bb275f49 WHIRLPOOL 19ac8e955c0802b17c255b77ada9fc70305d59972b3c08a99dda84cae2d7b0898c3a3846405bb1791278381fc72de55ccec45222733b64366f96004c3a42a2ce
+MISC ChangeLog 3434 SHA256 f4018d2351e0d680631a883a78ca749fc99a4efc915b4d32a302a7a495a4d43e SHA512 e1e028672b70cfc2c02ad2328c67f4d0cbeefcb4fa08417ce449b64e821d401c5b39d884c098febd83370590b9907eaf8a072750d27fd6fbc8b260549e3a260c WHIRLPOOL a8814d517a9762e9d303dc9c278271db9572ef3d5cecc24b26048580a42ff9d078d030f8b749aaf5ef1d47656cf1200f72406514623a2df37c35b082c9c2c7a7
+MISC metadata.xml 524 SHA256 03d92323b98033273689c9031e2a364b893f3796b4089ae6fe4ec9a96d958d7c SHA512 9db7c7a3082ee848ec4963831da06cced596d543e53660747fb56ac33998c219e1d7252892ffc32132d7db3c99ce9746fb6d9e85f866c3cba97552c31948342c WHIRLPOOL af84fdd4aca89713c10a087507e30631ddeea5b6002005db7c198588890df38573229618499eb0e7f4bb87782aaa38589c556d5fa4348a1e636561a1595309b0
diff --git a/sys-libs/binutils-libs/binutils-libs-2.25.1-r2.ebuild b/sys-libs/binutils-libs/binutils-libs-2.25.1-r2.ebuild
new file mode 100644
index 000000000000..95a918e34685
--- /dev/null
+++ b/sys-libs/binutils-libs/binutils-libs-2.25.1-r2.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.1"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+MY_PN="binutils"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages"
+HOMEPAGE="https://sourceware.org/binutils/"
+SRC_URI="mirror://gnu/binutils/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.xz"
+
+LICENSE="|| ( GPL-3 LGPL-3 )"
+# The shared lib SONAMEs use the ${PV} in them.
+SLOT="0/${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="64-bit-bfd multitarget nls static-libs zlib"
+
+COMMON_DEPEND="zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+DEPEND="${COMMON_DEPEND}
+ nls? ( sys-devel/gettext )"
+# Need a newer binutils-config that'll reset include/lib symlinks for us.
+RDEPEND="${COMMON_DEPEND}
+ >=sys-devel/binutils-config-5
+ nls? ( !<sys-devel/gdb-7.10-r1[nls] )"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/bfd.h
+)
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+}
+
+pkgversion() {
+ printf "Gentoo ${PVR}"
+ [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
+}
+
+multilib_src_configure() {
+ local myconf=(
+ $(use_with zlib)
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.24) make this an explicit option. #497268
+ --enable-install-libiberty
+ --disable-werror
+ --with-bugurl="https://bugs.gentoo.org/"
+ --with-pkgversion="$(pkgversion)"
+ $(use_enable static-libs static)
+ # The binutils eclass enables this flag for all bi-arch builds,
+ # but other tools often don't care about that support. Put it
+ # beyond a flag if people really want it, but otherwise leave
+ # it disabled as it can slow things down on 32bit arches. #438522
+ $(use_enable 64-bit-bfd)
+ # We only care about the libs, so disable programs. #528088
+ --disable-{binutils,etc,ld,gas,gold,gprof}
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ )
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ use nls \
+ && myconf+=( --without-included-gettext ) \
+ || myconf+=( --disable-nls )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+ default
+ # Provide libiberty.h directly.
+ dosym libiberty/libiberty.h /usr/include/libiberty.h
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+}
diff --git a/sys-libs/binutils-libs/binutils-libs-2.27.ebuild b/sys-libs/binutils-libs/binutils-libs-2.27.ebuild
new file mode 100644
index 000000000000..17de45b112f6
--- /dev/null
+++ b/sys-libs/binutils-libs/binutils-libs-2.27.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.0"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+MY_PN="binutils"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages"
+HOMEPAGE="https://sourceware.org/binutils/"
+SRC_URI="mirror://gnu/binutils/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.xz"
+
+LICENSE="|| ( GPL-3 LGPL-3 )"
+# The shared lib SONAMEs use the ${PV} in them.
+SLOT="0/${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="64-bit-bfd multitarget nls static-libs"
+
+COMMON_DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
+DEPEND="${COMMON_DEPEND}
+ nls? ( sys-devel/gettext )"
+# Need a newer binutils-config that'll reset include/lib symlinks for us.
+RDEPEND="${COMMON_DEPEND}
+ >=sys-devel/binutils-config-5
+ nls? ( !<sys-devel/gdb-7.10-r1[nls] )"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/bfd.h
+)
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+}
+
+pkgversion() {
+ printf "Gentoo ${PVR}"
+ [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.24) make this an explicit option. #497268
+ --enable-install-libiberty
+ --disable-werror
+ --with-bugurl="https://bugs.gentoo.org/"
+ --with-pkgversion="$(pkgversion)"
+ $(use_enable static-libs static)
+ # The binutils eclass enables this flag for all bi-arch builds,
+ # but other tools often don't care about that support. Put it
+ # beyond a flag if people really want it, but otherwise leave
+ # it disabled as it can slow things down on 32bit arches. #438522
+ $(use_enable 64-bit-bfd)
+ # This only disables building in the zlib subdir.
+ # For binutils itself, it'll use the system version. #591516
+ --without-zlib
+ --with-system-zlib
+ # We only care about the libs, so disable programs. #528088
+ --disable-{binutils,etc,ld,gas,gold,gprof}
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ )
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ use nls \
+ && myconf+=( --without-included-gettext ) \
+ || myconf+=( --disable-nls )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+ default
+ # Provide libiberty.h directly.
+ dosym libiberty/libiberty.h /usr/include/libiberty.h
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+}
diff --git a/sys-libs/binutils-libs/binutils-libs-2.28-r1.ebuild b/sys-libs/binutils-libs/binutils-libs-2.28-r1.ebuild
new file mode 100644
index 000000000000..71fb7dcb22a0
--- /dev/null
+++ b/sys-libs/binutils-libs/binutils-libs-2.28-r1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.2"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+MY_PN="binutils"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages"
+HOMEPAGE="https://sourceware.org/binutils/"
+SRC_URI="mirror://gnu/binutils/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.xz"
+
+LICENSE="|| ( GPL-3 LGPL-3 )"
+# The shared lib SONAMEs use the ${PV} in them.
+SLOT="0/${PV}"
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="64-bit-bfd multitarget nls static-libs"
+
+COMMON_DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
+DEPEND="${COMMON_DEPEND}
+ >=sys-apps/texinfo-4.7
+ nls? ( sys-devel/gettext )"
+# Need a newer binutils-config that'll reset include/lib symlinks for us.
+RDEPEND="${COMMON_DEPEND}
+ >=sys-devel/binutils-config-5
+ nls? ( !<sys-devel/gdb-7.10-r1[nls] )"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/bfd.h
+)
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+}
+
+pkgversion() {
+ printf "Gentoo ${PVR}"
+ [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.24) make this an explicit option. #497268
+ --enable-install-libiberty
+ --disable-werror
+ --with-bugurl="https://bugs.gentoo.org/"
+ --with-pkgversion="$(pkgversion)"
+ $(use_enable static-libs static)
+ # The binutils eclass enables this flag for all bi-arch builds,
+ # but other tools often don't care about that support. Put it
+ # beyond a flag if people really want it, but otherwise leave
+ # it disabled as it can slow things down on 32bit arches. #438522
+ $(use_enable 64-bit-bfd)
+ # This only disables building in the zlib subdir.
+ # For binutils itself, it'll use the system version. #591516
+ --without-zlib
+ --with-system-zlib
+ # We only care about the libs, so disable programs. #528088
+ --disable-{binutils,etc,ld,gas,gold,gprof}
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ )
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ use nls \
+ && myconf+=( --without-included-gettext ) \
+ || myconf+=( --disable-nls )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+ default
+ # Provide libiberty.h directly.
+ dosym libiberty/libiberty.h /usr/include/libiberty.h
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+}
diff --git a/sys-libs/binutils-libs/binutils-libs-2.28.1.ebuild b/sys-libs/binutils-libs/binutils-libs-2.28.1.ebuild
new file mode 100644
index 000000000000..0af572c85ed4
--- /dev/null
+++ b/sys-libs/binutils-libs/binutils-libs-2.28.1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.0"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+MY_PN="binutils"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages"
+HOMEPAGE="https://sourceware.org/binutils/"
+SRC_URI="mirror://gnu/binutils/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.xz"
+
+LICENSE="|| ( GPL-3 LGPL-3 )"
+# The shared lib SONAMEs use the ${PV} in them.
+SLOT="0/${PV}"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="64-bit-bfd multitarget nls static-libs"
+
+COMMON_DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
+DEPEND="${COMMON_DEPEND}
+ >=sys-apps/texinfo-4.7
+ nls? ( sys-devel/gettext )"
+# Need a newer binutils-config that'll reset include/lib symlinks for us.
+RDEPEND="${COMMON_DEPEND}
+ >=sys-devel/binutils-config-5
+ nls? ( !<sys-devel/gdb-7.10-r1[nls] )"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/bfd.h
+)
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+}
+
+pkgversion() {
+ printf "Gentoo ${PVR}"
+ [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.24) make this an explicit option. #497268
+ --enable-install-libiberty
+ --disable-werror
+ --with-bugurl="https://bugs.gentoo.org/"
+ --with-pkgversion="$(pkgversion)"
+ $(use_enable static-libs static)
+ # The binutils eclass enables this flag for all bi-arch builds,
+ # but other tools often don't care about that support. Put it
+ # beyond a flag if people really want it, but otherwise leave
+ # it disabled as it can slow things down on 32bit arches. #438522
+ $(use_enable 64-bit-bfd)
+ # This only disables building in the zlib subdir.
+ # For binutils itself, it'll use the system version. #591516
+ --without-zlib
+ --with-system-zlib
+ # We only care about the libs, so disable programs. #528088
+ --disable-{binutils,etc,ld,gas,gold,gprof}
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ )
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ use nls \
+ && myconf+=( --without-included-gettext ) \
+ || myconf+=( --disable-nls )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+ default
+ # Provide libiberty.h directly.
+ dosym libiberty/libiberty.h /usr/include/libiberty.h
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+}
diff --git a/sys-libs/binutils-libs/binutils-libs-2.29.1.ebuild b/sys-libs/binutils-libs/binutils-libs-2.29.1.ebuild
new file mode 100644
index 000000000000..eb6065807e00
--- /dev/null
+++ b/sys-libs/binutils-libs/binutils-libs-2.29.1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.0"
+PATCH_BINUTILS_VER="2.29"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+MY_PN="binutils"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages"
+HOMEPAGE="https://sourceware.org/binutils/"
+SRC_URI="mirror://gnu/binutils/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_PN}-${PATCH_BINUTILS_VER}-patches-${PATCHVER}.tar.xz"
+
+LICENSE="|| ( GPL-3 LGPL-3 )"
+# The shared lib SONAMEs use the ${PV} in them.
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="64-bit-bfd multitarget nls static-libs"
+
+COMMON_DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
+DEPEND="${COMMON_DEPEND}
+ >=sys-apps/texinfo-4.7
+ nls? ( sys-devel/gettext )"
+# Need a newer binutils-config that'll reset include/lib symlinks for us.
+RDEPEND="${COMMON_DEPEND}
+ >=sys-devel/binutils-config-5
+ nls? ( !<sys-devel/gdb-7.10-r1[nls] )"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/bfd.h
+)
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+}
+
+pkgversion() {
+ printf "Gentoo ${PVR}"
+ [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.24) make this an explicit option. #497268
+ --enable-install-libiberty
+ --disable-werror
+ --with-bugurl="https://bugs.gentoo.org/"
+ --with-pkgversion="$(pkgversion)"
+ $(use_enable static-libs static)
+ # The binutils eclass enables this flag for all bi-arch builds,
+ # but other tools often don't care about that support. Put it
+ # beyond a flag if people really want it, but otherwise leave
+ # it disabled as it can slow things down on 32bit arches. #438522
+ $(use_enable 64-bit-bfd)
+ # This only disables building in the zlib subdir.
+ # For binutils itself, it'll use the system version. #591516
+ --without-zlib
+ --with-system-zlib
+ # We only care about the libs, so disable programs. #528088
+ --disable-{binutils,etc,ld,gas,gold,gprof}
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ )
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ use nls \
+ && myconf+=( --without-included-gettext ) \
+ || myconf+=( --disable-nls )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+ default
+ # Provide libiberty.h directly.
+ dosym libiberty/libiberty.h /usr/include/libiberty.h
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+}
diff --git a/sys-libs/binutils-libs/binutils-libs-2.29.ebuild b/sys-libs/binutils-libs/binutils-libs-2.29.ebuild
new file mode 100644
index 000000000000..05b015965804
--- /dev/null
+++ b/sys-libs/binutils-libs/binutils-libs-2.29.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.0"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+MY_PN="binutils"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages"
+HOMEPAGE="https://sourceware.org/binutils/"
+SRC_URI="mirror://gnu/binutils/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.xz"
+
+LICENSE="|| ( GPL-3 LGPL-3 )"
+# The shared lib SONAMEs use the ${PV} in them.
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="64-bit-bfd multitarget nls static-libs"
+
+COMMON_DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
+DEPEND="${COMMON_DEPEND}
+ >=sys-apps/texinfo-4.7
+ nls? ( sys-devel/gettext )"
+# Need a newer binutils-config that'll reset include/lib symlinks for us.
+RDEPEND="${COMMON_DEPEND}
+ >=sys-devel/binutils-config-5
+ nls? ( !<sys-devel/gdb-7.10-r1[nls] )"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/bfd.h
+)
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+}
+
+pkgversion() {
+ printf "Gentoo ${PVR}"
+ [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.24) make this an explicit option. #497268
+ --enable-install-libiberty
+ --disable-werror
+ --with-bugurl="https://bugs.gentoo.org/"
+ --with-pkgversion="$(pkgversion)"
+ $(use_enable static-libs static)
+ # The binutils eclass enables this flag for all bi-arch builds,
+ # but other tools often don't care about that support. Put it
+ # beyond a flag if people really want it, but otherwise leave
+ # it disabled as it can slow things down on 32bit arches. #438522
+ $(use_enable 64-bit-bfd)
+ # This only disables building in the zlib subdir.
+ # For binutils itself, it'll use the system version. #591516
+ --without-zlib
+ --with-system-zlib
+ # We only care about the libs, so disable programs. #528088
+ --disable-{binutils,etc,ld,gas,gold,gprof}
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ )
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ use nls \
+ && myconf+=( --without-included-gettext ) \
+ || myconf+=( --disable-nls )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+ default
+ # Provide libiberty.h directly.
+ dosym libiberty/libiberty.h /usr/include/libiberty.h
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+}
diff --git a/sys-libs/binutils-libs/metadata.xml b/sys-libs/binutils-libs/metadata.xml
new file mode 100644
index 000000000000..80f41eae3f2b
--- /dev/null
+++ b/sys-libs/binutils-libs/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 type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+<use>
+ <flag name="64-bit-bfd">Support 64-bit targets even on 32-bit hosts (is ignored on 64-bit hosts)</flag>
+ <flag name="multitarget">Enable all possible targets in libbfd</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:gnu:binutils</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
new file mode 100644
index 000000000000..844fd6cce019
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -0,0 +1,10 @@
+DIST compiler-rt-4.0.1.src.tar.xz 1434100 SHA256 a3c87794334887b93b7a766c507244a7cdcce1d48b2e9249fc9a94f2c3beb440 SHA512 cfeb625884b273f7c0e6767b81a8d3e5f24e0b96a510d5764d9d47a0e215fc841b4cb9d1843c8fb428cd21def720cfbfe8d3593ff5bb390548ebc8c32a902649 WHIRLPOOL 8b33c6841cacefe98da92435418b13b8f8ed97a982903be827e5c37f937dc9001975d6a709d60423b21509dd5670ee2e90cb34c96473fb4a66c2ab6f47af09e5
+DIST compiler-rt-5.0.0.src.tar.xz 1507996 SHA256 d5ad5266462134a482b381f1f8115b6cad3473741b3bb7d1acc7f69fd0f0c0b3 SHA512 5f3fd49736fba35232b0baa19a5f03c4ab3bf85ec16f23355eb3c516fe6d861c14272c224ca2f2092a80636df4307e49a3df1b60a3791949b3f1ba4a0c8c81fb WHIRLPOOL 7ac0eb36b59a7917b694e4b5e9a425a3ffed7c48eda0c211a7d1c52596b2d39fa4bc0a84db5f58492bf7b5b64c22b81cd2fcd8dee2bceb89583b6e190c70d2d8
+DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d WHIRLPOOL 1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
+DIST llvm-5.0.0.src.tar.xz 23411980 SHA256 e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a WHIRLPOOL 6a99edbdc3e6726dc8ff9126b110fd7560faac46601407722e6dd80b5d894ff242521dc8fda7f4d879de83dac51c65645a37224f7e8def0d8d2f1e564b0531bb
+EBUILD compiler-rt-sanitizers-4.0.1.ebuild 3700 SHA256 e94c8ca46912fae9fd0341e1d04e21a187223aef73ff3fc6d8c2c5266ec9c7f6 SHA512 ded0c49686b4e1cce4ec15f199a913c0668d643a8217ffcdfc1b62dddb28c08754a791a38dcdbdf5defdd6e5fa917b3aa3bed27ac7e6c574a933a8149168f320 WHIRLPOOL edacaff32670287f15f92c357e3ece365c99e3558a17c1ff2d2d9fa954851c7e35207e8b87de0616cd4e98bed09b7dda64bd0c9d4080dcaac50f4be1b0eae28d
+EBUILD compiler-rt-sanitizers-5.0.0.ebuild 3645 SHA256 fed86a6a5176fda58c40b958ec33cb419a1c324d3b6c46aca3dba40eff54ebc0 SHA512 c54db543aafa607484f49bba0171c5e46c30ac461431711baa7ec1f65e81aae633c48bb5c83dc1f0b77a3aacaab539040e3fdadb842c27ae1b1fb4904ff1c95e WHIRLPOOL f34ea544071a0d03c75b435b204a14e19f33ddb0869f9a8bae199a24962a13f5ccb338307f842cb7ff6ecb481139ef0745c260f94efde92d6e6d4300e1c77275
+EBUILD compiler-rt-sanitizers-5.0.9999.ebuild 3862 SHA256 6b82152a67c2f4b82f417c6e97259d03807f6cf2ec357f6ee9bd46b40959e9c8 SHA512 2c79eb1f8c92a420a07b68acefc00b8fbec6032e98aded26faf3045c76961dd5a295463859ac81fc7088770a6df503bcd5ee489d90f6f3268b64b8d3bce58e93 WHIRLPOOL af88861d550afc0f7d80a72584ccefc45f055a5a687aec99721d692c9b26cfa2793383af0bf828dc05c43432b34ea89df3ec729caa008e4bca6acd821fbd0152
+EBUILD compiler-rt-sanitizers-9999.ebuild 4038 SHA256 ab69b8ee1f478316da37c4cc2fc1b309b14bb2234ae273ed3e311a9473e05f98 SHA512 dfab5425724b3bddbb061bacd0e7ac71056e115f3c7676b371e8ff8944e09bbdb3b7a9840a308b8bff8d77c878fb0e9072eb6c20260819effa92d50457d00d09 WHIRLPOOL 21f256ea1f5d8c6a059ea81195b502b52ba1e0db48114761c4e0c244bc3c0c661f7c8e74cba23c5d1d5ebcfbb5daa3aea0ff712d1f24007f656c11f05ad120fe
+MISC ChangeLog 1300 SHA256 acfa9e6834077c600556eea74d2e5f70f0b607877b0edcd88f17388cca5e4f9a SHA512 0f2006ec7f8193506ae6c39995c7b08503fd0b81e5ede648be46e511b5f7168372c40d845ff4936d0d6455970e37fa44212156f43578f4f501c1dbee469ea6b6 WHIRLPOOL 6a0fca5215e7d5aa7a5ee79ebb9a9df00e7473ff78097b0ce5b20d8ee636796b9d60ca6a13cd568450ae3450feb3330d9653c815514478179fbd52865b8b0a1d
+MISC metadata.xml 216 SHA256 e94ba81dd2791908508a3993afdebf723cc617314c53c273b9bcca15a9c48327 SHA512 3485598147c953e72e1785693a489a7e7d73d59620b76054db9c0ce95d8bfa0e8ffec29da7f7a9d73a32e5b77eac07ca3306c56a972dc57fd89d477edaebf3d5 WHIRLPOOL 29145f5721e079e0548c5ef22424c65e6a5b2bfc4428918e923fcfdfc37e9b8749fb63e3c2eb5773c17fab276f7513dd66e326b906f1848911dceba7ae4b419a
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
new file mode 100644
index 000000000000..5cee6068c3a6
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.1.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils flag-o-matic llvm python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/compiler-rt-${PV/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+
+LLVM_SLOT=${SLOT%%.*}
+RDEPEND="!=sys-libs/compiler-rt-sanitizers-${SLOT}*:0"
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ test? (
+ app-portage/unsandbox
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT}
+ sys-libs/compiler-rt:${SLOT} )
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/compiler-rt-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+check_space() {
+ if use test; then
+ local CHECKREQS_DISK_BUILD=11G
+ check-reqs_pkg_pretend
+ fi
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ if use test; then
+ mv llvm-* llvm || die
+ fi
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+ # use a build dir structure consistent with install
+ # this makes it possible to easily deploy test-friendly clang
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=ON
+ -DCOMPILER_RT_BUILD_XRAY=ON
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+
+ # same flags are passed for build & tests, so we need to strip
+ # them down to a subset supported by clang
+ CC=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ fi
+
+ cmake-utils_src_configure
+
+ if use test; then
+ local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
+ [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
+ [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
+
+ # copy clang over since resource_dir is located relatively to binary
+ # therefore, we can put our new libraries in it
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die
+ cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
+ "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
+ cp "${sys_dir}"/*builtins*.a \
+ "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
+ # we also need LLVMgold.so for gold-based tests
+ if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.0.ebuild
new file mode 100644
index 000000000000..8f82822471dd
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.0.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils flag-o-matic llvm python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/compiler-rt-${PV/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ test? (
+ app-portage/unsandbox
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT}
+ sys-libs/compiler-rt:${SLOT} )
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/compiler-rt-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+check_space() {
+ if use test; then
+ local CHECKREQS_DISK_BUILD=11G
+ check-reqs_pkg_pretend
+ fi
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ if use test; then
+ mv llvm-* llvm || die
+ fi
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+ # use a build dir structure consistent with install
+ # this makes it possible to easily deploy test-friendly clang
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=ON
+ -DCOMPILER_RT_BUILD_XRAY=ON
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+
+ # same flags are passed for build & tests, so we need to strip
+ # them down to a subset supported by clang
+ CC=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ fi
+
+ cmake-utils_src_configure
+
+ if use test; then
+ local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
+ [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
+ [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
+
+ # copy clang over since resource_dir is located relatively to binary
+ # therefore, we can put our new libraries in it
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die
+ cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
+ "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
+ cp "${sys_dir}"/*builtins*.a \
+ "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
+ # we also need LLVMgold.so for gold-based tests
+ if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.9999.ebuild
new file mode 100644
index 000000000000..5118f318acd5
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-5.0.9999.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils flag-o-matic git-r3 llvm python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git
+ https://github.com/llvm-mirror/compiler-rt.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+# Note: this needs to be updated to match version of clang-9999
+SLOT="5.0.1"
+KEYWORDS=""
+IUSE="test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ test? (
+ app-portage/unsandbox
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT}
+ sys-libs/compiler-rt:${SLOT} )
+ ${PYTHON_DEPS}"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+check_space() {
+ if use test; then
+ local CHECKREQS_DISK_BUILD=11G
+ check-reqs_pkg_pretend
+ fi
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+ # use a build dir structure consistent with install
+ # this makes it possible to easily deploy test-friendly clang
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=ON
+ -DCOMPILER_RT_BUILD_XRAY=ON
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+
+ # same flags are passed for build & tests, so we need to strip
+ # them down to a subset supported by clang
+ CC=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ fi
+
+ cmake-utils_src_configure
+
+ if use test; then
+ local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
+ [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
+ [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
+
+ # copy clang over since resource_dir is located relatively to binary
+ # therefore, we can put our new libraries in it
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die
+ cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
+ "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
+ cp "${sys_dir}"/*builtins*.a \
+ "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
+ # we also need LLVMgold.so for gold-based tests
+ if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
new file mode 100644
index 000000000000..82ccb7403217
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils flag-o-matic git-r3 llvm python-any-r1
+
+DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git
+ https://github.com/llvm-mirror/compiler-rt.git"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+# Note: this needs to be updated to match version of clang-9999
+SLOT="6.0.0"
+KEYWORDS=""
+IUSE="test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ test? (
+ app-portage/unsandbox
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT}
+ sys-libs/compiler-rt:${SLOT} )
+ ${PYTHON_DEPS}"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+check_space() {
+ if use test; then
+ local CHECKREQS_DISK_BUILD=11G
+ check-reqs_pkg_pretend
+ fi
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+ # use a build dir structure consistent with install
+ # this makes it possible to easily deploy test-friendly clang
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ # built-ins installed by sys-libs/compiler-rt
+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
+ -DCOMPILER_RT_BUILD_LIBFUZZER=ON
+ -DCOMPILER_RT_BUILD_PROFILE=ON
+ -DCOMPILER_RT_BUILD_SANITIZERS=ON
+ -DCOMPILER_RT_BUILD_XRAY=ON
+ )
+ if use test; then
+ cat > "${T}"/unsandbox-lit.py <<-EOF || die
+ import os, sys
+ os.execlp("unsandbox", sys.argv[0], "lit", *sys.argv[1:])
+ EOF
+
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_EXTERNAL_LIT="${T}/unsandbox-lit.py"
+ -DLLVM_LIT_ARGS="-vv"
+
+ # they are created during src_test()
+ -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+
+ # same flags are passed for build & tests, so we need to strip
+ # them down to a subset supported by clang
+ CC=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang \
+ CXX=${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++ \
+ strip-unsupported-flags
+ fi
+
+ cmake-utils_src_configure
+
+ if use test; then
+ local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* )
+ [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}"
+ [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}"
+
+ # copy clang over since resource_dir is located relatively to binary
+ # therefore, we can put our new libraries in it
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die
+ cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \
+ "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die
+ cp "${sys_dir}"/*builtins*.a \
+ "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die
+ # we also need LLVMgold.so for gold-based tests
+ if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then
+ ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die
+ fi
+ fi
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-all
+}
diff --git a/sys-libs/compiler-rt-sanitizers/metadata.xml b/sys-libs/compiler-rt-sanitizers/metadata.xml
new file mode 100644
index 000000000000..89c4bdb96049
--- /dev/null
+++ b/sys-libs/compiler-rt-sanitizers/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 type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/compiler-rt/Manifest b/sys-libs/compiler-rt/Manifest
new file mode 100644
index 000000000000..272b576c0b15
--- /dev/null
+++ b/sys-libs/compiler-rt/Manifest
@@ -0,0 +1,8 @@
+DIST compiler-rt-4.0.1.src.tar.xz 1434100 SHA256 a3c87794334887b93b7a766c507244a7cdcce1d48b2e9249fc9a94f2c3beb440 SHA512 cfeb625884b273f7c0e6767b81a8d3e5f24e0b96a510d5764d9d47a0e215fc841b4cb9d1843c8fb428cd21def720cfbfe8d3593ff5bb390548ebc8c32a902649 WHIRLPOOL 8b33c6841cacefe98da92435418b13b8f8ed97a982903be827e5c37f937dc9001975d6a709d60423b21509dd5670ee2e90cb34c96473fb4a66c2ab6f47af09e5
+DIST compiler-rt-5.0.0.src.tar.xz 1507996 SHA256 d5ad5266462134a482b381f1f8115b6cad3473741b3bb7d1acc7f69fd0f0c0b3 SHA512 5f3fd49736fba35232b0baa19a5f03c4ab3bf85ec16f23355eb3c516fe6d861c14272c224ca2f2092a80636df4307e49a3df1b60a3791949b3f1ba4a0c8c81fb WHIRLPOOL 7ac0eb36b59a7917b694e4b5e9a425a3ffed7c48eda0c211a7d1c52596b2d39fa4bc0a84db5f58492bf7b5b64c22b81cd2fcd8dee2bceb89583b6e190c70d2d8
+EBUILD compiler-rt-4.0.1.ebuild 4140 SHA256 9545c010bbaeb42c0c0ffe5ceedba2ffb43da080c0d967e5eda4c9156f189e4b SHA512 1045366ba80a89af9f0b86825da1040b315234b81a756b350f6156aabfcac371e305d92eaef7d83374ce6475589cc7799517b09b52e26569cb2ce4171e6f512d WHIRLPOOL 3a693783df5dce274dc215fda8338b958499b3e242db47d1433f0d0f5f3f8366d79c84a45d6af1a599b421ca62eda1179393b1417bae82be26191f9fb0467d4c
+EBUILD compiler-rt-5.0.0.ebuild 2465 SHA256 b9642f659ee7b7cc261941165af3cc678e2b2039e9d4b9fa7ca1899b42b6625f SHA512 a6b6cc988d66efa33917031c30edac1685a2421250182b74e3ae50f86ad30e60b088b43697d256a77cc3e5a0ca44dd111801dd191f20563e35c5620f5d28580a WHIRLPOOL 2134438e2f28b6db0eeb590da42f775458f93f2bba48792b3ce6f1c9e7d17ce9b888cb42290a5669dc08e0fecc4d45c4b454a3369f7751e89f3829cd2fc7e0be
+EBUILD compiler-rt-5.0.9999.ebuild 2565 SHA256 b2fba465b88e6db46910f3d1ba1979d0d8d47d439c350ef719bd30a9ce002d86 SHA512 f7a1a7db0cec09ffefa9c8d96f603b86d388f8eb94f3e8fcb26dc85046d58c9a42e7ade0c869a54e6e427980f82bc67f4ad0b6f8c8d1349e3ccfc7b0ffee84c4 WHIRLPOOL 67d79931765a6d135fd14f9162634f054ad4cbcdf0bce7849a739aafd9f6994f82c979c05e8c9af7b8e2335834d1819cc2539f9fecf19b78d5a28bdbda314a42
+EBUILD compiler-rt-9999.ebuild 2641 SHA256 6daa15e9cb05625706bebd5d88521bc2cc8aa61a71e0899308214bc8726790d2 SHA512 a3abf71a684f1d208b18c9fc805296a445c5cdafb945384b19eba05bc53d61942c18d4f21bb8c86d0a2f1edd3daa4ffaa4d89696e4b146e94f7bcb991b85697d WHIRLPOOL cfe3861cc95587951b3ab8eb8a2e0efd65409e96d5a85ee27febe48b145c1114f1362b5a0879cae7a32608e145eaa3ac5fbec65a74e84c3877ee1d18c72b5d79
+MISC ChangeLog 1484 SHA256 d4460f2dfc06bb597b20da8e44d333c86d8282e7bee9a5cdb5f77ebb666d93b6 SHA512 60a0c5178b9f219b9e411e30a8a8b8b550e1e8c8dd477579044b72b8f8fbfa52c350dff871e43ad71ec1e71b50d72472c8bbdc85bd4d88549f334a3da5389c98 WHIRLPOOL 47b2acab1f3a6f2f95c043ce05b8cd209aafe56e199e617c991672d7046f7f34271eb9bc91d0146b17659b3fc9dd7cb3bcc46967add50aedf7f26ba1acc12e5f
+MISC metadata.xml 333 SHA256 358db03e7c65d9f9ac1ce9d4db64f695300fe1bb684249a3a9cc70c94567950b SHA512 97daa7452a696b7297c47f5f637a33425f82b51426060a75b3de6bc812f9ddcd3c70ae068bc3e88ce937ab1eb10d59b0ab48a2d2c0397a112b8b6a754e333bdc WHIRLPOOL d7d22a6bdfe1827698250cc3cd9e1911808fff08e5d13b348103607718bd48ef807b965bcc7ab5b12da56df5d6a3cd6a6d56d091b6975701e45bf2a8db766026
diff --git a/sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild b/sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild
new file mode 100644
index 000000000000..bc1e65eb314f
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+# TODO: fix unnecessary dep on Python upstream
+inherit cmake-utils flag-o-matic llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+clang test"
+
+LLVM_SLOT=${SLOT%%.*}
+RDEPEND="!=sys-libs/compiler-rt-${SLOT}*:0"
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
+ test? ( =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_pretend() {
+ if ! use clang && ! tc-is-clang; then
+ ewarn "Building using a compiler other than clang may result in broken atomics"
+ ewarn "library. Enable USE=clang unless you have a very good reason not to."
+ fi
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+test_compiler() {
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+ <<<'int main() { return 0; }' &>/dev/null
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local nolib_flags=( -nodefaultlibs -lc )
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ strip-unsupported-flags
+ elif ! test_compiler; then
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
+ fi
+ fi
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+ # use a build dir structure consistent with install
+ # this makes it possible to easily deploy test-friendly clang
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}"
+
+ # currently lit covers only sanitizer tests
+ -DCOMPILER_RT_INCLUDE_TESTS=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+ -DCOMPILER_RT_BUILD_XRAY=OFF
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # prepare a test compiler
+ # copy clang over since resource_dir is located relatively to binary
+ # therefore, we can put our new libraries in it
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}{/bin,$(get_libdir)},clang/${SLOT}/include} || die
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die
+ cp "${EPREFIX}/usr/lib/clang/${SLOT}/include"/*.h \
+ "${BUILD_DIR}/lib/clang/${SLOT}/include/" || die
+
+ # builtins are not converted to lit yet, so run them manually
+ local tests=() f
+ cd "${S}"/test/builtins/Unit || die
+ while read -r -d '' f; do
+ # ppc subdir is unmaintained and lacks proper guards
+ # (and ppc builtins do not seem to be used anyway)
+ [[ ${f} == ./ppc/* ]] && continue
+ # these are special
+ [[ ${f} == ./cpu_model_test.c ]] && continue
+ [[ ${f} == ./gcc_personality_test.c ]] && continue
+ # unsupported
+ [[ ${f} == ./trampoline_setup_test.c ]] && continue
+ tests+=( "${f%.c}" )
+ done < <(find -name '*.c' -print0)
+
+ {
+ echo "check: ${tests[*]/#/check-}" &&
+ echo ".PHONY: check ${tests[*]/#/check-}" &&
+ for f in "${tests[@]}"; do
+ echo "check-${f}: ${f}" &&
+ echo " ${f}"
+ done
+ } > Makefile || die
+
+ local ABI
+ for ABI in $(get_all_abis); do
+ # not supported at all at the moment
+ [[ ${ABI} == x32 ]] && continue
+
+ rm -f "${tests[@]}" || die
+
+ einfo "Running tests for ABI=${ABI}"
+ # use -k to run all tests even if some fail
+ emake -k \
+ CC="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang" \
+ CFLAGS="$(get_abi_CFLAGS)" \
+ CPPFLAGS='-I../../../lib/builtins' \
+ LDFLAGS='-rtlib=compiler-rt' \
+ LDLIBS='-lm'
+ done
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # includes are mistakenly installed for all sanitizers and xray
+ rm -rf "${ED}"usr/lib/clang/*/include || die
+}
diff --git a/sys-libs/compiler-rt/compiler-rt-5.0.0.ebuild b/sys-libs/compiler-rt/compiler-rt-5.0.0.ebuild
new file mode 100644
index 000000000000..9b135a41b328
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-5.0.0.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+clang test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
+ ${PYTHON_DEPS}"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_pretend() {
+ if ! use clang && ! tc-is-clang; then
+ ewarn "Building using a compiler other than clang may result in broken atomics"
+ ewarn "library. Enable USE=clang unless you have a very good reason not to."
+ fi
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+test_compiler() {
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+ <<<'int main() { return 0; }' &>/dev/null
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local nolib_flags=( -nodefaultlibs -lc )
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ strip-unsupported-flags
+ elif ! test_compiler; then
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
+ fi
+ fi
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+ -DCOMPILER_RT_BUILD_XRAY=OFF
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-builtins
+}
diff --git a/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild b/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild
new file mode 100644
index 000000000000..d53f8561e00a
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-5.0.9999.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic git-r3 llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git
+ https://github.com/llvm-mirror/compiler-rt.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+# Note: this needs to be updated to match version of clang-9999
+SLOT="5.0.1"
+KEYWORDS=""
+IUSE="+clang test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
+ ${PYTHON_DEPS}"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_pretend() {
+ if ! use clang && ! tc-is-clang; then
+ ewarn "Building using a compiler other than clang may result in broken atomics"
+ ewarn "library. Enable USE=clang unless you have a very good reason not to."
+ fi
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+test_compiler() {
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+ <<<'int main() { return 0; }' &>/dev/null
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local nolib_flags=( -nodefaultlibs -lc )
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ strip-unsupported-flags
+ elif ! test_compiler; then
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
+ fi
+ fi
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+ -DCOMPILER_RT_BUILD_XRAY=OFF
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-builtins
+}
diff --git a/sys-libs/compiler-rt/compiler-rt-9999.ebuild b/sys-libs/compiler-rt/compiler-rt-9999.ebuild
new file mode 100644
index 000000000000..3f8cb77ef772
--- /dev/null
+++ b/sys-libs/compiler-rt/compiler-rt-9999.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic git-r3 llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="Compiler runtime library for clang (built-in part)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/compiler-rt.git
+ https://github.com/llvm-mirror/compiler-rt.git"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+# Note: this needs to be updated to match version of clang-9999
+SLOT="6.0.0"
+KEYWORDS=""
+IUSE="+clang test"
+
+LLVM_SLOT=${SLOT%%.*}
+# llvm-4 needed for --cmakedir
+DEPEND="
+ >=sys-devel/llvm-4
+ clang? ( sys-devel/clang )
+ test? (
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
+ ${PYTHON_DEPS}"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+pkg_pretend() {
+ if ! use clang && ! tc-is-clang; then
+ ewarn "Building using a compiler other than clang may result in broken atomics"
+ ewarn "library. Enable USE=clang unless you have a very good reason not to."
+ fi
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+test_compiler() {
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \
+ <<<'int main() { return 0; }' &>/dev/null
+}
+
+src_configure() {
+ # pre-set since we need to pass it to cmake
+ BUILD_DIR=${WORKDIR}/${P}_build
+
+ local nolib_flags=( -nodefaultlibs -lc )
+ if use clang; then
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ # ensure we can use clang before installing compiler-rt
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ strip-unsupported-flags
+ elif ! test_compiler; then
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
+ fi
+ fi
+
+ local mycmakeargs=(
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}"
+
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex test)
+ -DCOMPILER_RT_BUILD_LIBFUZZER=OFF
+ -DCOMPILER_RT_BUILD_PROFILE=OFF
+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
+ -DCOMPILER_RT_BUILD_XRAY=OFF
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+
+ -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang"
+ -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/bin/clang++"
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-builtins
+}
diff --git a/sys-libs/compiler-rt/metadata.xml b/sys-libs/compiler-rt/metadata.xml
new file mode 100644
index 000000000000..3b996021381a
--- /dev/null
+++ b/sys-libs/compiler-rt/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 type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='clang'>Force building using installed clang (rather
+ than the default CC/CXX).</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/cracklib/Manifest b/sys-libs/cracklib/Manifest
new file mode 100644
index 000000000000..cabba446b37a
--- /dev/null
+++ b/sys-libs/cracklib/Manifest
@@ -0,0 +1,7 @@
+AUX cracklib-2.9.6-CVE-2016-6318.patch 3288 SHA256 16f033cb2192cb27d77e992b5399a4f2b99f7a0afa13f112f98a82b5ad826eee SHA512 232f632034fb602ea464885cd9f07aa30a3feb04bd231e7c2f2854f47493e027d87910454c089dc2c567aa01f6882bed7ee2a86d929fa36178746cf2a7dbf346 WHIRLPOOL 898cc6e66dc5b0801b324836a80004a7d0f97c710a46c618f29ff12b72e22c924cd7d82cad1163df1b47597f5676a84ec64955ddad7297ce64c98323ca127288
+AUX cracklib-2.9.6-fix-long-word-bufferoverflow.patch 1614 SHA256 b26ea5ff656e606f27baceccf2c11503fc2deeea912397b44f31ebd0dbdd7ddd SHA512 e4a2f9f467d3f0ce8acd4c9ea6ca19787dca6bd2bfaa80ddbf9ec1214a5e2b519c088b07760349adac9bd6805a4b512c015181863d679643cc12c68104c29a6d WHIRLPOOL abea9574414390a474561313e501b240457da22cd8fb18109ad42ab5af9a504ee20c4a2a3d9d4b9ea7bd148d26604ba5c1826a511f68d08f43c9b69b18d27f8f
+DIST cracklib-2.9.6.tar.gz 642402 SHA256 17cf76943de272fd579ed831a1fd85339b393f8d00bf9e0d17c91e972f583343 SHA512 2b09672e5b412d670e7ed911ebf0c0023fe2901ea05c9c02eefb7a58a13cddbc27a65d75bb20be9f8cebf4c90a9a56dfe1a3b656dff62b1d6048f5376e671786 WHIRLPOOL 2b7b908952166e07aedfca7d17423a8dff0ec145a5f34a7ec01571cb591f0e92e57dd25ab6ffff15f1ec276bfefa455072fc7741e664115a4fafdd7f75d580e1
+EBUILD cracklib-2.9.6-r1.ebuild 2586 SHA256 00bef078c5d6ba19c76edaa79d58c091bd1f02d3cc6ffbb39e2c3e38c3956edd SHA512 0154faa441e253340b73b681ca939cc63bb3a3e6fc165f94593da6036478bd3b849557ac53f6b260028d4627414b269434d7bbb3f5dc1e5bccb149abf10add2c WHIRLPOOL 1898e3f398636ab985472db34af285dd910ed6834eb65e32e423a8c194dff398a14d652dcfe9e8ce0b6dec0d2ae392521074c5265900f67d1e5b5b863f37de01
+MISC ChangeLog 7657 SHA256 66e9eed15ff1a8dd2ca9ed3e7a2476fffeb90433f933c0c687b5fb887b6d7034 SHA512 344ec06e6b80812a30572f2fed8a5c6ae6345ed8f0b1b61e144fe189e57a897c127b6363bbcd6b2a6761d123c4d328e8685931eca2ae4399bc5e3a1f4108d5e0 WHIRLPOOL b836a6a114602930c3feb150448f03faca5cf109f72dd079b0eb22d0aaa4cb6c3aa52dfa7a2b7f5fb05363b039e9b6f660c89cb1edba00bd61a100f0171f6f27
+MISC ChangeLog-2015 27435 SHA256 f4e21158fda642097c81941e1bfbd1ca009335d73a21fefe18e41d322dcafa6e SHA512 73625d98457b1e96cc9b77585a457a3375b34fce199cac90db905616013934ea4edbf05a2d6f1419dba58c3c9e158e900d652c39a8eb7583b91678c293da0592 WHIRLPOOL 7ee06f55d10d379fd01caef49525c803413a551e5dc4573fa01d652b4152c6c4eaf486781fc71ed5e76fb2686e00bc98435a7b8538ec5c4899d4d0d32a3a326c
+MISC metadata.xml 384 SHA256 7634a3d5aca060298d77d31e2b9048b1e4e3c6be42c080f618d882a65f347232 SHA512 773287176f56f1a0f11edc6cd1ca85453f998ad8e58b1e608562335f814aab18124bfb850063dd4fa35aba525b776bf2c202d8afa6d4b51e354276678f324bd1 WHIRLPOOL b94fe41a178eba9f8fcfa6519a8de0e091b14fe3157d3e6c9b7260a069915f10bc66c314e62062e4d5047978944a30c3a978d9f9e08b94a7607a4755530df5e9
diff --git a/sys-libs/cracklib/cracklib-2.9.6-r1.ebuild b/sys-libs/cracklib/cracklib-2.9.6-r1.ebuild
new file mode 100644
index 000000000000..101aef422958
--- /dev/null
+++ b/sys-libs/cracklib/cracklib-2.9.6-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+DISTUTILS_OPTIONAL=1
+
+inherit eutils distutils-r1 libtool multilib-minimal toolchain-funcs
+
+MY_P=${P/_}
+DESCRIPTION="Password Checking Library"
+HOMEPAGE="https://github.com/cracklib/cracklib/"
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${P}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~m68k-mint"
+IUSE="nls python static-libs zlib"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ python? (
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+do_python() {
+ multilib_is_native_abi || return 0
+ use python || return 0
+ pushd python > /dev/null || die
+ distutils-r1_src_${EBUILD_PHASE}
+ popd > /dev/null
+}
+
+pkg_setup() {
+ # workaround #195017
+ if has unmerge-orphans ${FEATURES} && has_version "<${CATEGORY}/${PN}-2.8.10" ; then
+ eerror "Upgrade path is broken with FEATURES=unmerge-orphans"
+ eerror "Please run: FEATURES=-unmerge-orphans emerge cracklib"
+ die "Please run: FEATURES=-unmerge-orphans emerge cracklib"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/cracklib-2.9.6-CVE-2016-6318.patch
+ epatch "${FILESDIR}"/cracklib-2.9.6-fix-long-word-bufferoverflow.patch
+
+ elibtoolize #269003
+ do_python
+}
+
+multilib_src_configure() {
+ export ac_cv_header_zlib_h=$(usex zlib)
+ export ac_cv_search_gzopen=$(usex zlib -lz no)
+ # use /usr/lib so that the dictionary is shared between ABIs
+ ECONF_SOURCE=${S} \
+ econf \
+ --with-default-dict='/usr/lib/cracklib_dict' \
+ --without-python \
+ $(use_enable nls) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_compile() {
+ default
+ do_python
+}
+
+multilib_src_test() {
+ # Make sure we load the freshly built library
+ LD_LIBRARY_PATH="${BUILD_DIR}/lib/.libs" do_python
+}
+
+python_test() {
+ ${EPYTHON} -m unittest test_cracklib || die "Tests fail with ${EPYTHON}"
+}
+
+multilib_src_install() {
+ default
+ # move shared libs to /
+ gen_usr_ldscript -a crack
+
+ do_python
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files
+ rm -r "${ED}"/usr/share/cracklib
+
+ insinto /usr/share/dict
+ doins dicts/cracklib-small || die
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == "/" ]] ; then
+ ebegin "Regenerating cracklib dictionary"
+ create-cracklib-dict "${EPREFIX}"/usr/share/dict/* > /dev/null
+ eend $?
+ fi
+}
diff --git a/sys-libs/cracklib/files/cracklib-2.9.6-CVE-2016-6318.patch b/sys-libs/cracklib/files/cracklib-2.9.6-CVE-2016-6318.patch
new file mode 100644
index 000000000000..bc47734759e2
--- /dev/null
+++ b/sys-libs/cracklib/files/cracklib-2.9.6-CVE-2016-6318.patch
@@ -0,0 +1,108 @@
+From 47e5dec521ab6243c9b249dd65b93d232d90d6b1 Mon Sep 17 00:00:00 2001
+From: Jan Dittberner <jan@dittberner.info>
+Date: Thu, 25 Aug 2016 17:13:49 +0200
+Subject: [PATCH] Apply patch to fix CVE-2016-6318
+
+This patch fixes an issue with a stack-based buffer overflow whne
+parsing large GECOS field. See
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6318 and
+https://security-tracker.debian.org/tracker/CVE-2016-6318 for more
+information.
+---
+ src/NEWS | 1 +
+ src/lib/fascist.c | 57 ++++++++++++++++++++++++++++++++-----------------------
+ 2 files changed, 34 insertions(+), 24 deletions(-)
+
+diff --git a/src/NEWS b/src/NEWS
+index 26abeee..361a207 100644
+--- a/src/NEWS
++++ b/src/NEWS
+@@ -1,3 +1,4 @@
++v2.9.x apply patch to fix CVE-2016-6318 Stack-based buffer overflow when parsing large GECOS field
+ v2.9.6 updates to cracklib-words to add a bunch of other dictionary lists
+ migration to github
+ patch to add some particularly bad cases to the cracklib small dictionary (Matthew Miller)
+diff --git a/src/lib/fascist.c b/src/lib/fascist.c
+index a996509..d4deb15 100644
+--- a/src/lib/fascist.c
++++ b/src/lib/fascist.c
+@@ -502,7 +502,7 @@ FascistGecosUser(char *password, const char *user, const char *gecos)
+ char gbuffer[STRINGSIZE];
+ char tbuffer[STRINGSIZE];
+ char *uwords[STRINGSIZE];
+- char longbuffer[STRINGSIZE * 2];
++ char longbuffer[STRINGSIZE];
+
+ if (gecos == NULL)
+ gecos = "";
+@@ -583,38 +583,47 @@ FascistGecosUser(char *password, const char *user, const char *gecos)
+ {
+ for (i = 0; i < j; i++)
+ {
+- strcpy(longbuffer, uwords[i]);
+- strcat(longbuffer, uwords[j]);
+-
+- if (GTry(longbuffer, password))
++ if (strlen(uwords[i]) + strlen(uwords[j]) < STRINGSIZE)
+ {
+- return _("it is derived from your password entry");
+- }
++ strcpy(longbuffer, uwords[i]);
++ strcat(longbuffer, uwords[j]);
+
+- strcpy(longbuffer, uwords[j]);
+- strcat(longbuffer, uwords[i]);
++ if (GTry(longbuffer, password))
++ {
++ return _("it is derived from your password entry");
++ }
+
+- if (GTry(longbuffer, password))
+- {
+- return _("it's derived from your password entry");
+- }
++ strcpy(longbuffer, uwords[j]);
++ strcat(longbuffer, uwords[i]);
+
+- longbuffer[0] = uwords[i][0];
+- longbuffer[1] = '\0';
+- strcat(longbuffer, uwords[j]);
++ if (GTry(longbuffer, password))
++ {
++ return _("it's derived from your password entry");
++ }
++ }
+
+- if (GTry(longbuffer, password))
++ if (strlen(uwords[j]) < STRINGSIZE - 1)
+ {
+- return _("it is derivable from your password entry");
++ longbuffer[0] = uwords[i][0];
++ longbuffer[1] = '\0';
++ strcat(longbuffer, uwords[j]);
++
++ if (GTry(longbuffer, password))
++ {
++ return _("it is derivable from your password entry");
++ }
+ }
+
+- longbuffer[0] = uwords[j][0];
+- longbuffer[1] = '\0';
+- strcat(longbuffer, uwords[i]);
+-
+- if (GTry(longbuffer, password))
++ if (strlen(uwords[i]) < STRINGSIZE - 1)
+ {
+- return _("it's derivable from your password entry");
++ longbuffer[0] = uwords[j][0];
++ longbuffer[1] = '\0';
++ strcat(longbuffer, uwords[i]);
++
++ if (GTry(longbuffer, password))
++ {
++ return _("it's derivable from your password entry");
++ }
+ }
+ }
+ }
diff --git a/sys-libs/cracklib/files/cracklib-2.9.6-fix-long-word-bufferoverflow.patch b/sys-libs/cracklib/files/cracklib-2.9.6-fix-long-word-bufferoverflow.patch
new file mode 100644
index 000000000000..59dc9e539eb3
--- /dev/null
+++ b/sys-libs/cracklib/files/cracklib-2.9.6-fix-long-word-bufferoverflow.patch
@@ -0,0 +1,43 @@
+From 33d7fa4585247cd2247a1ffa032ad245836c6edb Mon Sep 17 00:00:00 2001
+From: Jan Dittberner <jan@dittberner.info>
+Date: Thu, 25 Aug 2016 17:17:53 +0200
+Subject: [PATCH] Fix a buffer overflow processing long words
+
+A buffer overflow processing long words has been discovered. This commit
+applies the patch from
+https://build.opensuse.org/package/view_file/Base:System/cracklib/0004-overflow-processing-long-words.patch
+by Howard Guo.
+
+See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835386 and
+http://www.openwall.com/lists/oss-security/2016/08/23/8
+---
+ src/NEWS | 1 +
+ src/lib/rules.c | 5 ++---
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/NEWS b/src/NEWS
+index 361a207..f1df3b0 100644
+--- a/src/NEWS
++++ b/src/NEWS
+@@ -1,4 +1,5 @@
+ v2.9.x apply patch to fix CVE-2016-6318 Stack-based buffer overflow when parsing large GECOS field
++ fix a buffer overflow processing long words
+ v2.9.6 updates to cracklib-words to add a bunch of other dictionary lists
+ migration to github
+ patch to add some particularly bad cases to the cracklib small dictionary (Matthew Miller)
+diff --git a/src/lib/rules.c b/src/lib/rules.c
+index d193cc0..3a2aa46 100644
+--- a/src/lib/rules.c
++++ b/src/lib/rules.c
+@@ -434,9 +434,8 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
+ {
+ int limit;
+ register char *ptr;
+- static char area[STRINGSIZE];
+- char area2[STRINGSIZE];
+- area[0] = '\0';
++ static char area[STRINGSIZE * 2] = {0};
++ char area2[STRINGSIZE * 2] = {0};
+ strcpy(area, input);
+
+ for (ptr = control; *ptr; ptr++)
diff --git a/sys-libs/cracklib/metadata.xml b/sys-libs/cracklib/metadata.xml
new file mode 100644
index 000000000000..0bd584bf7040
--- /dev/null
+++ b/sys-libs/cracklib/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">cracklib</remote-id>
+ <remote-id type="github">cracklib/cracklib</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/csu/Manifest b/sys-libs/csu/Manifest
new file mode 100644
index 000000000000..e72372ed571c
--- /dev/null
+++ b/sys-libs/csu/Manifest
@@ -0,0 +1,8 @@
+AUX csu-85-arm-availability.patch 475 SHA256 596acf5e23295c67544d018e8ecb135074ec9cbb51d83d86413fccda1f6bbb3c SHA512 bcdf8153f80f2d873ceda05e3e0b2b798924e311e7038a7c52f2fec760d1c4b38f99eeae4cdd3bcc3ac64c1e123fb333a3d4be08fe36cb1d93823c15ea9c3742 WHIRLPOOL 7dcee120e8b16a530a0d9d156b834bf1eb1ead6d1d23fd73c3689d204f62e86de76cbeb9adb3c356148d6a31769a7b522785aa79eb3e69c091c6171239159c4b
+DIST Csu-79.tar.gz 12719 SHA256 d052e1daa1f5de7fc02e7e7cb8b79ee2eeaad0f321c0a70bea4fc7217e232ec2 SHA512 1d47cce40d400241bdd0a4c24e332f999cb7ae08bd43b08b88e9b5fd5a0a53c9752816b0e07c5b6ffb78f7b5bc24f45986c6a50c661bc5cdd15fee5e465da1bb WHIRLPOOL 74df2f9a9c42bc346f165d8db1d9b3862e2eab89f5b7112e73e27c41419258c0f9c203d7c13acbe43bf2f6c253d12d0f37139d98188773b807419f6bd6bdf4cc
+DIST Csu-85.tar.gz 13376 SHA256 f2291d7548da854322acf194a875609bfae96c2481738cf6fd1d89eea9ae057a SHA512 3cfeb7d37630fc9d6607da018b9ac1aeb3f41a4c190a67e7dc242ae48e7abd0026e25055b9459f2f187d3bb25644f516f079d1b2e943e8cb4cc6c132ad594467 WHIRLPOOL 96552600235fa7e098658e16e2afc1f95ead6bb705703faa6b8f792ec6bcacf9c5c7da5de729d98f83eae337d086750b536f7c1ee0f1a2d5223b53a18d5143f4
+EBUILD csu-79.ebuild 1157 SHA256 90de167c4921fa0dceb3f5bb7f2c4c8106df7be4c25755c7d8ce97f6a4bd8af6 SHA512 7458326cb5087b9bf3386d710cf82f9c7d364cf68f3be68bfd9653d1cb2861973ca4a6d9be41dd314bae9e2063e8c522a5d18781532f78e1b4245a1398e6da6d WHIRLPOOL 398bba6f46cf5238ecedd10a91b8403e5ee50daafcbb9b5593a2e68a59402ec013626e1aafd98fb0c2070e0d9cbcc8d5664baf1c52e702c37bf852f38a2f01a5
+EBUILD csu-85.ebuild 1276 SHA256 f4cdedc17c0f8ef91244b8b4f3a27619b2cedacaec592bcfe6a1f015f2c53898 SHA512 d268f2cf5320cb5c62f6c7f988c2f05f585f61c2cfee79be59d6970876251fe440d1b9947c348fd88169068ba6d6e824c03096d73fc1f403183d311570781bcf WHIRLPOOL c3f3ea587147b1c33e5f7859ac960588ab294fef19d7936b5575221fb6672162de062b65bc16b2004f5fb8ef230ae886c66f60c00c54b2813902303215e16e7f
+MISC ChangeLog 2485 SHA256 8b047577bfa6f61c5a76c7025d5c319da1c2408bde78dadf62726f6854232b6a SHA512 d80d6e89e04732cfa89e3c6756f085bcdfd20ba0d38bc83e38c64cc362aca695d2a1cc311b6e8edfb0b1539a289d4e5718d97b7faab79288d144dd8d7ef4093d WHIRLPOOL b7ede85f9fd4d3083f637ba858d04878226723e371c1c2f73b3db5896dd5697614dbc7f3d37f275a4b369d6fe4b3ee4a174c52fc4d2e7f81ea77b3d83eac1b62
+MISC ChangeLog-2015 1686 SHA256 09ab17cc9adceee0b0bf7ac62722099004795aefb7fc219f78ec113780e7d16d SHA512 41bbab3a0776136d612c0be3012c6504d3c6d43bf40583094d6b3499fa4a4c4d58250a19b44aa5bf18e17eace0194527842efdcec970dc981d35a5731336239b WHIRLPOOL 1ee583adfe7acf0196563fbc91b0903272814dd52a1299f9266fca4acf6a68d1cc6875b05ab34d6db89111ee4071141c9eb1773d224bb28074923a794871348a
+MISC metadata.xml 253 SHA256 9499c0a0b4a789e06676a4d449b0c76c56e3e92a0fc37cc33a810888fc6becbc SHA512 b87265dab4980faf3d32b53ab9ce7d4ebbe5cc9d12300903b1365b337bcd72c337fdec2ef1574615d2d02cf0664023c17c0d30b57ac0237412fd2b401cc0e2f8 WHIRLPOOL 6811616f92b0dbb437634b151ddbb7fbfd95f68a1ff5f2afffc4b8c15effb2ff5de2cbf41f318c36c7f4ba6ae1c4e47ea6713b5451714a2293b312f2d60c4eb0
diff --git a/sys-libs/csu/csu-79.ebuild b/sys-libs/csu/csu-79.ebuild
new file mode 100644
index 000000000000..bd386e8f1cdc
--- /dev/null
+++ b/sys-libs/csu/csu-79.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="Darwin Csu (crt1.o) - Mac OS X 10.6.6 to 10.9.5 versions"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/tarballs/Csu/Csu-${PV}.tar.gz"
+
+LICENSE="APSL-2"
+
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+S=${WORKDIR}/Csu-${PV}
+
+src_prepare() {
+ # since we don't have crt0, we can't build it either
+ sed -i \
+ -e 's:$(SYMROOT)/crt0.o::' \
+ -e '/LOCLIBDIR)\/crt0.o/d' \
+ Makefile || die
+
+ if [[ ${CHOST} == powerpc-*-darwin* && ${CHOST##*-darwin} -le 8 ]] ; then
+ # *must not* be compiled with -Os on PPC because that will
+ # optimize out _pointer_to__darwin_gcc3_preregister_frame_info
+ # which causes linker errors for large programs because the
+ # jump to ___darwin_gcc3_preregister_frame_info gets to be more
+ # than 16MB away
+ sed -i -e "s, -Os , -O ,g" Makefile || die
+ fi
+}
+
+src_compile() {
+ emake USRLIBDIR="${EPREFIX}"/lib || die
+}
+
+src_install() {
+ emake -j1 \
+ USRLIBDIR="${EPREFIX}"/lib \
+ LOCLIBDIR="${EPREFIX}"/lib \
+ DSTROOT="${D}" \
+ install || die
+}
diff --git a/sys-libs/csu/csu-85.ebuild b/sys-libs/csu/csu-85.ebuild
new file mode 100644
index 000000000000..f8c0f3f7d29c
--- /dev/null
+++ b/sys-libs/csu/csu-85.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Darwin Csu (crt1.o) - Mac OS X 10.10 version"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/tarballs/Csu/Csu-${PV}.tar.gz"
+
+LICENSE="APSL-2"
+
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+S=${WORKDIR}/Csu-${PV}
+
+src_prepare() {
+ # since we don't have crt0, we can't build it either
+ sed -i \
+ -e 's:$(SYMROOT)/crt0.o::' \
+ -e '/LOCLIBDIR)\/crt0.o/d' \
+ -e '/^CC = /d' \
+ Makefile || die
+
+ # only require Availability.h for arm, bugs #538602, #539964
+ epatch "${FILESDIR}"/${P}-arm-availability.patch
+
+ if [[ ${CHOST} == powerpc* ]] ; then
+ # *must not* be compiled with -Os on PPC because that
+ # will optimize out
+ # _pointer_to__darwin_gcc3_preregister_frame_info which
+ # causes linker errors for large programs because the
+ # jump to ___darwin_gcc3_preregister_frame_info gets to
+ # be more than 16MB away
+ sed -i -e "s, -Os , -O ,g" Makefile || die
+ fi
+}
+
+src_compile() {
+ emake USRLIBDIR="${EPREFIX}"/lib || die
+}
+
+src_install() {
+ emake -j1 \
+ USRLIBDIR="${EPREFIX}"/lib \
+ LOCLIBDIR="${EPREFIX}"/lib \
+ DSTROOT="${D}" \
+ install || die
+}
diff --git a/sys-libs/csu/files/csu-85-arm-availability.patch b/sys-libs/csu/files/csu-85-arm-availability.patch
new file mode 100644
index 000000000000..6d3f3cf42b06
--- /dev/null
+++ b/sys-libs/csu/files/csu-85-arm-availability.patch
@@ -0,0 +1,18 @@
+Guard inclusion of Availability.h so that it only happens on arm where it's
+actuallty used so it doesn't cause failures on old OS X where Availability.h
+doesn't exist yet.
+
+Michael Weiser <michael@weiser.dinsnail.net>
+
+--- Csu-85/start.s.orig 2013-10-09 01:11:47.000000000 +0200
++++ Csu-85/start.s 2015-02-11 20:34:04.000000000 +0100
+@@ -22,7 +22,9 @@
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
++#ifdef __arm__
+ #include <Availability.h>
++#endif
+
+ #if __ppc__ && __DYNAMIC__
+ //
diff --git a/sys-libs/csu/metadata.xml b/sys-libs/csu/metadata.xml
new file mode 100644
index 000000000000..7151af145b05
--- /dev/null
+++ b/sys-libs/csu/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 type="project">
+ <email>prefix@gentoo.org</email>
+ <name>Gentoo Prefix</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/cygwin-crypt/Manifest b/sys-libs/cygwin-crypt/Manifest
new file mode 100644
index 000000000000..7b47e53afae4
--- /dev/null
+++ b/sys-libs/cygwin-crypt/Manifest
@@ -0,0 +1,3 @@
+DIST cygwin-crypt-1.4.tar.bz2 4446 SHA256 26767faae5dab6a8e4103df0d41cd2b07cda97c48a31dfab73949b4df198818b SHA512 1ecc4256730f13161a651cfdf71b27c1042e6f56fb859943426c371d4b37b8b2bd6ea768f86e45f7b8cf3478e97ff9578b79e5c37178c8794ff9b87799f2cab3 WHIRLPOOL def38d196a7cdbcc2fcb307b5aaf45e76a703fb4557475f157f00eb63ca693e02f126f101552a424abb3a19bb8e342c777747b443295551fac637716ea5482a3
+EBUILD cygwin-crypt-1.4.ebuild 869 SHA256 be415fea03fa02b5b38a363af6c811c929a01667299d9d94d09f5cd86b77d810 SHA512 c60bf76fab75226c4266e837d4e4eb5bcb572bad6cefdd49431f3eebebac91f1434ffea5c90843b0bc15b3b7fcc2eeec4fcaaa32c7129e4ed93cc16b4340c3de WHIRLPOOL 7818d41a4560d9f9821c31ef77164729734a1413dc7e6b8879223e6ae092e75dc73e817c3808ab04af9a393b94ab694f1f2db852b286b459409dcc1f88521a6b
+MISC metadata.xml 517 SHA256 34da146e9fc9ef7f9e22c5a7fb5208ccc67c4759ac7632cd1bb38fb3f595005d SHA512 3434a72bc3776b411a6fa9cb4948a77c510002e145fb2986552731a1da3fb16152bcca762e72c12de5369a66ba9add93848783364f30e68b0de1cefbd2458e2c WHIRLPOOL d8454df05f8563a14d482bec69d95c4e07827d185dd9b2ba987550f786e58fee1feb5653d3ac3962315e70c6fccf4bebf163c5e9a06580f3d739b1a761601c14
diff --git a/sys-libs/cygwin-crypt/cygwin-crypt-1.4.ebuild b/sys-libs/cygwin-crypt/cygwin-crypt-1.4.ebuild
new file mode 100644
index 000000000000..1b97a32993a0
--- /dev/null
+++ b/sys-libs/cygwin-crypt/cygwin-crypt-1.4.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="Cygwin Encryption/Decryption utility and library"
+HOMEPAGE="https://sourceware.org/cygwin-apps/"
+# Upstream provides the git repo only, so we do:
+# git clone git://cygwin.com/git/cygwin-apps/crypt.git
+# cd crypt
+# git archive -o cygwin-crypt-${PV}.tar --prefix=cygwin-crypt-${PV}/ crypt-${PV}-release
+# bzip2 cygwin-crypt-${PV}.tar
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~x64-cygwin ~x86-cygwin"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+mymake() {
+ emake \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ CFLAGS="${CFLAGS}" \
+ prefix="${EPREFIX}/usr" \
+ docdir="${EPREFIX}/share/doc/${P}" \
+ "$@"
+}
+
+src_compile() {
+ mymake
+}
+
+src_install() {
+ mymake install DESTDIR="${D}"
+}
diff --git a/sys-libs/cygwin-crypt/metadata.xml b/sys-libs/cygwin-crypt/metadata.xml
new file mode 100644
index 000000000000..598620e9d7d7
--- /dev/null
+++ b/sys-libs/cygwin-crypt/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 type="person">
+ <email>haubi@gentoo.org</email>
+ <name>Michael Haubenwallner</name>
+ </maintainer>
+ <longdescription lang="en">
+ This packages provides a library which exports the functions crypt(3),
+ encrypt(3), and setkey(3). The created passwords are 56 bit DES
+ encrypted and are 100% identical to those created by the Linux crypt(3).
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-libs/db/Manifest b/sys-libs/db/Manifest
new file mode 100644
index 000000000000..1c63b89b0e10
--- /dev/null
+++ b/sys-libs/db/Manifest
@@ -0,0 +1,88 @@
+AUX db-1.85-gentoo-paths.patch 684 SHA256 049052c74c544ac1c1f3b1b91c3e43df76b135c610148212679dfd324470cf2f SHA512 d7e2075a1683c7a04337830730e429c4bf2b5f0bdb49cdc3b625bda83be7cf579f4039204a355f5854c2981b6bd3234767e02bc6a7914e2bcde2a73d698fb914 WHIRLPOOL 272d1acc842c83f9b189deaaf9c38cabc67a0428a21f6b0ff6647899ffb6db7fb4944d18e76884f816baa02ec842d393f5b8c341ef41b820c74adf02d6e86d3a
+AUX db-3.2.9-fix-dep-link.patch 1005 SHA256 57e6f13170db99ba7f2f43aa0c7606085d25094127c63a48b76333c1289f6382 SHA512 42f8a6e495266209d7c9bf35bfba801abddffb10488b7b156a790bacdf8fe2d3d3113d8d0a1afddeca238736f64cf8a881141d181fd4a211e4b04da9ed010587 WHIRLPOOL d01855996c76b18793a6cb68ddfab8f3e9a439a13267c41299be13a294469f56d3842a418600475861181b97e90472e800696745068ffb3f47ccbccd74578513
+AUX db-3.2.9-gcc43.patch 441 SHA256 102ac694f32719deabbefdcfbecd96a255b8a6cdc312095fb537cf99ca6b9d77 SHA512 17d44ae357337d938bbe296b519efc03b914792ce4440936c1178b09dbb21783034e16f4fb2ff03443b00e8af530afc0fce778a937b06f0ba8c598b02cbc989c WHIRLPOOL 89f49f22f7c89d8989b002dc1f9469216666d2e79aaf724f4849b30a05eb108e1c1e4a286b60e2331e6fad7139b74c28eb6eaa93fe16358bf7d29928907c990e
+AUX db-4.0.14-fix-dep-link.patch 1119 SHA256 ea2324490dcc36199e0b441f183e05768965c358ba2e5e963753e0aaf29525c1 SHA512 5c7895d8c284c5b9c2305319e20afb8b98a43974bb2ff16012ab322abf131e0d050632fd7c67a0dad47df719da2c53316c6a36f5b6686196cd1b27ced3dae7c4 WHIRLPOOL b394d0bc636b86fae921cc4825d99b8cd11634b3d1590fd8c58af2d9fd2e8db82c108370523c592280638427dc69e529ec728df5c5e3d7b6fed3340d911c839e
+AUX db-4.2-jni-check-prefix-first.patch 1172 SHA256 609eb9d59954effdd229df7622627c639c6a784e8da8131297321a54e808fbe1 SHA512 ab81f0a924f3a763f76ef39dff12035570462e0bbed41d1c58ca41a37a0f647e4348238ea5cebda7e639645f0e160292348e16469ac0be88edfb453158ff3e9c WHIRLPOOL 189349cd3773c73d8e3aafece96c169b5f5531c0a6309a3de6cb5935d7ca0ebbd29ad26d4a65a5016bd2c9265eb9d674d1cbefbf01b602e03b2475bc206e066b
+AUX db-4.2-libtool.patch 665 SHA256 d8584986fd711c736b453fbab9488a0cd535b908035e77554d53e84d316129f4 SHA512 6a0c6fb1a8cb76f84763c2925ad05dc06c521356f02ada61bf627fe855556da61c1c721063181720e300fe7e012b11bb7a85dd55a4c02083d26f21115aacfbfd WHIRLPOOL e0b06269a53717d3079a166b5fd862a9af320f82c8060e698d04e28aff1fc18a66c824c2d6373bba008bcc62c6dab83a3138a388b2039f1bfe2727828e2dc8f4
+AUX db-4.2-listen-to-java-options.patch 312 SHA256 407f9a9d601137cf40824165ac9f2861c450f90dbf263db929d8d2637e67a851 SHA512 04a962a9999f331a97928a580494351b15e4ab2b545aefb0c5351dd4f476a522fd84f108b5161e92ed47ac121e10b1184b4b8d7b682d7b4597d7c425a475ee03 WHIRLPOOL 3dcfc7692b9490c6b723332c4d82ddc6862e510304f574c07819b4909cb89925ceb3db59b46af5dcecf4dd9b43b27e9faec542354b0b573eb169fb3ebb7be91b
+AUX db-4.2.52_p2-TXN.patch 2328 SHA256 acce757ff83adf10853095714a7087047b3f5b6ab1af479baea45fd69a05a681 SHA512 528d85cfa1ec2d803c87f8cc50c00606b4b69eda1460056a548f4f18f3a1667c06eeaaa8672a3192747ca68a6fdde451cd9c45fce625e71161f9855ed92d286d WHIRLPOOL dc33de1cd44c1ba488425b2eaf009257fa8c049cda62e68578940781b5a68786abe3c70fa825c91809ac58f6b88c34f92d6a6dc1a781d8eba8b80e38f4a27c69
+AUX db-4.3-jni-check-prefix-first.patch 1172 SHA256 609eb9d59954effdd229df7622627c639c6a784e8da8131297321a54e808fbe1 SHA512 ab81f0a924f3a763f76ef39dff12035570462e0bbed41d1c58ca41a37a0f647e4348238ea5cebda7e639645f0e160292348e16469ac0be88edfb453158ff3e9c WHIRLPOOL 189349cd3773c73d8e3aafece96c169b5f5531c0a6309a3de6cb5935d7ca0ebbd29ad26d4a65a5016bd2c9265eb9d674d1cbefbf01b602e03b2475bc206e066b
+AUX db-4.3-libtool.patch 2161 SHA256 2ec92f53f9ae5431acfbe4fdaddc5406730b98f3bf372d58f0ad69c69fa16df4 SHA512 52beef4ea2c3e6742efc0331649b53686f052cddf0b8b809a34c9ffc5cd977dd71bfd3bf035708b5174f677d8390065e62807a20b3a3b7c918dd6d336a0541ab WHIRLPOOL a864225d67a9939b2b3d9ecbade53c3386994a8907ad91520421ac45759ba30768ab65ffe61b9633669e690e2c98946e818242235c0c2810e4dce9773bc69b52
+AUX db-4.3-listen-to-java-options.patch 312 SHA256 407f9a9d601137cf40824165ac9f2861c450f90dbf263db929d8d2637e67a851 SHA512 04a962a9999f331a97928a580494351b15e4ab2b545aefb0c5351dd4f476a522fd84f108b5161e92ed47ac121e10b1184b4b8d7b682d7b4597d7c425a475ee03 WHIRLPOOL 3dcfc7692b9490c6b723332c4d82ddc6862e510304f574c07819b4909cb89925ceb3db59b46af5dcecf4dd9b43b27e9faec542354b0b573eb169fb3ebb7be91b
+AUX db-4.3.27-fix-dep-link.patch 1179 SHA256 fc5c59311dadd11dde7ba6b6e975069a52e1ded76fcebe1b76927b79899fe425 SHA512 05f9eb53f01db8e4d36ff3527a5757611def974d2c2a4cc97cdd48ce7bd5e8bd22030cd8d4493374a5ee226a98f4873bf8f75e196897f6c0c9c4e9bdc368d05f WHIRLPOOL 9cd94aa4122be7a420ee6b8be95f5eb3f89ea4dbc77096e3cba69773d5081b198853c58ecd4cc1a4a12004a6faa9eefc853694f13caa80a66159d6d84f6b440b
+AUX db-4.4-libtool.patch 1817 SHA256 7b47ab059b5e9a775e024f6f2562eea136e870a32748675664e5a5315b871b21 SHA512 e22cc040c20f0f52b3a57d0795604b6d469a45a124d3892963c817e533e2d85810630ab286f839bd77c9dc66cc13633fdc57979dd005ec74cc8c6d17ea3d5d3d WHIRLPOOL 6df7ab992e45da4eaf1ecac0c699b9c52cbd405c553f14056f316c1de109e96a688dddfcc1150eaf92619f5d37ef095f66012aa65eae44c9290c525a691839db
+AUX db-4.5-libtool.patch 1817 SHA256 7b47ab059b5e9a775e024f6f2562eea136e870a32748675664e5a5315b871b21 SHA512 e22cc040c20f0f52b3a57d0795604b6d469a45a124d3892963c817e533e2d85810630ab286f839bd77c9dc66cc13633fdc57979dd005ec74cc8c6d17ea3d5d3d WHIRLPOOL 6df7ab992e45da4eaf1ecac0c699b9c52cbd405c553f14056f316c1de109e96a688dddfcc1150eaf92619f5d37ef095f66012aa65eae44c9290c525a691839db
+AUX db-4.6-jni-check-prefix-first.patch 1172 SHA256 bc32845c7da201a4ce7af280a8e734e3fa0267a44657aecb52877f67e29c5c3e SHA512 4cb3a313c1523608003bc58583c07bd7ac4a69e822e21943d9d0968db821058ebfd9984a41e728befb90f781dd64d09413b402ca21ba8c95e5fb22c35bfd4cd6 WHIRLPOOL 269779e645ef7e4d8e8f1a494e054fbbcf8dba63cf2d06f003fb0ee1457647f7cc6ced0346cb5cc41535487223cfc819e7d0383b6c4a77cbf58ba2e7b7ed4935
+AUX db-4.6-libtool.patch 1817 SHA256 7b47ab059b5e9a775e024f6f2562eea136e870a32748675664e5a5315b871b21 SHA512 e22cc040c20f0f52b3a57d0795604b6d469a45a124d3892963c817e533e2d85810630ab286f839bd77c9dc66cc13633fdc57979dd005ec74cc8c6d17ea3d5d3d WHIRLPOOL 6df7ab992e45da4eaf1ecac0c699b9c52cbd405c553f14056f316c1de109e96a688dddfcc1150eaf92619f5d37ef095f66012aa65eae44c9290c525a691839db
+AUX db-4.8-libtool.patch 2076 SHA256 b337c02ffc540e2d692ec57fe093d182f0054a673e5267eabd2db24121486312 SHA512 c2d8c544edefa902d70d762675367da993c48c39566d84ec26ca7ffcba8441414f0cbd6a07bef982c5fa58bd4481cb1e279070552da6d724f644a301543a7199 WHIRLPOOL 1991e449cf2cdb6906f31c0d826cecd0570415c852c9e8321a50e54d5d2a3fc41fc5cf1f740f77e57643be0cee7fcb2d92dd965c048b7f9cae16902e7eb42c3e
+AUX db-4.8.24-java-manifest-location.patch 592 SHA256 1589885b89ff465fe752c3062e322638a39ccf1a96c392473c5424cfcc628aea SHA512 306503befbc76b1b0775adb94185407fbff23f467d474e0ad3b28190edfdb485942d14c3a53a7cde71213f49bc548a7d271fedd95286920ae5c21778e139fec2 WHIRLPOOL 47401345e32fbcb5a221e5c041502f8c58d7de2e0c79723b4a515aba1e5bbb625d9a796b75a6a49cf239e2eae5c3ca8e3dbe2fafac35122e3913e61137facb77
+AUX db-4.8.30-rename-atomic-compare-exchange.patch 836 SHA256 8efa8b37d4dbcbeb73592472be493f23c999616469dda88c6832b9d25f00b813 SHA512 1a4be944b1d41483fb4429a9454a3e9446b41720ff829c0b90b09bc3f9838c798dc3f9e0c918332d0933d6bc62b9b13b3f8251463f1fbddfddbdb341adbaf5ed WHIRLPOOL 58777a9588937dc669e82d541309e571da2ed81515e69b1678aca87cee06fa40a398bcb16a02b29ef182f5b97121e2181b7897b71e33fc93d4b24b9c341be8f9
+AUX db-5.1.29-rename-atomic-compare-exchange.patch 852 SHA256 a9f9e73018a275079e70d5eb9819d09c7c64356b813992a824aef04b268b1be2 SHA512 8ba96cfc3e484a839b8651214f0769b35273c6235de7e53d5118eb0347f5a477f75e3336a12f1399b7748c6b6ab95aec39c8b813d7b227dd61f37ed4ab52f7d5 WHIRLPOOL 1b2745a6b0897f05071e6e2a938655f0e6d575e5877686e67716d79eb9cc26397c57ef517ad59721dfd2534e29f7143eefb3d352b68610bc6d3e863e64adc47b
+AUX db-5.2.28-sqlite-configure-path.patch 906 SHA256 94e36064e3414d644cc1a157c011a80fdf28df66b0da4b7df69d078735d152fe SHA512 ed0e683313f780975b3aec60018b08569ebdd38e4cdf60de170ef0bc4fc63d602e7a5572792f2634f3680e763b74ffdb0a5b484562a10a4b82b28b19c3acc565 WHIRLPOOL d557e9040e05b1543cc1cf8b9a2ab4d033498004924115be37ad781a1765acc740abd230cf44a196aa1072ab63c57044f7fb84e651436d03cbe0cd8055819e6c
+AUX db-6.0.20-test-link.patch 1568 SHA256 cbfa6444aea5927328f1dc8942d082582dbfc0b39b5a93406a310aedfe9b6c3b SHA512 0e091949a071e76439cae4bb37cfdd6c4e4f586c15adbaa6d5d1c9cca5a4982f8e5960d968b41c4368d99556a95b172a6ef1331daf90fb87a77567fc7343f980 WHIRLPOOL e3c66e554c0ae78208508847e90aa922f6b9c30a797049511bfe76da8cec368d5bf3e32369556d2df5a93b40e724da58dac3713ad59ccc8d03adde847beeb116
+AUX db-6.0.35-sqlite-configure-path.patch 764 SHA256 b25282ad2599a980b7e2f7a0a4394af52edf1808dbe4c312f18dc49ce2f92757 SHA512 acb6aa901d62a5c5f4ae22e9d2e0bb89101038a3e91c2d65845cd514cdb0e38c3aa15645701024dc5ed39372850362a24b47faa96a0a81f8149958d8ebabdf17 WHIRLPOOL 69cbe3cfec3f53e5c98a127e765dfc0d6f4885d51df99560b6ee0aac2c7cf181ac3b2a479eb13c2ca338b94e4f75f230542870d5a7d99ff62c0bf365f0560b30
+AUX db-6.1.19-sqlite-configure-path.patch 727 SHA256 638611333e1620b3acae20e0b0ffedb786fcc42065becea0edb0494d0e74e55c SHA512 6d15c1ec5726998001a6dfa6679bd6f55fe70dc16b1cc531709ba49ee962531e3b4e4bd91ac3a5ea0d1b0736632e66269638651e42a3bbf7697785cecb87aff7 WHIRLPOOL 9ca94a1ad48617259096d3d94936b864a1a44744c1638ea5b2f86ae45ddef4487e3c6624048ff3f7659fae5ecd7bcaacf6f9891d2232ff5c7cc6205817e059fe
+AUX db-6.2-jni-check-prefix-first.patch 1302 SHA256 86f6a4498051640c734f3bf76bfb858909a3afb002e25197e09405e31ac3ac5f SHA512 662fb5e1b292dd87b11db7cd071b280863d2cb7c5e1e8ec7149e6ecc5d0db0c40a0b3995503c27ff0dd0d3d5fb274a7f72736058edd2e5b52521048e11253a30 WHIRLPOOL 41b180c4bb9246ced91c6e089b97baa7460ad66b1c24e908a4fdfa2952d52e0a4969da4ba45b3b03bd9acdde87213bc77efc84c63c3b1675302ae47df2f17c98
+AUX db-6.2.32-jni-check-prefix-first.patch 1575 SHA256 e048a375c01bee490e8c45d29e5c7bc2fd205abd6f46b5115ed7fd5066d81b1d SHA512 eb0739c46f88ad9538e4a467e8547f97404747633942ec6b05eabcfb7ba427ff66c00aa5dc95cb9518056b861c240898db4745dd3626ed95e7cb01c54b47dccd WHIRLPOOL 0a3211a5dff586892c6650c836dca42f9b66cfaf3fd52c164d8189442a907c6c3435b1c8a451778adcf1fcfbd4e74f238ef84865029358ec3db9a090035a4fef
+DIST db-1.85-r3.1.patch.bz2 14641 SHA256 88e3095b191fe425d0192d052595ab838ad4ef6324aac0a9e338fd6df7ae40d4 SHA512 32b1810515476758ece7415f241378460a4051bf5ee23fb464748f84a90a56ff2c5119ed93028114d64f1b1691b1c694c2301ff825edd89cdee90a870a68b6f4 WHIRLPOOL 3c3437cd4a6294c2ca6db3b6522c4999d5efd9c1807b499b72bba7534c658349bd7f889912b0dbc4bc017fcc5f6d2062ec112ebf044673802bc0d9476ee26dfb
+DIST db-3.2.9.tar.gz 2085238 SHA256 3eccaec87bca4ca0f5728cf4579650da9d12e331187f1e98321e5c9e9e04b108 SHA512 5f07b27ae0cbd2832e5db9473cd4f2d4aebeee25ed8245ebd2c297a576571635ca5cf75e63e0967b1e90978128a5b6f5d8112559c56927d5bc5eb0d9fd3a2e95 WHIRLPOOL 248641e75420fc353d3ace86b3c65ee8354b073e2dddc7d71c1d2ea4681d81306255077dd7ed322a2b5ad8b87d356fa5aba864e5f24dc956133d563e2bba96bd
+DIST db-4.2.52.tar.gz 4073147 SHA256 72f581d8b91da900434629886d1d1c6ea8b9d2a9329368c3b875e7cd556b6a0e SHA512 47a4e1353fe4f5c2160952a8f7a09b73fdf2dfcd222a8214e12630cec3139a624907bba83a06f10f8492b4dce328a979e9155ee049b9a88798edaca62cfe60d1 WHIRLPOOL 409df946378054ccca9e5f27980f28da410f9dad9ffa7acaf092725779897fe89a2ac7a4add4a7974271e1d82bc9255681fb1b6cde94782feae86b7f73f8e8f7
+DIST db-4.3.29.tar.gz 6103264 SHA256 db3e762d819f9a31bc4ebf5ecada53e9787aeb26fc92fa6064b2ba57df806af4 SHA512 93d36c040b25739b92c52504e117a9c7f4b671463d61d00029e70d0bc8171311f5d04211f7d966b8a9ef8c2a85a5ebe8cc55e4469c3c7c0e468caa4221f691fc WHIRLPOOL 39bdfd19561d676b4feebf8ccc64dea29c783601613e2cf470e050fd3a15b626937243538fe109b1816c936a792ed0014eb5dd5a410699b39413f671dc04f741
+DIST db-4.4.20-20060110-rpc_server-java.tar.gz 158976 SHA256 a1bbc35c4ac3ce1c13de695dd2870cf8bd0f5030a19d4531c1fbf9c95e5fcc78 SHA512 d1f04fe512baa0e5c8a11d765cb9040943ab70258f7d07fbaf579b3442c43ca0dfee56267db7543a71abbbd2f056b80fb5f9d2d8bb83b0f5e5ccebf273280e6f WHIRLPOOL 2e895dd68df9a9ef35a448754d1d49b12a782c53eb7ad7bf7f4f13e42ea7a09676ddeada67bebedd0ae673b454c530d4cbb3ba234ee96bd0df5e11e201df32de
+DIST db-4.4.20.tar.gz 7952742 SHA256 298ab78801f7502016aa2db033b65fab46f323533bdc08610d3dabd910d63b79 SHA512 dea85d0aa3cea0539de2f9819e1ebc8a8aba887614bbbd1710a69dbf2cef3fe262414b8b03deb7325c8bfeb3bbbdc3d5ba35377a73aac5e3c63aa1082d3a579e WHIRLPOOL cf597b0fd688422b0a7828cf101518e5e3bb197e7a8f42e28056745a549da820a9d921b179a2afe6bc698ee0e5166771d636eee2949d62eb649f581e430866dc
+DIST db-4.5.20.tar.gz 9281894 SHA256 f52cd5cea899823dd200d56556f70b33c55e48a33bb7b65ee128968dc10ca82d SHA512 c34907a53323158627971f464c32b9a5b00aff0fa779c67117826ebeea86a4731e272a5dc6dc5ae32f16284ff15c79d93050273795381acaaefd48e18dc2d612 WHIRLPOOL b0fbf20befbcaa1dc4c6c8fa1f190f17cce9d8034d8a3c96c296ec3212e37aaa11ce6d35cdf9dbb64d266b443453d967eb9da530d6c6c9ae8b9bd0ee08c3d352
+DIST db-4.6.21.tar.gz 11881885 SHA256 53ea9c9f03746a0aa415e6706e9c6da18ca18148f20ad1465b182411a7985e21 SHA512 8118218e2eaf9d22e445e551ef184f4610406b81f9257794d14f637d9d12a51a007166b48bf820140c5be287ef61d22a62a16f7702f0d29f385108c40b11ce43 WHIRLPOOL f6011aa40be091a8bbd52981d99d1e41e336bc64b6b89ca69ce0e9d97a6650c2e10d363ea738d3d47b656f290fdaeb8f1a2ed016967182228eb6509253f561b3
+DIST db-4.7.25.tar.gz 13124129 SHA256 f14fd96dd38915a1d63dcb94a63fbb8092334ceba6b5060760427096f631263e SHA512 3a0b2bcb210192c7a37b082fab47a8a32da5e7e91058e18be8fb844c8780088cbd4de6234257750505d5a05864517be03afdad95cb1c549f9743386d6129554b WHIRLPOOL 71ef3aefab84d1ccd782aa948c03bf814eef45b8352837b5d797f781a94652c72f45adf2a114014a78693d27f8ad87c6cd22237b154dc4a8452eba72ee5b2c16
+DIST db-4.8.30.tar.gz 22887305 SHA256 e0491a07cdb21fb9aa82773bbbedaeb7639cbd0e7f96147ab46141e0045db72a SHA512 d1a3c52b0ab54ae3fd6792e6396c9f74d25f36b2eb9e853b67ef9c872508a58c784c7818108d06d184f59601b70cc877916e67dfea6f0ee1ca2b07468c1041f1 WHIRLPOOL 4a9c8b4ca4ff3c94d2c01001911ea7aff824ddff971f99c802eee642bd78882456dca1347bb1ce7add42f402b9bdc3b099775f8b74e81496d1c0ee2bd131eaf3
+DIST db-5.1.29.tar.gz 32188074 SHA256 a943cb4920e62df71de1069ddca486d408f6d7a09ddbbb5637afe7a229389182 SHA512 b3487161cc09dd0aee6117d685d0bc0a58854cf5e96f9e778969a51d3a61b66f8e007b76e584e4ef73f84e07d4418b89c2f6697e34c1ad4072609b11b7b4c5b0 WHIRLPOOL c2c5e335a8ed85f9dd947eb8225148c9633d21f5e17d321a6938b50d4bf061e735563cdbefb8c8aa457923ef80e778f95ad80aba4a92a381432ecf52c2a25353
+DIST db-5.3.28.tar.gz 35090431 SHA256 e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628 SHA512 e91bbe550fc147a8be7e69ade86fdb7066453814971b2b0223f7d17712bd029a8eff5b2b6b238042ff6ec1ffa6879d44cb95c5645a922fee305c26c3eeaee090 WHIRLPOOL ad9042c4509ece1cae42ade4734f69d59a9ec946a85bd486063a7e8f9fa1ae3f925b71f0475fef05a27d33f695ef82ffd06fbaadbd7dc5bfaa77a8caacf9d1dc
+DIST db-6.0.35.tar.gz 36532251 SHA256 24421affa8ae436fe427ae4f5f2d1634da83d3d55a5ad6354a98eeedb825de55 SHA512 002db1553def44efa715095b04b2bac2de7450cdc7142586d1d8b5d8ce79ee5e98f824b3bd276cd586ca932dc51ed35a9ffbed95b2b9847264f262cfa092479d WHIRLPOOL ebbbe7dd0969a36d06c8cc5618a0f61334396b38671b9b1c2523e3d1d3ba687903242acd23999be3efec45e1ea6b9c7f0f9f5acbb54d8d1dc48bba51d196c487
+DIST db-6.1.29.tar.gz 37521943 SHA256 b3c18180e4160d97dd197ba1d37c19f6ea2ec91d31bbfaf8972d99ba097af17d SHA512 ced40e357acd1214f8b5800ddcf084c65c0ab77ca045a4504ac1a4c864035bd50aa8993cd1232174ff81071a36806314807330aa53dcb18de548c886c2a99e73 WHIRLPOOL cf18bd00ff203c5b2ccb39fe87ad307fc9e1cdf45a1db96753c50eaf555b571b3ab77dc52b32c09122956505f366dbdbdcdff094486d7ded21512a3cb873aa42
+DIST db-6.2.23.tar.gz 44305964 SHA256 47612c8991aa9ac2f6be721267c8d3cdccf5ac83105df8e50809daea24e95dc7 SHA512 0aac380673ff4f97a2a6230f135f8151b8d2896a12710f708cd983b5fb95075b55fc2c67af577365e8ec7a32e43357a4f3118e37713d00b227f05eb11b1d12f5 WHIRLPOOL 8a0537da75a5d0d4e0f335a9b27c3767ccab75d0a0f8b2b8b6ccb7483c2f6da02c55b1c14fcda9bdc5bc57fedad6a3c2b81e5d04775cba6d3b42ddcf8266a86e
+DIST db-6.2.32.tar.gz 45342417 SHA256 a9c5e2b004a5777aa03510cfe5cd766a4a3b777713406b02809c17c8e0e7a8fb SHA512 83bdbf18a7b9782409cf4563f8d5f11322d5e564a39946c890604a60440a6ea6361e0236bbc30bd4e8e1de1fa9196b8e815fd126baa035f55c5826c2c6aa3401 WHIRLPOOL 66b2f2ba2e86800b837b9093f3ebf0caeec71ae29b3614aa6b0f908af933539cb6113980049f6c68f63dbfad808fdd530b4f2435bd8ca32611662e384b38885e
+DIST db.1.85.tar.gz 270953 SHA256 4220d4ddeb77fb57ba2f37c1aa105d561d3ef85a6fb89c79c3edd735d0e193c6 SHA512 03bf3a2b0947efdca4e38719542e96378b5eeb57da64d5030dd23ab710773c1826f1c867032d0bea658b7fdd8272db253e97bbc490d198b9437025ffdf9e880e WHIRLPOOL 802346b9fc133f6c9316e987352e8bd8e12792b30b0eae9b4e2b3629c9bc8385ab12244dead428bb824945aab383cd4801de3fc705667797bdf6159066ed1352
+DIST patch.3.2.9.1 2139 SHA256 6d89a42ee0be9e47b3e8a42981c65266a556de84bc6281edcf0f977f52547798 SHA512 f410c43ea4af28a39d8ea47f774d38b53bf1183a34abfcf1f27e253eb61b42f4b5e9f0a3a500e174eb796ea342e6dd50a8bb95ff3eb8ee188461489cc994b8f9 WHIRLPOOL 3a879d5306403739465550ade1fbf53ac62b832fbdf507a204fef13949bc7be9c35ddd972834d3ca74bf17c421791011200556dffd95265eb64849f1d7b647ec
+DIST patch.3.2.9.2 495 SHA256 61db874796fe8789b0045f456285b27c5b8b7b8902a5e342a115456015716d0e SHA512 cc75fef11a641d480beaa2b62201177c72d10c4eb20376b5f15769db6e9e1a0da41c0365d79772af19b4cacdaa9f91dad049c735de9f95b98dcfc4f0b611b557 WHIRLPOOL 1362c32dc16875a97b451ff52415fe4b9e9d37b256a92c7e86c14a52431937352ae55ecee4361459e9036b9bea238c205a8f0d4406ac7e47387a8cda22906879
+DIST patch.4.2.52.1 988 SHA256 98b7580916459ee931b9c7e06dcb9da980732672fe0811714933f366ad97dfa5 SHA512 67b894678503dc394e50b7c6a875ebbd996d6f78acd21858c04ba2cc4aba118f527aa3aae0793cff4e44bcb17b13fb1eb6a3d895e94cb97270d9759be1bb4bdb WHIRLPOOL eb0f038e0be19473ae938afec57aab061ff2e6ef1a5bd55891ab50000889a5e7b8e20220168427fb5edea550e3d852460dfc90ecac0b9c4ca3cb7c95d49621df
+DIST patch.4.2.52.2 1433 SHA256 c9b132bcc8f1c12e03baaf47abd3801f2adf24ffbd56f35a27617fec12654f32 SHA512 93c9463e2a795049473a2799186642185b7e2f94c51efa0412031d134088d129ebcf07e6a5f309d6cb37d9d282d8168276305d7420fb4cff6d7acc38a6ba4f00 WHIRLPOOL 093aba1ce3ecdc72fae6e2050fe1436a8da49ed59aedf17e4f6e5e3a87c860ce6728967a32b0281c703ded4769e1f888a14b6a8806ec48b4fb787155ee68364a
+DIST patch.4.2.52.3 8672 SHA256 ca5245d2e1c7a40df5ec57cbabee8bf0106292c69a37eb0ca275d1aa59061907 SHA512 234bd96b93aec826c97314b41c8b9231c55598213ee8437a6df7efea44e6c1e8e4844db8214a9468d27bae9a588b028c765747493b5d169235e3d06d0cf107b4 WHIRLPOOL c52417393f47e4028472bbf64ac20d799f2d5651077ed2252459ef6aed80a8d04bf2262d4fd35fe8ebf80d7a8604b44214516375800662ca17d6148bb339def0
+DIST patch.4.2.52.4 1311 SHA256 c15c82071c02ce1a10024c572e2e9fd72006089007141a01fdd37b889411b973 SHA512 e2632944d82f5b6dcbbdfc237bdc37d5db736acd0284edfdb51fc0f3a9ca4fc6bcdb412bab325e62fc30d690f6963dfe53e6120cdda65dc403eff89d3a931287 WHIRLPOOL ac6cebc2a007bced6140519bdc2091335f1a824845310b7bc5c8a965d672818ca7d31894ddc6357b40c016b73a14f19d22b583a9b912e1b7a3b000f652ee1d36
+DIST patch.4.2.52.5 839 SHA256 242f1a9c3efdd61a2b738c12617175849dbc73df6a2bf7cff61c814b13905e06 SHA512 5457bc4e433c8f12f34a764fcec1dfc9e832f960f518b21bd9116ec1b1130d9ad12373553e224d844e2b2de254470daf142120ff6d3125683a57f14a42a8e879 WHIRLPOOL ce7c6e3c85182d8eac99468d6a05e0ea0aa09927b7d0a3522706c5806eb8f5e7dfdd5b8724307163861160682e3e9bcf390e547f8a14e15663410997142721b1
+DIST patch.4.3.29.1 835 SHA256 6fbda9c0554cfe3d281161b288f779e7cf2c814f311c69e1c6309b6f97d75931 SHA512 c3dda4de68bff744dac5c96d1533032b2c8e8e0945f1a126b8aacdda322e05d1ec2e364eb7432ea1fb7366424ce155a9e58f84b9bee8e1ab4dd05a3313bcd8f7 WHIRLPOOL e05c4e52c56299a434c8e7259386c84f33f07dca0286c07e8df95cdf5a612df55055c8607ee5e624b59d76c7d988ce01ea03c1b6fb554119eab4f9faeb27cc80
+DIST patch.4.4.20.1 867 SHA256 4eeb18450b88703282251c386405bf7c9efa053a42d1dda97603ee8039ee5869 SHA512 0fd501d219eb3de94c59e7b526c5031bba5dcc7dea4174545db5d688f33a5b4324aadd71e0e4eca3781592da0e90c1481c3b2d8f74612dfdff651c18d10eb2d7 WHIRLPOOL db6c05c1ab2582a55cd6c08dbdb2729ff539b71ac96728509ab58d749ed36dd8dd8f38ab3d15ef8409d66935811d1fb1caf7050856d2d1d1c554191aea7ca2cc
+DIST patch.4.4.20.2 721 SHA256 45949e288482736bbc27bd62c854a99fad4b3e55103897eafd62bce1d5629bbc SHA512 4c497ce01c740c9c32b3a74946638c21b619cf057bbc8acaef24cb9f8d55d0d020d4cbc7775cb0cf07113c44981f076316cea14573fa08b49bc6352770bf5de6 WHIRLPOOL 92fbd4744b769af310a1aa03f932e40e51e0da1a9331a7d60fab565e54388a1e639e8587cbf28897ebe9307b21f4c5d01da07e6a5510a73efa5249e38bc58fad
+DIST patch.4.4.20.3 1366 SHA256 ae54bb752a31655a1a945f12900b740fad397c3e2ddab792ecfd4660d3e6e236 SHA512 2b00acd823342083f0eaaf3b9659c811d05eebba67b39d9a9dbfa4a8fb56cded322e3f9028c57d83c75cb949a79f705cd8584df1630dd8cd3ad22a54c83baa91 WHIRLPOOL f346d372f91ec2ba948f4ceea02aa88c1ea63285963f7681d4f83097336f106d24562092941f67d13ea53a2f4667471e275d12b3a174100a3e61ad81a5dd2846
+DIST patch.4.4.20.4 837 SHA256 7018f74e5184451809f6864172132472e91d95e2bec97ce6124afb67f0d65e59 SHA512 9aa464580cc1b402e594da56cdfc5e4d7c465f125b5f0cb312abbcdf72753bbf9ff14248657e0d354c93d7f1f89c7189e08060242c9a061033bb1016db640ceb WHIRLPOOL b0a2ef5f9fcb642accad061c9c0b8ae3b6713a63266ade97d851c3a84dd07642d80b91c4c601d4d6549697a83d1f02f42b30425221bb68a2a99ed42082f562ae
+DIST patch.4.5.20.1 984 SHA256 f0749a6780cd260fed20b6e961a0d354889ffe84505129d5c81925a4a4dcf6cb SHA512 a8aff6f594e5413436a7ae5afe48286b0d397a247b2cd466f192eb6b4870fc68353c1ec1d0209cdd06640e09090b3d84ddb0fb709f8478ff3823e244c7f6cd3e WHIRLPOOL 6fdb09551a04593af15c18530f0d984e5bc96e09b284525cab23c608c368067642fb7939ba81189c4150f12dcd054af91c097cd5fa779d1ee8166e5eb9031af7
+DIST patch.4.5.20.2 1752 SHA256 232a93565ab1bf34db10f7513b612867bb61e0c012def7f63715800a05d07e6a SHA512 b6af4b73e03b290595b6823e4d5c27da1b1bb5e66721ed5f0c6ecfec6595bcc56281340ec77fe6fb9432397adec0e292b31a5ee9d01870fb2955b8519017ffb7 WHIRLPOOL f99ea354e1ad91579057c1a4f82f3cf8c9c6ef38afc35dd47d7540358d13c5fe94c5f9d735501d909c501e9762cce18667b3534923feddca3f7f0dfabb2ddead
+DIST patch.4.6.21.1 2475 SHA256 d28c0723c465a2cf3ff2ddc5ed3c643b40c955c4e64d56580961f2fd799cbb53 SHA512 9fe4991a59e409cb7df5b507efed7e443c05199b41646ea2d5d52de29513c8d27c2f3bf154a0170f04e12eaee6a622b945ae0f9789c3faaeb2ccea55f7a1ca2d WHIRLPOOL 3110a7172e2596805b1527ff9b9aad37eccd761c8d46e78097c9c058c2f06438851e879dad1f169b207f65a50a3cce225db66e4da638c6b6dca685cda33bc641
+DIST patch.4.6.21.2 892 SHA256 9496a6cad44377ad1fab8c617f17c6f541e3423814663bfa81c3abb4001622d9 SHA512 e8570c0bee7522056f74cea73379fc13dae02258cffa78e540ee1c0433f368b3f856a21dc83017798120b3db7987c09e23af448153f0c024217df41a3e027347 WHIRLPOOL 370b636f0d1299ced97f70ba4d2f8ab8ab9a7e48106a5ce51fa48994bf4774b3f492d08d35369e128dc7975a07999af36b23ffbc741052071aa92162c4c8e93b
+DIST patch.4.6.21.3 1517 SHA256 3f531b18d88ce68ff080761cd62ef621444e675593aa23045d69121cd2c7c638 SHA512 4da65c9414bd04d2efddd7d7855235f1276d827258971bf3ae175c73ab9c1b57a4f089b27e22928d1ed869e4e14cfde2f5e7c6a31ddf63c8dc582d0a2384cfcf WHIRLPOOL 2bc3e1f8a70b9ff743f7007736798e23efbaf3fc0a65089325a02331d2eaa5f3ccec36327f2224a3cc22961304ba7c471af980b49cf756fa5f69cc9e39850872
+DIST patch.4.6.21.4 41501 SHA256 98bb4499dc7408c27a8a855330972a69abd3b29d0ff3820d6e1da790593a5bb7 SHA512 cb7819d7b1742f09af352e7563344abef27f1db1bbf04be049710abd26fb12eda142a08ff3cd3449b0a4a406141e39bbb0535f08bff051efbd261e7fbe5b53be WHIRLPOOL 58edfc65dce80bf2cc985c494ef635a65f70d96b1fc8ed3b62f01ae6bb4c283ab50035fc4dcf7b8925a3b85fafd2ad8f800f12c8f2678ecea21acfae52b37b51
+DIST patch.4.7.25.1 2072 SHA256 e91590af872705efc34414afb702abc630a75c55ba61570dca2216c783e0a83a SHA512 6f8618a3acc7ebc2839d2786d66c85904b8a9805319178175298239a9441550f1c61dda544d7994931e2aa412cdf5c209d8bb2f38207cebca341c556b97b9191 WHIRLPOOL 6723452283c9a487f86793d3580324736083d40424a81e7c5981cb125b44de23ea04e660a6336ff2b376c6fa85dfe97f49bef444b3333aade7232001deae7434
+DIST patch.4.7.25.2 2210 SHA256 05d6cde0ab1bfdb80394a7a88ff7233d0407f0b09103b0dd3791ebfccbbcca31 SHA512 d57746a527574966606955a8ad6b97742ff3979e85a0d087ae0c33b64b4fc2fd854f3ac145e2efc061b3479de5ee8172a02183cf54ada91fce3e331ab948ff18 WHIRLPOOL 63976fafb5a207f732534b501ccffbcd1d552e876b6379f3a1d3559c144c34d77eb5dea5dfb4ffa399a8bbc2f7cd66f2cd04a39cd3cf860f1ed1014083250383
+DIST patch.4.7.25.3 8442 SHA256 e5393cbfc8538cc21cc939d26ceca3e5782b4a4259a644884d91790e18ed39f3 SHA512 815560c45c9c8491fd58d881a0bc1d23a82a13298d4757ed7d2ae4df4b88b278b8e4d6063eb46349a8f6f11ca9aa5b8555f3ce01df025715c2579dfa36241238 WHIRLPOOL 30ffb9d93269543bf4463ac401f41b257c15dd19d301b8703a972d0a29973ccc86a155ac020f753d726c8998891ae349e47620fadc2cecd92cf36cfa09bff54c
+DIST patch.4.7.25.4 5647 SHA256 f55ea01a7905f8439d617717892e03d026c0ac34434c8fa16798fec75e5ba798 SHA512 df9810034773a9d0556cbd174e4f131f0461402bf3f476ae5da1deb92f3e2e9ef789687c5cc5c2df6385f6b14251e893be225ffacd895d71dfb305b9de32567e WHIRLPOOL 4cd00af410e23efbe43b6a8e8734294d829f19522e747c4f502fedc8c3c47adf821c6b9632149ee19ccf082f8067a3cbf20235e513558c397165ee25f2b5283a
+EBUILD db-1.85-r3.ebuild 1317 SHA256 a4eb2b1d973394a0db15c3dcdb7963cbebcd7b05e1f59b52b7d9ce1ea4ee4c43 SHA512 86f94dfcb55449d961e3b25f139ab968ac1091db313b7906a0e3de941cd5da22e86546426dfbae39d4b25c328ad7991b2feaa1d013ac016ede4bbea8f302b2ba WHIRLPOOL 9f5ca60b94c5c3b060d22abe37f117617410ffb8b3ab7f1f0860d414ffe7b62f70ba6f759e38d13f33f673dff9b4bad67b587581fc6a583c406c09dd1eac1c33
+EBUILD db-3.2.9_p2.ebuild 4947 SHA256 e9c04a75c90c264c3953f9069f57a9eec8e3ec96491b0074def6f9098de834c1 SHA512 435dd3a6743369e373b99cca0ed926aad98c91d2d79bce8af3ab97868c1624afd8a9ffc46cc5f1d035289211ceb222bc38fce214df1f358bf62d35cc4b1ec0af WHIRLPOOL f123f21748fbd4754059d4a0b77da3b0714a6fbc546d312e8fcdce411ee90a857511b19b083438579f7030cdcf7d577c191efca4dc7da6277bf84dfb1e992020
+EBUILD db-4.2.52_p5-r1.ebuild 4994 SHA256 a38cc6a1d83c5c84ef1c5acbc6ad0d7daa431cbdab72e3934eb42dadc33bc829 SHA512 facc045c230d6c69dc821b308ad50acea7c64a16438d1d1eb8e09d95fefbb2f03f658f9eb8ca59eb538f66e4eabbedc6899ae94fbe3b4cd37cc69cc2dce54209 WHIRLPOOL 8fec1558863366a5201814eb3b4b366c58abf3becded92f06f28e67faee8663e96ce62b216e9e9d14592cf9bfea1039c1fa122793448a383e792c76f0621a5de
+EBUILD db-4.3.29_p1-r1.ebuild 4953 SHA256 aed78717c2f1b8dd908215ea94a5488bf39443bc933a7d8fedac683b4f17772d SHA512 edbe670abc1da1e80b4375d7c9e6c7f565b44e9b27fa5c1eca525eaadcf266c1c95d6f448fa30403d3f61420fa2d68d2d0966dd3bb95df8069652ad228004d41 WHIRLPOOL a5ed8e895cc1d95e9eb96b3bc1c26ea6b8d63f0032d5693db4f4fa8e070b1321d76a440a851ee6ddb48d83df42c135ff62060089c1e04137083b8f56935fcb28
+EBUILD db-4.4.20_p4-r1.ebuild 4833 SHA256 5d7c2bd0b279ca729ebdc10fb187ccf7cb419d4d506e41f76b7821fbef319320 SHA512 dc4d0d17ae2470cbf294a4e1dfaa2e0d5b3c7eb12131b59bc47eaba11347810a055deeb77e869471529bb31dd442eafeedce7c751386db8ee54a2e0217075531 WHIRLPOOL 3b7acf2b29d4d065e81d874e55d551f9bac71cc0324eb81f0e4df5782ba506857263454551baafeb29940992d291d697b77f1a4a011c1e2e979600f8773bd859
+EBUILD db-4.5.20_p2-r1.ebuild 5112 SHA256 557d822a147891d38e9c4dae48216bfa2a25ebb46945337f574bd569bd4cea07 SHA512 66e0db87939fd8a4d6bf62067b5a4a183086334e617bb479427574b9a99a765b966e3656333db3e2996ad8cec7c47a0f8ca1670927aed5601ab233eb0ea0f854 WHIRLPOOL 88e8a4d973f307b242a3be8c85f070a2ed3c5f9a1637ad980a5aee2c69de7c7860fa45fcf79366678daed058d1076d3b64589ddc3e5b967763b583f51dc4bb1d
+EBUILD db-4.6.21_p4.ebuild 4841 SHA256 db7254fcb936f15d9af00d4b382c8b9eab188ce04be21f651394369c1460fde6 SHA512 4f20a6137342af997730d6d0dc980785b1263fa5b406d4d680c98eddf41d6c520cc83613561f5fe35025bacc6536cd530de48f7da41e4f05bd294a2697ce255c WHIRLPOOL 4f87a6e35d4844c8816c1d13b43e72f705ad7c13904949e119e3adb83ab87c7893b74430a5d12a95072f33a9c6edebf954a0690162a8366387fdfd54f496af58
+EBUILD db-4.7.25_p4.ebuild 4291 SHA256 a3ebe3dd4d854dd924ba87c2801e3082d96f5c33eec4ba88489f52f2a22c9a7e SHA512 7b71c66c36ba09417ea6cf4160a122dbab880a7c09ba008670d5b1c243f4add4537b12df2f21df16ee0de9a175ddd3108bd2b4f333afa489415a8dfe82974dcf WHIRLPOOL 6b2e212679fbea765fa9be6f04bcd747c9fa57a3e58375b9404db4b6596424b38dae1994084a6aea374e61379ebca857e00172836b62a6582adfe048622ed513
+EBUILD db-4.8.30-r2.ebuild 5057 SHA256 fc1844db2f97b13e3655144e272da8c74069766338188609b28ccc44345b173f SHA512 feed5105861a88475d9fca3f3fa2ab0134d1c8dac830d39340754d14178f833c652800b31e729854b186ab106ce3a4eab75982ee48693dbd2ca3fb91a0c66bfe WHIRLPOOL 282e5c710c1a642d667c6951ce601eabb7a80c25d73d33a965eb0e988f3349bd7cfc0a5707c20fcb0c02067fdec5829d2228f4c2ae55efe88c0b4349107afbe5
+EBUILD db-5.1.29-r1.ebuild 5467 SHA256 ba6f9a90643d6d0377309ab363a0bff663921e55a867b49bce9edccfcc4e4919 SHA512 86ed6cf561152f39cb59a76fb547e8f676ef068c564941ea3c675097911d0b5663013d1912be05e6e30c9d1664ebddf11b6c88e24f2cacb5362dedb44c1e4e44 WHIRLPOOL c2b6b53f0a02bd832fb069af4921001501b3f823a0745ee937d6fd4fbb13a8a0e7841928151d71744af8111fbc250f54fafcc823cfa4e26fd7db732a43611257
+EBUILD db-5.3.28-r2.ebuild 6625 SHA256 eab245745d8d042aa4ef96192c23fba34548e0e2be7d03f5129563f80e38134c SHA512 b576eb9cd538faee9056bf40720981a1e0cb6c327f557ab90650386ee688c39014da2d52893dda4943731517d26b18ff5ce9c6514a20225090b4a0c4b5710f8a WHIRLPOOL b6eb0f8a75ada0f94aff9b3364c90573e9d912e6a6e649b63ab58653802f343600050a970b8e8e2dbd9029decdd7718bf0c3b5dd0c1d13db98a25498b216158c
+EBUILD db-5.3.28-r3.ebuild 6730 SHA256 0a312000842790e262eae983fc05be2b332201ae567e666e7a1b035b675d7bd5 SHA512 018f21342ef835a000c9db7fdb19eefbb51e666896b21ac5f390f0c350345711e98459711dd1be6d7f1dfe6be7ccb342acfb4b38f2aefa3d328728553f5ba451 WHIRLPOOL ab4b68ca446f4302763becbee068a896c5fa504e4ef023d4d7aa42bb788541dbdc6492e830ef6d6027418b5364a1795efbd31576bf39baf48a1ff531e33ee69c
+EBUILD db-6.0.35-r1.ebuild 6735 SHA256 da19ac538600a261dc0bc2832a3ad77709e46ab788f9d5b4036f3bf43366408e SHA512 aa6fdd88f9c417c861dfddfdac478cab7198daab0cf3f5e83c691a3e74cf53e87862698ad7901d5d03ce1ca8fc0815dbd8e23d2ca8b7fcffce56b24afdf9e2d2 WHIRLPOOL c899fac75d41ccb4e3fd70a32b34ae7cb687af41afc0c82f2a53ee89bddf02871e806423475f727bc47cd924d2859aeafbee1fa65bf76e2462db7a3dcbabe6aa
+EBUILD db-6.0.35.ebuild 6639 SHA256 654933d0c81961ec1438c9a679361c97647f5c66c9fedd2fa4f27d8b182d7763 SHA512 01be1372da86a8f0fa2d17be22172677c2f36664e12e3febc1c21c1e393cb663116253b348d9eae7490b0e47edf3e0592b007edefa15ae57ad30314dc16807b9 WHIRLPOOL 493642da658ae00437be3e7a4e842e47d278ea72c84f8130101133664af489bf63aed1b251dd7918e858d2040c2de5ed901867f30400973bdc3f65fab05fa92d
+EBUILD db-6.1.29-r1.ebuild 6735 SHA256 c566cc75ac513f93e5cb7248a8746f7f8fd035a93b69bd0b84f255aa6f7618a3 SHA512 0c8379370b4e3ae62020fbd6243ab32e359621c0efe335ed7bd123fcaa1755089d5d29672c9c532a4a163441131a1c97528a49e76287c018ce5428d50bc7fa8f WHIRLPOOL 1fb0d167d15ef01805297a405ce3e3953a662d24621e659cd817834094534db6c2be9123e009772665f2a296a7bd0b2e0ad3c9529c543037c302f1ea522c51d8
+EBUILD db-6.1.29.ebuild 6639 SHA256 88bac910a15d60f3f8e6b7833d213773423076903d2728efee8ee48453a33ee0 SHA512 7d852633a7281ce2f0587f777d8fdeaf5cbbf7dee09784d3a7adc8121c10b336521f5ffe66ba825cd356e83d1274790db4d1c5905ffbdad594254d4a365e81b3 WHIRLPOOL a723adecf804105d7fe93490d4e3ac35e68ccf3bbcf90a792ea31d002a3837c478f1d18bda9417a0206e1d1c0882c3587693f8f93d49e0bf761721dec5924863
+EBUILD db-6.2.23-r1.ebuild 6750 SHA256 454b6e95352c16228d0d3360795deae1a84b93eb0714d143a9739f57f7dbf936 SHA512 dcb8e66457d243ff6a15f08372d2bed5d3e5203a1badae55b275119bcf6168b25cc4f6b3b13d38134343d2a2009dbfd88c70b7ea4e44da6705996033f9ffe42b WHIRLPOOL 03bfef7a48cdd50860c775fcf147eed66f16d712e3ed4b9feb90ddc4e22c26156b6659666091101f9a633c7b8ef64ea5fd4c296b6012687df4a26086e80e3dd9
+EBUILD db-6.2.23.ebuild 6654 SHA256 1c2369d7dba452b59ab9297a687835752ba7b157d8d3d88e3c35a477bf48855a SHA512 dafc35d5d2f996b951d5fb6f4e852001cb3af0c73a966673b8aa5929a44483bb24711d0a3afae93dda45b6161dc9eedee9b752f691bc312f95d99b244586a0cd WHIRLPOOL 00104ddc227df50b2cad23b70abfbc1336c34ec945623876461fafbad8f6422d8928cd807b0478fce5ada477ddd60d455d6a340028322214f6475d71242d6b7e
+EBUILD db-6.2.32-r1.ebuild 6753 SHA256 dfeb11a54b09fd00f45bb81bc301c0e0479fcffa9ba0856b3a6c44cae07eadcd SHA512 44f34a5f04146aed5de7f71d4dd057da93a8c6e3b344e1cc5ace9b99148a906d9c2077bc9437173c6335b33129a8f36b86403879a1007fcf36aeb5738e901252 WHIRLPOOL 5737390c83443b700f7d2d664593ebe184c5560f23499dc9eb3595722e7713fe03d74c78ed92e4f601f8e4d145459dd7695a14e08fd3913b99e2faef9b23d751
+EBUILD db-6.2.32.ebuild 6657 SHA256 65f535b016b332673838aa2d01f5b2224638090303517477e0c821abda6a5a68 SHA512 5e894dbea0ea1f092fd2857a8b5eea9401fe4f6165b061224c47a4ab498a00643ce9d98d7b0b33168e6f64aa0391485a19d2c3ba75186ae722170b0feab31fe9 WHIRLPOOL 61e32261f51c051296dcd6389f36843419bf3b9175069f0200c5835acc8e0f4ca89cfb365e3361e40c49422dc39871160ab7d9b6030c5c8526306c1a1de49738
+MISC ChangeLog 8233 SHA256 d3c2284ec6e4770335e1471b6d7cc61b8df21b82c08991b524b7337ae2fb1cb5 SHA512 d7aed1e70182c3eb2d4884a83d27771752c77001d815d26c323a5166c06fe86b1c52e0993404ef702de9c676d2ef27d8b0d53d1ebcf752fc99a6fcb4b123903c WHIRLPOOL f277ac5a4d197c72830a1fc2d98a13f3618e61031bef5250e5c5501432f3ca9742f320878968aa645ac9f21fa06cc890abc8d0ef0b45d10e83381666e8f318d1
+MISC ChangeLog-2015 61376 SHA256 85e97ee07d139d8984e3b24777b1391f02a723ba9ca8a9f2871d005a963d9378 SHA512 416e427409a130f10b11ad303e5cdd0cb853ddc7a332044e7ff6dbbfe0ed014ba7c283816cdd2d808e7b51b930f8f722223e9379a3444a8d4d18fdfcc0b31991 WHIRLPOOL a872aa1481510417a229c4d44915cefc5ba2b35ca3b92b6566c492d9b733fdb4ff5e45be366b17191bbdda102ddb6bd6c4a94a43ae3cad1c406ac09fcaa26210
+MISC metadata.xml 1323 SHA256 1fc5c9111864abc6567a60798a6dc9428ebf11924d5d3b31e0b5743c1ccb9179 SHA512 36f8b6db241ef960b2ac0f7bd19738066e3daadd90efbf7edc54a4774e491506d69a2207738f53643a3e52f1f35a900e4717747744bd30ca682265f50cb8884c WHIRLPOOL cc923c760d53bf42fd2c90f246ec0ba212852d5a6fab576578becb9a3a1e7133713547edd072b167de3a9f6213fb80d37ebb26e798e2f09b6d00fe467b760744
diff --git a/sys-libs/db/db-1.85-r3.ebuild b/sys-libs/db/db-1.85-r3.ebuild
new file mode 100644
index 000000000000..1b325ae84774
--- /dev/null
+++ b/sys-libs/db/db-1.85-r3.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils toolchain-funcs multilib multilib
+
+DESCRIPTION="old berk db kept around for really old packages"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/db.${PV}.tar.gz
+ mirror://gentoo/${PF}.1.patch.bz2"
+# The patch used by Gentoo is from Fedora, and includes all 5 patches found on
+# the Oracle page, plus others.
+
+LICENSE="Sleepycat"
+SLOT="1"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}/db.${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${WORKDIR}"/${PF}.1.patch
+ epatch "${FILESDIR}"/${P}-gentoo-paths.patch
+ sed -i \
+ -e "s:@GENTOO_LIBDIR@:$(get_libdir):" \
+ PORT/linux/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+ emake -C PORT/linux OORG="${CFLAGS}" || die
+}
+
+src_install() {
+ make -C PORT/linux install DESTDIR="${ED}" || die
+
+ # binary compat symlink
+ dosym libdb1.so.2 /usr/$(get_libdir)/libdb.so.2 || die
+
+ dosed "s:<db.h>:<db1/db.h>:" /usr/include/db1/ndbm.h
+ dosym db1/ndbm.h /usr/include/ndbm.h
+
+ dodoc changelog README
+ newdoc hash/README README.hash
+ docinto ps
+ dodoc docs/*.ps
+}
diff --git a/sys-libs/db/db-3.2.9_p2.ebuild b/sys-libs/db/db-3.2.9_p2.ebuild
new file mode 100644
index 000000000000..07e9f6567c3c
--- /dev/null
+++ b/sys-libs/db/db-3.2.9_p2.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils db multilib
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+DESCRIPTION="Berkeley DB for transaction support in MySQL"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="3"
+# This ebuild is to be the compatibility ebuild for when db4 is put
+# in the tree.
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="doc"
+
+DEPEND="${RDEPEND}
+ =sys-libs/db-1.85*"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ # This doesn't build without exceptions
+ export CXXFLAGS="${CXXFLAGS/-fno-exceptions/-fexceptions}"
+
+ unpack "${MY_P}".tar.gz
+
+ chmod -R ug+w *
+
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ # Get db to link libdb* to correct dependencies ... for example if we use
+ # NPTL or NGPT, db detects usable mutexes, and should link against
+ # libpthread, but does not do so ...
+ # <azarah@gentoo.org> (23 Feb 2003)
+ epatch "${FILESDIR}"/${MY_P}-fix-dep-link.patch
+
+ # We should get dump185 to link against system db1 ..
+ # <azarah@gentoo.org> (23 Feb 2003)
+ mv "${S}"/dist/Makefile.in "${S}"/dist/Makefile.in.orig
+ sed -e 's:DB185INC=:DB185INC= -I/usr/include/db1:' \
+ -e 's:DB185LIB=:DB185LIB= -ldb1:' \
+ "${S}"/dist/Makefile.in.orig > "${S}"/dist/Makefile.in || die "Failed to sed"
+
+ epatch "${FILESDIR}"/${MY_P}-gcc43.patch
+
+ # Fix invalid .la files
+ cd "${WORKDIR}"/${MY_P}/dist
+ rm -f ltversion.sh
+ # remove config.guess else we have problems with gcc-3.2
+ rm -f config.guess
+ sed -i "s,\(-D_GNU_SOURCE\),\1 ${CFLAGS}," configure
+
+}
+
+src_compile() {
+ local conf=
+ local conf_shared=
+ local conf_static=
+
+ conf="${conf}
+ --host=${CHOST} \
+ --build=${CHOST} \
+ --enable-cxx \
+ --enable-compat185 \
+ --enable-dump185 \
+ --prefix=${EPREFIX}/usr"
+
+ # --enable-rpc DOES NOT BUILD
+ # Robin H. Johnson <robbat2@gentoo.org> (18 Oct 2003)
+
+ conf_shared="${conf_shared}
+ --enable-dynamic"
+
+ # TCL support is also broken
+ # Robin H. Johnson <robbat2@gentoo.org> (18 Oct 2003)
+ # conf_shared="${conf_shared}
+ # `use_enable tcl tcl`
+ # `use_with tcl tcl /usr/$(get_libdir)`"
+
+ # NOTE: we should not build both shared and static versions
+ # of the libraries in the same build root!
+
+ einfo "Configuring ${P} (static)..."
+ mkdir -p "${S}"/build-static
+ cd "${S}"/build-static
+ strip=/bin/true \
+ ECONF_SOURCE="${S}"/dist econf \
+ ${conf} ${conf_static} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --disable-shared \
+ --enable-static || die
+
+ einfo "Configuring ${P} (shared)..."
+ mkdir -p "${S}"/build-shared
+ cd "${S}"/build-shared
+ strip="${ED}"/bin/true \
+ ECONF_SOURCE="${S}"/dist econf \
+ ${conf} ${conf_shared} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --disable-static \
+ --enable-shared || die
+
+ # Parallel make does not work
+ MAKEOPTS="${MAKEOPTS} -j1"
+ einfo "Building ${P} (static)..."
+ cd "${S}"/build-static
+ emake strip="${EPREFIX}"/bin/true || die "Static build failed"
+ einfo "Building ${P} (shared)..."
+ cd "${S}"/build-shared
+ emake strip="${EPREFIX}"/bin/true || die "Shared build failed"
+}
+
+src_install () {
+ cd "${S}"/build-shared
+ make libdb=libdb-3.2.a \
+ libcxx=libcxx_3.2.a \
+ prefix="${EPREFIX}"/usr \
+ libdir="${EPREFIX}"/usr/$(get_libdir) \
+ strip="${EPREFIX}"/bin/true \
+ install || die
+
+ cd "${S}"/build-static
+ newlib.a libdb.a libdb-3.2.a || die "failed to package static libraries!"
+ newlib.a libdb_cxx.a libdb_cxx-3.2.a || die "failed to package static libraries!"
+
+ db_src_install_headerslot || die "db_src_install_headerslot failed!"
+
+ # this is now done in the db eclass, function db_fix_so and db_src_install_usrlibcleanup
+ #cd "${D}"/usr/lib
+ #ln -s libdb-3.2.so libdb.so.3
+
+ # For some reason, db.so's are *not* readable by group or others,
+ # resulting in no one but root being able to use them!!!
+ # This fixes it -- DR 15 Jun 2001
+ cd "${ED}"/usr/$(get_libdir)
+ chmod go+rx *.so
+ # The .la's aren't readable either
+ chmod go+r *.la
+
+ cd "${S}"
+ dodoc README
+
+ db_src_install_doc || die "db_src_install_doc failed!"
+
+ db_src_install_usrbinslot || die "db_src_install_usrbinslot failed!"
+
+ db_src_install_usrlibcleanup || die "db_src_install_usrlibcleanup failed!"
+}
+
+pkg_postinst () {
+ db_fix_so
+}
+
+pkg_postrm () {
+ db_fix_so
+}
+
+src_test() {
+ if use test; then
+ eerror "We'd love to be able to test, but the testsuite is broken in the 3.2.9 series"
+ fi
+}
diff --git a/sys-libs/db/db-4.2.52_p5-r1.ebuild b/sys-libs/db/db-4.2.52_p5-r1.ebuild
new file mode 100644
index 000000000000..a68275844a24
--- /dev/null
+++ b/sys-libs/db/db-4.2.52_p5-r1.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S="${WORKDIR}/${MY_P}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="4.2"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="tcl java doc cxx rpc"
+
+DEPEND="tcl? ( >=dev-lang/tcl-8.4 )
+ java? ( >=virtual/jdk-1.4 )"
+RDEPEND="tcl? ( dev-lang/tcl )
+ java? ( >=virtual/jre-1.4 )"
+
+src_unpack() {
+ unpack "${MY_P}".tar.gz
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+ epatch "${FILESDIR}"/"${PN}"-4.2.52_p2-TXN.patch
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-libtool.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-listen-to-java-options.patch
+ epatch "${FILESDIR}"/"${PN}"-4.0.14-fix-dep-link.patch
+
+ sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S}"/../dist/Makefile.in
+
+ # START of 4.5+earlier specific
+ # Upstream sucks, they normally concat these
+ cd "${S}"/../dist/aclocal
+ for i in *; do ln -s $i ${i%.ac}.m4 ; done ;
+ cd "${S}"/../dist/aclocal_java
+ for i in *; do ln -s $i ${i%.ac}.m4 ; done ;
+ # END of 4.5+earlier specific
+ cd "${S}"/../dist
+ rm -f aclocal/libtool.{m4,ac} aclocal.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, missing_sh/ bash, missing_sh/' \
+ aclocal/programs.m4
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ sed -i \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure
+}
+
+src_compile() {
+ local myconf=""
+
+ use amd64 && myconf="${myconf} --with-mutex=x86/gcc-assembly"
+
+ myconf="${myconf} $(use_enable cxx)"
+
+ use tcl \
+ && myconf="${myconf} --enable-tcl --with-tcl=${EPREFIX}/usr/$(get_libdir)" \
+ || myconf="${myconf} --disable-tcl"
+
+ myconf="${myconf} $(use_enable java)"
+ if use java; then
+ myconf="${myconf} --with-java-prefix=${JAVA_HOME}"
+ # Can't get this working any other way, since it returns spaces, and
+ # bash doesn't seem to want to pass correctly in any way i try
+ local javaconf="-with-javac-flags=$(java-pkg_javac-args)"
+ fi
+
+ [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
+
+ # the entire testsuite needs the TCL functionality
+ if use tcl && use test; then
+ myconf="${myconf} --enable-test"
+ else
+ myconf="${myconf} --disable-test"
+ fi
+
+ cd "${S}" && ECONF_SOURCE="${S}"/../dist econf \
+ --prefix="${EPREFIX}"/usr \
+ --mandir="${EPREFIX}"/usr/share/man \
+ --infodir="${EPREFIX}"/usr/share/info \
+ --datadir="${EPREFIX}"/usr/share \
+ --sysconfdir="${EPREFIX}"/etc \
+ --localstatedir="${EPREFIX}"/var/lib \
+ --libdir="${EPREFIX}"/usr/"$(get_libdir)" \
+ --enable-compat185 \
+ --with-uniquename \
+ $(use_enable rpc) \
+ --host="${CHOST}" \
+ ${myconf} "${javaconf}" || die "configure failed"
+
+ # This isn't safe for prefix (Darwin should be .jnilib), but I can't get the
+ # build system to behave itself, it generates libtool too late.
+ sed -i \
+ -e 's/-shrext $(SOFLAGS)/-shrext .so $(SOFLAGS)/g' \
+ Makefile
+ emake || die "make failed"
+}
+
+src_install() {
+ einstall libdir="${ED}/usr/$(get_libdir)" strip="${ED}/bin/strip" || die
+
+ db_src_install_usrbinslot
+
+ db_src_install_headerslot
+
+ db_src_install_doc
+
+ db_src_install_usrlibcleanup
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] && \
+ mv "${ED}"/usr/bin/berkeley_db_svc "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
+
+ if use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+pkg_postinst() {
+ db_fix_so
+}
+
+pkg_postrm() {
+ db_fix_so
+}
diff --git a/sys-libs/db/db-4.3.29_p1-r1.ebuild b/sys-libs/db/db-4.3.29_p1-r1.ebuild
new file mode 100644
index 000000000000..fa709ec48a83
--- /dev/null
+++ b/sys-libs/db/db-4.3.29_p1-r1.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S="${WORKDIR}/${MY_P}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="4.3"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="tcl java doc cxx rpc"
+
+DEPEND="tcl? ( >=dev-lang/tcl-8.4 )
+ java? ( >=virtual/jdk-1.4 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( dev-lang/tcl )
+ java? ( >=virtual/jre-1.4 )"
+
+src_unpack() {
+ unpack "${MY_P}".tar.gz
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-libtool.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-listen-to-java-options.patch
+
+ epatch "${FILESDIR}"/"${PN}"-4.3.27-fix-dep-link.patch
+
+ sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S}"/../dist/Makefile.in
+
+ # START of 4.5+earlier specific
+ # Upstream sucks, they normally concat these
+ cd "${S}"/../dist/aclocal
+ for i in *; do ln -s $i ${i%.ac}.m4 ; done ;
+ cd "${S}"/../dist/aclocal_java
+ for i in *; do ln -s $i ${i%.ac}.m4 ; done ;
+ # END of 4.5+earlier specific
+ cd "${S}"/../dist
+ rm -f aclocal/libtool.{m4,ac} aclocal.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, missing_sh/ bash, missing_sh/' \
+ aclocal/programs.m4
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ sed -i \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure
+}
+
+src_compile() {
+ local myconf=""
+
+ use amd64 && myconf="${myconf} --with-mutex=x86/gcc-assembly"
+
+ myconf="${myconf} $(use_enable cxx)"
+
+ use tcl \
+ && myconf="${myconf} --enable-tcl --with-tcl=${EPREFIX}/usr/$(get_libdir)" \
+ || myconf="${myconf} --disable-tcl"
+
+ myconf="${myconf} $(use_enable java)"
+ if use java; then
+ myconf="${myconf} --with-java-prefix=${JAVA_HOME}"
+ # Can't get this working any other way, since it returns spaces, and
+ # bash doesn't seem to want to pass correctly in any way i try
+ local javaconf="-with-javac-flags=$(java-pkg_javac-args)"
+ fi
+
+ [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
+
+ # the entire testsuite needs the TCL functionality
+ if use tcl && use test ; then
+ myconf="${myconf} --enable-test"
+ else
+ myconf="${myconf} --disable-test"
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header
+ # file mumbo jumbo.
+ if use userland_GNU; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ cd "${S}" && ECONF_SOURCE="${S}"/../dist econf \
+ --prefix="${EPREFIX}"/usr \
+ --mandir="${EPREFIX}"/usr/share/man \
+ --infodir="${EPREFIX}"/usr/share/info \
+ --datadir="${EPREFIX}"/usr/share \
+ --sysconfdir="${EPREFIX}"/etc \
+ --localstatedir="${EPREFIX}"/var/lib \
+ --libdir="${EPREFIX}"/usr/"$(get_libdir)" \
+ --enable-compat185 \
+ --enable-o_direct \
+ --without-uniquename \
+ $(use_enable rpc) \
+ --host="${CHOST}" \
+ ${myconf} "${javaconf}" || die "configure failed"
+
+ emake || die "make failed"
+}
+
+src_install() {
+ einstall libdir="${ED}/usr/$(get_libdir)" strip="${ED}/bin/strip" || die
+
+ db_src_install_usrbinslot
+
+ db_src_install_headerslot
+
+ db_src_install_doc
+
+ db_src_install_usrlibcleanup
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] && \
+ mv "${ED}"/usr/bin/berkeley_db_svc "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
+
+ if use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+pkg_postinst() {
+ db_fix_so
+}
+
+pkg_postrm() {
+ db_fix_so
+}
diff --git a/sys-libs/db/db-4.4.20_p4-r1.ebuild b/sys-libs/db/db-4.4.20_p4-r1.ebuild
new file mode 100644
index 000000000000..296dcc89ef9e
--- /dev/null
+++ b/sys-libs/db/db-4.4.20_p4-r1.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S="${WORKDIR}/${MY_P}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz
+ mirror://gentoo/${MY_P}-20060110-rpc_server-java.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat BSD"
+SLOT="4.4"
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="tcl java doc cxx rpc"
+
+DEPEND="tcl? ( >=dev-lang/tcl-8.4 )
+ java? ( >=virtual/jdk-1.4 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( dev-lang/tcl )
+ java? ( >=virtual/jre-1.4 )"
+
+src_unpack() {
+ unpack "${MY_P}".tar.gz
+ unpack "${MY_P}-20060110-rpc_server-java".tar.gz
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-libtool.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/"${PN}"-4.3-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/"${PN}"-4.3-listen-to-java-options.patch
+
+ sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S}"/../dist/Makefile.in
+
+ # START of 4.5+earlier specific
+ # Upstream sucks, they normally concat these
+ cd "${S}"/../dist/aclocal
+ for i in *; do ln -s $i ${i%.ac}.m4 ; done ;
+ cd "${S}"/../dist/aclocal_java
+ for i in *; do ln -s $i ${i%.ac}.m4 ; done ;
+ # END of 4.5+earlier specific
+ cd "${S}"/../dist
+ rm -f aclocal/libtool.{m4,ac} aclocal.m4
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ sed -i \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure
+}
+
+src_compile() {
+ local myconf=""
+
+ use amd64 && myconf="${myconf} --with-mutex=x86/gcc-assembly"
+
+ myconf="${myconf} $(use_enable cxx)"
+
+ use tcl \
+ && myconf="${myconf} --enable-tcl --with-tcl=${EPREFIX}/usr/$(get_libdir)" \
+ || myconf="${myconf} --disable-tcl"
+
+ myconf="${myconf} $(use_enable java)"
+ if use java; then
+ myconf="${myconf} --with-java-prefix=${JAVA_HOME}"
+ # Can't get this working any other way, since it returns spaces, and
+ # bash doesn't seem to want to pass correctly in any way i try
+ local javaconf="-with-javac-flags=$(java-pkg_javac-args)"
+ fi
+
+ [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
+
+ # the entire testsuite needs the TCL functionality
+ if use tcl && use test ; then
+ myconf="${myconf} --enable-test"
+ else
+ myconf="${myconf} --disable-test"
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ cd "${S}" && ECONF_SOURCE="${S}"/../dist econf \
+ --prefix="${EPREFIX}"/usr \
+ --mandir="${EPREFIX}"/usr/share/man \
+ --infodir="${EPREFIX}"/usr/share/info \
+ --datadir="${EPREFIX}"/usr/share \
+ --sysconfdir="${EPREFIX}"/etc \
+ --localstatedir="${EPREFIX}"/var/lib \
+ --libdir="${EPREFIX}"/usr/"$(get_libdir)" \
+ --enable-compat185 \
+ --enable-o_direct \
+ --without-uniquename \
+ $(use_enable rpc) \
+ --host="${CHOST}" \
+ ${myconf} "${javaconf}" || die "configure failed"
+
+ emake -j1 || die "make failed"
+}
+
+src_install() {
+ einstall libdir="${ED}/usr/$(get_libdir)" strip="${ED}/bin/strip" || die
+
+ db_src_install_usrbinslot
+
+ db_src_install_headerslot
+
+ db_src_install_doc
+
+ db_src_install_usrlibcleanup
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] && \
+ mv "${ED}"/usr/bin/berkeley_db_svc "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
+
+ if use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+pkg_postinst() {
+ db_fix_so
+}
+
+pkg_postrm() {
+ db_fix_so
+}
diff --git a/sys-libs/db/db-4.5.20_p2-r1.ebuild b/sys-libs/db/db-4.5.20_p2-r1.ebuild
new file mode 100644
index 000000000000..178d0bf58c64
--- /dev/null
+++ b/sys-libs/db/db-4.5.20_p2-r1.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S="${WORKDIR}/${MY_P}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="4.5"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="tcl java doc cxx rpc"
+
+DEPEND="tcl? ( >=dev-lang/tcl-8.4 )
+ java? ( >=virtual/jdk-1.4 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( dev-lang/tcl )
+ java? ( >=virtual/jre-1.4 )"
+
+src_unpack() {
+ unpack "${MY_P}".tar.gz
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-libtool.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/"${PN}"-4.3-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/"${PN}"-4.3-listen-to-java-options.patch
+
+ sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S}"/../dist/Makefile.in
+
+ # START of 4.5+earlier specific
+ # Upstream sucks, they normally concat these
+ cd "${S}"/../dist/aclocal
+ for i in *; do ln -s $i ${i%.ac}.m4 ; done ;
+ cd "${S}"/../dist/aclocal_java
+ for i in *; do ln -s $i ${i%.ac}.m4 ; done ;
+ # END of 4.5+earlier specific
+ cd "${S}"/../dist
+ rm -f aclocal/libtool.{m4,ac} aclocal.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ sed -i \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure
+}
+
+src_compile() {
+ # compilation with -O0 fails on amd64, see bug #171231
+ if use amd64; then
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ local myconf=""
+
+ use amd64 && myconf="${myconf} --with-mutex=x86/gcc-assembly"
+
+ myconf="${myconf} $(use_enable cxx)"
+
+ use tcl \
+ && myconf="${myconf} --enable-tcl --with-tcl=${EPREFIX}/usr/$(get_libdir)" \
+ || myconf="${myconf} --disable-tcl"
+
+ myconf="${myconf} $(use_enable java)"
+ if use java; then
+ myconf="${myconf} --with-java-prefix=${JAVA_HOME}"
+ # Can't get this working any other way, since it returns spaces, and
+ # bash doesn't seem to want to pass correctly in any way i try
+ local javaconf="-with-javac-flags=$(java-pkg_javac-args)"
+ fi
+
+ [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
+
+ # the entire testsuite needs the TCL functionality
+ if use tcl && use test ; then
+ myconf="${myconf} --enable-test"
+ else
+ myconf="${myconf} --disable-test"
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ cd "${S}" && ECONF_SOURCE="${S}"/../dist econf \
+ --prefix="${EPREFIX}"/usr \
+ --mandir="${EPREFIX}"/usr/share/man \
+ --infodir="${EPREFIX}"/usr/share/info \
+ --datadir="${EPREFIX}"/usr/share \
+ --sysconfdir="${EPREFIX}"/etc \
+ --localstatedir="${EPREFIX}"/var/lib \
+ --libdir="${EPREFIX}"/usr/"$(get_libdir)" \
+ --enable-compat185 \
+ --enable-o_direct \
+ --without-uniquename \
+ $(use_enable rpc) \
+ --host="${CHOST}" \
+ ${myconf} "${javaconf}" || die "configure failed"
+
+ sed -e "s,\(^STRIP *=\).*,\1\"true\"," Makefile > Makefile.cpy \
+ && mv Makefile.cpy Makefile
+
+ emake || die "make failed"
+}
+
+src_install() {
+ einstall libdir="${ED}/usr/$(get_libdir)" STRIP="true" || die
+
+ db_src_install_usrbinslot
+
+ db_src_install_headerslot
+
+ db_src_install_doc
+
+ db_src_install_usrlibcleanup
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] && \
+ mv "${ED}"/usr/bin/berkeley_db_svc "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
+
+ if use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+pkg_postinst() {
+ db_fix_so
+}
+
+pkg_postrm() {
+ db_fix_so
+}
diff --git a/sys-libs/db/db-4.6.21_p4.ebuild b/sys-libs/db/db-4.6.21_p4.ebuild
new file mode 100644
index 000000000000..7f32087a5edd
--- /dev/null
+++ b/sys-libs/db/db-4.6.21_p4.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S="${WORKDIR}/${MY_P}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="4.6"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="tcl java doc cxx rpc"
+
+DEPEND="tcl? ( >=dev-lang/tcl-8.4 )
+ java? ( >=virtual/jdk-1.4 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( dev-lang/tcl )
+ java? ( >=virtual/jre-1.4 )"
+
+src_unpack() {
+ unpack "${MY_P}".tar.gz
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-libtool.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/"${PN}"-"${SLOT}"-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/"${PN}"-4.3-listen-to-java-options.patch
+
+ sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S}"/../dist/Makefile.in
+
+ cd "${S}"/../dist
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ sed -i \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure
+}
+
+src_compile() {
+ # compilation with -O0 fails on amd64, see bug #171231
+ if use amd64; then
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ local myconf=""
+
+ use amd64 && myconf="${myconf} --with-mutex=x86/gcc-assembly"
+
+ myconf="${myconf} $(use_enable cxx)"
+
+ use tcl \
+ && myconf="${myconf} --enable-tcl --with-tcl=${EPREFIX}/usr/$(get_libdir)" \
+ || myconf="${myconf} --disable-tcl"
+
+ myconf="${myconf} $(use_enable java)"
+ if use java; then
+ myconf="${myconf} --with-java-prefix=${JAVA_HOME}"
+ # Can't get this working any other way, since it returns spaces, and
+ # bash doesn't seem to want to pass correctly in any way i try
+ local javaconf="-with-javac-flags=$(java-pkg_javac-args)"
+ fi
+
+ [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
+
+ # the entire testsuite needs the TCL functionality
+ if use tcl && use test ; then
+ myconf="${myconf} --enable-test"
+ else
+ myconf="${myconf} --disable-test"
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ cd "${S}" && ECONF_SOURCE="${S}"/../dist econf \
+ --prefix="${EPREFIX}"/usr \
+ --mandir="${EPREFIX}"/usr/share/man \
+ --infodir="${EPREFIX}"/usr/share/info \
+ --datadir="${EPREFIX}"/usr/share \
+ --sysconfdir="${EPREFIX}"/etc \
+ --localstatedir="${EPREFIX}"/var/lib \
+ --libdir="${EPREFIX}"/usr/"$(get_libdir)" \
+ --enable-compat185 \
+ --enable-o_direct \
+ --without-uniquename \
+ $(use_enable rpc) \
+ --host="${CHOST}" \
+ ${myconf} "${javaconf}" || die "configure failed"
+
+ sed -e "s,\(^STRIP *=\).*,\1\"true\"," Makefile > Makefile.cpy \
+ && mv Makefile.cpy Makefile
+
+ emake || die "make failed"
+}
+
+src_install() {
+ einstall libdir="${ED}/usr/$(get_libdir)" STRIP="true" || die
+
+ db_src_install_usrbinslot
+
+ db_src_install_headerslot
+
+ db_src_install_doc
+
+ db_src_install_usrlibcleanup
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] && \
+ mv "${ED}"/usr/bin/berkeley_db_svc "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
+
+ if use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+pkg_postinst() {
+ db_fix_so
+}
+
+pkg_postrm() {
+ db_fix_so
+}
diff --git a/sys-libs/db/db-4.7.25_p4.ebuild b/sys-libs/db/db-4.7.25_p4.ebuild
new file mode 100644
index 000000000000..828747ac824c
--- /dev/null
+++ b/sys-libs/db/db-4.7.25_p4.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S="${WORKDIR}/${MY_P}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="4.7"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test rpc"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.4 )
+ test? ( >=dev-lang/tcl-8.4 )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( dev-lang/tcl )
+ java? ( >=virtual/jre-1.5 )"
+
+src_unpack() {
+ unpack "${MY_P}".tar.gz
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+ epatch "${FILESDIR}"/"${PN}"-4.6-libtool.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/"${PN}"-4.6-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/"${PN}"-4.3-listen-to-java-options.patch
+
+ sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S}"/../dist/Makefile.in
+
+ cd "${S}"/../dist
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ sed -i \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure
+}
+
+src_compile() {
+ local myconf=''
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if use amd64; then
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ set --
+ if use java ; then
+ set -- "$@" \
+ --with-java-prefix="${JAVA_HOME}" \
+ --with-javac-flags="$(java-pkg_javac-args)"
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf="${myconf} --enable-tcl"
+ myconf="${myconf} --with-tcl=${EPREFIX}/usr/$(get_libdir)"
+ else
+ myconf="${myconf} --disable-tcl"
+ fi
+
+ cd "${S}"
+ ECONF_SOURCE="${S}"/../dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-o_direct \
+ --without-uniquename \
+ $(use_enable rpc) \
+ $(use arm && echo --with-mutex=ARM/gcc-assembly) \
+ $(use amd64 && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable java) \
+ ${myconf} \
+ $(use_enable test) \
+ "$@"
+
+ emake || die "make failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+
+ db_src_install_usrbinslot
+
+ db_src_install_headerslot
+
+ db_src_install_doc
+
+ db_src_install_usrlibcleanup
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] && \
+ mv "${ED}"/usr/bin/berkeley_db_svc "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
+
+ if use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+pkg_postinst() {
+ db_fix_so
+}
+
+pkg_postrm() {
+ db_fix_so
+}
diff --git a/sys-libs/db/db-4.8.30-r2.ebuild b/sys-libs/db/db-4.8.30-r2.ebuild
new file mode 100644
index 000000000000..5584a2c115ad
--- /dev/null
+++ b/sys-libs/db/db-4.8.30-r2.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S="${WORKDIR}/${MY_P}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="4.8"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}" || die
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+ epatch "${FILESDIR}"/${PN}-4.8-libtool.patch
+ epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+ epatch "${FILESDIR}"/${PN}-4.8.30-rename-atomic-compare-exchange.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/${PN}-4.6-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ sed -e "/^DB_RELEASE_DATE=/s/%B %e, %Y/%Y-%m-%d/" -i dist/RELEASE \
+ || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S}"/../dist/Makefile.in || die
+
+ cd "${S}"/../dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ sed -i \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure || die
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ ECONF_SOURCE="${S}"/../dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-o_direct \
+ --without-uniquename \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
diff --git a/sys-libs/db/db-5.1.29-r1.ebuild b/sys-libs/db/db-5.1.29-r1.ebuild
new file mode 100644
index 000000000000..1098ae248f88
--- /dev/null
+++ b/sys-libs/db/db-5.1.29-r1.ebuild
@@ -0,0 +1,203 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="5.1"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.4:0 )
+ test? ( >=dev-lang/tcl-8.4:0 )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( dev-lang/tcl:0 )
+ java? ( >=virtual/jre-1.5 )"
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+ epatch "${FILESDIR}"/${PN}-4.8-libtool.patch
+ epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/${PN}-4.6-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # upstream autoconf fails to build DBM when it's supposed to
+ # merged upstream in 5.0.26
+ #epatch "${FILESDIR}"/${PN}-5.0.21-enable-dbm-autoconf.patch
+
+ # Needed when compiling with clang
+ epatch "${FILESDIR}"/${P}-rename-atomic-compare-exchange.patch
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in
+
+ cd "${S_BASE}"/dist
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure
+ done
+}
+
+src_configure() {
+ local myconf=''
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if use amd64; then
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ set --
+ if use java ; then
+ set -- "$@" \
+ --with-java-prefix="${JAVA_HOME}" \
+ --with-javac-flags="$(java-pkg_javac-args)"
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf="${myconf} --enable-tcl"
+ myconf="${myconf} --with-tcl=${EPREFIX}/usr/$(get_libdir)"
+ else
+ myconf="${myconf} --disable-tcl"
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ cd "${S}"
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --enable-sql \
+ --enable-sql_codegen \
+ --disable-sql_compat \
+ $(use arm && echo --with-mutex=ARM/gcc-assembly) \
+ $(use amd64 && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(use_enable java) \
+ ${myconf} \
+ $(use_enable test) \
+ "$@"
+}
+
+src_compile() {
+ emake || die "make failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+
+ db_src_install_usrbinslot
+
+ db_src_install_headerslot
+
+ db_src_install_doc
+
+ db_src_install_usrlibcleanup
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] && \
+ mv "${ED}"/usr/bin/berkeley_db_svc "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
+
+ if use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+pkg_postinst() {
+ db_fix_so
+}
+
+pkg_postrm() {
+ db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl"
+
+ db_src_test
+}
diff --git a/sys-libs/db/db-5.3.28-r2.ebuild b/sys-libs/db/db-5.3.28-r2.ebuild
new file mode 100644
index 000000000000..5f80d60111f2
--- /dev/null
+++ b/sys-libs/db/db-5.3.28-r2.ebuild
@@ -0,0 +1,232 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="5.3"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db5.3/db.h
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ # bug #510506
+ epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/${PN}-4.6-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x
+ epatch "${FILESDIR}"/${PN}-5.2.28-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ epatch "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+
+ # Needed when compiling with clang
+ epatch "${FILESDIR}"/${PN}-5.1.29-rename-atomic-compare-exchange.patch
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --enable-sql \
+ --enable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-5.3.28-r3.ebuild b/sys-libs/db/db-5.3.28-r3.ebuild
new file mode 100644
index 000000000000..240a2b09a416
--- /dev/null
+++ b/sys-libs/db/db-5.3.28-r3.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="Sleepycat"
+SLOT="5.3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db5.3/db.h
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ # bug #510506
+ epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/${PN}-4.6-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x
+ epatch "${FILESDIR}"/${PN}-5.2.28-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ epatch "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+
+ # Needed when compiling with clang
+ epatch "${FILESDIR}"/${PN}-5.1.29-rename-atomic-compare-exchange.patch
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ # Don't --enable-sql* because we don't want to use bundled sqlite.
+ # See Gentoo bug #605688
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --disable-sql \
+ --disable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-6.0.35-r1.ebuild b/sys-libs/db/db-6.0.35-r1.ebuild
new file mode 100644
index 000000000000..0c5fe167e084
--- /dev/null
+++ b/sys-libs/db/db-6.0.35-r1.ebuild
@@ -0,0 +1,232 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal versionator toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db$(get_version_component_range 1-2)/db.h
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ # bug #510506
+ epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/${PN}-4.6-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ epatch "${FILESDIR}"/${PN}-6.0.35-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ epatch "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ # Don't --enable-sql* because we don't want to use bundled sqlite.
+ # See Gentoo bug #605688
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --disable-sql \
+ --disable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-6.0.35.ebuild b/sys-libs/db/db-6.0.35.ebuild
new file mode 100644
index 000000000000..5dce460076e1
--- /dev/null
+++ b/sys-libs/db/db-6.0.35.ebuild
@@ -0,0 +1,230 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal versionator toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db$(get_version_component_range 1-2)/db.h
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ # bug #510506
+ epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/${PN}-4.6-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ epatch "${FILESDIR}"/${PN}-6.0.35-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ epatch "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --enable-sql \
+ --enable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-6.1.29-r1.ebuild b/sys-libs/db/db-6.1.29-r1.ebuild
new file mode 100644
index 000000000000..1055a51317b6
--- /dev/null
+++ b/sys-libs/db/db-6.1.29-r1.ebuild
@@ -0,0 +1,232 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal versionator toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db$(get_version_component_range 1-2)/db.h
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ # bug #510506
+ epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/${PN}-6.2-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ epatch "${FILESDIR}"/${PN}-6.1.19-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ epatch "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ # Don't --enable-sql* because we don't want to use bundled sqlite.
+ # See Gentoo bug #605688
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --disable-sql \
+ --disable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-6.1.29.ebuild b/sys-libs/db/db-6.1.29.ebuild
new file mode 100644
index 000000000000..950bc6f97452
--- /dev/null
+++ b/sys-libs/db/db-6.1.29.ebuild
@@ -0,0 +1,230 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal versionator toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db$(get_version_component_range 1-2)/db.h
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ # bug #510506
+ epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ epatch "${FILESDIR}"/${PN}-6.2-jni-check-prefix-first.patch
+ epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ epatch "${FILESDIR}"/${PN}-6.1.19-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ epatch "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --enable-sql \
+ --enable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-6.2.23-r1.ebuild b/sys-libs/db/db-6.2.23-r1.ebuild
new file mode 100644
index 000000000000..2d4ba9b44373
--- /dev/null
+++ b/sys-libs/db/db-6.2.23-r1.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal versionator toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db$(get_version_component_range 1-2)/db.h
+)
+
+PATCHES=(
+ # bug #510506
+ "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ "${FILESDIR}"/${PN}-6.2-jni-check-prefix-first.patch
+ "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ "${FILESDIR}"/${PN}-6.1.19-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ epatch "${PATCHES[@]}"
+ epatch_user
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ # Don't --enable-sql* because we don't want to use bundled sqlite.
+ # See Gentoo bug #605688
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --disable-sql \
+ --disable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-6.2.23.ebuild b/sys-libs/db/db-6.2.23.ebuild
new file mode 100644
index 000000000000..ff7694a3b692
--- /dev/null
+++ b/sys-libs/db/db-6.2.23.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal versionator toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db$(get_version_component_range 1-2)/db.h
+)
+
+PATCHES=(
+ # bug #510506
+ "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ "${FILESDIR}"/${PN}-6.2-jni-check-prefix-first.patch
+ "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ "${FILESDIR}"/${PN}-6.1.19-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ epatch "${PATCHES[@]}"
+ epatch_user
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --enable-sql \
+ --enable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-6.2.32-r1.ebuild b/sys-libs/db/db-6.2.32-r1.ebuild
new file mode 100644
index 000000000000..2dbb2cc1a5de
--- /dev/null
+++ b/sys-libs/db/db-6.2.32-r1.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal versionator toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db$(get_version_component_range 1-2)/db.h
+)
+
+PATCHES=(
+ # bug #510506
+ "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ "${FILESDIR}"/${PN}-6.2.32-jni-check-prefix-first.patch
+ "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ "${FILESDIR}"/${PN}-6.1.19-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ epatch "${PATCHES[@]}"
+ epatch_user
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ # Don't --enable-sql* because we don't want to use bundled sqlite.
+ # See Gentoo bug #605688
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --disable-sql \
+ --disable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/db-6.2.32.ebuild b/sys-libs/db/db-6.2.32.ebuild
new file mode 100644
index 000000000000..61a18bfa9445
--- /dev/null
+++ b/sys-libs/db/db-6.2.32.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib multilib-minimal versionator toolchain-funcs
+
+#Number of official patches
+#PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
+PATCHNO=${PV/*.*.*_p}
+if [[ ${PATCHNO} == "${PV}" ]] ; then
+ MY_PV=${PV}
+ MY_P=${P}
+ PATCHNO=0
+else
+ MY_PV=${PV/_p${PATCHNO}}
+ MY_P=${PN}-${MY_PV}
+fi
+
+S_BASE="${WORKDIR}/${MY_P}"
+S="${S_BASE}/build_unix"
+DESCRIPTION="Oracle Berkeley DB"
+HOMEPAGE="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
+for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
+ export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
+done
+
+LICENSE="AGPL-3"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc java cxx tcl test"
+
+REQUIRED_USE="test? ( tcl )"
+
+# the entire testsuite needs the TCL functionality
+DEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ test? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jdk-1.5 )
+ >=sys-devel/binutils-2.16.1"
+RDEPEND="tcl? ( >=dev-lang/tcl-8.5.15-r1:0=[${MULTILIB_USEDEP}] )
+ java? ( >=virtual/jre-1.5 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/db$(get_version_component_range 1-2)/db.h
+)
+
+PATCHES=(
+ # bug #510506
+ "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
+
+ # use the includes from the prefix
+ "${FILESDIR}"/${PN}-6.2.32-jni-check-prefix-first.patch
+ "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
+
+ # sqlite configure call has an extra leading ..
+ # upstreamed:5.2.36, missing in 5.3.x/6.x
+ # still needs to be patched in 6.0.20
+ "${FILESDIR}"/${PN}-6.1.19-sqlite-configure-path.patch
+
+ # The upstream testsuite copies .lib and the binaries for each parallel test
+ # core, ~300MB each. This patch uses links instead, saves a lot of space.
+ "${FILESDIR}"/${PN}-6.0.20-test-link.patch
+)
+
+src_prepare() {
+ cd "${WORKDIR}"/"${MY_P}"
+ for (( i=1 ; i<=${PATCHNO} ; i++ ))
+ do
+ epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
+ done
+
+ epatch "${PATCHES[@]}"
+ epatch_user
+
+ # Upstream release script grabs the dates when the script was run, so lets
+ # end-run them to keep the date the same.
+ export REAL_DB_RELEASE_DATE="$(awk \
+ '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
+ "${S_BASE}"/dist/configure)"
+ sed -r -i \
+ -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
+ "${S_BASE}"/dist/RELEASE || die
+
+ # Include the SLOT for Java JAR files
+ # This supersedes the unused jarlocation patches.
+ sed -r -i \
+ -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
+ "${S_BASE}"/dist/Makefile.in || die
+
+ cd "${S_BASE}"/dist || die
+ rm -f aclocal/libtool.m4
+ sed -i \
+ -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
+ configure.ac || die
+ sed -i \
+ -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
+ aclocal/programs.m4 || die
+ AT_M4DIR="aclocal aclocal_java" eautoreconf
+ # Upstream sucks - they do autoconf and THEN replace the version variables.
+ . ./RELEASE
+ for v in \
+ DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
+ DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
+ DB_VERSION \
+ DB_RELEASE_DATE ; do
+ local ev="__EDIT_${v}__"
+ sed -i -e "s/${ev}/${!v}/g" configure || die
+ done
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ tc-ld-disable-gold #470634
+
+ # compilation with -O0 fails on amd64, see bug #171231
+ if [[ ${ABI} == amd64 ]]; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O0 -O2
+ is-flagq -O[s123] || append-flags -O2
+ fi
+
+ # Add linker versions to the symbols. Easier to do, and safer than header file
+ # mumbo jumbo.
+ if use userland_GNU ; then
+ append-ldflags -Wl,--default-symver
+ fi
+
+ # use `set` here since the java opts will contain whitespace
+ if multilib_is_native_abi && use java ; then
+ myconf+=(
+ --with-java-prefix="${JAVA_HOME}"
+ --with-javac-flags="$(java-pkg_javac-args)"
+ )
+ fi
+
+ # Bug #270851: test needs TCL support
+ if use tcl || use test ; then
+ myconf+=(
+ --enable-tcl
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ )
+ else
+ myconf+=(--disable-tcl )
+ fi
+
+ # sql_compat will cause a collision with sqlite3
+ # --enable-sql_compat
+ ECONF_SOURCE="${S_BASE}"/dist \
+ STRIP="true" \
+ econf \
+ --enable-compat185 \
+ --enable-dbm \
+ --enable-o_direct \
+ --without-uniquename \
+ --enable-sql \
+ --enable-sql_codegen \
+ --disable-sql_compat \
+ $([[ ${ABI} == arm ]] && echo --with-mutex=ARM/gcc-assembly) \
+ $([[ ${ABI} == amd64 ]] && echo --with-mutex=x86/gcc-assembly) \
+ $(use_enable cxx) \
+ $(use_enable cxx stl) \
+ $(multilib_native_use_enable java) \
+ "${myconf[@]}" \
+ $(use_enable test)
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ db_src_install_headerslot
+
+ db_src_install_usrlibcleanup
+
+ if multilib_is_native_abi && use java; then
+ java-pkg_regso "${ED}"/usr/"$(get_libdir)"/libdb_java*.so
+ java-pkg_dojar "${ED}"/usr/"$(get_libdir)"/*.jar
+ rm -f "${ED}"/usr/"$(get_libdir)"/*.jar
+ fi
+}
+
+multilib_src_install_all() {
+ db_src_install_usrbinslot
+
+ db_src_install_doc
+
+ dodir /usr/sbin
+ # This file is not always built, and no longer exists as of db-4.8
+ if [[ -f "${ED}"/usr/bin/berkeley_db_svc ]] ; then
+ mv "${ED}"/usr/bin/berkeley_db_svc \
+ "${ED}"/usr/sbin/berkeley_db"${SLOT/./}"_svc || die
+ fi
+}
+
+pkg_postinst() {
+ multilib_foreach_abi db_fix_so
+}
+
+pkg_postrm() {
+ multilib_foreach_abi db_fix_so
+}
+
+src_test() {
+ # db_repsite is impossible to build, as upstream strips those sources.
+ # db_repsite is used directly in the setup_site_prog,
+ # setup_site_prog is called from open_site_prog
+ # which is called only from tests in the multi_repmgr group.
+ #sed -ri \
+ # -e '/set subs/s,multi_repmgr,,g' \
+ # "${S_BASE}/test/testparams.tcl"
+ sed -ri \
+ -e '/multi_repmgr/d' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ # This is the only failure in 5.2.28 so far, and looks like a false positive.
+ # Repmgr018 (btree): Test of repmgr stats.
+ # Repmgr018.a: Start a master.
+ # Repmgr018.b: Start a client.
+ # Repmgr018.c: Run some transactions at master.
+ # Rep_test: btree 20 key/data pairs starting at 0
+ # Rep_test.a: put/get loop
+ # FAIL:07:05:59 (00:00:00) perm_no_failed_stat: expected 0, got 1
+ sed -ri \
+ -e '/set parms.*repmgr018/d' \
+ -e 's/repmgr018//g' \
+ "${S_BASE}/test/tcl/test.tcl" || die
+
+ multilib-minimal_src_test
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || return
+
+ S=${BUILD_DIR} db_src_test
+}
diff --git a/sys-libs/db/files/db-1.85-gentoo-paths.patch b/sys-libs/db/files/db-1.85-gentoo-paths.patch
new file mode 100644
index 000000000000..4a65106bdc70
--- /dev/null
+++ b/sys-libs/db/files/db-1.85-gentoo-paths.patch
@@ -0,0 +1,29 @@
+--- PORT/linux/Makefile
++++ PORT/linux/Makefile
+@@ -1,12 +1,12 @@
+ # @(#)Makefile 8.9 (Berkeley) 7/14/94
+
+-LIBDB= libdb.a
+-LIBDBSO=libdb.so
++LIBDB= libdb1.a
++LIBDBSO=libdb1.so
+ SOVER=2
+ SONAME=$(LIBDBSO).$(SOVER)
+ LIBNDBM=libndbm.a
+ LIBNDBMSO=libndbm.so
+-PROG= db_dump185
++PROG= db1_dump185
+ OBJ1= hash.o hash_bigkey.o hash_buf.o hash_func.o hash_log2.o hash_page.o \
+ ndbm.o
+ OBJ2= bt_close.o bt_conv.o bt_debug.o bt_delete.o bt_get.o bt_open.o \
+@@ -27,8 +27,8 @@
+ DESTDIR =
+ prefix = /usr
+ bindir = $(prefix)/bin
+-libdir = $(prefix)/lib
+-includedir = $(prefix)/include
++libdir = $(prefix)/@GENTOO_LIBDIR@
++includedir = $(prefix)/include/db1
+
+ all: $(LIBDB) $(LIBDBSO) $(PROG)
+
diff --git a/sys-libs/db/files/db-3.2.9-fix-dep-link.patch b/sys-libs/db/files/db-3.2.9-fix-dep-link.patch
new file mode 100644
index 000000000000..cdf6599b0d55
--- /dev/null
+++ b/sys-libs/db/files/db-3.2.9-fix-dep-link.patch
@@ -0,0 +1,26 @@
+--- db-3.2.9/dist/Makefile.in.orig 2003-02-23 23:41:13.000000000 +0200
++++ db-3.2.9/dist/Makefile.in 2003-02-23 23:42:07.000000000 +0200
+@@ -240,19 +240,19 @@
+
+ $(libso_target): $(OBJS)
+ $(SOLINK) $(SOFLAGS) -o $(libso_target) \
+- $(OBJS) $(LDFLAGS) $(LIBSO_LIBS)
++ $(OBJS) $(LDFLAGS) $(LIBS) $(LIBSO_LIBS)
+
+ $(libxso_target): $(COBJS) $(OBJS)
+ $(SOLINK) $(SOFLAGS) -o $(libxso_target) \
+- $(COBJS) $(OBJS) $(LDFLAGS) $(LIBXSO_LIBS)
++ $(COBJS) $(OBJS) $(LDFLAGS) $(LIBS) $(LIBXSO_LIBS)
+
+ $(libjso_target): $(JOBJS) $(OBJS)
+ $(SOLINK) $(SOFLAGS) -o $(libjso_target) \
+- $(JOBJS) $(OBJS) $(LDFLAGS) $(LIBJSO_LIBS)
++ $(JOBJS) $(OBJS) $(LDFLAGS) $(LIBS) $(LIBJSO_LIBS)
+
+ $(libtso_target): $(TOBJS) $(OBJS)
+ $(SOLINK) $(SOFLAGS) -o $(libtso_target) \
+- $(TOBJS) $(OBJS) $(LDFLAGS) $(LIBTSO_LIBS)
++ $(TOBJS) $(OBJS) $(LDFLAGS) $(LIBS) $(LIBTSO_LIBS)
+
+ ##################################################
+ # Creating individual dependencies and actions for building class
diff --git a/sys-libs/db/files/db-3.2.9-gcc43.patch b/sys-libs/db/files/db-3.2.9-gcc43.patch
new file mode 100644
index 000000000000..f032da85296a
--- /dev/null
+++ b/sys-libs/db/files/db-3.2.9-gcc43.patch
@@ -0,0 +1,16 @@
+diff -Nuar db-3.2.9.orig/include/db_cxx.h db-3.2.9/include/db_cxx.h
+--- db-3.2.9.orig/include/db_cxx.h 2001-01-11 10:28:55.000000000 -0800
++++ db-3.2.9/include/db_cxx.h 2008-08-16 16:10:48.474699646 -0700
+@@ -49,7 +49,12 @@
+ // Forward declarations
+ //
+
++#if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
++using namespace std;
++#include <iostream>
++#else
+ #include <iostream.h>
++#endif
+ #include <stdarg.h>
+ #include "db.h"
+
diff --git a/sys-libs/db/files/db-4.0.14-fix-dep-link.patch b/sys-libs/db/files/db-4.0.14-fix-dep-link.patch
new file mode 100644
index 000000000000..f54f064640e6
--- /dev/null
+++ b/sys-libs/db/files/db-4.0.14-fix-dep-link.patch
@@ -0,0 +1,38 @@
+--- db-4.0.14/dist/Makefile.in.orig 2003-08-16 06:21:53.763400112 +0200
++++ db-4.0.14/dist/Makefile.in 2003-08-16 06:23:16.036892640 +0200
+@@ -58,7 +58,7 @@
+
+ LDFLAGS= @LDFLAGS@
+ LIBS= @LIBS@
+-LIBSO_LIBS= @LIBSO_LIBS@
++LIBSO_LIBS= @LIBSO_LIBS@ $(LIBS)
+
+ libdb= libdb.a
+ libso_base= libdb
+@@ -77,7 +77,7 @@
+ CXX= @MAKEFILE_CXX@
+ CXXLINK= @MAKEFILE_CXXLINK@
+ XSOLINK= @MAKEFILE_XSOLINK@
+-LIBXSO_LIBS= @LIBXSO_LIBS@
++LIBXSO_LIBS= @LIBXSO_LIBS@ $(LIBS)
+
+ libcxx= libdb_cxx.a
+ libxso_base= libdb_cxx
+@@ -93,7 +93,7 @@
+ # Java support is optional and requires shared librarires.
+ ##################################################
+ CLASSPATH= $(JAVA_CLASSTOP)
+-LIBJSO_LIBS= @LIBJSO_LIBS@
++LIBJSO_LIBS= @LIBJSO_LIBS@ $(LIBS)
+
+ JAR= @JAR@
+ JAVAC= env CLASSPATH="$(CLASSPATH)" @JAVAC@
+@@ -121,7 +121,7 @@
+ # Tcl support is optional and requires shared libraries.
+ ##################################################
+ TCFLAGS= @TCFLAGS@
+-LIBTSO_LIBS= @LIBTSO_LIBS@
++LIBTSO_LIBS= @LIBTSO_LIBS@ $(LIBS)
+ libtso_base= libdb_tcl
+ libtso= $(libtso_base)-$(SOVERSION).@SOSUFFIX@
+ libtso_static= $(libtso_base)-$(SOVERSION).a
diff --git a/sys-libs/db/files/db-4.2-jni-check-prefix-first.patch b/sys-libs/db/files/db-4.2-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..17f80e1bcfef
--- /dev/null
+++ b/sys-libs/db/files/db-4.2-jni-check-prefix-first.patch
@@ -0,0 +1,30 @@
+--- dist/aclocal_java/ac_jni_include_dirs.ac 2003-10-06 20:41:38.000000000 +0200
++++ dist/aclocal_java/ac_jni_include_dirs.ac 2005-09-23 21:31:26.000000000 +0200
+@@ -43,14 +43,19 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- _JINC="$_JTOPDIR/Headers";;
+- *) _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ _JINC="$_JTOPDIR/Headers";;
++ *) _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/files/db-4.2-libtool.patch b/sys-libs/db/files/db-4.2-libtool.patch
new file mode 100644
index 000000000000..a4a9db7f4557
--- /dev/null
+++ b/sys-libs/db/files/db-4.2-libtool.patch
@@ -0,0 +1,20 @@
+--- ./dist/configure.orig 2004-09-22 22:58:48.421632944 -0700
++++ ./dist/configure 2004-09-22 23:02:55.068136976 -0700
+@@ -5657,7 +5657,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-case `"$LD" -v 2>&1 </dev/null` in
++case `$LD -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -11135,7 +11135,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-case `"$LD" -v 2>&1 </dev/null` in
++case `$LD -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
diff --git a/sys-libs/db/files/db-4.2-listen-to-java-options.patch b/sys-libs/db/files/db-4.2-listen-to-java-options.patch
new file mode 100644
index 000000000000..8ddb46b70261
--- /dev/null
+++ b/sys-libs/db/files/db-4.2-listen-to-java-options.patch
@@ -0,0 +1,10 @@
+--- dist/configure.ac 2005-09-23 21:01:26.000000000 +0200
++++ dist/configure.ac 2005-09-23 20:59:20.000000000 +0200
+@@ -385,6 +385,7 @@
+ # A classpath that includes . is needed to check for Java
+ CLASSPATH=".:$CLASSPATH"
+ export CLASSPATH
++ AC_JAVA_OPTIONS
+ AC_PROG_JAVAC
+ AC_PROG_JAR
+ AC_PROG_JAVA
diff --git a/sys-libs/db/files/db-4.2.52_p2-TXN.patch b/sys-libs/db/files/db-4.2.52_p2-TXN.patch
new file mode 100644
index 000000000000..7ff8874c0ca8
--- /dev/null
+++ b/sys-libs/db/files/db-4.2.52_p2-TXN.patch
@@ -0,0 +1,68 @@
+This patch is intended to be applied to Berkeley DB 4.2.52 and,
+if applied, will automatically be used by slapd(8) back-bdb/hdb.
+Without this patch the BDB DB_LOG_AUTOREMOVE option will not work,
+nor will db_archive allow any transaction log files to be removed
+while slapd is running.
+
+The patch can be applied to the BDB source using patch(1) as follows
+ cd db-4.2.52
+ patch -p0 < openldap-src/build/BerkeleyDB42.patch
+
+(modify directory paths as necessary), then recompile and reinstall
+the BerkeleyDB 4.2 library, and then build and install OpenLDAP
+Software.
+
+The patch should not be applied to Berkeley DB 4.3.
+
+
+Index: dbinc/db.in
+===================================================================
+RCS file: /var/CVSROOT/bdb42/dbinc/db.in,v
+retrieving revision 1.1.1.1
+retrieving revision 1.2
+diff -u -r1.1.1.1 -r1.2
+--- dbinc/db.in 25 Nov 2003 21:58:02 -0000 1.1.1.1
++++ dbinc/db.in 17 Jul 2004 16:07:23 -0000 1.2
+@@ -839,6 +839,7 @@
+ #define TXN_NOWAIT 0x040 /* Do not wait on locks. */
+ #define TXN_RESTORED 0x080 /* Transaction has been restored. */
+ #define TXN_SYNC 0x100 /* Sync on prepare and commit. */
++#define TXN_NOLOG 0x200 /* Do not log this transaction. */
+ u_int32_t flags;
+ };
+
+Index: txn/txn.c
+===================================================================
+RCS file: /var/CVSROOT/bdb42/txn/txn.c,v
+retrieving revision 1.1.1.2
+retrieving revision 1.2
+diff -u -r1.1.1.2 -r1.2
+--- txn/txn.c 17 Dec 2003 21:43:53 -0000 1.1.1.2
++++ txn/txn.c 17 Jul 2004 16:07:27 -0000 1.2
+@@ -127,7 +127,7 @@
+ if ((ret = __db_fchk(dbenv,
+ "txn_begin", flags,
+ DB_DIRTY_READ | DB_TXN_NOWAIT |
+- DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
++ DB_TXN_NOSYNC | DB_TXN_SYNC | DB_TXN_NOT_DURABLE)) != 0)
+ return (ret);
+ if ((ret = __db_fcchk(dbenv,
+ "txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
+@@ -193,6 +193,8 @@
+ F_SET(txn, TXN_SYNC);
+ if (LF_ISSET(DB_TXN_NOWAIT))
+ F_SET(txn, TXN_NOWAIT);
++ if (LF_ISSET(DB_TXN_NOT_DURABLE))
++ F_SET(txn, TXN_NOLOG);
+
+ if ((ret = __txn_begin_int(txn, 0)) != 0)
+ goto err;
+@@ -328,7 +330,7 @@
+ * We should set this value when we write the first log record, not
+ * here.
+ */
+- if (DBENV_LOGGING(dbenv))
++ if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
+ __log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
+ else
+ ZERO_LSN(begin_lsn);
diff --git a/sys-libs/db/files/db-4.3-jni-check-prefix-first.patch b/sys-libs/db/files/db-4.3-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..17f80e1bcfef
--- /dev/null
+++ b/sys-libs/db/files/db-4.3-jni-check-prefix-first.patch
@@ -0,0 +1,30 @@
+--- dist/aclocal_java/ac_jni_include_dirs.ac 2003-10-06 20:41:38.000000000 +0200
++++ dist/aclocal_java/ac_jni_include_dirs.ac 2005-09-23 21:31:26.000000000 +0200
+@@ -43,14 +43,19 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- _JINC="$_JTOPDIR/Headers";;
+- *) _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ _JINC="$_JTOPDIR/Headers";;
++ *) _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/files/db-4.3-libtool.patch b/sys-libs/db/files/db-4.3-libtool.patch
new file mode 100644
index 000000000000..426fd519f714
--- /dev/null
+++ b/sys-libs/db/files/db-4.3-libtool.patch
@@ -0,0 +1,47 @@
+--- dist/configure.orig 2005-02-02 11:22:49.596096072 +0100
++++ dist/configure 2005-02-02 11:23:46.749407448 +0100
+@@ -5684,7 +5684,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -8461,7 +8461,7 @@
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds="$tmp_archive_cmds"
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -11383,7 +11383,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15353,7 +15353,7 @@
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds_F77="$tmp_archive_cmds"
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -17695,7 +17695,7 @@
+ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds_GCJ="$tmp_archive_cmds"
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
diff --git a/sys-libs/db/files/db-4.3-listen-to-java-options.patch b/sys-libs/db/files/db-4.3-listen-to-java-options.patch
new file mode 100644
index 000000000000..8ddb46b70261
--- /dev/null
+++ b/sys-libs/db/files/db-4.3-listen-to-java-options.patch
@@ -0,0 +1,10 @@
+--- dist/configure.ac 2005-09-23 21:01:26.000000000 +0200
++++ dist/configure.ac 2005-09-23 20:59:20.000000000 +0200
+@@ -385,6 +385,7 @@
+ # A classpath that includes . is needed to check for Java
+ CLASSPATH=".:$CLASSPATH"
+ export CLASSPATH
++ AC_JAVA_OPTIONS
+ AC_PROG_JAVAC
+ AC_PROG_JAR
+ AC_PROG_JAVA
diff --git a/sys-libs/db/files/db-4.3.27-fix-dep-link.patch b/sys-libs/db/files/db-4.3.27-fix-dep-link.patch
new file mode 100644
index 000000000000..1d14e83d078c
--- /dev/null
+++ b/sys-libs/db/files/db-4.3.27-fix-dep-link.patch
@@ -0,0 +1,38 @@
+--- db-4.3.27/dist/Makefile.in.chris 2005-02-01 23:40:34.447945464 +0100
++++ db-4.3.27/dist/Makefile.in 2005-02-01 23:42:21.635650456 +0100
+@@ -58,7 +58,7 @@
+ LDFLAGS= @LDFLAGS@
+ LIBS= @LIBS@
+ TEST_LIBS= @TEST_LIBS@
+-LIBSO_LIBS= @LIBSO_LIBS@
++LIBSO_LIBS= @LIBSO_LIBS@ $(LIBS)
+
+ libdb_base= libdb
+ libdb= $(libdb_base).a
+@@ -77,7 +77,7 @@
+ CXX= @MAKEFILE_CXX@
+ CXXLINK= @MAKEFILE_CXXLINK@ @CXXFLAGS@
+ XSOLINK= @MAKEFILE_XSOLINK@ @CXXFLAGS@
+-LIBXSO_LIBS= @LIBXSO_LIBS@
++LIBXSO_LIBS= @LIBXSO_LIBS@ $(LIBS)
+
+ libcxx_base= libdb_cxx
+ libcxx= $(libcxx_base).a
+@@ -93,7 +93,7 @@
+ # Java support is optional and requires shared librarires.
+ ##################################################
+ CLASSPATH= $(JAVA_CLASSTOP)
+-LIBJSO_LIBS= @LIBJSO_LIBS@
++LIBJSO_LIBS= @LIBJSO_LIBS@ $(LIBS)
+
+ JAR= @JAR@
+ JAVAC= env CLASSPATH="$(CLASSPATH)" @JAVAC@
+@@ -126,7 +126,7 @@
+ # Tcl support is optional and requires shared libraries.
+ ##################################################
+ TCFLAGS= @TCFLAGS@
+-LIBTSO_LIBS= @LIBTSO_LIBS@
++LIBTSO_LIBS= @LIBTSO_LIBS@ $(LIBS)
+ libtso_base= libdb_tcl
+ libtso= $(libtso_base)-$(LIBVERSION)@MODSUFFIX@
+ libtso_static= $(libtso_base)-$(LIBVERSION).a
diff --git a/sys-libs/db/files/db-4.4-libtool.patch b/sys-libs/db/files/db-4.4-libtool.patch
new file mode 100644
index 000000000000..3d86b88f86b3
--- /dev/null
+++ b/sys-libs/db/files/db-4.4-libtool.patch
@@ -0,0 +1,47 @@
+--- dist/configure.orig 2006-01-31 10:23:58.000000000 +0100
++++ dist/configure 2006-01-31 10:26:43.000000000 +0100
+@@ -5765,7 +5765,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -8753,7 +8753,7 @@
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -11855,7 +11855,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15842,7 +15842,7 @@
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -18300,7 +18300,7 @@
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
diff --git a/sys-libs/db/files/db-4.5-libtool.patch b/sys-libs/db/files/db-4.5-libtool.patch
new file mode 100644
index 000000000000..3d86b88f86b3
--- /dev/null
+++ b/sys-libs/db/files/db-4.5-libtool.patch
@@ -0,0 +1,47 @@
+--- dist/configure.orig 2006-01-31 10:23:58.000000000 +0100
++++ dist/configure 2006-01-31 10:26:43.000000000 +0100
+@@ -5765,7 +5765,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -8753,7 +8753,7 @@
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -11855,7 +11855,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15842,7 +15842,7 @@
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -18300,7 +18300,7 @@
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
diff --git a/sys-libs/db/files/db-4.6-jni-check-prefix-first.patch b/sys-libs/db/files/db-4.6-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..63735e62469f
--- /dev/null
+++ b/sys-libs/db/files/db-4.6-jni-check-prefix-first.patch
@@ -0,0 +1,30 @@
+--- dist/aclocal_java/ac_jni_include_dirs.m4 2003-10-06 20:41:38.000000000 +0200
++++ dist/aclocal_java/ac_jni_include_dirs.m4 2005-09-23 21:31:26.000000000 +0200
+@@ -43,14 +43,19 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- _JINC="$_JTOPDIR/Headers";;
+- *) _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ _JINC="$_JTOPDIR/Headers";;
++ *) _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/files/db-4.6-libtool.patch b/sys-libs/db/files/db-4.6-libtool.patch
new file mode 100644
index 000000000000..3d86b88f86b3
--- /dev/null
+++ b/sys-libs/db/files/db-4.6-libtool.patch
@@ -0,0 +1,47 @@
+--- dist/configure.orig 2006-01-31 10:23:58.000000000 +0100
++++ dist/configure 2006-01-31 10:26:43.000000000 +0100
+@@ -5765,7 +5765,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -8753,7 +8753,7 @@
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -11855,7 +11855,7 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15842,7 +15842,7 @@
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -18300,7 +18300,7 @@
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>/dev/null` in
++ case `"$LD" -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
diff --git a/sys-libs/db/files/db-4.8-libtool.patch b/sys-libs/db/files/db-4.8-libtool.patch
new file mode 100644
index 000000000000..f5d985b2f209
--- /dev/null
+++ b/sys-libs/db/files/db-4.8-libtool.patch
@@ -0,0 +1,65 @@
+--- dist/configure
++++ dist/configure
+@@ -6691,7 +6691,7 @@
+ $as_echo_n "(cached) " >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -7348,7 +7348,7 @@
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+- case $LD in
++ case "$LD" in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+@@ -10664,7 +10664,7 @@
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+- case `$LD -v 2>&1` in
++ case `"$LD" -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+@@ -10858,7 +10858,7 @@
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+- case `$LD -v 2>&1` in
++ case `"$LD" -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+@@ -12206,7 +12206,7 @@
+ libsuff= shlibsuff=
+ ;;
+ *)
+- case $LD in # libtool.m4 will add one of these switches to LD
++ case "$LD" in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+@@ -13423,7 +13423,7 @@
+ $as_echo_n "(cached) " >&6
+ else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+-case `$LD -v 2>&1 </dev/null` in
++case `"$LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+@@ -15672,7 +15672,7 @@
+ libsuff= shlibsuff=
+ ;;
+ *)
+- case $LD in # libtool.m4 will add one of these switches to LD
++ case "$LD" in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
diff --git a/sys-libs/db/files/db-4.8.24-java-manifest-location.patch b/sys-libs/db/files/db-4.8.24-java-manifest-location.patch
new file mode 100644
index 000000000000..9cebadc52064
--- /dev/null
+++ b/sys-libs/db/files/db-4.8.24-java-manifest-location.patch
@@ -0,0 +1,12 @@
+diff -Nuar db-4.8.24.orig/dist/Makefile.in db-4.8.24/dist/Makefile.in
+--- db-4.8.24.orig/dist/Makefile.in 2009-09-19 23:39:45.286001896 +0000
++++ db-4.8.24/dist/Makefile.in 2009-09-19 23:41:13.079326882 +0000
+@@ -830,7 +830,7 @@
+ $(JAVA) -classpath $(JAVA_CLASSTOP) \
+ com.sleepycat.persist.model.ClassEnhancer $(JAVA_CLASSTOP)
+ cd $(JAVA_CLASSTOP) && \
+- $(JAR) cfm ../$(libj_jarfile) ../$(JAVA_MANIFEST) ./com/sleepycat
++ $(JAR) cfm ../$(libj_jarfile) $(JAVA_MANIFEST) ./com/sleepycat
+
+ $(libj_exjarfile): $(libj_jarfile) $(JAVA_EXSRCS)
+ @test -d $(JAVA_EXCLASSTOP) || \
diff --git a/sys-libs/db/files/db-4.8.30-rename-atomic-compare-exchange.patch b/sys-libs/db/files/db-4.8.30-rename-atomic-compare-exchange.patch
new file mode 100644
index 000000000000..c53160a82970
--- /dev/null
+++ b/sys-libs/db/files/db-4.8.30-rename-atomic-compare-exchange.patch
@@ -0,0 +1,22 @@
+diff --git a/dbinc/atomic.h b/dbinc/atomic.h
+index 0034dcc..fa7ba93 100644
+--- a/dbinc/atomic.h
++++ b/dbinc/atomic.h
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define atomic_inc(env, p) __atomic_inc(p)
+ #define atomic_dec(env, p) __atomic_dec(p)
+ #define atomic_compare_exchange(env, p, o, n) \
+- __atomic_compare_exchange((p), (o), (n))
++ __db_atomic_compare_exchange((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ int temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+ * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+ * which configure could be changed to use.
+ */
+-static inline int __atomic_compare_exchange(
++static inline int __db_atomic_compare_exchange(
+ db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ atomic_value_t was;
diff --git a/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch b/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch
new file mode 100644
index 000000000000..ad3da2786c88
--- /dev/null
+++ b/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch
@@ -0,0 +1,22 @@
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index 0034dcc..fa7ba93 100644
+--- a/src/dbinc/atomic.h
++++ b/src/dbinc/atomic.h
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define atomic_inc(env, p) __atomic_inc(p)
+ #define atomic_dec(env, p) __atomic_dec(p)
+ #define atomic_compare_exchange(env, p, o, n) \
+- __atomic_compare_exchange((p), (o), (n))
++ __db_atomic_compare_exchange((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ int temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+ * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+ * which configure could be changed to use.
+ */
+-static inline int __atomic_compare_exchange(
++static inline int __db_atomic_compare_exchange(
+ db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ atomic_value_t was;
diff --git a/sys-libs/db/files/db-5.2.28-sqlite-configure-path.patch b/sys-libs/db/files/db-5.2.28-sqlite-configure-path.patch
new file mode 100644
index 000000000000..ff7abbe1fd79
--- /dev/null
+++ b/sys-libs/db/files/db-5.2.28-sqlite-configure-path.patch
@@ -0,0 +1,12 @@
+diff -Nuar db-5.2.28.orig//dist/aclocal/sql.m4 db-5.2.28//dist/aclocal/sql.m4
+--- db-5.2.28.orig//dist/aclocal/sql.m4 2011-06-10 09:50:45.000000000 -0700
++++ db-5.2.28//dist/aclocal/sql.m4 2011-07-15 17:02:54.646521189 -0700
+@@ -91,7 +91,7 @@
+ # !!! END COPIED from autoconf distribution
+
+ sqlite_dir=$srcdir/../lang/sql/sqlite
+-(cd sql && eval "\$SHELL ../$sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline" && cat build_config.h >> config.h) || exit 1
++(cd sql && eval "\$SHELL $sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline" && cat build_config.h >> config.h) || exit 1
+
+ # Configure JDBC if --enable-jdbc
+ if test "$db_cv_jdbc" != "no"; then
diff --git a/sys-libs/db/files/db-6.0.20-test-link.patch b/sys-libs/db/files/db-6.0.20-test-link.patch
new file mode 100644
index 000000000000..8aceaa4d6f8c
--- /dev/null
+++ b/sys-libs/db/files/db-6.0.20-test-link.patch
@@ -0,0 +1,38 @@
+diff -Nuar db-6.0.20.orig/test/tcl/parallel.tcl db-6.0.20/test/tcl/parallel.tcl
+--- db-6.0.20.orig/test/tcl/parallel.tcl 2013-07-04 15:49:43.408348040 +0000
++++ db-6.0.20/test/tcl/parallel.tcl 2013-07-04 17:40:07.147943377 +0000
+@@ -289,16 +289,26 @@
+ [eval glob -nocomplain {$dir/$buildpath/db_{reptest,repsite,replicate}$EXE}] \
+ $destdir/$buildpath}
+ }
++ catch {
++ set l [eval glob {$dir/.libs} {$dir/db_{checkpoint,deadlock}$EXE} \
++ {$dir/db_{dump,load,printlog,recover,stat,upgrade}$EXE} \
++ {$dir/db_{archive,verify,hotbackup,log_verify}$EXE}]
++ foreach fn $l {
++ set fbasename [file tail $fn]
++ eval file link {$destdir/$fbasename} $fn
++ }
++ }
++ # we will be modifying this file, so we must copy, not link
+ catch {eval file copy \
+- [eval glob {$dir/{.libs,include.tcl}}] $destdir}
++ [eval glob {$dir/include.tcl}] $destdir}
+ # catch {eval file copy $dir/$queuedir $destdir}
+- catch {eval file copy \
+- [eval glob {$dir/db_{checkpoint,deadlock}$EXE} \
+- {$dir/db_{dump,load,printlog,recover,stat,upgrade}$EXE} \
+- {$dir/db_{archive,verify,hotbackup,log_verify}$EXE}] \
+- $destdir}
+- catch {eval file copy \
+- [eval glob -nocomplain {$dir/db_{reptest,repsite,replicate}$EXE}] $destdir}
++ catch {
++ set l [eval glob -nocomplain {$dir/db_{reptest,repsite,replicate}$EXE}]
++ foreach fn $l {
++ set fbasename [file tail $fn]
++ eval file link {$destdir/$fbasename} $fn
++ }
++ }
+
+ # Create modified copies of include.tcl in parallel
+ # directories so paths still work.
diff --git a/sys-libs/db/files/db-6.0.35-sqlite-configure-path.patch b/sys-libs/db/files/db-6.0.35-sqlite-configure-path.patch
new file mode 100644
index 000000000000..c239bb118a82
--- /dev/null
+++ b/sys-libs/db/files/db-6.0.35-sqlite-configure-path.patch
@@ -0,0 +1,11 @@
+--- db-6.0.35/dist/aclocal/sql.m4
++++ db-6.0.35/dist/aclocal/sql.m4
+@@ -96,7 +96,7 @@
+ if test "$db_cv_build_cryptography" = "yes"; then
+ CPPFLAGS="$CPPFLAGS -DSQLITE_HAS_CODEC=1"
+ fi
+-(cd sql && eval "\$SHELL ../$sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline " && cat build_config.h >> config.h) || exit 1
++(cd sql && eval "\$SHELL $sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline " && cat build_config.h >> config.h) || exit 1
+
+ # Configure JDBC if --enable-jdbc
+ if test "$db_cv_jdbc" != "no"; then
diff --git a/sys-libs/db/files/db-6.1.19-sqlite-configure-path.patch b/sys-libs/db/files/db-6.1.19-sqlite-configure-path.patch
new file mode 100644
index 000000000000..25854c53e160
--- /dev/null
+++ b/sys-libs/db/files/db-6.1.19-sqlite-configure-path.patch
@@ -0,0 +1,10 @@
+--- db-6.1.19/dist/aclocal/sql.m4
++++ db-6.1.19/dist/aclocal/sql.m4
+@@ -96,6 +96,6 @@
+ if test "$db_cv_build_cryptography" = "yes"; then
+ CPPFLAGS="$CPPFLAGS -DSQLITE_HAS_CODEC=1"
+ fi
+-(cd sql && eval "\$SHELL ../$sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline " && cat build_config.h >> config.h) || exit 1
++(cd sql && eval "\$SHELL $sqlite_dir/configure --disable-option-checking $ac_sub_configure_args CPPFLAGS=\"-I.. $CPPFLAGS\" --enable-amalgamation=$db_cv_sql_amalgamation --enable-readline=$with_readline " && cat build_config.h >> config.h) || exit 1
+
+ # Configure JDBC if --enable-jdbc
diff --git a/sys-libs/db/files/db-6.2-jni-check-prefix-first.patch b/sys-libs/db/files/db-6.2-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..963b01380c23
--- /dev/null
+++ b/sys-libs/db/files/db-6.2-jni-check-prefix-first.patch
@@ -0,0 +1,38 @@
+--- db-6.2.23/dist/aclocal_java/ac_jni_include_dirs.m4
++++ db-6.2.23/dist/aclocal_java/ac_jni_include_dirs.m4
+@@ -43,18 +43,23 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- if test -d "$_JTOPDIR/include"; then
+- _JINC="$_JTOPDIR/include"
+- else
+- _JINC="$_JTOPDIR/Headers"
+- fi;;
+- *) _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ if test -d "$_JTOPDIR/include"; then
++ _JINC="$_JTOPDIR/include"
++ else
++ _JINC="$_JTOPDIR/Headers"
++ fi;;
++ *) _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/files/db-6.2.32-jni-check-prefix-first.patch b/sys-libs/db/files/db-6.2.32-jni-check-prefix-first.patch
new file mode 100644
index 000000000000..0a320d7f9336
--- /dev/null
+++ b/sys-libs/db/files/db-6.2.32-jni-check-prefix-first.patch
@@ -0,0 +1,44 @@
+--- db-6.2.32/dist/aclocal_java/ac_jni_include_dirs.m4
++++ db-6.2.32/dist/aclocal_java/ac_jni_include_dirs.m4
+@@ -43,21 +43,26 @@
+ *) AC_MSG_ERROR([$_ACJNI_JAVAC is not an absolute path name]);;
+ esac
+
+-_ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
+-_JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
+-case "$host_os" in
+- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- if test -d "$_JTOPDIR/include"; then
+- _JINC="$_JTOPDIR/include"
+- else
+- _JINC="`$_JTOPDIR/Commands/java_home`/include"
+- fi;;
+- *) if test ! -r "$_JTOPDIR/include/jni.h"; then
+- _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+- fi
+- _JINC="$_JTOPDIR/include";;
+-esac
+-
++# If JAVAPREFIX is defined, look there first
++if test -r "$JAVAPREFIX/include/jni.h"; then
++ _JTOPDIR="$JAVAPREFIX"
++ _JINC="$JAVAPREFIX/include"
++else
++ _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
++ _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
++ case "$host_os" in
++ darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ if test -d "$_JTOPDIR/include"; then
++ _JINC="$_JTOPDIR/include"
++ else
++ _JINC="`$_JTOPDIR/Commands/java_home`/include"
++ fi;;
++ *) if test ! -r "$_JTOPDIR/include/jni.h"; then
++ _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
++ fi
++ _JINC="$_JTOPDIR/include";;
++ esac
++fi
+ # If we find jni.h in /usr/include, then it's not a java-only tree, so
+ # don't add /usr/include or subdirectories to the list of includes.
+ # An extra -I/usr/include can foul things up with newer gcc's.
diff --git a/sys-libs/db/metadata.xml b/sys-libs/db/metadata.xml
new file mode 100644
index 000000000000..19c65222929a
--- /dev/null
+++ b/sys-libs/db/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<longdescription>
+The Berkeley Database (Berkeley DB) is a programmatic toolkit
+that provides embedded database support for both traditional and client/server
+applications. Berkeley DB includes b+tree, queue, extended linear hashing,
+fixed, and variable-length record access methods, transactions, locking,
+logging, shared memory caching and database recovery. DB supports C, C++, Java,
+and Perl APIs. DB is available for a wide variety of UNIX platforms as well as
+Windows NT and Windows '95 (MSVC 4, 5 and 6).
+</longdescription>
+<longdescription lang="nl">
+De Berkeley Database is een programmatische toolkit
+die embedded database support verzorg voor en traditionele en client/server
+applicaties. Berkeley DB bevat b+tree, rij, uitgebreide lineaire hashing, vaste
+en variabele lengte record toegangsmethoden, transacties, locking, logging,
+gedeeld geheugen caching en database herstel. DB ondersteund C, C++, Java en
+Perl API's. DB is beschikbaar voor veel UNIX platformen en
+Windows.
+</longdescription>
+<use>
+ <flag name="rpc">Enable rpc client/server</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-libs/e2fsprogs-libs/Manifest b/sys-libs/e2fsprogs-libs/Manifest
new file mode 100644
index 000000000000..e2bc9f31b20c
--- /dev/null
+++ b/sys-libs/e2fsprogs-libs/Manifest
@@ -0,0 +1,10 @@
+AUX e2fsprogs-libs-1.42.13-fix-build-cflags.patch 300 SHA256 6d8b58c49e5b830df986576142fc3816907ea94fcc048ebd3f9aa65589b50b5a SHA512 0c0a39a7cdf1930c2c8da0072f935eb02e15ce7a5202990b4ee5458a4ba7a5c1848a7b759e91e32c76f38ea419059179b04ff94fa336cbf77e4ecde55f9dc1d3 WHIRLPOOL c371a68c8b79a568f9e74811fb7ee0e15292fa109cbf17a4b308fcae3a7a6d2ba53da8cc0c3f95e9ee13a2c1b67f9be8739cff1a29d1488ba4ccddc554996010
+DIST e2fsprogs-libs-1.43.3.tar.gz 599387 SHA256 157d90e8482753d3bebe03e8d6a4688a751c1f8b0847ba4aff8627c288fa9d31 SHA512 a1a5c01be1d020d858b958694747ba4f35032cd55bff71078cfddc31a818790ce4ead25fcf5e2aceca42c0faaf1635b6d8e3a2c7b87caac7f6fbbe5a44ceb411 WHIRLPOOL 2d82e8bac810aff56435785d8e345b3c4bef2483cb508b2c4168c7801feb10f5d573f67058f705a9b03e63ba889ef9a02e983831f31649cefe1a73d66f511dac
+DIST e2fsprogs-libs-1.43.5.tar.gz 602292 SHA256 da19f849d313158523d76bc950fd0fc33bda1f3e2b687e465a47c9468eb9058b SHA512 9bb99251dcec8ef3128dd1eecd2d2885566581328e875d0ef641856080aa92dcdaa86d858ecc09f153bdc83a8280fa5ddcf96dce3ce6247adc17b555b80eb171 WHIRLPOOL 55f088066a57dd120da0a615635cf588edcfb0fbb7524d928860a616f028b498e810897e4e4ed91cde7a514a99a9c257c9f294edb79bc3156c24b1a17ef2506a
+DIST e2fsprogs-libs-1.43.6.tar.gz 595409 SHA256 74366864feec30c73621efe43afa1c412af613af3dca912cf86472ca27586dc8 SHA512 80a643ba349aac79c88548e9692066f777c5f9e82e309b348606a8078de456171535e6e5df91f73ca3db9d03bb539b1a19883cf74615357bdf77f3bd20cc0b11 WHIRLPOOL 7264bc369ac8c7f1a04df84e7270b5d030a55696d1f13056763d7d1c01a57a10461534a70ae442f4ab6e3f2c28b1b4af98ac33ee2c0e791eb4d21efe8ed25dda
+EBUILD e2fsprogs-libs-1.43.3.ebuild 1866 SHA256 6fab0890c66bdfce0172b516a9e4c69802f0ee8bdae665cf86cd31ba6f15844d SHA512 d3b5cd55e334010d636fe72f5ec54b8ef4383327b242bb4be9bb496107c96d0cf83f47886dae2f915b4f7b6d9f53595b0effe7911a74770e18a20321c272dc60 WHIRLPOOL 446b44e802ac761f4f6c44b44b77a4bf132856343e07c563089643a0c79e4e3f62af5bef202784b68d710a88c99b88c5ef9cf00dfca1deab9d9e96653bf6b5bf
+EBUILD e2fsprogs-libs-1.43.5.ebuild 1864 SHA256 53acc760e7f89e5e6e9da81c571c5355098a0785924b8c335f292e303f14825f SHA512 50f0993a527c7f75747615272875ef4f2d74799242c389fa8258e6dfcd0f86d29706bf12b8dd29be1de39bfcf49627ee991dc15d217c182fb66b54ffd97c0d97 WHIRLPOOL 3792e55806ce30e8a54f4dedfb8c1491de4521a64f9ff7f1e0cd3934a85be4b9d61433563e430a94a9adf00395ea0c3fd57a4b128731834b5ea0c659fc4a53bd
+EBUILD e2fsprogs-libs-1.43.6.ebuild 1864 SHA256 53acc760e7f89e5e6e9da81c571c5355098a0785924b8c335f292e303f14825f SHA512 50f0993a527c7f75747615272875ef4f2d74799242c389fa8258e6dfcd0f86d29706bf12b8dd29be1de39bfcf49627ee991dc15d217c182fb66b54ffd97c0d97 WHIRLPOOL 3792e55806ce30e8a54f4dedfb8c1491de4521a64f9ff7f1e0cd3934a85be4b9d61433563e430a94a9adf00395ea0c3fd57a4b128731834b5ea0c659fc4a53bd
+MISC ChangeLog 6196 SHA256 d619dda283d2dcb1e59d1894762c4076679c679e1b107ac9d18605f9df11426e SHA512 ff37c2e6b7f7de8f5cc9136c014ee78995783f4156aa460b5ed55ca6f2f90fb70f986521bd6945f34d1df514cf143d73aeb4e989335b5c41770bd09670c40134 WHIRLPOOL 05c04c3286946f8de76749870cb40b97c1eaf7912c3d5bf5058865a7e4dc4597fe97127116ed6bf3382d36f3c1b55758e6c28c51782fa13607c1d8d822ec63b7
+MISC ChangeLog-2015 21687 SHA256 fe736cc78afebb966f4972c2825f3aebc646d2b2a5b7058a6f5d9152bcd81778 SHA512 6e1654ab6dd1d4dedad962ba2dc17ef8e8ca76635e7cbb578d3cfe914e51187c2e1f149b8e6fd1b40e5fe04f81d4329c9121c8b328f2706365a38951d577809e WHIRLPOOL bac584d14ef35e4941d858c129fc7aac819aef60e8aacf0de45cb695926d50cb1c4abde308e64a570500ab8b8c9bbc39044b8d83e89961e2adb19f672a6ff46f
+MISC metadata.xml 329 SHA256 ebb8a44b3a063c96b9de50cdb8c3b981bc8f7c579d858e3b47dc5395b11f9d86 SHA512 39e1ddf508b648594e45cd4e72a41997ab4ae7b5cfdefa136a18a1e68ac5a2bfb1f6a12328f1faee5501fbeff0c61cd91417de717c4869f530a18a05ea5d4c71 WHIRLPOOL 8818fd931c002a52014c8629207e25ac26e06e2e51e303691ebe2b935e47d46bb9973a336c691f37cc964fbf2d1182b175fe2ab34cb5c481688ad7d0df85d6d7
diff --git a/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.3.ebuild b/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.3.ebuild
new file mode 100644
index 000000000000..96f2b453d10b
--- /dev/null
+++ b/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.3.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+case ${PV} in
+*_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;;
+*) UP_PV=${PV} ;;
+esac
+
+inherit toolchain-funcs eutils multilib-minimal
+
+DESCRIPTION="e2fsprogs libraries (common error and subsystem)"
+HOMEPAGE="http://e2fsprogs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/e2fsprogs/${PN}-${UP_PV}.tar.gz
+ mirror://kernel/linux/kernel/people/tytso/e2fsprogs/v${UP_PV}/${PN}-${UP_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~m68k-mint ~x86-solaris"
+IUSE="nls static-libs"
+
+RDEPEND="!sys-libs/com_err
+ !sys-libs/ss
+ !<sys-fs/e2fsprogs-1.41.8"
+DEPEND="nls? ( sys-devel/gettext )
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${P%_pre*}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch #516854
+)
+
+src_prepare() {
+ printf 'all:\n%%:;@:\n' > doc/Makefile.in # don't bother with docs #305613
+ epatch "${PATCHES[@]}"
+}
+
+multilib_src_configure() {
+ local myconf=()
+ # we use blkid/uuid from util-linux now
+ if use kernel_linux ; then
+ export ac_cv_lib_{uuid_uuid_generate,blkid_blkid_get_cache}=yes
+ myconf+=( --disable-lib{blkid,uuid} )
+ fi
+ ac_cv_path_LDCONFIG=: \
+ ECONF_SOURCE="${S}" \
+ CC="$(tc-getCC)" \
+ BUILD_CC="$(tc-getBUILD_CC)" \
+ BUILD_LD="$(tc-getBUILD_LD)" \
+ econf \
+ $(tc-is-static-only || echo --enable-elf-shlibs) \
+ $(tc-has-tls || echo --disable-tls) \
+ $(use_enable nls) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake V=1
+}
+
+multilib_src_install() {
+ emake V=1 STRIP=: DESTDIR="${D}" install || die
+ gen_usr_ldscript -a com_err ss $(usex kernel_linux '' 'uuid blkid')
+ # configure doesn't have an option to disable static libs :/
+ use static-libs || find "${ED}" -name '*.a' -delete
+}
diff --git a/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.5.ebuild b/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.5.ebuild
new file mode 100644
index 000000000000..2368a1eda153
--- /dev/null
+++ b/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.5.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+case ${PV} in
+*_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;;
+*) UP_PV=${PV} ;;
+esac
+
+inherit toolchain-funcs eutils multilib-minimal
+
+DESCRIPTION="e2fsprogs libraries (common error and subsystem)"
+HOMEPAGE="http://e2fsprogs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/e2fsprogs/${PN}-${UP_PV}.tar.gz
+ mirror://kernel/linux/kernel/people/tytso/e2fsprogs/v${UP_PV}/${PN}-${UP_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~m68k-mint ~x86-solaris"
+IUSE="nls static-libs"
+
+RDEPEND="!sys-libs/com_err
+ !sys-libs/ss
+ !<sys-fs/e2fsprogs-1.41.8"
+DEPEND="nls? ( sys-devel/gettext )
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${P%_pre*}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch #516854
+)
+
+src_prepare() {
+ printf 'all:\n%%:;@:\n' > doc/Makefile.in # don't bother with docs #305613
+ default
+}
+
+multilib_src_configure() {
+ local myconf=()
+ # we use blkid/uuid from util-linux now
+ if use kernel_linux ; then
+ export ac_cv_lib_{uuid_uuid_generate,blkid_blkid_get_cache}=yes
+ myconf+=( --disable-lib{blkid,uuid} )
+ fi
+ ac_cv_path_LDCONFIG=: \
+ ECONF_SOURCE="${S}" \
+ CC="$(tc-getCC)" \
+ BUILD_CC="$(tc-getBUILD_CC)" \
+ BUILD_LD="$(tc-getBUILD_LD)" \
+ econf \
+ $(tc-is-static-only || echo --enable-elf-shlibs) \
+ $(tc-has-tls || echo --disable-tls) \
+ $(use_enable nls) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake V=1
+}
+
+multilib_src_install() {
+ emake V=1 STRIP=: DESTDIR="${D}" install || die
+ gen_usr_ldscript -a com_err ss $(usex kernel_linux '' 'uuid blkid')
+ # configure doesn't have an option to disable static libs :/
+ use static-libs || find "${ED}" -name '*.a' -delete
+}
diff --git a/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.6.ebuild b/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.6.ebuild
new file mode 100644
index 000000000000..2368a1eda153
--- /dev/null
+++ b/sys-libs/e2fsprogs-libs/e2fsprogs-libs-1.43.6.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+case ${PV} in
+*_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;;
+*) UP_PV=${PV} ;;
+esac
+
+inherit toolchain-funcs eutils multilib-minimal
+
+DESCRIPTION="e2fsprogs libraries (common error and subsystem)"
+HOMEPAGE="http://e2fsprogs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/e2fsprogs/${PN}-${UP_PV}.tar.gz
+ mirror://kernel/linux/kernel/people/tytso/e2fsprogs/v${UP_PV}/${PN}-${UP_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~m68k-mint ~x86-solaris"
+IUSE="nls static-libs"
+
+RDEPEND="!sys-libs/com_err
+ !sys-libs/ss
+ !<sys-fs/e2fsprogs-1.41.8"
+DEPEND="nls? ( sys-devel/gettext )
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${P%_pre*}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch #516854
+)
+
+src_prepare() {
+ printf 'all:\n%%:;@:\n' > doc/Makefile.in # don't bother with docs #305613
+ default
+}
+
+multilib_src_configure() {
+ local myconf=()
+ # we use blkid/uuid from util-linux now
+ if use kernel_linux ; then
+ export ac_cv_lib_{uuid_uuid_generate,blkid_blkid_get_cache}=yes
+ myconf+=( --disable-lib{blkid,uuid} )
+ fi
+ ac_cv_path_LDCONFIG=: \
+ ECONF_SOURCE="${S}" \
+ CC="$(tc-getCC)" \
+ BUILD_CC="$(tc-getBUILD_CC)" \
+ BUILD_LD="$(tc-getBUILD_LD)" \
+ econf \
+ $(tc-is-static-only || echo --enable-elf-shlibs) \
+ $(tc-has-tls || echo --disable-tls) \
+ $(use_enable nls) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake V=1
+}
+
+multilib_src_install() {
+ emake V=1 STRIP=: DESTDIR="${D}" install || die
+ gen_usr_ldscript -a com_err ss $(usex kernel_linux '' 'uuid blkid')
+ # configure doesn't have an option to disable static libs :/
+ use static-libs || find "${ED}" -name '*.a' -delete
+}
diff --git a/sys-libs/e2fsprogs-libs/files/e2fsprogs-libs-1.42.13-fix-build-cflags.patch b/sys-libs/e2fsprogs-libs/files/e2fsprogs-libs-1.42.13-fix-build-cflags.patch
new file mode 100644
index 000000000000..a87f0c697eab
--- /dev/null
+++ b/sys-libs/e2fsprogs-libs/files/e2fsprogs-libs-1.42.13-fix-build-cflags.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/516854
+
+--- e2fsprogs-libs-1.42.13/configure
++++ e2fsprogs-libs-1.42.13/configure
+@@ -1315,6 +1315,8 @@
+ if test $cross_compiling = no; then
+ BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H"
+ BUILD_LDFLAGS="$LDFLAGS"
++else
++ BUILD_CFLAGS="$INCLUDES"
+ fi
+
+
diff --git a/sys-libs/e2fsprogs-libs/metadata.xml b/sys-libs/e2fsprogs-libs/metadata.xml
new file mode 100644
index 000000000000..fb37f7ff1115
--- /dev/null
+++ b/sys-libs/e2fsprogs-libs/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">e2fsprogs</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/efivar/Manifest b/sys-libs/efivar/Manifest
new file mode 100644
index 000000000000..32400f0c4c56
--- /dev/null
+++ b/sys-libs/efivar/Manifest
@@ -0,0 +1,7 @@
+DIST efivar-30.tar.bz2 73202 SHA256 1f5720a9434ddb29a5cb8213e4e3973e212d90eff95dd9b173a5444f48b5128b SHA512 0a6d7175762011c3fc67b531d3d19a45e82195c729b9ff498be02b3a6a73f6c3c4f9e14a27470c6744b741d7d54db9ef24c7882639af25fca1034b7b9f641b39 WHIRLPOOL 66e3aa3243a34d9a0305e12caa58a187434a61777cc87c3c0ded403c9aa0383da9b8c56bdb974246c6d43602fbb569f5294bc5e1bb1e07e282714ffb0d84507e
+DIST efivar-31.tar.bz2 82404 SHA256 d891958a5a762a43371987c46ca112ba506a26312d4969e6871d77acb5ea787e SHA512 5055f690fd99cf59895dcf3d11103494d917d4923567626f0bee816ea5e4dd56cec23627ede5f21bdc57b7306522471ad19cc8ab22ae94591dbd1925c084f163 WHIRLPOOL 2ee42eeb8121dc83fc14cf4f3130ff913e54a8efb992a13e672ddb6666ab571a4440f02f8545a3ea4aefbafe90d387e26e8159d0e6f9c4c7b323f4569f4cc78c
+EBUILD efivar-30.ebuild 954 SHA256 075f7020f6751aef3bf968ee3522b6aae7ca7783153b935f3303d65bfcf292d4 SHA512 75253eb96dbe9ad28a0f12e4ea46a92a49cfd4b5c1749c812b6ac1ae355336b28c0a28a819b97f5ad9d55936ebde29f5e82b68b9dc819fba92bad7afd44881c0 WHIRLPOOL 5121613ceb229ddfa6b9f291693961593964431223174fa9333b8a514e77cfadf47a8288839da169b9817305476e7c391db0e60f9cacf6a4b403f9fb75777b36
+EBUILD efivar-31.ebuild 810 SHA256 1925771764a63c829514e54da46227ef71ed68fad1e74c47148168272f4728d2 SHA512 88bee0eb65013e8b674b0720d5af80ae31051b8fb004b0dd0e4fd65f7ac66ee8326ef6687e43deedac50dce1d64e5f4f2867fef786d8b4a16e7924335d5b8d67 WHIRLPOOL f72b2df1c62b005847db2427b473f4e19bc65396054a7a46fe786203ce2d9917e86c5367767b38d8450972d8f38ff444d9e941e93f9bc598337f9038596527f8
+MISC ChangeLog 5093 SHA256 a7e3e89cd86e8ad9cac2ed75c7acc58e26ea86a1bcad2dd59f4bafd007a74353 SHA512 1c762c73aaafcb54493d2c999563bece398c2a0a1779f9a1b08849f1c26c2b38c4cca8773f977112c286bca9d403319b0facf1fd215c730ab5c2932425084f2d WHIRLPOOL 7956e84bb38f194dc89bd0216971a67dc52dfb9f7294b318c79f36a306fdf69e00abbbb1b154f4a602384d3c8f728eafe4d139f31cc98f9286f18b8f43e3fa83
+MISC ChangeLog-2015 1400 SHA256 19acadd29d4ade26e28eb1b3c90b53fe7bd656c994429ddd2c0210a5c4781ef7 SHA512 a3ddd6f45f6b7d7f29435fea17bd76448dcaed5d15f06aa8e8824d7e1a92848c2ef19204cac4201c4a940103d6f874148f3e9b1726af99c9c778dab5f09598bc WHIRLPOOL 9a685232976e2381e39f103e98fb3df05c0c9ac1ef48ef063f5a2dbab414cd6de464bc775a8d9890cf1f9f2aafe2c102e16ac9c22e04d938f0039c2fcd319bed
+MISC metadata.xml 329 SHA256 562af8ae9d4eac40cd37ccea2827ecb766176649c836296a10a75dddc4446181 SHA512 a349c5ce7e3ad96d816b52ee35e6547bfb1f4cf9ebd60426ac90b84d67adb0728ab9dcccf93754ad7c71614b0fbd82a1a02fc3fde07e15d12d960d1a7fc088df WHIRLPOOL b6c568a210bf85aea3dffae55d3f861fae101047b431b9ed64f60a61ac5b76d4866d63298a8a11e42f78c013388bc932b1fdd73d44a82fa2476138f2521f3444
diff --git a/sys-libs/efivar/efivar-30.ebuild b/sys-libs/efivar/efivar-30.ebuild
new file mode 100644
index 000000000000..b50a9b12bb88
--- /dev/null
+++ b/sys-libs/efivar/efivar-30.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Tools and library to manipulate EFI variables"
+HOMEPAGE="https://github.com/rhinstaller/efivar"
+SRC_URI="https://github.com/rhinstaller/efivar/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0/1"
+KEYWORDS="amd64 ~arm64 ia64 x86"
+
+RDEPEND="dev-libs/popt"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-3.18
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ default
+ sed -i -e s/-Werror// gcc.specs || die
+}
+
+src_configure() {
+ tc-export CC
+
+ # https://github.com/rhinstaller/efivar/issues/64
+ append-cflags -flto
+
+ tc-ld-disable-gold
+ export libdir="/usr/$(get_libdir)"
+ unset LIBS # Bug 562004
+}
+
+src_compile() {
+ # Avoid building static binary/libs
+ opts=(
+ BINTARGETS=efivar
+ STATICLIBTARGETS=
+ )
+ emake "${opts[@]}"
+}
+
+src_install() {
+ emake "${opts[@]}" DESTDIR="${D}" install
+}
diff --git a/sys-libs/efivar/efivar-31.ebuild b/sys-libs/efivar/efivar-31.ebuild
new file mode 100644
index 000000000000..0700f0bd2935
--- /dev/null
+++ b/sys-libs/efivar/efivar-31.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Tools and library to manipulate EFI variables"
+HOMEPAGE="https://github.com/rhinstaller/efivar"
+SRC_URI="https://github.com/rhinstaller/efivar/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0/1"
+KEYWORDS="~amd64 ~arm64 ~ia64 ~x86"
+
+RDEPEND="dev-libs/popt"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-3.18
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ default
+ sed -i -e s/-Werror// gcc.specs || die
+}
+
+src_configure() {
+ tc-export CC
+ tc-ld-disable-gold
+ export libdir="/usr/$(get_libdir)"
+ unset LIBS # Bug 562004
+
+ if [[ -n ${GCC_SPECS} ]]; then
+ # The environment overrides the command line.
+ GCC_SPECS+=":${S}/gcc.specs"
+ fi
+}
diff --git a/sys-libs/efivar/metadata.xml b/sys-libs/efivar/metadata.xml
new file mode 100644
index 000000000000..f9d83d4843a1
--- /dev/null
+++ b/sys-libs/efivar/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 type="person">
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">rhinstaller/efivar</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/fortify-headers/Manifest b/sys-libs/fortify-headers/Manifest
new file mode 100644
index 000000000000..8b3d44214397
--- /dev/null
+++ b/sys-libs/fortify-headers/Manifest
@@ -0,0 +1,8 @@
+DIST fortify-headers-0.6.tar.gz 5339 SHA256 e3baedbd1a2ca612faf83f3c87c50eeb33b31c663948cfb3ca04300751d86b68 SHA512 6106219332515e7c23354d916383cdac6efccba7eefa13b0c2c221d0fd03be7afb29b3a8622bd29b62ee0b602f9d1f273e1a08c07583bdcd12db9938ef4d7acc WHIRLPOOL 833aa8df26e1e28ec064ba0592dab42ee63e8fe794d095085ed544c7232855646790257c9b1c4d3a4af34873de9b1fcce222c3f665da3221c36ca5130cc88bc7
+DIST fortify-headers-0.7.tar.gz 5524 SHA256 683ac9ae7bddb2975a2a76c9b09f432097928c8dfe8561c0aabf69f90f30920d SHA512 9335d5042f973904cf131d4894c71d3d25c84e82427500064a4ed3f798abd8051c3b52375a17c807ca89227115fa5ba9922939f0e86059a9f04fee61f0b69e53 WHIRLPOOL 05eba07d6b22d0b3717f9c74a79310f9202379560901eea09ffe56bdf9987371c1882e2885431d13ca1a8ceb9f0e436c3b41bd2b7a7031094629a6133f4a7af8
+EBUILD fortify-headers-0.6.ebuild 624 SHA256 0df06d04f998bebebbe4fc8448fb5662795f9fe2819cb67493099e77b39ac508 SHA512 f0bb74781d447038dc2f61e0f19f7d6c6eefc97c347f582dd4b4baad13170b35a8677a440716bb02198c0982c80c4b588df366ec62b3976002382c2b0730621f WHIRLPOOL 0134539a9ea4ac7ea45f595a341d092dd33cdc91db7c63bf4cc28f663037832fc853424d360ca59d3f9a077c957df394204dfe5cb0460c0e46d3c8cf96e3dda2
+EBUILD fortify-headers-0.7.ebuild 624 SHA256 0df06d04f998bebebbe4fc8448fb5662795f9fe2819cb67493099e77b39ac508 SHA512 f0bb74781d447038dc2f61e0f19f7d6c6eefc97c347f582dd4b4baad13170b35a8677a440716bb02198c0982c80c4b588df366ec62b3976002382c2b0730621f WHIRLPOOL 0134539a9ea4ac7ea45f595a341d092dd33cdc91db7c63bf4cc28f663037832fc853424d360ca59d3f9a077c957df394204dfe5cb0460c0e46d3c8cf96e3dda2
+EBUILD fortify-headers-9999.ebuild 624 SHA256 0df06d04f998bebebbe4fc8448fb5662795f9fe2819cb67493099e77b39ac508 SHA512 f0bb74781d447038dc2f61e0f19f7d6c6eefc97c347f582dd4b4baad13170b35a8677a440716bb02198c0982c80c4b588df366ec62b3976002382c2b0730621f WHIRLPOOL 0134539a9ea4ac7ea45f595a341d092dd33cdc91db7c63bf4cc28f663037832fc853424d360ca59d3f9a077c957df394204dfe5cb0460c0e46d3c8cf96e3dda2
+MISC ChangeLog 2755 SHA256 1422a47b08cc211b67a74e77206172f2ffc136a93c167f4908383e923bf94e56 SHA512 6ab6e175b6bdf051693882e3232b40f86f034c22f4d492d20d0d54c5e9cfc60b1b21cc4b397c512cbadf2614d1a9d64b1b11bb84e73568301a05327d6e41bea3 WHIRLPOOL e60ead510d1a93f7be68fa9886df739f0e5f10a7779f1b6a31454f5d34efa7974766dad7daf2a812e63b1033e926cf88b60e20a2a5187e6e96c22aade6779323
+MISC ChangeLog-2015 735 SHA256 6b54c55a06665d7f20b44f565e25f4684cf18c1dacc05463415bf234d171afae SHA512 2e1042dc413cf3620ed045411a825cd4c567eaf277549fb7ba8bfcf30247c9bb40e582058029f9eded59fdf4e657993ff1b39c28b78c8494341dac9d55b73e12 WHIRLPOOL 41ae6460e68201b7449294b8535936cb525736dcab9bb03cfd7dda4319d45f2690f6650d56daf60aa667b7b7015a287e21cd28cd2d3a0721f3d9a79ae57d8313
+MISC metadata.xml 252 SHA256 a590e5133cd97a615db4f977b0e28e5c60c56cac76eb3d339109cdf379003b60 SHA512 cbda7bf9832872764ae776ce16b2966c37a2ba3a1982d9817006fd6b82d7b17146434cde428bf114062a483e9053d2acdcdd004695e6ebf428d19cdc09937c65 WHIRLPOOL b209a730a169969b9e3c4d4612368bc5b30bfa5fae275d98d83ba96fd0ad01d308a8fed4f7d67a7c9fa417c624dfeb23ce89ab58923a8a0b5b1bd68ee73f288c
diff --git a/sys-libs/fortify-headers/fortify-headers-0.6.ebuild b/sys-libs/fortify-headers/fortify-headers-0.6.ebuild
new file mode 100644
index 000000000000..fccc550aeab3
--- /dev/null
+++ b/sys-libs/fortify-headers/fortify-headers-0.6.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.2f30.org/fortify-headers"
+ inherit git-2
+else
+ SRC_URI="http://git.2f30.org/fortify-headers/snapshot/fortify-headers-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+DESCRIPTION="A standalone implementation of fortify source."
+HOMEPAGE="http://git.2f30.org/fortify-headers/"
+
+LICENSE="ISC"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i -e 's|^PREFIX = /usr/local|PREFIX = /usr|g' Makefile
+ export DESTDIR="${D}"
+}
diff --git a/sys-libs/fortify-headers/fortify-headers-0.7.ebuild b/sys-libs/fortify-headers/fortify-headers-0.7.ebuild
new file mode 100644
index 000000000000..fccc550aeab3
--- /dev/null
+++ b/sys-libs/fortify-headers/fortify-headers-0.7.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.2f30.org/fortify-headers"
+ inherit git-2
+else
+ SRC_URI="http://git.2f30.org/fortify-headers/snapshot/fortify-headers-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+DESCRIPTION="A standalone implementation of fortify source."
+HOMEPAGE="http://git.2f30.org/fortify-headers/"
+
+LICENSE="ISC"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i -e 's|^PREFIX = /usr/local|PREFIX = /usr|g' Makefile
+ export DESTDIR="${D}"
+}
diff --git a/sys-libs/fortify-headers/fortify-headers-9999.ebuild b/sys-libs/fortify-headers/fortify-headers-9999.ebuild
new file mode 100644
index 000000000000..fccc550aeab3
--- /dev/null
+++ b/sys-libs/fortify-headers/fortify-headers-9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.2f30.org/fortify-headers"
+ inherit git-2
+else
+ SRC_URI="http://git.2f30.org/fortify-headers/snapshot/fortify-headers-${PV}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+DESCRIPTION="A standalone implementation of fortify source."
+HOMEPAGE="http://git.2f30.org/fortify-headers/"
+
+LICENSE="ISC"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i -e 's|^PREFIX = /usr/local|PREFIX = /usr|g' Makefile
+ export DESTDIR="${D}"
+}
diff --git a/sys-libs/fortify-headers/metadata.xml b/sys-libs/fortify-headers/metadata.xml
new file mode 100644
index 000000000000..d920e3ba3e56
--- /dev/null
+++ b/sys-libs/fortify-headers/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 type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/freeipmi/Manifest b/sys-libs/freeipmi/Manifest
new file mode 100644
index 000000000000..96af89a1c58c
--- /dev/null
+++ b/sys-libs/freeipmi/Manifest
@@ -0,0 +1,19 @@
+AUX bmc-watchdog.confd 1495 SHA256 0f9cbe8090523e3fd4df35fb049d38ee696292892542ff6ffe3139e39fb1795e SHA512 11bbd920eb67a64a9d3742e860ae146c1a00398f44d4cead49f8f6070f46a09249c05bb647a1b7bf2c4c6c78e1ae393b2e52395f640bc7e5139aade7c99b45b2 WHIRLPOOL 00910dca8b0aaa2f321010f6ac3897ce1cc974749073273db731d112d5a7ef833771bdc90945d0ddfd4f230176aa1e14eb954216c4be67a551ccdb6166247ec3
+AUX bmc-watchdog.initd.4 404 SHA256 8a6601e9f613b02b2b82da69788018a86e559b2663c70908eec8a1feeed41bd7 SHA512 2b9c38713d66adce3f8ff95551d2588ffbda62190077578b02aaf890651eff23f6acc6a7ab41efa8efdca4447c9aa466d0ad59a76e3b05443fd423eff06b4071 WHIRLPOOL 1a1bf08076bd8471cf719fc0ca5f09b7ada5db99a68ec964b0c2b500f86fd27bdf8fd739afc04670cb9a579042a3c780f15c26f89a150c8361e5fddea9d083a7
+AUX freeipmi-1.1.1-strictaliasing.patch 587 SHA256 3f571021a288e62d8d1c537ca15d49d64d92d7c422d451387ec9996c74aca45e SHA512 a8b4dae48cfd767f35d5d2eb39f1ff8c831dce2d03428d2a7ceb371122bded9c85abdee53ece26099af3ad03f90e86871f6c3c9b854de2e7d575a6e618ff0302 WHIRLPOOL a198b7720764466c1d42784f4bc7ad81cc401510120fb0783c53138dafe0f0ae63614ea91f04b88816fdcd7c787f4c1264e55c271d9339d7df31de386498ba5f
+AUX freeipmi.icinga 117 SHA256 ffa3f35d00df5ec38eb82b82062ab1d79778064052e42b0f2f0103fc6dfbc178 SHA512 813aeebe5e663073f3bce7917b35c6ec493f5222bb759d47238aa2b382459661a90165b0bd3a74c2e6e1940d373eccb43ab03a4270d2d2c91a03be361ce46032 WHIRLPOOL 388453b1b1f15a57023739e03297512afecb2cb50dd1f5f46c56cc810f3923ef698da05aba55dfac5b0bd6b3ad1e8f34ee4347a2b4cb458fc70f2ca148a87fef
+AUX ipmidetectd.confd 185 SHA256 6265782b53083c5d6332ac015b580b8f76426dac62ef58e32eb5b2fc74446891 SHA512 f10e908a451c646b2c61338d79e69663c05216a54093745bd2b659041e0b91adb9be4077c92d63f6f3d62cb5510168b6a57e5e86375533e235fd3abb2b72a49c WHIRLPOOL 7236f10b61e6b0ddbba0d2359ce459dedb5bad187f91588116f33ebff8091c6871d7bfb8242001a9d8ecee7f32078e0bb747810fe078b7f2c3d2a34b3d35df61
+AUX ipmiseld.confd 192 SHA256 bc520fa47e690a72e658d183c47b59e68c7e11a875719f2cf65c88042fe0cee7 SHA512 0a031f29a4692085054d5fc2dfe6d0ad7fb762f7ee96849ce2d562a90d6e3b0f3ae8328ab852dc22bee6221bc5cd8b588bd02075222038fa0f0e2f64ac185799 WHIRLPOOL 482cfad90bcdf0ec6f56a8435f020e625209c0bdf45da6c612d7ae6b45e79d6fe960c0186235fcba816c05fbf2d83aa9275647496e8e1e996ae809466544bc8f
+DIST freeipmi-1.2.2.tar.gz 3031730 SHA256 c8539a8225616e3e647b99903ef1243c5a6a4e1c7bd009399bd8bacf3b263b9c SHA512 86ea9a073ec275b3594e93c7e7fdef2b7214dcd3e696fdec4a017841d4bb7e2179a407d91aa11b26c952cf5b06262801b41293642ed38220d57112a37878a5f4 WHIRLPOOL 763a46cea7bfd1a5e18fae79094a73bd86173a73a8b8d150b3f938bc51c8da6c18db5105ece7ca8f3821254de19bc4e2b2429aac66b260c36426f789be176243
+DIST freeipmi-1.4.3.tar.gz 3089282 SHA256 2d8701555f7fd5c3cdc0186e2e435d2ed7945047d22b66088f1e5417dcc35386 SHA512 88a2dec70696017407aac313628407200ee2c6600547fbff73c6880ae8d65cda166c8e00e0f4b7eaddc35f4376143b8fdb0b4ac284aba401c2592a95804e6cec WHIRLPOOL 36c05750f58d018768c82b2a9531892c8c933a7f7b92ea4513dd3527d27494993f82b59d621558bc2975585f51bc6b555b85e246bec1e79704947ac7591cf08b
+DIST freeipmi-1.4.8.tar.gz 3185068 SHA256 9fa7e9df7f848445cf6035b26b4167a79711ecc05d8e96ab16bbec10b36e551b SHA512 3cd4acde402bbc945b007e31e7f8dad3ad4539d2cf00310e9168d7cec8024203a280c8ad91e3f08b86dfa9be536779969c5393c4523df2fe8eb904f765fcfc56 WHIRLPOOL ae4393fd36271238597f1602fbaaa6c975268291d26ae3303d9bb1b447cc40070ff4c66ac56a7c301f0544f69ab54eb49a9c6f81fdbdc83ab4d89f3f253b3701
+DIST freeipmi-1.5.6.tar.gz 3321440 SHA256 2b1abdc455ffb0e5017cf4d669f549079d3559ad57a73677611e76cec5a06c5c SHA512 2a33c4068af03be5d99a9a0098ded3177bedbc1b71df14c2ba67d40012bee6791388947b0dc552433feb9098753182d62a84f43af6036fbfbd06a7f277ef8b6a WHIRLPOOL 2a70667240d45cd750d0589417e730d7732c9fd77998aced0f210415f8e9dfed4e1f14ab66f1bad9a108b719a766a5dbd5290bd9d980db17ec12e5bae86e3d3c
+DIST freeipmi-1.5.7.tar.gz 3321187 SHA256 b46c9432e8649b87d4646bbf4da32f7e9039796fc256f4b229c94c3ac7d0bde5 SHA512 a4d39d11d4e4b9635c272ee3a197729ac61c3e1c909c202498fb480c41289116eb933cd716fe2e0b5aa6dc258751ee204892bfb009398b6d5c2c65ee1cc58544 WHIRLPOOL 40a70aeef0be622ad39d10f6a850d26f34f5517bdf99d1ed5dcc04d1c3029edfe99e0a071df914bcc5bd1f4324245b9eb57e91b34eebcd5efa003e17fad21fd0
+EBUILD freeipmi-1.2.2.ebuild 2085 SHA256 9e9f0fde2538e5838b0090bab8277b72da5da3e281032cc281136e783cb25686 SHA512 914e6107bf10437251484d1ed134595544148dda1aff4ea95b1c5fa5be22cfb1ff1f79ae79f3bf683b78e52e822c0a4c8faac70bf2b29ba7866114955862f78a WHIRLPOOL 5deeee4ebfa8520ad37ea5372ae93864c910050c60c8a505bf9f1548447ea33dce2ea5a88e272c5cdf6343a38d1f70904564405485b9b8d42ff78bed45c84f04
+EBUILD freeipmi-1.4.3.ebuild 2522 SHA256 2688ce0008b51fe360f252ae983b3ef8d44fe9e484f3df09d4d471984cef989a SHA512 9432d9aa0889d773b38e8ba017c9d018f41cc5c0be777c1fd6a0689d70820800a7044ba5f20d41fa0da71916a198edde6f958a79bd3c93fb0d78c7870cf8ceab WHIRLPOOL 29ea30c23957d27062ccc162e4df7946769c8f6ce7e66cbe4769b505baade1ae98e38febe64aef4bca03ddaee98dc677d8c6095f5ef450e2beee67b4024ea048
+EBUILD freeipmi-1.4.8.ebuild 2450 SHA256 cc3907af41b4be87ce2c53649d65a3782ee177941d664d3b6b1109eb22093703 SHA512 0b753e237c2268ccbaa2424e050ffbaf5aa6ffb018d7a9baf1d108d5bd57ce137b6b1becf9c2bb485884fa77961b9ae87dc7bab8f9b6f4458f9d73693c1f9e70 WHIRLPOOL 6c829112a2b087ff43a1691f2cf130088fe710cbb9513f66078a029ed6cab273351388c1b53dc074bb606cbf84487b5d579fb18b5f9457e1ecf11cce53b291ec
+EBUILD freeipmi-1.5.6.ebuild 2386 SHA256 f4a5eae6ce6c7cdf023183c98b8df6c62e7c12d8233b6131b84378a1b2ea2067 SHA512 825cde0fece7cca0676cd51274b4e4364c406c3b7c247dca9a0c495b3eda9fd40fdd1f353500c7e306a0c9aa48ee77ef148d42da4e5a39d2090604b6c2d215a2 WHIRLPOOL 95722028963d54654ab5331b42de05f4368da94a5ac6a48b0c4d747667a92c3e02436a94ea1bb04d870465705d73b9c35007d027dcec0ff0fa85f8ff60f08a8c
+EBUILD freeipmi-1.5.7.ebuild 2385 SHA256 659337eab950f1ac3e16124c8b1eae65f987c67e644fae26e84d7d15b17af8cc SHA512 0b6c15e88f9bcb17f5c37f6704fd4feda4761e5d528711ee042de00d93874770395eb4dbbb0ae975b72caddcc0218e6c62c21c6a018837b97b6568b7c91667e0 WHIRLPOOL b4d30de9b426f6d04d1286677f7c92930d34475969d5364e2bb06ee9cfbb624ed844343a8709f181fdca1b6e1d1caba39aa489106112a84cdd65283322119172
+MISC ChangeLog 5461 SHA256 58ff579e9e93f60f63eb4feb00142c3f2f40f20c3760683d7a1754e97118f830 SHA512 0050ec858a9df7d72c335547397aae3b3ffe462d1f3d865800e8e5062c22373cf5d6eb52a0a0accb8f898cbda6c4bd00262904f1a1ce5162e6a225347e45ded8 WHIRLPOOL 8d49ed1f1f4619bc17f9ed3548d0cc6732ecd4fb2ed441266474db336c6c3b5865f376e6cc2092d19513c12fe24bcab6529d8b9de2d8dc7c490b9a77c35ddbad
+MISC ChangeLog-2015 15375 SHA256 1876db56d002390911125c374ab054e1edcb38d1acd1bef61f3f19a758387613 SHA512 8628321136d2fcb97c35fafb74bc7c844636cdeff850a9aea3860a7fab03d15098bdf45827c606f696b3062a52663958779be9bb40c5bf6b27f7fc11a55f4e4a WHIRLPOOL daf03ebd14b84abb4539dcc5684babc061aef35d3e8d95c8f335d1197b030c0180e2fb08897b791591b02927cb7b4b1173c88f9ade51743ae5ca6a7a818c5f34
+MISC metadata.xml 376 SHA256 6a38653a9f1cd7230352dfc459ca8db06e27823298f8586b87c07aef60591461 SHA512 10922a1b392edce6cdb447eb2a06694570a88f765fd49eb7f154deed1cb3a33901c68ff1881f3068ae212ba6182c61e598e7ab7d4d683602f4016adc3ca7d7e8 WHIRLPOOL e047477bc197dc466e7b136a8b8274a9421c567079bbe679f5d648ddd69a0cffdd6b4a31383d19dc732aa884225207ee50827937d00f39ee15cc2568b8999238
diff --git a/sys-libs/freeipmi/files/bmc-watchdog.confd b/sys-libs/freeipmi/files/bmc-watchdog.confd
new file mode 100644
index 000000000000..4d39cf4d8b7d
--- /dev/null
+++ b/sys-libs/freeipmi/files/bmc-watchdog.confd
@@ -0,0 +1,44 @@
+#
+# This configuration file controls the behaviour of the bmc-watchdog daemon
+# from FreeIPMI.
+#
+# -u INT, --timer-use=INT
+# Set timer use. The timer use value can be set to one of the
+# following: 1 = BIOS FRB2, 2 = BIOS POST, 3 = OS_LOAD, 4 = SMS
+# OS, 5 = OEM.
+#
+# -p INT, --pre-timeout-interrupt=INT
+# Set pre-timeout interrupt. The pre timeout interrupt can be set
+# to one of the following: 0 = None, 1 = SMI, 2 = NMI, 3 = Messag-
+# ing Interrupt.
+#
+# -a INT, --timeout-action=INT
+# Set timeout action. The timeout action can be set to one of the
+# following: 0 = No action, 1 = Hard Reset, 2 = Power Down, 3 =
+# Power Cycle.
+#
+# -F, --clear-bios-frb2
+# Clear BIOS FRB2 Timer Use Flag.
+#
+# -P, --clear-bios-post
+# Clear BIOS POST Timer Use Flag.
+#
+# -L, --clear-os-load
+# Clear OS Load Timer Use Flag.
+#
+# -S, --clear-sms-os
+# Clear SMS/OS Timer Use Flag.
+#
+# -O, --clear-oem
+# Clear OEM Timer Use Flag.
+#
+# -i SECS, --initial-countdown=SECS
+# Set initial countdown in seconds.
+#
+# -e, --reset-period
+# Time interval to wait before resetting timer. The default is 60
+# seconds.
+#
+# For the remaining options, consult man bmc-watchdog
+#
+OPTIONS="-d -u 4 -p 0 -a 1 -F -P -L -S -O -i 900 -e 60"
diff --git a/sys-libs/freeipmi/files/bmc-watchdog.initd.4 b/sys-libs/freeipmi/files/bmc-watchdog.initd.4
new file mode 100644
index 000000000000..e0f8bf02c045
--- /dev/null
+++ b/sys-libs/freeipmi/files/bmc-watchdog.initd.4
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="condrestart"
+description_condrestart="Restart the service only if started already"
+
+command="/usr/sbin/${SVCNAME}"
+command_args="${OPTIONS}"
+pidfile=/var/run/$SVCNAME.pid
+
+depend() {
+ need localmount
+ use logger
+}
+
+condrestart() {
+ service_started && restart
+}
diff --git a/sys-libs/freeipmi/files/freeipmi-1.1.1-strictaliasing.patch b/sys-libs/freeipmi/files/freeipmi-1.1.1-strictaliasing.patch
new file mode 100644
index 000000000000..ecbb77f216fb
--- /dev/null
+++ b/sys-libs/freeipmi/files/freeipmi-1.1.1-strictaliasing.patch
@@ -0,0 +1,13 @@
+diff -Nuar freeipmi-1.1.1.orig/libfreeipmi/Makefile.am freeipmi-1.1.1/libfreeipmi/Makefile.am
+--- freeipmi-1.1.1.orig/libfreeipmi/Makefile.am 2012-01-02 19:26:00.000000000 +0000
++++ freeipmi-1.1.1/libfreeipmi/Makefile.am 2012-01-21 20:26:26.957801741 +0000
+@@ -25,7 +25,8 @@
+ -DIPMI_IPCKEY=\"$(localstatedir)/lib/$(PACKAGE_NAME)/ipckey\" \
+ -DIPMI_DEBUG_IPCKEY=\"$(top_builddir)/libfreeipmi/driver/ipmi-semaphores.h\" \
+ -D_GNU_SOURCE \
+- -D_REENTRANT
++ -D_REENTRANT \
++ -fno-strict-aliasing
+
+ libfreeipmi_la_LDFLAGS = \
+ -version-info @LIBFREEIPMI_VERSION_INFO@ $(VERSION_FLAGS) \
diff --git a/sys-libs/freeipmi/files/freeipmi.icinga b/sys-libs/freeipmi/files/freeipmi.icinga
new file mode 100644
index 000000000000..4c4026c72b87
--- /dev/null
+++ b/sys-libs/freeipmi/files/freeipmi.icinga
@@ -0,0 +1,4 @@
+define command {
+ command_name nagios_ipmi_sensors
+ command_line $USER1$/nagios_ipmi_sensors.pl -h $HOSTADDRESS$
+}
diff --git a/sys-libs/freeipmi/files/ipmidetectd.confd b/sys-libs/freeipmi/files/ipmidetectd.confd
new file mode 100644
index 000000000000..74245f14c0c5
--- /dev/null
+++ b/sys-libs/freeipmi/files/ipmidetectd.confd
@@ -0,0 +1,5 @@
+# This configuration file controls the behaviour of the ipmid daemon
+# from FreeIPMI.
+# See `man 8 ipmitdetectd` for further information.
+
+# OPTIONS="-c /etc/freeipmi/ipmidetectd.conf"
diff --git a/sys-libs/freeipmi/files/ipmiseld.confd b/sys-libs/freeipmi/files/ipmiseld.confd
new file mode 100644
index 000000000000..8e40a5c0c8dc
--- /dev/null
+++ b/sys-libs/freeipmi/files/ipmiseld.confd
@@ -0,0 +1,5 @@
+# This configuration file controls the behaviour of the ipmiseld daemon
+# from FreeIPMI.
+# See `man 8 ipmiseld` for further information.
+
+# OPTIONS="--config-file /etc/freeipmi/ipmiseld.conf"
diff --git a/sys-libs/freeipmi/freeipmi-1.2.2.ebuild b/sys-libs/freeipmi/freeipmi-1.2.2.ebuild
new file mode 100644
index 000000000000..46c2d33103fe
--- /dev/null
+++ b/sys-libs/freeipmi/freeipmi-1.2.2.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit autotools eutils
+
+DESCRIPTION="Provides Remote-Console and System Management Software as per IPMI v1.5/2.0"
+HOMEPAGE="https://www.gnu.org/software/freeipmi/"
+
+MY_P="${P/_/.}"
+S="${WORKDIR}"/${MY_P}
+[[ ${MY_P} == *.beta* ]] && ALPHA="-alpha"
+SRC_URI="mirror://gnu${ALPHA}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+RDEPEND="dev-libs/libgcrypt:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+RDEPEND="${RDEPEND}
+ sys-apps/openrc"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-1.1.1-strictaliasing.patch
+
+ AT_M4DIR="config" eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ --disable-dependency-tracking \
+ --enable-fast-install \
+ --disable-static \
+ --disable-init-scripts \
+ --localstatedir=/var
+}
+
+# There are no tests
+src_test() { :; }
+
+src_install() {
+ emake DESTDIR="${D}" docdir="/usr/share/doc/${PF}" install
+ find "${D}" -name '*.la' -delete
+
+ # freeipmi by defaults install _all_ commands to /usr/sbin, but
+ # quite a few can be run remotely as standard user, so move them
+ # in /usr/bin afterwards.
+ dodir /usr/bin
+ for file in ipmi{detect,ping,power,console}; do
+ mv "${D}"/usr/{s,}bin/${file} || die
+
+ # The default install symlinks these commands to add a dash
+ # after the ipmi prefix; we repeat those after move for
+ # consistency.
+ rm "${D}"/usr/sbin/${file/ipmi/ipmi-}
+ dosym ${file} /usr/bin/${file/ipmi/ipmi-}
+ done
+
+ dodoc AUTHORS ChangeLog* DISCLAIMER* NEWS README* TODO doc/*.txt
+
+ keepdir \
+ /var/cache/ipmimonitoringsdrcache \
+ /var/lib/freeipmi \
+ /var/log/ipmiconsole
+
+ # starting from version 1.2.0 the two daemons are similar enough
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmidetectd
+ newconfd "${FILESDIR}"/ipmidetectd.confd ipmidetectd
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 bmc-watchdog
+ newconfd "${FILESDIR}"/bmc-watchdog.confd bmc-watchdog
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmiseld
+ newconfd "${FILESDIR}"/ipmiseld.confd ipmiseld
+}
diff --git a/sys-libs/freeipmi/freeipmi-1.4.3.ebuild b/sys-libs/freeipmi/freeipmi-1.4.3.ebuild
new file mode 100644
index 000000000000..5eb32e80ba34
--- /dev/null
+++ b/sys-libs/freeipmi/freeipmi-1.4.3.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils multilib autotools-utils
+
+DESCRIPTION="Provides Remote-Console and System Management Software as per IPMI v1.5/2.0"
+HOMEPAGE="https://www.gnu.org/software/freeipmi/"
+
+MY_P="${P/_/.}"
+S="${WORKDIR}"/${MY_P}
+[[ ${MY_P} == *.beta* ]] && ALPHA="-alpha"
+SRC_URI="mirror://gnu${ALPHA}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~x86"
+IUSE="debug nagios"
+
+RDEPEND="dev-libs/libgcrypt:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+RDEPEND="${RDEPEND}
+ nagios? (
+ || ( net-analyzer/icinga net-analyzer/nagios )
+ dev-lang/perl
+ )
+ sys-apps/openrc"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.1.1-strictaliasing.patch
+
+ AT_M4DIR="config" eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable debug)
+ --disable-static
+ --disable-init-scripts
+ --localstatedir=/var
+ )
+
+ autotools-utils_src_configure
+}
+
+# There are no tests
+src_test() { :; }
+
+src_install() {
+ autotools-utils_src_install
+
+ # freeipmi by defaults install _all_ commands to /usr/sbin, but
+ # quite a few can be run remotely as standard user, so move them
+ # in /usr/bin afterwards.
+ dodir /usr/bin
+ for file in ipmi{detect,ping,power,console}; do
+ mv "${D}"/usr/{s,}bin/${file} || die
+
+ # The default install symlinks these commands to add a dash
+ # after the ipmi prefix; we repeat those after move for
+ # consistency.
+ rm "${D}"/usr/sbin/${file/ipmi/ipmi-}
+ dosym ${file} /usr/bin/${file/ipmi/ipmi-}
+ done
+
+ # Install the nagios plugin in its proper place, if desired
+ if use nagios; then
+ dodir /usr/$(get_libdir)/nagios/plugins
+ mv "${D}"/usr/share/doc/${PF}/contrib/nagios/nagios_ipmi_sensors.pl \
+ "${D}"/usr/$(get_libdir)/nagios/plugins/ || die
+ fperms 0755 /usr/$(get_libdir)/nagios/plugins/nagios_ipmi_sensors.pl
+
+ insinto /etc/icinga/conf.d
+ newins "${FILESDIR}"/freeipmi.icinga freeipmi-command.cfg
+ fi
+
+ dodoc AUTHORS ChangeLog* DISCLAIMER* NEWS README* TODO doc/*.txt
+
+ keepdir \
+ /var/cache/ipmimonitoringsdrcache \
+ /var/lib/freeipmi \
+ /var/log/ipmiconsole
+
+ # starting from version 1.2.0 the two daemons are similar enough
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmidetectd
+ newconfd "${FILESDIR}"/ipmidetectd.confd ipmidetectd
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 bmc-watchdog
+ newconfd "${FILESDIR}"/bmc-watchdog.confd bmc-watchdog
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmiseld
+ newconfd "${FILESDIR}"/ipmiseld.confd ipmiseld
+}
diff --git a/sys-libs/freeipmi/freeipmi-1.4.8.ebuild b/sys-libs/freeipmi/freeipmi-1.4.8.ebuild
new file mode 100644
index 000000000000..0d42117b146b
--- /dev/null
+++ b/sys-libs/freeipmi/freeipmi-1.4.8.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+#AUTOTOOLS_AUTORECONF=1
+AT_M4DIR="config"
+
+inherit eutils multilib autotools-utils
+
+DESCRIPTION="Provides Remote-Console and System Management Software as per IPMI v1.5/2.0"
+HOMEPAGE="https://www.gnu.org/software/freeipmi/"
+
+MY_P="${P/_/.}"
+S="${WORKDIR}"/${MY_P}
+[[ ${MY_P} == *.beta* ]] && ALPHA="-alpha"
+SRC_URI="mirror://gnu${ALPHA}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug nagios"
+
+RDEPEND="dev-libs/libgcrypt:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+RDEPEND="${RDEPEND}
+ nagios? (
+ || ( net-analyzer/icinga net-analyzer/nagios )
+ dev-lang/perl
+ )
+ sys-apps/openrc"
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable debug)
+ --disable-static
+ --disable-init-scripts
+ --localstatedir=/var
+ )
+
+ autotools-utils_src_configure
+}
+
+# There are no tests
+src_test() { :; }
+
+src_install() {
+ autotools-utils_src_install
+
+ # freeipmi by defaults install _all_ commands to /usr/sbin, but
+ # quite a few can be run remotely as standard user, so move them
+ # in /usr/bin afterwards.
+ dodir /usr/bin
+ for file in ipmi{detect,ping,power,console}; do
+ mv "${D}"/usr/{s,}bin/${file} || die
+
+ # The default install symlinks these commands to add a dash
+ # after the ipmi prefix; we repeat those after move for
+ # consistency.
+ rm "${D}"/usr/sbin/${file/ipmi/ipmi-}
+ dosym ${file} /usr/bin/${file/ipmi/ipmi-}
+ done
+
+ # Install the nagios plugin in its proper place, if desired
+ if use nagios; then
+ dodir /usr/$(get_libdir)/nagios/plugins
+ mv "${D}"/usr/share/doc/${PF}/contrib/nagios/nagios_ipmi_sensors.pl \
+ "${D}"/usr/$(get_libdir)/nagios/plugins/ || die
+ fperms 0755 /usr/$(get_libdir)/nagios/plugins/nagios_ipmi_sensors.pl
+
+ insinto /etc/icinga/conf.d
+ newins "${FILESDIR}"/freeipmi.icinga freeipmi-command.cfg
+ fi
+
+ dodoc AUTHORS ChangeLog* DISCLAIMER* NEWS README* TODO doc/*.txt
+
+ keepdir \
+ /var/cache/ipmimonitoringsdrcache \
+ /var/lib/freeipmi \
+ /var/log/ipmiconsole
+
+ # starting from version 1.2.0 the two daemons are similar enough
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmidetectd
+ newconfd "${FILESDIR}"/ipmidetectd.confd ipmidetectd
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 bmc-watchdog
+ newconfd "${FILESDIR}"/bmc-watchdog.confd bmc-watchdog
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmiseld
+ newconfd "${FILESDIR}"/ipmiseld.confd ipmiseld
+}
diff --git a/sys-libs/freeipmi/freeipmi-1.5.6.ebuild b/sys-libs/freeipmi/freeipmi-1.5.6.ebuild
new file mode 100644
index 000000000000..d5be2c966fd2
--- /dev/null
+++ b/sys-libs/freeipmi/freeipmi-1.5.6.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+AT_M4DIR="config"
+
+inherit eutils multilib
+
+DESCRIPTION="Provides Remote-Console and System Management Software as per IPMI v1.5/2.0"
+HOMEPAGE="https://www.gnu.org/software/freeipmi/"
+
+MY_P="${P/_/.}"
+S="${WORKDIR}"/${MY_P}
+[[ ${MY_P} == *.beta* ]] && ALPHA="-alpha"
+SRC_URI="mirror://gnu${ALPHA}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug nagios"
+
+RDEPEND="dev-libs/libgcrypt:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+RDEPEND="${RDEPEND}
+ nagios? (
+ || ( net-analyzer/icinga net-analyzer/nagios )
+ dev-lang/perl
+ )
+ sys-apps/openrc"
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable debug)
+ --disable-static
+ --disable-init-scripts
+ --localstatedir=/var
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+# There are no tests
+src_test() { :; }
+
+src_install() {
+ default
+
+ # freeipmi by defaults install _all_ commands to /usr/sbin, but
+ # quite a few can be run remotely as standard user, so move them
+ # in /usr/bin afterwards.
+ dodir /usr/bin
+ for file in ipmi{detect,ping,power,console}; do
+ mv "${D}"/usr/{s,}bin/${file} || die
+
+ # The default install symlinks these commands to add a dash
+ # after the ipmi prefix; we repeat those after move for
+ # consistency.
+ rm "${D}"/usr/sbin/${file/ipmi/ipmi-}
+ dosym ${file} /usr/bin/${file/ipmi/ipmi-}
+ done
+
+ # Install the nagios plugin in its proper place, if desired
+ if use nagios; then
+ dodir /usr/$(get_libdir)/nagios/plugins
+ mv "${D}"/usr/share/doc/${PF}/contrib/nagios/nagios_ipmi_sensors.pl \
+ "${D}"/usr/$(get_libdir)/nagios/plugins/ || die
+ fperms 0755 /usr/$(get_libdir)/nagios/plugins/nagios_ipmi_sensors.pl
+
+ insinto /etc/icinga/conf.d
+ newins "${FILESDIR}"/freeipmi.icinga freeipmi-command.cfg
+ fi
+
+ dodoc AUTHORS ChangeLog* DISCLAIMER* NEWS README* TODO doc/*.txt
+
+ keepdir \
+ /var/cache/ipmimonitoringsdrcache \
+ /var/lib/freeipmi \
+ /var/log/ipmiconsole
+
+ # starting from version 1.2.0 the two daemons are similar enough
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmidetectd
+ newconfd "${FILESDIR}"/ipmidetectd.confd ipmidetectd
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 bmc-watchdog
+ newconfd "${FILESDIR}"/bmc-watchdog.confd bmc-watchdog
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmiseld
+ newconfd "${FILESDIR}"/ipmiseld.confd ipmiseld
+}
diff --git a/sys-libs/freeipmi/freeipmi-1.5.7.ebuild b/sys-libs/freeipmi/freeipmi-1.5.7.ebuild
new file mode 100644
index 000000000000..a8485cef9b1b
--- /dev/null
+++ b/sys-libs/freeipmi/freeipmi-1.5.7.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+AT_M4DIR="config"
+
+inherit eutils multilib
+
+DESCRIPTION="Provides Remote-Console and System Management Software as per IPMI v1.5/2.0"
+HOMEPAGE="https://www.gnu.org/software/freeipmi/"
+
+MY_P="${P/_/.}"
+S="${WORKDIR}"/${MY_P}
+[[ ${MY_P} == *.beta* ]] && ALPHA="-alpha"
+SRC_URI="mirror://gnu${ALPHA}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug nagios"
+
+RDEPEND="dev-libs/libgcrypt:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+RDEPEND="${RDEPEND}
+ nagios? (
+ || ( net-analyzer/icinga net-analyzer/nagios )
+ dev-lang/perl
+ )
+ sys-apps/openrc"
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable debug)
+ --disable-static
+ --disable-init-scripts
+ --localstatedir=/var
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+# There are no tests
+src_test() { :; }
+
+src_install() {
+ default
+
+ # freeipmi by defaults install _all_ commands to /usr/sbin, but
+ # quite a few can be run remotely as standard user, so move them
+ # in /usr/bin afterwards.
+ dodir /usr/bin
+ for file in ipmi{detect,ping,power,console}; do
+ mv "${D}"/usr/{s,}bin/${file} || die
+
+ # The default install symlinks these commands to add a dash
+ # after the ipmi prefix; we repeat those after move for
+ # consistency.
+ rm "${D}"/usr/sbin/${file/ipmi/ipmi-}
+ dosym ${file} /usr/bin/${file/ipmi/ipmi-}
+ done
+
+ # Install the nagios plugin in its proper place, if desired
+ if use nagios; then
+ dodir /usr/$(get_libdir)/nagios/plugins
+ mv "${D}"/usr/share/doc/${PF}/contrib/nagios/nagios_ipmi_sensors.pl \
+ "${D}"/usr/$(get_libdir)/nagios/plugins/ || die
+ fperms 0755 /usr/$(get_libdir)/nagios/plugins/nagios_ipmi_sensors.pl
+
+ insinto /etc/icinga/conf.d
+ newins "${FILESDIR}"/freeipmi.icinga freeipmi-command.cfg
+ fi
+
+ dodoc AUTHORS ChangeLog* DISCLAIMER* NEWS README* TODO doc/*.txt
+
+ keepdir \
+ /var/cache/ipmimonitoringsdrcache \
+ /var/lib/freeipmi \
+ /var/log/ipmiconsole
+
+ # starting from version 1.2.0 the two daemons are similar enough
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmidetectd
+ newconfd "${FILESDIR}"/ipmidetectd.confd ipmidetectd
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 bmc-watchdog
+ newconfd "${FILESDIR}"/bmc-watchdog.confd bmc-watchdog
+
+ newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmiseld
+ newconfd "${FILESDIR}"/ipmiseld.confd ipmiseld
+}
diff --git a/sys-libs/freeipmi/metadata.xml b/sys-libs/freeipmi/metadata.xml
new file mode 100644
index 000000000000..8ed4f6ed5e53
--- /dev/null
+++ b/sys-libs/freeipmi/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 type="project">
+ <email>sysadmin@gentoo.org</email>
+ <name>Gentoo Sysadmin Project</name>
+ </maintainer>
+
+ <use>
+ <flag name="nagios">
+ Install a nagios plugin to check sensors' status.
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/fts-standalone/Manifest b/sys-libs/fts-standalone/Manifest
new file mode 100644
index 000000000000..98ecba9cb32a
--- /dev/null
+++ b/sys-libs/fts-standalone/Manifest
@@ -0,0 +1,7 @@
+DIST fts-0.2.tar.gz 339498 SHA256 4ee5db6449dc0fa4a83438616fd4bbed0f65b2123e56ac253cba5b25dbd9e056 SHA512 4f31182f4ebce7f663db893def0e2380b87ef1a262a021837fc6fc9965803a829217142df140c67b1cd83b292eb8862fa0a470cf795a312494674e6e94f02f79 WHIRLPOOL 23a55fc572189d827fc35849205296ac39d83d74ccab9431fb47b1eab7e2da8e196aca50b8161e9b9ea4a2f0e7471676a4f229f8c510c4b6af023beb5a5657b4
+DIST fts-standalone-1.2.7.tar.gz 19336 SHA256 49ae567a96dbab22823d045ffebe0d6b14b9b799925e9ca9274d47d26ff482a6 SHA512 949f73b9406b06bd8712c721b4ec89afcb37d4eaef5666cccf3712242d3a57fc0acf3ca994934e0f57c1e92f40521a9370132a21eb6d1957415a83c76bf20feb WHIRLPOOL c2ae59855a8093ca789d3d26e1300c89d8ca11cc4e60714e4a0364181feb82b9380beba8e034311ea0df13a62a64a6cbfbc485fc79b1c84c021895eb60c43d19
+EBUILD fts-standalone-0.2-r1.ebuild 525 SHA256 9a640ea075c571723dc004988679ca4b33f312f670d953a3ff922856fc275b6f SHA512 063e7e8c5505871d0340145f31197227d0aa724d1ffb55fbe4b5637e56673bf749406528164c82196094c5d91065658ad431406eca54bc6d3d1bf76d260c0f98 WHIRLPOOL 2ee7bc75bb86811b4cb6bd59562cb2b2abb219a6e609f86bc1bce1695a515f70181561309841b6a6667405b98f8ef338fb539c6193f49fd3e0ab175cfab9159f
+EBUILD fts-standalone-1.2.7.ebuild 734 SHA256 4a74db505099b58bf1e821115d6bc72a1d0d9ecdaf365fa114b1953936f37dc7 SHA512 f2acd6088724b4676061014a3ea4cc8a12c2239d818eeb46c7e0dc2bfdc01c4c3dde1f32af61cec41583461493d5f6d1ad4ba6438ec573878d04dd7646ffb24e WHIRLPOOL 5ed37f7c9ffa6925d364af30e41fb93f190beefb41c7352b5afa6de90a2ef707b7c7b6fa38e748993b61935e53c21bc25c790fcf585fbec24aadf19e291a7a59
+MISC ChangeLog 2878 SHA256 c34d7f86da8c4b4d8f8e7fc1c43e8e3a359ba79625635d72c64ae8c852572d3b SHA512 6870b4ffbfbb71b0f10930a89db841217183450ec36340d4b9c5830b16e7df227e6ef6cc447e8e3636e85420949ae5c575ef719e10010baab2b5a8f8cf4e5080 WHIRLPOOL d1c9d767f1f194561f3f3411e5955dc18023030e90cf2184d210ce0f24098001e760848780d8ac4336fa15c31bb3815c69a5ee2066b5f6b46f43d4cf6eb43a33
+MISC ChangeLog-2015 539 SHA256 35bc4ecc326d67a8555b3337797aa29cd363c6a614b4c6ab3689183720e36b86 SHA512 61706acf10b0d97ff5f153d3cf9abe09a30f1ec1b54f8043c9c9cac4c9fc29e7e39c42b5b290b99731266f9fa683271cf5b15403b0641fd0e8ca3f264bd9240e WHIRLPOOL f07ce950c7159bef5438f902e1ae1821026eea5768621aada19d9491f47a1c516b85f474b4ba68d28429d2bca5f0c4a8a3f31cb2207d5da469d597d7d7a66b92
+MISC metadata.xml 334 SHA256 ad06d216c55dfe4f8450641382d2cdd60186ac2ba14a9446d04ac9d524e728f1 SHA512 f42362781a8bd718ddb3cc00aba96d8f7c5104a3dd0722cb189e827d2c0f7e78cec8d7dffbf3cf9ee82b5fba00330427486ae48247e3a2b3c0308e68d45702ab WHIRLPOOL 66e259184da045f179fd611acd2ccb62e590a8ed3bf3b541c088cfda3f26910789205880528763b4b8e877aa445d4257628ffaf61a25f497b885f43e82266478
diff --git a/sys-libs/fts-standalone/fts-standalone-0.2-r1.ebuild b/sys-libs/fts-standalone/fts-standalone-0.2-r1.ebuild
new file mode 100644
index 000000000000..8226697e49c2
--- /dev/null
+++ b/sys-libs/fts-standalone/fts-standalone-0.2-r1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+MY_P=${P/-standalone/}
+
+DESCRIPTION="Standalone fts library for use with musl"
+HOMEPAGE="https://dev.gentoo.org/~blueness/fts-standalone"
+SRC_URI="https://dev.gentoo.org/~blueness/fts-standalone/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~mips ~ppc x86"
+IUSE=""
+
+DEPEND="
+ !sys-libs/glibc
+ !sys-libs/uclibc"
+
+S="${WORKDIR}/${MY_P}"
+
+src_install() {
+ default
+ rm -rf "${D}"/usr/share/man
+}
diff --git a/sys-libs/fts-standalone/fts-standalone-1.2.7.ebuild b/sys-libs/fts-standalone/fts-standalone-1.2.7.ebuild
new file mode 100644
index 000000000000..f651d8caee05
--- /dev/null
+++ b/sys-libs/fts-standalone/fts-standalone-1.2.7.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="Standalone fts library for use with musl"
+HOMEPAGE="https://github.com/pullmoll/musl-fts"
+SRC_URI="https://github.com/pullmoll/musl-fts/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="static-libs"
+
+DEPEND="
+ !sys-libs/glibc
+ !sys-libs/uclibc"
+
+S="${WORKDIR}/musl-fts-${PV}"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+ mv "${ED%/}"/usr/$(get_libdir)/pkgconfig/{musl-fts,fts-standalone}.pc || die
+}
diff --git a/sys-libs/fts-standalone/metadata.xml b/sys-libs/fts-standalone/metadata.xml
new file mode 100644
index 000000000000..f9ca28f3ecc6
--- /dev/null
+++ b/sys-libs/fts-standalone/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 type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">pullmoll/musl-fts</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/gdbm/Manifest b/sys-libs/gdbm/Manifest
new file mode 100644
index 000000000000..723a2bce807d
--- /dev/null
+++ b/sys-libs/gdbm/Manifest
@@ -0,0 +1,10 @@
+DIST gdbm-1.11.tar.gz 811662 SHA256 8d912f44f05d0b15a4a5d96a76f852e905d051bb88022fcdfd98b43be093e3c3 SHA512 272fb65ab9ca0a21e9f0dcfb2c638457e87cbb938c65ee850123474d11f2858496f84d3fa9edca27cd91c7220160cfdb59f90bd46ddc45395514addc9fd4151c WHIRLPOOL 827f100826273fb8e6d8fdc88fffdb81e5630a7d07bdbeeb7d25759809c5165613446567b0b48bf862d4a4b231e5db921e28c9d6915e669fd0ce795f4a9f150a
+DIST gdbm-1.12.tar.gz 841213 SHA256 d97b2166ee867fd6ca5c022efee80702d6f30dd66af0e03ed092285c3af9bcea SHA512 25e03dceed6986f1977d304a5ad059ac6c603a88ad4aa18c831ec42df82d68006f2e04b8a3cc400d0a4970750c78ba24a3f84cdff70de9f278cfd854c059699e WHIRLPOOL 63f6592eafc5332cb754a1def412beaecaa21d751a41eab90be84ea0100846efa088c2a10f223238a17a48109e880d945db1f19eb62b8ddea673b413021f8669
+DIST gdbm-1.13.tar.gz 891987 SHA256 9d252cbd7d793f7b12bcceaddda98d257c14f4d1890d851c386c37207000a253 SHA512 fdb777f5b415b0578ea46b4a6fc70151a04a3568e2f2c8c0219ccad8c0d34abb773d80d5d7a06462ad1a3d6c1f3b5b7ab25f9de4f43ccf05c58db05f9a2906ad WHIRLPOOL 7defcbde2c67fe91ffbf04701e1589a1015d02f07f7936e01410087671711fc15100d5222e36de4c4f09609f644be23e18f46aaf23ff49a59215e24ac7490963
+DIST gdbm-1.8.3.tar.gz 228695 SHA256 cc340338a2e28b40058ab9eb5354a21d53f88a1582ea21ba0bb185c37a281dc9 SHA512 2a01751ee8f730db563b4f52185c72f1c7a4f66530d6736f05f7446153be685ea0bb6ea1d2bad16ce31547fea879dc48507ff65ad35b0973df9aa385713b10d7 WHIRLPOOL 9d2e402b2ec00cadfc64e40d87da095f293f157386abbe9a64ebe8b7a2af9b965546805826ffe3d5c88212dec0628ab2ae3ebef91de2da7fc69d0937d03d7075
+EBUILD gdbm-1.11.ebuild 1887 SHA256 ca92a52ef07d86f47512e67703f48c28c57f36578fa6dd2199a24f015e895937 SHA512 fb5768d73a8a25cad8e6defeba0dd4ba788a2f339e697054da879b0aa600cfafa18ec5793a255bc5cc3066019c189bdcb43842710588590c2bab1c28c172d5d5 WHIRLPOOL ce109c5f7878b4814092d8e1d8e6f275858ca8e228d11c9b9bb1d02e7c90ea37617c703666723d56639fd64dbf2771536eafb89e574f4ecec77d8ef322936af4
+EBUILD gdbm-1.12.ebuild 1898 SHA256 9b04aaad950ed9158b579a7f2aa8a613c3511f16b19075ffbb8ee6f939c2eeff SHA512 70b901cc796d76e15f914528b68d80348415918c32d7fa6fab2600680bfc21a09fdad51c083eabf8913de6554fca2824e74025f797c1002e9d10264c80d99348 WHIRLPOOL 8c6310d1c3857144ef0f1187e17a5a92e4429099beacc902ce5e3f2efc1fa2e2186d05366a198ebfe8c61e0289ef4b263693c5d3bc8fe3c86fdc9912dc6cbb63
+EBUILD gdbm-1.13.ebuild 1908 SHA256 cfa9938543e9fea1eb5e8031d0f06ee527de20c58c8532a5846f6716c4455ba6 SHA512 35b0414c2eec85e9b5ff6b7b8e152c1f59e135161e1d1bb39ccee5339b8871ef50b291a0eb5bf3c8d83694d1a84d0759ffd709411586e5209fd4ef23fbe6ae16 WHIRLPOOL f2f20976f7bffa196ad9276f4815f10735b0d04a4f2b9f949e2407994dee21a982c85d5c90c9de0f0aca29f8369103f0ba25d07f53e9f3829c5def449a6a601d
+MISC ChangeLog 4464 SHA256 2d03fad822b2ae5d0aa1b5e6b24843245a408bc5cbe9b8d988c793cc35d5b2f1 SHA512 21684c784765cd5f9170845f30dc7efb28189b77117083b4c85634f87b81a2e8d39a7683db1ac466808dfe4348ff2e45b221446c17abbdd348c4f4470b2dee11 WHIRLPOOL 80397fc399292af2e10e5f0a67c1fc812c5d15059650c7a1867a9f8ad50084b33a9c4d342532f669ac373c9f554756c4783d291fb7e4b0d94f6d6761a3c0453a
+MISC ChangeLog-2015 10716 SHA256 19fe9c5b4266099c7427e5917c42ac85eafd7368850b7b7224f44fb82138c818 SHA512 f77f6a170d4478988743d96cedb7e96effc14efc131ecf56bbf7304d556f9019979f96280eb143ec93890d911c4d71b617b482f1e954980c778302920ebafd77 WHIRLPOOL 46fe6b3248b867cade7d596e89ba5e2a2c5e6b0f2818eea6e0ad64eb7e640763c79f41cc2bd8ec7a69131471b046fb9fa1cc5445fa9e52ba9e5cedde5d06b9ae
+MISC metadata.xml 471 SHA256 d1096e4a55096ffa3feec967b72fc7facdef179e2a0f229f72a4649f4b157ea6 SHA512 05f989aa1f1d2ca29d4084741af8465c3daa0713881130aeb8ba8ac65f89a8874d668a0ea32184ec404e19777aa1df9e8d2526fe2ce9a22cae8c08c608501d41 WHIRLPOOL 7dfb6740dc7b6c26edc10bb868522abfcb549bebb965daaed20e3531a23d43cde993f3b1795bf19c890fbb29a60c73b7ad5f7ee2ec35bb0f9981b0976818f5ed
diff --git a/sys-libs/gdbm/gdbm-1.11.ebuild b/sys-libs/gdbm/gdbm-1.11.ebuild
new file mode 100644
index 000000000000..13204d00fa80
--- /dev/null
+++ b/sys-libs/gdbm/gdbm-1.11.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit flag-o-matic libtool multilib multilib-minimal
+
+EX_P="${PN}-1.8.3"
+DESCRIPTION="Standard GNU database libraries"
+HOMEPAGE="https://www.gnu.org/software/gdbm/"
+SRC_URI="mirror://gnu/gdbm/${P}.tar.gz
+ exporter? ( mirror://gnu/gdbm/${EX_P}.tar.gz )"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+berkdb exporter nls static-libs"
+
+RDEPEND="
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+EX_S="${WORKDIR}"/${EX_P}
+
+src_prepare() {
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # gdbm doesn't appear to use either of these libraries
+ export ac_cv_lib_dbm_main=no ac_cv_lib_ndbm_main=no
+
+ if multilib_is_native_abi && use exporter ; then
+ pushd "${EX_S}" >/dev/null
+ append-lfs-flags
+ econf --disable-shared
+ popd >/dev/null
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf \
+ --includedir="${EPREFIX}"/usr/include/gdbm \
+ --with-gdbm183-libdir="${EX_S}/.libs" \
+ --with-gdbm183-includedir="${EX_S}" \
+ $(use_enable berkdb libgdbm-compat) \
+ $(multilib_native_use_enable exporter gdbm-export) \
+ $(use_enable nls) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_compile() {
+ use exporter && emake -C "${EX_S}" libgdbm.la
+ emake
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ use static-libs || find "${ED}" -name '*.la' -delete
+ mv "${ED}"/usr/include/gdbm/gdbm.h "${ED}"/usr/include/ || die
+}
+
+pkg_preinst() {
+ preserve_old_lib libgdbm{,_compat}.so.{2,3} #32510
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify libgdbm{,_compat}.so.{2,3} #32510
+}
diff --git a/sys-libs/gdbm/gdbm-1.12.ebuild b/sys-libs/gdbm/gdbm-1.12.ebuild
new file mode 100644
index 000000000000..4748ea363615
--- /dev/null
+++ b/sys-libs/gdbm/gdbm-1.12.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit flag-o-matic libtool multilib multilib-minimal
+
+EX_P="${PN}-1.8.3"
+DESCRIPTION="Standard GNU database libraries"
+HOMEPAGE="https://www.gnu.org/software/gdbm/"
+SRC_URI="mirror://gnu/gdbm/${P}.tar.gz
+ exporter? ( mirror://gnu/gdbm/${EX_P}.tar.gz )"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+berkdb exporter nls static-libs"
+
+RDEPEND="
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+EX_S="${WORKDIR}"/${EX_P}
+
+src_prepare() {
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # gdbm doesn't appear to use either of these libraries
+ export ac_cv_lib_dbm_main=no ac_cv_lib_ndbm_main=no
+
+ if multilib_is_native_abi && use exporter ; then
+ pushd "${EX_S}" >/dev/null
+ append-lfs-flags
+ econf --disable-shared
+ popd >/dev/null
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf \
+ --includedir="${EPREFIX}"/usr/include/gdbm \
+ --with-gdbm183-libdir="${EX_S}/.libs" \
+ --with-gdbm183-includedir="${EX_S}" \
+ $(use_enable berkdb libgdbm-compat) \
+ $(multilib_native_use_enable exporter gdbm-export) \
+ $(use_enable nls) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_compile() {
+ use exporter && emake -C "${EX_S}" libgdbm.la
+ emake
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ use static-libs || find "${ED}" -name '*.la' -delete
+ mv "${ED}"/usr/include/gdbm/gdbm.h "${ED}"/usr/include/ || die
+}
+
+pkg_preinst() {
+ preserve_old_lib libgdbm{,_compat}.so.{2,3} #32510
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify libgdbm{,_compat}.so.{2,3} #32510
+}
diff --git a/sys-libs/gdbm/gdbm-1.13.ebuild b/sys-libs/gdbm/gdbm-1.13.ebuild
new file mode 100644
index 000000000000..1aafca746d33
--- /dev/null
+++ b/sys-libs/gdbm/gdbm-1.13.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit flag-o-matic libtool multilib multilib-minimal
+
+EX_P="${PN}-1.8.3"
+DESCRIPTION="Standard GNU database libraries"
+HOMEPAGE="https://www.gnu.org/software/gdbm/"
+SRC_URI="mirror://gnu/gdbm/${P}.tar.gz
+ exporter? ( mirror://gnu/gdbm/${EX_P}.tar.gz )"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="+berkdb exporter nls +readline static-libs"
+
+DEPEND="
+ readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+
+EX_S="${WORKDIR}/${EX_P}"
+
+src_prepare() {
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # gdbm doesn't appear to use either of these libraries
+ export ac_cv_lib_dbm_main=no ac_cv_lib_ndbm_main=no
+
+ if multilib_is_native_abi && use exporter ; then
+ pushd "${EX_S}" >/dev/null
+ append-lfs-flags
+ econf --disable-shared
+ popd >/dev/null
+ fi
+
+ local myeconfargs=(
+ --includedir="${EPREFIX}"/usr/include/gdbm
+ --with-gdbm183-libdir="${EX_S}/.libs"
+ --with-gdbm183-includedir="${EX_S}"
+ $(use_enable berkdb libgdbm-compat)
+ $(multilib_native_use_enable exporter gdbm-export)
+ $(use_enable nls)
+ $(use_enable static-libs static)
+ $(use_with readline)
+ )
+ ECONF_SOURCE=${S} econf "${myeconfargs[@]}"
+}
+
+multilib_src_compile() {
+ use exporter && emake -C "${EX_S}" libgdbm.la
+ emake
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ use static-libs || find "${ED}" -name '*.la' -delete
+ mv "${ED%/}"/usr/include/gdbm/gdbm.h "${ED%/}"/usr/include/ || die
+}
+
+pkg_preinst() {
+ preserve_old_lib libgdbm{,_compat}.so.{2,3} #32510
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify libgdbm{,_compat}.so.{2,3} #32510
+}
diff --git a/sys-libs/gdbm/metadata.xml b/sys-libs/gdbm/metadata.xml
new file mode 100644
index 000000000000..d75e86be3d80
--- /dev/null
+++ b/sys-libs/gdbm/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="berkdb">enable compatibility layer for UNIX-like dbm and ndbm interfaces</flag>
+ <flag name="exporter">enable gdbmexport binary for exporting data from gdbm-1.8 databases into gdbm-1.9</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest
new file mode 100644
index 000000000000..689340378c4a
--- /dev/null
+++ b/sys-libs/glibc/Manifest
@@ -0,0 +1,63 @@
+AUX 2.10/glibc-2.10-gentoo-chk_fail.c 9407 SHA256 7745c0f5d37b37959b43b41e39762fc35b877161bc5740d9d3e9a83021acbc0e SHA512 d1c51c573353b3b8ae6ab1bcc8c10eda5cad8b98fc7ab4848e4fbd8a8736174f3c3fd1b72dd80c72b1e54be78f1cae4dc1ab8130df25aa6d1495e5cbbaf3b9f6 WHIRLPOOL 32028ddeb422d89c0523fec994413e67c6afd9fcfdaf147d3d6a28bd02f8feabda9571ced4509253b7061a95bb2c16cecf94a4274671b33909ff545b1787f101
+AUX 2.10/glibc-2.10-hardened-configure-picdefault.patch 865 SHA256 b50b29f85d88011555bbcbe6046e6600be9344f2d78412b14aebdea515420774 SHA512 e0a09f77b209a72ab577fe1e62126609fdddedf3fba0eec749c4b506cdf793779b48390f055a3594892120f694291f8340c0b6f51862e94c03fd516897138be7 WHIRLPOOL d1b8e1536696350e0ed9eaf9a923daa7c004ef40ae94c1c3ba3d6cb293f1c19364cefbe8491089061124cbe26a9fded9f3d38d89f1bda56d408162e53702e8d4
+AUX 2.10/glibc-2.10-hardened-inittls-nosysenter.patch 8823 SHA256 dcf78c6524c222dbee907200a8878aff727e29d43a4962b977a16d85752e5c10 SHA512 0605b7964af87d1d6bdccea5c4d1bfe6267d4401b8bbf0c8bb689663e6bb3ef92eebad8be6c23ffdf6632a4d5e6098d8a403c3e84ffb21b5e87b5b1d1ec3512d WHIRLPOOL 635261b547883bbfbe23c802fcf97916dee823b367f96732ccecd7506dff004b87f2d36d97ed398510711330f3a53f039a14e226d20a681cc201a8c7a3450833
+AUX 2.17/glibc-2.17-hardened-pie.patch 1784 SHA256 bba32e40c73aef20122b2825f31e5c3aa058b61feae4f32f336e1941f83f82d1 SHA512 9ecfe2b6c8c982a42786181d6507d5fa588a6868109065451f58a779848837bd5e69c32a24e43a186c2ff63a9784015c51487e342c87982ac074139e36c169fc WHIRLPOOL 1baffbef9e6d870ea2f2ae5be014b71020a213a1a11e9856fa207545867de444ed164cb926b2aac23471854eaaf72a87e38760702b32bfcfa639add8733d925e
+AUX 2.18/glibc-2.18-gentoo-chk_fail.c 9384 SHA256 e6ed60f4e0d262aaaffac2b84fd2fcf7906965dc9d91a2150b8b2d9f50e7b9e4 SHA512 f7106e36fa49b0000192c281edfcd49338c825b8b8663ac9d7304e8fe8b2f44b39c6c82a741b8e8abce4cbe2fd72f64e3cfe7a18ff504a4b2b2d63e5c75d62b7 WHIRLPOOL 80aa86694aedf306276ba74334a14e98b108caca046430e6ce71ec67221ef716e7350a667929bf79277bfa9f0eaa23d4544f8acf7e32fd54a26b3a0f5ebc596c
+AUX 2.18/glibc-2.18-gentoo-stack_chk_fail.c 9599 SHA256 039a6249236c60bb909e67339fd7ef6eefd1f4bb71b8cd39f4fe04530c536315 SHA512 97acbdb8aa87dd7e197a1577bd053374b1c8c30d6c82f4a71ef04409bf87b36a60322237cb79896ebdb49960fcaae4c4f2333497f5c255f67717b01d6d62c2d5 WHIRLPOOL 40ed26d3a251a6f4de125a588bafb911b7ba4867f5139142c00a2bc2f2616658a45cff144d2629bdf33cadece020ed6a1bd7a74047da812821cdb6d3e8253f40
+AUX 2.18/glibc-2.18-hardened-inittls-nosysenter.patch 8981 SHA256 3fcdef34164b7fa6e493e081d32427017d239236aa4e183e3a470fe49a028eb7 SHA512 98feb8f12dc5d2bb030ec7c6c77f3f9389ebc208fafc96496f316e577457dd991294d59735b013b17e1d10d5c7b63471d5b857d2334be78239a8ceb1ad62b1fc WHIRLPOOL 52ac2452fe3f9ec6ac3f4635cf017d1347eda6b950f25ecee6ef1b444de97fad5a1792432e0c783375fc7d07c80b4cd77e48a6d6051aec3933696e2f17fcec18
+AUX 2.19/glibc-2.19-hardened-configure-picdefault.patch 865 SHA256 feeb2ddc276e90f55d2fd358837e8d4922d3b2875cb8080b1d8e27e5da83a2d9 SHA512 d8e6fea72e240f1fde8a487958463140a84e8bd6bb5b176f8ce84a34df3137943db9016300884f3efdd4da130e342448e57ed0c0dc6eb2956d647286ce1d00ce WHIRLPOOL 3a5d2882b5fc1bea78c45409c848c94a260659e3ea1e28a5dc8818de8825e55453aa1cc97b86eef99c91b17bde9f2a6db1fd8ae03839f7029d93a71feaa4d4d0
+AUX 2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch 1360 SHA256 f0d8bb004f598375b61e67e1c215b15953c293038243207f2d85cbe9f10d093e SHA512 79876b12871b3e7693340bfdf99276ac0dfd6ff30bc977a9526af9e681fcbab2f25d3ac9e2b33f027c968b38a4b670237de54ffd08edc418423ecd82dddd1d67 WHIRLPOOL 5ca64dddf58a790cc5f6090ae48fc4bd4799a9aac4c67f6ef7d1fea9498208ffc38ee8167b6ec80dc97c4f723fcdfade8f573893f1b380aff04f6d0476d0d253
+AUX 2.20/glibc-2.20-gentoo-chk_fail.c 8978 SHA256 f9cc426b0fb21de1dc11bb36e43bca8e1b3114fe78f8b343f672a951a82c742e SHA512 5cb529ac9d18a315f25fd48a3a80a529924bee0588074c97e6df7dbe8568a67f786363c41da6300ea55818369e3609ed4315b2e2104f8a8b4f1266ba43076eda WHIRLPOOL 2d38c19a20226fc4687037b8bb19025065f039ddaa62466879ca98765c8899e64b147dd148565304419ed1a98fbe1f8403710b22c930b08a19bddba7e79b0f1d
+AUX 2.20/glibc-2.20-gentoo-stack_chk_fail.c 55 SHA256 ec73e74297b5eade591bfb3a2999989e2a7aa80752140048ffa67349635f05e7 SHA512 4dfec1bd17007b826110dcb73d09331a58b7a892c87de55b94480b14c28686442c567725b610082813411cf9911e180835a400a54ea704fe80f81cfba966a989 WHIRLPOOL b2b338a50f7895c530a71a19e4582bd0116a0b9d13b2e1505f0566924557493849f93cefb2c0ad1719ef684321e145129e0f72cfc9aa85a44ea7ebf910e7304c
+AUX 2.20/glibc-2.20-hardened-inittls-nosysenter.patch 9951 SHA256 992fb70b9b62674d94ef8938297a3f2591b3121495987d927f5a44c1d8788658 SHA512 a8302ee2963bd791be859233223b17cd154afbf04c13c046956bb1140d748272d7bcb3a6167ce8b61573ebcffe906dff064308374d2910656b8fad18480fe422 WHIRLPOOL b8753d6f1301650b91b5cf4f342de22010d819deb2bf4da27aac33d7540e15a140b8a7a4c5e111faba320873ed5784b22f6add29181fbaef14c3e9504b1b838f
+AUX 2.25/glibc-2.25-gentoo-chk_fail.c 9068 SHA256 cf8ba550579c9891bb0dd415df38fddc897ec0ff47f6b30ea935f0b34633106b SHA512 4503002b0e2cee0b6efc4599152d24fcff330157d4e35992a77d0d83a2decc4cf2da2b8645a44d90d428a1d82300a4fd8d13c5937b7c89f368c12b3c9139be6f WHIRLPOOL 1ac8777a52bb26fb9930720879d2e1d7c1b8e8c8bafaa611cca385c36301d67698b296032e66e20663c5ddc62e87220d172ceeef08b4fbfc63159f0f7b6ec099
+AUX 2.6/glibc-2.6-gentoo-stack_chk_fail.c 9545 SHA256 1410ded812be80d452eada5f9d6b9bd7bdb504c14f01cc27dce3e36b6f92b92a SHA512 360b77df2d19d14060e19e763878297bf042eccd5206ce4829a33c78c982b59b46144116d237a7cac73a22dd6cb4987c8dd50f1d16003baa22c2cb2942d2cbdf WHIRLPOOL 44e14dacdd258c46201a44c2c6aae4d975b960a914c24e49f2b39dae960636512049daa052d3cd8e8d93819d263327c28eac947efdb5d9e240d1bc6e9964016f
+AUX nscd 1520 SHA256 13391343bfc64379c696b4bfc1cfe8d7fbb2886f477265343fddf448d82deabf SHA512 9dc02748b89229af665983abe9067a6c23f1e39ee0593c845386c3390db316920242526740b615a065dd6d381e3f39a4b0e3e91aa6b27909ba52bb6d21fd285b WHIRLPOOL 420ce9fbbcb15acb66674ee6110f7f331b886b55c172e3480c3cf8e7c8fd747f8bc1525792710b2eb6363da47cc44295b0d164eff0281406bca7a95f9d2c1eec
+AUX nscd.service 337 SHA256 de7bc9946309d34f0ab44aa22a4d3cf259fe91c57e8000d741cb09ecd3a6caa0 SHA512 2001100f3b054843c69b6fd2d38852c7c824282aa8998c25a3c0352db993705429d25c70d8ce6cb3579f836b7089644c520acac423ebd69cb1b36e94a77c5bea WHIRLPOOL f01d191971b0dc45f541c9ebaaa1a40f3497e2cc838cff6a20a7b1828d726c248abbd94322a5a5ff30c33ddb7d9086cd4d2ba3bdc1811fed59ff292ef3983a72
+AUX nscd.tmpfilesd 111 SHA256 f0f64c4612d2097173854d2ec2e94ecbf4b77c7a6e94d950874e37346aa90d72 SHA512 53b80b331e1a85d8ee16eb2ce547a7249e944926c3d1cdd4a47a5301a5c842ffc7ec1e3dc0a731542a8facf8261c1c57121802d01741aa89898a3476c09da340 WHIRLPOOL cf1fed1a7e2ac1623a84f1cfa2062645afe3f791da2f4ace3859d12aa05df0e282b4c2e367a460015956ac2a8d01fee4cda84917a3adf2c38561dff200335270
+AUX nsswitch.conf 394 SHA256 608220300fada6ae9ac918b0c87e1ffba0dd739384f1f28554217637e1930712 SHA512 ec9aca1618fb3727cef0601bf893f77cb3db453cad5dd8cff1ebdef2096d57899083f471249b43d4e117ba375b1d5b2e5e22e803fe71d84bc3cd1ef91f5851aa WHIRLPOOL b8d9372c361510f2342d173ad4fe5d341039ee09a9065451ac591414f83cd7a23d156e7b09f634ce26aa28ec4cbdcfcdc730cbc7ff202a28866790d96da62369
+DIST gcc-4.7.3-r1-multilib-bootstrap.tar.bz2 8064097 SHA256 34aec5a59bb4d0ecf908c62fd418461d0f3793238296897687305fd7a1f27299 SHA512 40b93e194ad41a75d649d84d1c49070680f253a13f0617803243bc61c44fed1ca2d0a7572a97ebb79353f312b58b5f6360be916dd7435928cc53935082e15269 WHIRLPOOL bbce19e7fe5c30faa55ddd4e29070f0d1fdfca3a04e8d68e0772260fa9be89ccde63ec92badb490209008df5fee6e53dfdeec4ae51857b90ba298a79315a199f
+DIST glibc-2.17-patches-8.tar.bz2 83707 SHA256 477946a4915dcd0cc0565ff8532d219e2ee868f6e821ea71ce579652d01ccbb3 SHA512 6675357e62b554d9d0f8ef70341b8038f8f89591fba384bc3783ef81aead0532486e2218af71da9c6f88a3b8b382edec81bed36eb636ee231eac80e111acbfd8 WHIRLPOOL 946f431b28ec60cc61d44364187f64a2d6e92ed7c9071126cf70277843c656de4dfac9f184f572f9a72c0cb452d879cdb7aca5b9f92f8ff02a8b1a521fffef43
+DIST glibc-2.17.tar.xz 10981956 SHA256 6914e337401e0e0ade23694e1b2c52a5f09e4eda3270c67e7c3ba93a89b5b23e SHA512 384e54037daaa344a26ce58242acc3f9a249d0765088d18a540a305745afa33ae6dec4024adae958eacd7100be9c713d117260ace8340f6d8c8396dbde4868d2 WHIRLPOOL 9b98c1c298aeff607aaa554341c300c15491b7314f127524fc5c048c67c5059daaf706e6cf206bb69213d5307e37bed87137ab46f504d8072bb778310081fc23
+DIST glibc-2.18-patches-4.tar.bz2 95165 SHA256 89b458e22db60847b4ad869e3b5cf32868528b8d73205a692a6c0d07779dd083 SHA512 d881c9c5fe32b967694d4ca5185ff5ffc964449f2ed49fd062e5d57a3c6d9f16eef2f591d2d8e98a1a95a6487f3436ef031839ed8766fd085404b288340b7933 WHIRLPOOL 55f87d0efce1f84b45968f377e868c31102cb5228fe4ff1ffa132770f242f9f4f1843c28e4eb38ee7bed1321507ae12b7284a18199af63df1ecd070233d1076f
+DIST glibc-2.18.tar.xz 11150148 SHA256 2cb4e1e381928f1e5e55e71ab1ba8e0ea7ede75ff9709770435bfd018ea257a3 SHA512 27218d2e7dd3bf3908d7af171c490933680e958c579ebd27b43b661e223fd5de2219cc1cf699170405280808c84de476d0ad86dbba35a488ef404e9438552327 WHIRLPOOL 89b877c7db602ffd4374c7fb84db17397b91f889a7de6259f79374cc3fcd00613114cbb93feb518ef25fb2e579fb03843df15d17235c1fe1b6a7e0e64aa8e8fa
+DIST glibc-2.19-patches-3.tar.bz2 80664 SHA256 6fb03292e224199e0dd9ba7ee83aca723e1560f26831e85cdc6302b187c6de3c SHA512 d281d6a2757920124cf8a3f02b97e75192598b08d96ae48840df34c7ffdcb212952d171f233e6f12a429b19437d0a296212fe1f2eae164d6a1c6793cb3cb69f0 WHIRLPOOL 6f28a2d0dff42e8ad0e77859938e3093753f77f78821375777eebb2db5568bf1c56e8b8208f02280f23acb2dd26dc8a313fedd5b2c10755f1659e6d324a1dbc3
+DIST glibc-2.19.tar.xz 12083312 SHA256 2d3997f588401ea095a0b27227b1d50cdfdd416236f6567b564549d3b46ea2a2 SHA512 9e021fcb3afbb9ace2a0e37fded231a62de861bd766e29d47163a03182e37add718b7acc3963d1c525f9556773e842297725715acde48dcfbaab6e756af1a23d WHIRLPOOL 9581a3a23ebdd56bc559b56b95b7bcd21ca039546ec19c6c0e4e0738597542164fdb21ab1d1f36d5e73a205fb51f0974c7d497972615bce69ae002298f6475b6
+DIST glibc-2.20-patches-5.tar.bz2 55986 SHA256 3d3eec9ac9b5d0530f9e05614f4646d64ff93a48865b42c156990bea69247cda SHA512 409f59a028127e02f0c9f91107715b540d8d234475830adc17108a02664be232098d119b43bcc8df9b328ab50c1fffb0868d510e6487ce1c34ec2c7c7a78375b WHIRLPOOL b3c41b01af5d8ae8e901ac48ae124e13ff1c76fbeb35315cb9630c648c03d7abbfb753294cbdfe1dc939bda260e24d8450ffb19cfe5c255b32f8c5500f2c43f3
+DIST glibc-2.20.tar.xz 12283992 SHA256 f84b6d42aecc288d593c397b0a3d02260a33ee686bce0c634eb9b32798f36ba5 SHA512 7a8eea8b71d3ccba766c3f304cab61055446d451ef063309476b26dc40d880562dc33b1b68fbedeedb4b55b84c26415b9202311aaa71ef8c141b6849a814d2fa WHIRLPOOL 042f74d75c62a655ae35348c9cd0bed0845ab199e37a76635eb74c04ed927b5eca77723c38d2dc46f12fca62c1004001887b43946a914b079ad22f6a9cc8daaa
+DIST glibc-2.21-patches-7.tar.bz2 46894 SHA256 49126df6f4b819f2c315cca0a07e9b8ee7e279257148506d336ccfef5766bbcb SHA512 e4cca3d753c0b9d213c0ed85e3d08cbbf6517862b3a48af987e010abaf5a022b47330040ced183d30b5b934de7587e97b4342e51a6df3d5cfa768bdd8b43b756 WHIRLPOOL b5f4bffdcaf629d735e7498f509bf2130acb18194b18e69747bb6c3e403b221f2163eea3770bb19c05253d7134f70ed4657d7c30c5978f7b5571a3482f9521ad
+DIST glibc-2.21.tar.xz 12322092 SHA256 aeeb362437965a5d3f40b151094ca79def04a115bd363fdd4a9a0c69482923b8 SHA512 8cded6693618bec115f678fcbd0b77556f97dfa8337608f66e37224aefa55b38765ba61cb4d58beea37b5934e5ec8e30bad58613707388484906f2a0ce77997d WHIRLPOOL d07fec32bd92eade065a3b6170932b8bd41d07df4aa69dd5a860ebb9678c22bd1e20bf88b1fc05c3ecc18e709c0a63118e12525dc668e0399d7ef7fe4454702d
+DIST glibc-2.22-patches-13.tar.bz2 74479 SHA256 ffd1e0f9a41be030e5ce2518d9e84a1fbaa9a4fb2e96f1b85dafb05fea666c86 SHA512 73517fc1502b0733d67ade1d1ba6168415f5da64f37045fac0b10ef57155bf6dfbe1876e4742d2543fcea0c935c179426f6fbb94f0205968392ef903d2f83897 WHIRLPOOL 0eeedaf09eb42e5186256dd41aae00cd2b9b8e3ab929a792e83d0fd8e8a8630d829f01b293588bf59e105eb17ab512416d8d115c3e542cddc34a84b84d56af3d
+DIST glibc-2.22.tar.xz 12969072 SHA256 eb731406903befef1d8f878a46be75ef862b9056ab0cde1626d08a7a05328948 SHA512 a8719f3a4f8aa5fa81711116fdafbea5082c6dfd85bd8c4cdce60571910263ab422b35bb8b55a84d37ccb146442133ba60a84d453ca4a439c8ccd35419bd051b WHIRLPOOL f7e707b3776fc197a2e7bf5633721925507237b154bbc1f94b9fc303c87e6fc039ff0758da6ee55b4c1a0daaa87c6e594a6c96e7b00a7ba8ae98ee29918709a7
+DIST glibc-2.23-patches-7.tar.bz2 315221 SHA256 97ef9e370ce9b09d8e9b9f6239f7ef94dd837d29b7bfc1404438c63da1d534ac SHA512 c0d0cab0a370acef0b085b0ab09ce868425a12bbb371d0a9ff91dc83a74a0d8d3b541d10c44650b00b7cb155f8ac1f87764e6a6bd9d6bae8a9a904b4df1650ef WHIRLPOOL 128ea1a2eeaad3d95cdf1054d10232a34e8f88d10ed8907a67d9ff02734243d20b21595ca3698a4861d9c65e2a59aedbcf8e399bd1ed879dba1556ce2995ad9b
+DIST glibc-2.23-patches-8.tar.bz2 304199 SHA256 6110777176abfb8d287d82804d98e007c255db6040a1beca589a212772c90482 SHA512 470814bbbd9d4ee5fa2dd7570a2e14b0229723e373e801472856fd6c2f089499eddc300f69b49af8ba0edbdca583ee3ca521fdb5c642509717cafea0ad925fd2 WHIRLPOOL 1ef9a431d67d7669f34f7db21185d50ddd6dc82c549a9ff274f0b98454417f4098ee771bfe10073be12d3c153ee46ff36e40b46ecb31844ab09791ae29b49074
+DIST glibc-2.23.tar.xz 13455260 SHA256 94efeb00e4603c8546209cefb3e1a50a5315c86fa9b078b6fad758e187ce13e9 SHA512 b82953388cd028e174cb08f082557bbce0dad8b67b17d31b29f90102fd52a51e03d591448ecb64882a1c1d5303afffc7f6ede85cee4c784a9284fbc9b4ad26cf WHIRLPOOL 7c7e3bf55a89a04bac917b9ca5a1cbb1613f22c427d2766f114b5a36f9635856005b823852ef5d3b73462b577fe4e5865e68e7b64633d48a95fa1e5eaa831a71
+DIST glibc-2.24-patches-10.tar.bz2 73586 SHA256 d479033b63ff796fea56fb1bde390c442021acd856994b15c983b4a89e46fbbe SHA512 fc9191a85da53a2515bbaab228648936682e04267284049468e0c82284f618ab2907b9247baca701e16edc50640199ff6d8e2a6a93ccbd5a9d3b0eb73cc484ca WHIRLPOOL 7afe94307900a70de2f5e028d8ec9e0f4b06b661ec6493217e51a13d750f891e10b45c0f66d86fa83c16cc3ce539bb257039b33bc3e363469cd03502d956d75e
+DIST glibc-2.24.tar.xz 13554048 SHA256 99d4a3e8efd144d71488e478f62587578c0f4e1fa0b4eed47ee3d4975ebeb5d3 SHA512 a4cb28a2c51a0cc029ed69da7cba11931a615ba897235590b4f7fad2eaabec9042f8250eaac2a5860997437a69ab13304f10a634000e52c0336b5593b7969adb WHIRLPOOL be82b47fc73f7e780e8e73a5f58b313d8e861d5ea8c4320f95ef0d8c1e125ff011d61dcfc0380be0e83868bd8c3299de1ea662da7fc8d709050e89b2c126e3eb
+DIST glibc-2.25-patches-11.tar.bz2 64221 SHA256 38c76c844238a7bbaecc85b359e67af6a98a1614f3196f25d85f83dec4358e99 SHA512 cbbbca9653f55f0cb3b73c38c979cb439c87b172819f3e999d2b435d59cd2bef2c89f11a398300c53f447ad433ee87f47a0f3e890c78f8694705c788455325dd WHIRLPOOL e61203ac129d7283f3beda1421e1365da58c229bcb6b6a1f8b71755d9ea0e2bfb64b8be69ab7698861a593d4b98ab6163d574f3c215fba0a0d9e6a1b15d2eed5
+DIST glibc-2.25-patches-8.tar.bz2 47110 SHA256 1dc41664153369886d240a1851b15bf0c3c3739c8319e6d68cb0c2f85fc98901 SHA512 41d772c47770a63502c863f3c9bb05164e0ceab69fb7b7f355c25685ae4285d73e9ab0e3836162bd11852339055329d0bdc7238f3191fde39a50ce0d9a60454c WHIRLPOOL c6e0443d75e2e4607226caa4df1ce2b10ef21ec2564b447e2a287888d1f593d51f334a6e1ab942f5d1602d02c6fee87ce4ef9a7db3409de6063bc377a470a42d
+DIST glibc-2.25-patches-9.tar.bz2 67901 SHA256 cbd8af837aa0776940fd41e34874e930a7f25d78cdd212e138dd9a85e1349519 SHA512 b4f0be5b20834aff102394df23084cc0adf1ab674e6ce050550f6b6658cf0eab57f7685cac079b1a19388dba927a36b8ca31f58af3dddc559d7230674ffd59b5 WHIRLPOOL 81c18056fe26a79c7a7598da1181ba02e83daf7d9e9883a3c1195804a35fe22a79d7cc4a8411f2f4a4ce6430e506978199f59b61d3ed0a70b4e4f7dd05ecfafe
+DIST glibc-2.25.tar.xz 13873900 SHA256 067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0 SHA512 5b7a2418d5b8a1b6a907c6c7fb6477ee2a473151cb45e03d0d4cdd9a33497c90b1ee39e2e7e885e2b25743dcd3747336ef114b4a73eb001da1fd79f29e0f9a6e WHIRLPOOL dc2fafaa4a0e5581268338453838a03ed0c5e7a2af844e8fb7086ab8d3ae48efbdbe6f25db1d089ae669cd2f8b0412f690d965506753d86f8525da2df59b7953
+DIST glibc-2.26-patches-1.tar.bz2 26479 SHA256 ce54a83d17dc2d605e69045a9031d31c729e660fa33e740780de2fea1f186115 SHA512 416cd1e2f4a7eaed2c1f5cd2d483a9d695e82e33add42d0f1c854fd69ccb2ce7f99666aee8fb7bc2320d5d3f44780c3d872134f383279ba573325df91f061dbf WHIRLPOOL deb3a5d12510b20f427a4d82a8b5fff4ab4c4932e6096ddd056efe07d1453f5099040db2c9794c3df4fa79516424a28d2c0c2158e3aec6ae6b05b840ee5e156d
+DIST glibc-2.26-patches-2.tar.bz2 68040 SHA256 c40f03059d389fd8b22b54f83c0a669c44a38ee84cc359cb86d8f6dbdd1b957f SHA512 2b54d6e33b29d5ee5e4d4b64f299bf15e22ece5ce6555dafe43fd97ec8a2d9ef0645075ff24dc593ec6f89e02caf40c25a72af93ecd11113fba77268ccf486e2 WHIRLPOOL 59c54cdd2e3e64091dd206ad6b5ff467eff6c0d7f8ef5ab11504a4e6cfe958f762b9de2fbe8b6004a9e19963520a84a493ccf03908a78ea0a452dbc28e0df1e5
+DIST glibc-2.26.tar.xz 14682748 SHA256 e54e0a934cd2bc94429be79da5e9385898d2306b9eaf3c92d5a77af96190f6bd SHA512 6ed368523bc55f00976f96c5177f114e3f714b27273d7bffc252812c8b98fb81970403c1f5b5f0a61da678811532fb446530745492d2b49bfefc0d5bd71ce8c0 WHIRLPOOL 9091c3bccc9b590de6b9595aa391ba01091f0c301bd9199d7c48fbeaeeb013ec9c683c68b65b59c5a69e3905b7f842cca1b0a410431967ecb3a1229b8535486f
+DIST glibc-9999-patches-3.tar.bz2 19892 SHA256 97f60ed6debd495610b123d7a27227e75942bea1a0fb1e5f78833a6f3bbe6c64 SHA512 75084b86a83d447d3a4b3959fa2a93d849e304ba9473ebec5570ca4fb5e2f8dfb38548faf3abc9fbd29b529f2c608b52eb2ef2e6e9a2ad5bea9a9298a19ef596 WHIRLPOOL 04a5c30aabf72530fa96fa3a8eadf8207d85d3a2a948ba5f4b72c0deeeae24e7eb71b99875f0e9b1018051fabb4a23630b41873fa4ff0d6ba9778ca6051212bf
+EBUILD glibc-2.17.ebuild 5489 SHA256 09a8f36c613552e89d7663fd29f79d1ec842e5732188610569e7f521f03178ec SHA512 2f68b5e8947a0c9086b788a0472260ab6e7026d3b1d8e35fe05ae0221a16079cbba085653dd676ff4af4f35de3f9e05d83eaed6cdfd44b5e9538ae7d802cdc87 WHIRLPOOL 5ee03596ade2788e055d9894bf85d3ab2f77d7541088ab1616cd888355a4f05d804cfb1dacfb460cf3f6f762afdc72c844844ab2dd7a725f3d261d3be6d8ddfe
+EBUILD glibc-2.18-r1.ebuild 5550 SHA256 f1652aed48da55524fdcbabff8ba578b514c56ff194dbfd223856477b43bc815 SHA512 c6987e27573579da33711c68a1ce1e0c4535874666f50a149b9e484c87838e3dd1c7376c2cb15a6d85e1998a4f000660b5b4e659d37b4526e1752ea973046fb2 WHIRLPOOL 6aef74c03d2af530bc78c4122e32aedefd21bd5e10e43a92212a59eadc4c7dea59bbd5408807dbe6a604ffe88c3fed8506c15f9ebcfe122be2a74466dd84cef3
+EBUILD glibc-2.19-r1.ebuild 5507 SHA256 a5efd011a0df8ebe87e3f6ac64458e85524d211ca0244679d391dfa225daa12d SHA512 122c3628afa6e08a5f9eaa08cbde7cfa21ed47decc935634184541a5e5192a778524c99aac20c534a4cbd494dfa474cd152dca74012131419eaef52d6409ac1d WHIRLPOOL 48b82428e325934bae15effa303177d66977823149f7c9ed3e1e96dc8da030dbdcd81559cb11358be8159854aae9e04773a62289c5cccb1adc104b948aa8d310
+EBUILD glibc-2.20-r2.ebuild 4983 SHA256 d5df9d77752a0cfac560040f64d87e59809c0d19ac1b263cde0f858c8449b29c SHA512 29fd2fc8e0bdd875aa439bec4ab58e76edd40bc8ec7f5545d85be5b45e7e572356f71c5c06b5e48f0e6cd0efe61766f8f789a39aa222840143f2389f95b6c484 WHIRLPOOL 3ba05598e5b861eaf5b6bbdc47a8d8c96b3f7b8a17323ee29abc9401f1ef2c2586219721d07e15ddd0b6c64e1464ba366c990944abc6e0e7df70eb92c4d3dc8e
+EBUILD glibc-2.21-r2.ebuild 4958 SHA256 3e5b00eed148166a5b738d645ac10bf5932641b91b9fd9c8bf414036cf53ab70 SHA512 4e95449753ac9043ae7b5db1442f05106bee6237d24529e8cc0bc4ba1270937a067d25a9c90ccc357f8d38d8bc6be9c5c9bf52472c8adac9b5cc9c8c415cc8f5 WHIRLPOOL 62c6641d334091e23fe9d5631176f3f4605ef4f32df445c502df20782c68fd3f07a5076dbe671d67869c5e806b4b39997dd59e706326b45f6dccb8d3a498dd56
+EBUILD glibc-2.22-r4.ebuild 5009 SHA256 897760d86ae324656302bb26ddbdf9a18a7a6b049da496741117bd84b4761035 SHA512 740e963131bbebb20614a9cd27b09a3a1707f91bb83e1aede168156e15cc546950b5c2e6226d44c879b2a4fc8ab96ce9d648d9ed3b67cb2c06d6868a0a3bd3e0 WHIRLPOOL 755150e31951f2ad6b37a70fe10734a7b0c03b98a16ffac4e6cb1a43be4f91af0def460b573be2e2d176d0fb88854a5cd3fa722190a3809c94430ef4041afd81
+EBUILD glibc-2.23-r3.ebuild 4890 SHA256 364b764f399b9525f719563cf2d50c0c75c092419d38583ae7fff2fffe1eeb7c SHA512 1cc3788c854e92a1ee5df8a421af0d3180f15b83077bd06c83632e49c31b91baea7a58f6a2c849fac6e0438d36de81d989c9e1a1e79ace0db5d2502c67d19344 WHIRLPOOL c5ca04af9119ab27c26ad2c9318eea3e99ddbe61fff67e3a1093e402808bb4dbeb3baa8ee9b192696aadb3ce39b30d1bdf520705e0e731a66a379e4fa19f3083
+EBUILD glibc-2.23-r4.ebuild 5011 SHA256 3690a8b559bd563dc9af89d1217f5021c7da1b89eb5ec513e8b725e04cb45e0e SHA512 3695c8acea09838cc79c33379cfcaf0eb774759f3af5863892ff9c63732926764a8a5187ab9aaccdfd358d62c0884feab95a7055735c9295549d5c8f0c198221 WHIRLPOOL d6a6404e9968ea604d578d500ff7cd550097c1cc30713d61253a130d6a26f9f228ea83189abc611b4704e58be2b74323ab8f106faf4d3db92f7c61f27bf43d93
+EBUILD glibc-2.24-r4.ebuild 5047 SHA256 c200272f9c19ce196e788572aa0ff5e0e0a24b37b6fd3b0a85236406b6ea8f11 SHA512 d93834a9012716293c1992d6217eed6364782e6e01c692e349c6edb00bbda6dd5f227f70977e438b46de0861e9a2d4bc8c04270873cec75b1eb395b1328ea8e2 WHIRLPOOL 4dfbf4334444fb77baca96eb14911738f3253709816a6e87ddc2d53c5eebfec22abc32dd61dece00dd250a13574a35df5b8bb3d6812b6fb27e05e192c5d44297
+EBUILD glibc-2.25-r4.ebuild 4924 SHA256 c0da394b59de8b630923bcf8c6dc1380cf0a78188d6249cd8c9ee4845cd091fd SHA512 b161ebb907156041d3b94d9e0d46de6587be6dc76ebe9e078d5341c4ce5e98644d44b75fc64bb3f2f113564ddd0f9f78409c18a8e64d6e5c73b942da0e065133 WHIRLPOOL 662eecd40af24e60074e023ad01b3a0fb5dcfe5abe2e670f745243700c7630dda1ec438b84617b23b58f82a1743a9976535b8c039494df2d0e35a9a2e81551b5
+EBUILD glibc-2.25-r5.ebuild 4966 SHA256 ed5fdeab50bec85ee4c5127b598cacf66d1f2b7429250203d63e33056d56288b SHA512 9b8eaa8a37ed54c7cf48a40bc9c15da3918d787e0374ffa7d63350d6ccbd2077435871f7021e3c0e975134299c9c1a3b40f990cd9535d35d9f488a0853213a72 WHIRLPOOL a2f1379c652f3acf13ae17775b86bd9775b4a1a9f21af223f23823522714d108ce8351cb2869ef9e9f782bbc256f39162f377f01e6b8aa8182432cf4ea8f0033
+EBUILD glibc-2.25-r7.ebuild 4967 SHA256 3793570b4b1bd9bfc3475ba7edca14683b7c5ec9653141f2d1a67751d85f8f65 SHA512 242db7036410f38e18d9dccf75599602d190acdd6b36c344227383d62853526c398c44f88612628de857b7a8ee6f1194d123a1f4e13c23684ca46482f540f91e WHIRLPOOL 952248ef8b7b31c45e6136141cccbf6544f11f01d006ba9d9ba44528c8bdb8a4cf2dab9a0ce707c74987d71bd5b792e618309750457f72242932870a2d99900b
+EBUILD glibc-2.26-r1.ebuild 23722 SHA256 899859c6118f79e8a74ea4bf962ad05b9c6f7556aaa5fecc725529e4a5139470 SHA512 3ca6176057d707eb408217d19801cffc180f1c1f29b7031ce1b60b600fab92843354a4b41b3a05e195a526c81b3aa1c8b9fe936773365d69c6b3195eb6a4bdd8 WHIRLPOOL dc1d21e11cddbdb3e62ddfce6258fd69e2b79f159a9a98f769a6e38fff723cc074136923a7f2cc426f188fb25d780a0f8a48c752208c830f5b05371a3d7b97b6
+EBUILD glibc-2.26-r2.ebuild 23725 SHA256 f67f77719efc019599fcefa6f54e1c5dd6f8ed90a0afb42307994d7d42b5ced8 SHA512 e9ef1fb2811ac3df63ea69f6f72d34c049917e8760ddb6526d10cd372d11958bfcff7de6d170553970de9a1a59f8eaace01743fa456a5bfa7156461059d30329 WHIRLPOOL 091ad1a6e474082e960a4a0b32a8fd461826a5e7a71b932f0c309c3e0eed7e97e664fdd109f945848a9fe77c6f5abc059555e0f4c258d3a9656201ccbc8c5aef
+EBUILD glibc-9999.ebuild 23727 SHA256 4a47827f79af8a242f802a8bc4931edd714000a2cdb94f3844a96163c0ad612f SHA512 64fe6c86b3bb288ccb1f60a035d3cc26762b1d950c178b8c9717f422390783974417e7a40e4f29f77d790c31571e3d6bcbdd0200f401d129612c81c3d80b4f4c WHIRLPOOL 8fa3b2d67e4eac18332461e3a40a3ff11293fdf0ac866c21f4a6a7b8485e2234e1d471b1eb6ec264fcbeb12efe60872b653484296ce6d9a3fbf20ecb7c9c2348
+MISC ChangeLog 17234 SHA256 6aa54d20b4de284c51e7d0691f861af52e68376d48e91788c79f8ee821300a91 SHA512 39aa17d86df6c1d53c9c2ad268b2123bafccd45a226e064e3b759bda73294c7896d43f9846bf2fa401d29fa04efecee414674d923bb632915175adf7e8b24b2b WHIRLPOOL d60c804c21d7b0065aca45a3f761f0c81f96fe681d60df7f33ce13c879325d23a9908a134f948e50f3c57b5c596c93d1b04932bfb501e88d6d1d88847df62d32
+MISC ChangeLog-2007 108548 SHA256 d622be202eb0d61a363b0ae4065012cd1d494fefaa0c03d4aa7986177cdde6d0 SHA512 fdb3f311a3be4b97a6acfceb1763af5ea69e74d8195522c5d03307f75e15a9382991e9e29dbfdec79e74f1c36328f82648768749bc929e5050ff64b628c7ca98 WHIRLPOOL e550f354394569069e000a7e70ec69c94388a0f415c19b427203f0dcbcbeeec0f5e379ee2af7886cd2d68559e749fab8122e7e077985729d7e0e728ae9096d7a
+MISC ChangeLog-2015 77895 SHA256 d7c16b77521b14a7e1c148f1ad699128e4fcf7caf41a77b46844508ba68acf15 SHA512 1a7fee53e1ec55d0b16b949543b01ad6f429f74293cb6ed730f05a3ddfc4a21fdaf7ee80c0c839d456587a207780ccfefdaf68a236989db5129ffba30c77ff5e WHIRLPOOL 48d46ac586309e415b7d669598c330062afd6fcb2668600d5c62e234d5ab8c3dfd2e81d4f528689efb6d5fb5e2ca5e24c68a4c58be52e1c336127d63224e18fd
+MISC metadata.xml 921 SHA256 c01e0edef8cd5db7d721a3abfba19365507f1cb35df4d62b048468fe49b543f7 SHA512 5d4ecf57cf80cbda0dea361d7996ec5df384eee928c07e8e37e25e0ff82577144878492a49b318000b10f51c1ad03b950db7ee5d74e46e96e688b2fcdccfb66a WHIRLPOOL 7024db2e0a3ea6269c9d4158b966c0fda46eee5c7787a7e99b90cfb366ec816843e8849b9390aaec37af05eb530445fa12e0b70dc75ce16277c10c4234d231df
diff --git a/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c b/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c
new file mode 100644
index 000000000000..37711e8aacbf
--- /dev/null
+++ b/sys-libs/glibc/files/2.10/glibc-2.10-gentoo-chk_fail.c
@@ -0,0 +1,315 @@
+/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Copyright (C) 2006-2008 Gentoo Foundation Inc.
+ * License terms as above.
+ *
+ * Hardened Gentoo SSP and FORTIFY handler
+ *
+ * An SSP failure handler that does not use functions from the rest of
+ * glibc; it uses the INTERNAL_SYSCALL methods directly. This ensures
+ * no possibility of recursion into the handler.
+ *
+ * Direct all bug reports to http://bugs.gentoo.org/
+ *
+ * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
+ * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
+ *
+ * The following people contributed to the glibc-2.3 Hardened
+ * Gentoo SSP and FORTIFY handler, from which this implementation draws much:
+ *
+ * Ned Ludd - <solar[@]gentoo.org>
+ * Alexander Gabert - <pappy[@]gentoo.org>
+ * The PaX Team - <pageexec[@]freemail.hu>
+ * Peter S. Mazinger - <ps.m[@]gmx.net>
+ * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ * Robert Connolly - <robert[@]linuxfromscratch.org>
+ * Cory Visi <cory[@]visi.name>
+ * Mike Frysinger <vapier[@]gentoo.org>
+ * Magnus Granberg <zorry[@]ume.nu>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <sys/types.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include <kernel-features.h>
+
+#include <alloca.h>
+/* from sysdeps */
+#include <socketcall.h>
+/* for the stuff in bits/socket.h */
+#include <sys/socket.h>
+#include <sys/un.h>
+
+/* Sanity check on SYSCALL macro names - force compilation
+ * failure if the names used here do not exist
+ */
+#if !defined __NR_socketcall && !defined __NR_socket
+# error Cannot do syscall socket or socketcall
+#endif
+#if !defined __NR_socketcall && !defined __NR_connect
+# error Cannot do syscall connect or socketcall
+#endif
+#ifndef __NR_write
+# error Cannot do syscall write
+#endif
+#ifndef __NR_close
+# error Cannot do syscall close
+#endif
+#ifndef __NR_getpid
+# error Cannot do syscall getpid
+#endif
+#ifndef __NR_kill
+# error Cannot do syscall kill
+#endif
+#ifndef __NR_exit
+# error Cannot do syscall exit
+#endif
+#ifdef SSP_SMASH_DUMPS_CORE
+# define ENABLE_SSP_SMASH_DUMPS_CORE 1
+# if !defined _KERNEL_NSIG && !defined _NSIG
+# error No _NSIG or _KERNEL_NSIG for rt_sigaction
+# endif
+# if !defined __NR_sigaction && !defined __NR_rt_sigaction
+# error Cannot do syscall sigaction or rt_sigaction
+# endif
+/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
+ * of the _kernel_ sigset_t which is not the same as the user sigset_t.
+ * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
+ * some reason.
+ */
+# ifdef _KERNEL_NSIG
+# define _SSP_NSIG _KERNEL_NSIG
+# else
+# define _SSP_NSIG _NSIG
+# endif
+#else
+# define _SSP_NSIG 0
+# define ENABLE_SSP_SMASH_DUMPS_CORE 0
+#endif
+
+/* Define DO_SIGACTION - default to newer rt signal interface but
+ * fallback to old as needed.
+ */
+#ifdef __NR_rt_sigaction
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
+#else
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
+#endif
+
+/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
+#if defined(__NR_socket) && defined(__NR_connect)
+# define USE_OLD_SOCKETCALL 0
+#else
+# define USE_OLD_SOCKETCALL 1
+#endif
+
+/* stub out the __NR_'s so we can let gcc optimize away dead code */
+#ifndef __NR_socketcall
+# define __NR_socketcall 0
+#endif
+#ifndef __NR_socket
+# define __NR_socket 0
+#endif
+#ifndef __NR_connect
+# define __NR_connect 0
+#endif
+#define DO_SOCKET(result, domain, type, protocol) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = domain; \
+ socketargs[1] = type; \
+ socketargs[2] = protocol; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
+ } while (0)
+#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = sockfd; \
+ socketargs[1] = (unsigned long int)serv_addr; \
+ socketargs[2] = addrlen; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
+ } while (0)
+
+#ifndef _PATH_LOG
+# define _PATH_LOG "/dev/log"
+#endif
+
+static const char path_log[] = _PATH_LOG;
+
+/* For building glibc with SSP switched on, define __progname to a
+ * constant if building for the run-time loader, to avoid pulling
+ * in more of libc.so into ld.so
+ */
+#ifdef IS_IN_rtld
+static char *__progname = "<rtld>";
+#else
+extern char *__progname;
+#endif
+
+/* Common handler code, used by chk_fail
+ * Inlined to ensure no self-references to the handler within itself.
+ * Data static to avoid putting more than necessary on the stack,
+ * to aid core debugging.
+ */
+__attribute__ ((__noreturn__ , __always_inline__))
+static inline void
+__hardened_gentoo_chk_fail(char func[], int damaged)
+{
+#define MESSAGE_BUFSIZ 256
+ static pid_t pid;
+ static int plen, i;
+ static char message[MESSAGE_BUFSIZ];
+ static const char msg_ssa[] = ": buffer overflow attack";
+ static const char msg_inf[] = " in function ";
+ static const char msg_ssd[] = "*** buffer overflow detected ***: ";
+ static const char msg_terminated[] = " - terminated\n";
+ static const char msg_report[] = "Report to http://bugs.gentoo.org/\n";
+ static const char msg_unknown[] = "<unknown>";
+ static int log_socket, connect_result;
+ static struct sockaddr_un sock;
+ static unsigned long int socketargs[4];
+
+ /* Build socket address
+ */
+ sock.sun_family = AF_UNIX;
+ i = 0;
+ while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) {
+ sock.sun_path[i] = path_log[i];
+ i++;
+ }
+ sock.sun_path[i] = '\0';
+
+ /* Try SOCK_DGRAM connection to syslog */
+ connect_result = -1;
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ if (connect_result == -1) {
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+ /* Try SOCK_STREAM connection to syslog */
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ }
+
+ /* Build message. Messages are generated both in the old style and new style,
+ * so that log watchers that are configured for the old-style message continue
+ * to work.
+ */
+#define strconcat(str) \
+ {i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
+ {\
+ message[plen+i]=str[i];\
+ i++;\
+ }\
+ plen+=i;}
+
+ /* R.Henderson post-gcc-4 style message */
+ plen = 0;
+ strconcat(msg_ssd);
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Dr. Etoh pre-gcc-4 style message */
+ plen = 0;
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_ssa);
+ strconcat(msg_inf);
+ if (func != NULL)
+ strconcat(func)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Direct reports to bugs.gentoo.org */
+ plen=0;
+ strconcat(msg_report);
+ message[plen++]='\0';
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+
+ /* Suicide */
+ pid = INLINE_SYSCALL(getpid, 0);
+
+ if (ENABLE_SSP_SMASH_DUMPS_CORE) {
+ static struct sigaction default_abort_act;
+ /* Remove any user-supplied handler for SIGABRT, before using it */
+ default_abort_act.sa_handler = SIG_DFL;
+ default_abort_act.sa_sigaction = NULL;
+ __sigfillset(&default_abort_act.sa_mask);
+ default_abort_act.sa_flags = 0;
+ if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
+ INLINE_SYSCALL(kill, 2, pid, SIGABRT);
+ }
+
+ /* Note; actions cannot be added to SIGKILL */
+ INLINE_SYSCALL(kill, 2, pid, SIGKILL);
+
+ /* In case the kill didn't work, exit anyway
+ * The loop prevents gcc thinking this routine returns
+ */
+ while (1)
+ INLINE_SYSCALL(exit, 0);
+}
+
+__attribute__ ((__noreturn__))
+void __chk_fail(void)
+{
+ __hardened_gentoo_chk_fail(NULL, 0);
+}
+
diff --git a/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch
new file mode 100644
index 000000000000..e75ccc788c89
--- /dev/null
+++ b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-configure-picdefault.patch
@@ -0,0 +1,30 @@
+Prevent default-fPIE from confusing configure into thinking
+PIC code is default. This causes glibc to build both PIC and
+non-PIC code as normal, which on the hardened compiler generates
+PIC and PIE.
+
+Patch by Kevin F. Quinn <kevquinn@gentoo.org>
+Fixed for glibc 2.10 by Magnus Granberg <zorry@ume.nu>
+
+--- configure.in
++++ configure.in
+@@ -2145,7 +2145,7 @@
+ # error PIC is default.
+ #endif
+ EOF
+-if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
++if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
+ libc_cv_pic_default=no
+ fi
+ rm -f conftest.*])
+--- configure
++++ configure
+@@ -7698,7 +7698,7 @@
+ # error PIC is default.
+ #endif
+ EOF
+-if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
++if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then
+ libc_cv_pic_default=no
+ fi
+ rm -f conftest.*
diff --git a/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
new file mode 100644
index 000000000000..cb6d8e3c78ba
--- /dev/null
+++ b/sys-libs/glibc/files/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
@@ -0,0 +1,274 @@
+When building glibc PIE (which is not something upstream support),
+several modifications are necessary to the glibc build process.
+
+First, any syscalls in PIEs must be of the PIC variant, otherwise
+textrels ensue. Then, any syscalls made before the initialisation
+of the TLS will fail on i386, as the sysenter variant on i386 uses
+the TLS, giving rise to a chicken-and-egg situation. This patch
+defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
+version is normally used, and uses the non-sysenter version for the brk
+syscall that is performed by the TLS initialisation. Further, the TLS
+initialisation is moved in this case prior to the initialisation of
+dl_osversion, as that requires further syscalls.
+
+csu/libc-start.c: Move initial TLS initialization to before the
+initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
+
+csu/libc-tls.c: Use the no-sysenter version of sbrk when
+INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
+version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+misc/brk.c: Define a no-sysenter version of brk if
+INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
+Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
+
+Patch by Kevin F. Quinn <kevquinn@gentoo.org>
+Fixed for 2.10 by Magnus Granberg <zorry@ume.nu>
+
+--- csu/libc-start.c
++++ csu/libc-start.c
+@@ -28,6 +28,7 @@
+ extern int __libc_multiple_libcs;
+
+ #include <tls.h>
++#include <sysdep.h>
+ #ifndef SHARED
+ # include <dl-osinfo.h>
+ extern void __pthread_initialize_minimal (void);
+@@ -129,6 +130,11 @@
+ # endif
+ _dl_aux_init (auxvec);
+ # endif
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ /* Do the initial TLS initialization before _dl_osversion,
++ since the latter uses the uname syscall. */
++ __pthread_initialize_minimal ();
++# endif
+ # ifdef DL_SYSDEP_OSCHECK
+ if (!__libc_multiple_libcs)
+ {
+@@ -138,10 +144,12 @@
+ }
+ # endif
+
++# ifndef INTERNAL_SYSCALL_NOSYSENTER
+ /* Initialize the thread library at least a bit since the libgcc
+ functions are using thread functions if these are available and
+ we need to setup errno. */
+ __pthread_initialize_minimal ();
++# endif
+
+ /* Set up the stack checker's canary. */
+ uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
+--- csu/libc-tls.c
++++ csu/libc-tls.c
+@@ -23,6 +23,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <sys/param.h>
++#include <sysdep.h>
+
+
+ #ifdef SHARED
+@@ -29,6 +30,9 @@
+ #error makefile bug, this file is for static only
+ #endif
+
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++extern void *__sbrk_nosysenter (intptr_t __delta);
++#endif
+ extern ElfW(Phdr) *_dl_phdr;
+ extern size_t _dl_phnum;
+
+@@ -141,14 +145,26 @@
+
+ The initialized value of _dl_tls_static_size is provided by dl-open.c
+ to request some surplus that permits dynamic loading of modules with
+- IE-model TLS. */
++ IE-model TLS.
++
++ Where the normal sbrk would use a syscall that needs the TLS (i386)
++ use the special non-sysenter version instead. */
+ #if TLS_TCB_AT_TP
+ tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
++# else
+ tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
++# endif
+ #elif TLS_DTV_AT_TP
+ tcb_offset = roundup (tcbsize, align ?: 1);
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
++ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
++# else
+ tlsblock = __sbrk (tcb_offset + memsz + max_align
+ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
++# endif
+ tlsblock += TLS_PRE_TCB_SIZE;
+ #else
+ /* In case a model with a different layout for the TCB and DTV
+--- misc/sbrk.c
++++ misc/sbrk.c
+@@ -18,6 +18,7 @@
+ #include <errno.h>
+ #include <stdint.h>
+ #include <unistd.h>
++#include <sysdep.h>
+
+ /* Defined in brk.c. */
+ extern void *__curbrk;
+@@ -29,6 +30,35 @@
+ /* Extend the process's data space by INCREMENT.
+ If INCREMENT is negative, shrink data space by - INCREMENT.
+ Return start of new space allocated, or -1 for errors. */
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++/* This version is used by csu/libc-tls.c whem initialising the TLS
++ if the SYSENTER version requires the TLS (which it does on i386).
++ Obviously using the TLS before it is initialised is broken. */
++extern int __brk_nosysenter (void *addr);
++void *
++__sbrk_nosysenter (intptr_t increment)
++{
++ void *oldbrk;
++
++ /* If this is not part of the dynamic library or the library is used
++ via dynamic loading in a statically linked program update
++ __curbrk from the kernel's brk value. That way two separate
++ instances of __brk and __sbrk can share the heap, returning
++ interleaved pieces of it. */
++ if (__curbrk == NULL || __libc_multiple_libcs)
++ if (__brk_nosysenter (0) < 0) /* Initialize the break. */
++ return (void *) -1;
++
++ if (increment == 0)
++ return __curbrk;
++
++ oldbrk = __curbrk;
++ if (__brk_nosysenter (oldbrk + increment) < 0)
++ return (void *) -1;
++
++ return oldbrk;
++}
++#endif
+ void *
+ __sbrk (intptr_t increment)
+ {
+--- sysdeps/unix/sysv/linux/i386/brk.c
++++ sysdeps/unix/sysv/linux/i386/brk.c
+@@ -31,6 +31,30 @@
+ linker. */
+ weak_alias (__curbrk, ___brk_addr)
+
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++/* This version is used by csu/libc-tls.c whem initialising the TLS
++ * if the SYSENTER version requires the TLS (which it does on i386).
++ * Obviously using the TLS before it is initialised is broken. */
++int
++__brk_nosysenter (void *addr)
++{
++ void *__unbounded newbrk;
++
++ INTERNAL_SYSCALL_DECL (err);
++ newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
++ __ptrvalue (addr));
++
++ __curbrk = newbrk;
++
++ if (newbrk < addr)
++ {
++ __set_errno (ENOMEM);
++ return -1;
++ }
++
++ return 0;
++}
++#endif
+ int
+ __brk (void *addr)
+ {
+--- sysdeps/unix/sysv/linux/i386/sysdep.h
++++ sysdeps/unix/sysv/linux/i386/sysdep.h
+@@ -187,7 +187,7 @@
+ /* The original calling convention for system calls on Linux/i386 is
+ to use int $0x80. */
+ #ifdef I386_USE_SYSENTER
+-# ifdef SHARED
++# if defined SHARED || defined __PIC__
+ # define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
+ # else
+ # define ENTER_KERNEL call *_dl_sysinfo
+@@ -358,7 +358,7 @@
+ possible to use more than four parameters. */
+ #undef INTERNAL_SYSCALL
+ #ifdef I386_USE_SYSENTER
+-# ifdef SHARED
++# if defined SHARED || defined __PIC__
+ # define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+ register unsigned int resultvar; \
+@@ -384,6 +384,18 @@
+ : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
+ ASMFMT_##nr(args) : "memory", "cc"); \
+ (int) resultvar; })
++# define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
++ ({ \
++ register unsigned int resultvar; \
++ EXTRAVAR_##nr \
++ asm volatile ( \
++ LOADARGS_NOSYSENTER_##nr \
++ "movl %1, %%eax\n\t" \
++ "int $0x80\n\t" \
++ RESTOREARGS_NOSYSENTER_##nr \
++ : "=a" (resultvar) \
++ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
++ (int) resultvar; })
+ # else
+ # define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+@@ -447,12 +459,20 @@
+
+ #define LOADARGS_0
+ #ifdef __PIC__
+-# if defined I386_USE_SYSENTER && defined SHARED
++# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
+ # define LOADARGS_1 \
+ "bpushl .L__X'%k3, %k3\n\t"
+ # define LOADARGS_5 \
+ "movl %%ebx, %4\n\t" \
+ "movl %3, %%ebx\n\t"
++# define LOADARGS_NOSYSENTER_1 \
++ "bpushl .L__X'%k2, %k2\n\t"
++# define LOADARGS_NOSYSENTER_2 LOADARGS_NOSYSENTER_1
++# define LOADARGS_NOSYSENTER_3 LOADARGS_3
++# define LOADARGS_NOSYSENTER_4 LOADARGS_3
++# define LOADARGS_NOSYSENTER_5 \
++ "movl %%ebx, %3\n\t" \
++ "movl %2, %%ebx\n\t"
+ # else
+ # define LOADARGS_1 \
+ "bpushl .L__X'%k2, %k2\n\t"
+@@ -474,11 +495,18 @@
+
+ #define RESTOREARGS_0
+ #ifdef __PIC__
+-# if defined I386_USE_SYSENTER && defined SHARED
++# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
+ # define RESTOREARGS_1 \
+ "bpopl .L__X'%k3, %k3\n\t"
+ # define RESTOREARGS_5 \
+ "movl %4, %%ebx"
++# define RESTOREARGS_NOSYSENTER_1 \
++ "bpopl .L__X'%k2, %k2\n\t"
++# define RESTOREARGS_NOSYSENTER_2 RESTOREARGS_NOSYSENTER_1
++# define RESTOREARGS_NOSYSENTER_3 RESTOREARGS_3
++# define RESTOREARGS_NOSYSENTER_4 RESTOREARGS_3
++# define RESTOREARGS_NOSYSENTER_5 \
++ "movl %3, %%ebx"
+ # else
+ # define RESTOREARGS_1 \
+ "bpopl .L__X'%k2, %k2\n\t"
diff --git a/sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch b/sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch
new file mode 100644
index 000000000000..da4fb82539cf
--- /dev/null
+++ b/sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch
@@ -0,0 +1,42 @@
+2012-11-11 Magnus Granberg <zorry@gentoo.org>
+
+ #442712
+ * Makeconfig (+link): Set to +link-pie.
+ (+link-static-before-libc): Change $(static-start-installed-name) to
+ S$(static-start-installed-name).
+ (+prector): Set to +prectorS.
+ (+postctor): Set to +postctorS.
+
+--- libc/Makeconfig
++++ libc/Makeconfig
+@@ -447,11 +447,12 @@
+ $(common-objpfx)libc% $(+postinit),$^) \
+ $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
+ endif
+++link = $(+link-pie)
+ # Command for statically linking programs with the C library.
+ ifndef +link-static
+ +link-static-before-libc = $(CC) -nostdlib -nostartfiles -static -o $@ \
+ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+- $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
++ $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
+ $(+preinit) $(+prectorT) \
+ $(filter-out $(addprefix $(csu-objpfx),start.o \
+ $(start-installed-name))\
+@@ -549,11 +550,10 @@
+ ifeq ($(elf),yes)
+ +preinit = $(addprefix $(csu-objpfx),crti.o)
+ +postinit = $(addprefix $(csu-objpfx),crtn.o)
+-+prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
+-+postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
+-# Variants of the two previous definitions for linking PIE programs.
+ +prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
+ +postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
+++prector = $(+prectorS)
+++postctor = $(+postctorS)
+ # Variants of the two previous definitions for statically linking programs.
+ +prectorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o`
+ +postctorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
+ +interp = $(addprefix $(elf-objpfx),interp.os)
+ endif
+ csu-objpfx = $(common-objpfx)csu/
diff --git a/sys-libs/glibc/files/2.18/glibc-2.18-gentoo-chk_fail.c b/sys-libs/glibc/files/2.18/glibc-2.18-gentoo-chk_fail.c
new file mode 100644
index 000000000000..c1934362f628
--- /dev/null
+++ b/sys-libs/glibc/files/2.18/glibc-2.18-gentoo-chk_fail.c
@@ -0,0 +1,314 @@
+/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Copyright (C) 2006-2013 Gentoo Foundation Inc.
+ * License terms as above.
+ *
+ * Hardened Gentoo SSP and FORTIFY handler
+ *
+ * An SSP failure handler that does not use functions from the rest of
+ * glibc; it uses the INTERNAL_SYSCALL methods directly. This ensures
+ * no possibility of recursion into the handler.
+ *
+ * Direct all bug reports to http://bugs.gentoo.org/
+ *
+ * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
+ * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
+ *
+ * The following people contributed to the glibc-2.3 Hardened
+ * Gentoo SSP and FORTIFY handler, from which this implementation draws much:
+ *
+ * Ned Ludd - <solar[@]gentoo.org>
+ * Alexander Gabert - <pappy[@]gentoo.org>
+ * The PaX Team - <pageexec[@]freemail.hu>
+ * Peter S. Mazinger - <ps.m[@]gmx.net>
+ * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ * Robert Connolly - <robert[@]linuxfromscratch.org>
+ * Cory Visi <cory[@]visi.name>
+ * Mike Frysinger <vapier[@]gentoo.org>
+ * Magnus Granberg <zorry[@]ume.nu>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <sys/types.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+
+#include <kernel-features.h>
+
+#include <alloca.h>
+/* from sysdeps */
+#include <socketcall.h>
+/* for the stuff in bits/socket.h */
+#include <sys/socket.h>
+#include <sys/un.h>
+
+/* Sanity check on SYSCALL macro names - force compilation
+ * failure if the names used here do not exist
+ */
+#if !defined __NR_socketcall && !defined __NR_socket
+# error Cannot do syscall socket or socketcall
+#endif
+#if !defined __NR_socketcall && !defined __NR_connect
+# error Cannot do syscall connect or socketcall
+#endif
+#ifndef __NR_write
+# error Cannot do syscall write
+#endif
+#ifndef __NR_close
+# error Cannot do syscall close
+#endif
+#ifndef __NR_getpid
+# error Cannot do syscall getpid
+#endif
+#ifndef __NR_kill
+# error Cannot do syscall kill
+#endif
+#ifndef __NR_exit
+# error Cannot do syscall exit
+#endif
+#ifdef SSP_SMASH_DUMPS_CORE
+# define ENABLE_SSP_SMASH_DUMPS_CORE 1
+# if !defined _KERNEL_NSIG && !defined _NSIG
+# error No _NSIG or _KERNEL_NSIG for rt_sigaction
+# endif
+# if !defined __NR_sigaction && !defined __NR_rt_sigaction
+# error Cannot do syscall sigaction or rt_sigaction
+# endif
+/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
+ * of the _kernel_ sigset_t which is not the same as the user sigset_t.
+ * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
+ * some reason.
+ */
+# ifdef _KERNEL_NSIG
+# define _SSP_NSIG _KERNEL_NSIG
+# else
+# define _SSP_NSIG _NSIG
+# endif
+#else
+# define _SSP_NSIG 0
+# define ENABLE_SSP_SMASH_DUMPS_CORE 0
+#endif
+
+/* Define DO_SIGACTION - default to newer rt signal interface but
+ * fallback to old as needed.
+ */
+#ifdef __NR_rt_sigaction
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
+#else
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
+#endif
+
+/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
+#if defined(__NR_socket) && defined(__NR_connect)
+# define USE_OLD_SOCKETCALL 0
+#else
+# define USE_OLD_SOCKETCALL 1
+#endif
+
+/* stub out the __NR_'s so we can let gcc optimize away dead code */
+#ifndef __NR_socketcall
+# define __NR_socketcall 0
+#endif
+#ifndef __NR_socket
+# define __NR_socket 0
+#endif
+#ifndef __NR_connect
+# define __NR_connect 0
+#endif
+#define DO_SOCKET(result, domain, type, protocol) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = domain; \
+ socketargs[1] = type; \
+ socketargs[2] = protocol; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
+ } while (0)
+#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = sockfd; \
+ socketargs[1] = (unsigned long int)serv_addr; \
+ socketargs[2] = addrlen; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
+ } while (0)
+
+#ifndef _PATH_LOG
+# define _PATH_LOG "/dev/log"
+#endif
+
+static const char path_log[] = _PATH_LOG;
+
+/* For building glibc with SSP switched on, define __progname to a
+ * constant if building for the run-time loader, to avoid pulling
+ * in more of libc.so into ld.so
+ */
+#ifdef IS_IN_rtld
+static char *__progname = "<rtld>";
+#else
+extern char *__progname;
+#endif
+
+/* Common handler code, used by chk_fail
+ * Inlined to ensure no self-references to the handler within itself.
+ * Data static to avoid putting more than necessary on the stack,
+ * to aid core debugging.
+ */
+__attribute__ ((__noreturn__ , __always_inline__))
+static inline void
+__hardened_gentoo_chk_fail(char func[], int damaged)
+{
+#define MESSAGE_BUFSIZ 256
+ static pid_t pid;
+ static int plen, i;
+ static char message[MESSAGE_BUFSIZ];
+ static const char msg_ssa[] = ": buffer overflow attack";
+ static const char msg_inf[] = " in function ";
+ static const char msg_ssd[] = "*** buffer overflow detected ***: ";
+ static const char msg_terminated[] = " - terminated\n";
+ static const char msg_report[] = "Report to http://bugs.gentoo.org/\n";
+ static const char msg_unknown[] = "<unknown>";
+ static int log_socket, connect_result;
+ static struct sockaddr_un sock;
+ static unsigned long int socketargs[4];
+
+ /* Build socket address
+ */
+ sock.sun_family = AF_UNIX;
+ i = 0;
+ while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) {
+ sock.sun_path[i] = path_log[i];
+ i++;
+ }
+ sock.sun_path[i] = '\0';
+
+ /* Try SOCK_DGRAM connection to syslog */
+ connect_result = -1;
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ if (connect_result == -1) {
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+ /* Try SOCK_STREAM connection to syslog */
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ }
+
+ /* Build message. Messages are generated both in the old style and new style,
+ * so that log watchers that are configured for the old-style message continue
+ * to work.
+ */
+#define strconcat(str) \
+ {i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
+ {\
+ message[plen+i]=str[i];\
+ i++;\
+ }\
+ plen+=i;}
+
+ /* R.Henderson post-gcc-4 style message */
+ plen = 0;
+ strconcat(msg_ssd);
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Dr. Etoh pre-gcc-4 style message */
+ plen = 0;
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_ssa);
+ strconcat(msg_inf);
+ if (func != NULL)
+ strconcat(func)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Direct reports to bugs.gentoo.org */
+ plen=0;
+ strconcat(msg_report);
+ message[plen++]='\0';
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+
+ /* Suicide */
+ pid = INLINE_SYSCALL(getpid, 0);
+
+ if (ENABLE_SSP_SMASH_DUMPS_CORE) {
+ static struct sigaction default_abort_act;
+ /* Remove any user-supplied handler for SIGABRT, before using it */
+ default_abort_act.sa_handler = SIG_DFL;
+ default_abort_act.sa_sigaction = NULL;
+ __sigfillset(&default_abort_act.sa_mask);
+ default_abort_act.sa_flags = 0;
+ if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
+ INLINE_SYSCALL(kill, 2, pid, SIGABRT);
+ }
+
+ /* Note; actions cannot be added to SIGKILL */
+ INLINE_SYSCALL(kill, 2, pid, SIGKILL);
+
+ /* In case the kill didn't work, exit anyway
+ * The loop prevents gcc thinking this routine returns
+ */
+ while (1)
+ INLINE_SYSCALL(exit, 0);
+}
+
+__attribute__ ((__noreturn__))
+void __chk_fail(void)
+{
+ __hardened_gentoo_chk_fail(NULL, 0);
+}
+
diff --git a/sys-libs/glibc/files/2.18/glibc-2.18-gentoo-stack_chk_fail.c b/sys-libs/glibc/files/2.18/glibc-2.18-gentoo-stack_chk_fail.c
new file mode 100644
index 000000000000..9535c2157895
--- /dev/null
+++ b/sys-libs/glibc/files/2.18/glibc-2.18-gentoo-stack_chk_fail.c
@@ -0,0 +1,322 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Copyright (C) 2006-2013 Gentoo Foundation Inc.
+ * License terms as above.
+ *
+ * Hardened Gentoo SSP handler
+ *
+ * An SSP failure handler that does not use functions from the rest of
+ * glibc; it uses the INTERNAL_SYSCALL methods directly. This ensures
+ * no possibility of recursion into the handler.
+ *
+ * Direct all bug reports to http://bugs.gentoo.org/
+ *
+ * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
+ * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
+ *
+ * Fixed to support glibc-2.18 by Magnus Granberg - <zorry[@]gentoo.org>
+ *
+ * The following people contributed to the glibc-2.3 Hardened
+ * Gentoo SSP handler, from which this implementation draws much:
+ *
+ * Ned Ludd - <solar[@]gentoo.org>
+ * Alexander Gabert - <pappy[@]gentoo.org>
+ * The PaX Team - <pageexec[@]freemail.hu>
+ * Peter S. Mazinger - <ps.m[@]gmx.net>
+ * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ * Robert Connolly - <robert[@]linuxfromscratch.org>
+ * Cory Visi <cory[@]visi.name>
+ * Mike Frysinger <vapier[@]gentoo.org>
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <sys/types.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+
+#include <kernel-features.h>
+
+#include <alloca.h>
+/* from sysdeps */
+#include <socketcall.h>
+/* for the stuff in bits/socket.h */
+#include <sys/socket.h>
+#include <sys/un.h>
+
+
+/* Sanity check on SYSCALL macro names - force compilation
+ * failure if the names used here do not exist
+ */
+#if !defined __NR_socketcall && !defined __NR_socket
+# error Cannot do syscall socket or socketcall
+#endif
+#if !defined __NR_socketcall && !defined __NR_connect
+# error Cannot do syscall connect or socketcall
+#endif
+#ifndef __NR_write
+# error Cannot do syscall write
+#endif
+#ifndef __NR_close
+# error Cannot do syscall close
+#endif
+#ifndef __NR_getpid
+# error Cannot do syscall getpid
+#endif
+#ifndef __NR_kill
+# error Cannot do syscall kill
+#endif
+#ifndef __NR_exit
+# error Cannot do syscall exit
+#endif
+#ifdef SSP_SMASH_DUMPS_CORE
+# define ENABLE_SSP_SMASH_DUMPS_CORE 1
+# if !defined _KERNEL_NSIG && !defined _NSIG
+# error No _NSIG or _KERNEL_NSIG for rt_sigaction
+# endif
+# if !defined __NR_sigaction && !defined __NR_rt_sigaction
+# error Cannot do syscall sigaction or rt_sigaction
+# endif
+/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
+ * of the _kernel_ sigset_t which is not the same as the user sigset_t.
+ * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
+ * some reason.
+ */
+# ifdef _KERNEL_NSIG
+# define _SSP_NSIG _KERNEL_NSIG
+# else
+# define _SSP_NSIG _NSIG
+# endif
+#else
+# define _SSP_NSIG 0
+# define ENABLE_SSP_SMASH_DUMPS_CORE 0
+#endif
+
+/* Define DO_SIGACTION - default to newer rt signal interface but
+ * fallback to old as needed.
+ */
+#ifdef __NR_rt_sigaction
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
+#else
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
+#endif
+
+/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
+#if defined(__NR_socket) && defined(__NR_connect)
+# define USE_OLD_SOCKETCALL 0
+#else
+# define USE_OLD_SOCKETCALL 1
+#endif
+/* stub out the __NR_'s so we can let gcc optimize away dead code */
+#ifndef __NR_socketcall
+# define __NR_socketcall 0
+#endif
+#ifndef __NR_socket
+# define __NR_socket 0
+#endif
+#ifndef __NR_connect
+# define __NR_connect 0
+#endif
+#define DO_SOCKET(result, domain, type, protocol) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = domain; \
+ socketargs[1] = type; \
+ socketargs[2] = protocol; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
+ } while (0)
+#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = sockfd; \
+ socketargs[1] = (unsigned long int)serv_addr; \
+ socketargs[2] = addrlen; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
+ } while (0)
+
+#ifndef _PATH_LOG
+# define _PATH_LOG "/dev/log"
+#endif
+
+static const char path_log[] = _PATH_LOG;
+
+/* For building glibc with SSP switched on, define __progname to a
+ * constant if building for the run-time loader, to avoid pulling
+ * in more of libc.so into ld.so
+ */
+#ifdef IS_IN_rtld
+static char *__progname = "<rtld>";
+#else
+extern char *__progname;
+#endif
+
+
+/* Common handler code, used by stack_chk_fail and __stack_smash_handler
+ * Inlined to ensure no self-references to the handler within itself.
+ * Data static to avoid putting more than necessary on the stack,
+ * to aid core debugging.
+ */
+__attribute__ ((__noreturn__ , __always_inline__))
+static inline void
+__hardened_gentoo_stack_chk_fail(char func[], int damaged)
+{
+#define MESSAGE_BUFSIZ 256
+ static pid_t pid;
+ static int plen, i;
+ static char message[MESSAGE_BUFSIZ];
+ static const char msg_ssa[] = ": stack smashing attack";
+ static const char msg_inf[] = " in function ";
+ static const char msg_ssd[] = "*** stack smashing detected ***: ";
+ static const char msg_terminated[] = " - terminated\n";
+ static const char msg_report[] = "Report to http://bugs.gentoo.org/\n";
+ static const char msg_unknown[] = "<unknown>";
+ static int log_socket, connect_result;
+ static struct sockaddr_un sock;
+ static unsigned long int socketargs[4];
+
+ /* Build socket address
+ */
+ sock.sun_family = AF_UNIX;
+ i = 0;
+ while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) {
+ sock.sun_path[i] = path_log[i];
+ i++;
+ }
+ sock.sun_path[i] = '\0';
+
+ /* Try SOCK_DGRAM connection to syslog */
+ connect_result = -1;
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ if (connect_result == -1) {
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+ /* Try SOCK_STREAM connection to syslog */
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ }
+
+ /* Build message. Messages are generated both in the old style and new style,
+ * so that log watchers that are configured for the old-style message continue
+ * to work.
+ */
+#define strconcat(str) \
+ {i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
+ {\
+ message[plen+i]=str[i];\
+ i++;\
+ }\
+ plen+=i;}
+
+ /* R.Henderson post-gcc-4 style message */
+ plen = 0;
+ strconcat(msg_ssd);
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Dr. Etoh pre-gcc-4 style message */
+ plen = 0;
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_ssa);
+ strconcat(msg_inf);
+ if (func != NULL)
+ strconcat(func)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Direct reports to bugs.gentoo.org */
+ plen=0;
+ strconcat(msg_report);
+ message[plen++]='\0';
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+
+ /* Suicide */
+ pid = INLINE_SYSCALL(getpid, 0);
+
+ if (ENABLE_SSP_SMASH_DUMPS_CORE) {
+ static struct sigaction default_abort_act;
+ /* Remove any user-supplied handler for SIGABRT, before using it */
+ default_abort_act.sa_handler = SIG_DFL;
+ default_abort_act.sa_sigaction = NULL;
+ __sigfillset(&default_abort_act.sa_mask);
+ default_abort_act.sa_flags = 0;
+ if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
+ INLINE_SYSCALL(kill, 2, pid, SIGABRT);
+ }
+
+ /* Note; actions cannot be added to SIGKILL */
+ INLINE_SYSCALL(kill, 2, pid, SIGKILL);
+
+ /* In case the kill didn't work, exit anyway
+ * The loop prevents gcc thinking this routine returns
+ */
+ while (1)
+ INLINE_SYSCALL(exit, 0);
+}
+
+__attribute__ ((__noreturn__))
+void __stack_chk_fail(void)
+{
+ __hardened_gentoo_stack_chk_fail(NULL, 0);
+}
+
+#ifdef ENABLE_OLD_SSP_COMPAT
+__attribute__ ((__noreturn__))
+void __stack_smash_handler(char func[], int damaged)
+{
+ __hardened_gentoo_stack_chk_fail(func, damaged);
+}
+#endif
diff --git a/sys-libs/glibc/files/2.18/glibc-2.18-hardened-inittls-nosysenter.patch b/sys-libs/glibc/files/2.18/glibc-2.18-hardened-inittls-nosysenter.patch
new file mode 100644
index 000000000000..8907ab2c6a34
--- /dev/null
+++ b/sys-libs/glibc/files/2.18/glibc-2.18-hardened-inittls-nosysenter.patch
@@ -0,0 +1,277 @@
+When building glibc PIE (which is not something upstream support),
+several modifications are necessary to the glibc build process.
+
+First, any syscalls in PIEs must be of the PIC variant, otherwise
+textrels ensue. Then, any syscalls made before the initialisation
+of the TLS will fail on i386, as the sysenter variant on i386 uses
+the TLS, giving rise to a chicken-and-egg situation. This patch
+defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
+version is normally used, and uses the non-sysenter version for the brk
+syscall that is performed by the TLS initialisation. Further, the TLS
+initialisation is moved in this case prior to the initialisation of
+dl_osversion, as that requires further syscalls.
+
+csu/libc-start.c: Move initial TLS initialization to before the
+initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
+
+csu/libc-tls.c: Use the no-sysenter version of sbrk when
+INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
+version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+misc/brk.c: Define a no-sysenter version of brk if
+INTERNAL_SYSCALL_NOSYSENTER is defined.
+
+sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
+Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
+
+Patch by Kevin F. Quinn <kevquinn@gentoo.org>
+Fixed for 2.10 by Magnus Granberg <zorry@ume.nu>
+Fixed for 2.18 by Magnus Granberg <zorry@gentoo.org>
+
+--- csu/libc-start.c
++++ csu/libc-start.c
+@@ -28,6 +28,7 @@
+ extern int __libc_multiple_libcs;
+
+ #include <tls.h>
++#include <sysdep.h>
+ #ifndef SHARED
+ # include <dl-osinfo.h>
+ extern void __pthread_initialize_minimal (void);
+@@ -170,7 +170,11 @@ LIBC_START_MAIN (int (*main) (int, char
+ GL(dl_phnum) = __ehdr_start.e_phnum;
+ }
+ }
+-
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ /* Do the initial TLS initialization before _dl_osversion,
++ since the latter uses the uname syscall. */
++ __pthread_initialize_minimal ();
++# endif
+ # ifdef DL_SYSDEP_OSCHECK
+ if (!__libc_multiple_libcs)
+ {
+@@ -138,10 +144,12 @@
+ }
+ # endif
+
++# ifndef INTERNAL_SYSCALL_NOSYSENTER
+ /* Initialize the thread library at least a bit since the libgcc
+ functions are using thread functions if these are available and
+ we need to setup errno. */
+ __pthread_initialize_minimal ();
++# endif
+
+ /* Set up the stack checker's canary. */
+ uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
+--- csu/libc-tls.c
++++ csu/libc-tls.c
+@@ -22,14 +22,17 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <sys/param.h>
+-
++#include <sysdep.h>
+
+ #ifdef SHARED
+ #error makefile bug, this file is for static only
+ #endif
+
+-dtv_t _dl_static_dtv[2 + TLS_SLOTINFO_SURPLUS];
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++extern void *__sbrk_nosysenter (intptr_t __delta);
++#endif
+
++dtv_t _dl_static_dtv[2 + TLS_SLOTINFO_SURPLUS];
+
+ static struct
+ {
+@@ -139,14 +142,26 @@ __libc_setup_tls (size_t tcbsize, size_t
+
+ The initialized value of _dl_tls_static_size is provided by dl-open.c
+ to request some surplus that permits dynamic loading of modules with
+- IE-model TLS. */
++ IE-model TLS.
++
++ Where the normal sbrk would use a syscall that needs the TLS (i386)
++ use the special non-sysenter version instead. */
+ #if TLS_TCB_AT_TP
+ tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
++# else
+ tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
++#endif
+ #elif TLS_DTV_AT_TP
+ tcb_offset = roundup (tcbsize, align ?: 1);
++# ifdef INTERNAL_SYSCALL_NOSYSENTER
++ tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
++ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
++# else
+ tlsblock = __sbrk (tcb_offset + memsz + max_align
+ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
++#endif
+ tlsblock += TLS_PRE_TCB_SIZE;
+ #else
+ /* In case a model with a different layout for the TCB and DTV
+--- misc/sbrk.c
++++ misc/sbrk.c
+@@ -18,6 +18,7 @@
+ #include <errno.h>
+ #include <stdint.h>
+ #include <unistd.h>
++#include <sysdep.h>
+
+ /* Defined in brk.c. */
+ extern void *__curbrk;
+@@ -29,6 +30,35 @@
+ /* Extend the process's data space by INCREMENT.
+ If INCREMENT is negative, shrink data space by - INCREMENT.
+ Return start of new space allocated, or -1 for errors. */
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++/* This version is used by csu/libc-tls.c whem initialising the TLS
++ if the SYSENTER version requires the TLS (which it does on i386).
++ Obviously using the TLS before it is initialised is broken. */
++extern int __brk_nosysenter (void *addr);
++void *
++__sbrk_nosysenter (intptr_t increment)
++{
++ void *oldbrk;
++
++ /* If this is not part of the dynamic library or the library is used
++ via dynamic loading in a statically linked program update
++ __curbrk from the kernel's brk value. That way two separate
++ instances of __brk and __sbrk can share the heap, returning
++ interleaved pieces of it. */
++ if (__curbrk == NULL || __libc_multiple_libcs)
++ if (__brk_nosysenter (0) < 0) /* Initialize the break. */
++ return (void *) -1;
++
++ if (increment == 0)
++ return __curbrk;
++
++ oldbrk = __curbrk;
++ if (__brk_nosysenter (oldbrk + increment) < 0)
++ return (void *) -1;
++
++ return oldbrk;
++}
++#endif
+ void *
+ __sbrk (intptr_t increment)
+ {
+--- sysdeps/unix/sysv/linux/i386/brk.c
++++ sysdeps/unix/sysv/linux/i386/brk.c
+@@ -31,6 +31,29 @@
+ linker. */
+ weak_alias (__curbrk, ___brk_addr)
+
++#ifdef INTERNAL_SYSCALL_NOSYSENTER
++/* This version is used by csu/libc-tls.c whem initialising the TLS
++ * if the SYSENTER version requires the TLS (which it does on i386).
++ * Obviously using the TLS before it is initialised is broken. */
++int
++__brk_nosysenter (void *addr)
++{
++ void * newbrk;
++
++ INTERNAL_SYSCALL_DECL (err);
++ newbrk = (void *) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1, addr);
++
++ __curbrk = newbrk;
++
++ if (newbrk < addr)
++ {
++ __set_errno (ENOMEM);
++ return -1;
++ }
++
++ return 0;
++}
++#endif
+ int
+ __brk (void *addr)
+ {
+--- sysdeps/unix/sysv/linux/i386/sysdep.h
++++ sysdeps/unix/sysv/linux/i386/sysdep.h
+@@ -187,7 +187,7 @@
+ /* The original calling convention for system calls on Linux/i386 is
+ to use int $0x80. */
+ #ifdef I386_USE_SYSENTER
+-# ifdef SHARED
++# if defined SHARED || defined __PIC__
+ # define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
+ # else
+ # define ENTER_KERNEL call *_dl_sysinfo
+@@ -358,7 +358,7 @@
+ possible to use more than four parameters. */
+ #undef INTERNAL_SYSCALL
+ #ifdef I386_USE_SYSENTER
+-# ifdef SHARED
++# if defined SHARED || defined __PIC__
+ # define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+ register unsigned int resultvar; \
+@@ -384,6 +384,18 @@
+ : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
+ ASMFMT_##nr(args) : "memory", "cc"); \
+ (int) resultvar; })
++# define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
++ ({ \
++ register unsigned int resultvar; \
++ EXTRAVAR_##nr \
++ asm volatile ( \
++ LOADARGS_NOSYSENTER_##nr \
++ "movl %1, %%eax\n\t" \
++ "int $0x80\n\t" \
++ RESTOREARGS_NOSYSENTER_##nr \
++ : "=a" (resultvar) \
++ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
++ (int) resultvar; })
+ # else
+ # define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+@@ -447,12 +459,20 @@
+
+ #define LOADARGS_0
+ #ifdef __PIC__
+-# if defined I386_USE_SYSENTER && defined SHARED
++# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
+ # define LOADARGS_1 \
+ "bpushl .L__X'%k3, %k3\n\t"
+ # define LOADARGS_5 \
+ "movl %%ebx, %4\n\t" \
+ "movl %3, %%ebx\n\t"
++# define LOADARGS_NOSYSENTER_1 \
++ "bpushl .L__X'%k2, %k2\n\t"
++# define LOADARGS_NOSYSENTER_2 LOADARGS_NOSYSENTER_1
++# define LOADARGS_NOSYSENTER_3 LOADARGS_3
++# define LOADARGS_NOSYSENTER_4 LOADARGS_3
++# define LOADARGS_NOSYSENTER_5 \
++ "movl %%ebx, %3\n\t" \
++ "movl %2, %%ebx\n\t"
+ # else
+ # define LOADARGS_1 \
+ "bpushl .L__X'%k2, %k2\n\t"
+@@ -474,11 +495,18 @@
+
+ #define RESTOREARGS_0
+ #ifdef __PIC__
+-# if defined I386_USE_SYSENTER && defined SHARED
++# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
+ # define RESTOREARGS_1 \
+ "bpopl .L__X'%k3, %k3\n\t"
+ # define RESTOREARGS_5 \
+ "movl %4, %%ebx"
++# define RESTOREARGS_NOSYSENTER_1 \
++ "bpopl .L__X'%k2, %k2\n\t"
++# define RESTOREARGS_NOSYSENTER_2 RESTOREARGS_NOSYSENTER_1
++# define RESTOREARGS_NOSYSENTER_3 RESTOREARGS_3
++# define RESTOREARGS_NOSYSENTER_4 RESTOREARGS_3
++# define RESTOREARGS_NOSYSENTER_5 \
++ "movl %3, %%ebx"
+ # else
+ # define RESTOREARGS_1 \
+ "bpopl .L__X'%k2, %k2\n\t"
diff --git a/sys-libs/glibc/files/2.19/glibc-2.19-hardened-configure-picdefault.patch b/sys-libs/glibc/files/2.19/glibc-2.19-hardened-configure-picdefault.patch
new file mode 100644
index 000000000000..341d8c5028e1
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-hardened-configure-picdefault.patch
@@ -0,0 +1,30 @@
+Prevent default-fPIE from confusing configure into thinking
+PIC code is default. This causes glibc to build both PIC and
+non-PIC code as normal, which on the hardened compiler generates
+PIC and PIE.
+
+Patch by Kevin F. Quinn <kevquinn@gentoo.org>
+Fixed for glibc 2.19 by Magnus Granberg <zorry@ume.nu>
+
+--- configure.ac
++++ configure.ac
+@@ -2145,7 +2145,7 @@
+ # error PIC is default.
+ #endif
+ EOF
+-if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
++if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
+ libc_cv_pic_default=no
+ fi
+ rm -f conftest.*])
+--- configure
++++ configure
+@@ -7698,7 +7698,7 @@
+ # error PIC is default.
+ #endif
+ EOF
+-if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
++if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then
+ libc_cv_pic_default=no
+ fi
+ rm -f conftest.*
diff --git a/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch b/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch
new file mode 100644
index 000000000000..72a616a046a8
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/503838
+http://gcc.gnu.org/PR60465
+https://sourceware.org/ml/libc-alpha/2015-12/msg00556.html
+https://trofi.github.io/posts/189-glibc-on-ia64-or-how-relocations-bootstrap.html
+
+newer versions of gcc generate relocations in the elf_get_dynamic_info func
+which glibc relies on to populate some info structs. those structs are then
+used by ldso to process relocations in itself. glibc requires that there are
+no relocations until that point (*after* elf_get_dynamic_info), so we end up
+crashing during elf_get_dynamic_info because the relocation has not yet been
+processed.
+
+this hack shuffles the code in a way that tricks gcc into not generating the
+relocation. we need to figure out something better for upstream.
+
+--- a/elf/get-dynamic-info.h
++++ b/elf/get-dynamic-info.h
+@@ -66,8 +66,12 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
+ info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
+ + DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn;
+ else if ((d_tag_utype) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
+- info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
+- + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn;
++ {
++ d_tag_utype i =
++ DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
++ + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM;
++ info[i] = dyn;
++ }
+ ++dyn;
+ }
+
diff --git a/sys-libs/glibc/files/2.20/glibc-2.20-gentoo-chk_fail.c b/sys-libs/glibc/files/2.20/glibc-2.20-gentoo-chk_fail.c
new file mode 100644
index 000000000000..a8ab9d8a3e29
--- /dev/null
+++ b/sys-libs/glibc/files/2.20/glibc-2.20-gentoo-chk_fail.c
@@ -0,0 +1,299 @@
+/* Copyright (C) 2004-2014 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Gentoo Foundation Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Hardened Gentoo SSP and FORTIFY handler
+
+ A failure handler that does not use functions from the rest of glibc;
+ it uses the INTERNAL_SYSCALL methods directly. This helps ensure no
+ possibility of recursion into the handler.
+
+ Direct all bug reports to http://bugs.gentoo.org/
+
+ People who have contributed significantly to the evolution of this file:
+ Ned Ludd - <solar[@]gentoo.org>
+ Alexander Gabert - <pappy[@]gentoo.org>
+ The PaX Team - <pageexec[@]freemail.hu>
+ Peter S. Mazinger - <ps.m[@]gmx.net>
+ Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ Robert Connolly - <robert[@]linuxfromscratch.org>
+ Cory Visi <cory[@]visi.name>
+ Mike Frysinger <vapier[@]gentoo.org>
+ Magnus Granberg <zorry[@]gentoo.org>
+ Kevin F. Quinn - <kevquinn[@]gentoo.org>
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <sys/types.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+
+#include <kernel-features.h>
+
+#include <alloca.h>
+/* from sysdeps */
+#include <socketcall.h>
+/* for the stuff in bits/socket.h */
+#include <sys/socket.h>
+#include <sys/un.h>
+
+/* Sanity check on SYSCALL macro names - force compilation
+ * failure if the names used here do not exist
+ */
+#if !defined __NR_socketcall && !defined __NR_socket
+# error Cannot do syscall socket or socketcall
+#endif
+#if !defined __NR_socketcall && !defined __NR_connect
+# error Cannot do syscall connect or socketcall
+#endif
+#ifndef __NR_write
+# error Cannot do syscall write
+#endif
+#ifndef __NR_close
+# error Cannot do syscall close
+#endif
+#ifndef __NR_getpid
+# error Cannot do syscall getpid
+#endif
+#ifndef __NR_kill
+# error Cannot do syscall kill
+#endif
+#ifndef __NR_exit
+# error Cannot do syscall exit
+#endif
+#ifdef SSP_SMASH_DUMPS_CORE
+# define ENABLE_SSP_SMASH_DUMPS_CORE 1
+# if !defined _KERNEL_NSIG && !defined _NSIG
+# error No _NSIG or _KERNEL_NSIG for rt_sigaction
+# endif
+# if !defined __NR_sigaction && !defined __NR_rt_sigaction
+# error Cannot do syscall sigaction or rt_sigaction
+# endif
+/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
+ * of the _kernel_ sigset_t which is not the same as the user sigset_t.
+ * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
+ * some reason.
+ */
+# ifdef _KERNEL_NSIG
+# define _SSP_NSIG _KERNEL_NSIG
+# else
+# define _SSP_NSIG _NSIG
+# endif
+#else
+# define _SSP_NSIG 0
+# define ENABLE_SSP_SMASH_DUMPS_CORE 0
+#endif
+
+/* Define DO_SIGACTION - default to newer rt signal interface but
+ * fallback to old as needed.
+ */
+#ifdef __NR_rt_sigaction
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
+#else
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
+#endif
+
+/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
+#if defined(__NR_socket) && defined(__NR_connect)
+# define USE_OLD_SOCKETCALL 0
+#else
+# define USE_OLD_SOCKETCALL 1
+#endif
+
+/* stub out the __NR_'s so we can let gcc optimize away dead code */
+#ifndef __NR_socketcall
+# define __NR_socketcall 0
+#endif
+#ifndef __NR_socket
+# define __NR_socket 0
+#endif
+#ifndef __NR_connect
+# define __NR_connect 0
+#endif
+#define DO_SOCKET(result, domain, type, protocol) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = domain; \
+ socketargs[1] = type; \
+ socketargs[2] = protocol; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
+ } while (0)
+#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = sockfd; \
+ socketargs[1] = (unsigned long int)serv_addr; \
+ socketargs[2] = addrlen; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
+ } while (0)
+
+#ifndef _PATH_LOG
+# define _PATH_LOG "/dev/log"
+#endif
+
+static const char path_log[] = _PATH_LOG;
+
+/* For building glibc with SSP switched on, define __progname to a
+ * constant if building for the run-time loader, to avoid pulling
+ * in more of libc.so into ld.so
+ */
+#ifdef IS_IN_rtld
+static const char *__progname = "<ldso>";
+#else
+extern const char *__progname;
+#endif
+
+#ifdef GENTOO_SSP_HANDLER
+# define ERROR_MSG "stack smashing"
+#else
+# define ERROR_MSG "buffer overflow"
+#endif
+
+/* Common handler code, used by chk_fail
+ * Inlined to ensure no self-references to the handler within itself.
+ * Data static to avoid putting more than necessary on the stack,
+ * to aid core debugging.
+ */
+__attribute__ ((__noreturn__, __always_inline__))
+static inline void
+__hardened_gentoo_fail(void)
+{
+#define MESSAGE_BUFSIZ 512
+ static pid_t pid;
+ static int plen, i, hlen;
+ static char message[MESSAGE_BUFSIZ];
+ /* <11> is LOG_USER|LOG_ERR. A dummy date for loggers to skip over. */
+ static const char msg_header[] = "<11>" __DATE__ " " __TIME__ " glibc-gentoo-hardened-check: ";
+ static const char msg_ssd[] = "*** " ERROR_MSG " detected ***: ";
+ static const char msg_terminated[] = " terminated; ";
+ static const char msg_report[] = "report to " REPORT_BUGS_TO "\n";
+ static const char msg_unknown[] = "<unknown>";
+ static int log_socket, connect_result;
+ static struct sockaddr_un sock;
+ static unsigned long int socketargs[4];
+
+ /* Build socket address */
+ sock.sun_family = AF_UNIX;
+ i = 0;
+ while (path_log[i] != '\0' && i < sizeof(sock.sun_path) - 1) {
+ sock.sun_path[i] = path_log[i];
+ ++i;
+ }
+ sock.sun_path[i] = '\0';
+
+ /* Try SOCK_DGRAM connection to syslog */
+ connect_result = -1;
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ if (connect_result == -1) {
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+ /* Try SOCK_STREAM connection to syslog */
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ }
+
+ /* Build message. Messages are generated both in the old style and new style,
+ * so that log watchers that are configured for the old-style message continue
+ * to work.
+ */
+#define strconcat(str) \
+ ({ \
+ i = 0; \
+ while ((str[i] != '\0') && ((i + plen) < (MESSAGE_BUFSIZ - 1))) { \
+ message[plen + i] = str[i]; \
+ ++i; \
+ } \
+ plen += i; \
+ })
+
+ /* Tersely log the failure */
+ plen = 0;
+ strconcat(msg_header);
+ hlen = plen;
+ strconcat(msg_ssd);
+ if (__progname != NULL)
+ strconcat(__progname);
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+ strconcat(msg_report);
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message + hlen, plen - hlen);
+ if (connect_result != -1) {
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+ INLINE_SYSCALL(close, 1, log_socket);
+ }
+
+ /* Time to kill self since we have no idea what is going on */
+ pid = INLINE_SYSCALL(getpid, 0);
+
+ if (ENABLE_SSP_SMASH_DUMPS_CORE) {
+ /* Remove any user-supplied handler for SIGABRT, before using it. */
+#if 0
+ /*
+ * Note: Disabled because some programs catch & process their
+ * own crashes. We've already enabled this code path which
+ * means we want to let core dumps happen.
+ */
+ static struct sigaction default_abort_act;
+ default_abort_act.sa_handler = SIG_DFL;
+ default_abort_act.sa_sigaction = NULL;
+ __sigfillset(&default_abort_act.sa_mask);
+ default_abort_act.sa_flags = 0;
+ if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
+#endif
+ INLINE_SYSCALL(kill, 2, pid, SIGABRT);
+ }
+
+ /* SIGKILL is only signal which cannot be caught */
+ INLINE_SYSCALL(kill, 2, pid, SIGKILL);
+
+ /* In case the kill didn't work, exit anyway.
+ * The loop prevents gcc thinking this routine returns.
+ */
+ while (1)
+ INLINE_SYSCALL(exit, 1, 137);
+}
+
+__attribute__ ((__noreturn__))
+#ifdef GENTOO_SSP_HANDLER
+void __stack_chk_fail(void)
+#else
+void __chk_fail(void)
+#endif
+{
+ __hardened_gentoo_fail();
+}
diff --git a/sys-libs/glibc/files/2.20/glibc-2.20-gentoo-stack_chk_fail.c b/sys-libs/glibc/files/2.20/glibc-2.20-gentoo-stack_chk_fail.c
new file mode 100644
index 000000000000..4a537bb52c5f
--- /dev/null
+++ b/sys-libs/glibc/files/2.20/glibc-2.20-gentoo-stack_chk_fail.c
@@ -0,0 +1,2 @@
+#define GENTOO_SSP_HANDLER
+#include <debug/chk_fail.c>
diff --git a/sys-libs/glibc/files/2.20/glibc-2.20-hardened-inittls-nosysenter.patch b/sys-libs/glibc/files/2.20/glibc-2.20-hardened-inittls-nosysenter.patch
new file mode 100644
index 000000000000..35eabe94014a
--- /dev/null
+++ b/sys-libs/glibc/files/2.20/glibc-2.20-hardened-inittls-nosysenter.patch
@@ -0,0 +1,306 @@
+When building glibc PIE (which is not something upstream support),
+several modifications are necessary to the glibc build process.
+
+First, any syscalls in PIEs must be of the PIC variant, otherwise
+textrels ensue. Then, any syscalls made before the initialisation
+of the TLS will fail on i386, as the sysenter variant on i386 uses
+the TLS, giving rise to a chicken-and-egg situation. This patch
+defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
+version is normally used, and uses the non-sysenter version for the brk
+syscall that is performed by the TLS initialisation. Further, the TLS
+initialisation is moved in this case prior to the initialisation of
+dl_osversion, as that requires further syscalls.
+
+csu/libc-start.c: Move initial TLS initialization to before the
+initialisation of dl_osversion, when INTERNAL_SYSCALL_PRE_TLS is defined
+
+csu/libc-tls.c: Use the no-sysenter version of sbrk when
+INTERNAL_SYSCALL_PRE_TLS is defined.
+
+misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
+version of brk - if INTERNAL_SYSCALL_PRE_TLS is defined.
+
+misc/brk.c: Define a no-sysenter version of brk if
+INTERNAL_SYSCALL_PRE_TLS is defined.
+
+sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_PRE_TLS
+Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
+
+Patch by Kevin F. Quinn <kevquinn@gentoo.org>
+Fixed for 2.10 by Magnus Granberg <zorry@ume.nu>
+Fixed for 2.18 by Magnus Granberg <zorry@gentoo.org>
+Fixed for 2.20 by Francisco Blas Izquierdo Riera <klondike@gentoo.org>
+
+--- a/csu/libc-start.c
++++ b/csu/libc-start.c
+@@ -28,6 +28,7 @@
+ extern int __libc_multiple_libcs;
+
+ #include <tls.h>
++#include <sysdep.h>
+ #ifndef SHARED
+ # include <dl-osinfo.h>
+ extern void __pthread_initialize_minimal (void);
+@@ -170,6 +171,11 @@ LIBC_START_MAIN (int (*main) (int, char
+ }
+ }
+
++# ifdef INTERNAL_SYSCALL_PRE_TLS
++ /* Do the initial TLS initialization before _dl_osversion,
++ since the latter uses the uname syscall. */
++ __pthread_initialize_minimal ();
++# endif
+ # ifdef DL_SYSDEP_OSCHECK
+ if (!__libc_multiple_libcs)
+ {
+@@ -138,10 +144,12 @@
+ }
+ # endif
+
++# ifndef INTERNAL_SYSCALL_PRE_TLS
+ /* Initialize the thread library at least a bit since the libgcc
+ functions are using thread functions if these are available and
+ we need to setup errno. */
+ __pthread_initialize_minimal ();
++# endif
+
+ /* Set up the stack checker's canary. */
+ uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
+--- a/csu/libc-tls.c
++++ b/csu/libc-tls.c
+@@ -22,12 +22,17 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <sys/param.h>
++#include <sysdep.h>
+
+
+ #ifdef SHARED
+ #error makefile bug, this file is for static only
+ #endif
+
++#ifdef INTERNAL_SYSCALL_PRE_TLS
++extern void *__sbrk_nosysenter (intptr_t __delta);
++#endif
++
+ dtv_t _dl_static_dtv[2 + TLS_SLOTINFO_SURPLUS];
+
+
+@@ -139,20 +144,29 @@ __libc_setup_tls (size_t tcbsize, size_t
+
+ The initialized value of _dl_tls_static_size is provided by dl-open.c
+ to request some surplus that permits dynamic loading of modules with
+- IE-model TLS. */
++ IE-model TLS.
++
++ Where the normal sbrk would use a syscall that needs the TLS (i386)
++ use the special non-sysenter version instead. */
++#ifdef INTERNAL_SYSCALL_PRE_TLS
++# define __sbrk __sbrk_nosysenter
++#endif
+ #if TLS_TCB_AT_TP
+ tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
+ tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
+ #elif TLS_DTV_AT_TP
+ tcb_offset = roundup (tcbsize, align ?: 1);
+ tlsblock = __sbrk (tcb_offset + memsz + max_align
+ + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
+ tlsblock += TLS_PRE_TCB_SIZE;
+ #else
+ /* In case a model with a different layout for the TCB and DTV
+ is defined add another #elif here and in the following #ifs. */
+ # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
+ #endif
++#ifdef INTERNAL_SYSCALL_PRE_TLS
++# undef __sbrk
++#endif
+
+ /* Align the TLS block. */
+ tlsblock = (void *) (((uintptr_t) tlsblock + max_align - 1)
+--- a/misc/sbrk.c
++++ b/misc/sbrk.c
+@@ -18,6 +18,7 @@
+ #include <errno.h>
+ #include <stdint.h>
+ #include <unistd.h>
++#include <sysdep.h>
+
+ /* Defined in brk.c. */
+ extern void *__curbrk;
+@@ -29,6 +30,35 @@
+ /* Extend the process's data space by INCREMENT.
+ If INCREMENT is negative, shrink data space by - INCREMENT.
+ Return start of new space allocated, or -1 for errors. */
++#ifdef INTERNAL_SYSCALL_PRE_TLS
++/* This version is used by csu/libc-tls.c whem initialising the TLS
++ if the SYSENTER version requires the TLS (which it does on i386).
++ Obviously using the TLS before it is initialised is broken. */
++extern int __brk_nosysenter (void *addr);
++void *
++__sbrk_nosysenter (intptr_t increment)
++{
++ void *oldbrk;
++
++ /* If this is not part of the dynamic library or the library is used via
++ dynamic loading in a statically linked program update __curbrk from the
++ kernel's brk value. That way two separate instances of __brk and __sbrk
++ can share the heap, returning interleaved pieces of it. */
++ if (__curbrk == NULL || __libc_multiple_libcs)
++ if (__brk_nosysenter (0) < 0) /* Initialize the break. */
++ return (void *) -1;
++
++ if (increment == 0)
++ return __curbrk;
++
++ oldbrk = __curbrk;
++ if (__brk_nosysenter (oldbrk + increment) < 0)
++ return (void *) -1;
++
++ return oldbrk;
++}
++#endif
++
+ void *
+ __sbrk (intptr_t increment)
+ {
+--- a/sysdeps/unix/sysv/linux/i386/brk.c
++++ b/sysdeps/unix/sysv/linux/i386/brk.c
+@@ -31,6 +31,30 @@
+ linker. */
+ weak_alias (__curbrk, ___brk_addr)
+
++#ifdef INTERNAL_SYSCALL_PRE_TLS
++/* This version is used by csu/libc-tls.c whem initialising the TLS
++ if the SYSENTER version requires the TLS (which it does on i386).
++ Obviously using the TLS before it is initialised is broken. */
++int
++__brk_nosysenter (void *addr)
++{
++ void *newbrk;
++
++ INTERNAL_SYSCALL_DECL (err);
++ newbrk = (void *) INTERNAL_SYSCALL_PRE_TLS (brk, err, 1, addr);
++
++ __curbrk = newbrk;
++
++ if (newbrk < addr)
++ {
++ __set_errno (ENOMEM);
++ return -1;
++ }
++
++ return 0;
++}
++#endif
++
+ int
+ __brk (void *addr)
+ {
+--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
++++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
+@@ -187,7 +187,7 @@
+ /* The original calling convention for system calls on Linux/i386 is
+ to use int $0x80. */
+ #ifdef I386_USE_SYSENTER
+-# ifdef SHARED
++# ifdef __PIC__
+ # define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
+ # else
+ # define ENTER_KERNEL call *_dl_sysinfo
+@@ -358,7 +358,7 @@
+ possible to use more than four parameters. */
+ #undef INTERNAL_SYSCALL
+ #ifdef I386_USE_SYSENTER
+-# ifdef SHARED
++# ifdef __PIC__
+ # define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+ register unsigned int resultvar; \
+@@ -384,6 +384,18 @@
+ : "0" (name), "i" (offsetof (tcbhead_t, sysinfo)) \
+ ASMFMT_##nr(args) : "memory", "cc"); \
+ (int) resultvar; })
++# define INTERNAL_SYSCALL_PRE_TLS(name, err, nr, args...) \
++ ({ \
++ register unsigned int resultvar; \
++ EXTRAVAR_##nr \
++ asm volatile ( \
++ LOADARGS_NOSYSENTER_##nr \
++ "movl %1, %%eax\n\t" \
++ "int $0x80\n\t" \
++ RESTOREARGS_NOSYSENTER_##nr \
++ : "=a" (resultvar) \
++ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \
++ (int) resultvar; })
+ # else
+ # define INTERNAL_SYSCALL(name, err, nr, args...) \
+ ({ \
+@@ -447,12 +459,20 @@
+
+ #define LOADARGS_0
+ #ifdef __PIC__
+-# if defined I386_USE_SYSENTER && defined SHARED
++# if defined I386_USE_SYSENTER && defined __PIC__
+ # define LOADARGS_1 \
+ "bpushl .L__X'%k3, %k3\n\t"
+ # define LOADARGS_5 \
+ "movl %%ebx, %4\n\t" \
+ "movl %3, %%ebx\n\t"
++# define LOADARGS_NOSYSENTER_1 \
++ "bpushl .L__X'%k2, %k2\n\t"
++# define LOADARGS_NOSYSENTER_2 LOADARGS_NOSYSENTER_1
++# define LOADARGS_NOSYSENTER_3 LOADARGS_3
++# define LOADARGS_NOSYSENTER_4 LOADARGS_3
++# define LOADARGS_NOSYSENTER_5 \
++ "movl %%ebx, %3\n\t" \
++ "movl %2, %%ebx\n\t"
+ # else
+ # define LOADARGS_1 \
+ "bpushl .L__X'%k2, %k2\n\t"
+@@ -474,11 +494,18 @@
+
+ #define RESTOREARGS_0
+ #ifdef __PIC__
+-# if defined I386_USE_SYSENTER && defined SHARED
++# if defined I386_USE_SYSENTER && defined __PIC__
+ # define RESTOREARGS_1 \
+ "bpopl .L__X'%k3, %k3\n\t"
+ # define RESTOREARGS_5 \
+ "movl %4, %%ebx"
++# define RESTOREARGS_NOSYSENTER_1 \
++ "bpopl .L__X'%k2, %k2\n\t"
++# define RESTOREARGS_NOSYSENTER_2 RESTOREARGS_NOSYSENTER_1
++# define RESTOREARGS_NOSYSENTER_3 RESTOREARGS_3
++# define RESTOREARGS_NOSYSENTER_4 RESTOREARGS_3
++# define RESTOREARGS_NOSYSENTER_5 \
++ "movl %3, %%ebx"
+ # else
+ # define RESTOREARGS_1 \
+ "bpopl .L__X'%k2, %k2\n\t"
+--- a/sysdeps/i386/nptl/tls.h
++++ b/sysdeps/i386/nptl/tls.h
+@@ -189,6 +189,15 @@
+ desc->vals[3] = 0x51;
+ }
+
++/* We have no sysenter until the tls is initialized which is a
++ problem for PIC. Thus we need to do the right call depending
++ on the situation. */
++#ifndef INTERNAL_SYSCALL_PRE_TLS
++# define TLS_INIT_SYSCALL INTERNAL_SYSCALL
++#else
++# define TLS_INIT_SYSCALL INTERNAL_SYSCALL_PRE_TLS
++#endif
++
+ /* Code to initially initialize the thread pointer. This might need
+ special attention since 'errno' is not yet available and if the
+ operation can cause a failure 'errno' must not be touched. */
+@@ -209,7 +218,7 @@
+ \
+ /* Install the TLS. */ \
+ INTERNAL_SYSCALL_DECL (err); \
+- _result = INTERNAL_SYSCALL (set_thread_area, err, 1, &_segdescr.desc); \
++ _result = TLS_INIT_SYSCALL (set_thread_area, err, 1, &_segdescr.desc); \
+ \
+ if (_result == 0) \
+ /* We know the index in the GDT, now load the segment register. \
diff --git a/sys-libs/glibc/files/2.25/glibc-2.25-gentoo-chk_fail.c b/sys-libs/glibc/files/2.25/glibc-2.25-gentoo-chk_fail.c
new file mode 100644
index 000000000000..2ef96b75eacf
--- /dev/null
+++ b/sys-libs/glibc/files/2.25/glibc-2.25-gentoo-chk_fail.c
@@ -0,0 +1,303 @@
+/* Copyright (C) 2004-2014 Free Software Foundation, Inc.
+ Copyright (C) 2006-2014 Gentoo Foundation Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Hardened Gentoo SSP and FORTIFY handler
+
+ A failure handler that does not use functions from the rest of glibc;
+ it uses the INTERNAL_SYSCALL methods directly. This helps ensure no
+ possibility of recursion into the handler.
+
+ Direct all bug reports to http://bugs.gentoo.org/
+
+ People who have contributed significantly to the evolution of this file:
+ Ned Ludd - <solar[@]gentoo.org>
+ Alexander Gabert - <pappy[@]gentoo.org>
+ The PaX Team - <pageexec[@]freemail.hu>
+ Peter S. Mazinger - <ps.m[@]gmx.net>
+ Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ Robert Connolly - <robert[@]linuxfromscratch.org>
+ Cory Visi <cory[@]visi.name>
+ Mike Frysinger <vapier[@]gentoo.org>
+ Magnus Granberg <zorry[@]gentoo.org>
+ Kevin F. Quinn - <kevquinn[@]gentoo.org>
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <sys/types.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+
+#include <kernel-features.h>
+
+#include <alloca.h>
+/* from sysdeps */
+#include <socketcall.h>
+/* for the stuff in bits/socket.h */
+#include <sys/socket.h>
+#include <sys/un.h>
+
+/* Sanity check on SYSCALL macro names - force compilation
+ * failure if the names used here do not exist
+ */
+#if !defined __NR_socketcall && !defined __NR_socket
+# error Cannot do syscall socket or socketcall
+#endif
+#if !defined __NR_socketcall && !defined __NR_connect
+# error Cannot do syscall connect or socketcall
+#endif
+#ifndef __NR_write
+# error Cannot do syscall write
+#endif
+#ifndef __NR_close
+# error Cannot do syscall close
+#endif
+#ifndef __NR_getpid
+# error Cannot do syscall getpid
+#endif
+#ifndef __NR_kill
+# error Cannot do syscall kill
+#endif
+#ifndef __NR_exit
+# error Cannot do syscall exit
+#endif
+#ifdef SSP_SMASH_DUMPS_CORE
+# define ENABLE_SSP_SMASH_DUMPS_CORE 1
+# if !defined _KERNEL_NSIG && !defined _NSIG
+# error No _NSIG or _KERNEL_NSIG for rt_sigaction
+# endif
+# if !defined __NR_sigaction && !defined __NR_rt_sigaction
+# error Cannot do syscall sigaction or rt_sigaction
+# endif
+/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
+ * of the _kernel_ sigset_t which is not the same as the user sigset_t.
+ * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
+ * some reason.
+ */
+# ifdef _KERNEL_NSIG
+# define _SSP_NSIG _KERNEL_NSIG
+# else
+# define _SSP_NSIG _NSIG
+# endif
+#else
+# define _SSP_NSIG 0
+# define ENABLE_SSP_SMASH_DUMPS_CORE 0
+#endif
+
+/* Define DO_SIGACTION - default to newer rt signal interface but
+ * fallback to old as needed.
+ */
+#ifdef __NR_rt_sigaction
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
+#else
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
+#endif
+
+/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
+#if defined(__NR_socket) && defined(__NR_connect)
+# define USE_OLD_SOCKETCALL 0
+#else
+# define USE_OLD_SOCKETCALL 1
+#endif
+
+/* stub out the __NR_'s so we can let gcc optimize away dead code */
+#ifndef __NR_socketcall
+# define __NR_socketcall 0
+#endif
+#ifndef __NR_socket
+# define __NR_socket 0
+#endif
+#ifndef __NR_connect
+# define __NR_connect 0
+#endif
+#define DO_SOCKET(result, domain, type, protocol) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = domain; \
+ socketargs[1] = type; \
+ socketargs[2] = protocol; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
+ } while (0)
+#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = sockfd; \
+ socketargs[1] = (unsigned long int)serv_addr; \
+ socketargs[2] = addrlen; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
+ } while (0)
+
+#ifndef _PATH_LOG
+# define _PATH_LOG "/dev/log"
+#endif
+
+static const char path_log[] = _PATH_LOG;
+
+/* For building glibc with SSP switched on, define __progname to a
+ * constant if building for the run-time loader, to avoid pulling
+ * in more of libc.so into ld.so
+ */
+#ifdef IS_IN_rtld
+static const char *__progname = "<ldso>";
+#else
+extern const char *__progname;
+#endif
+
+#ifdef GENTOO_SSP_HANDLER
+# define ERROR_MSG "stack smashing"
+#else
+# define ERROR_MSG "buffer overflow"
+#endif
+
+/* Common handler code, used by chk_fail
+ * Inlined to ensure no self-references to the handler within itself.
+ * Data static to avoid putting more than necessary on the stack,
+ * to aid core debugging.
+ */
+__attribute__ ((__noreturn__, __always_inline__))
+static inline void
+__hardened_gentoo_fail(void)
+{
+#define MESSAGE_BUFSIZ 512
+ static pid_t pid;
+ static int plen, i, hlen;
+ static char message[MESSAGE_BUFSIZ];
+ /* <11> is LOG_USER|LOG_ERR. A dummy date for loggers to skip over. */
+ static const char msg_header[] = "<11>" __DATE__ " " __TIME__ " glibc-gentoo-hardened-check: ";
+ static const char msg_ssd[] = "*** " ERROR_MSG " detected ***: ";
+ static const char msg_terminated[] = " terminated; ";
+ static const char msg_report[] = "report to " REPORT_BUGS_TO "\n";
+ static const char msg_unknown[] = "<unknown>";
+ static int log_socket, connect_result;
+ static struct sockaddr_un sock;
+ static unsigned long int socketargs[4];
+
+ /* Build socket address */
+ sock.sun_family = AF_UNIX;
+ i = 0;
+ while (path_log[i] != '\0' && i < sizeof(sock.sun_path) - 1) {
+ sock.sun_path[i] = path_log[i];
+ ++i;
+ }
+ sock.sun_path[i] = '\0';
+
+ /* Try SOCK_DGRAM connection to syslog */
+ connect_result = -1;
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ if (connect_result == -1) {
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+ /* Try SOCK_STREAM connection to syslog */
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ }
+
+ /* Build message. Messages are generated both in the old style and new style,
+ * so that log watchers that are configured for the old-style message continue
+ * to work.
+ */
+#define strconcat(str) \
+ ({ \
+ i = 0; \
+ while ((str[i] != '\0') && ((i + plen) < (MESSAGE_BUFSIZ - 1))) { \
+ message[plen + i] = str[i]; \
+ ++i; \
+ } \
+ plen += i; \
+ })
+
+ /* Tersely log the failure */
+ plen = 0;
+ strconcat(msg_header);
+ hlen = plen;
+ strconcat(msg_ssd);
+ if (__progname != NULL)
+ strconcat(__progname);
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+ strconcat(msg_report);
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message + hlen, plen - hlen);
+ if (connect_result != -1) {
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+ INLINE_SYSCALL(close, 1, log_socket);
+ }
+
+ /* Time to kill self since we have no idea what is going on */
+ pid = INLINE_SYSCALL(getpid, 0);
+
+ if (ENABLE_SSP_SMASH_DUMPS_CORE) {
+ /* Remove any user-supplied handler for SIGABRT, before using it. */
+#if 0
+ /*
+ * Note: Disabled because some programs catch & process their
+ * own crashes. We've already enabled this code path which
+ * means we want to let core dumps happen.
+ */
+ static struct sigaction default_abort_act;
+ default_abort_act.sa_handler = SIG_DFL;
+ default_abort_act.sa_sigaction = NULL;
+ __sigfillset(&default_abort_act.sa_mask);
+ default_abort_act.sa_flags = 0;
+ if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
+#endif
+ INLINE_SYSCALL(kill, 2, pid, SIGABRT);
+ }
+
+ /* SIGKILL is only signal which cannot be caught */
+ INLINE_SYSCALL(kill, 2, pid, SIGKILL);
+
+ /* In case the kill didn't work, exit anyway.
+ * The loop prevents gcc thinking this routine returns.
+ */
+ while (1)
+ INLINE_SYSCALL(exit, 1, 137);
+}
+
+__attribute__ ((__noreturn__))
+#ifdef GENTOO_SSP_HANDLER
+void __stack_chk_fail(void)
+#else
+void __chk_fail(void)
+#endif
+{
+ __hardened_gentoo_fail();
+}
+
+#ifdef GENTOO_SSP_HANDLER
+strong_alias (__stack_chk_fail, __stack_chk_fail_local)
+#endif
diff --git a/sys-libs/glibc/files/2.6/glibc-2.6-gentoo-stack_chk_fail.c b/sys-libs/glibc/files/2.6/glibc-2.6-gentoo-stack_chk_fail.c
new file mode 100644
index 000000000000..217bf1a90790
--- /dev/null
+++ b/sys-libs/glibc/files/2.6/glibc-2.6-gentoo-stack_chk_fail.c
@@ -0,0 +1,321 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Copyright (C) 2006-2007 Gentoo Foundation Inc.
+ * License terms as above.
+ *
+ * Hardened Gentoo SSP handler
+ *
+ * An SSP failure handler that does not use functions from the rest of
+ * glibc; it uses the INTERNAL_SYSCALL methods directly. This ensures
+ * no possibility of recursion into the handler.
+ *
+ * Direct all bug reports to http://bugs.gentoo.org/
+ *
+ * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
+ * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
+ *
+ * The following people contributed to the glibc-2.3 Hardened
+ * Gentoo SSP handler, from which this implementation draws much:
+ *
+ * Ned Ludd - <solar[@]gentoo.org>
+ * Alexander Gabert - <pappy[@]gentoo.org>
+ * The PaX Team - <pageexec[@]freemail.hu>
+ * Peter S. Mazinger - <ps.m[@]gmx.net>
+ * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
+ * Robert Connolly - <robert[@]linuxfromscratch.org>
+ * Cory Visi <cory[@]visi.name>
+ * Mike Frysinger <vapier[@]gentoo.org>
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <sys/types.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+#include <kernel-features.h>
+
+#include <alloca.h>
+/* from sysdeps */
+#include <socketcall.h>
+/* for the stuff in bits/socket.h */
+#include <sys/socket.h>
+#include <sys/un.h>
+
+
+/* Sanity check on SYSCALL macro names - force compilation
+ * failure if the names used here do not exist
+ */
+#if !defined __NR_socketcall && !defined __NR_socket
+# error Cannot do syscall socket or socketcall
+#endif
+#if !defined __NR_socketcall && !defined __NR_connect
+# error Cannot do syscall connect or socketcall
+#endif
+#ifndef __NR_write
+# error Cannot do syscall write
+#endif
+#ifndef __NR_close
+# error Cannot do syscall close
+#endif
+#ifndef __NR_getpid
+# error Cannot do syscall getpid
+#endif
+#ifndef __NR_kill
+# error Cannot do syscall kill
+#endif
+#ifndef __NR_exit
+# error Cannot do syscall exit
+#endif
+#ifdef SSP_SMASH_DUMPS_CORE
+# define ENABLE_SSP_SMASH_DUMPS_CORE 1
+# if !defined _KERNEL_NSIG && !defined _NSIG
+# error No _NSIG or _KERNEL_NSIG for rt_sigaction
+# endif
+# if !defined __NR_sigaction && !defined __NR_rt_sigaction
+# error Cannot do syscall sigaction or rt_sigaction
+# endif
+/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
+ * of the _kernel_ sigset_t which is not the same as the user sigset_t.
+ * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
+ * some reason.
+ */
+# ifdef _KERNEL_NSIG
+# define _SSP_NSIG _KERNEL_NSIG
+# else
+# define _SSP_NSIG _NSIG
+# endif
+#else
+# define _SSP_NSIG 0
+# define ENABLE_SSP_SMASH_DUMPS_CORE 0
+#endif
+
+/* Define DO_SIGACTION - default to newer rt signal interface but
+ * fallback to old as needed.
+ */
+#ifdef __NR_rt_sigaction
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
+#else
+# define DO_SIGACTION(signum, act, oldact) \
+ INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
+#endif
+
+/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
+#if defined(__NR_socket) && defined(__NR_connect)
+# define USE_OLD_SOCKETCALL 0
+#else
+# define USE_OLD_SOCKETCALL 1
+#endif
+/* stub out the __NR_'s so we can let gcc optimize away dead code */
+#ifndef __NR_socketcall
+# define __NR_socketcall 0
+#endif
+#ifndef __NR_socket
+# define __NR_socket 0
+#endif
+#ifndef __NR_connect
+# define __NR_connect 0
+#endif
+#define DO_SOCKET(result, domain, type, protocol) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = domain; \
+ socketargs[1] = type; \
+ socketargs[2] = protocol; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
+ } while (0)
+#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
+ do { \
+ if (USE_OLD_SOCKETCALL) { \
+ socketargs[0] = sockfd; \
+ socketargs[1] = (unsigned long int)serv_addr; \
+ socketargs[2] = addrlen; \
+ socketargs[3] = 0; \
+ result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
+ } else \
+ result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
+ } while (0)
+
+#ifndef _PATH_LOG
+# define _PATH_LOG "/dev/log"
+#endif
+
+static const char path_log[] = _PATH_LOG;
+
+/* For building glibc with SSP switched on, define __progname to a
+ * constant if building for the run-time loader, to avoid pulling
+ * in more of libc.so into ld.so
+ */
+#ifdef IS_IN_rtld
+static char *__progname = "<rtld>";
+#else
+extern char *__progname;
+#endif
+
+
+/* Common handler code, used by stack_chk_fail and __stack_smash_handler
+ * Inlined to ensure no self-references to the handler within itself.
+ * Data static to avoid putting more than necessary on the stack,
+ * to aid core debugging.
+ */
+__attribute__ ((__noreturn__ , __always_inline__))
+static inline void
+__hardened_gentoo_stack_chk_fail(char func[], int damaged)
+{
+#define MESSAGE_BUFSIZ 256
+ static pid_t pid;
+ static int plen, i;
+ static char message[MESSAGE_BUFSIZ];
+ static const char msg_ssa[] = ": stack smashing attack";
+ static const char msg_inf[] = " in function ";
+ static const char msg_ssd[] = "*** stack smashing detected ***: ";
+ static const char msg_terminated[] = " - terminated\n";
+ static const char msg_report[] = "Report to http://bugs.gentoo.org/\n";
+ static const char msg_unknown[] = "<unknown>";
+ static int log_socket, connect_result;
+ static struct sockaddr_un sock;
+ static unsigned long int socketargs[4];
+
+ /* Build socket address
+ */
+ sock.sun_family = AF_UNIX;
+ i = 0;
+ while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) {
+ sock.sun_path[i] = path_log[i];
+ i++;
+ }
+ sock.sun_path[i] = '\0';
+
+ /* Try SOCK_DGRAM connection to syslog */
+ connect_result = -1;
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ if (connect_result == -1) {
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+ /* Try SOCK_STREAM connection to syslog */
+ DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
+ if (log_socket != -1)
+ DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
+ }
+
+ /* Build message. Messages are generated both in the old style and new style,
+ * so that log watchers that are configured for the old-style message continue
+ * to work.
+ */
+#define strconcat(str) \
+ {i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
+ {\
+ message[plen+i]=str[i];\
+ i++;\
+ }\
+ plen+=i;}
+
+ /* R.Henderson post-gcc-4 style message */
+ plen = 0;
+ strconcat(msg_ssd);
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Dr. Etoh pre-gcc-4 style message */
+ plen = 0;
+ if (__progname != (char *)0)
+ strconcat(__progname)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_ssa);
+ strconcat(msg_inf);
+ if (func != NULL)
+ strconcat(func)
+ else
+ strconcat(msg_unknown);
+ strconcat(msg_terminated);
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ /* Direct reports to bugs.gentoo.org */
+ plen=0;
+ strconcat(msg_report);
+ message[plen++]='\0';
+
+ /* Write out error message to STDERR, to syslog if open */
+ INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
+ if (connect_result != -1)
+ INLINE_SYSCALL(write, 3, log_socket, message, plen);
+
+ if (log_socket != -1)
+ INLINE_SYSCALL(close, 1, log_socket);
+
+ /* Suicide */
+ pid = INLINE_SYSCALL(getpid, 0);
+
+ if (ENABLE_SSP_SMASH_DUMPS_CORE) {
+ static struct sigaction default_abort_act;
+ /* Remove any user-supplied handler for SIGABRT, before using it */
+ default_abort_act.sa_handler = SIG_DFL;
+ default_abort_act.sa_sigaction = NULL;
+ __sigfillset(&default_abort_act.sa_mask);
+ default_abort_act.sa_flags = 0;
+ if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
+ INLINE_SYSCALL(kill, 2, pid, SIGABRT);
+ }
+
+ /* Note; actions cannot be added to SIGKILL */
+ INLINE_SYSCALL(kill, 2, pid, SIGKILL);
+
+ /* In case the kill didn't work, exit anyway
+ * The loop prevents gcc thinking this routine returns
+ */
+ while (1)
+ INLINE_SYSCALL(exit, 0);
+}
+
+__attribute__ ((__noreturn__))
+void __stack_chk_fail(void)
+{
+ __hardened_gentoo_stack_chk_fail(NULL, 0);
+}
+
+#ifdef ENABLE_OLD_SSP_COMPAT
+__attribute__ ((__noreturn__))
+void __stack_smash_handler(char func[], int damaged)
+{
+ __hardened_gentoo_stack_chk_fail(func, damaged);
+}
+#endif
diff --git a/sys-libs/glibc/files/nscd b/sys-libs/glibc/files/nscd
new file mode 100644
index 000000000000..929d1016df79
--- /dev/null
+++ b/sys-libs/glibc/files/nscd
@@ -0,0 +1,63 @@
+#!/sbin/openrc-run
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use dns ldap net slapd
+}
+
+checkconfig() {
+ if [ ! -d /var/run/nscd ] ; then
+ mkdir -p /var/run/nscd
+ chmod 755 /var/run/nscd
+ fi
+ if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then
+ echo ""
+ ewarn "nscd run dir is not world readable, you should reset the perms:"
+ ewarn "chmod 755 /var/run/nscd"
+ ewarn "chmod a+rw /var/run/nscd/socket"
+ echo ""
+ ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd"
+ echo ""
+ fi
+}
+
+start() {
+ checkconfig
+
+ ebegin "Starting Name Service Cache Daemon"
+ local secure=`while read curline ; do
+ table=${curline%:*}
+ entries=${curline##$table:}
+ table=${table%%[^a-z]*}
+ case $table in
+ passwd*|group*|hosts)
+ for entry in $entries ; do
+ case $entry in
+ nisplus*)
+ /usr/sbin/nscd_nischeck $table || \
+ /echo "-S $table,yes"
+ ;;
+ esac
+ done
+ ;;
+ esac
+ done < /etc/nsswitch.conf`
+ local pidfile="$(strings /usr/sbin/nscd | grep nscd.pid)"
+ mkdir -p "$(dirname ${pidfile})"
+ save_options pidfile "${pidfile}"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/nscd --pidfile "${pidfile}" \
+ -- $secure
+ eend $?
+}
+
+stop() {
+ local pidfile="$(get_options pidfile)"
+ [ -n "${pidfile}" ] && pidfile="--pidfile ${pidfile}"
+ ebegin "Shutting down Name Service Cache Daemon"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/nscd ${pidfile}
+ eend $?
+}
+
+# vim:ts=4
diff --git a/sys-libs/glibc/files/nscd.service b/sys-libs/glibc/files/nscd.service
new file mode 100644
index 000000000000..25a3b1d9be0a
--- /dev/null
+++ b/sys-libs/glibc/files/nscd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Name Service Cache Daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/nscd -F
+ExecStop=/usr/sbin/nscd --shutdown
+ExecReload=/usr/sbin/nscd -i passwd
+ExecReload=/usr/sbin/nscd -i group
+ExecReload=/usr/sbin/nscd -i hosts
+ExecReload=/usr/sbin/nscd -i services
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-libs/glibc/files/nscd.tmpfilesd b/sys-libs/glibc/files/nscd.tmpfilesd
new file mode 100644
index 000000000000..52edbba673cf
--- /dev/null
+++ b/sys-libs/glibc/files/nscd.tmpfilesd
@@ -0,0 +1,4 @@
+# Configuration to create /run/nscd directory
+# Used as part of systemd's tmpfiles
+
+d /run/nscd 0755 root root
diff --git a/sys-libs/glibc/files/nsswitch.conf b/sys-libs/glibc/files/nsswitch.conf
new file mode 100644
index 000000000000..9f06cfb8e7a9
--- /dev/null
+++ b/sys-libs/glibc/files/nsswitch.conf
@@ -0,0 +1,23 @@
+# /etc/nsswitch.conf:
+
+passwd: compat
+shadow: compat
+group: compat
+
+# passwd: db files nis
+# shadow: db files nis
+# group: db files nis
+
+hosts: files dns
+networks: files dns
+
+services: db files
+protocols: db files
+rpc: db files
+ethers: db files
+netmasks: files
+netgroup: files
+bootparams: files
+
+automount: files
+aliases: files
diff --git a/sys-libs/glibc/glibc-2.17.ebuild b/sys-libs/glibc/glibc-2.17.ebuild
new file mode 100644
index 000000000000..a0d0cd113b83
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.17.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="8" # Gentoo patchset
+NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.16"} # min kernel version nptl requires
+
+IUSE="debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.16/2.6.20}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ selinux? ( sys-libs/libselinux )
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.20
+ >=${CATEGORY}/gcc-4.3
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.20
+ >=sys-devel/gcc-4.3
+ virtual/os-headers
+ !vanilla? ( >=sys-libs/timezone-data-2012c )"
+ RDEPEND+="
+ vanilla? ( !sys-libs/timezone-data )
+ !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ GLIBC_PATCH_EXCLUDE+=" 6600_mips_librt-mips.patch" #456912
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+
+ if use hardened ; then
+ cd "${S}"
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ tc-enables-pie && epatch "${FILESDIR}"/2.17/glibc-2.17-hardened-pie.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
+
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
+ debug/stack_chk_fail.c || die
+ cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
+ debug/chk_fail.c || die
+
+ if use debug ; then
+ # When using Hardened Gentoo stack handler, have smashes dump core for
+ # analysis - debug only, as core could be an information leak
+ # (paranoia).
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug stack handler"
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug fortify handler"
+ fi
+
+ # Build nscd with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ nscd/Makefile \
+ || die "Failed to ensure nscd builds with ssp-all"
+ fi
+}
+
+pkg_preinst() {
+ toolchain-glibc_pkg_preinst
+
+ if [[ ${CTARGET} == arm* ]] ; then
+ # Backwards compat support for renaming hardfp ldsos #417287
+ local oldso='/lib/ld-linux.so.3'
+ local nldso='/lib/ld-linux-armhf.so.3'
+ if [[ -e ${D}${nldso} ]] ; then
+ if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
+ ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
+ ewarn "Please rebuild all packages using this old ldso as compat"
+ ewarn "support will be dropped in the future."
+ ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
+ fi
+ fi
+ fi
+}
diff --git a/sys-libs/glibc/glibc-2.18-r1.ebuild b/sys-libs/glibc/glibc-2.18-r1.ebuild
new file mode 100644
index 000000000000..a9c0bfc2c2b7
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.18-r1.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="4" # Gentoo patchset
+NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.16"} # min kernel version nptl requires
+
+IUSE="debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.16/2.6.20}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ selinux? ( sys-libs/libselinux )
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.20
+ >=${CATEGORY}/gcc-4.3
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.20
+ >=sys-devel/gcc-4.3
+ virtual/os-headers
+ !vanilla? ( >=sys-libs/timezone-data-2012c )"
+ RDEPEND+="
+ vanilla? ( !sys-libs/timezone-data )
+ !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ GLIBC_PATCH_EXCLUDE+=" 00_all_0012-mips-add-clock_-g-s-ettime-symbol-compat-hacks.patch" #456912 #481438
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+
+ if use hardened ; then
+ cd "${S}"
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ tc-enables-pie && epatch "${FILESDIR}"/2.17/glibc-2.17-hardened-pie.patch
+ epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
+ epatch "${FILESDIR}"/2.18/glibc-2.18-hardened-inittls-nosysenter.patch
+
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp -f "${FILESDIR}"/2.18/glibc-2.18-gentoo-stack_chk_fail.c \
+ debug/stack_chk_fail.c || die
+ cp -f "${FILESDIR}"/2.18/glibc-2.18-gentoo-chk_fail.c \
+ debug/chk_fail.c || die
+
+ if use debug ; then
+ # When using Hardened Gentoo stack handler, have smashes dump core for
+ # analysis - debug only, as core could be an information leak
+ # (paranoia).
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug stack handler"
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug fortify handler"
+ fi
+
+ # Build nscd with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ nscd/Makefile \
+ || die "Failed to ensure nscd builds with ssp-all"
+ fi
+}
+
+pkg_preinst() {
+ toolchain-glibc_pkg_preinst
+
+ if [[ ${CTARGET} == arm* ]] ; then
+ # Backwards compat support for renaming hardfp ldsos #417287
+ local oldso='/lib/ld-linux.so.3'
+ local nldso='/lib/ld-linux-armhf.so.3'
+ if [[ -e ${D}${nldso} ]] ; then
+ if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
+ ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
+ ewarn "Please rebuild all packages using this old ldso as compat"
+ ewarn "support will be dropped in the future."
+ ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
+ fi
+ fi
+ fi
+}
diff --git a/sys-libs/glibc/glibc-2.19-r1.ebuild b/sys-libs/glibc/glibc-2.19-r1.ebuild
new file mode 100644
index 000000000000..8860850c0224
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.19-r1.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="3" # Gentoo patchset
+NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.16"} # min kernel version nptl requires
+
+IUSE="debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.16/2.6.20}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ selinux? ( sys-libs/libselinux )
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.20
+ >=${CATEGORY}/gcc-4.3
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.20
+ >=sys-devel/gcc-4.3
+ virtual/os-headers
+ !vanilla? ( >=sys-libs/timezone-data-2012c )"
+ RDEPEND+="
+ vanilla? ( !sys-libs/timezone-data )
+ !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+ toolchain-glibc_src_unpack
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ tc-enables-pie && epatch "${FILESDIR}"/2.17/glibc-2.17-hardened-pie.patch
+ epatch "${FILESDIR}"/2.19/glibc-2.19-hardened-configure-picdefault.patch
+ epatch "${FILESDIR}"/2.18/glibc-2.18-hardened-inittls-nosysenter.patch
+
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp -f "${FILESDIR}"/2.18/glibc-2.18-gentoo-stack_chk_fail.c \
+ debug/stack_chk_fail.c || die
+ cp -f "${FILESDIR}"/2.18/glibc-2.18-gentoo-chk_fail.c \
+ debug/chk_fail.c || die
+
+ if use debug ; then
+ # When using Hardened Gentoo stack handler, have smashes dump core for
+ # analysis - debug only, as core could be an information leak
+ # (paranoia).
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug stack handler"
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile \
+ || die "Failed to modify debug/Makefile for debug fortify handler"
+ fi
+
+ # Build nscd with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ nscd/Makefile \
+ || die "Failed to ensure nscd builds with ssp-all"
+ fi
+}
+
+pkg_preinst() {
+ toolchain-glibc_pkg_preinst
+
+ if [[ ${CTARGET} == arm* ]] ; then
+ # Backwards compat support for renaming hardfp ldsos #417287
+ local oldso='/lib/ld-linux.so.3'
+ local nldso='/lib/ld-linux-armhf.so.3'
+ if [[ -e ${D}${nldso} ]] ; then
+ if scanelf -qRyi "${ROOT}$(alt_prefix)"/*bin/ | grep -s "^${oldso}" ; then
+ ewarn "Symlinking old ldso (${oldso}) to new ldso (${nldso})."
+ ewarn "Please rebuild all packages using this old ldso as compat"
+ ewarn "support will be dropped in the future."
+ ln -s "${nldso##*/}" "${D}$(alt_prefix)${oldso}"
+ fi
+ fi
+ fi
+}
diff --git a/sys-libs/glibc/glibc-2.20-r2.ebuild b/sys-libs/glibc/glibc-2.20-r2.ebuild
new file mode 100644
index 000000000000..04363835f616
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.20-r2.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="alpha amd64 arm arm64 -hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="5" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ selinux? ( sys-libs/libselinux )
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.4
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.4
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI HTTP~blueness/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ tc-enables-pie && epatch "${FILESDIR}"/2.17/glibc-2.17-hardened-pie.patch
+ epatch "${FILESDIR}"/2.20/glibc-2.20-hardened-inittls-nosysenter.patch
+
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+
+ # Build various bits with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ */Makefile || die
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.21-r2.ebuild b/sys-libs/glibc/glibc-2.21-r2.ebuild
new file mode 100644
index 000000000000..9216657a9703
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.21-r2.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="7" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ selinux? ( sys-libs/libselinux )
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.6
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.6
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
+ tc-enables-pie && epatch "${FILESDIR}"/2.17/glibc-2.17-hardened-pie.patch
+ epatch "${FILESDIR}"/2.20/glibc-2.20-hardened-inittls-nosysenter.patch
+
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+
+ # Build various bits with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ */Makefile || die
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.22-r4.ebuild b/sys-libs/glibc/glibc-2.22-r4.ebuild
new file mode 100644
index 000000000000..5949f88d64ac
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.22-r4.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="13" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+DEPEND=">=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="!sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ selinux? ( sys-libs/libselinux )
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.6
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.6
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+ # Bug 558636 we don't apply the pie works around for 2.22. It shoud have the support. #558636
+ GLIBC_PATCH_EXCLUDE+=" 00_all_0002-workaround-crash-when-handling-signals-in-static-PIE.patch"
+ GLIBC_PATCH_EXCLUDE+=" 00_all_0012-disable-PIE-when-checking-for-PIC-default.patch"
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+
+ # Build various bits with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ */Makefile || die
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.23-r3.ebuild b/sys-libs/glibc/glibc-2.23-r3.ebuild
new file mode 100644
index 000000000000..410b3485c156
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.23-r3.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+PATCH_VER="7" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="audit caps debug gd hardened multilib nscd +rpc selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.7
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.7
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+
+ # Build various bits with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ */Makefile || die
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.23-r4.ebuild b/sys-libs/glibc/glibc-2.23-r4.ebuild
new file mode 100644
index 000000000000..01efec5a7b42
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.23-r4.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+# patches live at https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/
+PATCH_VER="8" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="audit caps debug gd hardened multilib nscd +rpc selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.7
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.7
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI HTTP~tamiko/distfiles/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+
+ # Build various bits with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ */Makefile || die
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.24-r4.ebuild b/sys-libs/glibc/glibc-2.24-r4.ebuild
new file mode 100644
index 000000000000..29a17f827aec
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.24-r4.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+# patches live at https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/
+PATCH_VER="10" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="audit caps debug gd hardened multilib nscd +rpc selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.7
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.7
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI HTTP~tamiko/distfiles/URI HTTP~slyfox/distfiles/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+
+ # Build various bits with ssp-all
+ sed -i \
+ -e 's:-fstack-protector$:-fstack-protector-all:' \
+ */Makefile || die
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.25-r4.ebuild b/sys-libs/glibc/glibc-2.25-r4.ebuild
new file mode 100644
index 000000000000..27cd42605ffe
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.25-r4.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+# patches live at https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/
+PATCH_VER="8" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="audit caps debug gd hardened multilib nscd +rpc selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.7
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.7
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI HTTP~tamiko/distfiles/URI HTTP~slyfox/distfiles/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.25/glibc-2.25-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.25-r5.ebuild b/sys-libs/glibc/glibc-2.25-r5.ebuild
new file mode 100644
index 000000000000..24ad65b328fd
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.25-r5.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+# patches live at https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/
+PATCH_VER="9" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="audit caps debug gd hardened multilib nscd +rpc selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+ systemtap? ( dev-util/systemtap )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.7
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.7
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~dilfridge/distfiles/URI HTTP~tamiko/distfiles/URI HTTP~slyfox/distfiles/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.25/glibc-2.25-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.25-r7.ebuild b/sys-libs/glibc/glibc-2.25-r7.ebuild
new file mode 100644
index 000000000000..18cab6ab3797
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.25-r7.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-glibc
+
+DESCRIPTION="GNU libc6 (also called glibc2) C library"
+HOMEPAGE="https://www.gnu.org/software/libc/libc.html"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+RESTRICT="strip" # strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+RELEASE_VER=""
+case ${PV} in
+9999*)
+ EGIT_REPO_URIS="git://sourceware.org/git/glibc.git"
+ EGIT_SOURCEDIRS="${S}"
+ inherit git-2
+ ;;
+*)
+ RELEASE_VER=${PV}
+ ;;
+esac
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+# patches live at https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/
+PATCH_VER="11" # Gentoo patchset
+: ${NPTL_KERN_VER:="2.6.32"} # min kernel version nptl requires
+
+IUSE="audit caps debug gd hardened multilib nscd +rpc selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# Why SLOT 2.2 you ask yourself while sippin your tea ?
+# Everyone knows 2.2 > 0, duh.
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+ systemtap? ( dev-util/systemtap )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.7
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.7
+ virtual/os-headers"
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+upstream_uris() {
+ echo mirror://gnu/glibc/$1 ftp://sourceware.org/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
+}
+gentoo_uris() {
+ local devspace="HTTP~vapier/dist/URI HTTP~dilfridge/distfiles/URI HTTP~tamiko/distfiles/URI HTTP~slyfox/distfiles/URI"
+ devspace=${devspace//HTTP/https://dev.gentoo.org/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+SRC_URI=$(
+ [[ -z ${EGIT_REPO_URIS} ]] && upstream_uris ${P}.tar.xz
+ [[ -n ${PATCH_VER} ]] && gentoo_uris ${P}-patches-${PATCH_VER}.tar.bz2
+)
+SRC_URI+=" ${GCC_BOOTSTRAP_VER:+multilib? ( $(gentoo_uris gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2) )}"
+
+src_unpack() {
+ [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ toolchain-glibc_src_unpack
+}
+
+src_prepare() {
+ toolchain-glibc_src_prepare
+
+ cd "${S}"
+
+ epatch "${FILESDIR}"/2.19/${PN}-2.19-ia64-gcc-4.8-reloc-hack.patch #503838
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.25/glibc-2.25-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+ fi
+
+ case $(gcc-fullversion) in
+ 4.8.[0-3]|4.9.0)
+ eerror "You need to switch to a newer compiler; gcc-4.8.[0-3] and gcc-4.9.0 miscompile"
+ eerror "glibc. See https://bugs.gentoo.org/547420 for details."
+ die "need to switch compilers #547420"
+ ;;
+ esac
+}
diff --git a/sys-libs/glibc/glibc-2.26-r1.ebuild b/sys-libs/glibc/glibc-2.26-r1.ebuild
new file mode 100644
index 000000000000..29d3ad987099
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.26-r1.ebuild
@@ -0,0 +1,795 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit prefix toolchain-glibc
+
+DESCRIPTION="GNU libc C library"
+HOMEPAGE="https://www.gnu.org/software/libc/"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+RESTRICT="strip" # Strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://sourceware.org/git/glibc.git"
+ inherit git-r3
+else
+ # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ KEYWORDS=""
+ SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
+fi
+
+RELEASE_VER=${PV}
+
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+
+# Gentoo patchset
+PATCH_VER="1"
+
+SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2"
+SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2 )"
+
+IUSE="audit caps debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Min kernel version nptl requires
+: ${NPTL_KERN_VER:="2.6.32"}
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+ systemtap? ( dev-util/systemtap )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db
+"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.9
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.9
+ virtual/os-headers
+ "
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+#
+# the phases
+#
+
+pkg_pretend() {
+ # Make sure devpts is mounted correctly for use w/out setuid pt_chown
+ check_devpts
+
+ # Prevent native builds from downgrading
+ if [[ ${MERGE_TYPE} != "buildonly" ]] && \
+ [[ ${ROOT} == "/" ]] && \
+ [[ ${CBUILD} == ${CHOST} ]] && \
+ [[ ${CHOST} == ${CTARGET} ]] ; then
+ # The high rev # is to allow people to downgrade between -r# versions.
+ # We want to block 2.20->2.19, but 2.20-r3->2.20-r2 should be fine.
+ # Hopefully we never actually use a r# this high.
+ if has_version ">${CATEGORY}/${P}-r10000" ; then
+ eerror "Sanity check to keep you from breaking your system:"
+ eerror " Downgrading glibc is not supported and a sure way to destruction"
+ die "Aborting to save your system"
+ fi
+
+ if ! glibc_run_test '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n'
+ then
+ eerror "Your patched vendor kernel is broken. You need to get an"
+ eerror "update from whoever is providing the kernel to you."
+ eerror "https://sourceware.org/bugzilla/show_bug.cgi?id=5227"
+ eerror "https://bugs.gentoo.org/262698"
+ die "Keeping your system alive, say thank you"
+ fi
+
+ if ! glibc_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n'
+ then
+ eerror "Your old kernel is broken. You need to update it to"
+ eerror "a newer version as syscall(<bignum>) will break."
+ eerror "https://bugs.gentoo.org/279260"
+ die "Keeping your system alive, say thank you"
+ fi
+ fi
+
+ # Users have had a chance to phase themselves, time to give em the boot
+ if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
+ eerror "You still haven't deleted ${EROOT}/etc/locales.build."
+ eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
+ die "Lazy upgrader detected"
+ fi
+
+ if [[ ${CTARGET} == i386-* ]] ; then
+ eerror "i386 CHOSTs are no longer supported."
+ eerror "Chances are you don't actually want/need i386."
+ eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml"
+ die "Please fix your CHOST"
+ fi
+
+ if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
+ ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
+ ewarn "This will result in a 50% performance penalty when running with a 32bit"
+ ewarn "hypervisor, which is probably not what you want."
+ fi
+
+ use hardened && ! tc-enables-pie && \
+ ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
+
+ # Make sure host system is up to date #394453
+ if has_version '<sys-libs/glibc-2.13' && \
+ [[ -n $(scanelf -qys__guard -F'#s%F' "${EROOT}"/lib*/l*-*.so) ]]
+ then
+ ebegin "Scanning system for __guard to see if you need to rebuild first ..."
+ local files=$(
+ scanelf -qys__guard -F'#s%F' \
+ "${EROOT}"/*bin/ \
+ "${EROOT}"/lib* \
+ "${EROOT}"/usr/*bin/ \
+ "${EROOT}"/usr/lib* | \
+ egrep -v \
+ -e "^${EROOT}/lib.*/(libc|ld)-2.*.so$" \
+ -e "^${EROOT}/sbin/(ldconfig|sln)$"
+ )
+ [[ -z ${files} ]]
+ if ! eend $? ; then
+ eerror "Your system still has old SSP __guard symbols. You need to"
+ eerror "rebuild all the packages that provide these files first:"
+ eerror "${files}"
+ die "old __guard detected"
+ fi
+ fi
+}
+
+src_unpack() {
+ use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ setup_env
+
+ # Check NPTL support _before_ we unpack things to save some time
+ check_nptl_support
+
+ if [[ -n ${EGIT_REPO_URI} ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${P}.tar.xz
+ fi
+
+ cd "${S}"
+ touch locale/C-translit.h #185476 #218003
+
+ cd "${WORKDIR}"
+ unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
+ # pull out all the addons
+ local d
+ for d in extra/*/configure ; do
+ d=${d%/configure}
+ [[ -d ${S}/${d} ]] && die "${d} already exists in \${S}"
+ mv "${d}" "${S}" || die "moving ${d} failed"
+ done
+}
+
+src_prepare() {
+ if ! use vanilla ; then
+ elog "Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER} ..."
+ eapply "${WORKDIR}"/patches/*.patch
+ fi
+
+ if just_headers ; then
+ if [[ -e ports/sysdeps/mips/preconfigure ]] ; then
+ # mips peeps like to screw with us. if building headers,
+ # we don't have a real compiler, so we can't let them
+ # insert -mabi on us.
+ sed -i '/CPPFLAGS=.*-mabi/s|.*|:|' ports/sysdeps/mips/preconfigure || die
+ find ports/sysdeps/mips/ -name Makefile -exec sed -i '/^CC.*-mabi=/s:-mabi=.*:-D_MIPS_SZPTR=32:' {} +
+ fi
+ fi
+
+ default
+
+ gnuconfig_update
+
+ cd "${WORKDIR}"
+ find . -name configure -exec touch {} +
+
+ eprefixify extra/locale/locale-gen
+
+ # Fix permissions on some of the scripts.
+ chmod u+x "${S}"/scripts/*.sh
+
+ cd "${S}"
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.25/glibc-2.25-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+ fi
+}
+
+glibc_do_configure() {
+ # Glibc does not work with gold (for various reasons) #269274.
+ tc-ld-disable-gold
+
+ # CXX isnt handled by the multilib system, so if we dont unset here
+ # we accumulate crap across abis
+ unset CXX
+
+ einfo "Configuring glibc for $1"
+
+ local v
+ for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS ; do
+ einfo " $(printf '%15s' ${v}:) ${!v}"
+ done
+
+ # The glibc configure script doesn't properly use LDFLAGS all the time.
+ export CC="$(tc-getCC ${CTARGET}) ${LDFLAGS}"
+ einfo " $(printf '%15s' 'Manual CC:') ${CC}"
+
+ # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
+ export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS)"
+ einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
+
+ echo
+
+ local myconf=()
+
+ # set addons
+ pushd "${S}" > /dev/null
+ local addons=$(echo */configure | sed \
+ -e 's:/configure::g' \
+ -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
+ -e 's: \+$::' \
+ -e 's! !,!g' \
+ -e 's!^!,!' \
+ -e '/^,\*$/d')
+ [[ -d ports ]] && addons+=",ports"
+ popd > /dev/null
+
+ case ${CTARGET} in
+ powerpc-*)
+ # Currently gcc on powerpc32 generates invalid code for
+ # __builtin_return_address(0) calls. Normally programs
+ # don't do that but malloc hooks in glibc do:
+ # https://gcc.gnu.org/PR81996
+ # https://bugs.gentoo.org/629054
+ myconf+=( --enable-stack-protector=no )
+ ;;
+ *)
+ myconf+=( --enable-stack-protector=all )
+ ;;
+ esac
+ myconf+=( --enable-stackguard-randomization )
+
+ [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
+
+ if [[ $1 == "nptl" ]] ; then
+ myconf+=( --enable-kernel=${NPTL_KERN_VER} )
+ else
+ die "invalid pthread option"
+ fi
+ myconf+=( --enable-add-ons="${addons#,}" )
+
+ # Since SELinux support is only required for nscd, only enable it if:
+ # 1. USE selinux
+ # 2. only for the primary ABI on multilib systems
+ # 3. Not a crosscompile
+ if ! is_crosscompile && use selinux ; then
+ if use multilib ; then
+ if is_final_abi ; then
+ myconf+=( --with-selinux )
+ else
+ myconf+=( --without-selinux )
+ fi
+ else
+ myconf+=( --with-selinux )
+ fi
+ else
+ myconf+=( --without-selinux )
+ fi
+
+ # Force a few tests where we always know the answer but
+ # configure is incapable of finding it.
+ if is_crosscompile ; then
+ export \
+ libc_cv_c_cleanup=yes \
+ libc_cv_forced_unwind=yes
+ fi
+
+ myconf+=(
+ --without-cvs
+ --disable-werror
+ --enable-bind-now
+ --build=${CBUILD_OPT:-${CBUILD}}
+ --host=${CTARGET_OPT:-${CTARGET}}
+ $(use_enable profile)
+ $(use_with gd)
+ --with-headers=$(alt_build_headers)
+ --prefix="${EPREFIX}/usr"
+ --sysconfdir="${EPREFIX}/etc"
+ --localstatedir="${EPREFIX}/var"
+ --libdir='$(prefix)'/$(get_libdir)
+ --mandir='$(prefix)'/share/man
+ --infodir='$(prefix)'/share/info
+ --libexecdir='$(libdir)'/misc/glibc
+ --with-bugurl=https://bugs.gentoo.org/
+ --with-pkgversion="$(glibc_banner)"
+ $(use_multiarch || echo --disable-multi-arch)
+ $(in_iuse systemtap && use_enable systemtap)
+ $(in_iuse nscd && use_enable nscd)
+ ${EXTRA_ECONF}
+ )
+
+ # We rely on sys-libs/timezone-data for timezone tools normally.
+ myconf+=( $(use_enable vanilla timezone-tools) )
+
+ # These libs don't have configure flags.
+ ac_cv_lib_audit_audit_log_user_avc_message=$(in_iuse audit && usex audit || echo no)
+ ac_cv_lib_cap_cap_init=$(in_iuse caps && usex caps || echo no)
+
+ # There is no configure option for this and we need to export it
+ # since the glibc build will re-run configure on itself
+ export libc_cv_rootsbindir="${EPREFIX}/sbin"
+ export libc_cv_slibdir="${EPREFIX}/$(get_libdir)"
+
+ # We take care of patching our binutils to use both hash styles,
+ # and many people like to force gnu hash style only, so disable
+ # this overriding check. #347761
+ export libc_cv_hashstyle=no
+
+ local builddir=$(builddir "$1")
+ mkdir -p "${builddir}"
+ cd "${builddir}"
+ set -- "${S}"/configure "${myconf[@]}"
+ echo "$@"
+ "$@" || die "failed to configure glibc"
+
+ # ia64 static cross-compilers are a pita in so much that they
+ # can't produce static ELFs (as the libgcc.a is broken). so
+ # disable building of the programs for those targets if it
+ # doesn't work.
+ # XXX: We could turn this into a compiler test, but ia64 is
+ # the only one that matters, so this should be fine for now.
+ if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then
+ sed -i '1i+link-static = touch $@' config.make
+ fi
+
+ # If we're trying to migrate between ABI sets, we need
+ # to lie and use a local copy of gcc. Like if the system
+ # is built with MULTILIB_ABIS="amd64 x86" but we want to
+ # add x32 to it, gcc/glibc don't yet support x32.
+ if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib ; then
+ echo 'main(){}' > "${T}"/test.c
+ if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then
+ sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die
+ mkdir -p sunrpc
+ cp $(which rpcgen) sunrpc/cross-rpcgen || die
+ touch -t 202001010101 sunrpc/cross-rpcgen || die
+ fi
+ fi
+}
+
+glibc_headers_configure() {
+ export ABI=default
+
+ local builddir=$(builddir "headers")
+ mkdir -p "${builddir}"
+ cd "${builddir}"
+
+ # if we don't have a compiler yet, we can't really test it now ...
+ # hopefully they don't affect header generation, so let's hope for
+ # the best here ...
+ local v vars=(
+ ac_cv_header_cpuid_h=yes
+ libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes
+ libc_cv_asm_cfi_directives=yes
+ libc_cv_broken_visibility_attribute=no
+ libc_cv_c_cleanup=yes
+ libc_cv_forced_unwind=yes
+ libc_cv_gcc___thread=yes
+ libc_cv_mlong_double_128=yes
+ libc_cv_mlong_double_128ibm=yes
+ libc_cv_ppc_machine=yes
+ libc_cv_ppc_rel16=yes
+ libc_cv_predef_fortify_source=no
+ libc_cv_visibility_attribute=yes
+ libc_cv_z_combreloc=yes
+ libc_cv_z_execstack=yes
+ libc_cv_z_initfirst=yes
+ libc_cv_z_nodelete=yes
+ libc_cv_z_nodlopen=yes
+ libc_cv_z_relro=yes
+ libc_mips_abi=${ABI}
+ libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard)
+ # These libs don't have configure flags.
+ ac_cv_lib_audit_audit_log_user_avc_message=no
+ ac_cv_lib_cap_cap_init=no
+ )
+
+ einfo "Forcing cached settings:"
+ for v in "${vars[@]}" ; do
+ einfo " ${v}"
+ export ${v}
+ done
+
+ # Blow away some random CC settings that screw things up. #550192
+ if [[ -d ${S}/sysdeps/mips ]]; then
+ pushd "${S}"/sysdeps/mips >/dev/null
+ sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die
+ sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die
+
+ # Force the mips ABI to the default. This is OK because the set of
+ # installed headers in this phase is the same between the 3 ABIs.
+ # If this ever changes, this hack will break, but that's unlikely
+ # as glibc discourages that behavior.
+ # https://crbug.com/647033
+ sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
+
+ popd >/dev/null
+ fi
+
+ local myconf=()
+ myconf+=(
+ --disable-sanity-checks
+ --enable-hacker-mode
+ --without-cvs
+ --disable-werror
+ --enable-bind-now
+ --build=${CBUILD_OPT:-${CBUILD}}
+ --host=${CTARGET_OPT:-${CTARGET}}
+ --with-headers=$(alt_build_headers)
+ --prefix="${EPREFIX}/usr"
+ ${EXTRA_ECONF}
+ )
+
+ local addons
+ [[ -d ${S}/ports ]] && addons+=",ports"
+ myconf+=( --enable-add-ons="${addons#,}" )
+
+ # Nothing is compiled here which would affect the headers for the target.
+ # So forcing CC/CFLAGS is sane.
+ set -- "${S}"/configure "${myconf[@]}"
+ echo "$@"
+ CC="$(tc-getBUILD_CC)" \
+ CFLAGS="-O1 -pipe" \
+ CPPFLAGS="-U_FORTIFY_SOURCE" \
+ LDFLAGS="" \
+ "$@" || die "failed to configure glibc"
+}
+
+do_src_configure() {
+ if just_headers ; then
+ glibc_headers_configure
+ else
+ glibc_do_configure nptl
+ fi
+}
+
+src_configure() {
+ foreach_abi do_src_configure
+}
+
+do_src_compile() {
+ emake -C "$(builddir nptl)" || die "make nptl for ${ABI} failed"
+}
+
+src_compile() {
+ if just_headers ; then
+ return
+ fi
+
+ foreach_abi do_src_compile
+}
+
+glibc_src_test() {
+ cd "$(builddir $1)"
+ emake -j1 check
+}
+
+do_src_test() {
+ local ret=0
+
+ glibc_src_test nptl
+ : $(( ret |= $? ))
+
+ return ${ret}
+}
+
+src_test() {
+ # Give tests more time to complete.
+ export TIMEOUTFACTOR=5
+
+ foreach_abi do_src_test || die "tests failed"
+}
+
+glibc_do_src_install() {
+ local builddir=$(builddir nptl)
+ cd "${builddir}"
+
+ emake install_root="${D}$(alt_prefix)" install || die
+
+ # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support
+ # which come without headers etc. Only needed for binary packages since the
+ # external net-libs/libnsl has increased soversion. Keep only versioned libraries.
+ find "${D}" -name "libnsl.a" -delete
+ find "${D}" -name "libnsl.so" -delete
+
+ # Normally real_pv is ${PV}. Live ebuilds are exception, there we need
+ # to infer upstream version:
+ # '#define VERSION "2.26.90"' -> '2.26.90'
+ local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
+
+ # Newer versions get fancy with libm linkage to include vectorized support.
+ # While we don't really need a ldscript here, portage QA checks get upset.
+ if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
+ dosym ../../$(get_libdir)/libm-${upstream_pv}.so $(alt_usrlibdir)/libm-${upstream_pv}.so
+ fi
+
+ # We'll take care of the cache ourselves
+ rm -f "${ED}"/etc/ld.so.cache
+
+ # Everything past this point just needs to be done once ...
+ is_final_abi || return 0
+
+ # Make sure the non-native interp can be found on multilib systems even
+ # if the main library set isn't installed into the right place. Maybe
+ # we should query the active gcc for info instead of hardcoding it ?
+ local i ldso_abi ldso_name
+ local ldso_abi_list=(
+ # x86
+ amd64 /lib64/ld-linux-x86-64.so.2
+ x32 /libx32/ld-linux-x32.so.2
+ x86 /lib/ld-linux.so.2
+ # mips
+ o32 /lib/ld.so.1
+ n32 /lib32/ld.so.1
+ n64 /lib64/ld.so.1
+ # powerpc
+ ppc /lib/ld.so.1
+ ppc64 /lib64/ld64.so.1
+ # s390
+ s390 /lib/ld.so.1
+ s390x /lib/ld64.so.1
+ # sparc
+ sparc32 /lib/ld-linux.so.2
+ sparc64 /lib64/ld-linux.so.2
+ )
+ case $(tc-endian) in
+ little)
+ ldso_abi_list+=(
+ # arm
+ arm64 /lib/ld-linux-aarch64.so.1
+ )
+ ;;
+ big)
+ ldso_abi_list+=(
+ # arm
+ arm64 /lib/ld-linux-aarch64_be.so.1
+ )
+ ;;
+ esac
+ if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib
+ fi
+ for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do
+ ldso_abi=${ldso_abi_list[i]}
+ has ${ldso_abi} $(get_install_abis) || continue
+
+ ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}"
+ if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then
+ dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name}
+ fi
+ done
+
+ # With devpts under Linux mounted properly, we do not need the pt_chown
+ # binary to be setuid. This is because the default owners/perms will be
+ # exactly what we want.
+ if in_iuse suid && ! use suid ; then
+ find "${ED}" -name pt_chown -exec chmod -s {} +
+ fi
+
+ #################################################################
+ # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
+ # Make sure we install some symlink hacks so that when we build
+ # a 2nd stage cross-compiler, gcc finds the target system
+ # headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ # We need to make sure that /lib and /usr/lib always exists.
+ # gcc likes to use relative paths to get to its multilibs like
+ # /usr/lib/../lib64/. So while we don't install any files into
+ # /usr/lib/, we do need it to exist.
+ cd "${ED}"$(alt_libdir)/..
+ [[ -e lib ]] || mkdir lib
+ cd "${ED}"$(alt_usrlibdir)/..
+ [[ -e lib ]] || mkdir lib
+
+ dosym usr/include $(alt_prefix)/sys-include
+ return 0
+ fi
+
+ # Files for Debian-style locale updating
+ dodir /usr/share/i18n
+ sed \
+ -e "/^#/d" \
+ -e "/SUPPORTED-LOCALES=/d" \
+ -e "s: \\\\::g" -e "s:/: :g" \
+ "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
+ || die "generating /usr/share/i18n/SUPPORTED failed"
+ cd "${WORKDIR}"/extra/locale
+ dosbin locale-gen
+ doman *.[0-8]
+ insinto /etc
+ doins locale.gen
+
+ # Make sure all the ABI's can find the locales and so we only
+ # have to generate one set
+ local a
+ keepdir /usr/$(get_libdir)/locale
+ for a in $(get_install_abis) ; do
+ if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
+ dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
+ fi
+ done
+
+ cd "${S}"
+
+ # Install misc network config files
+ insinto /etc
+ doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
+ doins "${WORKDIR}"/extra/etc/*.conf
+
+ if use nscd ; then
+ doinitd "$(prefixify_ro "${WORKDIR}"/extra/etc/nscd)"
+
+ local nscd_args=(
+ -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
+ )
+
+ sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd
+
+ systemd_dounit nscd/nscd.service
+ systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
+ else
+ # Do this since extra/etc/*.conf above might have nscd.conf.
+ rm -f "${ED}"/etc/nscd.conf
+ fi
+
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
+ doenvd "${T}"/00glibc
+
+ for d in BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do
+ [[ -s ${d} ]] && dodoc ${d}
+ done
+
+ # Prevent overwriting of the /etc/localtime symlink. We'll handle the
+ # creation of the "factory" symlink in pkg_postinst().
+ rm -f "${ED}"/etc/localtime
+}
+
+glibc_headers_install() {
+ local builddir=$(builddir "headers")
+ cd "${builddir}"
+ emake install_root="${D}$(alt_prefix)" install-headers
+
+ insinto $(alt_headers)/gnu
+ doins "${S}"/include/gnu/stubs.h
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ dosym usr/include $(alt_prefix)/sys-include
+}
+
+src_install() {
+ if just_headers ; then
+ export ABI=default
+ glibc_headers_install
+ return
+ fi
+
+ foreach_abi glibc_do_src_install
+ src_strip
+}
+
+pkg_preinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ # prepare /etc/ld.so.conf.d/ for files
+ mkdir -p "${EROOT}"/etc/ld.so.conf.d
+
+ # Default /etc/hosts.conf:multi to on for systems with small dbs.
+ if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then
+ sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf
+ elog "Defaulting /etc/host.conf:multi to on"
+ fi
+
+ [[ ${ROOT} != "/" ]] && return 0
+ [[ -d ${ED}/$(get_libdir) ]] || return 0
+ [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
+}
+
+pkg_postinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then
+ # Generate fastloading iconv module configuration file.
+ "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
+ fi
+
+ if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
+ # Reload init ... if in a chroot or a diff init package, ignore
+ # errors from this step #253697
+ /sbin/telinit U 2>/dev/null
+
+ # if the host locales.gen contains no entries, we'll install everything
+ local locale_list="${EROOT}etc/locale.gen"
+ if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
+ ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
+ locale_list="${EROOT}usr/share/i18n/SUPPORTED"
+ fi
+ locale-gen -j $(makeopts_jobs) --config "${locale_list}"
+ fi
+}
diff --git a/sys-libs/glibc/glibc-2.26-r2.ebuild b/sys-libs/glibc/glibc-2.26-r2.ebuild
new file mode 100644
index 000000000000..8b6e1b1520be
--- /dev/null
+++ b/sys-libs/glibc/glibc-2.26-r2.ebuild
@@ -0,0 +1,796 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit prefix toolchain-glibc
+
+DESCRIPTION="GNU libc C library"
+HOMEPAGE="https://www.gnu.org/software/libc/"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+RESTRICT="strip" # Strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://sourceware.org/git/glibc.git"
+ inherit git-r3
+else
+ # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ KEYWORDS=""
+ SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
+fi
+
+RELEASE_VER=${PV}
+
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+
+# Gentoo patchset
+PATCH_VER=2
+
+SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2"
+SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2 )"
+
+IUSE="audit caps debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Min kernel version nptl requires
+: ${NPTL_KERN_VER:="2.6.32"}
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+ systemtap? ( dev-util/systemtap )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db
+"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.9
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.9
+ virtual/os-headers
+ "
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+#
+# the phases
+#
+
+pkg_pretend() {
+ # Make sure devpts is mounted correctly for use w/out setuid pt_chown
+ check_devpts
+
+ # Prevent native builds from downgrading
+ if [[ ${MERGE_TYPE} != "buildonly" ]] && \
+ [[ ${ROOT} == "/" ]] && \
+ [[ ${CBUILD} == ${CHOST} ]] && \
+ [[ ${CHOST} == ${CTARGET} ]] ; then
+ # The high rev # is to allow people to downgrade between -r# versions.
+ # We want to block 2.20->2.19, but 2.20-r3->2.20-r2 should be fine.
+ # Hopefully we never actually use a r# this high.
+ if has_version ">${CATEGORY}/${P}-r10000" ; then
+ eerror "Sanity check to keep you from breaking your system:"
+ eerror " Downgrading glibc is not supported and a sure way to destruction"
+ die "Aborting to save your system"
+ fi
+
+ if ! glibc_run_test '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n'
+ then
+ eerror "Your patched vendor kernel is broken. You need to get an"
+ eerror "update from whoever is providing the kernel to you."
+ eerror "https://sourceware.org/bugzilla/show_bug.cgi?id=5227"
+ eerror "https://bugs.gentoo.org/262698"
+ die "Keeping your system alive, say thank you"
+ fi
+
+ if ! glibc_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n'
+ then
+ eerror "Your old kernel is broken. You need to update it to"
+ eerror "a newer version as syscall(<bignum>) will break."
+ eerror "https://bugs.gentoo.org/279260"
+ die "Keeping your system alive, say thank you"
+ fi
+ fi
+
+ # Users have had a chance to phase themselves, time to give em the boot
+ if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
+ eerror "You still haven't deleted ${EROOT}/etc/locales.build."
+ eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
+ die "Lazy upgrader detected"
+ fi
+
+ if [[ ${CTARGET} == i386-* ]] ; then
+ eerror "i386 CHOSTs are no longer supported."
+ eerror "Chances are you don't actually want/need i386."
+ eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml"
+ die "Please fix your CHOST"
+ fi
+
+ if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
+ ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
+ ewarn "This will result in a 50% performance penalty when running with a 32bit"
+ ewarn "hypervisor, which is probably not what you want."
+ fi
+
+ use hardened && ! tc-enables-pie && \
+ ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
+
+ # Make sure host system is up to date #394453
+ if has_version '<sys-libs/glibc-2.13' && \
+ [[ -n $(scanelf -qys__guard -F'#s%F' "${EROOT}"/lib*/l*-*.so) ]]
+ then
+ ebegin "Scanning system for __guard to see if you need to rebuild first ..."
+ local files=$(
+ scanelf -qys__guard -F'#s%F' \
+ "${EROOT}"/*bin/ \
+ "${EROOT}"/lib* \
+ "${EROOT}"/usr/*bin/ \
+ "${EROOT}"/usr/lib* | \
+ egrep -v \
+ -e "^${EROOT}/lib.*/(libc|ld)-2.*.so$" \
+ -e "^${EROOT}/sbin/(ldconfig|sln)$"
+ )
+ [[ -z ${files} ]]
+ if ! eend $? ; then
+ eerror "Your system still has old SSP __guard symbols. You need to"
+ eerror "rebuild all the packages that provide these files first:"
+ eerror "${files}"
+ die "old __guard detected"
+ fi
+ fi
+}
+
+src_unpack() {
+ use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ setup_env
+
+ # Check NPTL support _before_ we unpack things to save some time
+ check_nptl_support
+
+ if [[ -n ${EGIT_REPO_URI} ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${P}.tar.xz
+ fi
+
+ cd "${S}"
+ touch locale/C-translit.h #185476 #218003
+
+ cd "${WORKDIR}"
+ unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
+ # pull out all the addons
+ local d
+ for d in extra/*/configure ; do
+ d=${d%/configure}
+ [[ -d ${S}/${d} ]] && die "${d} already exists in \${S}"
+ mv "${d}" "${S}" || die "moving ${d} failed"
+ done
+}
+
+src_prepare() {
+ if ! use vanilla ; then
+ elog "Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER} ..."
+ eapply "${WORKDIR}"/patches
+ elog "Done."
+ fi
+
+ if just_headers ; then
+ if [[ -e ports/sysdeps/mips/preconfigure ]] ; then
+ # mips peeps like to screw with us. if building headers,
+ # we don't have a real compiler, so we can't let them
+ # insert -mabi on us.
+ sed -i '/CPPFLAGS=.*-mabi/s|.*|:|' ports/sysdeps/mips/preconfigure || die
+ find ports/sysdeps/mips/ -name Makefile -exec sed -i '/^CC.*-mabi=/s:-mabi=.*:-D_MIPS_SZPTR=32:' {} +
+ fi
+ fi
+
+ default
+
+ gnuconfig_update
+
+ cd "${WORKDIR}"
+ find . -name configure -exec touch {} +
+
+ eprefixify extra/locale/locale-gen
+
+ # Fix permissions on some of the scripts.
+ chmod u+x "${S}"/scripts/*.sh
+
+ cd "${S}"
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.25/glibc-2.25-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+ fi
+}
+
+glibc_do_configure() {
+ # Glibc does not work with gold (for various reasons) #269274.
+ tc-ld-disable-gold
+
+ # CXX isnt handled by the multilib system, so if we dont unset here
+ # we accumulate crap across abis
+ unset CXX
+
+ einfo "Configuring glibc for $1"
+
+ local v
+ for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS ; do
+ einfo " $(printf '%15s' ${v}:) ${!v}"
+ done
+
+ # The glibc configure script doesn't properly use LDFLAGS all the time.
+ export CC="$(tc-getCC ${CTARGET}) ${LDFLAGS}"
+ einfo " $(printf '%15s' 'Manual CC:') ${CC}"
+
+ # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
+ export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS)"
+ einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
+
+ echo
+
+ local myconf=()
+
+ # set addons
+ pushd "${S}" > /dev/null
+ local addons=$(echo */configure | sed \
+ -e 's:/configure::g' \
+ -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
+ -e 's: \+$::' \
+ -e 's! !,!g' \
+ -e 's!^!,!' \
+ -e '/^,\*$/d')
+ [[ -d ports ]] && addons+=",ports"
+ popd > /dev/null
+
+ case ${CTARGET} in
+ powerpc-*)
+ # Currently gcc on powerpc32 generates invalid code for
+ # __builtin_return_address(0) calls. Normally programs
+ # don't do that but malloc hooks in glibc do:
+ # https://gcc.gnu.org/PR81996
+ # https://bugs.gentoo.org/629054
+ myconf+=( --enable-stack-protector=no )
+ ;;
+ *)
+ myconf+=( --enable-stack-protector=all )
+ ;;
+ esac
+ myconf+=( --enable-stackguard-randomization )
+
+ [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
+
+ if [[ $1 == "nptl" ]] ; then
+ myconf+=( --enable-kernel=${NPTL_KERN_VER} )
+ else
+ die "invalid pthread option"
+ fi
+ myconf+=( --enable-add-ons="${addons#,}" )
+
+ # Since SELinux support is only required for nscd, only enable it if:
+ # 1. USE selinux
+ # 2. only for the primary ABI on multilib systems
+ # 3. Not a crosscompile
+ if ! is_crosscompile && use selinux ; then
+ if use multilib ; then
+ if is_final_abi ; then
+ myconf+=( --with-selinux )
+ else
+ myconf+=( --without-selinux )
+ fi
+ else
+ myconf+=( --with-selinux )
+ fi
+ else
+ myconf+=( --without-selinux )
+ fi
+
+ # Force a few tests where we always know the answer but
+ # configure is incapable of finding it.
+ if is_crosscompile ; then
+ export \
+ libc_cv_c_cleanup=yes \
+ libc_cv_forced_unwind=yes
+ fi
+
+ myconf+=(
+ --without-cvs
+ --disable-werror
+ --enable-bind-now
+ --build=${CBUILD_OPT:-${CBUILD}}
+ --host=${CTARGET_OPT:-${CTARGET}}
+ $(use_enable profile)
+ $(use_with gd)
+ --with-headers=$(alt_build_headers)
+ --prefix="${EPREFIX}/usr"
+ --sysconfdir="${EPREFIX}/etc"
+ --localstatedir="${EPREFIX}/var"
+ --libdir='$(prefix)'/$(get_libdir)
+ --mandir='$(prefix)'/share/man
+ --infodir='$(prefix)'/share/info
+ --libexecdir='$(libdir)'/misc/glibc
+ --with-bugurl=https://bugs.gentoo.org/
+ --with-pkgversion="$(glibc_banner)"
+ $(use_multiarch || echo --disable-multi-arch)
+ $(in_iuse systemtap && use_enable systemtap)
+ $(in_iuse nscd && use_enable nscd)
+ ${EXTRA_ECONF}
+ )
+
+ # We rely on sys-libs/timezone-data for timezone tools normally.
+ myconf+=( $(use_enable vanilla timezone-tools) )
+
+ # These libs don't have configure flags.
+ ac_cv_lib_audit_audit_log_user_avc_message=$(in_iuse audit && usex audit || echo no)
+ ac_cv_lib_cap_cap_init=$(in_iuse caps && usex caps || echo no)
+
+ # There is no configure option for this and we need to export it
+ # since the glibc build will re-run configure on itself
+ export libc_cv_rootsbindir="${EPREFIX}/sbin"
+ export libc_cv_slibdir="${EPREFIX}/$(get_libdir)"
+
+ # We take care of patching our binutils to use both hash styles,
+ # and many people like to force gnu hash style only, so disable
+ # this overriding check. #347761
+ export libc_cv_hashstyle=no
+
+ local builddir=$(builddir "$1")
+ mkdir -p "${builddir}"
+ cd "${builddir}"
+ set -- "${S}"/configure "${myconf[@]}"
+ echo "$@"
+ "$@" || die "failed to configure glibc"
+
+ # ia64 static cross-compilers are a pita in so much that they
+ # can't produce static ELFs (as the libgcc.a is broken). so
+ # disable building of the programs for those targets if it
+ # doesn't work.
+ # XXX: We could turn this into a compiler test, but ia64 is
+ # the only one that matters, so this should be fine for now.
+ if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then
+ sed -i '1i+link-static = touch $@' config.make
+ fi
+
+ # If we're trying to migrate between ABI sets, we need
+ # to lie and use a local copy of gcc. Like if the system
+ # is built with MULTILIB_ABIS="amd64 x86" but we want to
+ # add x32 to it, gcc/glibc don't yet support x32.
+ if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib ; then
+ echo 'main(){}' > "${T}"/test.c
+ if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then
+ sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die
+ mkdir -p sunrpc
+ cp $(which rpcgen) sunrpc/cross-rpcgen || die
+ touch -t 202001010101 sunrpc/cross-rpcgen || die
+ fi
+ fi
+}
+
+glibc_headers_configure() {
+ export ABI=default
+
+ local builddir=$(builddir "headers")
+ mkdir -p "${builddir}"
+ cd "${builddir}"
+
+ # if we don't have a compiler yet, we can't really test it now ...
+ # hopefully they don't affect header generation, so let's hope for
+ # the best here ...
+ local v vars=(
+ ac_cv_header_cpuid_h=yes
+ libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes
+ libc_cv_asm_cfi_directives=yes
+ libc_cv_broken_visibility_attribute=no
+ libc_cv_c_cleanup=yes
+ libc_cv_forced_unwind=yes
+ libc_cv_gcc___thread=yes
+ libc_cv_mlong_double_128=yes
+ libc_cv_mlong_double_128ibm=yes
+ libc_cv_ppc_machine=yes
+ libc_cv_ppc_rel16=yes
+ libc_cv_predef_fortify_source=no
+ libc_cv_visibility_attribute=yes
+ libc_cv_z_combreloc=yes
+ libc_cv_z_execstack=yes
+ libc_cv_z_initfirst=yes
+ libc_cv_z_nodelete=yes
+ libc_cv_z_nodlopen=yes
+ libc_cv_z_relro=yes
+ libc_mips_abi=${ABI}
+ libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard)
+ # These libs don't have configure flags.
+ ac_cv_lib_audit_audit_log_user_avc_message=no
+ ac_cv_lib_cap_cap_init=no
+ )
+
+ einfo "Forcing cached settings:"
+ for v in "${vars[@]}" ; do
+ einfo " ${v}"
+ export ${v}
+ done
+
+ # Blow away some random CC settings that screw things up. #550192
+ if [[ -d ${S}/sysdeps/mips ]]; then
+ pushd "${S}"/sysdeps/mips >/dev/null
+ sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die
+ sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die
+
+ # Force the mips ABI to the default. This is OK because the set of
+ # installed headers in this phase is the same between the 3 ABIs.
+ # If this ever changes, this hack will break, but that's unlikely
+ # as glibc discourages that behavior.
+ # https://crbug.com/647033
+ sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
+
+ popd >/dev/null
+ fi
+
+ local myconf=()
+ myconf+=(
+ --disable-sanity-checks
+ --enable-hacker-mode
+ --without-cvs
+ --disable-werror
+ --enable-bind-now
+ --build=${CBUILD_OPT:-${CBUILD}}
+ --host=${CTARGET_OPT:-${CTARGET}}
+ --with-headers=$(alt_build_headers)
+ --prefix="${EPREFIX}/usr"
+ ${EXTRA_ECONF}
+ )
+
+ local addons
+ [[ -d ${S}/ports ]] && addons+=",ports"
+ myconf+=( --enable-add-ons="${addons#,}" )
+
+ # Nothing is compiled here which would affect the headers for the target.
+ # So forcing CC/CFLAGS is sane.
+ set -- "${S}"/configure "${myconf[@]}"
+ echo "$@"
+ CC="$(tc-getBUILD_CC)" \
+ CFLAGS="-O1 -pipe" \
+ CPPFLAGS="-U_FORTIFY_SOURCE" \
+ LDFLAGS="" \
+ "$@" || die "failed to configure glibc"
+}
+
+do_src_configure() {
+ if just_headers ; then
+ glibc_headers_configure
+ else
+ glibc_do_configure nptl
+ fi
+}
+
+src_configure() {
+ foreach_abi do_src_configure
+}
+
+do_src_compile() {
+ emake -C "$(builddir nptl)" || die "make nptl for ${ABI} failed"
+}
+
+src_compile() {
+ if just_headers ; then
+ return
+ fi
+
+ foreach_abi do_src_compile
+}
+
+glibc_src_test() {
+ cd "$(builddir $1)"
+ emake -j1 check
+}
+
+do_src_test() {
+ local ret=0
+
+ glibc_src_test nptl
+ : $(( ret |= $? ))
+
+ return ${ret}
+}
+
+src_test() {
+ # Give tests more time to complete.
+ export TIMEOUTFACTOR=5
+
+ foreach_abi do_src_test || die "tests failed"
+}
+
+glibc_do_src_install() {
+ local builddir=$(builddir nptl)
+ cd "${builddir}"
+
+ emake install_root="${D}$(alt_prefix)" install || die
+
+ # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support
+ # which come without headers etc. Only needed for binary packages since the
+ # external net-libs/libnsl has increased soversion. Keep only versioned libraries.
+ find "${D}" -name "libnsl.a" -delete
+ find "${D}" -name "libnsl.so" -delete
+
+ # Normally real_pv is ${PV}. Live ebuilds are exception, there we need
+ # to infer upstream version:
+ # '#define VERSION "2.26.90"' -> '2.26.90'
+ local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
+
+ # Newer versions get fancy with libm linkage to include vectorized support.
+ # While we don't really need a ldscript here, portage QA checks get upset.
+ if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
+ dosym ../../$(get_libdir)/libm-${upstream_pv}.so $(alt_usrlibdir)/libm-${upstream_pv}.so
+ fi
+
+ # We'll take care of the cache ourselves
+ rm -f "${ED}"/etc/ld.so.cache
+
+ # Everything past this point just needs to be done once ...
+ is_final_abi || return 0
+
+ # Make sure the non-native interp can be found on multilib systems even
+ # if the main library set isn't installed into the right place. Maybe
+ # we should query the active gcc for info instead of hardcoding it ?
+ local i ldso_abi ldso_name
+ local ldso_abi_list=(
+ # x86
+ amd64 /lib64/ld-linux-x86-64.so.2
+ x32 /libx32/ld-linux-x32.so.2
+ x86 /lib/ld-linux.so.2
+ # mips
+ o32 /lib/ld.so.1
+ n32 /lib32/ld.so.1
+ n64 /lib64/ld.so.1
+ # powerpc
+ ppc /lib/ld.so.1
+ ppc64 /lib64/ld64.so.1
+ # s390
+ s390 /lib/ld.so.1
+ s390x /lib/ld64.so.1
+ # sparc
+ sparc32 /lib/ld-linux.so.2
+ sparc64 /lib64/ld-linux.so.2
+ )
+ case $(tc-endian) in
+ little)
+ ldso_abi_list+=(
+ # arm
+ arm64 /lib/ld-linux-aarch64.so.1
+ )
+ ;;
+ big)
+ ldso_abi_list+=(
+ # arm
+ arm64 /lib/ld-linux-aarch64_be.so.1
+ )
+ ;;
+ esac
+ if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib
+ fi
+ for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do
+ ldso_abi=${ldso_abi_list[i]}
+ has ${ldso_abi} $(get_install_abis) || continue
+
+ ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}"
+ if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then
+ dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name}
+ fi
+ done
+
+ # With devpts under Linux mounted properly, we do not need the pt_chown
+ # binary to be setuid. This is because the default owners/perms will be
+ # exactly what we want.
+ if in_iuse suid && ! use suid ; then
+ find "${ED}" -name pt_chown -exec chmod -s {} +
+ fi
+
+ #################################################################
+ # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
+ # Make sure we install some symlink hacks so that when we build
+ # a 2nd stage cross-compiler, gcc finds the target system
+ # headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ # We need to make sure that /lib and /usr/lib always exists.
+ # gcc likes to use relative paths to get to its multilibs like
+ # /usr/lib/../lib64/. So while we don't install any files into
+ # /usr/lib/, we do need it to exist.
+ cd "${ED}"$(alt_libdir)/..
+ [[ -e lib ]] || mkdir lib
+ cd "${ED}"$(alt_usrlibdir)/..
+ [[ -e lib ]] || mkdir lib
+
+ dosym usr/include $(alt_prefix)/sys-include
+ return 0
+ fi
+
+ # Files for Debian-style locale updating
+ dodir /usr/share/i18n
+ sed \
+ -e "/^#/d" \
+ -e "/SUPPORTED-LOCALES=/d" \
+ -e "s: \\\\::g" -e "s:/: :g" \
+ "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
+ || die "generating /usr/share/i18n/SUPPORTED failed"
+ cd "${WORKDIR}"/extra/locale
+ dosbin locale-gen
+ doman *.[0-8]
+ insinto /etc
+ doins locale.gen
+
+ # Make sure all the ABI's can find the locales and so we only
+ # have to generate one set
+ local a
+ keepdir /usr/$(get_libdir)/locale
+ for a in $(get_install_abis) ; do
+ if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
+ dosym ../$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
+ fi
+ done
+
+ cd "${S}"
+
+ # Install misc network config files
+ insinto /etc
+ doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
+ doins "${WORKDIR}"/extra/etc/*.conf
+
+ if use nscd ; then
+ doinitd "$(prefixify_ro "${WORKDIR}"/extra/etc/nscd)"
+
+ local nscd_args=(
+ -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
+ )
+
+ sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd
+
+ systemd_dounit nscd/nscd.service
+ systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
+ else
+ # Do this since extra/etc/*.conf above might have nscd.conf.
+ rm -f "${ED}"/etc/nscd.conf
+ fi
+
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
+ doenvd "${T}"/00glibc
+
+ for d in BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do
+ [[ -s ${d} ]] && dodoc ${d}
+ done
+
+ # Prevent overwriting of the /etc/localtime symlink. We'll handle the
+ # creation of the "factory" symlink in pkg_postinst().
+ rm -f "${ED}"/etc/localtime
+}
+
+glibc_headers_install() {
+ local builddir=$(builddir "headers")
+ cd "${builddir}"
+ emake install_root="${D}$(alt_prefix)" install-headers
+
+ insinto $(alt_headers)/gnu
+ doins "${S}"/include/gnu/stubs.h
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ dosym usr/include $(alt_prefix)/sys-include
+}
+
+src_install() {
+ if just_headers ; then
+ export ABI=default
+ glibc_headers_install
+ return
+ fi
+
+ foreach_abi glibc_do_src_install
+ src_strip
+}
+
+pkg_preinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ # prepare /etc/ld.so.conf.d/ for files
+ mkdir -p "${EROOT}"/etc/ld.so.conf.d
+
+ # Default /etc/hosts.conf:multi to on for systems with small dbs.
+ if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then
+ sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf
+ elog "Defaulting /etc/host.conf:multi to on"
+ fi
+
+ [[ ${ROOT} != "/" ]] && return 0
+ [[ -d ${ED}/$(get_libdir) ]] || return 0
+ [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
+}
+
+pkg_postinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then
+ # Generate fastloading iconv module configuration file.
+ "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
+ fi
+
+ if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
+ # Reload init ... if in a chroot or a diff init package, ignore
+ # errors from this step #253697
+ /sbin/telinit U 2>/dev/null
+
+ # if the host locales.gen contains no entries, we'll install everything
+ local locale_list="${EROOT}etc/locale.gen"
+ if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
+ ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
+ locale_list="${EROOT}usr/share/i18n/SUPPORTED"
+ fi
+ locale-gen -j $(makeopts_jobs) --config "${locale_list}"
+ fi
+}
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
new file mode 100644
index 000000000000..dacec0b7e245
--- /dev/null
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -0,0 +1,796 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit prefix toolchain-glibc
+
+DESCRIPTION="GNU libc C library"
+HOMEPAGE="https://www.gnu.org/software/libc/"
+
+LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE"
+RESTRICT="strip" # Strip ourself #46186
+EMULTILIB_PKG="true"
+
+# Configuration variables
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://sourceware.org/git/glibc.git"
+ inherit git-r3
+else
+ # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ KEYWORDS=""
+ SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
+fi
+
+RELEASE_VER=${PV}
+
+GCC_BOOTSTRAP_VER="4.7.3-r1"
+
+# Gentoo patchset
+PATCH_VER="3"
+
+SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2"
+SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2 )"
+
+IUSE="audit caps debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only"
+
+# Min kernel version nptl requires
+: ${NPTL_KERN_VER:="2.6.32"}
+
+# Here's how the cross-compile logic breaks down ...
+# CTARGET - machine that will target the binaries
+# CHOST - machine that will host the binaries
+# CBUILD - machine that will build the binaries
+# If CTARGET != CHOST, it means you want a libc for cross-compiling.
+# If CHOST != CBUILD, it means you want to cross-compile the libc.
+# CBUILD = CHOST = CTARGET - native build/install
+# CBUILD != (CHOST = CTARGET) - cross-compile a native build
+# (CBUILD = CHOST) != CTARGET - libc for cross-compiler
+# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler
+# For install paths:
+# CHOST = CTARGET - install into /
+# CHOST != CTARGET - install into /usr/CTARGET/
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+SLOT="2.2"
+
+# General: We need a new-enough binutils/gcc to match upstream baseline.
+# arch: we need to make sure our binutils/gcc supports TLS.
+COMMON_DEPEND="
+ nscd? ( selinux? (
+ audit? ( sys-process/audit )
+ caps? ( sys-libs/libcap )
+ ) )
+ suid? ( caps? ( sys-libs/libcap ) )
+ selinux? ( sys-libs/libselinux )
+ systemtap? ( dev-util/systemtap )
+"
+DEPEND="${COMMON_DEPEND}
+ >=app-misc/pax-utils-0.1.10
+ !<sys-apps/sandbox-1.6
+ !<sys-apps/portage-2.1.2
+"
+RDEPEND="${COMMON_DEPEND}
+ !sys-kernel/ps3-sources
+ sys-apps/gentoo-functions
+ !sys-libs/nss-db
+"
+
+if [[ ${CATEGORY} == cross-* ]] ; then
+ DEPEND+=" !crosscompile_opts_headers-only? (
+ >=${CATEGORY}/binutils-2.24
+ >=${CATEGORY}/gcc-4.9
+ )"
+ [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
+else
+ DEPEND+="
+ >=sys-devel/binutils-2.24
+ >=sys-devel/gcc-4.9
+ virtual/os-headers
+ "
+ RDEPEND+=" vanilla? ( !sys-libs/timezone-data )"
+ PDEPEND+=" !vanilla? ( sys-libs/timezone-data )"
+fi
+
+#
+# the phases
+#
+
+pkg_pretend() {
+ # Make sure devpts is mounted correctly for use w/out setuid pt_chown
+ check_devpts
+
+ # Prevent native builds from downgrading
+ if [[ ${MERGE_TYPE} != "buildonly" ]] && \
+ [[ ${ROOT} == "/" ]] && \
+ [[ ${CBUILD} == ${CHOST} ]] && \
+ [[ ${CHOST} == ${CTARGET} ]] ; then
+ # The high rev # is to allow people to downgrade between -r# versions.
+ # We want to block 2.20->2.19, but 2.20-r3->2.20-r2 should be fine.
+ # Hopefully we never actually use a r# this high.
+ if has_version ">${CATEGORY}/${P}-r10000" ; then
+ eerror "Sanity check to keep you from breaking your system:"
+ eerror " Downgrading glibc is not supported and a sure way to destruction"
+ die "Aborting to save your system"
+ fi
+
+ if ! glibc_run_test '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n'
+ then
+ eerror "Your patched vendor kernel is broken. You need to get an"
+ eerror "update from whoever is providing the kernel to you."
+ eerror "https://sourceware.org/bugzilla/show_bug.cgi?id=5227"
+ eerror "https://bugs.gentoo.org/262698"
+ die "Keeping your system alive, say thank you"
+ fi
+
+ if ! glibc_run_test '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n'
+ then
+ eerror "Your old kernel is broken. You need to update it to"
+ eerror "a newer version as syscall(<bignum>) will break."
+ eerror "https://bugs.gentoo.org/279260"
+ die "Keeping your system alive, say thank you"
+ fi
+ fi
+
+ # Users have had a chance to phase themselves, time to give em the boot
+ if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then
+ eerror "You still haven't deleted ${EROOT}/etc/locales.build."
+ eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher."
+ die "Lazy upgrader detected"
+ fi
+
+ if [[ ${CTARGET} == i386-* ]] ; then
+ eerror "i386 CHOSTs are no longer supported."
+ eerror "Chances are you don't actually want/need i386."
+ eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml"
+ die "Please fix your CHOST"
+ fi
+
+ if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
+ ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
+ ewarn "This will result in a 50% performance penalty when running with a 32bit"
+ ewarn "hypervisor, which is probably not what you want."
+ fi
+
+ use hardened && ! tc-enables-pie && \
+ ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
+
+ # Make sure host system is up to date #394453
+ if has_version '<sys-libs/glibc-2.13' && \
+ [[ -n $(scanelf -qys__guard -F'#s%F' "${EROOT}"/lib*/l*-*.so) ]]
+ then
+ ebegin "Scanning system for __guard to see if you need to rebuild first ..."
+ local files=$(
+ scanelf -qys__guard -F'#s%F' \
+ "${EROOT}"/*bin/ \
+ "${EROOT}"/lib* \
+ "${EROOT}"/usr/*bin/ \
+ "${EROOT}"/usr/lib* | \
+ egrep -v \
+ -e "^${EROOT}/lib.*/(libc|ld)-2.*.so$" \
+ -e "^${EROOT}/sbin/(ldconfig|sln)$"
+ )
+ [[ -z ${files} ]]
+ if ! eend $? ; then
+ eerror "Your system still has old SSP __guard symbols. You need to"
+ eerror "rebuild all the packages that provide these files first:"
+ eerror "${files}"
+ die "old __guard detected"
+ fi
+ fi
+}
+
+src_unpack() {
+ use multilib && unpack gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2
+
+ setup_env
+
+ # Check NPTL support _before_ we unpack things to save some time
+ check_nptl_support
+
+ if [[ -n ${EGIT_REPO_URI} ]] ; then
+ git-r3_src_unpack
+ else
+ unpack ${P}.tar.xz
+ fi
+
+ cd "${S}"
+ touch locale/C-translit.h #185476 #218003
+
+ cd "${WORKDIR}"
+ unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
+ # pull out all the addons
+ local d
+ for d in extra/*/configure ; do
+ d=${d%/configure}
+ [[ -d ${S}/${d} ]] && die "${d} already exists in \${S}"
+ mv "${d}" "${S}" || die "moving ${d} failed"
+ done
+}
+
+src_prepare() {
+ if ! use vanilla ; then
+ elog "Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER} ..."
+ eapply "${WORKDIR}"/patches
+ elog "Done."
+ fi
+
+ if just_headers ; then
+ if [[ -e ports/sysdeps/mips/preconfigure ]] ; then
+ # mips peeps like to screw with us. if building headers,
+ # we don't have a real compiler, so we can't let them
+ # insert -mabi on us.
+ sed -i '/CPPFLAGS=.*-mabi/s|.*|:|' ports/sysdeps/mips/preconfigure || die
+ find ports/sysdeps/mips/ -name Makefile -exec sed -i '/^CC.*-mabi=/s:-mabi=.*:-D_MIPS_SZPTR=32:' {} +
+ fi
+ fi
+
+ default
+
+ gnuconfig_update
+
+ cd "${WORKDIR}"
+ find . -name configure -exec touch {} +
+
+ eprefixify extra/locale/locale-gen
+
+ # Fix permissions on some of the scripts.
+ chmod u+x "${S}"/scripts/*.sh
+
+ cd "${S}"
+
+ if use hardened ; then
+ # We don't enable these for non-hardened as the output is very terse --
+ # it only states that a crash happened. The default upstream behavior
+ # includes backtraces and symbols.
+ einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
+ cp "${FILESDIR}"/2.20/glibc-2.20-gentoo-stack_chk_fail.c debug/stack_chk_fail.c || die
+ cp "${FILESDIR}"/2.25/glibc-2.25-gentoo-chk_fail.c debug/chk_fail.c || die
+
+ if use debug ; then
+ # Allow SIGABRT to dump core on non-hardened systems, or when debug is requested.
+ sed -i \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ -e '/^CFLAGS-backtrace.c/ iCPPFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
+ debug/Makefile || die
+ fi
+ fi
+}
+
+glibc_do_configure() {
+ # Glibc does not work with gold (for various reasons) #269274.
+ tc-ld-disable-gold
+
+ # CXX isnt handled by the multilib system, so if we dont unset here
+ # we accumulate crap across abis
+ unset CXX
+
+ einfo "Configuring glibc for $1"
+
+ local v
+ for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS ; do
+ einfo " $(printf '%15s' ${v}:) ${!v}"
+ done
+
+ # The glibc configure script doesn't properly use LDFLAGS all the time.
+ export CC="$(tc-getCC ${CTARGET}) ${LDFLAGS}"
+ einfo " $(printf '%15s' 'Manual CC:') ${CC}"
+
+ # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548
+ export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS)"
+ einfo " $(printf '%15s' 'Manual CXX:') ${CXX}"
+
+ echo
+
+ local myconf=()
+
+ # set addons
+ pushd "${S}" > /dev/null
+ local addons=$(echo */configure | sed \
+ -e 's:/configure::g' \
+ -e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
+ -e 's: \+$::' \
+ -e 's! !,!g' \
+ -e 's!^!,!' \
+ -e '/^,\*$/d')
+ [[ -d ports ]] && addons+=",ports"
+ popd > /dev/null
+
+ case ${CTARGET} in
+ powerpc-*)
+ # Currently gcc on powerpc32 generates invalid code for
+ # __builtin_return_address(0) calls. Normally programs
+ # don't do that but malloc hooks in glibc do:
+ # https://gcc.gnu.org/PR81996
+ # https://bugs.gentoo.org/629054
+ myconf+=( --enable-stack-protector=no )
+ ;;
+ *)
+ myconf+=( --enable-stack-protector=all )
+ ;;
+ esac
+ myconf+=( --enable-stackguard-randomization )
+
+ [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
+
+ if [[ $1 == "nptl" ]] ; then
+ myconf+=( --enable-kernel=${NPTL_KERN_VER} )
+ else
+ die "invalid pthread option"
+ fi
+ myconf+=( --enable-add-ons="${addons#,}" )
+
+ # Since SELinux support is only required for nscd, only enable it if:
+ # 1. USE selinux
+ # 2. only for the primary ABI on multilib systems
+ # 3. Not a crosscompile
+ if ! is_crosscompile && use selinux ; then
+ if use multilib ; then
+ if is_final_abi ; then
+ myconf+=( --with-selinux )
+ else
+ myconf+=( --without-selinux )
+ fi
+ else
+ myconf+=( --with-selinux )
+ fi
+ else
+ myconf+=( --without-selinux )
+ fi
+
+ # Force a few tests where we always know the answer but
+ # configure is incapable of finding it.
+ if is_crosscompile ; then
+ export \
+ libc_cv_c_cleanup=yes \
+ libc_cv_forced_unwind=yes
+ fi
+
+ myconf+=(
+ --without-cvs
+ --disable-werror
+ --enable-bind-now
+ --build=${CBUILD_OPT:-${CBUILD}}
+ --host=${CTARGET_OPT:-${CTARGET}}
+ $(use_enable profile)
+ $(use_with gd)
+ --with-headers=$(alt_build_headers)
+ --prefix="${EPREFIX}/usr"
+ --sysconfdir="${EPREFIX}/etc"
+ --localstatedir="${EPREFIX}/var"
+ --libdir='$(prefix)'/$(get_libdir)
+ --mandir='$(prefix)'/share/man
+ --infodir='$(prefix)'/share/info
+ --libexecdir='$(libdir)'/misc/glibc
+ --with-bugurl=https://bugs.gentoo.org/
+ --with-pkgversion="$(glibc_banner)"
+ $(use_multiarch || echo --disable-multi-arch)
+ $(in_iuse systemtap && use_enable systemtap)
+ $(in_iuse nscd && use_enable nscd)
+ ${EXTRA_ECONF}
+ )
+
+ # We rely on sys-libs/timezone-data for timezone tools normally.
+ myconf+=( $(use_enable vanilla timezone-tools) )
+
+ # These libs don't have configure flags.
+ ac_cv_lib_audit_audit_log_user_avc_message=$(in_iuse audit && usex audit || echo no)
+ ac_cv_lib_cap_cap_init=$(in_iuse caps && usex caps || echo no)
+
+ # There is no configure option for this and we need to export it
+ # since the glibc build will re-run configure on itself
+ export libc_cv_rootsbindir="${EPREFIX}/sbin"
+ export libc_cv_slibdir="${EPREFIX}/$(get_libdir)"
+
+ # We take care of patching our binutils to use both hash styles,
+ # and many people like to force gnu hash style only, so disable
+ # this overriding check. #347761
+ export libc_cv_hashstyle=no
+
+ local builddir=$(builddir "$1")
+ mkdir -p "${builddir}"
+ cd "${builddir}"
+ set -- "${S}"/configure "${myconf[@]}"
+ echo "$@"
+ "$@" || die "failed to configure glibc"
+
+ # ia64 static cross-compilers are a pita in so much that they
+ # can't produce static ELFs (as the libgcc.a is broken). so
+ # disable building of the programs for those targets if it
+ # doesn't work.
+ # XXX: We could turn this into a compiler test, but ia64 is
+ # the only one that matters, so this should be fine for now.
+ if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then
+ sed -i '1i+link-static = touch $@' config.make
+ fi
+
+ # If we're trying to migrate between ABI sets, we need
+ # to lie and use a local copy of gcc. Like if the system
+ # is built with MULTILIB_ABIS="amd64 x86" but we want to
+ # add x32 to it, gcc/glibc don't yet support x32.
+ if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib ; then
+ echo 'main(){}' > "${T}"/test.c
+ if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then
+ sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die
+ mkdir -p sunrpc
+ cp $(which rpcgen) sunrpc/cross-rpcgen || die
+ touch -t 202001010101 sunrpc/cross-rpcgen || die
+ fi
+ fi
+}
+
+glibc_headers_configure() {
+ export ABI=default
+
+ local builddir=$(builddir "headers")
+ mkdir -p "${builddir}"
+ cd "${builddir}"
+
+ # if we don't have a compiler yet, we can't really test it now ...
+ # hopefully they don't affect header generation, so let's hope for
+ # the best here ...
+ local v vars=(
+ ac_cv_header_cpuid_h=yes
+ libc_cv_{386,390,alpha,arm,hppa,ia64,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes
+ libc_cv_asm_cfi_directives=yes
+ libc_cv_broken_visibility_attribute=no
+ libc_cv_c_cleanup=yes
+ libc_cv_forced_unwind=yes
+ libc_cv_gcc___thread=yes
+ libc_cv_mlong_double_128=yes
+ libc_cv_mlong_double_128ibm=yes
+ libc_cv_ppc_machine=yes
+ libc_cv_ppc_rel16=yes
+ libc_cv_predef_fortify_source=no
+ libc_cv_visibility_attribute=yes
+ libc_cv_z_combreloc=yes
+ libc_cv_z_execstack=yes
+ libc_cv_z_initfirst=yes
+ libc_cv_z_nodelete=yes
+ libc_cv_z_nodlopen=yes
+ libc_cv_z_relro=yes
+ libc_mips_abi=${ABI}
+ libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard)
+ # These libs don't have configure flags.
+ ac_cv_lib_audit_audit_log_user_avc_message=no
+ ac_cv_lib_cap_cap_init=no
+ )
+
+ einfo "Forcing cached settings:"
+ for v in "${vars[@]}" ; do
+ einfo " ${v}"
+ export ${v}
+ done
+
+ # Blow away some random CC settings that screw things up. #550192
+ if [[ -d ${S}/sysdeps/mips ]]; then
+ pushd "${S}"/sysdeps/mips >/dev/null
+ sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die
+ sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die
+
+ # Force the mips ABI to the default. This is OK because the set of
+ # installed headers in this phase is the same between the 3 ABIs.
+ # If this ever changes, this hack will break, but that's unlikely
+ # as glibc discourages that behavior.
+ # https://crbug.com/647033
+ sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die
+
+ popd >/dev/null
+ fi
+
+ local myconf=()
+ myconf+=(
+ --disable-sanity-checks
+ --enable-hacker-mode
+ --without-cvs
+ --disable-werror
+ --enable-bind-now
+ --build=${CBUILD_OPT:-${CBUILD}}
+ --host=${CTARGET_OPT:-${CTARGET}}
+ --with-headers=$(alt_build_headers)
+ --prefix="${EPREFIX}/usr"
+ ${EXTRA_ECONF}
+ )
+
+ local addons
+ [[ -d ${S}/ports ]] && addons+=",ports"
+ myconf+=( --enable-add-ons="${addons#,}" )
+
+ # Nothing is compiled here which would affect the headers for the target.
+ # So forcing CC/CFLAGS is sane.
+ set -- "${S}"/configure "${myconf[@]}"
+ echo "$@"
+ CC="$(tc-getBUILD_CC)" \
+ CFLAGS="-O1 -pipe" \
+ CPPFLAGS="-U_FORTIFY_SOURCE" \
+ LDFLAGS="" \
+ "$@" || die "failed to configure glibc"
+}
+
+do_src_configure() {
+ if just_headers ; then
+ glibc_headers_configure
+ else
+ glibc_do_configure nptl
+ fi
+}
+
+src_configure() {
+ foreach_abi do_src_configure
+}
+
+do_src_compile() {
+ emake -C "$(builddir nptl)" || die "make nptl for ${ABI} failed"
+}
+
+src_compile() {
+ if just_headers ; then
+ return
+ fi
+
+ foreach_abi do_src_compile
+}
+
+glibc_src_test() {
+ cd "$(builddir $1)"
+ emake -j1 check
+}
+
+do_src_test() {
+ local ret=0
+
+ glibc_src_test nptl
+ : $(( ret |= $? ))
+
+ return ${ret}
+}
+
+src_test() {
+ # Give tests more time to complete.
+ export TIMEOUTFACTOR=5
+
+ foreach_abi do_src_test || die "tests failed"
+}
+
+glibc_do_src_install() {
+ local builddir=$(builddir nptl)
+ cd "${builddir}"
+
+ emake install_root="${D}$(alt_prefix)" install || die
+
+ # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support
+ # which come without headers etc. Only needed for binary packages since the
+ # external net-libs/libnsl has increased soversion. Keep only versioned libraries.
+ find "${D}" -name "libnsl.a" -delete
+ find "${D}" -name "libnsl.so" -delete
+
+ # Normally real_pv is ${PV}. Live ebuilds are exception, there we need
+ # to infer upstream version:
+ # '#define VERSION "2.26.90"' -> '2.26.90'
+ local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
+
+ # Newer versions get fancy with libm linkage to include vectorized support.
+ # While we don't really need a ldscript here, portage QA checks get upset.
+ if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
+ dosym ../../$(get_libdir)/libm-${upstream_pv}.so $(alt_usrlibdir)/libm-${upstream_pv}.so
+ fi
+
+ # We'll take care of the cache ourselves
+ rm -f "${ED}"/etc/ld.so.cache
+
+ # Everything past this point just needs to be done once ...
+ is_final_abi || return 0
+
+ # Make sure the non-native interp can be found on multilib systems even
+ # if the main library set isn't installed into the right place. Maybe
+ # we should query the active gcc for info instead of hardcoding it ?
+ local i ldso_abi ldso_name
+ local ldso_abi_list=(
+ # x86
+ amd64 /lib64/ld-linux-x86-64.so.2
+ x32 /libx32/ld-linux-x32.so.2
+ x86 /lib/ld-linux.so.2
+ # mips
+ o32 /lib/ld.so.1
+ n32 /lib32/ld.so.1
+ n64 /lib64/ld.so.1
+ # powerpc
+ ppc /lib/ld.so.1
+ ppc64 /lib64/ld64.so.1
+ # s390
+ s390 /lib/ld.so.1
+ s390x /lib/ld64.so.1
+ # sparc
+ sparc32 /lib/ld-linux.so.2
+ sparc64 /lib64/ld-linux.so.2
+ )
+ case $(tc-endian) in
+ little)
+ ldso_abi_list+=(
+ # arm
+ arm64 /lib/ld-linux-aarch64.so.1
+ )
+ ;;
+ big)
+ ldso_abi_list+=(
+ # arm
+ arm64 /lib/ld-linux-aarch64_be.so.1
+ )
+ ;;
+ esac
+ if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib
+ fi
+ for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do
+ ldso_abi=${ldso_abi_list[i]}
+ has ${ldso_abi} $(get_install_abis) || continue
+
+ ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}"
+ if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then
+ dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name}
+ fi
+ done
+
+ # With devpts under Linux mounted properly, we do not need the pt_chown
+ # binary to be setuid. This is because the default owners/perms will be
+ # exactly what we want.
+ if in_iuse suid && ! use suid ; then
+ find "${ED}" -name pt_chown -exec chmod -s {} +
+ fi
+
+ #################################################################
+ # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
+ # Make sure we install some symlink hacks so that when we build
+ # a 2nd stage cross-compiler, gcc finds the target system
+ # headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ # We need to make sure that /lib and /usr/lib always exists.
+ # gcc likes to use relative paths to get to its multilibs like
+ # /usr/lib/../lib64/. So while we don't install any files into
+ # /usr/lib/, we do need it to exist.
+ cd "${ED}"$(alt_libdir)/..
+ [[ -e lib ]] || mkdir lib
+ cd "${ED}"$(alt_usrlibdir)/..
+ [[ -e lib ]] || mkdir lib
+
+ dosym usr/include $(alt_prefix)/sys-include
+ return 0
+ fi
+
+ # Files for Debian-style locale updating
+ dodir /usr/share/i18n
+ sed \
+ -e "/^#/d" \
+ -e "/SUPPORTED-LOCALES=/d" \
+ -e "s: \\\\::g" -e "s:/: :g" \
+ "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \
+ || die "generating /usr/share/i18n/SUPPORTED failed"
+ cd "${WORKDIR}"/extra/locale
+ dosbin locale-gen
+ doman *.[0-8]
+ insinto /etc
+ doins locale.gen
+
+ # Make sure all the ABI's can find the locales and so we only
+ # have to generate one set
+ local a
+ keepdir /usr/$(get_libdir)/locale
+ for a in $(get_install_abis) ; do
+ if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
+ dosym ../$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
+ fi
+ done
+
+ cd "${S}"
+
+ # Install misc network config files
+ insinto /etc
+ doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
+ doins "${WORKDIR}"/extra/etc/*.conf
+
+ if use nscd ; then
+ doinitd "$(prefixify_ro "${WORKDIR}"/extra/etc/nscd)"
+
+ local nscd_args=(
+ -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
+ )
+
+ sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd
+
+ systemd_dounit nscd/nscd.service
+ systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
+ else
+ # Do this since extra/etc/*.conf above might have nscd.conf.
+ rm -f "${ED}"/etc/nscd.conf
+ fi
+
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
+ doenvd "${T}"/00glibc
+
+ for d in BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do
+ [[ -s ${d} ]] && dodoc ${d}
+ done
+
+ # Prevent overwriting of the /etc/localtime symlink. We'll handle the
+ # creation of the "factory" symlink in pkg_postinst().
+ rm -f "${ED}"/etc/localtime
+}
+
+glibc_headers_install() {
+ local builddir=$(builddir "headers")
+ cd "${builddir}"
+ emake install_root="${D}$(alt_prefix)" install-headers
+
+ insinto $(alt_headers)/gnu
+ doins "${S}"/include/gnu/stubs.h
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ dosym usr/include $(alt_prefix)/sys-include
+}
+
+src_install() {
+ if just_headers ; then
+ export ABI=default
+ glibc_headers_install
+ return
+ fi
+
+ foreach_abi glibc_do_src_install
+ src_strip
+}
+
+pkg_preinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ # prepare /etc/ld.so.conf.d/ for files
+ mkdir -p "${EROOT}"/etc/ld.so.conf.d
+
+ # Default /etc/hosts.conf:multi to on for systems with small dbs.
+ if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then
+ sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf
+ elog "Defaulting /etc/host.conf:multi to on"
+ fi
+
+ [[ ${ROOT} != "/" ]] && return 0
+ [[ -d ${ED}/$(get_libdir) ]] || return 0
+ [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
+}
+
+pkg_postinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then
+ # Generate fastloading iconv module configuration file.
+ "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
+ fi
+
+ if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
+ # Reload init ... if in a chroot or a diff init package, ignore
+ # errors from this step #253697
+ /sbin/telinit U 2>/dev/null
+
+ # if the host locales.gen contains no entries, we'll install everything
+ local locale_list="${EROOT}etc/locale.gen"
+ if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
+ ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
+ locale_list="${EROOT}usr/share/i18n/SUPPORTED"
+ fi
+ locale-gen -j $(makeopts_jobs) --config "${locale_list}"
+ fi
+}
diff --git a/sys-libs/glibc/metadata.xml b/sys-libs/glibc/metadata.xml
new file mode 100644
index 000000000000..e6ebe220ca6b
--- /dev/null
+++ b/sys-libs/glibc/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 type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+<use>
+ <flag name="debug">When USE=hardened, allow fortify/stack violations to dump core (SIGABRT) and not kill self (SIGKILL)</flag>
+ <flag name="gd">build memusage and memusagestat tools</flag>
+ <flag name="nscd">Build, and enable support for, the Name Service Cache Daemon</flag>
+ <flag name="rpc">Enable obsolete RPC/NIS layers (disabling is experimental -- see bug 381391)</flag>
+ <flag name="suid">Make internal pt_chown helper setuid -- not needed if using Linux and have /dev/pts mounted with gid=5</flag>
+ <flag name="systemtap">enable systemtap static probe points</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:gnu:glibc</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/gpm/Manifest b/sys-libs/gpm/Manifest
new file mode 100644
index 000000000000..01a72488158b
--- /dev/null
+++ b/sys-libs/gpm/Manifest
@@ -0,0 +1,11 @@
+AUX gpm-1.20.7-glibc-2.26.patch 425 SHA256 71784722f92f65eee651d982f16235bf6eac922a3ab8c936bc85c59700f6ad29 SHA512 d8d240d07d4aed4080e6066fb1c43f24812ada8ea6254531e657ee598406b7bb7ec46e81755e6d58f8888730c4a1fd5b624f1038034e43022a845decca4d6ba4 WHIRLPOOL 203f75513d0e381a5e01e984350350396252ae761ff77128f3c27b53ebee105feaafe4571a6dcc302aa006471ff84639a49cc7a32383c6e34382ed284553d346
+AUX gpm-1.20.7-sysmacros.patch 1011 SHA256 786f6adeb7d89cbdb2b776c3aace14697b7a4ef5f6ef29113afefa972d35f285 SHA512 05ff1649182eb5223f1835945df8590e83b92d3948461ac55424ade8711a45a1fef61ebacd9497ef0f2c98f8e008e0ba3995eaf02ea567841b77a5ffd5b1e2fe WHIRLPOOL fe8b6ce964b7fc9a4b1f1b117cbc61dd2b0c29ba698da14db7c2e1aac2eab32c7e41321bfe371bb11fce1c371c2c2937151424aa5938ee4cd7fab98b0850d253
+AUX gpm.conf.d 580 SHA256 73e7483fdc4b12ab4225a4cb13bbe7da71b07b9e69b17e3a6a4c63cb5e2287c8 SHA512 14a4306a7454d1a12fda29973b51aadd6d1a5cf4833b1be5298cfe0c1ebc63a479cc79490007ae92c6ae24368e19215dfc4bd50ef5b0cfa0fef88cf69db67065 WHIRLPOOL 61039423b5749f65505db3d0c3355599f5776b8807b7e79720d9498916f1dc1312070209ec470375d0bcb9a36919ad0dbde1f5c6a283454c7ea9be3cc3e33c43
+AUX gpm.rc6-2 553 SHA256 b48fd8ef0c4e64ca3f3ada72e8e2148a276f86bf3cbb1a165504058bd15385c1 SHA512 19cfdab0e401ebc3571975acb6687891a33a176ba23fb04537c8724c2dab47617b67e144b4a89c933e6fdd7e2918857e8eadb2bc270e8ec96a84d855810e5934 WHIRLPOOL e1484ee2df4234b9632045fea120ca9f7e95539c3dcc7ade0a1482547d601b12d006ab3625bd06f5e019906c609bebaad19f9ed8537754515d0c387c4d802db4
+AUX gpm.service 222 SHA256 85f7d7144de8b2b941ba118ff1e6c0579ed825bbb34b576814b05cc45c5a067d SHA512 d710169f06a17aa372e88952bc67d1fb91c795349e9edc37f9c0bebf3bbd6502646ac9aac12ccbb5630b1b39143976e0780b9c7325d3610c3ac1683ffda7f05b WHIRLPOOL 6a7df1311c6f742168bd6aca9ec3c2def2f9755c9fa9f24b60e22a158f366636cefa2d430c5ee30d05dfccd2a576d981c32134052d207608dcf8fa0a8b292b0a
+DIST gpm-1.20.7-docs.patch.xz 41668 SHA256 a1b73e8916d1ae5e336a6c366c2be51b668176d743bb137a53c623f5a634faf6 SHA512 6cdcad70d0a77a56cb507330ff8409155de11255b5e61fb92ee439c1e117932c346df475f4187abb0e348ee4c28fa235a9693883b1c36913e91404662df272f4 WHIRLPOOL f6832979bc5b3ca1c61f150ab8795f744dc3d44fa404038dd5de97c4fd939e2e1fb4b40bcb27daf5cb81846a0841954dbfa5b8d6e37e341b834d9dce6382dcf1
+DIST gpm-1.20.7.tar.lzma 789691 SHA256 a955053b36556ffa7c628ce18fd6de7d625966573fa412fb08869533d8f7385c SHA512 a502741e2f457b47e41c6d155b1f7ef7c95384fd394503f82ddacf80cde9cdc286c906c77be12b6af8565ef1c3ab24d226379c1dcebcfcd15d64bcf3e94b63b9 WHIRLPOOL d3d142c3aa385e2ef4b16c96e0f94c04b3666376d893c516d439737c2f3016a12fff7884a8f18b5e6b58e4ba21d82379204b18621a2f338d8ab6d478e4e1ec1a
+EBUILD gpm-1.20.7-r2.ebuild 2334 SHA256 55860e4df9c10f3d5d7fedbc2a2d7a7c22b97a7f8b87b83fa2d9b6d3ecfdf273 SHA512 856e0fe8a14167141fd71e391c0cb44fdee8e40886b8b6ada2ad7422fdd94f337406e43fc22abb90e65aa66d272212751bc8b73fc7966304dc09b60205324489 WHIRLPOOL cfdb6bcecf93fb0c0dff271ca74d305e9aba92ca23cb5c27f2e903964e63a62bf64a34828ee7ea3fab6d4ff60bc811dfb27199187638c2e7384c017b7d3f5354
+MISC ChangeLog 5197 SHA256 13c7608b790f3f3d356546e61304af11e6817bc735a4cca035c02ee022d9f94f SHA512 8011cf2f14b71fa8024c87bf9db58c3bb669028db4d64e7943a9efff8e2b9c343d7f552db181b0f77d61be49847400b746dac91f7cc1ff04db06cc0f90fd65bb WHIRLPOOL ebd9feb8e0848643e2094efd304dee74a6bed6df07cf3d53273e8550590428c48ad54e89c2a10fa2ae5d20db37466fdd02836c2dee1f1ef6f90611cacc82750a
+MISC ChangeLog-2015 15057 SHA256 0ba96f380c129ad7160a6ef2ff5b2810b60a7b9cb22ae971d05bc92cf6a64c8e SHA512 efbf90f28be0470cc3eb14404410028f14f940d7381ff8971a115a1ea82455696b2e1f1bce39ca30fed8ed14c4a7aeb249ee631a6d1086461207d3805be07884 WHIRLPOOL 520fcca765b3cc1dee32eeaeb0fd82b4669c147178ed94847a10253b5d362786bd325d1c3cfdd0d9c4642a6b7108b38a14df0e50829fc3af31845312e5d92253
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-libs/gpm/files/gpm-1.20.7-glibc-2.26.patch b/sys-libs/gpm/files/gpm-1.20.7-glibc-2.26.patch
new file mode 100644
index 000000000000..ef2de01a6d63
--- /dev/null
+++ b/sys-libs/gpm/files/gpm-1.20.7-glibc-2.26.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/629774
+--- a/src/prog/gpm-root.y 2012-10-26 17:21:38.000000000 -0400
++++ b/src/prog/gpm-root.y 2017-09-07 20:39:51.933264063 -0400
+@@ -1197,7 +1197,7 @@
+ /* reap your zombies */
+ childaction.sa_handler=reap_children;
+ #if defined(__GLIBC__)
+- __sigemptyset(&childaction.sa_mask);
++ sigemptyset(&childaction.sa_mask);
+ #else /* __GLIBC__ */
+ childaction.sa_mask=0;
+ #endif /* __GLIBC__ */
diff --git a/sys-libs/gpm/files/gpm-1.20.7-sysmacros.patch b/sys-libs/gpm/files/gpm-1.20.7-sysmacros.patch
new file mode 100644
index 000000000000..d8ab2d191f7c
--- /dev/null
+++ b/sys-libs/gpm/files/gpm-1.20.7-sysmacros.patch
@@ -0,0 +1,30 @@
+From b350aee4ea5785a75cb6ad770f6b768c506ebb70 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 14 Mar 2016 15:39:54 -0400
+Subject: [PATCH] fix building w/newer glibc
+
+Linux C libraries are looking to disentangle sysmacros.h from the
+sys/types.h include, so make sure we pull in the header when it is
+found.
+---
+ src/daemon/open_console.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/daemon/open_console.c b/src/daemon/open_console.c
+index 4d6c0af..6dd43e6 100644
+--- a/src/daemon/open_console.c
++++ b/src/daemon/open_console.c
+@@ -24,6 +24,10 @@
+ #include <sys/types.h> /* major() */
+ #include <sys/ioctl.h> /* ioctl */
+
++#ifdef HAVE_SYS_SYSMACROS_H
++#include <sys/sysmacros.h> /* major() w/newer glibc */
++#endif
++
+ /* Linux specific (to be outsourced in gpm2 */
+ #include <linux/serial.h> /* for serial console check */
+ #include <asm/ioctls.h> /* for serial console check */
+--
+2.6.2
+
diff --git a/sys-libs/gpm/files/gpm.conf.d b/sys-libs/gpm/files/gpm.conf.d
new file mode 100644
index 000000000000..f21c25755b4a
--- /dev/null
+++ b/sys-libs/gpm/files/gpm.conf.d
@@ -0,0 +1,23 @@
+# /etc/init.d/gpm
+
+# Please uncomment the type of mouse you have and the appropriate MOUSEDEV entry
+
+MOUSE=ps2
+#MOUSE=imps2
+#MOUSEDEV=/dev/psaux
+MOUSEDEV=/dev/input/mice
+
+# Extra settings
+
+#RESPONSIVENESS=
+#REPEAT_TYPE=raw
+
+# Please uncomment this line if you want gpm to understand charsets used
+# in URLs and names with ~ or : in them, etc. This is a good idea to turn on!
+
+#APPEND="-l \"a-zA-Z0-9_.:~/\300-\326\330-\366\370-\377\""
+
+# Various other options, see gpm(8) manpage for more.
+
+#APPEND="-g 1 -A60"
+#APPEND="-l \"a-zA-Z0-9_.:~/\300-\326\330-\366\370-\377\" -g 1 -A60"
diff --git a/sys-libs/gpm/files/gpm.rc6-2 b/sys-libs/gpm/files/gpm.rc6-2
new file mode 100644
index 000000000000..abc1323acaa9
--- /dev/null
+++ b/sys-libs/gpm/files/gpm.rc6-2
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+#NB: Config is in /etc/conf.d/gpm
+
+command=/usr/sbin/gpm
+command_args="
+ -m ${MOUSEDEV}
+ -t ${MOUSE}
+ ${RESPONSIVENESS:+ -r ${RESPONSIVENESS}}
+ ${REPEAT_TYPE:+ -R${REPEAT_TYPE}}
+ ${APPEND}
+"
+
+pidfile=/var/run/gpm.pid
+
+depend() {
+ need localmount
+ use hotplug logger
+}
+
+start_pre() {
+ if [ -z "${MOUSEDEV}" ] || [ -z "${MOUSE}" ] ; then
+ eerror "You need to setup MOUSEDEV and MOUSE in /etc/conf.d/gpm first"
+ return 1
+ fi
+}
diff --git a/sys-libs/gpm/files/gpm.service b/sys-libs/gpm/files/gpm.service
new file mode 100644
index 000000000000..966ad80060fe
--- /dev/null
+++ b/sys-libs/gpm/files/gpm.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Console Mouse manager
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/gpm -m /dev/input/mice -t exps2
+StandardOutput=syslog
+Type=forking
+PIDFile=/var/run/gpm.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-libs/gpm/gpm-1.20.7-r2.ebuild b/sys-libs/gpm/gpm-1.20.7-r2.ebuild
new file mode 100644
index 000000000000..943ef06732c3
--- /dev/null
+++ b/sys-libs/gpm/gpm-1.20.7-r2.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# emacs support disabled due to #99533 #335900
+
+EAPI=5
+
+inherit eutils systemd toolchain-funcs autotools multilib-minimal
+
+DESCRIPTION="Console-based mouse driver"
+HOMEPAGE="http://www.nico.schottelius.org/software/gpm/"
+SRC_URI="http://www.nico.schottelius.org/software/${PN}/archives/${P}.tar.lzma
+ mirror://gentoo/${P}-docs.patch.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="selinux static-libs"
+
+RDEPEND=">=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}]
+ selinux? ( sec-policy/selinux-gpm )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r12
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND=">=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}]
+ app-arch/xz-utils
+ sys-apps/texinfo
+ virtual/yacc"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-sysmacros.patch
+
+ # Hack up the docs until we get this sorted upstream.
+ # https://github.com/telmich/gpm/issues/8
+ epatch "${WORKDIR}"/${P}-docs.patch
+ touch -r . doc/* || die
+
+ # bug #629774
+ epatch "${FILESDIR}"/${P}-glibc-2.26.patch
+
+ epatch_user
+
+ # fix ABI values
+ sed -i \
+ -e '/^abi_lev=/s:=.*:=1:' \
+ -e '/^abi_age=/s:=.*:=20:' \
+ configure.ac.footer || die
+ # Rebuild autotools since release doesn't include them.
+ # Should be fixed with the next release though.
+ # https://github.com/telmich/gpm/pull/15
+ sed -i -e '/ACLOCAL/,$d' autogen.sh || die
+ ./autogen.sh
+ eautoreconf
+
+ # Out-of-tree builds are broken.
+ # https://github.com/telmich/gpm/issues/16
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ econf \
+ --sysconfdir=/etc/gpm \
+ $(use_enable static-libs static) \
+ emacs=/bin/false
+}
+
+_emake() {
+ emake \
+ EMACS=: ELISP="" \
+ $(multilib_is_native_abi || echo "PROG= ") \
+ "$@"
+}
+
+multilib_src_compile() {
+ _emake
+}
+
+multilib_src_test() {
+ _emake check
+}
+
+multilib_src_install() {
+ _emake DESTDIR="${D}" install
+
+ dosym libgpm.so.1 /usr/$(get_libdir)/libgpm.so
+ gen_usr_ldscript -a gpm
+}
+
+multilib_src_install_all() {
+ insinto /etc/gpm
+ doins conf/gpm-*.conf
+
+ dodoc README TODO
+ dodoc doc/Announce doc/FAQ doc/README*
+
+ newinitd "${FILESDIR}"/gpm.rc6-2 gpm
+ newconfd "${FILESDIR}"/gpm.conf.d gpm
+ systemd_dounit "${FILESDIR}"/gpm.service
+}
diff --git a/sys-libs/gpm/metadata.xml b/sys-libs/gpm/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-libs/gpm/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/gwenhywfar/Manifest b/sys-libs/gwenhywfar/Manifest
new file mode 100644
index 000000000000..2d98b934173a
--- /dev/null
+++ b/sys-libs/gwenhywfar/Manifest
@@ -0,0 +1,12 @@
+DIST gwenhywfar-4.12.0beta.tar.gz 2442433 SHA256 bbc7d64baaa005173699e1d5bac3b427e26f4fd0702e2fff25450ee24a4b59d2 SHA512 102d41a2efa248fe5c65f8d85688728f081c4e97e6ca58b125430e5b4dbc8f5f5d025ea0b03015f6055b21811d4baf2cc9e5e96fc80d3ae4b768a777a06c7531 WHIRLPOOL 88196b13ed0ea478b6e7a288cb02467a2a12a77323ffe0d7f7e1ff7cba1927fe8e3ccb22fcb27287d3642d942ddc740234a2fd6626043b66652a69d7308f0c1c
+DIST gwenhywfar-4.13.1.tar.gz 2518248 SHA256 4beca892c1235548ea0ae30132a6d2e57911c22340746585395ccb01d84ec72b SHA512 6a7d58189c0a9250c5291ab6350ace3b33201f5565b713b2728a2253bec209295306cd13fbbcf6bd51c4e919fa5b8fdc812d3098d946606708cd819fccc0ea1a WHIRLPOOL b5c31dd60835d0e5295520553aff433d3781e7000c62a6d567770e5188afa03dd0526a9a2185dc27a9696f1c88f671d4fa249c98d765d8da77a6e036227de43c
+DIST gwenhywfar-4.15.3.tar.gz 2249350 SHA256 6a0e8787c99620414da6140e567c616b55856c5edf8825a9ebc67431923ee63a SHA512 a14d625518d94c94491df149f9e746ed8d769f4e43b6df24f51f4269f29005f7431e33e85de0bde0a81a2e876fea8ddad5ed4191114295d6c9ea2e94aba08799 WHIRLPOOL 668f742fd35c1277af9f297c4d7b5ac149e9453d90e5cf9d11248bfaed074b709d248f11043318ac05d32fbce478a2a474163537bc79289683adae5d37f05b07
+DIST gwenhywfar-4.3.3.tar.gz 2346826 SHA256 87ed0f8669e1c21eaa717a18a8cf516b771c00610f5e17148cd36bce0d7d8ec2 SHA512 cb8896991d012b3acfcb653ad5557f9f63e7239c76d0882b06382e6f3d1b0f05e705f85b6adef6d3c057ccf532c4836ab06dd0af2d5bc3d8283f13a1a12b3216 WHIRLPOOL 2b2af49609c7cad860956f3ec68c6678c5160e88e6de35ef5d42eaba7401be7e61f99ca69ad8e646bb870a1ef1f14c07799b67842792b3cce7f19106c4d41113
+EBUILD gwenhywfar-4.12.0_beta.ebuild 1424 SHA256 5714d0a989a3d8fa05fa5da362a15406328c45a0126491d2a604bc851d36d339 SHA512 5128d8256966f0a8eece6481ced8fa4700878e49ae584b600c084efae422666e77cead2d0b9f0daf30fcae5540969b1c5a2003b6b9d70d578becb7cb3105a3c2 WHIRLPOOL 04ceb4bec0a3a5c9b5e05029e1f13e81996309b1ce6e4b0dd46997286393dab5a28e3d976f50383aa0781577f0d903400d4c38f8c3b0f3a98975dd6cd87ec2dc
+EBUILD gwenhywfar-4.13.1.ebuild 1424 SHA256 849b4a930e9de163c955796bf0fe86c8023317192240aa9b9bb60354413d78e3 SHA512 10e9c924b7a75a1a453d30b9e5501d3502b6fb0c6a4d1cea80203e4febd4b16d6ba77ec7f9ecb34d808e53c054010e50e1d67963b9809072b15b2929c27b63af WHIRLPOOL 5baa0c58e4b8a2b07b48d98dffdbe50cb85c7a9e0e2f6671dec25b241aa66b2ebb576bb9a0aa56077f474e0ec47fa7fc0b108f62f75bc04c11800030661bd506
+EBUILD gwenhywfar-4.15.3-r1.ebuild 1629 SHA256 2aaa3320062c06076f15b472ead56e1fd0b017e6f4b3afde03ec47d441ceeec1 SHA512 bd0edd9354418dbeb9792f4371d0d862c2e7cfb5cddde2f682b342ccf08313681f0a4b7adccf7407a7d7e7c3e5faa45c334fa36bc546ea427fb454fb2f4aab5c WHIRLPOOL 3af8ac3e5c6b14c650b55c5d14ac1ca78a45d486d5244d692f124a22faf791946c881b3d50e0d7c938144bbe7bf19c7d4244786b1a1733551f61348d68fbbf20
+EBUILD gwenhywfar-4.15.3.ebuild 1422 SHA256 72d8e36c9c85f6b71b3cde7a1a7d051c24cc5ea4526a0cdaf045bd3329876971 SHA512 230baa16807362d4a0c48f9d9392c63e82abd2f44d6528f4431b96a0ba86dd2b073f65daf907232bd7e01b24ec85b1c189f611ca8af9ca6a657fc5256bf8d8af WHIRLPOOL 3eaf7f97846b6f64801dd6757e17bdff103d1abef9575f62b0f4d852ad27b4184a7703251611697de0a2cb75b674df10e09f90bb52377970043fcf08ddf1b490
+EBUILD gwenhywfar-4.3.3.ebuild 1368 SHA256 44b26ff19b8ab74ef4a31971f39c76a51c3acdce0e8782613a44399788ea8276 SHA512 aeafff69c32d2a2c18293f6c7def5e8b516c9274b5dff88224fd8e0bf7ac2e38a7c64859ffed22cd012944bed18072798222072a1c833ec8e6805ba8bdd8c448 WHIRLPOOL 644dff96f0e4e2521032c0d1dede8ad8ee176890410f1f24d5a9e8df47c0a261afb7873047e83a3b7250fcf5bfa271326e067a5c376e03eb3ab22a0028600ff9
+MISC ChangeLog 2951 SHA256 753ba6a576329adda77d07d718f2bdcd793b5466edb0a0ae96c3c037dae62052 SHA512 cdb09fe08e6db86fb9b9c71085e069cef820b8aca8935ec102b2e3bbb73925ac97497f276c6401fdf69c71831f32843ebb74d84ef8af7e60d5163fe49ee25672 WHIRLPOOL 731a54d7f87059866a08522c41f7d902d4b669eeb5a06c008ac8d9557f9196b3bdca6e6033554d6a9ebf0612ff4839c53b5f7fa6e34c67b5cf86acc91e549e0a
+MISC ChangeLog-2015 13213 SHA256 98df9b44c92d3a8ae5e5613d554ee04b5685529a7a7d6a994f52ea69ab97430a SHA512 1f0cc2edea939c6c160520b7ef06dba3de14b0acce60cf6967c9e1eb9aaea80ce150d969d1e50947491ff2376d9dbf80aacd70f30daa495e0f9aa6d9274b674f WHIRLPOOL 7fc95c8ab57001e7a57f1cb17bc0418253978a7107a2d79fc1541656a254af3eea42dae557fe92e00d80ffe20bcb8cf58dc736c5c9db432dd3feb58d83bd2df0
+MISC metadata.xml 311 SHA256 55ad5492e225b2a24848b7bbedd89f57464a47dabdf05da45c9b5b4b0439b825 SHA512 32a2ba2efc6a41f89871a9cd0a64cf894cabee5b863eefc17f4a5d1549b10472ee7359e19fc06a976f15a3f93dfc5b82bc248e0512c4d2f7b0f8d9ad18350fd9 WHIRLPOOL b8f77fd5ba9c1a082f91a0384a4f605c5c59af5dbdb51cf205cfe2694b04f97f0eac10609f4cd5fb66257386b5403bf31f6e9062b1660d45ab8805926e3c5b4a
diff --git a/sys-libs/gwenhywfar/gwenhywfar-4.12.0_beta.ebuild b/sys-libs/gwenhywfar/gwenhywfar-4.12.0_beta.ebuild
new file mode 100644
index 000000000000..466907c6983a
--- /dev/null
+++ b/sys-libs/gwenhywfar/gwenhywfar-4.12.0_beta.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/_beta/beta}"
+DESCRIPTION="A multi-platform helper library for other libraries"
+HOMEPAGE="http://www.aquamaniac.de/aqbanking/"
+SRC_URI="http://www.aquamaniac.de/sites/download/download.php?package=01&release=76&file=01&dummy=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug doc fox gtk qt4"
+
+RDEPEND="dev-libs/libgpg-error
+ >=dev-libs/libgcrypt-1.2.0:0
+ dev-libs/openssl:0
+ >=net-libs/gnutls-2.0.1
+ virtual/libiconv
+ virtual/libintl
+ fox? ( x11-libs/fox:1.6 )
+ gtk? ( >=x11-libs/gtk+-2.17.5:2 )
+ qt4? ( dev-qt/qtgui:4 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ doc? ( app-doc/doxygen )"
+
+# broken upstream, reported but got no reply
+RESTRICT="test"
+
+src_configure() {
+ local guis
+ use fox && guis="${guis} fox16"
+ use gtk && guis="${guis} gtk2"
+ use qt4 && guis="${guis} qt4"
+
+ econf \
+ --enable-ssl \
+ --enable-visibility \
+ $(use_enable debug) \
+ $(use_enable doc full-doc) \
+ --with-guis="${guis}" \
+ --with-docpath=/usr/share/doc/${PF}/apidoc
+}
+
+src_compile() {
+ emake
+ use doc && emake srcdoc
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use doc && emake DESTDIR="${D}" install-srcdoc
+ dodoc AUTHORS ChangeLog README TODO
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/sys-libs/gwenhywfar/gwenhywfar-4.13.1.ebuild b/sys-libs/gwenhywfar/gwenhywfar-4.13.1.ebuild
new file mode 100644
index 000000000000..6a21d9b8cb32
--- /dev/null
+++ b/sys-libs/gwenhywfar/gwenhywfar-4.13.1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/_beta/beta}"
+DESCRIPTION="A multi-platform helper library for other libraries"
+HOMEPAGE="http://www.aquamaniac.de/aqbanking/"
+SRC_URI="http://www.aquamaniac.de/sites/download/download.php?package=01&release=78&file=01&dummy=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug doc fox gtk qt4"
+
+RDEPEND="dev-libs/libgpg-error
+ >=dev-libs/libgcrypt-1.2.0:0
+ dev-libs/openssl:0
+ >=net-libs/gnutls-2.0.1
+ virtual/libiconv
+ virtual/libintl
+ fox? ( x11-libs/fox:1.6 )
+ gtk? ( >=x11-libs/gtk+-2.17.5:2 )
+ qt4? ( dev-qt/qtgui:4 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ doc? ( app-doc/doxygen )"
+
+# broken upstream, reported but got no reply
+RESTRICT="test"
+
+src_configure() {
+ local guis
+ use fox && guis="${guis} fox16"
+ use gtk && guis="${guis} gtk2"
+ use qt4 && guis="${guis} qt4"
+
+ econf \
+ --enable-ssl \
+ --enable-visibility \
+ $(use_enable debug) \
+ $(use_enable doc full-doc) \
+ --with-guis="${guis}" \
+ --with-docpath=/usr/share/doc/${PF}/apidoc
+}
+
+src_compile() {
+ emake
+ use doc && emake srcdoc
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use doc && emake DESTDIR="${D}" install-srcdoc
+ dodoc AUTHORS ChangeLog README TODO
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/sys-libs/gwenhywfar/gwenhywfar-4.15.3-r1.ebuild b/sys-libs/gwenhywfar/gwenhywfar-4.15.3-r1.ebuild
new file mode 100644
index 000000000000..9c3542e3c33f
--- /dev/null
+++ b/sys-libs/gwenhywfar/gwenhywfar-4.15.3-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit qmake-utils
+
+MY_P="${P/_beta/beta}"
+DESCRIPTION="A multi-platform helper library for other libraries"
+HOMEPAGE="http://www.aquamaniac.de/aqbanking/"
+SRC_URI="http://www.aquamaniac.de/sites/download/download.php?package=01&release=201&file=01&dummy=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug doc fox gtk qt4 qt5"
+
+RDEPEND="dev-libs/libgpg-error
+ dev-libs/libgcrypt:0=
+ dev-libs/openssl:0=
+ net-libs/gnutls:=
+ virtual/libiconv
+ virtual/libintl
+ fox? ( x11-libs/fox:1.6 )
+ gtk? ( x11-libs/gtk+:2 )
+ qt4? ( dev-qt/qtgui:4 )
+ qt5? ( dev-qt/qtgui:5 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ doc? ( app-doc/doxygen )"
+
+# broken upstream, reported but got no reply
+RESTRICT="test"
+
+src_configure() {
+ local guis
+ local extra_opts
+ use fox && guis="${guis} fox16"
+ use gtk && guis="${guis} gtk2"
+ use qt4 && guis="${guis} qt4" && extra_opts="${extra_opts} --with-qt4-moc="$(qt4_get_bindir)/moc""
+ use qt5 && guis="${guis} qt5" && extra_opts="${extra_opts} --with-qt5-qmake="$(qt5_get_bindir)/qmake" --with-qt5-moc="$(qt5_get_bindir)/moc""
+ econf \
+ --enable-ssl \
+ $(use_enable debug) \
+ $(use_enable doc full-doc) \
+ --with-guis="${guis}" \
+ ${extra_opts} \
+ --with-docpath="${EPREFIX}/usr/share/doc/${PF}/apidoc"
+}
+
+src_compile() {
+ emake
+ use doc && emake srcdoc
+}
+
+src_install() {
+ default
+ use doc && emake DESTDIR="${D}" install-srcdoc
+ find "${ED}" -name '*.la' -delete || die
+}
diff --git a/sys-libs/gwenhywfar/gwenhywfar-4.15.3.ebuild b/sys-libs/gwenhywfar/gwenhywfar-4.15.3.ebuild
new file mode 100644
index 000000000000..8dd748cddb84
--- /dev/null
+++ b/sys-libs/gwenhywfar/gwenhywfar-4.15.3.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/_beta/beta}"
+DESCRIPTION="A multi-platform helper library for other libraries"
+HOMEPAGE="http://www.aquamaniac.de/aqbanking/"
+SRC_URI="http://www.aquamaniac.de/sites/download/download.php?package=01&release=201&file=01&dummy=${MY_P}.tar.gz -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~hppa ppc ~ppc64 ~sparc x86"
+IUSE="debug doc fox gtk qt4"
+
+RDEPEND="dev-libs/libgpg-error
+ >=dev-libs/libgcrypt-1.2.0:0
+ dev-libs/openssl:0
+ >=net-libs/gnutls-2.0.1
+ virtual/libiconv
+ virtual/libintl
+ fox? ( x11-libs/fox:1.6 )
+ gtk? ( >=x11-libs/gtk+-2.17.5:2 )
+ qt4? ( dev-qt/qtgui:4 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ doc? ( app-doc/doxygen )"
+
+# broken upstream, reported but got no reply
+RESTRICT="test"
+
+src_configure() {
+ local guis
+ use fox && guis="${guis} fox16"
+ use gtk && guis="${guis} gtk2"
+ use qt4 && guis="${guis} qt4"
+
+ econf \
+ --enable-ssl \
+ --enable-visibility \
+ $(use_enable debug) \
+ $(use_enable doc full-doc) \
+ --with-guis="${guis}" \
+ --with-docpath=/usr/share/doc/${PF}/apidoc
+}
+
+src_compile() {
+ emake
+ use doc && emake srcdoc
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use doc && emake DESTDIR="${D}" install-srcdoc
+ dodoc AUTHORS ChangeLog README TODO
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/sys-libs/gwenhywfar/gwenhywfar-4.3.3.ebuild b/sys-libs/gwenhywfar/gwenhywfar-4.3.3.ebuild
new file mode 100644
index 000000000000..ce041b9eb8ef
--- /dev/null
+++ b/sys-libs/gwenhywfar/gwenhywfar-4.3.3.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+DESCRIPTION="A multi-platform helper library for other libraries"
+HOMEPAGE="http://www.aquamaniac.de/aqbanking/"
+SRC_URI="http://www.aquamaniac.de/sites/download/download.php?package=01&release=67&file=01&dummy=${P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 hppa ppc ~ppc64 ~sparc x86"
+IUSE="debug doc fox gtk qt4"
+
+RDEPEND="dev-libs/libgpg-error
+ >=dev-libs/libgcrypt-1.2.0:0
+ dev-libs/openssl:0
+ >=net-libs/gnutls-2.0.1
+ virtual/libiconv
+ virtual/libintl
+ fox? ( x11-libs/fox:1.6 )
+ gtk? ( >=x11-libs/gtk+-2.17.5:2 )
+ qt4? ( dev-qt/qtgui:4 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ doc? ( app-doc/doxygen )"
+
+# broken upstream, reported but got no reply
+RESTRICT="test"
+
+src_configure() {
+ local guis
+ use fox && guis="${guis} fox16"
+ use gtk && guis="${guis} gtk2"
+ use qt4 && guis="${guis} qt4"
+
+ econf \
+ --enable-ssl \
+ --enable-visibility \
+ $(use_enable debug) \
+ $(use_enable doc full-doc) \
+ --with-guis="${guis}" \
+ --with-docpath=/usr/share/doc/${PF}/apidoc
+}
+
+src_compile() {
+ emake
+ use doc && emake srcdoc
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use doc && emake DESTDIR="${D}" install-srcdoc
+ dodoc AUTHORS ChangeLog README TODO
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/sys-libs/gwenhywfar/metadata.xml b/sys-libs/gwenhywfar/metadata.xml
new file mode 100644
index 000000000000..4196ab24d5ad
--- /dev/null
+++ b/sys-libs/gwenhywfar/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 type="person">
+ <email>hanno@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="fox">Use <pkg>x11-libs/fox</pkg> graphical toolkit</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/kpmcore/Manifest b/sys-libs/kpmcore/Manifest
new file mode 100644
index 000000000000..719070dee2d4
--- /dev/null
+++ b/sys-libs/kpmcore/Manifest
@@ -0,0 +1,6 @@
+DIST kpmcore-3.1.2.tar.xz 403324 SHA256 52d4fa37b7939f1b584bdd1be4ed8bfa036f240ae05d6ec281cba717bb8ec6c1 SHA512 a11679f3de30f7c06ae567e6ce77d7737b0a98f2ea7e0955d08bcbd32b978915cdee992e003730cd56bcd504d311d4159e7e834e1db14a065c21f59a8609d003 WHIRLPOOL 58a13b396af1fda02430e730aac6b299a00aeb3165b0fdd6c319505f5d83a64324cad1bded3ced28df78a262c53d69f7fbaf028cfe038ef5b1940e90921f89ed
+DIST kpmcore-3.2.0.tar.xz 408256 SHA256 2b38c2bbc3d9a47cd4bfa2e8d2ad1bd7d791383dfe479506456b52a99ff899cb SHA512 664cb8617c302ee60e40d2cf57b712aa0503f080d1da0a5bc481c3628c2639037c091898e8ccc1528c4298c6ec643af44c0f484bd7ee60d8ad605a64ca1b4fed WHIRLPOOL 0cbc259c740ff377839ef75f1b884419018b9c03777a34a15ebb7b352695681bce649a835b64271c97335bdd34c2c6d371a6c3aa1b431bf219e646cfeba812e1
+EBUILD kpmcore-3.1.2.ebuild 797 SHA256 53736f0668eed81acaf9d582ff8d2144c1cb0d70896df7f781e8d3ad7548f83e SHA512 b00f8a82b8463bdf1d713d828db472e57510a114d5580fcafccb5b45b500ef860c9184309fa7f21f1c30b78ccaf4bb7b1ad837caa555989a5e4151041d1ca1f0 WHIRLPOOL c78cad0d70bedbd330218818cc08ab7968124c572beab982aaa9a9a628b750c6ecfe35ddd4607a1099a0a51be5cebd5c4b814e7e9c0209ed6301f125fa14a67b
+EBUILD kpmcore-3.2.0.ebuild 744 SHA256 46e0d9884017be4706ee338a8355e9bd9b6ea5017dfa699a5ae5f6799a6845c1 SHA512 abaa1227e1e543fe4ebbd06512f7befffc1a1ce6238ab4c052c74358f94c90d375f8ba50eb20f0b49698908e805a92d25fb6f6d8f57aa7a3c27cad924008c488 WHIRLPOOL e61ff47fde0794172e8c9e152f880febe1063022ab437c558c7ceca12f1293030a1802bd30d2241e73a4a8bf3e9806f30da561b3e238ecbb03e6210b58930f5d
+MISC ChangeLog 2757 SHA256 b963b5eb59fb7fe8a2a732d605c559adf42d69c13c13a45cbdec10d8d5d6d85c SHA512 4516c98074fe4719b61106f803a3ff8d620a553ea0e6fa1221f37606d42f33c0646f7db10dd056f84c11f1ad416fc75d83a33c5a3c015262d4864065df501ef8 WHIRLPOOL d4e38a375bc397e53c4149901ce8731a3da1046b41eea56beb6e87f1e80865b6e6b825031f94a1991d5a38e57cc1f2b4838a8f531cd8fb41ea7bc9b1266a93f3
+MISC metadata.xml 249 SHA256 584f1dcf51866dc24a9abf7a89bfba0fad11dde81ae1c1b715da41770d233c99 SHA512 76a5a340b13f0053ca3c5e94ed24380ea8d29b45ac8655419e22eaadb1e4a827c04d2e7e36b65145c4964e6526f656618fc6ac144e277ef53cb7373e6239e3c3 WHIRLPOOL 200c07a8bf7c55b11b7936d5cd30e991a511684913334e72f59def66c0ced5fed0b4a8754e2d98bffbab631cb90d4e17fcccc59d5dcc5a8e988f69e47c85518c
diff --git a/sys-libs/kpmcore/kpmcore-3.1.2.ebuild b/sys-libs/kpmcore/kpmcore-3.1.2.ebuild
new file mode 100644
index 000000000000..ee6ec9628692
--- /dev/null
+++ b/sys-libs/kpmcore/kpmcore-3.1.2.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit kde5
+
+if [[ ${KDE_BUILD_TYPE} = release ]]; then
+ SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
+ KEYWORDS="amd64 ~arm x86"
+fi
+
+DESCRIPTION="Library for managing partitions"
+HOMEPAGE="https://www.kde.org/applications/system/kdepartitionmanager"
+LICENSE="GPL-3"
+SLOT="5/5"
+IUSE=""
+
+RDEPEND="
+ $(add_frameworks_dep kcoreaddons)
+ $(add_frameworks_dep ki18n)
+ $(add_frameworks_dep kiconthemes)
+ $(add_frameworks_dep kio)
+ $(add_frameworks_dep kservice)
+ $(add_frameworks_dep kwidgetsaddons)
+ $(add_qt_dep qtdbus)
+ $(add_qt_dep qtgui)
+ $(add_qt_dep qtwidgets)
+ dev-libs/libatasmart
+ sys-apps/util-linux
+ >=sys-block/parted-3
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
diff --git a/sys-libs/kpmcore/kpmcore-3.2.0.ebuild b/sys-libs/kpmcore/kpmcore-3.2.0.ebuild
new file mode 100644
index 000000000000..9ee1d6becc5b
--- /dev/null
+++ b/sys-libs/kpmcore/kpmcore-3.2.0.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit kde5
+
+if [[ ${KDE_BUILD_TYPE} = release ]]; then
+ SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~x86"
+fi
+
+DESCRIPTION="Library for managing partitions"
+HOMEPAGE="https://www.kde.org/applications/system/kdepartitionmanager"
+LICENSE="GPL-3"
+SLOT="5/6"
+IUSE=""
+
+RDEPEND="
+ $(add_frameworks_dep kcoreaddons)
+ $(add_frameworks_dep ki18n)
+ $(add_frameworks_dep kservice)
+ $(add_frameworks_dep kwidgetsaddons)
+ $(add_qt_dep qtdbus)
+ $(add_qt_dep qtgui)
+ $(add_qt_dep qtwidgets)
+ dev-libs/libatasmart
+ >=sys-apps/util-linux-2.30
+ >=sys-block/parted-3
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
diff --git a/sys-libs/kpmcore/metadata.xml b/sys-libs/kpmcore/metadata.xml
new file mode 100644
index 000000000000..2fdbf33d963d
--- /dev/null
+++ b/sys-libs/kpmcore/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 type="project">
+ <email>kde@gentoo.org</email>
+ <name>Gentoo KDE Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/ldb/Manifest b/sys-libs/ldb/Manifest
new file mode 100644
index 000000000000..b9d2b0126ddd
--- /dev/null
+++ b/sys-libs/ldb/Manifest
@@ -0,0 +1,17 @@
+AUX ldb-1.1.24-optional-python.patch 2746 SHA256 5e97f0d4146411c4b28ef733257ebbc58d0fc8a6b85dea1001898fc1deba0a2c SHA512 caf287ceaa980cebf667d0dcb76f302ff5ab7e1a13f0dca94dfc0da5e96f9cc5d31a2f0facd1d82a74a19507f090e1138216ad7a6d847323c56344c13735ddcc WHIRLPOOL 0b36dd2524c3e29f609e3b3ae98c7faa14e5d60dadeae2d3a211af1418d0f74170ededb56284ec483e17ff038584f6cc717637ce377f7db607333b6cdc57acf3
+AUX ldb-1.1.27-optional_packages.patch 3596 SHA256 040a008ee2563d9a380da03f04594146d8d34991c74736d27cbec2ae6bf4366a SHA512 ddc567f926a82fd855ef1690ff14dd6995f3beec9cec3796377edf10d787f89bca7375c6990c29fc8a0dfd88a519f29bf331d8ecdc7a37a6f6e1de21780e4b4a WHIRLPOOL d96313a7e0b7a3b7087279ad5b3febcbaeb66c8bda46fdfca03afac2789fe60aa18b2ed57fc25417863c87f969939ed3772b9ed0bc08f1baaaa5dbda53147ab1
+AUX ldb-1.1.29-disable-python.patch 2294 SHA256 b7e4a4b2993e94a74b33b9d7a53c3590c242fbafb4fd13d7dcc0cfea7e4c587c SHA512 f13ebcae2b4c1a844cad65729b31926249887d82ad6d295857c5402a07fd88e76150adce5b34e1a4dc059e4ba29356d60f7f7a8e24b8ae622f2a3477914d7fe1 WHIRLPOOL d26f667a566348f928bf49351efd05b1b6d7019624f56439c921795d5e6a61c2930b5f88cf3abaa8e8b2722d6a7696d4db814a43d68b52af478def72d4743cb7
+AUX ldb-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch 701 SHA256 c6486f924cd3043f567d6fa5e9a17f61dd5a2864d7ad40bd50f28c35c45ab1a6 SHA512 35ba295d94ab5ce767f39c4cd5eb48d57a6e4993977013ee6ae0d640f74b5437a4dff6f1d14dc44dbcdc25d4e51e5084b0e3216353b2af383d8f544993228170 WHIRLPOOL 0f8d184e08d8e37bf9511280b30a658c4c848e0253d687bf9b922e0fbe43a1530dc720e8a69b84a2f98cbac876e03d8ef247b4dab4ab1127b3e57f819be93a73
+AUX ldb-1.1.31-optional_packages.patch 2022 SHA256 352830f35e5a12d258d8edd1bccc3564b871c5a3a13b063d5116a0ddd207498c SHA512 c9bc21fb306d4322874009e8eaded220f9ea1a3027781d2f6ae0f393f357349582cab8204e5a9343a88f61ab8d15f772bfb2e0d8bd42c0780b593ff9bdb9ad09 WHIRLPOOL 79006f4d15570de5150413d3f9093fe076313b8be41ddc8bf670cfdfaf0a118bb2511793468b32b56ed67caac03af95e092103e817e83296dbc7c78369365670
+AUX ldb-1.1.31-talloc-disable-python.patch 1706 SHA256 005dabcd79697577ea3ad0c5e65c0c0511492ba925c2af87b655acb91fbdcb2d SHA512 ac0bf82e8ed8b918a5efbdeb0a6cbaaef22bb72231abb09026637d62b8ce35b25212960d26c07abe63661328ab7ea8a82590cd93f04de583e23239211daf6efa WHIRLPOOL 9b18876c86af3d9211c87137ba628b0bb4f0b69cd961eb75b9ed1de461d9a157c75fc7605cba63f5024544d3bbb7270027894074a3d8cec03d99456153d1e9fb
+DIST ldb-1.1.26.tar.gz 1262660 SHA256 8843c7a72b980d9413ba6c494c039bccd10c524b37fda2917afb147745d8b2e6 SHA512 484689c5b87f223820e3613c056de5528a87736baef7b884df506fc47a3412b35ba2ef8e85f62e2d3da803fdab6b37bb328d4347a20bfc8fef8ed557646b6bbe WHIRLPOOL eb72c85faaf4aaf5fa647c084f9ceb8938e940390618b1dfc486b6bc8f344d1296314cb4f07770a04de3c6597798420347fdb90ede380db9e29a04a35c88bfcb
+DIST ldb-1.1.29.tar.gz 1277551 SHA256 59d84f9a5b799f519ba7b2685bb46f5a26f1bbf05b7a144b2f5e017d01d80f97 SHA512 d37bbe84358e05d17483e2e963b8477da5ea351b855b454142c94af35f7987bede0f19faeaff17779efe04e3bb37c510437fcc59be99a17c826620fc25fd659c WHIRLPOOL 57370e31249d7df8a23a7162eed9ed45d625f11edb1d57df8bd42c687bb80531e74ddf7399bd5411a1546460378903f27506a4cd56685e8fc533dfc2014086fd
+DIST ldb-1.1.31.tar.gz 1337586 SHA256 04d53e2ab5b35688f5ed7a4471f5b273da121016e1af0630b36a36506afaeb46 SHA512 49ccd57000cbcc6d828160f4457236b28853d766d641841471f61226156b6103fe563c43c950577b038ea3c0a54506bca94c640d3d5f912a3b8af95eb9ef2824 WHIRLPOOL 8c368317ed7efe218e66b8dac9722552a6d9346daed87788d78a07263491977402a442f950b437022bc6473b3d4452e3f47c23209abef78c1a47372e2455af99
+DIST ldb-1.2.2.tar.gz 1348041 SHA256 0cedeadb75de401c9735127f654dbc1a391c4327a2b83be54078be286fed1113 SHA512 7d9bd88c6a654967f092758146a8115ab6c66db69a8be269a1f536f0aa3b27fb0d2ea3848cd952ef0f1885c9c4d8b76940f9902b835fe3f79f86b22a4350129b WHIRLPOOL 35565cc8c6a5013fd5acb2538adc9c1e767444811858b32907e0546c709beed304abea51bd871fff695df0af5aa7cccb75dccc3f8cbc663ba49f4b8f69da83b7
+EBUILD ldb-1.1.26.ebuild 2351 SHA256 713e7d70b2a77935de3a46194000e586428a951c94519b4ca0276cc07bee64a4 SHA512 bc4ddc45b17ff2195ed56709a05d53f67bb10bb3cff45375b9622a0465c3447e4350138b1a83a2b39f364e063cba01821fce2f53f447406a3f68520be1a3c07b WHIRLPOOL da906fd490d25d8817742d04d8389e3ed09c4b976be907e7bb03bf0e3447a52cacf26668e3c9e0c69ca4a3dc7df8b19f5c044149c09bf234b53ec9e0dd0ad600
+EBUILD ldb-1.1.29-r1.ebuild 2555 SHA256 f3a09bb5cc6dcd85263f57e4393f4a97f0205fd3d44a63b1f53623d3596ac436 SHA512 47ea0de6eab1494f217a2e4efe0f2d19ebd24504c9dd70d5bf7427c46f4600591ec87a9e2e5afbd2a8a1c97cc269570124194839ba612905ed2eab76ab309b18 WHIRLPOOL 87a8055cf39bca90809e51ece1a66ab0447cc815826428cb59538c4516090ab9b07872a7ef7c49c523776f0b8554925b0c5324206158ddc1bfe653f8da7567dd
+EBUILD ldb-1.1.31.ebuild 2688 SHA256 22fa25402c5c5dcb6a8f302933124bf0fe306aa89465714e764cbd6f1a99444c SHA512 7dcc681909322c59e98cb69320f961250965820a02c74b90bed35a6de5e2337fabfcf89e3c1f78a02918d82492edf69ad39bf0e61edabffe0f96b6d903cfe28f WHIRLPOOL 0da71c1eb26cbb403f83cac29a7d511c323f633504fc6790c390ba0f24f4d2f6905e447428ab66451767470eed4f7f5b526926aa50465325c16e68237f3c09b4
+EBUILD ldb-1.2.2.ebuild 2568 SHA256 fce1b90b0b3ed2ada22cbe03ef5c6888bc2a02124cffdf4382af8a47995a6128 SHA512 8eee170a9b6381b148d70fc20c3922daab38d98ba6305a734992303b833750e0c56b9c7edf0505bdee76062e721cc2b1212f389d3300edd61d746be50f4da87e WHIRLPOOL f8b25734bea4196f0e5ebd409343e7e8f9cf72b0ea0ace8be6dd9ab2b159066a02dd8153eca1b380fa2bdf41798b39ed169b4a3de5f7d65324a6208c4e9fd70a
+MISC ChangeLog 10867 SHA256 a6abc3e37c299797a50e29798d2060011fb8eb81f254fb00aeb4829a9eaecea4 SHA512 a48482095be3b5705e6dec7e1ea2ff73f5d0444b1a03280c277965c93112504b0b9a2b15c962efb6b1f9efc04126e620dd436810f231422a50edab8b5f48820b WHIRLPOOL b50bf65f01c962e7be16ab762ab6ec699aef1de32c1ed067e02d5b900067cb0929086cf07eceb4ff39de96170e4c4f3ef76d9b9abaf1a53845d842b101016646
+MISC ChangeLog-2015 9552 SHA256 d14c0a59dece3d3616c98e97698d65b8a278ac954feb80df2b210b70adb7f92a SHA512 5f693bad8f9c18f41f101c44dba6b5ff2bb82f545c9a2c3a617924d220c1ff6a8cb5492712357f9e30ccd195eb7b42ac7860e4674af865640acedd486fbfc865 WHIRLPOOL 16d6b8d13aacf96262249fc6e895af6a10c1b3a8f42d1cefe0741a4d96fa1737579ab1618d45ea813123f6b093ca89d9ab5859c13e45471b953f7a0beff8ae44
+MISC metadata.xml 234 SHA256 53349d489ac79de20551dcbe0753476342d1940b2049db8d85ea21fa8b8434ff SHA512 31c30a4b01e860c3bcf28264630d9fb75feb1caa584c6877bc3e6b3d6a52aa2d986d0ffcf4214664dd887b51c5319d7163a7ed6734cfbc8f184b53bf92fd852d WHIRLPOOL d4c03d7461d890cfc5e7df149258fd19ec2e4f8649a19ca6a4f761ed4bac0648487f87c5ed3134abca5043786b10444f4d70da2d6b8b1a3f7d4884e36123eaa1
diff --git a/sys-libs/ldb/files/ldb-1.1.24-optional-python.patch b/sys-libs/ldb/files/ldb-1.1.24-optional-python.patch
new file mode 100644
index 000000000000..d8dda63d44b7
--- /dev/null
+++ b/sys-libs/ldb/files/ldb-1.1.24-optional-python.patch
@@ -0,0 +1,72 @@
+--- a/wscript 2015-12-10 06:01:40.000000000 -0500
++++ b/wscript 2016-01-06 15:05:57.013617848 -0500
+@@ -5,6 +5,7 @@
+
+ blddir = 'bin'
+
++import Logs
+ import sys, os
+
+ # find the buildtools directory
+@@ -13,7 +14,7 @@
+ srcdir = srcdir + '/..'
+ sys.path.insert(0, srcdir + '/buildtools/wafsamba')
+
+-import wafsamba, samba_dist, Utils
++import wafsamba, samba_dist, Utils, Options
+
+ samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
+ lib/tdb:lib/tdb lib/tdb:lib/tdb lib/tevent:lib/tevent
+@@ -28,8 +29,17 @@
+ opt.RECURSE('lib/tevent')
+ opt.RECURSE('lib/replace')
+ opt.tool_options('python') # options for disabling pyc or pyo compilation
++ if opt.IN_LAUNCH_DIR():
++ opt.add_option('--disable-python',
++ help=("disable the pyldb modules"),
++ action="store_true", dest='disable_python', default=False)
++
+
+ def configure(conf):
++ conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
++
++ conf.env.disable_python = getattr(Options.options, 'disable_python', False)
++
+ conf.RECURSE('lib/tdb')
+ conf.RECURSE('lib/tevent')
+
+@@ -44,16 +54,18 @@
+ conf.RECURSE('lib/replace')
+ conf.find_program('python', var='PYTHON')
+ conf.find_program('xsltproc', var='XSLTPROC')
+- conf.check_tool('python')
+- conf.check_python_version((2,4,2))
+- conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
++
++ if not conf.env.disable_python:
++ conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,4,2))
++ conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False)
++ if not conf.env.HAVE_PYTHON_H:
++ Logs.warn('Disabling pyldb-util as python devel libs not found')
++ conf.env.disable_python = True
+
+ # where does the default LIBDIR end up? in conf.env somewhere?
+ #
+ conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('MODULESDIR') + '/ldb')
+
+- conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
+-
+ if not conf.env.standalone_ldb:
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION,
+ onlyif='talloc tdb tevent',
+--- a/lib/talloc/wscript 2015-11-06 08:28:25.000000000 -0500
++++ b/lib/talloc/wscript 2016-01-06 15:07:43.673478788 -0500
+@@ -48,7 +48,7 @@
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_TALLOC', 1)
+- if conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
++ if not conf.env.disable_python and conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+ implied_deps='talloc replace'):
+ conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
+
diff --git a/sys-libs/ldb/files/ldb-1.1.27-optional_packages.patch b/sys-libs/ldb/files/ldb-1.1.27-optional_packages.patch
new file mode 100644
index 000000000000..92e14c651c86
--- /dev/null
+++ b/sys-libs/ldb/files/ldb-1.1.27-optional_packages.patch
@@ -0,0 +1,92 @@
+--- ldb-1.1.27/lib/talloc/wscript
++++ ldb-1.1.27/lib/talloc/wscript
+@@ -48,7 +48,7 @@
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('talloc', minversion=VERSION,
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_TALLOC', 1)
+- if conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
++ if not conf.env.disable_python and conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+ implied_deps='talloc replace'):
+ conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
+
+--- ldb-1.1.27/wscript
++++ ldb-1.1.27/wscript
+@@ -5,6 +5,7 @@
+
+ blddir = 'bin'
+
++import Logs
+ import sys, os
+
+ # find the buildtools directory
+@@ -13,7 +14,7 @@
+ srcdir = srcdir + '/..'
+ sys.path.insert(0, srcdir + '/buildtools/wafsamba')
+
+-import wafsamba, samba_dist, Utils
++import wafsamba, samba_dist, Utils, Options
+
+ samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
+ lib/tdb:lib/tdb lib/tdb:lib/tdb lib/tevent:lib/tevent
+@@ -28,8 +29,21 @@
+ opt.RECURSE('lib/tevent')
+ opt.RECURSE('lib/replace')
+ opt.tool_options('python') # options for disabling pyc or pyo compilation
++ if opt.IN_LAUNCH_DIR():
++ opt.add_option('--disable-python',
++ help=("disable the pyldb modules"),
++ action="store_true", dest='disable_python', default=False)
++ if opt.IN_LAUNCH_DIR():
++ opt.add_option('--disable-ldap',
++ help=("disable ldap support"),
++ action="store_true", dest='disable_ldap', default=False)
+
+ def configure(conf):
++ conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
++
++ conf.env.disable_python = getattr(Options.options, 'disable_python', False)
++ conf.env.disable_ldap = getattr(Options.options, 'disable_ldap', False)
++
+ conf.RECURSE('lib/tdb')
+ conf.RECURSE('lib/tevent')
+
+@@ -44,16 +58,18 @@
+ conf.RECURSE('lib/replace')
+ conf.find_program('python', var='PYTHON')
+ conf.find_program('xsltproc', var='XSLTPROC')
+- conf.check_tool('python')
+- conf.check_python_version((2,4,2))
+- conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
++
++ if not conf.env.disable_python:
++ conf.SAMBA_CHECK_PYTHON(mandatory=False, version=(2,4,2))
++ conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=False)
++ if not conf.env.HAVE_PYTHON_H:
++ Logs.warn('Disabling pyldb-util as python devel libs not found')
++ conf.env.disable_python = True
+
+ # where does the default LIBDIR end up? in conf.env somewhere?
+ #
+ conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('MODULESDIR') + '/ldb')
+
+- conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
+-
+ if not conf.env.standalone_ldb:
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION,
+ onlyif='talloc tdb tevent',
+@@ -67,9 +83,12 @@
+ if conf.env.standalone_ldb:
+ conf.CHECK_XSLTPROC_MANPAGES()
+
+- # we need this for the ldap backend
+- if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
+- conf.env.ENABLE_LDAP_BACKEND = True
++ if not conf.env.disable_ldap:
++ # we need this for the ldap backend
++ if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
++ conf.env.ENABLE_LDAP_BACKEND = True
++ else:
++ conf.env.ENABLE_LDAP_BACKEND = False
+
+ # we don't want any libraries or modules to rely on runtime
+ # resolution of symbols
diff --git a/sys-libs/ldb/files/ldb-1.1.29-disable-python.patch b/sys-libs/ldb/files/ldb-1.1.29-disable-python.patch
new file mode 100644
index 000000000000..bc4120e8acf6
--- /dev/null
+++ b/sys-libs/ldb/files/ldb-1.1.29-disable-python.patch
@@ -0,0 +1,48 @@
+--- a/lib/tdb/wscript 2016-11-30 09:56:00.000000000 -0500
++++ b/lib/tdb/wscript 2017-02-08 16:37:49.160987205 -0500
+@@ -77,16 +77,16 @@
+ conf.env.standalone_tdb = conf.IN_LAUNCH_DIR()
+ conf.env.building_tdb = True
+
++ conf.env.disable_python = getattr(Options.options, 'disable_python', False)
++
+ if not conf.env.standalone_tdb:
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('tdb', minversion=VERSION,
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_TDB', 1)
+ conf.env.building_tdb = False
+- if conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytdb', 'tdb', minversion=VERSION):
++ if not conf.env.disable_python and conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytdb', 'tdb', minversion=VERSION):
+ conf.define('USING_SYSTEM_PYTDB', 1)
+
+- conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+-
+ if (conf.CONFIG_SET('HAVE_ROBUST_MUTEXES') and
+ conf.env.building_tdb and
+ not conf.env.disable_tdb_mutex_locking):
+--- a/lib/tevent/wscript 2016-10-07 00:45:35.000000000 -0400
++++ b/lib/tevent/wscript 2017-02-08 16:39:22.478733175 -0500
+@@ -34,11 +34,13 @@
+
+ conf.env.standalone_tevent = conf.IN_LAUNCH_DIR()
+
++ conf.env.disable_python = getattr(Options.options, 'disable_python', False)
++
+ if not conf.env.standalone_tevent:
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('tevent', minversion=VERSION,
+ onlyif='talloc', implied_deps='replace talloc'):
+ conf.define('USING_SYSTEM_TEVENT', 1)
+- if conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytevent', 'tevent', minversion=VERSION):
++ if not conf.env.disable_python and conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytevent', 'tevent', minversion=VERSION):
+ conf.define('USING_SYSTEM_PYTEVENT', 1)
+
+ if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
+@@ -61,8 +63,6 @@
+ if not conf.CONFIG_SET('USING_SYSTEM_TEVENT'):
+ conf.DEFINE('TEVENT_NUM_SIGNALS', tevent_num_signals)
+
+- conf.env.disable_python = getattr(Options.options, 'disable_python', False)
+-
+ if not conf.env.disable_python:
+ # also disable if we don't have the python libs installed
+ conf.find_program('python', var='PYTHON')
diff --git a/sys-libs/ldb/files/ldb-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch b/sys-libs/ldb/files/ldb-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch
new file mode 100644
index 000000000000..c45b13feba99
--- /dev/null
+++ b/sys-libs/ldb/files/ldb-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch
@@ -0,0 +1,17 @@
+--- a/wscript 2017-07-05 15:35:52.178964698 -0400
++++ b/wscript 2017-07-05 15:49:20.137977649 -0400
+@@ -208,6 +208,14 @@
+ ldb_headers = ('include/ldb.h include/ldb_errors.h '
+ 'include/ldb_module.h include/ldb_handlers.h')
+
++ # we're not currently linking against the ldap libs, but ldb.pc.in
++ # has @LDAP_LIBS@
++ bld.env.LDAP_LIBS = ''
++
++ if not 'PACKAGE_VERSION' in bld.env:
++ bld.env.PACKAGE_VERSION = VERSION
++ bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
++
+ bld.SAMBA_LIBRARY('ldb',
+ COMMON_SRC + ' ' + LDB_MAP_SRC,
+ deps='tevent LIBLDB_MAIN replace',
diff --git a/sys-libs/ldb/files/ldb-1.1.31-optional_packages.patch b/sys-libs/ldb/files/ldb-1.1.31-optional_packages.patch
new file mode 100644
index 000000000000..1e9b51773570
--- /dev/null
+++ b/sys-libs/ldb/files/ldb-1.1.31-optional_packages.patch
@@ -0,0 +1,57 @@
+--- ldb-1.1.27/wscript
++++ ldb-1.1.27/wscript
+@@ -5,6 +5,7 @@
+
+ blddir = 'bin'
+
++import Logs
+ import sys, os
+
+ # find the buildtools directory
+@@ -13,7 +14,7 @@
+ srcdir = srcdir + '/..'
+ sys.path.insert(0, srcdir + '/buildtools/wafsamba')
+
+-import wafsamba, samba_dist, Utils
++import wafsamba, samba_dist, Utils, Options
+
+ samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
+ lib/tdb:lib/tdb lib/tdb:lib/tdb lib/tevent:lib/tevent
+@@ -28,8 +29,21 @@
+ opt.RECURSE('lib/tevent')
+ opt.RECURSE('lib/replace')
+ opt.tool_options('python') # options for disabling pyc or pyo compilation
++ if opt.IN_LAUNCH_DIR():
++ opt.add_option('--disable-python',
++ help=("disable the pyldb modules"),
++ action="store_true", dest='disable_python', default=False)
++ if opt.IN_LAUNCH_DIR():
++ opt.add_option('--disable-ldap',
++ help=("disable ldap support"),
++ action="store_true", dest='disable_ldap', default=False)
+
+ def configure(conf):
++ conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
++
++ conf.env.disable_python = getattr(Options.options, 'disable_python', False)
++ conf.env.disable_ldap = getattr(Options.options, 'disable_ldap', False)
++
+ conf.RECURSE('lib/tdb')
+ conf.RECURSE('lib/tevent')
+
+@@ -67,9 +81,12 @@
+ if conf.env.standalone_ldb:
+ conf.CHECK_XSLTPROC_MANPAGES()
+
+- # we need this for the ldap backend
+- if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
+- conf.env.ENABLE_LDAP_BACKEND = True
++ if not conf.env.disable_ldap:
++ # we need this for the ldap backend
++ if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
++ conf.env.ENABLE_LDAP_BACKEND = True
++ else:
++ conf.env.ENABLE_LDAP_BACKEND = False
+
+ # we don't want any libraries or modules to rely on runtime
+ # resolution of symbols
diff --git a/sys-libs/ldb/files/ldb-1.1.31-talloc-disable-python.patch b/sys-libs/ldb/files/ldb-1.1.31-talloc-disable-python.patch
new file mode 100644
index 000000000000..6ef45eb37fb8
--- /dev/null
+++ b/sys-libs/ldb/files/ldb-1.1.31-talloc-disable-python.patch
@@ -0,0 +1,34 @@
+--- a/lib/talloc/wscript 2017-04-28 04:57:26.000000000 -0400
++++ b/lib/talloc/wscript 2017-07-05 14:30:42.700580464 -0400
+@@ -74,19 +74,22 @@
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_TALLOC', 1)
+
+- using_system_pytalloc_util = True
+- if not conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+- implied_deps='talloc replace'):
++ if conf.env.disable_python:
+ using_system_pytalloc_util = False
+-
+- # We need to get a pytalloc-util for all the python versions
+- # we are building for
+- if conf.env['EXTRA_PYTHON']:
+- name = 'pytalloc-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
+- if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
++ else:
++ using_system_pytalloc_util = True
++ if not conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+ implied_deps='talloc replace'):
+ using_system_pytalloc_util = False
+
++ # We need to get a pytalloc-util for all the python versions
++ # we are building for
++ if conf.env['EXTRA_PYTHON']:
++ name = 'pytalloc-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
++ if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
++ implied_deps='talloc replace'):
++ using_system_pytalloc_util = False
++
+ if using_system_pytalloc_util:
+ conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
+
diff --git a/sys-libs/ldb/ldb-1.1.26.ebuild b/sys-libs/ldb/ldb-1.1.26.ebuild
new file mode 100644
index 000000000000..4c4921722c57
--- /dev/null
+++ b/sys-libs/ldb/ldb-1.1.26.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 waf-utils multilib-minimal eutils
+
+DESCRIPTION="An LDAP-like embedded database"
+HOMEPAGE="http://ldb.samba.org"
+SRC_URI="http://www.samba.org/ftp/pub/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="doc"
+
+RDEPEND="!elibc_FreeBSD? ( dev-libs/libbsd[${MULTILIB_USEDEP}] )
+ dev-libs/popt[${MULTILIB_USEDEP}]
+ >=sys-libs/talloc-2.1.5[python,${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.27[python(+),${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.3.8[python,${MULTILIB_USEDEP}]
+ net-nds/openldap
+ !!<net-fs/samba-3.6.0[ldb]
+ !!>=net-fs/samba-4.0.0[ldb]
+ ${PYTHON_DEPS}
+ "
+
+DEPEND="dev-libs/libxslt
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ ${RDEPEND}"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/pyldb.h )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.24-optional-python.patch
+)
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --disable-rpath \
+ --disable-rpath-install --bundled-libraries=NONE \
+ --with-modulesdir="${EPREFIX}"/usr/$(get_libdir)/samba \
+ --builtin-libraries=NONE
+ )
+ if ! multilib_is_native_abi; then
+ myconf+=( --disable-python )
+ fi
+ waf-utils_src_configure "${myconf[@]}"
+}
+
+multilib_src_compile(){
+ waf-utils_src_compile
+ multilib_is_native_abi && use doc && doxygen Doxyfile
+}
+
+multilib_src_test() {
+ if multilib_is_native_abi; then
+ WAF_MAKE=1 \
+ PATH=buildtools/bin:../../../buildtools/bin:$PATH:"${BUILD_DIR}"/bin/shared/private/ \
+ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${BUILD_DIR}"/bin/shared/private/:"${BUILD_DIR}"/bin/shared \
+ waf test || die
+ fi
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ if multilib_is_native_abi && use doc; then
+ doman apidocs/man/man3/*.3
+ docinto html
+ dodoc -r apidocs/html/*
+ fi
+}
+
+pkg_postinst() {
+ if has_version sys-auth/sssd; then
+ ewarn "You have sssd installed. It is known to break after ldb upgrades,"
+ ewarn "so please try to rebuild it before reporting bugs."
+ ewarn "See https://bugs.gentoo.org/404281"
+ fi
+}
diff --git a/sys-libs/ldb/ldb-1.1.29-r1.ebuild b/sys-libs/ldb/ldb-1.1.29-r1.ebuild
new file mode 100644
index 000000000000..3a65143b0958
--- /dev/null
+++ b/sys-libs/ldb/ldb-1.1.29-r1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 waf-utils multilib-minimal eutils
+
+DESCRIPTION="An LDAP-like embedded database"
+HOMEPAGE="http://ldb.samba.org"
+SRC_URI="http://www.samba.org/ftp/pub/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="doc +ldap +python"
+
+RDEPEND="!elibc_FreeBSD? ( dev-libs/libbsd[${MULTILIB_USEDEP}] )
+ dev-libs/popt[${MULTILIB_USEDEP}]
+ >=sys-libs/talloc-2.1.8[python?,${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.31[python(+)?,${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.3.12[python?,${MULTILIB_USEDEP}]
+ !!<net-fs/samba-3.6.0[ldb]
+ !!>=net-fs/samba-4.0.0[ldb]
+ python? ( ${PYTHON_DEPS} )
+ ldap? ( net-nds/openldap )
+ "
+
+DEPEND="dev-libs/libxslt
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ ${PYTHON_DEPS}
+ ${RDEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/pyldb.h )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.27-optional_packages.patch
+ "${FILESDIR}"/${P}-disable-python.patch
+)
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ $(usex ldap '' --disable-ldap) \
+ --disable-rpath \
+ --disable-rpath-install --bundled-libraries=NONE \
+ --with-modulesdir="${EPREFIX}"/usr/$(get_libdir)/samba \
+ --builtin-libraries=NONE
+ )
+ if ! multilib_is_native_abi; then
+ myconf+=( --disable-python )
+ else
+ myconf+=( $(usex python '' '--disable-python') )
+ fi
+ waf-utils_src_configure "${myconf[@]}"
+}
+
+multilib_src_compile(){
+ waf-utils_src_compile
+ multilib_is_native_abi && use doc && doxygen Doxyfile
+}
+
+multilib_src_test() {
+ if multilib_is_native_abi; then
+ WAF_MAKE=1 \
+ PATH=buildtools/bin:../../../buildtools/bin:$PATH:"${BUILD_DIR}"/bin/shared/private/ \
+ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${BUILD_DIR}"/bin/shared/private/:"${BUILD_DIR}"/bin/shared \
+ waf test || die
+ fi
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ if multilib_is_native_abi && use doc; then
+ doman apidocs/man/man3/*.3
+ docinto html
+ dodoc -r apidocs/html/*
+ fi
+}
+
+pkg_postinst() {
+ if has_version sys-auth/sssd; then
+ ewarn "You have sssd installed. It is known to break after ldb upgrades,"
+ ewarn "so please try to rebuild it before reporting bugs."
+ ewarn "See https://bugs.gentoo.org/404281"
+ fi
+}
diff --git a/sys-libs/ldb/ldb-1.1.31.ebuild b/sys-libs/ldb/ldb-1.1.31.ebuild
new file mode 100644
index 000000000000..7ce11c05b7b0
--- /dev/null
+++ b/sys-libs/ldb/ldb-1.1.31.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 waf-utils multilib-minimal eutils
+
+DESCRIPTION="An LDAP-like embedded database"
+HOMEPAGE="http://ldb.samba.org"
+SRC_URI="http://www.samba.org/ftp/pub/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="doc +ldap +python"
+
+RDEPEND="!elibc_FreeBSD? ( dev-libs/libbsd[${MULTILIB_USEDEP}] )
+ dev-libs/popt[${MULTILIB_USEDEP}]
+ >=dev-util/cmocka-1.1.1[${MULTILIB_USEDEP}]
+ >=sys-libs/talloc-2.1.9[python?,${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.31[python(+)?,${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.3.13[python?,${MULTILIB_USEDEP}]
+ !!<net-fs/samba-3.6.0[ldb]
+ !!>=net-fs/samba-4.0.0[ldb]
+ python? ( ${PYTHON_DEPS} )
+ ldap? ( net-nds/openldap )
+ "
+
+DEPEND="dev-libs/libxslt
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ ${PYTHON_DEPS}
+ ${RDEPEND}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/pyldb.h )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.31-optional_packages.patch
+ "${FILESDIR}"/${PN}-1.1.31-talloc-disable-python.patch
+ "${FILESDIR}"/${PN}-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch
+)
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ $(usex ldap '' --disable-ldap) \
+ --disable-rpath \
+ --disable-rpath-install --bundled-libraries=NONE \
+ --with-modulesdir="${EPREFIX}"/usr/$(get_libdir)/samba \
+ --builtin-libraries=NONE
+ )
+ if ! multilib_is_native_abi; then
+ myconf+=( --disable-python )
+ else
+ use python || myconf+=( --disable-python )
+ fi
+ waf-utils_src_configure "${myconf[@]}"
+}
+
+multilib_src_compile(){
+ waf-utils_src_compile
+ multilib_is_native_abi && use doc && doxygen Doxyfile
+}
+
+multilib_src_test() {
+ if multilib_is_native_abi; then
+ WAF_MAKE=1 \
+ PATH=buildtools/bin:../../../buildtools/bin:$PATH:"${BUILD_DIR}"/bin/shared/private/ \
+ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${BUILD_DIR}"/bin/shared/private/:"${BUILD_DIR}"/bin/shared \
+ waf test || die
+ fi
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ if multilib_is_native_abi && use doc; then
+ doman apidocs/man/man3/*.3
+ docinto html
+ dodoc -r apidocs/html/*
+ fi
+}
+
+pkg_postinst() {
+ if has_version sys-auth/sssd; then
+ ewarn "You have sssd installed. It is known to break after ldb upgrades,"
+ ewarn "so please try to rebuild it before reporting bugs."
+ ewarn "See https://bugs.gentoo.org/404281"
+ fi
+}
diff --git a/sys-libs/ldb/ldb-1.2.2.ebuild b/sys-libs/ldb/ldb-1.2.2.ebuild
new file mode 100644
index 000000000000..af7b0ac5cd34
--- /dev/null
+++ b/sys-libs/ldb/ldb-1.2.2.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit python-single-r1 waf-utils multilib-minimal eutils
+
+DESCRIPTION="An LDAP-like embedded database"
+HOMEPAGE="http://ldb.samba.org"
+SRC_URI="http://www.samba.org/ftp/pub/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0/${PV}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="doc +ldap +python"
+
+RDEPEND="!elibc_FreeBSD? ( dev-libs/libbsd[${MULTILIB_USEDEP}] )
+ dev-libs/popt[${MULTILIB_USEDEP}]
+ >=dev-util/cmocka-1.1.1[${MULTILIB_USEDEP}]
+ >=sys-libs/talloc-2.1.10[python?,${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.33[python(+)?,${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.3.15[python?,${MULTILIB_USEDEP}]
+ python? ( ${PYTHON_DEPS} )
+ ldap? ( net-nds/openldap )
+"
+
+DEPEND="dev-libs/libxslt
+ doc? ( app-doc/doxygen )
+ virtual/pkgconfig
+ ${PYTHON_DEPS}
+ ${RDEPEND}
+"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/pyldb.h )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.31-optional_packages.patch
+ "${FILESDIR}"/${PN}-1.1.31-fix_PKGCONFIGDIR-when-python-disabled.patch
+)
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ $(usex ldap '' --disable-ldap)
+ --disable-rpath
+ --disable-rpath-install --bundled-libraries=NONE
+ --with-modulesdir="${EPREFIX}"/usr/$(get_libdir)/samba
+ --builtin-libraries=NONE
+ )
+ if ! multilib_is_native_abi; then
+ myconf+=( --disable-python )
+ else
+ use python || myconf+=( --disable-python )
+ fi
+ waf-utils_src_configure "${myconf[@]}"
+}
+
+multilib_src_compile(){
+ waf-utils_src_compile
+ multilib_is_native_abi && use doc && doxygen Doxyfile
+}
+
+multilib_src_test() {
+ if multilib_is_native_abi; then
+ WAF_MAKE=1 \
+ PATH=buildtools/bin:../../../buildtools/bin:$PATH:"${BUILD_DIR}"/bin/shared/private/ \
+ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${BUILD_DIR}"/bin/shared/private/:"${BUILD_DIR}"/bin/shared \
+ waf test || die
+ fi
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ if multilib_is_native_abi && use doc; then
+ doman apidocs/man/man3/*.3
+ docinto html
+ dodoc -r apidocs/html/*
+ fi
+}
+
+pkg_postinst() {
+ if has_version sys-auth/sssd; then
+ ewarn "You have sssd installed. It is known to break after ldb upgrades,"
+ ewarn "so please try to rebuild it before reporting bugs."
+ ewarn "See https://bugs.gentoo.org/404281"
+ fi
+}
diff --git a/sys-libs/ldb/metadata.xml b/sys-libs/ldb/metadata.xml
new file mode 100644
index 000000000000..62c9222b8dd3
--- /dev/null
+++ b/sys-libs/ldb/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 type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/lib-compat-loki/Manifest b/sys-libs/lib-compat-loki/Manifest
new file mode 100644
index 000000000000..534ff8f23c1b
--- /dev/null
+++ b/sys-libs/lib-compat-loki/Manifest
@@ -0,0 +1,5 @@
+DIST lib-compat-loki-0.2.tar.bz2 1441552 SHA256 112b916c21f1a47d257aff721cda10a79e40efe4b75f71d696b70a0036f12234 SHA512 7a090d9bfb3cb3a184d64030f9c85070034365e83c9e11b315df98995d15933d13542069f15b7bd1dd1c4f1cfab3466c1b354bdc073172573846347ecc8c8527 WHIRLPOOL e92a57bed5a77af44fde2d310fab24feb872af6483a0b3da1ce2e914c2cc107428adfb15d86afcb44a50c7a8858093c65186f51e2c741f7bb7666b6ccd9f107a
+EBUILD lib-compat-loki-0.2-r1.ebuild 945 SHA256 156b3d2e179a433afa1f1b4d02338d612397c1ca79d6c31da542691c2d963d73 SHA512 f4520b4d12a8ac763082227e54ba56d7788ad7bfc147569c8affe3318d757c2217a7365d3a361bb9513ee56e80b9d1ffba83674a22c6d44b052a71c3c9d632bd WHIRLPOOL 5eb6c005a60ad4427df61d61d8469b306b30fc51b05c9e7bf725e991c47dae12a7ea5196a035923af73ca67c90b4ed8ae17dd4e2f7dd481a96f57f1329410cc4
+MISC ChangeLog 2486 SHA256 7b4eb8c086a8cd95c52d081a4c57fdf04b58b4592620b01377ca28f3f6851896 SHA512 07cd0bef353d47effad134180a4a0ada0685462d3089139ace24e288dda7695ff84c0db34d5e210ff5dbd12197d59cf3f78dd999a02c6ab4c0a72c87fa449842 WHIRLPOOL 02904b935b275ecf52bf6a17d22b950cd5dda68e5c0843a5ffba5ff1c24f10b4260d1921040dc5ee44af6939e7187c18a6d8910465d9c2c24cd739f3c8b5c601
+MISC ChangeLog-2015 1987 SHA256 efe8f65c571a0dceca6797f7f73dc0f1eef5e26aba6591dbee5ced369df832b0 SHA512 1c5e81b9325d0b8ea17446b8dffc1d5cea73ce3b22452d99fe5e57cc339e96d64c3c10da27537d2abb1169fd6c6016626f18a4e1c82fd125320ac8462b718023 WHIRLPOOL 770a18f60e51e88103d5a5da44d8554eabacbe7889e4838fa14b464396252ddf2571e6985700e7cce1d5a84c7e1bf738736ad4b7c522efc7920a9ff90c0def3d
+MISC metadata.xml 249 SHA256 943b9ce0cd072229b43569ab668dd7ec741d9dfefd942c8921dabd4490b27b0c SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118 WHIRLPOOL b10e21575c78e201a652c8582cd16e3f7c86b13dd20a30f4cea44066fb139440b3c186147dbaae83478f11a20b6f457a99c8b29ee1239a4caaa21eee01250088
diff --git a/sys-libs/lib-compat-loki/lib-compat-loki-0.2-r1.ebuild b/sys-libs/lib-compat-loki/lib-compat-loki-0.2-r1.ebuild
new file mode 100644
index 000000000000..1681e9fe2b1e
--- /dev/null
+++ b/sys-libs/lib-compat-loki/lib-compat-loki-0.2-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="Compatibility libc6 libraries for Loki games"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI="http://www.blfh.de/gentoo/distfiles/${P}.tar.bz2
+ https://dev.gentoo.org/~wolf31o2/sources/lib-compat-loki/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="sys-libs/lib-compat
+ >=media-libs/libsdl-1.2.15-r4[abi_x86_32(-)]"
+
+# I'm not quite sure if this is necessary:
+RESTRICT="strip"
+
+S=${WORKDIR}/${P}/x86
+
+src_prepare() {
+ # rename the libs in order to _never_ overwrite any existing lib.
+ mv libc-2.2.5.so loki_libc.so.6 || die
+ mv ld-2.2.5.so loki_ld-linux.so.2 || die
+ mv libnss_files-2.2.5.so loki_libnss_files.so.2 || die
+ mv libsmpeg-0.4.so.0 loki_libsmpeg-0.4.so.0 || die
+}
+
+src_install() {
+ ABI=x86
+
+ into /
+ dolib.so loki_ld-linux.so.2
+ rm -f loki_ld-linux.so.2
+ into /usr
+ dolib.so *.so*
+}
diff --git a/sys-libs/lib-compat-loki/metadata.xml b/sys-libs/lib-compat-loki/metadata.xml
new file mode 100644
index 000000000000..78274e0fa550
--- /dev/null
+++ b/sys-libs/lib-compat-loki/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 type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/lib-compat/Manifest b/sys-libs/lib-compat/Manifest
new file mode 100644
index 000000000000..797a6b3a9ca8
--- /dev/null
+++ b/sys-libs/lib-compat/Manifest
@@ -0,0 +1,7 @@
+DIST lib-compat-1.4.2.tar.bz2 3002557 SHA256 89861c0ba899e8f9c81561422007d0c6961fce60eb5d2967fff2618230ed562c SHA512 aa801434db2749f5f6f42fb12aaa4e518474e8a2b75e7d2e93733d99ebdbc52615c879f575b708dafa15bd1e8bd8362697a6d1f5a38691dd4664cd6fbb51ae14 WHIRLPOOL b1cee9cd0c19d06c1f08fc0b7fda18fef51501f27bc11dc0b345797a90a10a32a3f6e377c89bcd380126f12c59835e53035b802dc24242ee75b26128ef4b9dd9
+DIST lib-compat-1.5.tar.bz2 110305 SHA256 e926c320e47ef7bccf17ba5c45a7de5b2aa6dc1f98e18c44248088014719d668 SHA512 b23b12ab6ecf8c3840ccaebd9c7823651c687fbfaa845b071fa2c2970e616345650f2688cbfca35097686c6b914ab637d166461adb2122f5f7d37c7870a68472 WHIRLPOOL 290180a0ca732de1071f41909c686b41ddb6efff6447e221d343ad59e97ca7121dd45b35df33ba4a22803934f75d7b30669fea57ed9cb76a297e5e0ad3cf1f8c
+EBUILD lib-compat-1.4.2-r1.ebuild 622 SHA256 1133e0b28b12ffff92220bc8b8bdb325b1f8d17babdcbc03c3e70312e1d4e8a4 SHA512 6fee5d06c5c1d6f1d76d086939f8afc481b5a69222e1fe5b53f12d5c425de6465c7420091eee5e89bc358f2dcff5f21e6a4d90f3381af1e372a7a30d8829713c WHIRLPOOL 01284f159deef80d6224224d5cfe5d4bb31198171d26bcfbd712cf503feb5ddb726185b21253df7577c2358cee5dfb9ce32f7e43056b5fecac26e6b66653ff77
+EBUILD lib-compat-1.5.ebuild 425 SHA256 1b375c556ae96d812bb22abe1c49c3bfc72cf42b38b4a441c5b640fead456d2f SHA512 8a8fbe8135c82474ee2842de2d4c830b2e2476630000731785740d60c00991b4ae1890bcd310037d93aba30ee1d7ad5e45f8abdfc472ab2503fa1b057c2e4619 WHIRLPOOL 547675f5155e3cced3fc794d02b8a458711e457f16b2969ea021129dc00779085f793c05470ea51acc78d16cc5cf3346d0a4c477db7ab5069b6bb89544f8fcfc
+MISC ChangeLog 2971 SHA256 ad2ae81885e5e6367990a33423300f7b7a2861a77efc398319e68ea78cb8ce0f SHA512 9b9744a05fd7bb47f5a5d0d4cc91a90f55088a5e881414a2caab23723aeb64f2e2826772c5fbbec520b5332a68fcfc4819dd412e6799d4da66f8494084aecf4f WHIRLPOOL 01169e82a4c6cd8b4cee0c5c518a6188df7fb8a0e9e1836f03bd46eb92e1b86002c8bdf6e0f47112580284b64c59740682620d4b5d66b386456dd2e6813a3511
+MISC ChangeLog-2015 5600 SHA256 2ca8aa65d5c2ecec885f5e9d4e6d187a08dd92bfe5ad22e5e48c2a073d2a89a3 SHA512 f771f662916befd82dab4b0d28558b6e014d62e50d37e507c905388b39a02cc32803333704f4aace905ecf7b31c45f720732c994610702f3c55e9747f84e9582 WHIRLPOOL 2ca483514a875d9da5efd3a8d071f870c3719eac6f88ea5ff98d2ce97f7fce37deaf397fb8b0954798f94887ba06bca7fb420bfc5e2c4d255c99e5521737874e
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-libs/lib-compat/lib-compat-1.4.2-r1.ebuild b/sys-libs/lib-compat/lib-compat-1.4.2-r1.ebuild
new file mode 100644
index 000000000000..c15d3231e82e
--- /dev/null
+++ b/sys-libs/lib-compat/lib-compat-1.4.2-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="Compatibility C++ and libc5 and libc6 libraries for very old programs"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="!<=app-emulation/emul-linux-x86-compat-20140508"
+
+src_install() {
+ if use amd64 || use x86; then
+ cd x86 || die
+ ABI=x86
+ into /
+ dolib.so ld-linux.so.1*
+ rm -f ld-linux.so.1*
+ #elif use alpha; then
+ # cd alpha || die
+ else
+ die "arch not supported"
+ fi
+ into /usr
+ dolib.so *.so*
+}
diff --git a/sys-libs/lib-compat/lib-compat-1.5.ebuild b/sys-libs/lib-compat/lib-compat-1.5.ebuild
new file mode 100644
index 000000000000..064a9db028cb
--- /dev/null
+++ b/sys-libs/lib-compat/lib-compat-1.5.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Compatibility C++ library for very old programs"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="libstdc++" # corresponding source code in gcc-2.95.3.tar.bz2
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+
+src_install() {
+ ABI=x86 dolib.so x86/libstdc++-libc6.2-2.so.3
+}
diff --git a/sys-libs/lib-compat/metadata.xml b/sys-libs/lib-compat/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-libs/lib-compat/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libaal/Manifest b/sys-libs/libaal/Manifest
new file mode 100644
index 000000000000..c3e4eb8f6d3d
--- /dev/null
+++ b/sys-libs/libaal/Manifest
@@ -0,0 +1,8 @@
+DIST libaal-1.0.5.tar.gz 336052 SHA256 ff1adb7aa7b917010d827f2e451fad8cb65ce981877d762b48baf20e89212e81 SHA512 1e4076ce4228a7947074ce2764da63f48cbeb4086cf6ab75b882ecd4ff07d4de3a6f5411c5c0b9cdd1c279b3bb98f92f5da3892e5479b7112b67703fddc102be WHIRLPOOL 805ffefdf22b6df05e57d0f836940c4f5748dba8fa5d6933bf07f410ae85f3914353d0697eb33dbc7a927e6d367bd9ab1e85caa1c1be94f710d0395f52854432
+DIST libaal-1.0.6.tar.gz 345894 SHA256 b1a1547746438b156156f82332557b05442e6d6c39fa9fe0d8dd47a3ad16ce9c SHA512 9b13096abcb90e75fff607ffd7b11ed8b100f349800b726acb01aca12f54abe784adb9912916fe8ed0751ebf367ecced04ab058e1e8b947f4209a5e6c390f123 WHIRLPOOL 7d93c3dc6eb62712a460f37bc933588c0b71d17472c64104a5cba939324af801ca0ba37063cd020caf8aa0d352a21b5222f838b427fbba0c03144b89d64e98c6
+EBUILD libaal-1.0.5-r1.ebuild 768 SHA256 43bb498653c0249df660d672d17e454e7e6d64a776903c7eb52524f78a2c1d65 SHA512 2f98016332c69a1f493d40bd5898dce9b934f18fa948e0a55333f46f9e1bf49fb857157574fa8f5e56931ba63ff22e7183ed789a687b96c01f937710fe603db2 WHIRLPOOL 017e413168d1721e82dea942e38a69065950efd305c56ae7fdbeabb4abfc103739028518b801b2f6ed6d85b9c73a0d140f4757cf951663ded95b1e037ff6a061
+EBUILD libaal-1.0.5.ebuild 1053 SHA256 313fd61c6860828a0e4df85614923b6b212656b3ae5111f4d5891b8b9d73fb2b SHA512 794c0a5e5d49f0abec65981e8a5b494cc1344ea370c5bc6f27a9d0f4b6964add4120751c7820575f9147a862f02169838d4b09770ff2344cd497f127b24c4cbb WHIRLPOOL 6f5b86aca02aa824b1f7c45921133bbad12d4acd083367fecb6a6d541a98bf8db9ce00061e84e623f2774b5adf8635a26694e0a820437f872a6ebe0a45a707f2
+EBUILD libaal-1.0.6.ebuild 792 SHA256 b46b0e1ee5a6df8b125069ef68126b19e698bcd20ca210066ac154fa35402d48 SHA512 66013e3b2c5c0d13027dac0ffa0a02a6c59d10ee65531b95ee9627875bce0e5c3764244e88f8275f49e0d38843d5b40f265123e658ef8e33da8a3591b129e780 WHIRLPOOL 1b0b986a5d9b1943036c2da13fa80cf80b1bd1ff400c724b8db8fbf50498f9623bf9081db0b58328eeb1195a0f002b43b839206f88b6714ce6a01a23a0ca4735
+MISC ChangeLog 3190 SHA256 7380de15ecf7f3196fe9355f7bbe1e99b25c23ab60db56e7c247d727a70bf6c3 SHA512 3bf9c5243883310eef02144ab4c64c0469ddb0ff0002b7ac43ba3cc72ab27d68884e2af7f0cfc3741196a03612b4264a8877a06f4bbe2eaa703e64a21ac62860 WHIRLPOOL 185ec5914e0857153c2fc5d8e202af9b25ae8398f5cd6a881608daefae718ed3aa003579f7cb3ce2211c6adea248b81b898803f68deb85b3b1d7371cc5657bb3
+MISC ChangeLog-2015 3544 SHA256 680d01d3f61e50a9e6d5ef5fd99819afd51e1db02ae48c46e1a83b0298937680 SHA512 5206ee6514f885e597f29319b1c8f4cfe02c67ef2aced7b6e93587ad078e1eeada39c76943ce98dee0a5fd0b6386cddffd93d69be6bef9bd47397c7946481b21 WHIRLPOOL 7c6655c2a8f36cc46db0df0d2b628e69c37eabfb8d0b61deed8b4173831e7cc363ff30b05b5ba0fca263532967e124849812eb00115cec6404c93433767cbea0
+MISC metadata.xml 493 SHA256 8305d8b53fb2befa5ac6c2836e99f8ac1cf38609253896e036e9766a33910e12 SHA512 ec9eee8ae224303648bd688c0309cc8809cb2dd0d80aa1fe77d7a039a0258aa4288745e9cd191ac2c70de64160cb62c47f43983ef852f171044ad39f5a5120df WHIRLPOOL 1c48a3788fc7ae871c8aeaf057eedffae7d5e3d15d7ad9c3d1aa686e8cf0495a0ba2679553feb3642cec6497587e69345c8f5b8ccf57b2ea1e336494da5d7e91
diff --git a/sys-libs/libaal/libaal-1.0.5-r1.ebuild b/sys-libs/libaal/libaal-1.0.5-r1.ebuild
new file mode 100644
index 000000000000..ae2314925de7
--- /dev/null
+++ b/sys-libs/libaal/libaal-1.0.5-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="library required by reiser4progs"
+HOMEPAGE="https://sourceforge.net/projects/reiser4/"
+SRC_URI="mirror://sourceforge/reiser4/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 -sparc ~x86"
+IUSE="static-libs"
+
+src_prepare() {
+ # remove stupid CFLAG hardcodes
+ sed -i \
+ -e "/GENERIC_CFLAGS/s:-O3::" \
+ -e "/^CFLAGS=/s:\"\":\"${CFLAGS}\":" \
+ configure || die "sed"
+ printf '#!/bin/sh\n:\n' > run-ldconfig
+}
+
+src_configure() {
+ econf \
+ --enable-libminimal \
+ --enable-memory-manager \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ gen_usr_ldscript -a aal{,-minimal}
+}
diff --git a/sys-libs/libaal/libaal-1.0.5.ebuild b/sys-libs/libaal/libaal-1.0.5.ebuild
new file mode 100644
index 000000000000..23f7867dfa69
--- /dev/null
+++ b/sys-libs/libaal/libaal-1.0.5.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit toolchain-funcs
+
+DESCRIPTION="library required by reiser4progs"
+HOMEPAGE="https://www.kernel.org/pub/linux/utils/fs/reiser4/libaal/"
+SRC_URI="mirror://kernel/linux/utils/fs/reiser4/libaal/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 -sparc x86"
+IUSE=""
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ # remove stupid CFLAG hardcodes
+ sed -i \
+ -e "/GENERIC_CFLAGS/s:-O3::" \
+ -e "/^CFLAGS=/s:\"\":\"${CFLAGS}\":" \
+ configure || die "sed"
+ cat <<-EOF > run-ldconfig
+ #!/bin/sh
+ true
+ EOF
+}
+
+src_compile() {
+ econf \
+ --enable-libminimal \
+ --enable-memory-manager \
+ || die "configure failed"
+ emake || die "make failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ dodoc AUTHORS BUGS CREDITS ChangeLog NEWS README THANKS TODO
+
+ # move shared libs to /
+ dodir /$(get_libdir)
+ mv "${D}"/usr/$(get_libdir)/lib*.so* "${D}"/$(get_libdir)/ || die
+ gen_usr_ldscript libaal.so libaal-minimal.so
+}
diff --git a/sys-libs/libaal/libaal-1.0.6.ebuild b/sys-libs/libaal/libaal-1.0.6.ebuild
new file mode 100644
index 000000000000..91f3ab182e1e
--- /dev/null
+++ b/sys-libs/libaal/libaal-1.0.6.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="library required by reiser4progs"
+HOMEPAGE="https://sourceforge.net/projects/reiser4/"
+SRC_URI="mirror://sourceforge/reiser4/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 -sparc x86"
+IUSE="static-libs"
+
+DEPEND="virtual/os-headers"
+
+src_prepare() {
+ # remove stupid CFLAG hardcodes
+ sed -i \
+ -e "/GENERIC_CFLAGS/s:-O3::" \
+ -e "/^CFLAGS=/s:\"\":\"${CFLAGS}\":" \
+ configure || die "sed"
+ printf '#!/bin/sh\n:\n' > run-ldconfig
+}
+
+src_configure() {
+ econf \
+ --enable-libminimal \
+ --enable-memory-manager \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ gen_usr_ldscript -a aal{,-minimal}
+}
diff --git a/sys-libs/libaal/metadata.xml b/sys-libs/libaal/metadata.xml
new file mode 100644
index 000000000000..000768728e14
--- /dev/null
+++ b/sys-libs/libaal/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<longdescription>
+This is a library, that provides application abstraction mechanism.
+It includes device abstraction, libc independence code, etc.
+</longdescription>
+<upstream>
+ <remote-id type="sourceforge">reiser4</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/libapparmor/Manifest b/sys-libs/libapparmor/Manifest
new file mode 100644
index 000000000000..69464ad9c4f5
--- /dev/null
+++ b/sys-libs/libapparmor/Manifest
@@ -0,0 +1,6 @@
+AUX libapparmor-2.10-symbol_visibility.patch 215 SHA256 f6f22234a4dbcd6dc96683dee1d0859a4170773515f2418ae3907ed28a061935 SHA512 3c0935fb5d229f0442904bee11a2469b8f73c01ea3e93245170fdb532fc136186416c24a6c3f36ecadc4266b5a611dc6204a11c30e133cf49e2186a7b4d620cd WHIRLPOOL a49442dc1a63f1af607c7f5a4faae14eed953f088893e12e059249a1b80ac638a4a18b665f8130818b63d8d38986d5294f36ee2cc50a9f639b4ca1b1a72313f0
+DIST apparmor-2.11.0.tar.gz 5013297 SHA256 b1c489ea11e7771b8e6b181532cafbf9ebe6603e3cb00e2558f21b7a5bdd739a SHA512 86b33c1cbbd256028dd5fdfaddc764c225845acd19c833223fce5cdd6164f997fe010d7b642791f834a3417b4ea847d77175fdfd89ea99ab2111933790d42b55 WHIRLPOOL 2a3ca9a943694fba0f225cffc2bac3782545c0970b490189585a87cccf18047128eaab754e53003e03d535a5851a3198b0738a89c6547e88d081f6ad31f066d5
+EBUILD libapparmor-2.11.0-r1.ebuild 2164 SHA256 329ee993e8b7926119f8b6fb104e4ee2a580bdb4d318feaf0a0a93a62bd63823 SHA512 aadf9e0a2b8046c574bfc94dbd2cd8551ecf98cf95d28ece0576ed97c9ded505ad149a9c08c7aecafc329f6f1a21f4adfabc9e21c826c7f3b6866c007397721b WHIRLPOOL 96637015719dbf22160df5d78a64fbe58b465c378c786b5641036f23071256104630b39e9142be136ea4d938891a4aab7b7fe6c09bf35ff62e8db99a75bfcc77
+MISC ChangeLog 4318 SHA256 6fc7d8201b9d1a8ce1be0ac28a654ef9339a1620653a125c3fb5d1ebeeb70032 SHA512 c69606261ec88ab81de4de2e18f3c637518fdd1a587661c6c452618be3184396a1b8647870a4865413c95b0a35712a8b43eb9387d40edfc18cb65aed0e1ee19a WHIRLPOOL ed3c5792afad36992be866503c10c3d9a105dfcc38e05389b944292fd174cac8aec7f617451e91d973278f31dd861e5935d9d25831bae20df79ff2625de3f0e0
+MISC ChangeLog-2015 1141 SHA256 3670b455ad98dab1b82218ca6f269b50049c66c72728955a26a7fb682f810ea7 SHA512 d552090d3efd971cb723bbfbd6555b9d8022ab4bd6d286d71374357cb03513b5840aca0cf75cb391d3fea9778b4a115b7bd27fe96ac4e2fc044246cf39347c29 WHIRLPOOL 02141fbf0524d0d0257ea68ecea1b7a0068a676f3612de1dabbc62a8f1982e22622a7bfa1f2a734844ad177ab1242bf4d5b4e119be547f1c5156cef32ddb53fa
+MISC metadata.xml 409 SHA256 27d6c61ee1f7b16893f71239f855cc6372d360da930c827c62d13eba916a7d90 SHA512 a66647c5e40f2593017942c12786dc30995e7980fdb58c1de0b9ae34069434cb5a4c70b2bd268a239df82edfcc1e7288e8033bf57609f757a321639afd5e78b8 WHIRLPOOL b04b32e375e63f62604cd77898ffaf60726f8ee6cf528861969a45028586e6676ee0dd06e295f90da8da0312e63ebb428fa8f41be8e6fc93998d5112864f6687
diff --git a/sys-libs/libapparmor/files/libapparmor-2.10-symbol_visibility.patch b/sys-libs/libapparmor/files/libapparmor-2.10-symbol_visibility.patch
new file mode 100644
index 000000000000..beaf355a2c9b
--- /dev/null
+++ b/sys-libs/libapparmor/files/libapparmor-2.10-symbol_visibility.patch
@@ -0,0 +1,13 @@
+Adds an aditional symbol to allow dynamic linking.
+
+--- src/libapparmor.map
++++ src/libapparmor.map
+@@ -94,6 +94,7 @@
+ _aa_autoclose;
+ _aa_autofclose;
+ _aa_dirat_for_each;
++ _aa_asprintf;
+ local:
+ *;
+ };
+
diff --git a/sys-libs/libapparmor/libapparmor-2.11.0-r1.ebuild b/sys-libs/libapparmor/libapparmor-2.11.0-r1.ebuild
new file mode 100644
index 000000000000..6aaecf4ef4df
--- /dev/null
+++ b/sys-libs/libapparmor/libapparmor-2.11.0-r1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+GENTOO_DEPEND_ON_PERL="no"
+
+inherit autotools-utils distutils-r1 perl-functions versionator
+
+MY_PV="$(get_version_component_range 1-2)"
+
+DESCRIPTION="Library to support AppArmor userspace utilities"
+HOMEPAGE="http://apparmor.net/"
+SRC_URI="https://launchpad.net/apparmor/${MY_PV}/${MY_PV}/+download/apparmor-${PV}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc +perl +python static-libs"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="perl? ( dev-lang/perl:= )
+ python? ( ${PYTHON_DEPS} )"
+
+DEPEND="${RDEPEND}
+ sys-devel/autoconf-archive
+ sys-devel/bison
+ sys-devel/flex
+ doc? ( dev-lang/perl )
+ perl? ( dev-lang/swig )
+ python? ( dev-lang/swig )"
+
+S=${WORKDIR}/apparmor-${PV}/libraries/${PN}
+
+RESTRICT="test"
+
+src_prepare() {
+ rm -r m4 || die "failed to remove bundled macros"
+ epatch "${FILESDIR}"/${PN}-2.10-symbol_visibility.patch
+ autotools-utils_src_prepare
+ use python && distutils-r1_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with perl) \
+ $(use_with python)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile -C src
+ autotools-utils_src_compile -C include
+ use doc && autotools-utils_src_compile -C doc
+ use perl && autotools-utils_src_compile -C swig/perl
+
+ if use python ; then
+ pushd "${BUILD_DIR}"/swig/python > /dev/null
+ emake libapparmor_wrap.c
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ autotools-utils_src_install -C src
+ autotools-utils_src_install -C include
+ use doc && autotools-utils_src_install -C doc
+
+ if use perl ; then
+ autotools-utils_src_install -C swig/perl
+ perl_set_version
+ insinto "${VENDOR_ARCH}"
+ doins "${BUILD_DIR}"/swig/perl/LibAppArmor.pm
+
+ # bug 620886
+ perl_delete_localpod
+ perl_fix_packlist
+ fi
+
+ if use python ; then
+ pushd "${BUILD_DIR}"/swig/python > /dev/null
+ distutils-r1_src_install
+
+ python_moduleinto LibAppArmor
+ python_foreach_impl python_domodule LibAppArmor.py
+ popd > /dev/null
+ fi
+}
diff --git a/sys-libs/libapparmor/metadata.xml b/sys-libs/libapparmor/metadata.xml
new file mode 100644
index 000000000000..42d1e8f65243
--- /dev/null
+++ b/sys-libs/libapparmor/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 type="person">
+ <email>kensington@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>hardened@gentoo.org</email>
+ <name>Gentoo Hardened</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="launchpad">apparmor</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libavc1394/Manifest b/sys-libs/libavc1394/Manifest
new file mode 100644
index 000000000000..f6452c0d81c9
--- /dev/null
+++ b/sys-libs/libavc1394/Manifest
@@ -0,0 +1,8 @@
+DIST libavc1394-0.5.3.tar.gz 355976 SHA256 23c96822df4edc90e3da0f19b69d31fbf7c28d1aba393be387340a71460424a6 SHA512 36761830082c0040708074eea8124c2eb027e3bb80fdbb8978af5eabe655afd2e6c9d7fc2aa9d4aba4d4d218cba9fa41fa6079119a9e460900b1e17effb4c145 WHIRLPOOL f001090b91b10baacfe0d641ed8bbb511ccd32f1fc158d39f1ab663d37809f67e155c2d157266372693617e692c76ba2b58971759c9fb6c67662b00cc34c9052
+DIST libavc1394-0.5.4.tar.gz 341679 SHA256 7cb1ff09506ae911ca9860bef4af08c2403f3e131f6c913a2cbd6ddca4215b53 SHA512 ef07631cd2de9b79dec9d81247d705be318101e8f8a1fe007b946ffab3dfe7b97f392144614d867ef6b2315b6c0e82d53e915f07855d4e21401645293e18842a WHIRLPOOL 87d77193635c1fb4ce7b6b3547566c41dada6b0fc1acd522c93a582a6bdce07d939d171269475d8d5a9aae0bc84c2326df5c3db5378aefb9d60df988b907f09f
+EBUILD libavc1394-0.5.3.ebuild 587 SHA256 c537f2bf7ed1bcdd578a9a027d2edfa0c2c89708d77bb9a7504747738ec35d0a SHA512 37b8a588da58a908ccefcd511e2c2b9ca55c36c89a1d0774940c3c76daf0cf46aa335d21c65b5914f63639fb9d83cbff564ea741f67f6b98bce90afdb3d068ec WHIRLPOOL e9a8db0f236f245332636d6c913e9369b6bca6c52ea6e6072e40b2dc880590a7b26f739229c887e9047d4345989bcc8ebda85b83e30c8e74b85a0faad89ddab5
+EBUILD libavc1394-0.5.4-r1.ebuild 701 SHA256 915cd5246474f6fb4e055f4720cdbe663ca548c85fbea633e4b5b34fa0c3c89a SHA512 5841419128c735430541a51442663243c7fe644b7868db7d80e62726015d52fa573a6a23926796796e20aebda7c76f95ecbcae2868c852a4b5db78d2345de5c5 WHIRLPOOL e94067d9aab9be3b88aa9ba57a38247f742a9876cdf5e5d0189662be2d068088fb2252b8f3c8d650f91ea224b311f6377aa6a74317e0b40ad48a7a72799bc488
+EBUILD libavc1394-0.5.4.ebuild 539 SHA256 54c9c164ab01d5b97762af25c59553943b7749f951d26833b72fd15f41e712e5 SHA512 fb5bf3bb7854a9c268dfe9ffbcd0572cd08a5adbe9f2949d94e4244be7e3c77ae6bd0fd30010a3759c4dce6e542678892b11059a1e44aeaa570d7ec0544c0150 WHIRLPOOL f8134cb871c5aa3d874852451131e8898f3d828e0b6c268de81561b7c8788c88837602f745380a54901abd4412b12174aa0cafd60ac65af0c547368cf4ecea53
+MISC ChangeLog 3227 SHA256 75f80de8db1e37ae16c8b706faba44ffdeb036fe03b211fabaad9b11979912aa SHA512 5a9ce8a76866e14e42a77f6553911a59ff644e049454a86b4d11f164300482d043acc196fd9827347e1af26e940982ab7b2387a664d562e6732fa7fd8b5243b3 WHIRLPOOL c84fa2dbaf6aad95029bc87b6c0ff2d4f6ff27461fe9779dca24edc7d12b9e6c4391adbf7a7048293e9ea90a2ace1c976627360a145ba08b6ea7e6ca0e2b39e6
+MISC ChangeLog-2015 6355 SHA256 8d76ccc14d4b83b50199fc5909a06f16ee4f987a0ebabb48cfe18eb9a017bc1a SHA512 f5005afeffc65730416e42320dfc6d9f46501114c2c7270c22934e589f389acd600d913ad3cb853fe955e8272c8f27af5d3f22fe16b0cada7951e543409dcd68 WHIRLPOOL 53613d2aaaf801e8c9fa9f011c8bf86b23db1715a2bdf9f573c8ce37de19c9bbeb02fd587e25d2c2537a44ede7208b601917b47f21fd5107de4aad3f287cda9c
+MISC metadata.xml 330 SHA256 6c793b2f886bae53c3dc09710988d4bc683132201e086eaf058795ad61cd8bba SHA512 3b2a188bb90d59ac6acb66b90e0231db783a6364f4e91a955df28346422061b99837ecf4038f6d42eb570630029623797c0e874737151065343b63352bd082f2 WHIRLPOOL e7ddbea52d2d7a40a990c03815a6fbd09b3b862b06e8ae2ac6931b202691a71d248affd5177cd3d5e4548c735d54f1e6ea37c907a0577ff45fe1a00fd09f8bf2
diff --git a/sys-libs/libavc1394/libavc1394-0.5.3.ebuild b/sys-libs/libavc1394/libavc1394-0.5.3.ebuild
new file mode 100644
index 000000000000..359b39a142f1
--- /dev/null
+++ b/sys-libs/libavc1394/libavc1394-0.5.3.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="library for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set"
+HOMEPAGE="https://sourceforge.net/projects/libavc1394/"
+SRC_URI="mirror://sourceforge/libavc1394/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86"
+IUSE=""
+
+RDEPEND=">=sys-libs/libraw1394-0.8"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog NEWS README TODO
+}
diff --git a/sys-libs/libavc1394/libavc1394-0.5.4-r1.ebuild b/sys-libs/libavc1394/libavc1394-0.5.4-r1.ebuild
new file mode 100644
index 000000000000..20e6da0e2287
--- /dev/null
+++ b/sys-libs/libavc1394/libavc1394-0.5.4-r1.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit autotools-multilib
+
+DESCRIPTION="library for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set"
+HOMEPAGE="https://sourceforge.net/projects/libavc1394/"
+SRC_URI="mirror://sourceforge/libavc1394/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 ia64 ppc ppc64 sparc x86"
+IUSE="static-libs"
+
+RDEPEND=">=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
diff --git a/sys-libs/libavc1394/libavc1394-0.5.4.ebuild b/sys-libs/libavc1394/libavc1394-0.5.4.ebuild
new file mode 100644
index 000000000000..9d33d1a8038f
--- /dev/null
+++ b/sys-libs/libavc1394/libavc1394-0.5.4.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit autotools-utils
+
+DESCRIPTION="library for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set"
+HOMEPAGE="https://sourceforge.net/projects/libavc1394/"
+SRC_URI="mirror://sourceforge/libavc1394/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE="static-libs"
+
+RDEPEND=">=sys-libs/libraw1394-0.8"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
diff --git a/sys-libs/libavc1394/metadata.xml b/sys-libs/libavc1394/metadata.xml
new file mode 100644
index 000000000000..babba315f16e
--- /dev/null
+++ b/sys-libs/libavc1394/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">libavc1394</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/libblockdev/Manifest b/sys-libs/libblockdev/Manifest
new file mode 100644
index 000000000000..6640b9b0ef74
--- /dev/null
+++ b/sys-libs/libblockdev/Manifest
@@ -0,0 +1,5 @@
+DIST libblockdev-2.12-1.tar.gz 252590 SHA256 3758d1ba88756756f498e52710c37df56eb6d9287c28cdd514ef7bbe6574566b SHA512 d40ce3ae45edbe2c79fe0c86df8a22982bd94718cf82161ccd5d7759272eba9948d29e6ab26490f7ba8cb3630b0350ee3a659fba7da73056dc123db9c2535b2e WHIRLPOOL 8d32fe6a153595e756c2fe8bf6fb5a3eaa8f88670843be7afaf0419270c2f4e4d7ce8e6fda705b34547d964e5eb7869b45951f2267c5830060ae8634c82c224d
+DIST libblockdev-2.13-1.tar.gz 269162 SHA256 0eca9236ec47dad64729b602d6658ff48034bf95f749296df1aa23e733abf5df SHA512 eaa0751691008f2cb3c4cdbf00af8f3653b7e309a02ccb700528601ccfa0cca7631e6072e2a25d9da3862b0638dac08b0ac739b1ae4702b9b263fb58f73d10c9 WHIRLPOOL 311ccc4a65963f0457d519e8858d3d0e8a286d3343efb8819b2ffd1d1d01057b6ca2f6926472cc11b2b6f918cf8644654c328c074e63fddbe2447f62f02fc7fb
+EBUILD libblockdev-2.12.ebuild 1450 SHA256 70caa6a624595d028a9a568fd98374a3255e16552bdc053014e6e75917943c7d SHA512 42e0cbe8a870c7ef122322f3129b369154ca23c3676fd79fa45243696bb5907c67837c0d07b9dfc1447313cfdf859d3cee30c6a6618b7684a9a16acec3e30982 WHIRLPOOL 394413d274615f5043266a4440a432f493bf0af6156788062696b80d9d988751026178491ebb76e43b774e2f8e25a91187c197e33d5c69388148809265adb8e3
+EBUILD libblockdev-2.13.ebuild 1450 SHA256 70caa6a624595d028a9a568fd98374a3255e16552bdc053014e6e75917943c7d SHA512 42e0cbe8a870c7ef122322f3129b369154ca23c3676fd79fa45243696bb5907c67837c0d07b9dfc1447313cfdf859d3cee30c6a6618b7684a9a16acec3e30982 WHIRLPOOL 394413d274615f5043266a4440a432f493bf0af6156788062696b80d9d988751026178491ebb76e43b774e2f8e25a91187c197e33d5c69388148809265adb8e3
+MISC metadata.xml 699 SHA256 066244bf0d29afd9a7c56bf92b302f1a44a2e2964f3bbccb979af6de9e836ef8 SHA512 64d93b75e3100a80d83112de338979f1ea9dd42ff39ef96f232343e977058de0b1d8785f93760ee24616df564ab4f8af490909242cbbad037f044b283a21634d WHIRLPOOL 3f0e27a344b607c7f33e15fd967f7d2a90f484901ec8673d7b8f6703697054b4e17a1fa07b2da915a6b08cec7f19b6f44e0f8b1751782f05915b30112edc8769
diff --git a/sys-libs/libblockdev/libblockdev-2.12.ebuild b/sys-libs/libblockdev/libblockdev-2.12.ebuild
new file mode 100644
index 000000000000..53c3efbcb20a
--- /dev/null
+++ b/sys-libs/libblockdev/libblockdev-2.12.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_{4,5,6} )
+inherit autotools python-single-r1
+
+MY_PV="${PV}-1"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="A library for manipulating block devices"
+HOMEPAGE="https://github.com/rhinstaller/libblockdev"
+SRC_URI="https://github.com/rhinstaller/${PN}/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="LGPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="bcache +crypt dmraid doc lvm kbd test"
+
+CDEPEND="
+ >=dev-libs/glib-2.42.2
+ dev-libs/libbytesize
+ >=sys-apps/util-linux-2.27
+ >=sys-block/parted-3.1
+ crypt? (
+ >=dev-libs/nss-3.18.0
+ dev-libs/volume_key
+ >=sys-fs/cryptsetup-1.6.7
+ )
+ dmraid? (
+ sys-fs/dmraid
+ sys-fs/lvm2
+ )
+ lvm? (
+ sys-fs/lvm2
+ virtual/udev
+ )
+ kbd? ( >=sys-apps/kmod-19 )
+ ${PYTHON_DEPS}
+"
+
+DEPEND="
+ ${CDEPEND}
+ >=dev-libs/gobject-introspection-1.3.0
+ doc? ( dev-util/gtk-doc )
+"
+
+RDEPEND="
+ ${CDEPEND}
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-btrfs
+ --with-fs
+ --with-part
+ --with-python3
+ --without-mpath
+ $(use_enable test tests)
+ $(use_with bcache)
+ $(use_with crypt crypto)
+ $(use_with dmraid dm)
+ $(use_with doc gtk-doc)
+ $(use_with lvm lvm)
+ $(use_with lvm lvm-dbus)
+ $(use_with kbd)
+ )
+ econf "${myeconfargs[@]}"
+}
diff --git a/sys-libs/libblockdev/libblockdev-2.13.ebuild b/sys-libs/libblockdev/libblockdev-2.13.ebuild
new file mode 100644
index 000000000000..53c3efbcb20a
--- /dev/null
+++ b/sys-libs/libblockdev/libblockdev-2.13.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_{4,5,6} )
+inherit autotools python-single-r1
+
+MY_PV="${PV}-1"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="A library for manipulating block devices"
+HOMEPAGE="https://github.com/rhinstaller/libblockdev"
+SRC_URI="https://github.com/rhinstaller/${PN}/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+LICENSE="LGPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="bcache +crypt dmraid doc lvm kbd test"
+
+CDEPEND="
+ >=dev-libs/glib-2.42.2
+ dev-libs/libbytesize
+ >=sys-apps/util-linux-2.27
+ >=sys-block/parted-3.1
+ crypt? (
+ >=dev-libs/nss-3.18.0
+ dev-libs/volume_key
+ >=sys-fs/cryptsetup-1.6.7
+ )
+ dmraid? (
+ sys-fs/dmraid
+ sys-fs/lvm2
+ )
+ lvm? (
+ sys-fs/lvm2
+ virtual/udev
+ )
+ kbd? ( >=sys-apps/kmod-19 )
+ ${PYTHON_DEPS}
+"
+
+DEPEND="
+ ${CDEPEND}
+ >=dev-libs/gobject-introspection-1.3.0
+ doc? ( dev-util/gtk-doc )
+"
+
+RDEPEND="
+ ${CDEPEND}
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-btrfs
+ --with-fs
+ --with-part
+ --with-python3
+ --without-mpath
+ $(use_enable test tests)
+ $(use_with bcache)
+ $(use_with crypt crypto)
+ $(use_with dmraid dm)
+ $(use_with doc gtk-doc)
+ $(use_with lvm lvm)
+ $(use_with lvm lvm-dbus)
+ $(use_with kbd)
+ )
+ econf "${myeconfargs[@]}"
+}
diff --git a/sys-libs/libblockdev/metadata.xml b/sys-libs/libblockdev/metadata.xml
new file mode 100644
index 000000000000..6f4957ace55d
--- /dev/null
+++ b/sys-libs/libblockdev/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 type="person">
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <use>
+ <flag name="bcache">Enable block device cache support.</flag>
+ <flag name="dmraid">Support for dmraid devices, also known as ATA-RAID, or Fake RAID.</flag>
+ <flag name="lvm">Enable support for Logical Volume Management via <pkg>sys-fs/lvm2</pkg>.</flag>
+ <flag name="kbd">Enable kernel block device support.</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">storaged-project/libblockdev</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libcap-ng/Manifest b/sys-libs/libcap-ng/Manifest
new file mode 100644
index 000000000000..50189955ef7b
--- /dev/null
+++ b/sys-libs/libcap-ng/Manifest
@@ -0,0 +1,5 @@
+DIST libcap-ng-0.7.8.tar.gz 447946 SHA256 c21af997445cd4107a55d386f955c5ea6f6e96ead693e9151277c0ab5f97d05f SHA512 c32a4c5780c183b13611615abe9061221fd8987188b08828d1617cdaee338ad8de67b3430aa83bde60128efc76449a688546bfbf697f0847b6a835cb1a868756 WHIRLPOOL a56ee901f301c4c2e0353e2b9e38938fcd6efbb9394d60af6c7045967e6a310fd19b658617b362f14489a75da64a69e82a3afcada97f898c2ab25fad6fb6603d
+EBUILD libcap-ng-0.7.8.ebuild 2308 SHA256 8fcf3babd9e48b83098ef5561b680a372ba4f093f361ba3fe2f34b8a7a6110ad SHA512 b61063ef706671a2ccc15770d5687f2abc15a9b7c16ee7386db4b7e605f28094ad88b51c2d001cee018eb76900a10236b250eab741c8614e6541119fffa86461 WHIRLPOOL 81ca4a312121a80cf3e5fed1ef07ed0b698045e0a6af29907e695f110045d1a0765be0cc204443192e8f49899b4d75bbcc022bcd38b1503eca97fb7efc48416c
+MISC ChangeLog 5981 SHA256 95fae46ed32a503e1542fad7542bc0fb56e8123de570dd6d5628f6eaa2f5c901 SHA512 afc8440dc05497a72381e96b1762983ead83eb67d4002ab9055150f6d729c9763e9be08a91494f3fbdf557ee910eaa1272496df4f258ed6a0d644f8c39bd7394 WHIRLPOOL 2392f36fe99fa16b12ea98aa4c8f449cee2c8192cc34136053ce139500c9cb254a4339305fd6bfdfb965723a8345e3471c6516d6f4bb8697f9603fd702c53be4
+MISC ChangeLog-2015 10433 SHA256 559a152b35084b04940b619faff0216fb5f9055caa52594096fa7a3444f3616d SHA512 678b1fe48a396ffd2bd939b2828ef9cf9aa4175701f2aea8c6fbbd608c5038c518e98969891b2b2eab65992edf84c57818bc8a7b27f593c24414907ad5767961 WHIRLPOOL 549ea31a5cae98a96e177e6dd9ca75067a9108bc5e352e369fc4f8485ba735e3ab1b973c631eda1d21aba6444d1a39d6179e4e0d34c03933fde01bb76680794b
+MISC metadata.xml 580 SHA256 d6000e84fe72c4f6b507c04edda36269aed6a1cab6aaf430eab08ad3592bf48c SHA512 51d670d97a94c8c668a4580bf6106a5b027b4d8d0c2f27ca88a508e60ece5a5390b619f0368c8111f2b843748a9ad31f1804c2a60df91ae1717a2c8b2a7aedc3 WHIRLPOOL e29b31c47bdb74ea61049e6cebd897e4147c9d5acefbcd1c1f752cf8cc5893047b5918805bbc9b8553eec3b68319825a1c9a5c48f987b6f788e6415bebac8c7e
diff --git a/sys-libs/libcap-ng/libcap-ng-0.7.8.ebuild b/sys-libs/libcap-ng/libcap-ng-0.7.8.ebuild
new file mode 100644
index 000000000000..4d8132b1ac0b
--- /dev/null
+++ b/sys-libs/libcap-ng/libcap-ng-0.7.8.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit autotools-utils flag-o-matic python-r1
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="https://people.redhat.com/sgrubb/libcap-ng/"
+SRC_URI="https://people.redhat.com/sgrubb/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~arm-linux ~x86-linux"
+IUSE="python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers
+ python? ( >=dev-lang/swig-2 )"
+
+RESTRICT="test"
+
+src_prepare() {
+ sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die
+
+ autotools-utils_src_prepare
+
+ use sparc && replace-flags -O? -O0
+}
+
+src_configure() {
+ # set up the library build
+ local myeconfargs=( --without-python --without-python3 )
+ autotools-utils_src_configure
+
+ # set up python bindings build(s)
+ if use python ; then
+ setup_python_flags_configure() {
+ if [[ ${EPYTHON} == python2* ]] ; then
+ myeconfargs=( --with-python --without-python3 )
+ else
+ myeconfargs=( --with-python --with-python3 )
+ fi
+ autotools-utils_src_configure
+ }
+
+ python_foreach_impl setup_python_flags_configure
+ fi
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+ if use python; then
+ python_compile() {
+ local CFLAGS=${CFLAGS}
+
+ python_is_python3 || CFLAGS+=" -fno-strict-aliasing"
+
+ emake "${@}" \
+ -C "${BUILD_DIR}"/bindings/python
+ }
+
+ # help build system find the right objects
+ python_foreach_impl python_compile \
+ VPATH="${BUILD_DIR}"/bindings/python \
+ LIBS="${BUILD_DIR}"/src/libcap-ng.la
+ fi
+}
+
+src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions."
+ return
+ fi
+
+ autotools-utils_src_test
+
+ if use python; then
+ python_foreach_impl \
+ autotools-utils_src_compile -C bindings/python check \
+ VPATH="${BUILD_DIR}"/bindings/python:"${S}"/bindings/python/test
+ fi
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if use python; then
+ python_foreach_impl \
+ autotools-utils_src_install -C bindings/python \
+ VPATH="${BUILD_DIR}"/bindings/python
+ fi
+}
diff --git a/sys-libs/libcap-ng/metadata.xml b/sys-libs/libcap-ng/metadata.xml
new file mode 100644
index 000000000000..9aa642f3201d
--- /dev/null
+++ b/sys-libs/libcap-ng/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<longdescription>
+ The libcap-ng library is intended to make programming with POSIX
+ capabilities much easier than the traditional libcap library. It includes
+ utilities that can analyse all currently running applications and print
+ out any capabilities and whether or not it has an open ended bounding set.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
new file mode 100644
index 000000000000..5326ea16f42a
--- /dev/null
+++ b/sys-libs/libcap/Manifest
@@ -0,0 +1,15 @@
+AUX libcap-2.20-ignore-RAISE_SETFCAP-install-failures.patch 840 SHA256 29be1427227f9b045151bd02597192bff1c6761c649014b0fd1384f08e010616 SHA512 59936147919f3a8959d87831583df96ab3e1883e58b746f6542cc6430434d2a93c07e79ff7e9fdf9698626aa42e60c6c57981025e46923be76ff2d65720d606c WHIRLPOOL c721054ac8538b748367b9a17971d3021831fdaf49260a2290484a506638ee8598946f001272e014937abb99569b17b0a3f9daed31ea426b6ce74f9a09460867
+AUX libcap-2.21-include.patch 290 SHA256 60038e5f67928edbf7e1b43b8799d5a92cff40dd7c3678135c793ed434c29305 SHA512 6f4867c64121e1294824a2dc1ac02578c9900cd051aea41d0920f1f65e162e3acec86a42f7e4fa6ee1dff08554fe25bd740951e9dc8a11bf79471229f268cffd WHIRLPOOL c3233cf04efc380c274bbd2860576f68494a16e4b0a2827284a692b560650379e33497532b347c2e8aa5019d229f8ceb6be3e0a990e21eae5d459134115aafd1
+AUX libcap-2.22-no-perl.patch 2360 SHA256 4eca873685da1aec0d06e9d7681c285166f9ad7e7cb14c65da6e05cbb135e9ef SHA512 8c49d829cbae15f28ded70b96bc0715819b13183136d90b64b7b6bfbd85c262f0161d89450579e9b58961c724b34816919d111f839e3f5a7a68427ffe441881d WHIRLPOOL 1da9b5b8b54c38bf45117653122ee6dc55949c21c39152d18d2dc0c721d4b906f777a8734d184d18b2c7a25b2aa06aa68d1ccc4409b16915aeb8d9b014951759
+AUX libcap-2.24-build-system-fixes.patch 4943 SHA256 c3d77ae406d13def200f520f6063b3783ae0dae46e740ad78ab189f8a6168210 SHA512 84283f0652f87a8c1f598413d03e8f3aeeb140b322519051df1873933d6d3ac738757e1c7c91ea6efc51548d224149b84d6a1fab0301a655eb609b183bc9e7ba WHIRLPOOL 1697c9223a59f10c5472b0286fa19a9a6c4b9dee16314f785164731043b4207f122b916bef7d596cb94e46eaf4eb7d376129cbedbcc7d317f1b49f17875d11d2
+AUX libcap-2.24-setcap-errno.patch 1491 SHA256 397462a3e207944a7ab2837a06794b225c29ad45e630de69e02df64225106586 SHA512 367037d6c42d07c359e9ee397cbc7431ea05c3d34deea93db1473394decb9f61a2c9de186652fc3a12fb615406ec1a2f4d76eb63c4410c6a2b5f435ece5b05ef WHIRLPOOL 07ce9f884251aad17fd9f7a3fef11e8193b66f3dcd9b58fb4aad755237cd7e4ad28e55a8d5434c65c5e56cc0a92af45f7bf677f0dc451276f46dcffe046a2ee1
+AUX libcap-2.25-build-system-fixes.patch 4705 SHA256 577368c8f23c3de76ba8fe580c4f89f3d23642f00e727547b25b8a9eae8e16af SHA512 c99df67dfdceefeea3c3033a38e94a93cd7a9c4ed6e74f42c3b7198d66deee4b5d4aa91c540a48b12749ce3285c0ac3f11d0ecc33b913c3f0169578ae28745da WHIRLPOOL 5f3a9cb1be9163a7692dafdd3ddc1e18d7152a06e773b0cd260faf3671155fe11225de4dfadb11a41a4d3eb739e69880230ce9f1bafe528d2b4e003ac9ce41d3
+AUX libcap-2.25-gperf.patch 620 SHA256 313ceed1d85424aa5f2143501e1d39e3ff8a3ad83b1f3813266ab158db902324 SHA512 1fd325160ebcf96f8a8f58e7f453241d15d2c968752cc050b52871536840f8ebbbfe1fa2bd03c19f86859e9739eb0059d30f157d2fa3a076da4a895fc32182e6 WHIRLPOOL 5adf5e901329188e91c6e5ae29dc0da61861408b5f3f04a46fd6b0b5d82ab7ae8d31cc8fe88734dd13a0df7a36deadd7f41b4babcef72e62f661aae37e89abae
+AUX libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch 988 SHA256 fd18c5bb8cfd2f5b35b11d71d6170f0bff680aca313757bb3d8c201f137453d7 SHA512 ba573ce68858c1370f3d25ad03678a534e6f3052076694d09e795d1febf2f3d76a6a170658b71d9e31105521fd5d22dd72095585a5402286dba424937064b389 WHIRLPOOL 3d3d564cd1d066ac695a34c5d7ab4a5da30212e370492cface41581760bb47c5e113db5b8fda7eeb1bb645c01eb2f12a61b640d07ddba0754a883fb7dfe2aa8d
+DIST libcap-2.24.tar.xz 63412 SHA256 cee4568f78dc851d726fc93f25f4ed91cc223b1fe8259daa4a77158d174e6c65 SHA512 c062bab936d651a50efa66dcfa51ab3ce4b0881195d23bb32142b5c8044d30e0e2152f3497844ce90c04f909aeffe2d41203efff41972e38758dcca7b653884b WHIRLPOOL bb7a9d8d3b999ad289962ebdc8b9eff87e25bd744a86ee4717e999738cb5a556a51826d0f0cbfc628629948fa8355d5d972208910d6c1c99bdf66a673b6f1cc8
+DIST libcap-2.25.tar.xz 63672 SHA256 693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162 SHA512 c3ab491885292adc171cde542b96f1295e84132febb50112a46575c3bde3a3eb6fcf733f7a756b4b656e013c0abb5ed6571db24799f8c0b23d8f759f992864f9 WHIRLPOOL 294a399224997bb3e6187103f364dee2d64f5ab633068361c56fcb4a496abf24d0283b35d4c48df193d36f9372540a3afe853627429ba7f7caba7e9826e1a13d
+EBUILD libcap-2.24-r2.ebuild 1849 SHA256 ca4f76b966bfd23f822ce50299569e3946bc5be5cfc9adc731f3eb724f5602d7 SHA512 bcc666cb5493e71c9060144a87289cdbb8cdf7a9ee98de6d44619a54881a0b4585e50c8edd24596a419a9e79c67e8ecd0eb215fcb68bd2b7305e704d346dd1e1 WHIRLPOOL 0653cc83acef8d600bc834a52a36c8a8fe4d229db312fc4b85352171fd3564d4e021ea919c5c5dd8e80fa6e227029770fc166f80d6e0a0da7456046e1610f8fe
+EBUILD libcap-2.25.ebuild 1993 SHA256 15384016d977aacb418668811fe8f53704cb5f40485d43918868617d3ecd02d4 SHA512 f06c3222c4138950a7acbf1ff51dec492e383a8f6155a6e00477df63fb56f71138e49754bdb4fc4c7644d4acfc379d26504de926b8419cda8b8ac14c1efafb9d WHIRLPOOL 21177d62ce59b62963e2258e3c2bb36605bba96cb67cd21ac7db0b0f38b33210c7ef92474442675a566f8b194a38bb528e2d10c3c8c6f08ddbb7876988e9eb76
+MISC ChangeLog 6561 SHA256 eeaaba458412aa89795d59c4dac7b01914e38a3332e1f0e1790ccad7e2888de6 SHA512 edff5c5b9b1aea5bc80c069ed80dd4e46fedc6dc622444063bf651dbdf344423af62de1a9edb1782d38898c64b227b680830125f0cf6423cd31d0803b48ba6bd WHIRLPOOL 5b31ca3c4715d89f9553680f8fd16bb778c3cca175883c3c3dd14156583eaa13da3c065b5234b478018a18b198188c440ff3b57999db0a88bd4a865c109ee94d
+MISC ChangeLog-2015 19662 SHA256 b0af676d62d97ad4f30806040c14cc2fc4a8b55cac6b4840bc05866ccaf0204e SHA512 f39e403217fe2cde0c5e67501505e142726af4c662cca86561f8d5b737e5c8c5148f3ec73f33638e7aeabc3bd4aab93663bb814ba0db8a8e2a5ed1b993fe3334 WHIRLPOOL 37c17ae1a701eec386716a6902bef89ddf2ce61ad2a2d87f674dcc83ba1e67c579950ed2c0380f571c803b41a94fd9a42d9975b5e8299d81b421c06cf879c0f3
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-libs/libcap/files/libcap-2.20-ignore-RAISE_SETFCAP-install-failures.patch b/sys-libs/libcap/files/libcap-2.20-ignore-RAISE_SETFCAP-install-failures.patch
new file mode 100644
index 000000000000..1bc4d63ebb1a
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.20-ignore-RAISE_SETFCAP-install-failures.patch
@@ -0,0 +1,29 @@
+From f2020ee4ee4b2f245637c77e81d62ab6d1db3c6c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 25 Jan 2011 15:52:31 -0500
+Subject: [PATCH] ignore RAISE_SETFCAP install failures
+
+While the new RAISE_SETFCAP feature is nifty, its failure to run (often
+due to the fs not supporting it) shouldn't impair the default install.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ progs/Makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/progs/Makefile b/progs/Makefile
+index c261f57..9e1a84d 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -30,7 +30,7 @@ install: all
+ install -m 0755 $$p $(SBINDIR) ; \
+ done
+ ifeq ($(RAISE_SETFCAP),yes)
+- $(SBINDIR)/setcap cap_setfcap=i $(SBINDIR)/setcap
++ -$(SBINDIR)/setcap cap_setfcap=i $(SBINDIR)/setcap
+ endif
+
+ clean:
+--
+1.7.4.rc2
+
diff --git a/sys-libs/libcap/files/libcap-2.21-include.patch b/sys-libs/libcap/files/libcap-2.21-include.patch
new file mode 100644
index 000000000000..2a534246ee01
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.21-include.patch
@@ -0,0 +1,10 @@
+--- libcap/libcap.h.org 2011-06-15 07:25:58.912480899 +0200
++++ libcap/libcap.h 2011-06-15 07:26:16.421329661 +0200
+@@ -13,6 +13,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/capability.h>
++#include <sys/prctl.h> /* prctl() */
+
+ #ifndef __u8
+ #define __u8 unsigned char
diff --git a/sys-libs/libcap/files/libcap-2.22-no-perl.patch b/sys-libs/libcap/files/libcap-2.22-no-perl.patch
new file mode 100644
index 000000000000..9c29e7efbf38
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.22-no-perl.patch
@@ -0,0 +1,54 @@
+From fdd0f3b207785711663f48e0dd3414d90d1f2e86 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 12 Nov 2011 14:24:08 -0500
+Subject: [PATCH] use awk/sed instead of perl for creating header files
+
+More systems should have awk/sed than perl.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libcap/Makefile | 20 ++++++++++++++++----
+ 1 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 4762c60..68845e0 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -24,6 +24,8 @@ OBJS=$(addsuffix .o, $(FILES))
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
+ CFLAGS += -fPIC
++AWK = awk
++SED = sed
+
+ all: $(MINLIBNAME) $(STALIBNAME)
+
+@@ -39,11 +41,21 @@ cap_names.h: _makenames
+ ./_makenames > cap_names.h
+
+ $(GPERF_OUTPUT): cap_names.list.h
+- perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
++ (printf "%b" "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; \
++ $(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
++ gperf \
++ --ignore-case \
++ --language=ANSI-C \
++ --readonly \
++ --null-strings \
++ --global-table \
++ --hash-function-name=__cap_hash_name \
++ --lookup-function-name="__cap_lookup_name" \
++ -c -t -m20 $(INDENT) > $@
+
+-cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
+- @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
+- perl -e 'while ($$l=<>) { if ($$l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$$/) { $$tok=$$1; $$val=$$2; $$tok =~ tr/A-Z/a-z/; print "{\"$$tok\",$$val},\n"; } }' $(KERNEL_HEADERS)/linux/capability.h | fgrep -v 0x > $@
++cap_names.list.h: $(KERNEL_HEADERS)/linux/capability.h Makefile
++ @echo "=> making $@ from $<"
++ $(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $< > $@
+
+ $(STALIBNAME): $(OBJS)
+ $(AR) rcs $@ $^
+--
+1.7.6.1
+
diff --git a/sys-libs/libcap/files/libcap-2.24-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.24-build-system-fixes.patch
new file mode 100644
index 000000000000..64393275bb80
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.24-build-system-fixes.patch
@@ -0,0 +1,163 @@
+From 0485ff3e7f62a331aa4f1e8ec4c2fdcee400e324 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 16 Nov 2008 09:10:31 -0500
+Subject: [PATCH] build system fixes
+
+This touches up the homebrewed build system to work much better "out of the
+box" for people. Specifically:
+ - allow toolchain vars to be set via environment
+ - CC / BUILD_CC / AR / RANLIB
+ - CFLAGS / CPPFLAGS / LDFLAGS
+ - split CPPFLAGS out of CFLAGS
+ - break -fPIC out of global CFLAGS and only use where needed
+ - use LDLIBS for libraries, not LDFLAGS
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Make.Rules | 26 ++++++++++++++------------
+ libcap/Makefile | 11 ++++++-----
+ pam_cap/Makefile | 8 +++++---
+ progs/Makefile | 2 +-
+ 4 files changed, 26 insertions(+), 21 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index 18b7cf7..5364c46 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -45,27 +45,29 @@ MINOR=24
+
+ # Compilation specifics
+
+-KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
+-
+-CC := gcc
+-CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+-BUILD_CC := $(CC)
+-BUILD_CFLAGS := $(CFLAGS) $(IPATH)
+-AR := ar
+-RANLIB := ranlib
++CC ?= gcc
++CFLAGS ?= -O2
++BUILD_CC ?= $(CC)
++BUILD_CFLAGS ?= $(CFLAGS)
++AR ?= ar
++RANLIB ?= ranlib
+ DEBUG = -g #-DDEBUG
+ WARNINGS=-Wall -Wwrite-strings \
+ -Wpointer-arith -Wcast-qual -Wcast-align \
+ -Wstrict-prototypes -Wmissing-prototypes \
+ -Wnested-externs -Winline -Wshadow
+ LD=$(CC) -Wl,-x -shared
+-LDFLAGS := #-g
++LDFLAGS ?= #-g
+
+-SYSTEM_HEADERS = /usr/include
++KERNEL_HEADERS = $(topdir)/libcap/include/uapi
++LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
++LIBCAP_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+ LDFLAGS += -L$(topdir)/libcap
+-CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS) $(DEBUG)
+ PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+ DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 0ccd2e7..6b446ea 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -16,7 +16,7 @@ FILES=cap_alloc cap_proc cap_extint cap_flag cap_text
+ # no support).
+ ifeq ($(LIBATTR),yes)
+ FILES += cap_file
+-LDFLAGS += -lattr
++LDLIBS += -lattr
+ DEPS = -lattr
+ endif
+
+@@ -25,6 +25,7 @@ OBJS=$(addsuffix .o, $(FILES))
+ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
++CFLAGS += -fPIC
+
+ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc
+
+@@ -43,7 +44,7 @@ libcap.pc: libcap.pc.in
+ $< >$@
+
+ _makenames: _makenames.c cap_names.list.h
+- $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
++ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+
+ cap_names.h: _makenames
+ ./_makenames > cap_names.h
+@@ -60,15 +61,15 @@ $(STALIBNAME): $(OBJS)
+ $(RANLIB) $@
+
+ $(MINLIBNAME): $(OBJS)
+- $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^
++ $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^ $(LDLIBS)
+ ln -sf $(MINLIBNAME) $(MAJLIBNAME)
+ ln -sf $(MAJLIBNAME) $(LIBNAME)
+
+ %.o: %.c $(INCLS)
+- $(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+- $(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+
+ install: all
+ mkdir -p -m 0755 $(FAKEROOT)$(INCDIR)/sys
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index cc32fb6..6f07b6b 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -9,6 +9,8 @@ include ../Make.Rules
+ # written (and you know why it fails), email me and explain why. Thanks!
+ LDLIBS += -L../libcap -lcap
+
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ $(MAKE) testcompile
+
+@@ -17,13 +19,13 @@ install: all
+ install -m 0755 pam_cap.so $(FAKEROOT)$(LIBDIR)/security
+
+ pam_cap.so: pam_cap.o
+- $(LD) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
++ $(LD) $(CFLAGS) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
+
+ pam_cap.o: pam_cap.c
+- $(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+ testcompile: test.c pam_cap.o
+- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
+
+ clean:
+ rm -f *.o *.so testcompile *~
+diff --git a/progs/Makefile b/progs/Makefile
+index 778149e..8f4e2e6 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -22,7 +22,7 @@ $(BUILD): %: %.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
+
+ %.o: %.c $(INCS)
+- $(CC) $(IPATH) $(CFLAGS) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+ install: all
+ mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+--
+2.4.1
+
diff --git a/sys-libs/libcap/files/libcap-2.24-setcap-errno.patch b/sys-libs/libcap/files/libcap-2.24-setcap-errno.patch
new file mode 100644
index 000000000000..08513f643e65
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.24-setcap-errno.patch
@@ -0,0 +1,45 @@
+From 62b190c09d5652c58679dffd7f09e4aceb4c7daa Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 13 Jul 2015 01:59:14 -0400
+Subject: [PATCH] setcap: fix errno display
+
+The commit 056ffb0bd25d91ffbcb83c521fc4d3d9904ec4d4 broke the display of
+the final error message because it would do more operations that would
+clobber errno. Example:
+(libcap-2.22) sudo setcap cap_ipc_lock=ep /proc/filesystems | head -1
+Failed to set capabilities on file `/proc/filesystems' (Operation not supported)
+(libcap-2.23) sudo setcap cap_ipc_lock=ep /proc/filesystems | head -1
+Failed to set capabilities on file `/proc/filesystems' (Invalid argument)
+
+Save the original errno value and use that for the final display instead.
+
+URL: https://bugs.gentoo.org/551672
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ progs/setcap.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/progs/setcap.c b/progs/setcap.c
+index 83090ae..7304343 100644
+--- a/progs/setcap.c
++++ b/progs/setcap.c
+@@ -171,6 +171,7 @@ int main(int argc, char **argv)
+ retval = cap_set_file(*++argv, cap_d);
+ if (retval != 0) {
+ int explained = 0;
++ int oerrno = errno;
+ #ifdef linux
+ cap_value_t cap;
+ cap_flag_value_t per_state;
+@@ -193,7 +194,7 @@ int main(int argc, char **argv)
+
+ fprintf(stderr,
+ "Failed to set capabilities on file `%s' (%s)\n",
+- argv[0], strerror(errno));
++ argv[0], strerror(oerrno));
+ if (!explained) {
+ usage();
+ }
+--
+2.4.4
+
diff --git a/sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch
new file mode 100644
index 000000000000..c33fffda8d91
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch
@@ -0,0 +1,153 @@
+From d5a0c023a7f3deefd471d7b97ef4fa40ed374645 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 10 Feb 2016 09:47:27 +0100
+Subject: [PATCH] build system fixes
+
+This touches up the homebrewed build system to work much better "out of the
+box" for people. Specifically:
+ - allow toolchain vars to be set via environment
+ - CC / BUILD_CC / AR / RANLIB
+ - CFLAGS / CPPFLAGS / LDFLAGS
+ - split CPPFLAGS out of CFLAGS
+ - break -fPIC out of global CFLAGS and only use where needed
+ - use LDLIBS for libraries, not LDFLAGS
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.24 to libcap-2.25
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules | 26 ++++++++++++++------------
+ libcap/Makefile | 7 ++++---
+ pam_cap/Makefile | 8 +++++---
+ progs/Makefile | 2 +-
+ 4 files changed, 24 insertions(+), 19 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index 8347b26..d7196ef 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -45,28 +45,30 @@ MINOR=25
+
+ # Compilation specifics
+
+-KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
+-
+-CC := gcc
+-CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+-BUILD_CC := $(CC)
+-BUILD_CFLAGS := $(CFLAGS) $(IPATH)
+-AR := ar
+-RANLIB := ranlib
++CC ?= gcc
++CFLAGS ?= -O2
++BUILD_CC ?= $(CC)
++BUILD_CFLAGS ?= $(CFLAGS)
++AR ?= ar
++RANLIB ?= ranlib
+ DEBUG = -g #-DDEBUG
+ WARNINGS=-Wall -Wwrite-strings \
+ -Wpointer-arith -Wcast-qual -Wcast-align \
+ -Wstrict-prototypes -Wmissing-prototypes \
+ -Wnested-externs -Winline -Wshadow
+ LD=$(CC) -Wl,-x -shared
+-LDFLAGS := #-g
++LDFLAGS ?= #-g
+ BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
+
+-SYSTEM_HEADERS = /usr/include
++KERNEL_HEADERS = $(topdir)/libcap/include/uapi
++LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
++LIBCAP_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+ LDFLAGS += -L$(topdir)/libcap
+-CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS) $(DEBUG)
+ PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+ DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+diff --git a/libcap/Makefile b/libcap/Makefile
+index d189777..b99740f 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -17,6 +17,7 @@ OBJS=$(addsuffix .o, $(FILES))
+ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
++CFLAGS += -fPIC
+
+ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc
+
+@@ -35,7 +36,7 @@ libcap.pc: libcap.pc.in
+ $< >$@
+
+ _makenames: _makenames.c cap_names.list.h
+- $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
++ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+
+ cap_names.h: _makenames
+ ./_makenames > cap_names.h
+@@ -57,10 +58,10 @@ $(MINLIBNAME): $(OBJS)
+ ln -sf $(MAJLIBNAME) $(LIBNAME)
+
+ %.o: %.c $(INCLS)
+- $(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+- $(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+
+ install: all
+ mkdir -p -m 0755 $(FAKEROOT)$(INCDIR)/sys
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index cc32fb6..6f07b6b 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -9,6 +9,8 @@ include ../Make.Rules
+ # written (and you know why it fails), email me and explain why. Thanks!
+ LDLIBS += -L../libcap -lcap
+
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ $(MAKE) testcompile
+
+@@ -17,13 +19,13 @@ install: all
+ install -m 0755 pam_cap.so $(FAKEROOT)$(LIBDIR)/security
+
+ pam_cap.so: pam_cap.o
+- $(LD) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
++ $(LD) $(CFLAGS) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
+
+ pam_cap.o: pam_cap.c
+- $(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+ testcompile: test.c pam_cap.o
+- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
+
+ clean:
+ rm -f *.o *.so testcompile *~
+diff --git a/progs/Makefile b/progs/Makefile
+index c094a24..b9f0d3f 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -19,7 +19,7 @@ $(BUILD): %: %.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
+
+ %.o: %.c $(INCS)
+- $(CC) $(IPATH) $(CFLAGS) -c $< -o $@
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+ install: all
+ mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+--
+2.7.1
+
diff --git a/sys-libs/libcap/files/libcap-2.25-gperf.patch b/sys-libs/libcap/files/libcap-2.25-gperf.patch
new file mode 100644
index 000000000000..86e930f6a446
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.25-gperf.patch
@@ -0,0 +1,20 @@
+update gperf call to work with gperf-3.1
+
+https://bugs.gentoo.org/604802
+
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -44,11 +44,12 @@
+ ./_makenames > cap_names.h
+
+ $(GPERF_OUTPUT): cap_names.list.h
+- (printf "%b" "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; \
++ (printf "%b" "struct __cap_token_s { const char *name; int index; };\n%%\n"; \
+ $(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
+ gperf \
+ --ignore-case \
+ --language=ANSI-C \
++ --includes \
+ --readonly \
+ --null-strings \
+ --global-table \
diff --git a/sys-libs/libcap/files/libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch b/sys-libs/libcap/files/libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch
new file mode 100644
index 000000000000..0f737361a4d1
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch
@@ -0,0 +1,33 @@
+From 8dfcdcfdcb9c462a05566aa8d3c6eca871f0ddbf Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 10 Feb 2016 09:52:45 +0100
+Subject: [PATCH] ignore RAISE_SETFCAP install failures
+
+While the new RAISE_SETFCAP feature is nifty, its failure to run (often
+due to the fs not supporting it) shouldn't impair the default install.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.20 to libcap-2.25
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ progs/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/progs/Makefile b/progs/Makefile
+index c094a24..4a6db38 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -27,7 +27,7 @@ install: all
+ install -m 0755 $$p $(FAKEROOT)$(SBINDIR) ; \
+ done
+ ifeq ($(RAISE_SETFCAP),yes)
+- $(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
++ -$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
+ endif
+
+ clean:
+--
+2.7.1
+
diff --git a/sys-libs/libcap/libcap-2.24-r2.ebuild b/sys-libs/libcap/libcap-2.24-r2.ebuild
new file mode 100644
index 000000000000..5575faa355ce
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.24-r2.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib multilib-minimal toolchain-funcs pam
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="http://www.friedhoff.org/posixfilecaps.html"
+SRC_URI="mirror://kernel/linux/libs/security/linux-privs/libcap2/${P}.tar.xz"
+
+# it's available under either of the licenses
+LICENSE="|| ( GPL-2 BSD )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="pam static-libs"
+
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
+ pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.24-build-system-fixes.patch
+ epatch "${FILESDIR}"/${PN}-2.22-no-perl.patch
+ epatch "${FILESDIR}"/${PN}-2.20-ignore-RAISE_SETFCAP-install-failures.patch
+ epatch "${FILESDIR}"/${PN}-2.21-include.patch
+ epatch "${FILESDIR}"/${PN}-2.24-setcap-errno.patch #551672
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local pam
+ if multilib_is_native_abi && use pam; then
+ pam=yes
+ else
+ pam=no
+ fi
+
+ sed -i \
+ -e "/^PAM_CAP/s:=.*:=${pam}:" \
+ -e '/^DYNAMIC/s:=.*:=yes:' \
+ -e '/^lib_prefix=/s:=.*:=$(prefix):' \
+ -e "/^lib=/s:=.*:=$(get_libdir):" \
+ Make.Rules
+}
+
+multilib_src_compile() {
+ tc-export_build_env BUILD_CC
+ tc-export AR CC RANLIB
+
+ default
+}
+
+multilib_src_install() {
+ # no configure, needs explicit install line #444724#c3
+ emake install DESTDIR="${ED}"
+
+ gen_usr_ldscript -a cap
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/libcap.a
+
+ rm -rf "${ED}"/usr/$(get_libdir)/security
+ if multilib_is_native_abi && use pam; then
+ dopammod pam_cap/pam_cap.so
+ dopamsecurity '' pam_cap/capability.conf
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc CHANGELOG README doc/capability.notes
+}
diff --git a/sys-libs/libcap/libcap-2.25.ebuild b/sys-libs/libcap/libcap-2.25.ebuild
new file mode 100644
index 000000000000..feb60b9a4b62
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.25.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib multilib-minimal toolchain-funcs pam
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="http://www.friedhoff.org/posixfilecaps.html"
+SRC_URI="mirror://kernel/linux/libs/security/linux-privs/libcap2/${P}.tar.xz"
+
+# it's available under either of the licenses
+LICENSE="|| ( GPL-2 BSD )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="pam static-libs"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable. #604802
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
+ pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.25-build-system-fixes.patch
+ "${FILESDIR}"/${PN}-2.22-no-perl.patch
+ "${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
+ "${FILESDIR}"/${PN}-2.21-include.patch
+ "${FILESDIR}"/${PN}-2.25-gperf.patch
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local pam
+ if multilib_is_native_abi && use pam; then
+ pam=yes
+ else
+ pam=no
+ fi
+
+ sed -i \
+ -e "/^PAM_CAP/s:=.*:=${pam}:" \
+ -e '/^DYNAMIC/s:=.*:=yes:' \
+ -e '/^lib_prefix=/s:=.*:=$(prefix):' \
+ -e "/^lib=/s:=.*:=$(get_libdir):" \
+ Make.Rules
+}
+
+multilib_src_compile() {
+ tc-export_build_env BUILD_CC
+ tc-export AR CC RANLIB
+
+ default
+}
+
+multilib_src_install() {
+ # no configure, needs explicit install line #444724#c3
+ emake install DESTDIR="${ED}"
+
+ gen_usr_ldscript -a cap
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/libcap.a
+
+ rm -rf "${ED}"/usr/$(get_libdir)/security
+ if multilib_is_native_abi && use pam; then
+ dopammod pam_cap/pam_cap.so
+ dopamsecurity '' pam_cap/capability.conf
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc CHANGELOG README doc/capability.notes
+}
diff --git a/sys-libs/libcap/metadata.xml b/sys-libs/libcap/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-libs/libcap/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libchipcard/Manifest b/sys-libs/libchipcard/Manifest
new file mode 100644
index 000000000000..5f388b563c3c
--- /dev/null
+++ b/sys-libs/libchipcard/Manifest
@@ -0,0 +1,5 @@
+DIST libchipcard-5.0.2.tar.gz 736107 SHA256 d0968594c8ed0fc4cb6d681a74a5f000b48b0ac7a9375648b57d397ac49c1808 SHA512 82c9100b31086900d3fc66f9b04eb7f365cf09b65959e06dfc7927f2e8328d70d64ad33b40615cc382321dfd50720e721198c0308668a27f1a2db9ce46a292c9 WHIRLPOOL d3ae36e3545b3cd9fc89648178fe2cea7e6441ec6be43837f46d2c16aa3b2908a0ea01cae48ef42559cbf346fd7ee037f3fd26450695283da92e816c5e42d6e5
+EBUILD libchipcard-5.0.2.ebuild 1090 SHA256 1ea535ed51e68feb24473d78a552c2c07139c58e0bce50cb760fa320a1493324 SHA512 a3088ec094ff279e7ef2359f9eee04a7614c437b7df2d715b1cda886d83ec6649674b2d394ea1a1fff8580b07ff7167cb28672fd61af129491fa4faecfdd33dd WHIRLPOOL b951507bdeb65948bf4ae2407c13208501332c1fd891ce752024943b907032132cfcbf5fe863e8d4ec76da74748c9c0eeafd7f6c9704cf020a8888753a282811
+MISC ChangeLog 2238 SHA256 3b8e324a40033c675f836de703c29a48ae1ea7223160646f67dff71240cb0e4c SHA512 96dacfd42ea72f79ec4a0db1ffc221a0357602683c08b6f861f12e6144d16b01ab02fc2a02008fc11967c544386fd50b0ea3cfaa9eecc5c89a060239ae9ea190 WHIRLPOOL f22e753037247b9ee627c6d11811d730fb5e2264e7e1bb00ea13eb18485ab7e73114fa45b9483fa292a2f486e5ed259225b624e9df6a71b846281b818f0f4f24
+MISC ChangeLog-2015 13285 SHA256 01e488fdd8d5c4db4143d098c361e191e85963a4af09de15c420ebef0fa59431 SHA512 a18859443e5a51ee392d476c42d31efd7139ad4fbdca3d47c7747e63ed270ba42d80422675659a0fe5770c728af6a10204a50aeedfd86f08e28aee3f1b653c61 WHIRLPOOL b762478c2ebe11b7c82bbec8950d510a6ecc20eaab08dd670bb333f0a9b3d5495f88b20ef98ee5be35e1a6717fcbb973037a7647a81a6c24229f3426f0bf8318
+MISC metadata.xml 210 SHA256 261430405ac37ae531b59949774ba64133ecc8593015df002402afe0f0f60d7e SHA512 27fbc849a311e57c8dbad0cae9975d564c03ae8a7b495b2e7a5cd160c6a09c0101e695ba4d2edf07c0d4c4d7329ff9a4bd91656aa685623342883b83bcb9ac0f WHIRLPOOL daffaf412be04b8235613f91913fd8a88e1650897a3563641f50de943a4cdee417461a6627acdf7a99a3ff9f5ccf080c0676ae37105f6bfcda3a8200718d1ada
diff --git a/sys-libs/libchipcard/libchipcard-5.0.2.ebuild b/sys-libs/libchipcard/libchipcard-5.0.2.ebuild
new file mode 100644
index 000000000000..5907e46195b3
--- /dev/null
+++ b/sys-libs/libchipcard/libchipcard-5.0.2.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=2
+
+DESCRIPTION="Libchipcard is a library for easy access to chip cards via chip card readers (terminals)"
+HOMEPAGE="http://www.aquamaniac.de/aqbanking/"
+SRC_URI="http://www.aquamaniac.de/sites/download/download.php?package=02&release=26&file=01&dummy=${P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 hppa ppc ~ppc64 ~sparc x86"
+IUSE="doc examples"
+
+RDEPEND=">=sys-libs/gwenhywfar-4.2.1
+ >=sys-apps/pcsc-lite-1.6.2
+ sys-libs/zlib
+ virtual/libintl"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ doc? ( app-doc/doxygen )"
+
+src_configure() {
+ econf \
+ --disable-dependency-tracking \
+ --disable-static \
+ $(use_enable doc full-doc) \
+ --with-docpath=/usr/share/doc/${PF}/apidoc
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ dodoc AUTHORS ChangeLog NEWS README TODO \
+ doc/{CERTIFICATES,CONFIG,IPCCOMMANDS}
+
+ if use examples; then
+ docinto tutorials
+ dodoc tutorials/*.{c,h,xml} tutorials/README
+ fi
+
+ find "${D}" -name '*.la' -exec rm -f {} +
+}
diff --git a/sys-libs/libchipcard/metadata.xml b/sys-libs/libchipcard/metadata.xml
new file mode 100644
index 000000000000..28ef3c7b080f
--- /dev/null
+++ b/sys-libs/libchipcard/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person"><email>hanno@gentoo.org</email></maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest
new file mode 100644
index 000000000000..70d2cbfbb407
--- /dev/null
+++ b/sys-libs/libcxx/Manifest
@@ -0,0 +1,22 @@
+AUX Makefile 874 SHA256 ba99d3b7b98ed88a64f8370ba2d90e245f8e5ea9bfe302382ef8eeded0ec00b4 SHA512 96eef2e897075bc7d9fc799ce6c54f6a33ee917efd5666376ac578cb16e15d965205630dbd076f92a3a7091d58ecc235e37bc327c211bf3594244981f089135f WHIRLPOOL 0680b69fdc46c0d6fac01fc2fa0b93ff62d167a03b3ce1cc80fbe57ff04356f5ab4e71f0daec517e629697d5e34f295b66e8263f7506eaa347a500b27442933d
+AUX libcxx-3.8.1-musl-support.patch 442 SHA256 2f0127c39e96b27e46b4c769cfee3e0e88ed75ac27280275d76275b7dcf2d2bf SHA512 7b2568cbf3afcf2bcd33c3c8db2c24ed75f542081bcb5a7defdc9a4a39a750bbb4106ab7bce09864f146f7710b224802d9e3cc3ced8bb937d0ff6af7a6549e80 WHIRLPOOL f6fbad0ed76fa6118139bd35ce4d0c29cd2c6a02554049af53d353345d4d79be9a76165f05d45ea826f518eda031b06072f20d7896c43033c23ae21006ece930
+AUX libcxx-3.9-cmake-link-flags.patch 1014 SHA256 2a67d309f5aa802a8cb3d7fe76dff0a9c797e88a63f43fda758f9626afc8d4d0 SHA512 5df85c66bf865900197effe3905976bf165b4c4d79b8d14352753f6baca93ab5dc26bf735fd9478a0c13df489b860d8b629240134b7e26be6233138ea95dbab3 WHIRLPOOL b99590b6a0e1f4c0738d6bf95b4b379685a5ca5a32370938928656481234e22cf1acc788075a6af331406a70c8d8b0f81111ad392454df72ef58181d07d76d56
+AUX libcxx-3.9-cmake-static-lib.patch 7507 SHA256 f4c829b4eb930949571323b13ab67c4e9764d8dbfb245d1318f1cf30627d101e SHA512 435c14edfb7bca9ef35fa1e9e44ab9655d5b47e373e6437839027b6d56894a37dfb0f228cce062d84aaaf60677d9435b2cdee2c9248b4f25cf3f6890ec353f46 WHIRLPOOL 0ae4d12869d233fa549fd65f673729d60f1e34d400e7b02cb433b61ae5ff03efbdc321aa33314fe56caa3d78275e2f629eb6d47db5237f0e234b50161a29d423
+AUX prepare_snapshot.sh 427 SHA256 9ebf22257a2e296dee41a56b0a721cd1ba459c620009ca8422ba812515ff726f SHA512 ebac2a467f8b1dfb68f1dc46a35f8294d1cf74b70be2a008217fa13b3366ddf4a9f2ebbe611cd63824f42305c5c0304aac2f46386b2956c9e07d82d5d984b435 WHIRLPOOL 232a60d6a22f50c424ec9cf6f325bbb4e8e96815ba9dffdad0a5b1b872b19d20126d316ced71956978eb5ce098f72584d21104c14e232330b3893a73e4c3c358
+DIST libcxx-3.7.1.src.tar.xz 995724 SHA256 357fbd4288ce99733ba06ae2bec6f503413d258aeebaab8b6a791201e6f7f144 SHA512 08d2399a8b36aa15290733256c896c9fa43f1a1223bc5c73bbcd014fddf8880e514d2a6dcc456bcf18b537c01fb6911b092e6d9958bccd8e64e9f375ed7a1ab9 WHIRLPOOL 19f77946abf48cbdd3e7ea21fd009ca3cc5f607dfe0512a44b102847044bb1d5ae4b16f503f18b14ebd9ea115256e87af07409907ba2a65f6061e217a502a359
+DIST libcxx-3.8.1.src.tar.xz 1074164 SHA256 77d7f3784c88096d785bd705fa1bab7031ce184cd91ba8a7008abf55264eeecc SHA512 782ff3cdb85d02e92404e943474d0266ff601725c202f0667d60e7807f1ba3cfdebbdb062e27a52fec96be1c99339044be93a88ba7e396682f98d99c9ac175b2 WHIRLPOOL a729c44060972edee79b0019fd4c6c23fa56dd625e564f4c5965682d9fc79be4094df0643f67c5d2ffa3ae3c743c892c3c9ba19719b2307aada35775f64ed104
+DIST libcxx-3.9.0.src.tar.xz 1198308 SHA256 d0b38d51365c6322f5666a2a8105785f2e114430858de4c25a86b49f227f5b06 SHA512 55d5c4adff378ee02b0b99d732bc9f326910f9e49ab8c320a588eccdd0362fe009bc9a6a4337d29faf6338420c91b10d0d7d67f66128268f01258d30502c4f4a WHIRLPOOL 3ee3519acfe95287a862a6c44e30ed52ced1204332913007797da4e4da40dfdc5991ae120f5686827cc208b559936da5bc5485dab75617bdd5cbbd9e95a6032a
+DIST libcxx-3.9.1.src.tar.xz 1209020 SHA256 25e615e428f60e651ed09ffd79e563864e3f4bc69a9e93ee41505c419d1a7461 SHA512 a5976e4096624a7307b3e43f4a22ac2dc74572226e0f57af9f3ef537a14c3cff1601b7042aef9dc40a0ee53ca76b08d72eb9c253dcf34f115d3153c302db7070 WHIRLPOOL cad439979570192b195338d752a24fb0ad8704c0c8efed3b6d7724437763eab7bc3b8baaf2f0e6fff55c6d9be211dff6f7baf18dec55e3a29ad3b8a423cefb1e
+DIST libcxx-4.0.1.src.tar.xz 1446380 SHA256 520a1171f272c9ff82f324d5d89accadcec9bc9f3c78de11f5575cdb99accc4c SHA512 91f3f397be606989be99865d0b279557f9afb93f7a74ed10c3a74f4440e38b5694ddf452bbf2f487cacd4391606dd5c7edfe5130f2de19e2acfd6cce619d028a WHIRLPOOL fe7c71e8dc2d17d14e94896837229c5ed872e7c04aea79a207e8fa98aa4539a7445e402b848d0c0d009f154f00d970159ad009d16bfdb9ae012ce5c7c6d9ba51
+DIST libcxx-5.0.0.src.tar.xz 1518940 SHA256 eae5981e9a21ef0decfcac80a1af584ddb064a32805f95a57c7c83a5eb28c9b1 SHA512 210749f6585d8fd39fc63a32dd85d68de4aa480c91915cbf419b9e8a3b300fa4624f03200ed963cecc8ab233777c36e8c522fa0762a2aa068bc65e6f48118328 WHIRLPOOL c791f6718e1c2a97fae26741284d861fc869721fca11b4ab4d3e9b4052ce17fca1fd99f945f406fdcdbfde43622cb7afe351e0268d773f6b42d1da2f5dc0f1f5
+EBUILD libcxx-3.7.1.ebuild 5341 SHA256 b650e8a4dd09153792c9301f941b970e6611fe04403781f4ca54a4d185036eb2 SHA512 12d94732f3446447a0ed025dd7df4ec7711c3d3278c98c2922c85c6b78afe369bcbebee65e259825b4008417decfa4f6438ed803a8e271418b061864ee5de9c0 WHIRLPOOL e27f65ef8dc68e16ba1837b563617a6960dfeab015e64c8e25761003938498dfd7c1577cfa7ac1427ed03a9e24bb5b45ae591d1f226c7ce0bc21a6fe927a74e1
+EBUILD libcxx-3.8.1.ebuild 5720 SHA256 9081a591d0c48fa9ed45866234fdc59f55e44c8ca9056713c2014adf266ea832 SHA512 f674c2647756a1157bdaaa0dfb2ceb923830369d473f4d20bc896f94a3b4aaa5c6e8500b3449ec5e8b7c9b54a74a0002706848f60355a688c5c25425d0a3d1c4 WHIRLPOOL 9b0d7b452c22faf58dec629b0e18ce9013958bdfca2e7455422515988bf4c61cf131e4031e0a7927441f4bc5ad5c3a103d3379f4a583a69628791460d09f78c8
+EBUILD libcxx-3.9.0.ebuild 6794 SHA256 e1b0ed6b0bf8d124110c6c3731cbb31e37a00d4428b50cdd477c92b617a4ad93 SHA512 326cbb999424e5fca216a57b90b850c0d98d43bd93835525aed06fc6fc9354d35cfd51fb1d08683fa06da595dbb4719bf3d90dc67dd5b881b6242f964aba0438 WHIRLPOOL 06afc5984856bcc76e3d1baf47563eaa5fea7af464617620628bf8a6cabd32b84ada983346cca3d132e9a8dc61d533a9f99e30d1f06141566329170db48627b2
+EBUILD libcxx-3.9.1.ebuild 6815 SHA256 15bfb6ec3bdb0fd47a04182a276ed89f4b2acfbad24c2a62c4bcca5190a54283 SHA512 9c9632590b49cd01ad324641ee296f08442940ab1dda1f0c7cdc77abe6b653f70d0baa9b796ef7d77e1f4728e96fe27fcd42d79a389cfcf2b2427b087b9985af WHIRLPOOL 6fff12c49a78e456411cdc6a73b23055f8fc72c154d9a7e5cbf7ad1d5dde21be6b9e2e9e634f2b64377e0045b79370001beb1fba50d21748c6259fffe8cbb7cb
+EBUILD libcxx-4.0.1.ebuild 6303 SHA256 0d1f9bef569a478c14363ef05adb1c87739fd8d21574ba7efbcd1f328cc78eb9 SHA512 72a1d367d03be76b8cc43ea3653563be2c86376c796b759fc99feff4e7489a86875548fffe89ab87b26885a94028a1131a5f295c5e5ec5270dea80f2a6e189aa WHIRLPOOL e3a3549175db909eb606a3dde9581ec52999be593fac27a0b57adb7b493e8ec6a215d7fdfaad3371ca33f4eaac5bd617040f083cc1123fd7737f122d22bca639
+EBUILD libcxx-5.0.0.ebuild 6303 SHA256 0d1f9bef569a478c14363ef05adb1c87739fd8d21574ba7efbcd1f328cc78eb9 SHA512 72a1d367d03be76b8cc43ea3653563be2c86376c796b759fc99feff4e7489a86875548fffe89ab87b26885a94028a1131a5f295c5e5ec5270dea80f2a6e189aa WHIRLPOOL e3a3549175db909eb606a3dde9581ec52999be593fac27a0b57adb7b493e8ec6a215d7fdfaad3371ca33f4eaac5bd617040f083cc1123fd7737f122d22bca639
+EBUILD libcxx-5.0.9999.ebuild 6614 SHA256 7207175d2df08f2bfaf8a451587e1e28faa1cfe3712051171ae9ddad7ec48809 SHA512 b15a6eb21ea58907beed4603cab1088ee9b53adece3a8fded74c50763afe5b565d2cd7ac80b4b5326829a9e32fdf728ddb99c17f5bd3a9a691689a56c8203522 WHIRLPOOL 02caaa85e3c678f6e007ca80ee522d87699bc97cb2eeaa85e09a22d4c26bb3f2a05565afc70ac5aee43a81fe28cf12622ff7e0e7936d96a1a409474664b3cef4
+EBUILD libcxx-9999.ebuild 6458 SHA256 30884b27dd5880833b6efbab08317d43df9b8c09ed264f9c1c52c4cec39a83e7 SHA512 7f73a4a5c868c67e2c479740e6c98f53fea359956fd3758d8f4270a0107158354a4c703810976c65e5d943c46394870f965ffa3d0f930e694d037f400859f36f WHIRLPOOL 27c87c8bd41b9d0fdf97e5ba86a8bb7cf9d9d745e5f8cb39e81e1d22b44760edce245e2c3e1e466dc7a8f257c0c790c4da8ef836cdc4f946860ab7ec587f8191
+MISC ChangeLog 6417 SHA256 9fd5bef2d8c2ac1bae01f2d67f9dfe3a555ef2dd4effa763119a35959d700a83 SHA512 2b377fe2f4c992d75e0442a50cd88647140743dc7b8551e59fc24ad987ceb033cd23c29d832afacb78125497900ed7d9da6c027e58d33acd5da5d0ab026d11f8 WHIRLPOOL 380c99e461793281a68a198d5181bb3c33616a81236aff51da07afc87cadb96459bb94ce1dac9cde87af4517d684de540eb1ce9ce56aec174a95926f185d5cc6
+MISC ChangeLog-2015 7192 SHA256 1f19c485028b68143e12fe8fb77250e7b0cee933dba3390418d398e02ff7bf86 SHA512 648d68c5b8f759170eb6011afc1ef01797f5549068fbc733d6d8e0330a3a08afdadbb3256db04df624ba7e4539eff4489a262fdcc5f00bf67d146dd4c5513755 WHIRLPOOL 73fbaabbb064852de27ad52ee2558764aa9cd5c08e185b397ff92b2435eefcb32bf14caab3c0334c95655ed6e50f414836b2beec10e492ae37813f7e2eca273c
+MISC metadata.xml 854 SHA256 3ec547619ec9246a8013afa8185cc2ec300c77ea5f7794627765fa54e5b8f621 SHA512 8ef3feab266e09442a42baced2d72667fa8b1290624c2c84bab7b173ead72669568847f6e995388fc1d7bc722381f60805d87b2a0cc2d04ae0c49e36bec3802a WHIRLPOOL 3ef9e4095a710085257d418bbb2ad7f10bfe026d65f1684fb75a36418ccd3c314521cb24ec7afd552551a114edc958aa7d3cafab5e8b38975f697767c6adb355
diff --git a/sys-libs/libcxx/files/Makefile b/sys-libs/libcxx/files/Makefile
new file mode 100644
index 000000000000..029e7295b889
--- /dev/null
+++ b/sys-libs/libcxx/files/Makefile
@@ -0,0 +1,38 @@
+CXXFLAGS+=-std=c++11 -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
+ -Wpadded -Wstrict-aliasing=2 -Wstrict-overflow=4
+
+SRCDIR=..
+LIB=libc++
+STATIC=libc++.a
+MAJOR=1
+MINOR=0
+SHEXT?=.so
+SHLIB=$(LIB)$(SHEXT).$(MAJOR).$(MINOR)
+SONAME=$(LIB)$(SHEXT).$(MAJOR)
+
+SRC=$(wildcard $(SRCDIR)/src/*.cpp)
+OBJ=$(SRC:$(SRCDIR)/src/%.cpp=%.o)
+SOBJ=$(SRC:$(SRCDIR)/src/%.cpp=%.So)
+
+
+%.So: $(SRCDIR)/src/%.cpp
+ $(CXX) -I$(SRCDIR)/include $(CPPFLAGS) $(CXXFLAGS) -fPIC -nostdinc++ -c $< -o $@
+
+%.o: $(SRCDIR)/src/%.cpp
+ $(CXX) -I$(SRCDIR)/include $(CPPFLAGS) $(CXXFLAGS) -nostdinc++ -c $< -o $@
+
+$(STATIC): $(OBJ)
+ $(AR) cr $@ $^
+
+static: $(STATIC)
+
+$(SHLIB): $(SOBJ)
+ $(CXX) -fPIC -nodefaultlibs $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ $(LIBS)
+
+$(SONAME): $(SHLIB)
+ ln -s $< $@
+
+$(LIB)$(SHEXT): $(SONAME)
+ ln -s $< $@
+
+shared: $(SHLIB) $(SONAME) $(LIB)$(SHEXT)
diff --git a/sys-libs/libcxx/files/libcxx-3.8.1-musl-support.patch b/sys-libs/libcxx/files/libcxx-3.8.1-musl-support.patch
new file mode 100644
index 000000000000..ef86254dff17
--- /dev/null
+++ b/sys-libs/libcxx/files/libcxx-3.8.1-musl-support.patch
@@ -0,0 +1,15 @@
+diff --git a/include/__config b/include/__config
+index db5a832..f463557 100644
+--- a/include/__config
++++ b/include/__config
+@@ -11,6 +11,10 @@
+ #ifndef _LIBCPP_CONFIG
+ #define _LIBCPP_CONFIG
+
++// Normally this definition is handled by cmake; but since we're not using
++// cmake, we have to hardcode it here.
++#define _LIBCPP_HAS_MUSL_LIBC
++
+ #if defined(_MSC_VER) && !defined(__clang__)
+ #define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+ #endif
diff --git a/sys-libs/libcxx/files/libcxx-3.9-cmake-link-flags.patch b/sys-libs/libcxx/files/libcxx-3.9-cmake-link-flags.patch
new file mode 100644
index 000000000000..bef5bc187547
--- /dev/null
+++ b/sys-libs/libcxx/files/libcxx-3.9-cmake-link-flags.patch
@@ -0,0 +1,23 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d618e83..0e76525 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -293,6 +293,18 @@ remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
+ # so they don't get transformed into -Wno and -errors respectivly.
+ remove_flags(-Wno-pedantic -pedantic-errors -pedantic)
+
++# FIXME: this is cribbed from HandleLLVMOptions.cmake.
++if(LIBCXX_STANDALONE_BUILD)
++ # Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO
++ # build might work on ELF but fail on MachO/COFF.
++ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR CYGWIN OR
++ ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
++ ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") AND
++ NOT LLVM_USE_SANITIZER)
++ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
++ endif()
++endif()
++
+ # Required flags ==============================================================
+ add_compile_flags_if_supported(-std=c++11)
+ if (NOT MSVC AND NOT LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG)
diff --git a/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch b/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch
new file mode 100644
index 000000000000..5f0e31864dfd
--- /dev/null
+++ b/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch
@@ -0,0 +1,196 @@
+From b640da0b315ead39690d4d65c76938ab8aeb5449 Mon Sep 17 00:00:00 2001
+From: Petr Hosek <phosek@chromium.org>
+Date: Mon, 8 Aug 2016 22:57:25 +0000
+Subject: [PATCH] Allow building both shared and static library
+
+This change allows building both shared and static version of libc++
+in a single build, sharing object files between both versions.
+
+Differential Revision: https://reviews.llvm.org/D23232
+
+git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278068 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ CMakeLists.txt | 5 ++++
+ docs/BuildingLibcxx.rst | 11 ++++++--
+ lib/CMakeLists.txt | 71 ++++++++++++++++++++++++++++++++++---------------
+ 3 files changed, 63 insertions(+), 24 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 950070d..98886b0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -52,6 +52,7 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
+ # Basic options ---------------------------------------------------------------
+ option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
+ option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
++option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
+ option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
+ option(LIBCXX_ENABLE_FILESYSTEM
+ "Build filesystem as part of libc++experimental.a" ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY})
+@@ -68,6 +69,10 @@ option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY "Install libc++experimental.a" OFF)
+ set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.")
+ option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
+
++if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC)
++ message(FATAL_ERROR "libc++ must be built as either a shared or static library.")
++endif()
++
+ # ABI Library options ---------------------------------------------------------
+ set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
+ "Specify C++ ABI library to use." FORCE)
+diff --git a/docs/BuildingLibcxx.rst b/docs/BuildingLibcxx.rst
+index 5dd174a..6709352 100644
+--- a/docs/BuildingLibcxx.rst
++++ b/docs/BuildingLibcxx.rst
+@@ -150,8 +150,15 @@ libc++ specific options
+
+ **Default**: ``ON``
+
+- Build libc++ as a shared library. If ``OFF`` is specified then libc++ is
+- built as a static library.
++ Build libc++ as a shared library. Either :option:`LIBCXX_ENABLE_SHARED` or
++ :option:`LIBCXX_ENABLE_STATIC` has to be enabled.
++
++.. option:: LIBCXX_ENABLE_STATIC:BOOL
++
++ **Default**: ``ON``
++
++ Build libc++ as a static library. Either :option:`LIBCXX_ENABLE_SHARED` or
++ :option:`LIBCXX_ENABLE_STATIC` has to be enabled.
+
+ .. option:: LIBCXX_LIBDIR_SUFFIX:STRING
+
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index afc388e..cabf2e6 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -28,16 +28,6 @@ if(NOT LIBCXX_INSTALL_LIBRARY)
+ set(exclude_from_all EXCLUDE_FROM_ALL)
+ endif()
+
+-if (LIBCXX_ENABLE_SHARED)
+- add_library(cxx SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
+-else()
+- add_library(cxx STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
+-endif()
+-
+-if (DEFINED LIBCXX_CXX_ABI_DEPS)
+- add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
+-endif()
+-
+ #if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.
+ add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
+
+@@ -139,18 +129,51 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
+ endif()
+ endif()
+
+-target_link_libraries(cxx ${LIBCXX_LIBRARIES})
+ split_list(LIBCXX_COMPILE_FLAGS)
+ split_list(LIBCXX_LINK_FLAGS)
+
+-set_target_properties(cxx
++# Add a object library that contains the compiled source files.
++add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
++
++set_target_properties(cxx_objects
+ PROPERTIES
+ COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
+- LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+- OUTPUT_NAME "c++"
+- VERSION "${LIBCXX_ABI_VERSION}.0"
+- SOVERSION "${LIBCXX_ABI_VERSION}"
++)
++
++set(LIBCXX_TARGETS)
++
++# Build the shared library.
++if (LIBCXX_ENABLE_SHARED)
++ add_library(cxx_shared SHARED $<TARGET_OBJECTS:cxx_objects>)
++ target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
++ set_target_properties(cxx_shared
++ PROPERTIES
++ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
++ OUTPUT_NAME "c++"
++ VERSION "${LIBCXX_ABI_VERSION}.0"
++ SOVERSION "${LIBCXX_ABI_VERSION}"
+ )
++ list(APPEND LIBCXX_TARGETS "cxx_shared")
++endif()
++
++# Build the static library.
++if (LIBCXX_ENABLE_STATIC)
++ add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>)
++ target_link_libraries(cxx_static ${LIBCXX_LIBRARIES})
++ set_target_properties(cxx_static
++ PROPERTIES
++ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
++ OUTPUT_NAME "c++"
++ )
++ list(APPEND LIBCXX_TARGETS "cxx_static")
++endif()
++
++# Add a meta-target for both libraries.
++add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS})
++
++if (DEFINED LIBCXX_CXX_ABI_DEPS)
++ add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
++endif()
+
+ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+ file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)
+@@ -158,7 +181,11 @@ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+ file(GLOB LIBCXX_FILESYSTEM_SOURCES ../src/experimental/filesystem/*.cpp)
+ endif()
+ add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES} ${LIBCXX_FILESYSTEM_SOURCES})
+- target_link_libraries(cxx_experimental cxx)
++ if (LIBCXX_ENABLE_SHARED)
++ target_link_libraries(cxx_experimental cxx_shared)
++ else()
++ target_link_libraries(cxx_experimental cxx_static)
++ endif()
+
+ set(experimental_flags "${LIBCXX_COMPILE_FLAGS}")
+ check_flag_supported(-std=c++14)
+@@ -174,7 +201,7 @@ endif()
+
+ # Generate a linker script inplace of a libc++.so symlink. Rerun this command
+ # after cxx builds.
+-if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
++if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ # Get the name of the ABI library and handle the case where CXXABI_LIBNAME
+ # is a target name and not a library. Ex cxxabi_shared.
+ set(SCRIPT_ABI_LIBNAME "${LIBCXX_CXX_ABI_LIBRARY}")
+@@ -183,11 +210,11 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ endif()
+ # Generate a linker script inplace of a libc++.so symlink. Rerun this command
+ # after cxx builds.
+- add_custom_command(TARGET cxx POST_BUILD
++ add_custom_command(TARGET cxx_shared POST_BUILD
+ COMMAND
+ ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
+ ARGS
+- "$<TARGET_LINKER_FILE:cxx>"
++ "$<TARGET_LINKER_FILE:cxx_shared>"
+ "${SCRIPT_ABI_LIBNAME}"
+ WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
+ )
+@@ -197,13 +224,13 @@ if (LIBCXX_INSTALL_LIBRARY)
+ if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+ set(experimental_lib cxx_experimental)
+ endif()
+- install(TARGETS cxx ${experimental_lib}
++ install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
+ LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
+ ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
+ )
+ # NOTE: This install command must go after the cxx install command otherwise
+ # it will not be executed after the library symlinks are installed.
+- if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
++ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ # Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
+ # after we required CMake 3.0.
+ install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
+--
+2.4.10
+
diff --git a/sys-libs/libcxx/files/prepare_snapshot.sh b/sys-libs/libcxx/files/prepare_snapshot.sh
new file mode 100755
index 000000000000..3de5a97a8096
--- /dev/null
+++ b/sys-libs/libcxx/files/prepare_snapshot.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+VERSION=$(date +%Y%m%d)
+BASE_VERSION="0.0"
+PACKAGE="libcxx-${BASE_VERSION}_p${VERSION}"
+
+svn co http://llvm.org/svn/llvm-project/libcxx/trunk ${PACKAGE}
+
+find "${PACKAGE}" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
+find "${PACKAGE}" -type d -name '.git' -prune -print0 | xargs -0 rm -rf
+
+tar cJf ${PACKAGE}.tar.xz ${PACKAGE}
+rm -rf ${PACKAGE}/
+
+echo "Tarball: \"${PACKAGE}.tar.xz\""
+
+echo "** all done **"
diff --git a/sys-libs/libcxx/libcxx-3.7.1.ebuild b/sys-libs/libcxx/libcxx-3.7.1.ebuild
new file mode 100644
index 000000000000..3535d3d94043
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-3.7.1.ebuild
@@ -0,0 +1,169 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ESVN_REPO_URI="https://llvm.org/svn/llvm-project/libcxx/trunk"
+
+[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM=""
+
+inherit ${SCM} flag-o-matic toolchain-funcs multilib multilib-minimal
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="https://libcxx.llvm.org/"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
+ S="${WORKDIR}/${P}.src"
+else
+ SRC_URI=""
+fi
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ KEYWORDS="~amd64 ~mips ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="elibc_glibc +libcxxrt +static-libs test"
+
+RDEPEND="libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130725[static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] )"
+DEPEND="${RDEPEND}
+ test? ( sys-devel/clang )
+ app-arch/xz-utils"
+
+DOCS=( CREDITS.TXT )
+
+pkg_setup() {
+ if ! use libcxxrt ; then
+ ewarn "You have disabled USE=libcxxrt. This will build ${PN} against"
+ ewarn "libsupc++. Please note that this is not well supported."
+ ewarn "In particular, static linking will not work."
+ fi
+ if [[ $(gcc-version) < 4.7 ]] && [[ $(tc-getCXX) != *clang++* ]] ; then
+ eerror "${PN} needs to be built with clang++ or gcc-4.7 or later."
+ eerror "Please use gcc-config to switch to gcc-4.7 or later version."
+ die
+ fi
+}
+
+src_prepare() {
+ cp -f "${FILESDIR}/Makefile" lib/ || die
+ multilib_copy_sources
+}
+
+src_configure() {
+ export LIBS="-lpthread -lrt -lc -lgcc_s"
+ if use libcxxrt ; then
+ append-cppflags -DLIBCXXRT "-I${EPREFIX}/usr/include/libcxxrt/"
+ LIBS="-lcxxrt ${LIBS}"
+ cp "${EPREFIX}/usr/include/libcxxrt/"*.h "${S}/include"
+ else
+ # Very hackish, see $HOMEPAGE
+ # If someone has a clever idea, please share it!
+ local includes="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | sed -e 's/^ /-I/' | tr '\n' ' ')"
+ local libcxx_gcc_dirs="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | tr '\n' ' ')"
+ append-cppflags -D__GLIBCXX__ ${includes}
+ LIBS="-lsupc++ ${LIBS}"
+ local libsupcxx_includes="cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h bits/cxxabi_tweaks.h bits/cxxabi_forced.h"
+ for i in ${libsupcxx_includes} ; do
+ local found=""
+ [ -d "${S}/include/$(dirname ${i})/" ] || mkdir -p "${S}/include/$(dirname ${i})"
+ for j in ${libcxx_gcc_dirs} ; do
+ if [ -f "${j}/${i}" ] ; then
+ cp "${j}/${i}" "${S}/include/$(dirname ${i})/" || die
+ found=yes
+ fi
+ done
+ [ -n "${found}" ] || die "Header not found: ${i}"
+ done
+ fi
+
+ tc-export AR CC CXX
+
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
+}
+
+multilib_src_compile() {
+ cd "${BUILD_DIR}/lib" || die
+ emake shared
+ use static-libs && emake static
+}
+
+# Tests fail for now, if anybody is able to fix them, help is very welcome.
+multilib_src_test() {
+ cd "${BUILD_DIR}/test"
+ LD_LIBRARY_PATH="${BUILD_DIR}/lib:${LD_LIBRARY_PATH}" \
+ CC="clang++ $(get_abi_CFLAGS) ${CXXFLAGS}" \
+ HEADER_INCLUDE="-I${BUILD_DIR}/include" \
+ SOURCE_LIB="-L${BUILD_DIR}/lib" \
+ LIBS="-lm $(usex libcxxrt -lcxxrt "")" \
+ ./testit || die
+ # TODO: fix link against libsupc++
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ if use libcxxrt ; then
+ # Move it first.
+ mv "${ED}/usr/$(get_libdir)/libc++.a" "${ED}/usr/$(get_libdir)/libc++_static.a" || die
+
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="${EPREFIX}/usr/$(get_libdir)/libc++_static.a ${EPREFIX}/usr/$(get_libdir)/libcxxrt.a"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libpthread.a ${EPREFIX}/usr/$(get_libdir)/libdl.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.a"
+ fi
+ # TODO: Generate a libc++.a ldscript when building against libsupc++
+}
+
+gen_shared_ldscript() {
+ if use libcxxrt ; then
+ mv "${ED}/usr/$(get_libdir)/libc++.so" "${ED}/usr/$(get_libdir)/libc++_shared.so" || die
+ local deps="${EPREFIX}/usr/$(get_libdir)/libc++_shared.so ${EPREFIX}/usr/$(get_libdir)/libcxxrt.so"
+ gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.so"
+ fi
+ # TODO: Generate the linker script for other confiurations too.
+}
+
+multilib_src_install() {
+ cd "${BUILD_DIR}/lib"
+ if use static-libs ; then
+ dolib.a libc++.a
+ gen_static_ldscript
+ fi
+ dolib.so libc++.so*
+ gen_shared_ldscript
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ insinto /usr/include/c++/v1
+ doins -r include/*
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
diff --git a/sys-libs/libcxx/libcxx-3.8.1.ebuild b/sys-libs/libcxx/libcxx-3.8.1.ebuild
new file mode 100644
index 000000000000..33c990ecd408
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-3.8.1.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ESVN_REPO_URI="https://llvm.org/svn/llvm-project/libcxx/trunk"
+
+[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM=""
+
+inherit ${SCM} flag-o-matic toolchain-funcs multilib multilib-minimal
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="https://libcxx.llvm.org/"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
+ S="${WORKDIR}/${P}.src"
+else
+ SRC_URI=""
+fi
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ KEYWORDS="~amd64 ~mips ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="elibc_glibc elibc_musl +libcxxrt libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( libcxxrt )"
+
+RDEPEND="libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130725[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] )"
+DEPEND="${RDEPEND}
+ test? ( sys-devel/clang )
+ app-arch/xz-utils"
+
+DOCS=( CREDITS.TXT )
+
+pkg_setup() {
+ if ! use libcxxrt ; then
+ ewarn "You have disabled USE=libcxxrt. This will build ${PN} against"
+ ewarn "libsupc++. Please note that this is not well supported."
+ ewarn "In particular, static linking will not work."
+ fi
+ if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later (or other"
+ eerror "conformant compilers). Please use gcc-config to switch to"
+ eerror "gcc-4.7 or later version."
+ die
+ fi
+}
+
+src_prepare() {
+ cp -f "${FILESDIR}/Makefile" lib/ || die
+ use elibc_musl && epatch "${FILESDIR}/${P}-musl-support.patch"
+ multilib_copy_sources
+}
+
+src_configure() {
+ export LIBS="-lpthread -lrt -lc -l$(usex libunwind unwind gcc_s)"
+ if use libcxxrt ; then
+ append-cppflags -DLIBCXXRT "-I${EPREFIX}/usr/include/libcxxrt/"
+ LIBS="-lcxxrt ${LIBS}"
+ cp "${EPREFIX}/usr/include/libcxxrt/"*.h "${S}/include"
+ else
+ # Very hackish, see $HOMEPAGE
+ # If someone has a clever idea, please share it!
+ local includes="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | sed -e 's/^ /-I/' | tr '\n' ' ')"
+ local libcxx_gcc_dirs="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | tr '\n' ' ')"
+ append-cppflags -D__GLIBCXX__ ${includes}
+ LIBS="-lsupc++ ${LIBS}"
+ local libsupcxx_includes="cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h bits/cxxabi_tweaks.h bits/cxxabi_forced.h"
+ for i in ${libsupcxx_includes} ; do
+ local found=""
+ [ -d "${S}/include/$(dirname ${i})/" ] || mkdir -p "${S}/include/$(dirname ${i})"
+ for j in ${libcxx_gcc_dirs} ; do
+ if [ -f "${j}/${i}" ] ; then
+ cp "${j}/${i}" "${S}/include/$(dirname ${i})/" || die
+ found=yes
+ fi
+ done
+ [ -n "${found}" ] || die "Header not found: ${i}"
+ done
+ fi
+
+ tc-export AR CC CXX
+
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
+}
+
+multilib_src_compile() {
+ cd "${BUILD_DIR}/lib" || die
+ emake shared
+ use static-libs && emake static
+}
+
+# Tests fail for now, if anybody is able to fix them, help is very welcome.
+multilib_src_test() {
+ cd "${BUILD_DIR}/test"
+ LD_LIBRARY_PATH="${BUILD_DIR}/lib:${LD_LIBRARY_PATH}" \
+ CC="clang++ $(get_abi_CFLAGS) ${CXXFLAGS}" \
+ HEADER_INCLUDE="-I${BUILD_DIR}/include" \
+ SOURCE_LIB="-L${BUILD_DIR}/lib" \
+ LIBS="-lm $(usex libcxxrt -lcxxrt "")" \
+ ./testit || die
+ # TODO: fix link against libsupc++
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ if use libcxxrt ; then
+ # Move it first.
+ mv "${ED}/usr/$(get_libdir)/libc++.a" "${ED}/usr/$(get_libdir)/libc++_static.a" || die
+
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="${EPREFIX}/usr/$(get_libdir)/libc++_static.a ${EPREFIX}/usr/$(get_libdir)/libcxxrt.a"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libpthread.a ${EPREFIX}/usr/$(get_libdir)/libdl.a"
+
+ # unlike libgcc_s, libunwind is not implicitly linked
+ use libunwind && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libunwind.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.a"
+ fi
+ # TODO: Generate a libc++.a ldscript when building against libsupc++
+}
+
+gen_shared_ldscript() {
+ if use libcxxrt ; then
+ mv "${ED}/usr/$(get_libdir)/libc++.so" "${ED}/usr/$(get_libdir)/libc++_shared.so" || die
+ local deps="${EPREFIX}/usr/$(get_libdir)/libc++_shared.so ${EPREFIX}/usr/$(get_libdir)/libcxxrt.so"
+ use libunwind && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libunwind.so"
+ gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.so"
+ fi
+ # TODO: Generate the linker script for other configurations too.
+}
+
+multilib_src_install() {
+ cd "${BUILD_DIR}/lib"
+ if use static-libs ; then
+ dolib.a libc++.a
+ gen_static_ldscript
+ fi
+ dolib.so libc++.so*
+ gen_shared_ldscript
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ insinto /usr/include/c++/v1
+ doins -r include/*
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
diff --git a/sys-libs/libcxx/libcxx-3.9.0.ebuild b/sys-libs/libcxx/libcxx-3.9.0.ebuild
new file mode 100644
index 000000000000..185bbc3d7be0
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-3.9.0.ebuild
@@ -0,0 +1,216 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# Ninja provides better scalability and cleaner verbose output, and is used
+# throughout all LLVM projects.
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+EGIT_REPO_URI="https://llvm.org/git/libcxx.git
+ https://github.com/llvm-mirror/libcxx.git"
+PYTHON_COMPAT=( python2_7 )
+
+[[ ${PV} == 9999 ]] && SCM="git-r3" || SCM=""
+
+inherit ${SCM} cmake-multilib python-any-r1 toolchain-funcs
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="https://libcxx.llvm.org/"
+if [[ ${PV} != 9999 ]] ; then
+ SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
+ S="${WORKDIR}/${P}.src"
+else
+ SRC_URI=""
+fi
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+if [[ ${PV} != 9999 ]] ; then
+ KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="elibc_glibc elibc_musl libcxxabi +libcxxrt libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
+ ?? ( libcxxabi libcxxrt )"
+
+RDEPEND="
+ libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
+# llvm-3.9.0 needed because its cmake files installation path changed, which is
+# needed by libcxx
+# clang-3.9.0 installs necessary target symlinks unconditionally
+# which removes the need for MULTILIB_USEDEP
+DEPEND="${RDEPEND}
+ test? ( >=sys-devel/clang-3.9.0
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
+ app-arch/xz-utils
+ >=sys-devel/llvm-3.9.0"
+
+DOCS=( CREDITS.TXT )
+
+PATCHES=(
+ # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+ # out-of-tree build.
+ "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+
+ # Back-port of https://reviews.llvm.org/D23232, allowing building both
+ # shared and static libs in one run.
+ "${FILESDIR}/${PN}-3.9-cmake-static-lib.patch"
+)
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+
+ if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
+ eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
+ eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
+ eerror "and try again."
+ die
+ fi
+ if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later (or other"
+ eerror "conformant compilers). Please use gcc-config to switch to"
+ eerror "gcc-4.7 or later version."
+ die
+ fi
+}
+
+src_configure() {
+ NATIVE_LIBDIR=$(get_libdir)
+ cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+ local cxxabi cxxabi_incs
+ if use libcxxabi; then
+ cxxabi=libcxxabi
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
+ elif use libcxxrt; then
+ cxxabi=libcxxrt
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
+ else
+ local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
+ cxxabi=libsupc++
+ cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
+ fi
+
+ # we want -lgcc_s for unwinder, and for compiler runtime when using
+ # gcc, clang with gcc runtime (or any unknown compiler)
+ local extra_libs=() want_gcc_s=ON
+ if use libunwind; then
+ # work-around missing -lunwind upstream
+ extra_libs+=( -lunwind )
+ # if we're using libunwind and clang with compiler-rt, we want
+ # to link to compiler-rt instead of -lgcc_s
+ if tc-is-clang; then
+ # get the full library list out of 'pretend mode'
+ # and grep it for libclang_rt references
+ local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
+ local i
+ for i in "${args[@]}"; do
+ if [[ ${i} == *libclang_rt* ]]; then
+ want_gcc_s=OFF
+ extra_libs+=( "${i}" )
+ fi
+ done
+ fi
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ # LLVM_LIBDIR_SUFFIX is used to find CMake files
+ # and we are happy to use the native set
+ -DLLVM_LIBDIR_SUFFIX=${NATIVE_LIBDIR#lib}
+ -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXX_ENABLE_SHARED=ON
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXX_CXX_ABI=${cxxabi}
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
+ # we're using our own mechanism for generating linker scripts
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
+ -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
+ -DLIBCXX_INCLUDE_TESTS=$(usex test)
+ -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ # this can be any directory, it just needs to exist...
+ -DLLVM_MAIN_SRC_DIR="${T}"
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxx
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ local libdir=$(get_libdir)
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
+
+ # Move it first.
+ mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps+=" libpthread.a libdl.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
+}
+
+gen_shared_ldscript() {
+ local libdir=$(get_libdir)
+ # libsupc++ doesn't have a shared version
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
+
+ mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
+ local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+ gen_shared_ldscript
+ use static-libs && gen_static_ldscript
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
diff --git a/sys-libs/libcxx/libcxx-3.9.1.ebuild b/sys-libs/libcxx/libcxx-3.9.1.ebuild
new file mode 100644
index 000000000000..e847a9f5d318
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-3.9.1.ebuild
@@ -0,0 +1,216 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# Ninja provides better scalability and cleaner verbose output, and is used
+# throughout all LLVM projects.
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+EGIT_REPO_URI="https://llvm.org/git/libcxx.git
+ https://github.com/llvm-mirror/libcxx.git"
+PYTHON_COMPAT=( python2_7 )
+
+[[ ${PV} == 9999 ]] && SCM="git-r3" || SCM=""
+
+inherit ${SCM} cmake-multilib python-any-r1 toolchain-funcs
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="https://libcxx.llvm.org/"
+if [[ ${PV} != 9999 ]] ; then
+ SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
+ S="${WORKDIR}/${P}.src"
+else
+ SRC_URI=""
+fi
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+if [[ ${PV} != 9999 ]] ; then
+ KEYWORDS="amd64 ~arm64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS="amd64 ~arm64 x86"
+fi
+IUSE="elibc_glibc elibc_musl libcxxabi +libcxxrt libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
+ ?? ( libcxxabi libcxxrt )"
+
+RDEPEND="
+ libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
+# llvm-3.9.0 needed because its cmake files installation path changed, which is
+# needed by libcxx
+# clang-3.9.0 installs necessary target symlinks unconditionally
+# which removes the need for MULTILIB_USEDEP
+DEPEND="${RDEPEND}
+ test? ( >=sys-devel/clang-3.9.0
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
+ app-arch/xz-utils
+ >=sys-devel/llvm-3.9.0"
+
+DOCS=( CREDITS.TXT )
+
+PATCHES=(
+ # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+ # out-of-tree build.
+ "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+
+ # Back-port of https://reviews.llvm.org/D23232, allowing building both
+ # shared and static libs in one run.
+ "${FILESDIR}/${PN}-3.9-cmake-static-lib.patch"
+)
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+
+ if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
+ eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
+ eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
+ eerror "and try again."
+ die
+ fi
+ if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later (or other"
+ eerror "conformant compilers). Please use gcc-config to switch to"
+ eerror "gcc-4.7 or later version."
+ die
+ fi
+}
+
+src_configure() {
+ NATIVE_LIBDIR=$(get_libdir)
+ cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+ local cxxabi cxxabi_incs
+ if use libcxxabi; then
+ cxxabi=libcxxabi
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
+ elif use libcxxrt; then
+ cxxabi=libcxxrt
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
+ else
+ local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
+ cxxabi=libsupc++
+ cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
+ fi
+
+ # we want -lgcc_s for unwinder, and for compiler runtime when using
+ # gcc, clang with gcc runtime (or any unknown compiler)
+ local extra_libs=() want_gcc_s=ON
+ if use libunwind; then
+ # work-around missing -lunwind upstream
+ extra_libs+=( -lunwind )
+ # if we're using libunwind and clang with compiler-rt, we want
+ # to link to compiler-rt instead of -lgcc_s
+ if tc-is-clang; then
+ # get the full library list out of 'pretend mode'
+ # and grep it for libclang_rt references
+ local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
+ local i
+ for i in "${args[@]}"; do
+ if [[ ${i} == *libclang_rt* ]]; then
+ want_gcc_s=OFF
+ extra_libs+=( "${i}" )
+ fi
+ done
+ fi
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ # LLVM_LIBDIR_SUFFIX is used to find CMake files
+ # and we are happy to use the native set
+ -DLLVM_LIBDIR_SUFFIX=${NATIVE_LIBDIR#lib}
+ -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXX_ENABLE_SHARED=ON
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXX_CXX_ABI=${cxxabi}
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
+ # we're using our own mechanism for generating linker scripts
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
+ -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
+ -DLIBCXX_INCLUDE_TESTS=$(usex test)
+ -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ # this can be any directory, it just needs to exist...
+ -DLLVM_MAIN_SRC_DIR="${T}"
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxx
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ local libdir=$(get_libdir)
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
+
+ # Move it first.
+ mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps+=" libpthread.a libdl.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
+}
+
+gen_shared_ldscript() {
+ local libdir=$(get_libdir)
+ # libsupc++ doesn't have a shared version
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
+
+ mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
+ local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+ gen_shared_ldscript
+ use static-libs && gen_static_ldscript
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
diff --git a/sys-libs/libcxx/libcxx-4.0.1.ebuild b/sys-libs/libcxx/libcxx-4.0.1.ebuild
new file mode 100644
index 000000000000..43a14f9abb6b
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-4.0.1.ebuild
@@ -0,0 +1,199 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# Ninja provides better scalability and cleaner verbose output, and is used
+# throughout all LLVM projects.
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="https://libcxx.llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="elibc_glibc elibc_musl +libcxxabi libcxxrt +libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
+ ?? ( libcxxabi libcxxrt )"
+
+RDEPEND="
+ libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
+# LLVM 4 required for llvm-config --cmakedir
+# clang-3.9.0 installs necessary target symlinks unconditionally
+# which removes the need for MULTILIB_USEDEP
+DEPEND="${RDEPEND}
+ test? ( >=sys-devel/clang-3.9.0
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
+ app-arch/xz-utils
+ >=sys-devel/llvm-4"
+
+S=${WORKDIR}/${P/_/}.src
+
+DOCS=( CREDITS.TXT )
+
+PATCHES=(
+ # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+ # out-of-tree build.
+ "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+)
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+
+ if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
+ eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
+ eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
+ eerror "and try again."
+ die
+ fi
+ if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later (or other"
+ eerror "conformant compilers). Please use gcc-config to switch to"
+ eerror "gcc-4.7 or later version."
+ die
+ fi
+}
+
+multilib_src_configure() {
+ local cxxabi cxxabi_incs
+ if use libcxxabi; then
+ cxxabi=libcxxabi
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
+ elif use libcxxrt; then
+ cxxabi=libcxxrt
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
+ else
+ local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
+ cxxabi=libsupc++
+ cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
+ fi
+
+ # we want -lgcc_s for unwinder, and for compiler runtime when using
+ # gcc, clang with gcc runtime (or any unknown compiler)
+ local extra_libs=() want_gcc_s=ON
+ if use libunwind; then
+ # work-around missing -lunwind upstream
+ extra_libs+=( -lunwind )
+ # if we're using libunwind and clang with compiler-rt, we want
+ # to link to compiler-rt instead of -lgcc_s
+ if tc-is-clang; then
+ # get the full library list out of 'pretend mode'
+ # and grep it for libclang_rt references
+ local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
+ local i
+ for i in "${args[@]}"; do
+ if [[ ${i} == *libclang_rt* ]]; then
+ want_gcc_s=OFF
+ extra_libs+=( "${i}" )
+ fi
+ done
+ fi
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXX_ENABLE_SHARED=ON
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXX_CXX_ABI=${cxxabi}
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
+ # we're using our own mechanism for generating linker scripts
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
+ -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
+ -DLIBCXX_INCLUDE_TESTS=$(usex test)
+ -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ # this can be any directory, it just needs to exist...
+ # FIXME: remove this once https://reviews.llvm.org/D25093 is merged
+ -DLLVM_MAIN_SRC_DIR="${T}"
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxx
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ local libdir=$(get_libdir)
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
+
+ # Move it first.
+ mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps+=" libpthread.a libdl.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
+}
+
+gen_shared_ldscript() {
+ local libdir=$(get_libdir)
+ # libsupc++ doesn't have a shared version
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
+
+ mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
+ local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+ gen_shared_ldscript
+ use static-libs && gen_static_ldscript
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
diff --git a/sys-libs/libcxx/libcxx-5.0.0.ebuild b/sys-libs/libcxx/libcxx-5.0.0.ebuild
new file mode 100644
index 000000000000..43a14f9abb6b
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-5.0.0.ebuild
@@ -0,0 +1,199 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# Ninja provides better scalability and cleaner verbose output, and is used
+# throughout all LLVM projects.
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="https://libcxx.llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="elibc_glibc elibc_musl +libcxxabi libcxxrt +libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
+ ?? ( libcxxabi libcxxrt )"
+
+RDEPEND="
+ libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
+# LLVM 4 required for llvm-config --cmakedir
+# clang-3.9.0 installs necessary target symlinks unconditionally
+# which removes the need for MULTILIB_USEDEP
+DEPEND="${RDEPEND}
+ test? ( >=sys-devel/clang-3.9.0
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
+ app-arch/xz-utils
+ >=sys-devel/llvm-4"
+
+S=${WORKDIR}/${P/_/}.src
+
+DOCS=( CREDITS.TXT )
+
+PATCHES=(
+ # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+ # out-of-tree build.
+ "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+)
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+
+ if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
+ eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
+ eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
+ eerror "and try again."
+ die
+ fi
+ if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later (or other"
+ eerror "conformant compilers). Please use gcc-config to switch to"
+ eerror "gcc-4.7 or later version."
+ die
+ fi
+}
+
+multilib_src_configure() {
+ local cxxabi cxxabi_incs
+ if use libcxxabi; then
+ cxxabi=libcxxabi
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
+ elif use libcxxrt; then
+ cxxabi=libcxxrt
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
+ else
+ local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
+ cxxabi=libsupc++
+ cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
+ fi
+
+ # we want -lgcc_s for unwinder, and for compiler runtime when using
+ # gcc, clang with gcc runtime (or any unknown compiler)
+ local extra_libs=() want_gcc_s=ON
+ if use libunwind; then
+ # work-around missing -lunwind upstream
+ extra_libs+=( -lunwind )
+ # if we're using libunwind and clang with compiler-rt, we want
+ # to link to compiler-rt instead of -lgcc_s
+ if tc-is-clang; then
+ # get the full library list out of 'pretend mode'
+ # and grep it for libclang_rt references
+ local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
+ local i
+ for i in "${args[@]}"; do
+ if [[ ${i} == *libclang_rt* ]]; then
+ want_gcc_s=OFF
+ extra_libs+=( "${i}" )
+ fi
+ done
+ fi
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXX_ENABLE_SHARED=ON
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXX_CXX_ABI=${cxxabi}
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
+ # we're using our own mechanism for generating linker scripts
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
+ -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
+ -DLIBCXX_INCLUDE_TESTS=$(usex test)
+ -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ # this can be any directory, it just needs to exist...
+ # FIXME: remove this once https://reviews.llvm.org/D25093 is merged
+ -DLLVM_MAIN_SRC_DIR="${T}"
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxx
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ local libdir=$(get_libdir)
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
+
+ # Move it first.
+ mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps+=" libpthread.a libdl.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
+}
+
+gen_shared_ldscript() {
+ local libdir=$(get_libdir)
+ # libsupc++ doesn't have a shared version
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
+
+ mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
+ local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+ gen_shared_ldscript
+ use static-libs && gen_static_ldscript
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
diff --git a/sys-libs/libcxx/libcxx-5.0.9999.ebuild b/sys-libs/libcxx/libcxx-5.0.9999.ebuild
new file mode 100644
index 000000000000..fde85c232023
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-5.0.9999.ebuild
@@ -0,0 +1,211 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# Ninja provides better scalability and cleaner verbose output, and is used
+# throughout all LLVM projects.
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+EGIT_REPO_URI="https://git.llvm.org/git/libcxx.git
+ https://github.com/llvm-mirror/libcxx.git"
+EGIT_BRANCH="release_50"
+PYTHON_COMPAT=( python2_7 )
+
+[[ ${PV} == *9999 ]] && SCM="git-r3" || SCM=""
+
+inherit ${SCM} cmake-multilib llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="https://libcxx.llvm.org/"
+if [[ ${PV} != *9999 ]] ; then
+ SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
+ S="${WORKDIR}/${P}.src"
+else
+ SRC_URI=""
+fi
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+if [[ ${PV} != *9999 ]] ; then
+ KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="elibc_glibc elibc_musl +libcxxabi libcxxrt +libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
+ ?? ( libcxxabi libcxxrt )"
+
+RDEPEND="
+ libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
+# LLVM 4 required for llvm-config --cmakedir
+# clang-3.9.0 installs necessary target symlinks unconditionally
+# which removes the need for MULTILIB_USEDEP
+DEPEND="${RDEPEND}
+ test? ( >=sys-devel/clang-3.9.0
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
+ app-arch/xz-utils
+ >=sys-devel/llvm-4"
+
+DOCS=( CREDITS.TXT )
+
+PATCHES=(
+ # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+ # out-of-tree build.
+ "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+)
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+
+ if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
+ eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
+ eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
+ eerror "and try again."
+ die
+ fi
+ if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later (or other"
+ eerror "conformant compilers). Please use gcc-config to switch to"
+ eerror "gcc-4.7 or later version."
+ die
+ fi
+}
+
+multilib_src_configure() {
+ local cxxabi cxxabi_incs
+ if use libcxxabi; then
+ cxxabi=libcxxabi
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
+ elif use libcxxrt; then
+ cxxabi=libcxxrt
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
+ else
+ local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
+ cxxabi=libsupc++
+ cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
+ fi
+
+ # we want -lgcc_s for unwinder, and for compiler runtime when using
+ # gcc, clang with gcc runtime (or any unknown compiler)
+ local extra_libs=() want_gcc_s=ON
+ if use libunwind; then
+ # work-around missing -lunwind upstream
+ extra_libs+=( -lunwind )
+ # if we're using libunwind and clang with compiler-rt, we want
+ # to link to compiler-rt instead of -lgcc_s
+ if tc-is-clang; then
+ # get the full library list out of 'pretend mode'
+ # and grep it for libclang_rt references
+ local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
+ local i
+ for i in "${args[@]}"; do
+ if [[ ${i} == *libclang_rt* ]]; then
+ want_gcc_s=OFF
+ extra_libs+=( "${i}" )
+ fi
+ done
+ fi
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXX_ENABLE_SHARED=ON
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXX_CXX_ABI=${cxxabi}
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
+ # we're using our own mechanism for generating linker scripts
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
+ -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
+ -DLIBCXX_INCLUDE_TESTS=$(usex test)
+ -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ # this can be any directory, it just needs to exist...
+ # FIXME: remove this once https://reviews.llvm.org/D25093 is merged
+ -DLLVM_MAIN_SRC_DIR="${T}"
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxx
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ local libdir=$(get_libdir)
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
+
+ # Move it first.
+ mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps+=" libpthread.a libdl.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
+}
+
+gen_shared_ldscript() {
+ local libdir=$(get_libdir)
+ # libsupc++ doesn't have a shared version
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
+
+ mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
+ local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+ gen_shared_ldscript
+ use static-libs && gen_static_ldscript
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
diff --git a/sys-libs/libcxx/libcxx-9999.ebuild b/sys-libs/libcxx/libcxx-9999.ebuild
new file mode 100644
index 000000000000..17104067dfdc
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-9999.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# Ninja provides better scalability and cleaner verbose output, and is used
+# throughout all LLVM projects.
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+EGIT_REPO_URI="https://git.llvm.org/git/libcxx.git
+ https://github.com/llvm-mirror/libcxx.git"
+PYTHON_COMPAT=( python2_7 )
+
+[[ ${PV} == 9999 ]] && SCM="git-r3" || SCM=""
+
+inherit ${SCM} cmake-multilib llvm python-any-r1 toolchain-funcs
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="https://libcxx.llvm.org/"
+if [[ ${PV} != 9999 ]] ; then
+ SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
+ S="${WORKDIR}/${P}.src"
+else
+ SRC_URI=""
+fi
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+if [[ ${PV} != 9999 ]] ; then
+ KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="elibc_glibc elibc_musl +libcxxabi libcxxrt +libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
+ ?? ( libcxxabi libcxxrt )"
+
+RDEPEND="
+ libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
+# LLVM 4 required for llvm-config --cmakedir
+# clang-3.9.0 installs necessary target symlinks unconditionally
+# which removes the need for MULTILIB_USEDEP
+DEPEND="${RDEPEND}
+ test? ( >=sys-devel/clang-3.9.0
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
+ app-arch/xz-utils
+ >=sys-devel/llvm-4"
+
+DOCS=( CREDITS.TXT )
+
+PATCHES=(
+ # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+ # out-of-tree build.
+ "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+)
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+
+ if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
+ eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
+ eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
+ eerror "and try again."
+ die
+ fi
+ if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later (or other"
+ eerror "conformant compilers). Please use gcc-config to switch to"
+ eerror "gcc-4.7 or later version."
+ die
+ fi
+}
+
+multilib_src_configure() {
+ local cxxabi cxxabi_incs
+ if use libcxxabi; then
+ cxxabi=libcxxabi
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
+ elif use libcxxrt; then
+ cxxabi=libcxxrt
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
+ else
+ local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
+ cxxabi=libsupc++
+ cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
+ fi
+
+ # we want -lgcc_s for unwinder, and for compiler runtime when using
+ # gcc, clang with gcc runtime (or any unknown compiler)
+ local extra_libs=() want_gcc_s=ON
+ if use libunwind; then
+ # work-around missing -lunwind upstream
+ extra_libs+=( -lunwind )
+ # if we're using libunwind and clang with compiler-rt, we want
+ # to link to compiler-rt instead of -lgcc_s
+ if tc-is-clang; then
+ # get the full library list out of 'pretend mode'
+ # and grep it for libclang_rt references
+ local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
+ local i
+ for i in "${args[@]}"; do
+ if [[ ${i} == *libclang_rt* ]]; then
+ want_gcc_s=OFF
+ extra_libs+=( "${i}" )
+ fi
+ done
+ fi
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXX_ENABLE_SHARED=ON
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXX_CXX_ABI=${cxxabi}
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
+ # we're using our own mechanism for generating linker scripts
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
+ -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
+ -DLIBCXX_INCLUDE_TESTS=$(usex test)
+ -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
+ )
+
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxx
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ local libdir=$(get_libdir)
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
+
+ # Move it first.
+ mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps+=" libpthread.a libdl.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
+}
+
+gen_shared_ldscript() {
+ local libdir=$(get_libdir)
+ # libsupc++ doesn't have a shared version
+ local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
+
+ mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
+ local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+ gen_shared_ldscript
+ use static-libs && gen_static_ldscript
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
diff --git a/sys-libs/libcxx/metadata.xml b/sys-libs/libcxx/metadata.xml
new file mode 100644
index 000000000000..df0c52dcfcdf
--- /dev/null
+++ b/sys-libs/libcxx/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>aballier@gentoo.org</email>
+ <name>Alexis Ballier</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>bsd@gentoo.org</email>
+ <name>BSD Project</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ <name>LLVM Project</name>
+ </maintainer>
+ <use>
+ <flag name="libcxxabi">Build on top of <pkg>sys-libs/libcxxabi</pkg> instead of gcc's libsupc++ (avoids depending on gcc).</flag>
+ <flag name="libcxxrt">Build on top of <pkg>sys-libs/libcxxrt</pkg> instead of gcc's libsupc++ (avoids depending on gcc).</flag>
+ <flag name="libunwind">Use libunwind instead of libgcc_s for stack unwinding, thus avoiding dependence on gcc.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/libcxxabi/Manifest b/sys-libs/libcxxabi/Manifest
new file mode 100644
index 000000000000..afdbd9316808
--- /dev/null
+++ b/sys-libs/libcxxabi/Manifest
@@ -0,0 +1,18 @@
+AUX libcxxabi-3.9.0-cmake-path.patch 1447 SHA256 8b4eb6a654c32ee8d2bedd1e7feaa7b0566a6d720b9d94fd5ead9c5cccbdb2fa SHA512 0466db8c0bfce67bda9a72ab953c327d7d7ddcf279aea7ecf02d121ec96f940ba76d390c35fb39ed5fb4fffdb66a412d6bd952d6e4a661494bf56e7aa7d6bc16 WHIRLPOOL 23b7e3c0079c34389bc6464d9f02847ecad2b0ed3bab714bb2a304fa3e8aea718d997eafbd218c08d8ef3e09c0379b0320114fb22cbf77451173f4ec1ac93e07
+AUX libcxxabi-3.9.0-test-unwind.patch 1110 SHA256 6bedf46f50f826291a8cb68b80b741701a6ae295100a5f893c2093956f546831 SHA512 b4ca3b35bc4e430fc7b7ff6bd6bad0306b30aec193275bc57d840e6643ffcf8cf6696eaf8b560d108f969a548cbb4688ce9d4e1bf649d60a98e7a9e280ed4763 WHIRLPOOL c68e7721a21c65b9c851625dd4159e72b730f07b5b615c94346904804129c204bd97b87186b3521c19808a70a6bc69a7ae9b849653f8c1b948098387fcae2365
+DIST libcxx-3.9.0.src.tar.xz 1198308 SHA256 d0b38d51365c6322f5666a2a8105785f2e114430858de4c25a86b49f227f5b06 SHA512 55d5c4adff378ee02b0b99d732bc9f326910f9e49ab8c320a588eccdd0362fe009bc9a6a4337d29faf6338420c91b10d0d7d67f66128268f01258d30502c4f4a WHIRLPOOL 3ee3519acfe95287a862a6c44e30ed52ced1204332913007797da4e4da40dfdc5991ae120f5686827cc208b559936da5bc5485dab75617bdd5cbbd9e95a6032a
+DIST libcxx-3.9.1.src.tar.xz 1209020 SHA256 25e615e428f60e651ed09ffd79e563864e3f4bc69a9e93ee41505c419d1a7461 SHA512 a5976e4096624a7307b3e43f4a22ac2dc74572226e0f57af9f3ef537a14c3cff1601b7042aef9dc40a0ee53ca76b08d72eb9c253dcf34f115d3153c302db7070 WHIRLPOOL cad439979570192b195338d752a24fb0ad8704c0c8efed3b6d7724437763eab7bc3b8baaf2f0e6fff55c6d9be211dff6f7baf18dec55e3a29ad3b8a423cefb1e
+DIST libcxx-4.0.1.src.tar.xz 1446380 SHA256 520a1171f272c9ff82f324d5d89accadcec9bc9f3c78de11f5575cdb99accc4c SHA512 91f3f397be606989be99865d0b279557f9afb93f7a74ed10c3a74f4440e38b5694ddf452bbf2f487cacd4391606dd5c7edfe5130f2de19e2acfd6cce619d028a WHIRLPOOL fe7c71e8dc2d17d14e94896837229c5ed872e7c04aea79a207e8fa98aa4539a7445e402b848d0c0d009f154f00d970159ad009d16bfdb9ae012ce5c7c6d9ba51
+DIST libcxx-5.0.0.src.tar.xz 1518940 SHA256 eae5981e9a21ef0decfcac80a1af584ddb064a32805f95a57c7c83a5eb28c9b1 SHA512 210749f6585d8fd39fc63a32dd85d68de4aa480c91915cbf419b9e8a3b300fa4624f03200ed963cecc8ab233777c36e8c522fa0762a2aa068bc65e6f48118328 WHIRLPOOL c791f6718e1c2a97fae26741284d861fc869721fca11b4ab4d3e9b4052ce17fca1fd99f945f406fdcdbfde43622cb7afe351e0268d773f6b42d1da2f5dc0f1f5
+DIST libcxxabi-3.9.0.src.tar.xz 511324 SHA256 b037a92717856882e05df57221e087d7d595a2ae9f170f7bc1a23ec7a92c8019 SHA512 500207bfd59664bd42d920741d6b467c4b88569453742db6470af081c77be04894e097a14b8419e333b51abce484566366e35cbc3ed2607cd86dfc0ec0ddd0c5 WHIRLPOOL 7b2d3b022c4c539596ce7be0afac724df929f19fb80e6f5b14074e240fb252b04389fe121f987ceaf6f3567d59735238b2940546475e4107f3c32eb55a5f8a80
+DIST libcxxabi-3.9.1.src.tar.xz 510964 SHA256 920d8be32e6f5574a3fb293f93a31225eeba15086820fcb942155bf50dc029e2 SHA512 4f5603f1476b759c86d4784728fbdd212c59b30dc56d787c1834bf68a9cd83071fa22658d24e5a58beb94c0c656b0e4457d7da6e3048715dd36bd68380fc336e WHIRLPOOL 8ff9d0a2d5657e384f3b624fe514ae4074552c34672e8b7caeb4870d700e71913447af75d56021d393c6eebd45018e5e80b706747b1433d9ec608a1d5b0b3051
+DIST libcxxabi-4.0.1.src.tar.xz 515820 SHA256 8f08178989a06c66cd19e771ff9d8ca526dd4a23d1382d63e416c04ea9fa1b33 SHA512 e94315ba8a507d8481d70c33e7ab2d724d51726edb8412c70a1b5f59e3f15d5825f1502dc2db138b20e5293fb90a184050be94d5ac270fd7ce78b502efb9f86a WHIRLPOOL 8771bb1f5ac8cb1d22a4606bfd3b448e1e3b942be0d5639a7c8c36abcc550a59cf2e530558aeb486294b642fdcd10c56695b59d094bed41e0115980cb587c8af
+DIST libcxxabi-5.0.0.src.tar.xz 521524 SHA256 176918c7eb22245c3a5c56ef055e4d69f5345b4a98833e0e8cb1a19cab6b8911 SHA512 88f48a3232c220a7d22ee31121e5c2bd09b506177079a1ff567eeae213e24a9bb8bd13e59f0c6ca5ec995c60bf516e3c2507d342a149a2c4cef8aad7b4b330f8 WHIRLPOOL 13ca81abc08afd73b557d71dd0041851fedcecc2f525a902c92ba16f6693c1df3a88acceede5c15a2186ef78dea9187d3ffd3212ced5e07c852404a55626cc59
+EBUILD libcxxabi-3.9.0.ebuild 2627 SHA256 5d464837d65821e2467140188d2eb89ee27139fd6085e4215e95ea1c36e1c8fc SHA512 2cf85fde3b6ddb253b3be983ca10e0dfdc9abb4db3d0750953442a90f734ef4c7053c4a6bbd8aab7391e19e73deba3769c2aaaead54162535d545f25f21f6826 WHIRLPOOL 9d9d1d36d34f504ce2184064731673cd1bba0909da6ab302b4791c5e1e826113ca6a11082e68b1a8bec99f36dea3fc251b4b9d57d4542922a66119cee9a33b20
+EBUILD libcxxabi-3.9.1.ebuild 2646 SHA256 e2b66afa5832eb93692a7e1835458a3b185d11e200c03398e903b2d4d606ec67 SHA512 4849fbfe11876cb403d78852abd6df27a0dbeada69c15fd1af6e7a20d742fcca064b227592e3ac69e32546cef94c790f28d63d40c8522213a9910f0b625ea379 WHIRLPOOL 9ceaa5958dd457d1143ec014babeee8268f4021e1a0c46fe89bb133020fc2e072673ff88c9f2941b2378f8785afc97fd9936f84bf19d3e90ceb7fb385501cf68
+EBUILD libcxxabi-4.0.1.ebuild 2493 SHA256 aa3174509589fe01b8db0e8735fa77ea85de74febf2c82fce113bb1a361d5619 SHA512 528dc5eac2c834f320b1b24277af6cbd6468c0686b95116de1d6dd8dd188dbee899717921aa358e3e317f02067b6dffb8fd375090d5f29693bcb26fe7600be99 WHIRLPOOL 85d8c8a910d0cf274fb67cc8dd587fe0abb1007c689eacc63f4bb0fe287ed3bd4cc2cb7895248ab2db012425e763145b1561f8e7ca411ce74fdf3f719f8fb44e
+EBUILD libcxxabi-5.0.0.ebuild 2323 SHA256 38c748918bf659d70f25a002769b85a80ffd84b9a3346754531213031789d808 SHA512 540a980d884a5c1e7aaf627a855a6a9f64e8fe8ef89513ed10fbc56aeff77d160a91467c79348a3538273da1f3786695ade4c18a644aa46d97333ec411f26584 WHIRLPOOL 0e7fcc14aca06d4ba1d196a6b71400691913f69594cf60e09db58092ddcf3f8e5c92028488013622d030441ccd1011c00da75f9cd1f111c3202555da1dc2f142
+EBUILD libcxxabi-5.0.9999.ebuild 2481 SHA256 3f0a931405eda8ac9439671c27067f2a30757e4bfee77463a3a374ed5110456d SHA512 5ab1ef9d6ca1be4f39e4e56923e216dc9fba5bdfa7c5e75b2da3253036272f230d3c24d4a074ce33a86d9431582d532a670919414e0b2b50128f942a47d4d635 WHIRLPOOL 2b974d8daeac1c438827045d023b0b15d687f59145036befaa8a0830d3faaa400ece03a839869ac201aec947661032d105f110e502417b8499b0cd52c3d082c9
+EBUILD libcxxabi-9999.ebuild 2487 SHA256 cc359c7f99f186a022f93678a52161bb9b45d2bf999509c4a7b153d05d00c0cf SHA512 6d7c0fe386a53c087ca672b9ab7664cef0e931b2ca60aeb1d0a15dc1eab930d1ad4a472066008e3d015c175577d95858de64187acee83a7a799ed114fdcea2ed WHIRLPOOL aecf3e7b7103f1fb8afda2e38d3fabbda21ed01b3c38a8961b8f710a8183d57810a0ae0423eda1a979bd3338164e9fa8bcb5708af78b262e13d62a0a7bca4b3a
+MISC ChangeLog 963 SHA256 f60b92e35ac35a26e2c18b5cc1f24a7dead4b7a48580ba755ab1714458cdcd48 SHA512 1a91034c34d963dc0ddd6e2d80e98f7f682135e5879c0a4c06700265b03bba7b71e0f5d8078291dda1b4bcdc3615d67c042ab7e24d9ad0aa58c17b9ab43e607b WHIRLPOOL 4cb1b6c8e316f148d739ed54687708b5666748f4aeb925bb77d28bb92eb1971778e08b27c176168faabc51e1e2815fbb028e28f9e49ca34f0f6da478bd50eda1
+MISC metadata.xml 350 SHA256 19efe268c0747e237a6e9f54dde3471b5b562fa6d7f698853bc09a06aa1b0460 SHA512 317dd7b59a711dd0461b5369f7e31ea196882b018e047e1dbae8077274d06cb68542c8762efb852cce0b8021bedea69c19aa0c124b9414a36cf1a9c00e0b9703 WHIRLPOOL 0f5edd5b7c2c2bed62c5a69286bf2f8f465b31716a8670549717b10f1f78a5b529d225244869ca2fc5680ccf043208905e1e34508dc4f74c639572d938db9d6e
diff --git a/sys-libs/libcxxabi/files/libcxxabi-3.9.0-cmake-path.patch b/sys-libs/libcxxabi/files/libcxxabi-3.9.0-cmake-path.patch
new file mode 100644
index 000000000000..b80c0f572208
--- /dev/null
+++ b/sys-libs/libcxxabi/files/libcxxabi-3.9.0-cmake-path.patch
@@ -0,0 +1,34 @@
+From 8d4d9af454a985d8c10ffdb0c56e87efec25ddff Mon Sep 17 00:00:00 2001
+From: Logan Chien <tzuhsiang.chien@gmail.com>
+Date: Mon, 3 Oct 2016 11:08:17 +0000
+Subject: [PATCH] [CMake] Fix libc++abi standalone cmake build.
+
+The cmake files install directory has been changed to
+${prefix}/lib/cmake/llvm since r259821. Searching cmake modules in
+${prefix}/share/llvm/cmake will result in fatal errors.
+
+This commit fixes the out-of-tree build by changing the CMake module
+search path to: "$(llvm-config --obj-root)/lib/cmake/llvm"
+
+
+git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@283100 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a33cf48..e75c0b8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -49,7 +49,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
+ set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
+ set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+- set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
++ set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+ set(LLVM_LIT_PATH "${LLVM_PATH}/utils/lit/lit.py")
+ else()
+ message(FATAL_ERROR "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. "
+--
+2.10.1
+
diff --git a/sys-libs/libcxxabi/files/libcxxabi-3.9.0-test-unwind.patch b/sys-libs/libcxxabi/files/libcxxabi-3.9.0-test-unwind.patch
new file mode 100644
index 000000000000..1005cb7d133e
--- /dev/null
+++ b/sys-libs/libcxxabi/files/libcxxabi-3.9.0-test-unwind.patch
@@ -0,0 +1,37 @@
+From fff85c801ae564a09479e1e8e4cf81977536c550 Mon Sep 17 00:00:00 2001
+From: Petr Hosek <phosek@chromium.org>
+Date: Mon, 8 Aug 2016 22:09:54 +0000
+Subject: [PATCH] Do not depend on unwind when building standalone
+
+When libcxxabi is being built standalone, unwind dependency is not
+available, so do not use it even when LLVM unwinder is being
+requested.
+
+Differential Revision: https://reviews.llvm.org/D23228
+
+git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@278058 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ test/CMakeLists.txt | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 31b5d1d..3a489bf 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -36,10 +36,9 @@ endif()
+
+ if (NOT LIBCXXABI_BUILT_STANDALONE)
+ list(APPEND LIBCXXABI_TEST_DEPS cxx)
+-endif()
+-
+-if (LIBCXXABI_USE_LLVM_UNWINDER)
+- list(APPEND LIBCXXABI_TEST_DEPS unwind)
++ if (LIBCXXABI_USE_LLVM_UNWINDER)
++ list(APPEND LIBCXXABI_TEST_DEPS unwind)
++ endif()
+ endif()
+
+ add_lit_testsuite(check-libcxxabi "Running libcxxabi tests"
+--
+2.10.1
+
diff --git a/sys-libs/libcxxabi/libcxxabi-3.9.0.ebuild b/sys-libs/libcxxabi/libcxxabi-3.9.0.ebuild
new file mode 100644
index 000000000000..9e89b462247b
--- /dev/null
+++ b/sys-libs/libcxxabi/libcxxabi-3.9.0.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib python-any-r1
+
+DESCRIPTION="Low level support for a standard C++ library"
+HOMEPAGE="https://libcxxabi.llvm.org/"
+# also needs libcxx sources for headers
+SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz
+ https://llvm.org/releases/${PV}/${P/abi/}.src.tar.xz"
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="elibc_musl libunwind +static-libs test"
+
+RDEPEND="
+ libunwind? (
+ || (
+ >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,${MULTILIB_USEDEP}]
+ )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/llvm-3.9.0
+ test? ( >=sys-devel/clang-3.9.0
+ ~sys-libs/libcxx-${PV}[libcxxabi(-)]
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )"
+
+S=${WORKDIR}/${P}.src
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # backport cmake path fix for llvm-3.9+
+ eapply "${FILESDIR}/${P}-cmake-path.patch"
+ # kill stray unwind test dep in stand-alone builds
+ eapply "${FILESDIR}/${P}-test-unwind.patch"
+}
+
+src_configure() {
+ NATIVE_LIBDIR=$(get_libdir)
+ cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${NATIVE_LIBDIR#lib}
+ -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXXABI_ENABLE_SHARED=ON
+ -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind)
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+
+ -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx-${PV}.src/include
+ # upstream is omitting standard search path for this
+ # probably because gcc & clang are bundling their own unwind.h
+ -DLIBCXXABI_LIBUNWIND_INCLUDES="${EPREFIX}"/usr/include
+ # this only needs to exist, it does not have to make sense
+ -DLIBCXXABI_LIBUNWIND_SOURCES="${T}"
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ if use elibc_musl; then
+ local -x CPPFLAGS="${CPPFLAGS} -D_LIBCPP_HAS_MUSL_LIBC=1"
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxxabi
+}
+
+multilib_src_install_all() {
+ insinto /usr/include/libcxxabi
+ doins -r include/.
+}
diff --git a/sys-libs/libcxxabi/libcxxabi-3.9.1.ebuild b/sys-libs/libcxxabi/libcxxabi-3.9.1.ebuild
new file mode 100644
index 000000000000..57cba7ebc6f2
--- /dev/null
+++ b/sys-libs/libcxxabi/libcxxabi-3.9.1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib python-any-r1
+
+DESCRIPTION="Low level support for a standard C++ library"
+HOMEPAGE="https://libcxxabi.llvm.org/"
+# also needs libcxx sources for headers
+SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz
+ https://llvm.org/releases/${PV}/${P/abi/}.src.tar.xz"
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 x86"
+IUSE="elibc_musl libunwind +static-libs test"
+
+RDEPEND="
+ libunwind? (
+ || (
+ >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,${MULTILIB_USEDEP}]
+ )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/llvm-3.9.0
+ test? ( >=sys-devel/clang-3.9.0
+ ~sys-libs/libcxx-${PV}[libcxxabi(-)]
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )"
+
+S=${WORKDIR}/${P}.src
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # backport cmake path fix for llvm-3.9+
+ eapply "${FILESDIR}/${PN}-3.9.0-cmake-path.patch"
+ # kill stray unwind test dep in stand-alone builds
+ eapply "${FILESDIR}/${PN}-3.9.0-test-unwind.patch"
+}
+
+src_configure() {
+ NATIVE_LIBDIR=$(get_libdir)
+ cmake-multilib_src_configure
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${NATIVE_LIBDIR#lib}
+ -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXXABI_ENABLE_SHARED=ON
+ -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind)
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+
+ -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx-${PV}.src/include
+ # upstream is omitting standard search path for this
+ # probably because gcc & clang are bundling their own unwind.h
+ -DLIBCXXABI_LIBUNWIND_INCLUDES="${EPREFIX}"/usr/include
+ # this only needs to exist, it does not have to make sense
+ -DLIBCXXABI_LIBUNWIND_SOURCES="${T}"
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ if use elibc_musl; then
+ local -x CPPFLAGS="${CPPFLAGS} -D_LIBCPP_HAS_MUSL_LIBC=1"
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxxabi
+}
+
+multilib_src_install_all() {
+ insinto /usr/include/libcxxabi
+ doins -r include/.
+}
diff --git a/sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild b/sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild
new file mode 100644
index 000000000000..860d240849b4
--- /dev/null
+++ b/sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib llvm python-any-r1
+
+DESCRIPTION="Low level support for a standard C++ library"
+HOMEPAGE="https://libcxxabi.llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ https://releases.llvm.org/${PV/_//}/libcxx-${PV/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+libunwind +static-libs test"
+
+RDEPEND="
+ libunwind? (
+ || (
+ >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,${MULTILIB_USEDEP}]
+ )
+ )"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND="${RDEPEND}
+ >=sys-devel/llvm-4
+ test? ( >=sys-devel/clang-3.9.0
+ ~sys-libs/libcxx-${PV}[libcxxabi(-)]
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ mv libcxx-* libcxx || die
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXXABI_ENABLE_SHARED=ON
+ -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind)
+ -DLIBCXXABI_INCLUDE_TESTS=$(usex test)
+
+ -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include
+ # upstream is omitting standard search path for this
+ # probably because gcc & clang are bundling their own unwind.h
+ -DLIBCXXABI_LIBUNWIND_INCLUDES="${EPREFIX}"/usr/include
+ # this only needs to exist, it does not have to make sense
+ # FIXME: remove this once https://reviews.llvm.org/D25314 is merged
+ -DLIBCXXABI_LIBUNWIND_SOURCES="${T}"
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxxabi
+}
+
+multilib_src_install_all() {
+ insinto /usr/include/libcxxabi
+ doins -r include/.
+}
diff --git a/sys-libs/libcxxabi/libcxxabi-5.0.0.ebuild b/sys-libs/libcxxabi/libcxxabi-5.0.0.ebuild
new file mode 100644
index 000000000000..edbb3a871a65
--- /dev/null
+++ b/sys-libs/libcxxabi/libcxxabi-5.0.0.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib llvm python-any-r1
+
+DESCRIPTION="Low level support for a standard C++ library"
+HOMEPAGE="https://libcxxabi.llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ https://releases.llvm.org/${PV/_//}/libcxx-${PV/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+libunwind +static-libs test"
+
+RDEPEND="
+ libunwind? (
+ || (
+ >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,${MULTILIB_USEDEP}]
+ )
+ )"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND="${RDEPEND}
+ >=sys-devel/llvm-4
+ test? ( >=sys-devel/clang-3.9.0
+ ~sys-libs/libcxx-${PV}[libcxxabi(-)]
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ mv libcxx-* libcxx || die
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXXABI_ENABLE_SHARED=ON
+ -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind)
+ -DLIBCXXABI_INCLUDE_TESTS=$(usex test)
+
+ -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include
+ # upstream is omitting standard search path for this
+ # probably because gcc & clang are bundling their own unwind.h
+ -DLIBCXXABI_LIBUNWIND_INCLUDES="${EPREFIX}"/usr/include
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxxabi
+}
+
+multilib_src_install_all() {
+ insinto /usr/include/libcxxabi
+ doins -r include/.
+}
diff --git a/sys-libs/libcxxabi/libcxxabi-5.0.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-5.0.9999.ebuild
new file mode 100644
index 000000000000..1f5409df9c9d
--- /dev/null
+++ b/sys-libs/libcxxabi/libcxxabi-5.0.9999.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib git-r3 llvm python-any-r1
+
+DESCRIPTION="Low level support for a standard C++ library"
+HOMEPAGE="https://libcxxabi.llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/libcxxabi.git
+ https://github.com/llvm-mirror/libcxxabi.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS=""
+IUSE="+libunwind +static-libs test"
+
+RDEPEND="
+ libunwind? (
+ || (
+ >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,${MULTILIB_USEDEP}]
+ )
+ )"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND="${RDEPEND}
+ >=sys-devel/llvm-4
+ test? ( >=sys-devel/clang-3.9.0
+ ~sys-libs/libcxx-${PV}[libcxxabi(-)]
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ # we need the headers
+ git-r3_fetch "https://git.llvm.org/git/libcxx.git
+ https://github.com/llvm-mirror/libcxx.git"
+ git-r3_fetch
+
+ git-r3_checkout https://llvm.org/git/libcxx.git \
+ "${WORKDIR}"/libcxx
+ git-r3_checkout
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXXABI_ENABLE_SHARED=ON
+ -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind)
+ -DLIBCXXABI_INCLUDE_TESTS=$(usex test)
+
+ -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include
+ # upstream is omitting standard search path for this
+ # probably because gcc & clang are bundling their own unwind.h
+ -DLIBCXXABI_LIBUNWIND_INCLUDES="${EPREFIX}"/usr/include
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxxabi
+}
+
+multilib_src_install_all() {
+ insinto /usr/include/libcxxabi
+ doins -r include/.
+}
diff --git a/sys-libs/libcxxabi/libcxxabi-9999.ebuild b/sys-libs/libcxxabi/libcxxabi-9999.ebuild
new file mode 100644
index 000000000000..c2be84f86a22
--- /dev/null
+++ b/sys-libs/libcxxabi/libcxxabi-9999.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib git-r3 llvm python-any-r1
+
+DESCRIPTION="Low level support for a standard C++ library"
+HOMEPAGE="https://libcxxabi.llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/libcxxabi.git
+ https://github.com/llvm-mirror/libcxxabi.git"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS=""
+IUSE="+libunwind +static-libs test"
+
+RDEPEND="
+ libunwind? (
+ || (
+ >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,${MULTILIB_USEDEP}]
+ )
+ )"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND="${RDEPEND}
+ >=sys-devel/llvm-4
+ test? ( >=sys-devel/clang-3.9.0
+ ~sys-libs/libcxx-${PV}[libcxxabi(-)]
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ # we need the headers
+ git-r3_fetch "https://git.llvm.org/git/libcxx.git
+ https://github.com/llvm-mirror/libcxx.git"
+ git-r3_fetch
+
+ git-r3_checkout https://llvm.org/git/libcxx.git \
+ "${WORKDIR}"/libcxx
+ git-r3_checkout
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXXABI_ENABLE_SHARED=ON
+ -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind)
+ -DLIBCXXABI_INCLUDE_TESTS=$(usex test)
+
+ -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include
+ # upstream is omitting standard search path for this
+ # probably because gcc & clang are bundling their own unwind.h
+ -DLIBCXXABI_LIBUNWIND_INCLUDES="${EPREFIX}"/usr/include
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxxabi
+}
+
+multilib_src_install_all() {
+ insinto /usr/include/libcxxabi
+ doins -r include/.
+}
diff --git a/sys-libs/libcxxabi/metadata.xml b/sys-libs/libcxxabi/metadata.xml
new file mode 100644
index 000000000000..78c7d7d981b6
--- /dev/null
+++ b/sys-libs/libcxxabi/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 type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="libunwind">Use libunwind instead of libgcc_s for stack unwinding, thus avoiding dependency on gcc</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/libcxxrt/Manifest b/sys-libs/libcxxrt/Manifest
new file mode 100644
index 000000000000..dac620dbc812
--- /dev/null
+++ b/sys-libs/libcxxrt/Manifest
@@ -0,0 +1,15 @@
+AUX Makefile 513 SHA256 868714ac74fae3d3a4b21efff691d89d38df4b00052c8e788b4188de189ef29e SHA512 acb4b2855ea3912db0d3a26c7f8e7703b865f7e6f17b22a3654d9ac10633fc25fae3ba3995f0f33c106f4eba14ca897e8c6256e339e4d7f1393d8efdee7f4ef4 WHIRLPOOL 5fc7e6ad825bf577115601d1f391c6801df0894bbfb732fea4cbe9997ad797e861af1782a49acabd36835aa933e51a6a9c7b7a991f0993a8896c9232c9436133
+AUX Makefile.test 172 SHA256 af6cadd483849ae47f6ca6db3dfe03df8d5f8437c445f0f9a7fdcfb182fe88e1 SHA512 fc93c26e4df1c5eca2f99ad3058e2d129fa85a876c9d3d6fcc9e456f397455ebd136b88b3c0ed8d27003dc7a00a985094b6c711fb34316d9fef39e1ab2aadaba WHIRLPOOL 2fc180ce685c865748f57f9af00f74bacfd3ff73c0c1731d5b691f965724aaab13eaf8b33fd8d666abf889141eb1b194f6aa5bfe2386e4cd904ef77d4bc76d82
+AUX prepare_snapshot.sh 428 SHA256 78dabae151512d1b29d7f25324ee986e0ea7adbf7f39c35a8ce660a9981c32a5 SHA512 2fc1391df1178a1f6e2e29243731a0630e43718e7e525f95f8dcea3c9909905e86cba1cd9063c396be0a076965b6c3c1cfaac899ba6e30c9cf4f90e237fb5b25 WHIRLPOOL c474174085b772a781eb19c5eaba770a2c73640ee8aa14e3757b2b22fffa772a2d6041ba2be77fd35b46f87522f23de36e183386e72eac44ea05c862fdef7866
+DIST libcxxrt-0.0_p20140322.tar.xz 58208 SHA256 39392e1081710d7bf62de1a9723632adbaed5cd516e8b27af764195b8ea9aeb0 SHA512 8cc2f3779a28b8eb215c3dc97e1382651016127ec6b1feb5067de435841c20e6338662172176f003242f1393b8df3ecf91eaa85b54281e1c588dab44d01ca930 WHIRLPOOL 1e6b105cb6650762025f3ce0b6853eff84c94d6fb6c34269b6e3d92984c66308d59c20f2b4311cafea24928f0e3e645527ea6b041b939e941a05f2fea9a2c02e
+DIST libcxxrt-0.0_p20150423.tar.xz 58596 SHA256 a633256ffe43261dd873866aa4a0be9aaa8bdd38f8d554f16c209e84be2f1a88 SHA512 67a3b9204cee7b7900228483b8e24898d83f76b3ff2ed94bbbd67ca3fba623021e1b346c91ef46955da78f2e001395dc84a2f496223b52a0e59e97ff2e27e247 WHIRLPOOL bcf34a715b7aafa4169d39f045896be9230d3365dfffc422d91af160c64a254561a7f2e67bcdc35b4e2a2032a9d1c5e87eeebbc5c40607737f5715bbeeb4b530
+DIST libcxxrt-0.0_p20160922.tar.xz 60460 SHA256 be52f2e5a57344bd856e5dd155eaec5e4606edb0118f1ad4cadc2f2bd00d394e SHA512 3ec60ef2127a7e51793f90291ef61c6853d9a7b23201617f9dde0d27d987901db5ad0b142e3adb3eee64884e11793676912f2fb8e8b090d35288277a54d261bd WHIRLPOOL 841f21edaa8fc7aac4636826b7510b7f35cd5c5d580d5f13b1b06b00b101e2f097cec3f073463275fe54fbd337aa3e08f254be4fdacf9155ca8b625c0beb4f0e
+DIST libcxxrt-0.0_p20170515.tar.xz 60488 SHA256 b0549563834ed6eb3a7b78dc2905639c287bc297f03e2e5113738eb579c517d0 SHA512 cf0539ca8f836adadf83195784ad008008faea2b0dd8953191fa1012d542f10f546eb58ecc42fa8e864c1113530a6bceb28a8005aa62276570343a3aaba09266 WHIRLPOOL 40ff2b30047b4a2c687446902d601cff9e88c6a35a6a691e853f264e263f974adc9a2dd69830feeb29567655a09f3b7d00abcb196fbc7e9f696be85e455194b3
+EBUILD libcxxrt-0.0_p20140322.ebuild 1948 SHA256 ef35e38ed0e216ad7f21a411848bec483a34de198737ecd870ef09a8e5b396c9 SHA512 cd45ca0995e24113b1a14b3a068297f7dd1ae8217e873633429636902c93d4dbe98fa6949df81997c90bc15681442abc34859f179a8320ebbd193269330e63a9 WHIRLPOOL fef1911093525bb24b89d98c8e8fc4eb6247c90ec615d2cbfe6ceea90663ab5c24f6cb2c658e165dc71601bce955e2b3d9c53224a4925ef196418f1bc7acf291
+EBUILD libcxxrt-0.0_p20150423-r1.ebuild 2014 SHA256 f42e47e20cfec143d931eaa6c0735bff87f6597a110ad9fcda5b13589aba04e6 SHA512 8f8a7c32b57a66089d1ea88ed09566459a1038437f9df570dda9ec03cdd4fe9412136b8a2bda2a581dfae26624a5697d207a5adb7aaaeb3e740750a9a3785e13 WHIRLPOOL 288c89f9a769b69cf79535f42d339f0c57748dfb692ae342a81945755032c50d027ef76199aa773dbcb3d7f00355ff2deee38fc8c5d66455490d18ac7f5301f6
+EBUILD libcxxrt-0.0_p20160922.ebuild 2035 SHA256 3c999c057479bdb39644bebe35d00434a3ab069b08d2d51a6b89cd93c50c7f97 SHA512 ce681af3a08dc2d2fdd35009f33e22e5848a14ea072deaa784c8ff303573332f94df7e8dc3ff8c50c130fa5806ac71a7873ffb714b726876be60abe9a8edbac1 WHIRLPOOL 776e7529d4f612c8fb51c35d2ddbe02e8e725ba01204504d8c462373098ac42de74844acbdd54c491177fa5cd70f1b9e73fdcd68e34f7566b4466408bcc55305
+EBUILD libcxxrt-0.0_p20170515.ebuild 2023 SHA256 63cb7b399175e6842d403f662ca334a9248731104afa0a057aedf2d024cf7480 SHA512 31a525a44ccf160025631edd907576d520788f01c3c13141c2b3b0afb077bd1eb2a0c214f98f29d3f6f7f8fb28a02107b17a62cc474fa07c4fdf0771716ba08b WHIRLPOOL 79af389da22ff4f9bfebcf68b6c8204f0b6ea223e5005aa01a43353481a26b263f69a567af2341fd6547973ac74bd603ad865429191b0dae1e2b288600dc7297
+EBUILD libcxxrt-9999.ebuild 2023 SHA256 63cb7b399175e6842d403f662ca334a9248731104afa0a057aedf2d024cf7480 SHA512 31a525a44ccf160025631edd907576d520788f01c3c13141c2b3b0afb077bd1eb2a0c214f98f29d3f6f7f8fb28a02107b17a62cc474fa07c4fdf0771716ba08b WHIRLPOOL 79af389da22ff4f9bfebcf68b6c8204f0b6ea223e5005aa01a43353481a26b263f69a567af2341fd6547973ac74bd603ad865429191b0dae1e2b288600dc7297
+MISC ChangeLog 3553 SHA256 699c0fa1228ba83ec9792787112ed34d7b2e657b5295eb169a8afc52352b5ff1 SHA512 afa7d37a4631b8805d804d8d620b4ab7ccba8d60e4a094ea89ddde15ca0758a725c6f92635b874dfd9030b4e1e158bece0f9d628f6643ccb316d3e954997c6ff WHIRLPOOL 21dcb8058b3f14597dd7f532603646268ab0ba3e081490138576db165b87df021393c39efccfb722189f453ed617c7a344aaa40bb26220483b24daee10f1f8d2
+MISC ChangeLog-2015 4986 SHA256 5066675d8ab4bdd91eea68a397c8ddf1d04a64d7609634342fa93fb73a7c9022 SHA512 376df55f0dd00187bb2e6781cf6754d1a74aeb5295bc360aaeda2c55a025e793d3d12c16188d2b88442dc235c004604148fcaf30d766528f364a309ad16408fe WHIRLPOOL 2eeac44674ca2fdd32df6975f26d4f31e49b8a090f1ebdef13682e99a7919f6c48473a0163e94783445e21f6f15f1275fa884c0aabad3c43531a7bc9bb8950ae
+MISC metadata.xml 772 SHA256 527a8f028584a28ebd1255833984176a3a0c7481c40f552256c674970fb54244 SHA512 2740f5561f530ec9053c2e3cc1c32af9b11b61d6b9b1e1babc39d135132bd7fbc0670bcdef274408126c9444e93c9e6f964f7c51316cac06b4a64e177263be7a WHIRLPOOL 4c52d0358ea6c8557f8ebdead0f875a78837104652c0f479ec96ba55c36d2a01a6e4964d287070f3e5d2fd6bb9667a3b5695ea102b2a78945969cc954d99db06
diff --git a/sys-libs/libcxxrt/files/Makefile b/sys-libs/libcxxrt/files/Makefile
new file mode 100644
index 000000000000..18b90a7cf712
--- /dev/null
+++ b/sys-libs/libcxxrt/files/Makefile
@@ -0,0 +1,23 @@
+LIB=cxxrt
+MAJ=1
+OBJS=dynamic_cast.o exception.o guard.o stdexcept.o typeinfo.o memory.o auxhelper.o libelftc_dem_gnu3.o
+SOBJS=${OBJS:.o=.So}
+
+static: lib$(LIB).a
+
+shared: lib$(LIB).so
+
+%.So: %.cc
+ $(CXX) -fPIC $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+%.So: %.c
+ $(CC) -fPIC $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+lib$(LIB).a: $(OBJS)
+ $(AR) cr $@ $^
+
+lib$(LIB).so.$(MAJ): $(SOBJS)
+ $(CXX) -fPIC -nodefaultlibs $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $^ $(LIBS)
+
+lib$(LIB).so: lib$(LIB).so.$(MAJ)
+ ln -s $< $@
diff --git a/sys-libs/libcxxrt/files/Makefile.test b/sys-libs/libcxxrt/files/Makefile.test
new file mode 100644
index 000000000000..55099426e7b4
--- /dev/null
+++ b/sys-libs/libcxxrt/files/Makefile.test
@@ -0,0 +1,7 @@
+OBJS=test.o test_exception.o test_guard.o test_typeinfo.o
+
+cxxrttest: $(OBJS)
+ $(CXX) -nodefaultlibs $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+check: cxxrttest
+ ./cxxrttest
diff --git a/sys-libs/libcxxrt/files/prepare_snapshot.sh b/sys-libs/libcxxrt/files/prepare_snapshot.sh
new file mode 100755
index 000000000000..052076bc3813
--- /dev/null
+++ b/sys-libs/libcxxrt/files/prepare_snapshot.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+VERSION=$(date +%Y%m%d)
+BASE_VERSION="0.0"
+PACKAGE="libcxxrt-${BASE_VERSION}_p${VERSION}"
+
+git clone https://github.com/pathscale/libcxxrt.git ${PACKAGE}
+
+find "${PACKAGE}" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
+find "${PACKAGE}" -type d -name '.git' -prune -print0 | xargs -0 rm -rf
+
+tar cJf ${PACKAGE}.tar.xz ${PACKAGE}
+rm -rf ${PACKAGE}/
+
+echo "Tarball: \"${PACKAGE}.tar.xz\""
+
+echo "** all done **"
diff --git a/sys-libs/libcxxrt/libcxxrt-0.0_p20140322.ebuild b/sys-libs/libcxxrt/libcxxrt-0.0_p20140322.ebuild
new file mode 100644
index 000000000000..6ff5b6c3500a
--- /dev/null
+++ b/sys-libs/libcxxrt/libcxxrt-0.0_p20140322.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+EGIT_REPO_URI="https://github.com/pathscale/libcxxrt.git"
+
+[ "${PV%9999}" != "${PV}" ] && SCM="git-2" || SCM=""
+
+inherit flag-o-matic toolchain-funcs portability ${SCM} multilib-minimal
+
+DESCRIPTION="C++ Runtime from PathScale, FreeBSD and NetBSD"
+HOMEPAGE="https://github.com/pathscale/libcxxrt http://www.pathscale.com/node/265"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ SRC_URI="mirror://gentoo/${P}.tar.xz"
+ DEPEND="app-arch/xz-utils"
+else
+ SRC_URI=""
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ KEYWORDS="~amd64 ~mips ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="libunwind static-libs"
+
+RDEPEND="libunwind? ( >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ ${DEPEND}"
+
+DOCS=( AUTHORS COPYRIGHT README )
+
+src_prepare() {
+ cp "${FILESDIR}/Makefile" src/ || die
+ cp "${FILESDIR}/Makefile.test" test/Makefile || die
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ # Notes: we build -nodefaultlibs to avoid linking to gcc libs.
+ # libcxxrt needs: dladdr (dlopen_lib), libunwind or libgcc_s and the libc.
+ tc-export CC CXX AR
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
+ cd "${BUILD_DIR}/src"
+ LIBS="$(dlopen_lib) -l$(usex libunwind unwind gcc_s) -lc" emake shared
+ use static-libs && emake static
+}
+
+multilib_src_test() {
+ cd "${BUILD_DIR}/test"
+ LD_LIBRARY_PATH="${BUILD_DIR}/src:${LD_LIBRARY_PATH}" \
+ LIBS="-L${BUILD_DIR}/src -lcxxrt -l$(usex libunwind unwind gcc_s) -lc" \
+ emake check
+}
+
+multilib_src_install() {
+ # TODO: See README. Maybe hide it in a subdir and let only libcxx know about
+ # it. FreeBSD head installs it in /lib
+ dolib.so src/${PN}.so*
+ use static-libs && dolib.a src/${PN}.a
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ insinto /usr/include/libcxxrt/
+ doins src/cxxabi.h src/unwind*.h
+}
diff --git a/sys-libs/libcxxrt/libcxxrt-0.0_p20150423-r1.ebuild b/sys-libs/libcxxrt/libcxxrt-0.0_p20150423-r1.ebuild
new file mode 100644
index 000000000000..3917b71ee0bb
--- /dev/null
+++ b/sys-libs/libcxxrt/libcxxrt-0.0_p20150423-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+EGIT_REPO_URI="https://github.com/pathscale/libcxxrt.git"
+
+[ "${PV%9999}" != "${PV}" ] && SCM="git-2" || SCM=""
+
+inherit flag-o-matic toolchain-funcs portability ${SCM} multilib-minimal
+
+DESCRIPTION="C++ Runtime from PathScale, FreeBSD and NetBSD"
+HOMEPAGE="https://github.com/pathscale/libcxxrt http://www.pathscale.com/node/265"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ SRC_URI="mirror://gentoo/${P}.tar.xz"
+ DEPEND="app-arch/xz-utils"
+else
+ SRC_URI=""
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ KEYWORDS="~amd64 ~mips ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="libunwind +static-libs"
+
+RDEPEND="libunwind? ( || ( >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ sys-libs/llvm-libunwind[static-libs?,${MULTILIB_USEDEP}] ) )"
+DEPEND="${RDEPEND}
+ ${DEPEND}"
+
+DOCS=( AUTHORS COPYRIGHT README )
+
+src_prepare() {
+ cp "${FILESDIR}/Makefile" src/ || die
+ cp "${FILESDIR}/Makefile.test" test/Makefile || die
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ # Notes: we build -nodefaultlibs to avoid linking to gcc libs.
+ # libcxxrt needs: dladdr (dlopen_lib), libunwind or libgcc_s and the libc.
+ tc-export CC CXX AR
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
+ cd "${BUILD_DIR}/src"
+ LIBS="$(dlopen_lib) -l$(usex libunwind unwind gcc_s) -lc" emake shared
+ use static-libs && emake static
+}
+
+multilib_src_test() {
+ cd "${BUILD_DIR}/test"
+ LD_LIBRARY_PATH="${BUILD_DIR}/src:${LD_LIBRARY_PATH}" \
+ LIBS="-L${BUILD_DIR}/src -lcxxrt -l$(usex libunwind unwind gcc_s) -lc" \
+ emake check
+}
+
+multilib_src_install() {
+ # TODO: See README. Maybe hide it in a subdir and let only libcxx know about
+ # it. FreeBSD head installs it in /lib
+ dolib.so src/${PN}.so*
+ use static-libs && dolib.a src/${PN}.a
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ insinto /usr/include/libcxxrt/
+ doins src/cxxabi.h src/unwind*.h
+}
diff --git a/sys-libs/libcxxrt/libcxxrt-0.0_p20160922.ebuild b/sys-libs/libcxxrt/libcxxrt-0.0_p20160922.ebuild
new file mode 100644
index 000000000000..660db29feecd
--- /dev/null
+++ b/sys-libs/libcxxrt/libcxxrt-0.0_p20160922.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+EGIT_REPO_URI="https://github.com/pathscale/libcxxrt.git"
+
+[ "${PV%9999}" != "${PV}" ] && SCM="git-2" || SCM=""
+
+inherit flag-o-matic toolchain-funcs portability ${SCM} multilib-minimal
+
+DESCRIPTION="C++ Runtime from PathScale, FreeBSD and NetBSD"
+HOMEPAGE="https://github.com/pathscale/libcxxrt http://www.pathscale.com/node/265"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ SRC_URI="mirror://gentoo/${P}.tar.xz"
+ DEPEND="app-arch/xz-utils"
+else
+ SRC_URI=""
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ KEYWORDS="amd64 ~arm64 ~mips x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS="amd64 ~arm64 x86"
+fi
+IUSE="libunwind +static-libs"
+
+RDEPEND="libunwind? ( || ( >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ sys-libs/llvm-libunwind[static-libs?,${MULTILIB_USEDEP}] ) )"
+DEPEND="${RDEPEND}
+ ${DEPEND}"
+
+DOCS=( AUTHORS COPYRIGHT README )
+
+src_prepare() {
+ cp "${FILESDIR}/Makefile" src/ || die
+ cp "${FILESDIR}/Makefile.test" test/Makefile || die
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ # Notes: we build -nodefaultlibs to avoid linking to gcc libs.
+ # libcxxrt needs: dladdr (dlopen_lib), libunwind or libgcc_s and the libc.
+ tc-export CC CXX AR
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
+ cd "${BUILD_DIR}/src"
+ LIBS="$(dlopen_lib) -l$(usex libunwind unwind gcc_s) -lc" emake shared
+ use static-libs && emake static
+}
+
+multilib_src_test() {
+ cd "${BUILD_DIR}/test"
+ LD_LIBRARY_PATH="${BUILD_DIR}/src:${LD_LIBRARY_PATH}" \
+ LIBS="-L${BUILD_DIR}/src -lcxxrt -l$(usex libunwind unwind gcc_s) -lc" \
+ emake check
+}
+
+multilib_src_install() {
+ # TODO: See README. Maybe hide it in a subdir and let only libcxx know about
+ # it. FreeBSD head installs it in /lib
+ dolib.so src/${PN}.so*
+ use static-libs && dolib.a src/${PN}.a
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ insinto /usr/include/libcxxrt/
+ doins src/cxxabi.h src/unwind*.h
+}
diff --git a/sys-libs/libcxxrt/libcxxrt-0.0_p20170515.ebuild b/sys-libs/libcxxrt/libcxxrt-0.0_p20170515.ebuild
new file mode 100644
index 000000000000..8d68b661f0c3
--- /dev/null
+++ b/sys-libs/libcxxrt/libcxxrt-0.0_p20170515.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+EGIT_REPO_URI="https://github.com/pathscale/libcxxrt.git"
+
+[ "${PV%9999}" != "${PV}" ] && SCM="git-2" || SCM=""
+
+inherit flag-o-matic toolchain-funcs portability ${SCM} multilib-minimal
+
+DESCRIPTION="C++ Runtime from PathScale, FreeBSD and NetBSD"
+HOMEPAGE="https://github.com/pathscale/libcxxrt http://www.pathscale.com/node/265"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ SRC_URI="mirror://gentoo/${P}.tar.xz"
+ DEPEND="app-arch/xz-utils"
+else
+ SRC_URI=""
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ KEYWORDS="~amd64 ~arm64 ~mips ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="+libunwind +static-libs"
+
+RDEPEND="libunwind? ( || ( >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ sys-libs/llvm-libunwind[static-libs?,${MULTILIB_USEDEP}] ) )"
+DEPEND="${RDEPEND}
+ ${DEPEND}"
+
+DOCS=( AUTHORS COPYRIGHT README )
+
+src_prepare() {
+ cp "${FILESDIR}/Makefile" src/ || die
+ cp "${FILESDIR}/Makefile.test" test/Makefile || die
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ # Notes: we build -nodefaultlibs to avoid linking to gcc libs.
+ # libcxxrt needs: dladdr (dlopen_lib), libunwind or libgcc_s and the libc.
+ tc-export CC CXX AR
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
+ cd "${BUILD_DIR}/src"
+ LIBS="$(dlopen_lib) -l$(usex libunwind unwind gcc_s) -lc" emake shared
+ use static-libs && emake static
+}
+
+multilib_src_test() {
+ cd "${BUILD_DIR}/test"
+ LD_LIBRARY_PATH="${BUILD_DIR}/src:${LD_LIBRARY_PATH}" \
+ LIBS="-L${BUILD_DIR}/src -lcxxrt -l$(usex libunwind unwind gcc_s) -lc" \
+ emake check
+}
+
+multilib_src_install() {
+ # TODO: See README. Maybe hide it in a subdir and let only libcxx know about
+ # it. FreeBSD head installs it in /lib
+ dolib.so src/${PN}.so*
+ use static-libs && dolib.a src/${PN}.a
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ insinto /usr/include/libcxxrt/
+ doins src/cxxabi.h src/unwind*.h
+}
diff --git a/sys-libs/libcxxrt/libcxxrt-9999.ebuild b/sys-libs/libcxxrt/libcxxrt-9999.ebuild
new file mode 100644
index 000000000000..8d68b661f0c3
--- /dev/null
+++ b/sys-libs/libcxxrt/libcxxrt-9999.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+EGIT_REPO_URI="https://github.com/pathscale/libcxxrt.git"
+
+[ "${PV%9999}" != "${PV}" ] && SCM="git-2" || SCM=""
+
+inherit flag-o-matic toolchain-funcs portability ${SCM} multilib-minimal
+
+DESCRIPTION="C++ Runtime from PathScale, FreeBSD and NetBSD"
+HOMEPAGE="https://github.com/pathscale/libcxxrt http://www.pathscale.com/node/265"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ SRC_URI="mirror://gentoo/${P}.tar.xz"
+ DEPEND="app-arch/xz-utils"
+else
+ SRC_URI=""
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+if [ "${PV%9999}" = "${PV}" ] ; then
+ KEYWORDS="~amd64 ~arm64 ~mips ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="+libunwind +static-libs"
+
+RDEPEND="libunwind? ( || ( >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}]
+ sys-libs/llvm-libunwind[static-libs?,${MULTILIB_USEDEP}] ) )"
+DEPEND="${RDEPEND}
+ ${DEPEND}"
+
+DOCS=( AUTHORS COPYRIGHT README )
+
+src_prepare() {
+ cp "${FILESDIR}/Makefile" src/ || die
+ cp "${FILESDIR}/Makefile.test" test/Makefile || die
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ # Notes: we build -nodefaultlibs to avoid linking to gcc libs.
+ # libcxxrt needs: dladdr (dlopen_lib), libunwind or libgcc_s and the libc.
+ tc-export CC CXX AR
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
+ cd "${BUILD_DIR}/src"
+ LIBS="$(dlopen_lib) -l$(usex libunwind unwind gcc_s) -lc" emake shared
+ use static-libs && emake static
+}
+
+multilib_src_test() {
+ cd "${BUILD_DIR}/test"
+ LD_LIBRARY_PATH="${BUILD_DIR}/src:${LD_LIBRARY_PATH}" \
+ LIBS="-L${BUILD_DIR}/src -lcxxrt -l$(usex libunwind unwind gcc_s) -lc" \
+ emake check
+}
+
+multilib_src_install() {
+ # TODO: See README. Maybe hide it in a subdir and let only libcxx know about
+ # it. FreeBSD head installs it in /lib
+ dolib.so src/${PN}.so*
+ use static-libs && dolib.a src/${PN}.a
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ insinto /usr/include/libcxxrt/
+ doins src/cxxabi.h src/unwind*.h
+}
diff --git a/sys-libs/libcxxrt/metadata.xml b/sys-libs/libcxxrt/metadata.xml
new file mode 100644
index 000000000000..58657121adb2
--- /dev/null
+++ b/sys-libs/libcxxrt/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 type="person">
+ <email>aballier@gentoo.org</email>
+ <name>Alexis Ballier</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>bsd@gentoo.org</email>
+ <name>BSD Project</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="libunwind">Use libunwind instead of libgcc_s for unwinding. This should allow avoiding relying on <pkg>sys-devel/gcc</pkg> but for now clang is setup to use libgcc_s.</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">pathscale/libcxxrt</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libfaketime/Manifest b/sys-libs/libfaketime/Manifest
new file mode 100644
index 000000000000..a2c42a23b65f
--- /dev/null
+++ b/sys-libs/libfaketime/Manifest
@@ -0,0 +1,6 @@
+DIST libfaketime-0.9.6.tar.gz 51333 SHA256 3a89972708e262ae3a548655a04f197b48e9c82ac2b61acaeb1c47b135a682b7 SHA512 ab2e9c53f4ca2b9dcd2bbcd8de3ab9e27be57547ed9b52a17f07a6fe880fd3a283a6f10018736be2a6ba4e150f54e92161959ccb887be1f78ddfc96058729860 WHIRLPOOL 1a2dcc549286bb9d4e8a576ee8ea44b8508e6b40c581560099cf3351464470ef3b01e0ea8667e9d4973f5f8d35d3eeea68bd258f9ffc2fb0f424e128ba446a6d
+EBUILD libfaketime-0.9.6-r1.ebuild 776 SHA256 9f74acdbba4d9eae0836f5b1c0aed07f0f53f59b2de03b96c252c30a1823f1e4 SHA512 d15ae0475d7da5e11fd8da5c43a5eee289bae97ed33f2278f8d44699c167df79b30336abc014f6c79af103b79d86ef736e7faa2bb86c70d1749ac56daf0d99aa WHIRLPOOL ecfaa51f5f5e07c8acd698f2f5908e6cacdec380ddebae2efd8a062c7ba4119037f05b83f238204d050a4322e673c8274cc11f8754cab69684054d60cfbbaa79
+EBUILD libfaketime-0.9.6-r2.ebuild 1292 SHA256 3a652a1ae20dbb70be4a954474c21394aace147db40d898690257d76174b5a5b SHA512 f82ae9e534a3ad83f88f85c4a2b3d1a27036e779f5588220fc64721f40111484e237134e9819968970c86abd1c98642c0c4d2def6b3a195eb19c9cb97505f403 WHIRLPOOL 06441a06637e6826e51c4da6108d3928b3eefd6f2b3667c73e7630411b395570c128930d64219d57d944f40c1e4b3b366f92ab5466fd28f8a567d063da3b08e5
+MISC ChangeLog 3419 SHA256 e8eac6b91b47ce58b966db6a966012212e9113917c954a3f9ac1b29ef77ab03b SHA512 771b2f3508e39150634c5deaf5bfe3e336a7e6c608983286824515bb6c161bb6c53c2081657c2cf6cd9874b5c7802adc384c160caf1a33274d2fde06c0b4e721 WHIRLPOOL 2c141899fe82bdf807d2677df8b24ce853db8a544931300318f22bc9a0ff61344a1b690d386664b7066fee9d0cf48326c2dbcc23e69d36f87342907fc555e601
+MISC ChangeLog-2015 2325 SHA256 f5997d846ab4f4aa3a1a1bb802e5541e1ccb2b0d3c95e9408fa2b139072edb9d SHA512 6346e12d77c0b0a97c5c60c2afb04fc14613407abce3648d04d4a4b449d9a6b29acd06e0c7bdc1c5f7198b06824293144ee5ca965f00776344dd191f417814ec WHIRLPOOL fd089f1f6628268aca8b716f1b571a01f0bc69a0143ee412f3f61ada1165c47043cc466c0b552185235109752a014577c59c5adee594330e82013283b1886091
+MISC metadata.xml 844 SHA256 ffba964ed9e2a0dabaa25a197d00a2b5dda17840b8819de76bf48335dca053df SHA512 77924230fc18b29ee6c5891a73acde9158dabdec2d3f892ceeb84bc6e1b6f2b977dba05382a1da67fa8db6e57ca3be2161f6218e2f52feaefef690a0e1989893 WHIRLPOOL a74f74a7cf73efaebfab30e50c5c03c1c5b318b0868609f301c531748f97fee1023429161bf659b6fccb481481940d1980fc79c51e646256919b8e0ba165c308
diff --git a/sys-libs/libfaketime/libfaketime-0.9.6-r1.ebuild b/sys-libs/libfaketime/libfaketime-0.9.6-r1.ebuild
new file mode 100644
index 000000000000..33655f66e02d
--- /dev/null
+++ b/sys-libs/libfaketime/libfaketime-0.9.6-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit toolchain-funcs multilib
+
+DESCRIPTION="Report faked system time to programs"
+HOMEPAGE="http://www.code-wizards.com/projects/libfaketime/ https://github.com/wolfcw/libfaketime/"
+SRC_URI="http://www.code-wizards.com/projects/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 hppa x86"
+
+src_prepare() {
+ tc-export CC
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" LIBDIRNAME="/$(get_libdir)" PREFIX=/usr
+}
+
+src_install() {
+ dobin src/faketime
+ doman man/faketime.1
+ exeinto /usr/$(get_libdir)
+ doexe src/${PN}*.so.*
+ dosym ${PN}.so.1 /usr/$(get_libdir)/${PN}.so
+ dosym ${PN}MT.so.1 /usr/$(get_libdir)/${PN}MT.so
+ dodoc NEWS README TODO
+}
diff --git a/sys-libs/libfaketime/libfaketime-0.9.6-r2.ebuild b/sys-libs/libfaketime/libfaketime-0.9.6-r2.ebuild
new file mode 100644
index 000000000000..9ff87fcff830
--- /dev/null
+++ b/sys-libs/libfaketime/libfaketime-0.9.6-r2.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit toolchain-funcs multilib-minimal
+
+DESCRIPTION="Report faked system time to programs"
+HOMEPAGE="http://www.code-wizards.com/projects/libfaketime/ https://github.com/wolfcw/libfaketime"
+SRC_URI="http://www.code-wizards.com/projects/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 hppa sparc x86"
+
+src_prepare() {
+ sed -i 's/-Werror //' "${S}/src/Makefile" || die
+
+ # Bug #617624 (GCC-6 compatibility)
+ sed -i 's/-Wno-nonnull-compare //' "${S}/src/Makefile" || die
+
+ eapply_user
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ local target=all
+
+ pushd src > /dev/null || die
+ multilib_is_native_abi || target="${PN}.so.1 ${PN}MT.so.1"
+ # ${target} is intentionally not quoted
+ emake CC="$(tc-getCC)" LIBDIRNAME="/$(get_libdir)" PREFIX=/usr ${target}
+ popd > /dev/null || die
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake test
+}
+
+multilib_src_install() {
+ multilib_is_native_abi && dobin src/faketime
+ exeinto /usr/$(get_libdir)
+ doexe src/${PN}*.so.*
+ dosym ${PN}.so.1 /usr/$(get_libdir)/${PN}.so
+ dosym ${PN}MT.so.1 /usr/$(get_libdir)/${PN}MT.so
+}
+
+multilib_src_install_all() {
+ doman man/faketime.1
+ dodoc NEWS README TODO
+}
diff --git a/sys-libs/libfaketime/metadata.xml b/sys-libs/libfaketime/metadata.xml
new file mode 100644
index 000000000000..e4f0f0f8ff59
--- /dev/null
+++ b/sys-libs/libfaketime/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 type="person">
+ <email>whissi@gentoo.org</email>
+ <name>Thomas Deutschmann</name>
+ </maintainer>
+ <longdescription lang="en">
+ The Fake Time Preload Library (FTPL, a.k.a. libfaketime) intercepts
+ various system calls which programs use to retrieve the current date and time.
+ It can then report faked dates and times (as specified by you, the user) to
+ these programs. This means you can modify the system time a program sees
+ without having to change the time system-wide. FTPL allows you to specify both
+ absolute dates (e.g., 2004-01-01) and relative dates (e.g., 10 days ago).
+ </longdescription>
+ <upstream>
+ <remote-id type="github">wolfcw/libfaketime</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libhugetlbfs/Manifest b/sys-libs/libhugetlbfs/Manifest
new file mode 100644
index 000000000000..09c8a8506814
--- /dev/null
+++ b/sys-libs/libhugetlbfs/Manifest
@@ -0,0 +1,14 @@
+AUX libhugetlbfs-2.20-noexec-stack.patch 3513 SHA256 05e23ca6c2386c066c1d7e6a801f0b2e84901c9d94ee889fd7206ad72098bd03 SHA512 b8146512167da9530f107d3db4695d8e1174568c2f10bab41c3c3f8dff27b1357cef409e95cea75fbce177366a84904d80a7f1cfb7653dc6e8e10c0abfd8ef0b WHIRLPOOL 2440080979aca4dc38b14078b7eca168f0e3de535f19c594610ef780b2c481bcf80472c9b761dae9034e8bdfbe284a6f5dff07a7d5083a718d93c36c9fef5c87
+AUX libhugetlbfs-2.6-fixup-testsuite.patch 1231 SHA256 60d0e4a9a3a99e7ceab04f1479e6893403d43cb50bb740e8f2f632b05a2ec523 SHA512 af9ee541ac4a30260e17baab1616cee13fdcc679ae3fdceed29ca6282c12a6b60d24b04bb61e3aa5f42092e017eb3bae59a56fd2b03954e40803f9f6f2cc4f80 WHIRLPOOL c9a803d10b17de076a4a425dc3c5783fc31a51270d98a6e821808263f0fb7f23e688a922bcf62cf78e27f6bae3be0c3268e547bc373a33f8231ecadbf50b2377
+AUX libhugetlbfs-2.6-noexec-stack.patch 1497 SHA256 24de0b668c25568b70c705dbd3e1533c6358ad774ee96720b963ab7cd5226f2f SHA512 8aa87edbd238d28c03c61755480fa2ec6e8454f378f267054d911d26a8b9282ea0ca4d36fe4328205b838ba9a775eb8401316662e022fd673495272296556de4 WHIRLPOOL 360ff3ce07e7a48ad2d0c8aa539f7dc4fe81182100af25abf73fc59fbc6ce2f9af3d9ec60a9fd21fc73a861831507626c44a4478ece0b6f44f056c5c4dfe9606
+AUX libhugetlbfs-2.9-build.patch 1163 SHA256 7814841600b4cbaa67d041e61a42e81c243f73f3d689b09d23744e9c943c0f78 SHA512 d6443875d2dd2e44abfd470ec793b70d0cf5a69931e2c2889a7b204d1c27bc2abc3b0c7149a495845e080cb797b759844c330ad5c467aed7dae0669b7f5b7ff2 WHIRLPOOL 42551cf59b47a0598c04a2321f9ebb1c6177ee561350ac10840ab55588f4adc07372509241c4bd47c7498bb5e786f964ef047bb10b01ad279f771e8be3727fb5
+DIST libhugetlbfs-2.18.tar.gz 181275 SHA256 8c6ed5e884988e0c879a3705455ece153cf805f69cb9c710334e2711acbb6a06 SHA512 6dcdbf571d6a723a40c15e10b24533f16d65f67fe149aa2d25bee48a034d003419d4cf4b6e55fcd385e1214fc4f6b4dda72ba429b9eea9b38be9b1a393528746 WHIRLPOOL da0b17ca4d2a61be919ea47733b3da485714ce29cdc5e854e143ef0e9c0e45517a37649cb056eeeb74efe8c538f566267152aaad5d53ff837a3a15a9e11070cd
+DIST libhugetlbfs-2.19.tar.gz 181504 SHA256 a5ecb6e925ab2e491bcaa4049fbd6484740950da47d474e7af06dfc6bd1f690b SHA512 d21781fe68736eb3bbafeb8f36f4f34d30f290f2f6744b52c1a40161caf2e28b823cd8e9b9c74ec4e6d11f7d398d909f80eb736cc39a64ecc7bf571018bfec7c WHIRLPOOL bd76e6334acd11e55dec790170781aa418a74e4b1bd0007a15c0b65f5c0f4fd977d02eb89d6b16d48b4e4c7fd980ed2bd7ac9a8246179c0480874afe901da851
+DIST libhugetlbfs-2.20.tar.gz 186750 SHA256 feb51a17456e6ec9806e78720d4ae17a1211a5db8c9bb4ae654b7251a3f76166 SHA512 817fca3f8e3b127b9b877e0a03d0a94bf0c3ec481d3becf995986ce6ae0532629c5460100eb9f2ef3452ed59a3b9d3ac8362df8f87b387803c36d35ab7af0902 WHIRLPOOL e6c0244d47cee5966f1a51d7f39ea1cd0f26a7b1698b4471c6813ed9b2f194bc72d4087f62f72f5c2e5d99fcf00226b72b783a993ec39016625106f8ed17baca
+EBUILD libhugetlbfs-2.18.ebuild 3813 SHA256 6ff31b2068128e195f08bacde9c6171f457423b4940f636fba17a4a1ff57c9a2 SHA512 805aa633c2f036bd0d40f183f40169f2becd24c619d0198dfe8c088f97634ffb1c44a4e014a6349e9e11268c4c81f9e5cdc37b585cedecaeff1dd07bf8f6a205 WHIRLPOOL 0b6932e6acfb0f18beef139363d049bc73ff081e912ac5574c50b26ebc804b7970595a18337754d77a46087fb2fbfccb91249848d26b0c5141f26fd7eaddc4b7
+EBUILD libhugetlbfs-2.19-r1.ebuild 4376 SHA256 558dd593924e79beabda68a1822a13d99b73b91c8c2a3252cf05652245950f94 SHA512 874219cb5ee1cc94e66b1ee48ef2c0fdff1c045ec6964b7ad0038134d71c41691f657eca5c0721d5608417dd4b75fe4c63fd52f2fe3d8b9f230bb3dec25e2337 WHIRLPOOL 39edfe78b39734707c3894e85a671aa23c167940cb0e2955959761d0d17ea341a3c90896440132b82412af42fe413e2d554b2aa3f9d98426572e6d7db62842af
+EBUILD libhugetlbfs-2.19.ebuild 3956 SHA256 47c76e38efc0c8bc3fb5bcca6da6194b7f1f4a748ea1dbd050b97452fd8f6ebe SHA512 56f989b031415aa6398b8de29a131bde9e6e3c5c9c659717aeb7ee099af5ef920f1f335156baf58ec24dfa8be63dda9150d7a88298fa04b3c6eaf2416cbbb967 WHIRLPOOL d0fadad5214698c3db8140501cc02bcd1bd06aedab19a5509a359d6fd362255114667f6c4347183907968da99c2963e76590972736072e06ac3bab018344cc62
+EBUILD libhugetlbfs-2.20.ebuild 4461 SHA256 a1969a4712d10ccdaa717541ca63927f660f981899f33cff53db173797931109 SHA512 c8db19646892d790c08abd9e577c96bbfcb52de3e45087782a4019f0f5fffe0311079b5d8e61e96a75e5af56d3e9b0961e6a3d0b43f3d29ecf57c85fc12ce108 WHIRLPOOL 20199c138affb8af2a1c6bdac64371350d77f1915ba935d9e2ddac00d22676bd0d304f01b540e9c1a885e1a704d7e10649efccb66312597f80364b5db5e8d6a7
+MISC ChangeLog 4529 SHA256 63a38b3da64ec59b1554af344133e669b69c3936b8543ec0f3afcf689fae9d91 SHA512 762955da09786c023900dda3f5b61fd52bb3f7c36f679e1987c32567d97aa925bdf0b4b33c6205cc8c2fb278a882901dbe8290ab4d5a0fc7499c40b81ec5c81d WHIRLPOOL 6d33a9685c83d01020077d3928c472188800ccad485bbfc5bd379992c6ce2e2bd9982a0ef06f0e4b0866a51cf87bedb884e2b034dce269684fc0e1d046ede429
+MISC ChangeLog-2015 2477 SHA256 660726369b6c2a892c712f219d7cbfe1d7e6c5e2379a6c8dcea8346c43dcb310 SHA512 2b1c1b3c8634605a3569b1a42391aec26d91a6375c3ce9bdf3ea1f0b010c2b88d60c5904c8790ebbefcc64b9a82901b96d65625dee4de74d559add51af018ae0 WHIRLPOOL 2c2719f6db030e532b0696affaafd8f7271132fe0e63d520a8c2f9abaa86ec35101f8247551f6ee5999d8f93fd73c85ab1b467a4beebcf44b6506b0c48eca1a1
+MISC metadata.xml 484 SHA256 6d777c7cc038e8218eb0db9bb390f5facf45e24c1ef3ffb8e4eb2d8730d02ba0 SHA512 0dee09cbd2ca1a730dbe2a3c62ef1099959ab307c96f3106c483854310430dd59b45a7135a2db56a28684b0a4245898341527b1f67bb335456c8cdc14ae611fd WHIRLPOOL b44a940471183e80679e321a78dfc1c07a19bf1f803b1056119374f2132d386409e6a9fedef0c0f48c5a8bd2926afb6fa6dd2171a7cf019e4be06acdd681aea9
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.20-noexec-stack.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.20-noexec-stack.patch
new file mode 100644
index 000000000000..04c8baee37b8
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.20-noexec-stack.patch
@@ -0,0 +1,135 @@
+https://github.com/libhugetlbfs/libhugetlbfs/pull/9
+
+From 1c41d751d57a598919c40ab9c27514a98da93273 Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Sat, 31 Oct 2009 07:59:57 +0000
+Subject: [PATCH] set noexec markers in the asm file directly
+
+Using -Wl,-z,noexecstack can hide real exec stack issues coming from other
+files, and is a bit unportable. Instead, set proper section markers in the
+assembly files directly. It also means people using the static libraries
+won't have to use -Wl,-z,noexecstack when they link their code.
+---
+ Makefile | 2 +-
+ sys-aarch64elf.S | 4 ++++
+ sys-armelf_linux_eabi.S | 4 ++++
+ sys-elf32ppclinux.S | 4 ++++
+ sys-elf64_s390.S | 4 ++++
+ sys-elf64ppc.S | 4 ++++
+ sys-elf_i386.S | 4 ++++
+ sys-elf_s390.S | 4 ++++
+ sys-elf_x86_64.S | 4 ++++
+ 9 files changed, 33 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 73ebad7..ca987d9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -27,7 +27,7 @@ NODEPTARGETS=<version.h> <clean>
+
+ INSTALL = install
+
+-LDFLAGS += -Wl,-z,noexecstack -ldl
++LDFLAGS += -ldl
+ CFLAGS ?= -O2 -g
+ CFLAGS += -Wall -fPIC
+ CPPFLAGS += -D__LIBHUGETLBFS__
+diff --git a/sys-aarch64elf.S b/sys-aarch64elf.S
+index 54799d3..210558b 100644
+--- a/sys-aarch64elf.S
++++ b/sys-aarch64elf.S
+@@ -32,3 +32,7 @@ direct_syscall:
+ mov x6, x7
+ svc 0x0
+ ret
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-armelf_linux_eabi.S b/sys-armelf_linux_eabi.S
+index dfa7407..265b75d 100644
+--- a/sys-armelf_linux_eabi.S
++++ b/sys-armelf_linux_eabi.S
+@@ -31,3 +31,7 @@ direct_syscall:
+ swi 0x0
+ ldmfd sp!, {r4, r5, r6, r7}
+ bx lr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf32ppclinux.S b/sys-elf32ppclinux.S
+index 65d8b3f..6ba3f22 100644
+--- a/sys-elf32ppclinux.S
++++ b/sys-elf32ppclinux.S
+@@ -32,3 +32,7 @@ direct_syscall:
+ mr 8,9
+ sc
+ blr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf64_s390.S b/sys-elf64_s390.S
+index 425a387..5c31899 100644
+--- a/sys-elf64_s390.S
++++ b/sys-elf64_s390.S
+@@ -20,3 +20,7 @@ direct_syscall:
+ lgr %r5,%r6
+ svc 0
+ br %r14
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf64ppc.S b/sys-elf64ppc.S
+index d50f4a6..b57a345 100644
+--- a/sys-elf64ppc.S
++++ b/sys-elf64ppc.S
+@@ -46,3 +46,7 @@ direct_syscall:
+ mr 8,9
+ sc
+ blr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf_i386.S b/sys-elf_i386.S
+index ab30c8d..6182b3d 100644
+--- a/sys-elf_i386.S
++++ b/sys-elf_i386.S
+@@ -40,3 +40,7 @@ direct_syscall:
+ pop %edi
+ pop %ebp
+ ret
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf_s390.S b/sys-elf_s390.S
+index 40630d1..e6a9a96 100644
+--- a/sys-elf_s390.S
++++ b/sys-elf_s390.S
+@@ -20,3 +20,7 @@ direct_syscall:
+ lr %r5,%r6
+ svc 0
+ br %r14
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf_x86_64.S b/sys-elf_x86_64.S
+index 6af06ad..561f49b 100644
+--- a/sys-elf_x86_64.S
++++ b/sys-elf_x86_64.S
+@@ -32,3 +32,7 @@ direct_syscall:
+ mov 0x8(%rsp),%r9
+ syscall
+ retq
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+--
+2.6.2
+
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch
new file mode 100644
index 000000000000..12548a884a6f
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch
@@ -0,0 +1,31 @@
+diff -Nuar --exclude '*.S' --exclude Makefile libhugetlbfs-2.6.orig/tests/run_tests.py libhugetlbfs-2.6/tests/run_tests.py
+--- libhugetlbfs-2.6.orig/tests/run_tests.py 2009-08-24 05:56:07.000000000 -0700
++++ libhugetlbfs-2.6/tests/run_tests.py 2009-10-31 00:40:28.520387427 -0700
+@@ -56,6 +56,11 @@
+ local_env["LD_LIBRARY_PATH"] = "../obj%d:obj%d:%s" \
+ % (bits, bits, local_env.get("LD_LIBRARY_PATH", ""))
+ local_env["HUGETLB_DEFAULT_PAGE_SIZE"] = repr(pagesize)
++ if isinstance(cmd, types.StringType):
++ cmd = 'obj%d/%s' % (bits, cmd)
++ else:
++ s = 'obj%d/%s' % (bits, cmd[0])
++ cmd = (s,)+(cmd[1:])
+
+ p = subprocess.Popen(cmd, env=local_env, stdout=subprocess.PIPE)
+ try:
+@@ -523,10 +528,11 @@
+ elfshare_test("linkshare")
+ elflink_and_share_test("linkhuge")
+
+- # elflink_rw tests
+- elflink_rw_test("linkhuge_rw")
+- # elflink_rw sharing tests
+- elflink_rw_and_share_test("linkhuge_rw")
++ if 32 in wordsizes:
++ # elflink_rw tests
++ elflink_rw_test("linkhuge_rw")
++ # elflink_rw sharing tests
++ elflink_rw_and_share_test("linkhuge_rw")
+
+ # Accounting bug tests
+ # reset free hpages because sharing will have held some
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch
new file mode 100644
index 000000000000..bf964cda7a68
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch
@@ -0,0 +1,44 @@
+diff -Nuar libhugetlbfs-2.6.orig/sys-elf32ppclinux.S libhugetlbfs-2.6/sys-elf32ppclinux.S
+--- libhugetlbfs-2.6.orig/sys-elf32ppclinux.S 2009-08-24 12:56:07.000000000 +0000
++++ libhugetlbfs-2.6/sys-elf32ppclinux.S 2009-10-31 06:43:49.040319417 +0000
+@@ -32,3 +32,7 @@
+ mr 8,9
+ sc
+ blr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff -Nuar libhugetlbfs-2.6.orig/sys-elf64ppc.S libhugetlbfs-2.6/sys-elf64ppc.S
+--- libhugetlbfs-2.6.orig/sys-elf64ppc.S 2009-08-24 12:56:07.000000000 +0000
++++ libhugetlbfs-2.6/sys-elf64ppc.S 2009-10-31 06:43:54.303652251 +0000
+@@ -41,3 +41,7 @@
+ mr 8,9
+ sc
+ blr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff -Nuar libhugetlbfs-2.6.orig/sys-elf_i386.S libhugetlbfs-2.6/sys-elf_i386.S
+--- libhugetlbfs-2.6.orig/sys-elf_i386.S 2009-08-24 12:56:07.000000000 +0000
++++ libhugetlbfs-2.6/sys-elf_i386.S 2009-10-31 06:43:57.536975670 +0000
+@@ -40,3 +40,7 @@
+ pop %edi
+ pop %ebp
+ ret
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff -Nuar libhugetlbfs-2.6.orig/sys-elf_x86_64.S libhugetlbfs-2.6/sys-elf_x86_64.S
+--- libhugetlbfs-2.6.orig/sys-elf_x86_64.S 2009-08-24 12:56:07.000000000 +0000
++++ libhugetlbfs-2.6/sys-elf_x86_64.S 2009-10-31 06:44:26.943648847 +0000
+@@ -32,3 +32,7 @@
+ mov 0x8(%rsp),%r9
+ syscall
+ retq
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.9-build.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.9-build.patch
new file mode 100644
index 000000000000..827e2a58d101
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.9-build.patch
@@ -0,0 +1,31 @@
+--- Makefile.orig 2010-08-13 20:14:18.000000000 -0400
++++ Makefile 2010-08-13 20:14:42.000000000 -0400
+@@ -314,24 +314,24 @@
+ $(BIN_OBJ_DIR)/hugectl: $(BIN_OBJ_DIR)/hugectl.o
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+- $(CCBIN) $(CPPFLAGS) $(CFLAGS) -o $@ $^
++ $(CCBIN) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+ $(BIN_OBJ_DIR)/hugeedit: $(BIN_OBJ_DIR)/hugeedit.o
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+- $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
++ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^ $(LDFLAGS)
+
+ HUGEADM_OBJ=hugeadm.o libhugetlbfs_privutils.a
+ $(BIN_OBJ_DIR)/hugeadm: $(foreach file,$(HUGEADM_OBJ),$(BIN_OBJ_DIR)/$(file))
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+- $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
++ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^ $(LDFLAGS)
+
+ PAGESIZE_OBJ=pagesize.o libhugetlbfs_privutils.a
+ $(BIN_OBJ_DIR)/pagesize: $(foreach file,$(PAGESIZE_OBJ),$(BIN_OBJ_DIR)/$(file))
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+- $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
++ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^ $(LDFLAGS)
+
+ clean:
+ @$(VECHO) CLEAN
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.18.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.18.ebuild
new file mode 100644
index 000000000000..3725a9c49750
--- /dev/null
+++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.18.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="easy hugepage access"
+HOMEPAGE="http://libhugetlbfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="static-libs"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
+ epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
+ epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
+ sed -i \
+ -e '/^PREFIX/s:/local::' \
+ -e '1iBUILDTYPE = NATIVEONLY' \
+ -e '1iV = 1' \
+ -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
+ -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
+ Makefile
+ if [ "$(get_libdir)" == "lib64" ]; then
+ sed -i \
+ -e "/^LIB\(32\)/s:=.*:= lib32:" \
+ Makefile
+ fi
+}
+
+src_compile() {
+ tc-export AR
+ emake CC="$(tc-getCC)" libs tools
+}
+
+src_install() {
+ default
+ use static-libs || rm -f "${D}"/usr/$(get_libdir)/*.a
+ rm "${D}"/usr/bin/oprofile* || die
+}
+
+src_test_alloc_one() {
+ hugeadm="$1"
+ sign="$2"
+ pagesize="$3"
+ pagecount="$4"
+ ${hugeadm} \
+ --pool-pages-max ${pagesize}:${sign}${pagecount} \
+ && \
+ ${hugeadm} \
+ --pool-pages-min ${pagesize}:${sign}${pagecount}
+ return $?
+}
+
+# die is NOT allowed in this src_test block after the marked point, so that we
+# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
+src_test() {
+ [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
+ einfo "Building testsuite"
+ emake -j1 tests || die "Failed to build tests"
+
+ hugeadm='obj/hugeadm'
+ allocated=''
+ rc=0
+ # the testcases need 64MiB per pagesize.
+ MIN_HUGEPAGE_RAM=$((64*1024*1024))
+
+ einfo "Planning allocation"
+ PAGESIZES="$(${hugeadm} --page-sizes-all)"
+
+ # Need to do this before we can create the mountpoints.
+ for pagesize in ${PAGESIZES} ; do
+ # The kernel depends on the location :-(
+ mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ done
+ addwrite /proc/sys/vm/
+ addwrite /proc/sys/kernel/shmall
+ addwrite /proc/sys/kernel/shmmax
+ addwrite /proc/sys/kernel/shmmni
+
+ einfo "Checking HugeTLB mountpoints"
+ ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
+
+ # -----------------------------------------------------
+ # --------- die is unsafe after this point. -----------
+ # -----------------------------------------------------
+
+ einfo "Starting allocation"
+ for pagesize in ${PAGESIZES} ; do
+ pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
+ einfo " ${pagecount} @ ${pagesize}"
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
+ rc=$?
+ if [[ $rc -eq 0 ]]; then
+ allocated="${allocated} ${pagesize}:${pagecount}"
+ else
+ eerror "Failed to add ${pagecount} pages of size ${pagesize}"
+ fi
+ done
+
+ einfo "Allocation status"
+ ${hugeadm} --pool-list
+
+ if [[ -n "${allocated}" ]]; then
+ # All our allocations worked, so time to run.
+ einfo "Starting tests"
+ cd "${S}"/tests
+ TESTOPTS="-t func"
+ case $ARCH in
+ amd64|ppc64)
+ TESTOPTS="${TESTOPTS} -b 64"
+ ;;
+ x86)
+ TESTOPTS="${TESTOPTS} -b 32"
+ ;;
+ esac
+ # This needs a bit of work to give a nice exit code still.
+ ./run_tests.py ${TESTOPTS}
+ rc=$?
+ else
+ eerror "Failed to make HugeTLB allocations."
+ rc=1
+ fi
+
+ einfo "Cleaning up memory"
+ cd "${S}"
+ # Cleanup memory allocation
+ for alloc in ${allocated} ; do
+ pagesize="${alloc/:*}"
+ pagecount="${alloc/*:}"
+ einfo " ${pagecount} @ ${pagesize}"
+ src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
+ done
+
+ # ---------------------------------------------------------
+ # --------- die is safe again after this point. -----------
+ # ---------------------------------------------------------
+
+ return $rc
+}
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.19-r1.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.19-r1.ebuild
new file mode 100644
index 000000000000..030f4c4f9894
--- /dev/null
+++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.19-r1.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib toolchain-funcs perl-functions python-any-r1
+
+DESCRIPTION="easy hugepage access"
+HOMEPAGE="https://github.com/libhugetlbfs/libhugetlbfs"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+# Switch to github tarball w/next release.
+#SRC_URI="https://github.com/libhugetlbfs/libhugetlbfs/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="perl static-libs test"
+
+DEPEND="test? ( ${PYTHON_DEPS} )"
+RDEPEND="perl? ( dev-lang/perl:= )"
+
+src_prepare() {
+ perl_set_version
+
+ epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
+ epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
+ epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
+ sed -i \
+ -e '/^PREFIX/s:/local::' \
+ -e '1iBUILDTYPE = NATIVEONLY' \
+ -e '1iV = 1' \
+ -e '/gzip.*MANDIR/d' \
+ -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
+ -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
+ -e "/^PMDIR = .*\/perl5\/TLBC/s::PMDIR = ${VENDOR_LIB}\/TLBC:" \
+ Makefile || die "sed failed"
+ if [ "$(get_libdir)" == "lib64" ]; then
+ sed -i \
+ -e "/^LIB\(32\)/s:=.*:= lib32:" \
+ Makefile
+ fi
+}
+
+src_compile() {
+ tc-export AR
+ emake CC="$(tc-getCC)" libs tools
+}
+
+src_install() {
+ default
+ use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.a
+ rm "${ED}"/usr/bin/oprofile* || die
+ if ! use perl ; then
+ rm -r \
+ "${ED}"/usr/bin/cpupcstat \
+ "${ED}"/usr/share/man/man8/cpupcstat.8 \
+ "${ED}/${VENDOR_LIB}" \
+ || die
+ fi
+}
+
+src_test_alloc_one() {
+ hugeadm="$1"
+ sign="$2"
+ pagesize="$3"
+ pagecount="$4"
+ ${hugeadm} \
+ --pool-pages-max ${pagesize}:${sign}${pagecount} \
+ && \
+ ${hugeadm} \
+ --pool-pages-min ${pagesize}:${sign}${pagecount}
+ return $?
+}
+
+# die is NOT allowed in this src_test block after the marked point, so that we
+# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
+src_test() {
+ [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
+ einfo "Building testsuite"
+ emake -j1 tests || die "Failed to build tests"
+
+ hugeadm='obj/hugeadm'
+ allocated=''
+ rc=0
+ # the testcases need 64MiB per pagesize.
+ MIN_HUGEPAGE_RAM=$((64*1024*1024))
+
+ einfo "Planning allocation"
+ PAGESIZES="$(${hugeadm} --page-sizes-all)"
+
+ # Need to do this before we can create the mountpoints.
+ for pagesize in ${PAGESIZES} ; do
+ # The kernel depends on the location :-(
+ mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ done
+ addwrite /proc/sys/vm/
+ addwrite /proc/sys/kernel/shmall
+ addwrite /proc/sys/kernel/shmmax
+ addwrite /proc/sys/kernel/shmmni
+
+ einfo "Checking HugeTLB mountpoints"
+ ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
+
+ # -----------------------------------------------------
+ # --------- die is unsafe after this point. -----------
+ # -----------------------------------------------------
+
+ einfo "Starting allocation"
+ for pagesize in ${PAGESIZES} ; do
+ pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
+ einfo " ${pagecount} @ ${pagesize}"
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
+ rc=$?
+ if [[ $rc -eq 0 ]]; then
+ allocated="${allocated} ${pagesize}:${pagecount}"
+ else
+ eerror "Failed to add ${pagecount} pages of size ${pagesize}"
+ fi
+ done
+
+ einfo "Allocation status"
+ ${hugeadm} --pool-list
+
+ if [[ -n "${allocated}" ]]; then
+ # All our allocations worked, so time to run.
+ einfo "Starting tests"
+ cd "${S}"/tests
+ TESTOPTS="-t func"
+ case $ARCH in
+ amd64|ppc64)
+ TESTOPTS="${TESTOPTS} -b 64"
+ ;;
+ x86)
+ TESTOPTS="${TESTOPTS} -b 32"
+ ;;
+ esac
+ # This needs a bit of work to give a nice exit code still.
+ ./run_tests.py ${TESTOPTS}
+ rc=$?
+ else
+ eerror "Failed to make HugeTLB allocations."
+ rc=1
+ fi
+
+ einfo "Cleaning up memory"
+ cd "${S}"
+ # Cleanup memory allocation
+ for alloc in ${allocated} ; do
+ pagesize="${alloc/:*}"
+ pagecount="${alloc/*:}"
+ einfo " ${pagecount} @ ${pagesize}"
+ src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
+ done
+
+ # ---------------------------------------------------------
+ # --------- die is safe again after this point. -----------
+ # ---------------------------------------------------------
+
+ return $rc
+}
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild
new file mode 100644
index 000000000000..07b65a2775a2
--- /dev/null
+++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.19.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="easy hugepage access"
+HOMEPAGE="https://github.com/libhugetlbfs/libhugetlbfs"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+# Switch to github tarball w/next release.
+#SRC_URI="https://github.com/libhugetlbfs/libhugetlbfs/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="static-libs"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
+ epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
+ epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
+ sed -i \
+ -e '/^PREFIX/s:/local::' \
+ -e '1iBUILDTYPE = NATIVEONLY' \
+ -e '1iV = 1' \
+ -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
+ -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
+ Makefile
+ if [ "$(get_libdir)" == "lib64" ]; then
+ sed -i \
+ -e "/^LIB\(32\)/s:=.*:= lib32:" \
+ Makefile
+ fi
+}
+
+src_compile() {
+ tc-export AR
+ emake CC="$(tc-getCC)" libs tools
+}
+
+src_install() {
+ default
+ use static-libs || rm -f "${D}"/usr/$(get_libdir)/*.a
+ rm "${D}"/usr/bin/oprofile* || die
+}
+
+src_test_alloc_one() {
+ hugeadm="$1"
+ sign="$2"
+ pagesize="$3"
+ pagecount="$4"
+ ${hugeadm} \
+ --pool-pages-max ${pagesize}:${sign}${pagecount} \
+ && \
+ ${hugeadm} \
+ --pool-pages-min ${pagesize}:${sign}${pagecount}
+ return $?
+}
+
+# die is NOT allowed in this src_test block after the marked point, so that we
+# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
+src_test() {
+ [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
+ einfo "Building testsuite"
+ emake -j1 tests || die "Failed to build tests"
+
+ hugeadm='obj/hugeadm'
+ allocated=''
+ rc=0
+ # the testcases need 64MiB per pagesize.
+ MIN_HUGEPAGE_RAM=$((64*1024*1024))
+
+ einfo "Planning allocation"
+ PAGESIZES="$(${hugeadm} --page-sizes-all)"
+
+ # Need to do this before we can create the mountpoints.
+ for pagesize in ${PAGESIZES} ; do
+ # The kernel depends on the location :-(
+ mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ done
+ addwrite /proc/sys/vm/
+ addwrite /proc/sys/kernel/shmall
+ addwrite /proc/sys/kernel/shmmax
+ addwrite /proc/sys/kernel/shmmni
+
+ einfo "Checking HugeTLB mountpoints"
+ ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
+
+ # -----------------------------------------------------
+ # --------- die is unsafe after this point. -----------
+ # -----------------------------------------------------
+
+ einfo "Starting allocation"
+ for pagesize in ${PAGESIZES} ; do
+ pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
+ einfo " ${pagecount} @ ${pagesize}"
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
+ rc=$?
+ if [[ $rc -eq 0 ]]; then
+ allocated="${allocated} ${pagesize}:${pagecount}"
+ else
+ eerror "Failed to add ${pagecount} pages of size ${pagesize}"
+ fi
+ done
+
+ einfo "Allocation status"
+ ${hugeadm} --pool-list
+
+ if [[ -n "${allocated}" ]]; then
+ # All our allocations worked, so time to run.
+ einfo "Starting tests"
+ cd "${S}"/tests
+ TESTOPTS="-t func"
+ case $ARCH in
+ amd64|ppc64)
+ TESTOPTS="${TESTOPTS} -b 64"
+ ;;
+ x86)
+ TESTOPTS="${TESTOPTS} -b 32"
+ ;;
+ esac
+ # This needs a bit of work to give a nice exit code still.
+ ./run_tests.py ${TESTOPTS}
+ rc=$?
+ else
+ eerror "Failed to make HugeTLB allocations."
+ rc=1
+ fi
+
+ einfo "Cleaning up memory"
+ cd "${S}"
+ # Cleanup memory allocation
+ for alloc in ${allocated} ; do
+ pagesize="${alloc/:*}"
+ pagecount="${alloc/*:}"
+ einfo " ${pagecount} @ ${pagesize}"
+ src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
+ done
+
+ # ---------------------------------------------------------
+ # --------- die is safe again after this point. -----------
+ # ---------------------------------------------------------
+
+ return $rc
+}
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.20.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.20.ebuild
new file mode 100644
index 000000000000..c3c800361c4d
--- /dev/null
+++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.20.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib toolchain-funcs perl-functions python-any-r1
+
+DESCRIPTION="easy hugepage access"
+HOMEPAGE="https://github.com/libhugetlbfs/libhugetlbfs"
+SRC_URI="https://github.com/libhugetlbfs/libhugetlbfs/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~s390 ~x86"
+IUSE="perl static-libs test"
+
+DEPEND="test? ( ${PYTHON_DEPS} )"
+RDEPEND="perl? ( dev-lang/perl:= )"
+
+src_prepare() {
+ perl_set_version
+
+ epatch "${FILESDIR}"/${PN}-2.9-build.patch #332517
+ epatch "${FILESDIR}"/${PN}-2.20-noexec-stack.patch
+ epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
+ sed -i \
+ -e '/^PREFIX/s:/local::' \
+ -e '1iBUILDTYPE = NATIVEONLY' \
+ -e '1iV = 1' \
+ -e '/gzip.*MANDIR/d' \
+ -e "/^LIB\(32\)/s:=.*:= $(get_libdir):" \
+ -e '/^CC\(32\|64\)/s:=.*:= $(CC):' \
+ -e "/^PMDIR = .*\/perl5\/TLBC/s::PMDIR = ${VENDOR_LIB}\/TLBC:" \
+ Makefile || die "sed failed"
+ if [ "$(get_libdir)" == "lib64" ]; then
+ sed -i \
+ -e "/^LIB\(32\)/s:=.*:= lib32:" \
+ Makefile
+ fi
+
+ # Tarballs from github don't have the version set.
+ # https://github.com/libhugetlbfs/libhugetlbfs/issues/7
+ [[ -f version ]] || echo "${PV}" > version
+}
+
+src_compile() {
+ tc-export AR
+ emake CC="$(tc-getCC)" libs tools
+}
+
+src_install() {
+ default
+ use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.a
+ rm "${ED}"/usr/bin/oprofile* || die
+ if ! use perl ; then
+ rm -r \
+ "${ED}"/usr/bin/cpupcstat \
+ "${ED}"/usr/share/man/man8/cpupcstat.8 \
+ "${ED}/${VENDOR_LIB}" \
+ || die
+ fi
+}
+
+src_test_alloc_one() {
+ hugeadm="$1"
+ sign="$2"
+ pagesize="$3"
+ pagecount="$4"
+ ${hugeadm} \
+ --pool-pages-max ${pagesize}:${sign}${pagecount} \
+ && \
+ ${hugeadm} \
+ --pool-pages-min ${pagesize}:${sign}${pagecount}
+ return $?
+}
+
+# die is NOT allowed in this src_test block after the marked point, so that we
+# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
+src_test() {
+ [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
+ einfo "Building testsuite"
+ emake -j1 tests || die "Failed to build tests"
+
+ hugeadm='obj/hugeadm'
+ allocated=''
+ rc=0
+ # the testcases need 64MiB per pagesize.
+ MIN_HUGEPAGE_RAM=$((64*1024*1024))
+
+ einfo "Planning allocation"
+ PAGESIZES="$(${hugeadm} --page-sizes-all)"
+
+ # Need to do this before we can create the mountpoints.
+ for pagesize in ${PAGESIZES} ; do
+ # The kernel depends on the location :-(
+ mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ done
+ addwrite /proc/sys/vm/
+ addwrite /proc/sys/kernel/shmall
+ addwrite /proc/sys/kernel/shmmax
+ addwrite /proc/sys/kernel/shmmni
+
+ einfo "Checking HugeTLB mountpoints"
+ ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
+
+ # -----------------------------------------------------
+ # --------- die is unsafe after this point. -----------
+ # -----------------------------------------------------
+
+ einfo "Starting allocation"
+ for pagesize in ${PAGESIZES} ; do
+ pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
+ einfo " ${pagecount} @ ${pagesize}"
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
+ rc=$?
+ if [[ $rc -eq 0 ]]; then
+ allocated="${allocated} ${pagesize}:${pagecount}"
+ else
+ eerror "Failed to add ${pagecount} pages of size ${pagesize}"
+ fi
+ done
+
+ einfo "Allocation status"
+ ${hugeadm} --pool-list
+
+ if [[ -n "${allocated}" ]]; then
+ # All our allocations worked, so time to run.
+ einfo "Starting tests"
+ cd "${S}"/tests
+ TESTOPTS="-t func"
+ case $ARCH in
+ amd64|ppc64)
+ TESTOPTS="${TESTOPTS} -b 64"
+ ;;
+ x86)
+ TESTOPTS="${TESTOPTS} -b 32"
+ ;;
+ esac
+ # This needs a bit of work to give a nice exit code still.
+ ./run_tests.py ${TESTOPTS}
+ rc=$?
+ else
+ eerror "Failed to make HugeTLB allocations."
+ rc=1
+ fi
+
+ einfo "Cleaning up memory"
+ cd "${S}"
+ # Cleanup memory allocation
+ for alloc in ${allocated} ; do
+ pagesize="${alloc/:*}"
+ pagecount="${alloc/*:}"
+ einfo " ${pagecount} @ ${pagesize}"
+ src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
+ done
+
+ # ---------------------------------------------------------
+ # --------- die is safe again after this point. -----------
+ # ---------------------------------------------------------
+
+ return $rc
+}
diff --git a/sys-libs/libhugetlbfs/metadata.xml b/sys-libs/libhugetlbfs/metadata.xml
new file mode 100644
index 000000000000..534f22e29cc0
--- /dev/null
+++ b/sys-libs/libhugetlbfs/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="perl">Install the cpupcstat tool and some perl modules</flag>
+</use>
+<upstream>
+ <remote-id type="github">libhugetlbfs/libhugetlbfs</remote-id>
+ <remote-id type="sourceforge">libhugetlbfs</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/libhx/Manifest b/sys-libs/libhx/Manifest
new file mode 100644
index 000000000000..4e24be855b7d
--- /dev/null
+++ b/sys-libs/libhx/Manifest
@@ -0,0 +1,9 @@
+AUX libhx-3.22-no-lyx.patch 495 SHA256 5ed1f40c793f48b2b724dc96bda738e86ebd81c14e52174a43d78c717499a67a SHA512 f4299755b65c7e3b64937df81feed58851bfe7e4938c4b47cd94f818bb7d5c80eecac34b7e80b1c051b07490b3730cc74d6f38cd47a7c4321882a8715ff4b802 WHIRLPOOL 2b157b663014567a3c8be31a93fd319575819aea2287551840436a0473441d192e742ebe88ebaa0543bdd61b8254140c12693c6d901df2472fdba3badd32e5b4
+DIST libHX-3.16.tar.xz 867336 SHA256 b744e3754eebab5c81a7dbd5d77b3a94af8edf60488e6b4887c2b1cc332511f3 SHA512 d5c6f4ac889f4d1043d58742305632c78143c683be09ddd4288c3911747d4c5c6b33b4c1517813066f7933d87dcb7b8cd1dfb015f08c7e7afccc718899cdd259 WHIRLPOOL 3a0c44b4bd809f6f9051ae6c7a25dd03d85e3dbea0f3f982302f94d1a28bcb9cbfaa7c5a1bbf0a3f4e026cb515043b7496c108031786bd1f4ee1b976ed5de8bb
+DIST libHX-3.22.tar.xz 875516 SHA256 cc2087a964a82d2e50e8161cf458481ededebb7021e4660410cf53248a4c83a3 SHA512 4a50b7171be9f60e1a1bfefb0641f74fa8879c0edb258533ee04ec89617802c48358dc244497fb18d02dc37f828f79f7c52dd5ce2a07d8a2f5e6e6f7b4e97646 WHIRLPOOL 36d582261bce3cf4f3306d49876e4f44811e0782aee8e1b01838aa5397589e227f315d1b5da27ff1a8e8f118322ab9064831ac49c7ae0e26acdec054e8bf07c4
+EBUILD libhx-3.16.ebuild 562 SHA256 116b6272129a65d52aca48ee3db1698170675336e11c134a5c312f72729877da SHA512 54cb5f94b0da5796bd84d6f9ed825dcbce7b2c453107a2353514cbc0260299194c02d2bdd6f37543c875c11472d3f3f2f32bd04ddd28e1bce6e5c894b44a1649 WHIRLPOOL ef55dc526fdd8e16766c993368630a006a674fa4dfe1c7b1e8d6250ab51c8c4be8df8a67a64c2cc9972f39b2e5adc723f05032768e53f5d6413b875d5c7e6b22
+EBUILD libhx-3.22-r1.ebuild 704 SHA256 48639abd683c7e394ca36ecb16fa389d22879a877db9e91b26bf1709a9a8569a SHA512 b02728cf4b52e6739de5ac0aa232c43e020fbbcb38fe995033fdbee48ee3b606b2006a23c1bfd0401736d23aeb030209c1fdd69bf971a17062a11501782a2a84 WHIRLPOOL 3bc18dc58f71768d200bbd0b5d6a4dfde89c5941062468c3846ac5b4c2ef8269e993beff8ff73c3e3433f48d230c652bdad67e4e9552adca94d13ed923549c45
+EBUILD libhx-3.22.ebuild 565 SHA256 fdd0761f2822d5763e2bed9914709af8bbeaf9dba1cabe3ad35743c0d041e758 SHA512 4c6e03bf3fc8fbb16ae64c02ae3f3293828ea0409aab2ec6f730a06b5131fdf5b5f9908b62c60ca6fc72e35cfc63c61d36987b8d28def5343977c84904ca923e WHIRLPOOL 8e12b40aca5567db1663c0e8ecafe2cff8cb4351e7c78ae9600f1e521395cbe245ea031b8799f1787ca52788b5eacea93c1437416d1f510e2111540c4b281f67
+MISC ChangeLog 2663 SHA256 302f117acf72649cb3b535dcc40c0fe55e585cb81a79a5403e9f21287bf04d19 SHA512 9e0a59ad83a06a9aa9dac7bf1703f9ec39abcd3dd1de6cc1b86e242e44a7d7cb902d9701bc64fc3679ad6e8acfdb3e67be749f9fa4c958d5e489edee1fd32ce0 WHIRLPOOL f514c552632e8ac13d7063fcfc23c8882a4fc6e181356eca9e240260ecca2531a8521a552e4d64e6550aed9a79778932984233325a5d3ef5222a30c4a14a3850
+MISC ChangeLog-2015 6179 SHA256 727d32faca86791b061552740743c49c65f45b4b5227b490be9fb921ff3739ab SHA512 20850afd32898d152015a023b5ddfae600bec0bfc86abc523effdb3a207ae291bd7f1918ca9b51498fe3c2ceb4ebddd7ceb474f5564382371ab27b8020346a32 WHIRLPOOL 0a160d3e515fe7e7d5c38fcbd24937904d274d19c83cdb2cfd800b523a79df16d7edbc89a2b8d95ae1aef4b158d5e47a3d2bcaa34ee211cf2bb94a3d4e890f26
+MISC metadata.xml 398 SHA256 f5ee614e4b17d366be8ada1f4f023f25c919fabf2d4e46af7eabfc84a1794f68 SHA512 74a2fb87430a3e105fcfdacdbd594f9f64710749760ec4b49f6c7c3fec64f59641c5204b72481d436ae8abd46438b27d04d392ce7d93be68613608909c772fd0 WHIRLPOOL 9d3cd1596b561223e636d6ae0b60ae2cf76dc59c73c901b04eddbc76715ee2341aa3214f1ca362f710c2e25d6ba96028d181df45921c1c6e4242fed289f77edd
diff --git a/sys-libs/libhx/files/libhx-3.22-no-lyx.patch b/sys-libs/libhx/files/libhx-3.22-no-lyx.patch
new file mode 100644
index 000000000000..1c63d2596aae
--- /dev/null
+++ b/sys-libs/libhx/files/libhx-3.22-no-lyx.patch
@@ -0,0 +1,12 @@
+--- libHX-3.22/configure.ac.orig 2014-08-25 19:16:37.000000000 +0400
++++ libHX-3.22/configure.ac 2016-06-01 11:09:42.287438190 +0300
+@@ -107,8 +107,7 @@
+ AC_CHECK_FUNCS([getegid geteuid getpid getppid])
+ AM_CONDITIONAL([B_PROC], [test "$b_proc" = 1])
+
+-AC_CHECK_PROGS([LYX], [lyx])
+-AM_CONDITIONAL([BUILD_DOCS], [test -n "$LYX"])
++AM_CONDITIONAL([BUILD_DOCS], [false])
+
+ regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
+ regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
diff --git a/sys-libs/libhx/libhx-3.16.ebuild b/sys-libs/libhx/libhx-3.16.ebuild
new file mode 100644
index 000000000000..f089d0738420
--- /dev/null
+++ b/sys-libs/libhx/libhx-3.16.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Platform independent library providing basic system functions"
+HOMEPAGE="http://libhx.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/libHX-${PV}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+DEPEND="app-arch/xz-utils"
+RDEPEND=""
+
+S="${WORKDIR}/libHX-${PV}"
+
+src_configure() {
+ econf --docdir="/usr/share/doc/${PF}"
+}
+
+src_install() {
+ default
+ dodoc doc/*.txt
+ prune_libtool_files --all
+}
diff --git a/sys-libs/libhx/libhx-3.22-r1.ebuild b/sys-libs/libhx/libhx-3.22-r1.ebuild
new file mode 100644
index 000000000000..69c5c6d1ef3d
--- /dev/null
+++ b/sys-libs/libhx/libhx-3.22-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils
+
+DESCRIPTION="Platform independent library providing basic system functions"
+HOMEPAGE="http://libhx.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/libHX-${PV}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="doc"
+
+DEPEND="app-arch/xz-utils"
+RDEPEND=""
+
+S="${WORKDIR}/libHX-${PV}"
+
+PATCHES=( "${FILESDIR}/${P}-no-lyx.patch" )
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_install() {
+ default
+
+ if use doc; then
+ dodoc doc/*.txt
+ else
+ dodoc doc/changelog.txt
+ rm "${D}/usr/share/doc/${PF}/"*.pdf || die
+ fi
+
+ prune_libtool_files --all
+}
diff --git a/sys-libs/libhx/libhx-3.22.ebuild b/sys-libs/libhx/libhx-3.22.ebuild
new file mode 100644
index 000000000000..2790a6dacad8
--- /dev/null
+++ b/sys-libs/libhx/libhx-3.22.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Platform independent library providing basic system functions"
+HOMEPAGE="http://libhx.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/libHX-${PV}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND="app-arch/xz-utils"
+RDEPEND=""
+
+S="${WORKDIR}/libHX-${PV}"
+
+src_configure() {
+ econf --docdir="/usr/share/doc/${PF}"
+}
+
+src_install() {
+ default
+ dodoc doc/*.txt
+ prune_libtool_files --all
+}
diff --git a/sys-libs/libhx/metadata.xml b/sys-libs/libhx/metadata.xml
new file mode 100644
index 000000000000..fc0ea3009123
--- /dev/null
+++ b/sys-libs/libhx/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 type="person">
+ <email>hanno@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>mattst88@gentoo.org</email>
+ <name>Matt Turner</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">libhx</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libieee1284/Manifest b/sys-libs/libieee1284/Manifest
new file mode 100644
index 000000000000..553d4b619d4b
--- /dev/null
+++ b/sys-libs/libieee1284/Manifest
@@ -0,0 +1,6 @@
+DIST libieee1284-0.2.11.tar.bz2 278804 SHA256 7730de107782e5d2b071bdcb5b06a44da74856f00ef4a9be85d1ba4806a38f1a SHA512 06cc3049ce15613d34e39dc71bc572843c61ab64077c29ef9a6257edb0849c98565ff612a4cf787bc9642a39f1c89b7c47a20fb27f2318105be82aad8d472bb9 WHIRLPOOL 16ab2763c11f32ec75c6df8d77a0b558ac572bcea487edb93e4eb67a7461ff96973a78a3fb11ec02d3f93cb71d0c586ee66b4ce5efa471c26f3507a820cc46ed
+EBUILD libieee1284-0.2.11-r4.ebuild 1036 SHA256 f70e909e2bf4b936aa4cacc1d40707c40d70568fb08011ac22bd3f6e3b468cb9 SHA512 df9dc86e3d82cfac36fba7651af89bed30491fd7ae3744de5ad8782e572338b8b7c1ce124db06d9d8ba52533fbe891a7a469a01b4dd9445cd9aabb370dd884f3 WHIRLPOOL ebdac1a884798bcfb55631942f7b8ed20e4d473886a9d7046186a935c35b34d2c560ab6228ef0bc3653ffa9104db85c82fee628a03ae2fbcc2467b8ddd02cc1d
+EBUILD libieee1284-0.2.11-r5.ebuild 1025 SHA256 43a9a43e84fbf30c18191838ea3320be0ccc382a7c6ba0454c9238a5de3ed1ac SHA512 3c26fa58af2c51d6828855ce11b1877953e9f44b65512254fea66b3bd8c7ae29037c8a2f7bc696d7b459fc8439ddd7b08c0b183125321072c3daefda1a16b34e WHIRLPOOL df303869ef135916c3ea82332f2ee59d5c9d961dce9941b8093c6cd8cfb9b5ad9e229cadef05877588feb409587d2a926b2ad36b4e259e51f55eb3b2b8b8d473
+MISC ChangeLog 3403 SHA256 5b3c73b7d8ed1fab4f1b61d54ebf0d3f3abcc80fb35a0a1972c0b1f0a7be384a SHA512 a5ab8c1c20ba233a635d3ca784809fd79150f3f72e32b3ebb95c1b2f28b8db88ce8a1b92c165a5c84f5b2b5a4fd980cc7d841e7bc864c6181bd492bc109e4238 WHIRLPOOL a977b02a90949251264496751b818f61b06979c6c9af4d17101e2b0a2719af4883ea205df2d35758370d0f0bf807224c4f8d3178053e38098c78efdca161b2a3
+MISC ChangeLog-2015 5366 SHA256 d0a11324939404e8d0a2cbc8b5c4b5b848d516f7c3da41f8177cba24253e9fa8 SHA512 78a58486cfea23cf22e0221a76d746f456c240899bf9a649ec840e7bd45ba047d6ad28fefc8e3d4b1159bb1977b649cda4f36c27978911359e4d05c1e44cad26 WHIRLPOOL ab6529092fe1619a18819b90dac10fb0410b95e6c7e8e51edd06893a144c351901970e7a9d8fd8d06c6d333e911759aa0ab0cafeb68d69a183375462fde7b7de
+MISC metadata.xml 331 SHA256 66e78179a5bc22d8be1b3542863e9f236299ad5a6f0ed27f7aa198f42f9f7efe SHA512 f0855a91eb73804b3df9fcf9c821fdbfca67206c57152e7db3346c195ae3c8a204a7f0179c2449861799ff081d468dbd7709768d50073838bba19a447f252b5c WHIRLPOOL 217cc2daca7663598be9e6c527179051bf8e2263907ccbae9b65220b69b679ad6fffd20167e18b6954e62c7d2016ae074afe14fba0ab739b8896a673198a89fb
diff --git a/sys-libs/libieee1284/libieee1284-0.2.11-r4.ebuild b/sys-libs/libieee1284/libieee1284-0.2.11-r4.ebuild
new file mode 100644
index 000000000000..1cf8a0bd6c98
--- /dev/null
+++ b/sys-libs/libieee1284/libieee1284-0.2.11-r4.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1 multilib-minimal
+
+DESCRIPTION="Library to query devices using IEEE1284"
+HOMEPAGE="http://cyberelk.net/tim/libieee1284/index.html"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~x86-fbsd"
+IUSE="doc python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ doc? (
+ app-text/docbook-sgml-utils
+ >=app-text/docbook-sgml-dtd-4.1
+ app-text/docbook-dsssl-stylesheets
+ dev-perl/XML-RegExp
+ )"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --enable-shared \
+ $(use_enable static-libs static) \
+ $(multilib_native_with python)
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc doc/interface*
+
+ if ! use static-libs; then
+ find "${D}" -name '*.la' -delete || die
+ fi
+}
diff --git a/sys-libs/libieee1284/libieee1284-0.2.11-r5.ebuild b/sys-libs/libieee1284/libieee1284-0.2.11-r5.ebuild
new file mode 100644
index 000000000000..4ff103852d6d
--- /dev/null
+++ b/sys-libs/libieee1284/libieee1284-0.2.11-r5.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1 multilib-minimal
+
+DESCRIPTION="Library to query devices using IEEE1284"
+HOMEPAGE="http://cyberelk.net/tim/libieee1284/index.html"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ~x86 ~x86-fbsd"
+IUSE="doc python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ doc? (
+ app-text/docbook-sgml-utils
+ >=app-text/docbook-sgml-dtd-4.1
+ app-text/docbook-dsssl-stylesheets
+ dev-perl/XML-RegExp
+ )"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --enable-shared \
+ $(use_enable static-libs static) \
+ $(use_with python)
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc doc/interface*
+
+ if ! use static-libs; then
+ find "${D}" -name '*.la' -delete || die
+ fi
+}
diff --git a/sys-libs/libieee1284/metadata.xml b/sys-libs/libieee1284/metadata.xml
new file mode 100644
index 000000000000..047e93acaa98
--- /dev/null
+++ b/sys-libs/libieee1284/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">libieee1284</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/libixp/Manifest b/sys-libs/libixp/Manifest
new file mode 100644
index 000000000000..ad7a632605e0
--- /dev/null
+++ b/sys-libs/libixp/Manifest
@@ -0,0 +1,5 @@
+DIST libixp-0.5_p20110208.tar.xz 655956 SHA256 66ce92b25486505d04b97d838fb9b102cd1edb1455d90916d00dc38369b2c06b SHA512 c5cf13b54ab2fca66b6c0ace0f3067e46a461d62727e93235e60382d3665edd40751d404f3f590c9d7692a5b8cb7d1fefb05adb2c36d7941bf04e37d13a4a48a WHIRLPOOL 446a6f888681af53e00588aa3e8f076d3f53e34a25300020c90ebf7c8b2ece026ebed1d10bee9211f3c5464992a3c7749df9a5762d1d29867f8afa6f20a81c4b
+EBUILD libixp-0.5_p20110208-r3.ebuild 1121 SHA256 c30930d27ac0bad6e02a10147017f29849989aa6163edca7500d88fb0817f28a SHA512 c30a271e2bbfe3cde6f20b19d41a9feec6c66906aa76ddd81bf0bf969da221bd058b4af980ef07cb0f557918d24bb6ee2606400c8468a76a7a0b7afd7e617ecd WHIRLPOOL c9ae1b3a5a0bf5db5fe710913825a654dfdbd44cb28af7cc83525156295dfe359ce1ac8eb62ad89a31fee651a790f8a198082f2a571aec3870937fb542384027
+MISC ChangeLog 2943 SHA256 0aa55f1870d7a50ff99e9f8df935ffda74a8d86447ce43846d67e60d009cd679 SHA512 af813e5c50bdbbaffd78ebf0005840ed486c8f5a8d5e17ef52323816d2fcdcf6e397229ce22468fc79cadbc515c84dbfe39f45769bef00cc25ae37b9bc6278db WHIRLPOOL b04dafa30eae05a0ae8e134a4373618e9d923a05007f8ca41a3717ca0645894bfdd8e1d70c16192b59d833696078571d68ed2a067c485458ef083f8d1ef86669
+MISC ChangeLog-2015 4042 SHA256 fad5588bcc450fe2c2d356649f960e553d4b43e3b8b51f66046614c8d817ce4d SHA512 4da6a9fa48970f0850c0361f7046781a4e54de7c1a98e11c298739450e4f610f49a51e197dc2793996b5a9efbb98f956e2997bcc7ba3bbbe34edf47a6924cd20 WHIRLPOOL 163850506057d875c92a91b4cb7e95227c2252f83e1eed85df2b94b2d0d3c4dab9f2f06110e93faaacc7f6105e6fd535637e3b4d355ee483356f9b579ba18fdf
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/sys-libs/libixp/libixp-0.5_p20110208-r3.ebuild b/sys-libs/libixp/libixp-0.5_p20110208-r3.ebuild
new file mode 100644
index 000000000000..ac977ca3ebbd
--- /dev/null
+++ b/sys-libs/libixp/libixp-0.5_p20110208-r3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# hg clone https://hg.suckless.org/libixp
+
+EAPI=4
+inherit multilib toolchain-funcs
+
+DESCRIPTION="A stand-alone client/server 9P library including ixpc client"
+HOMEPAGE="https://libs.suckless.org/deprecated/libixp"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND=""
+DEPEND="app-arch/xz-utils"
+
+pkg_setup() {
+ myixpconf=(
+ PREFIX="/usr"
+ LIBDIR="/usr/$(get_libdir)"
+ CC="$(tc-getCC) -c"
+ LD="$(tc-getCC) ${LDFLAGS}"
+ AR="$(tc-getAR) crs"
+ MAKESO="1"
+ SOLDFLAGS="-shared"
+ )
+}
+
+src_prepare() {
+ # https://code.google.com/p/libixp/issues/detail?id=2
+ sed -i -e 's:ixp_serve9pconn:ixp_serve9conn:' include/ixp.h || die
+
+ # https://bugs.gentoo.org/393299 https://code.google.com/p/wmii/issues/detail?id=247
+ sed -i -e '69s:uint32_t:unsigned long:' include/ixp.h || die
+}
+
+src_compile() {
+ emake "${myixpconf[@]}"
+}
+
+src_install() {
+ emake "${myixpconf[@]}" DESTDIR="${D}" install
+ dolib.so lib/libixp{,_pthread}.so
+ dodoc NEWS
+}
diff --git a/sys-libs/libixp/metadata.xml b/sys-libs/libixp/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/sys-libs/libixp/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/sys-libs/libkudzu/Manifest b/sys-libs/libkudzu/Manifest
new file mode 100644
index 000000000000..fc965a4ed77f
--- /dev/null
+++ b/sys-libs/libkudzu/Manifest
@@ -0,0 +1,7 @@
+AUX kudzu-1.2.57.1-sbusfix.patch 2217 SHA256 5147b35cfdf50a2a79205198c8525874a590e0a0f015ee037cf3ee2e3de3eff7 SHA512 5b94734f63e1bb62cbfc349646c6dc4663e6ed2309e554e701943c35649193b14ea779a0c08e531ee931a94afdcc3e15529a8f410c658ea26d26659fe4147c71 WHIRLPOOL b2bf5b6a770bd66bf4b48e4d03f7ba1c2eaec9e3faadc5c514f631e5224ca80c377f98f6bcb98a77356653cac27bdf8e928bf630bfc1cc25e8292937addbdb8f
+AUX kudzu-1.2.57.1-sparc-keyboard.patch 5389 SHA256 f91b233f22bbd408e8efa6338d45615dadaceb488c72d31c871f301a9891cdf0 SHA512 6b89de1ede96e1a523880a33975488957e87cfc31cc0155014bb8152123cafb7ad793edcd9d228b9946bc6005b544e6fb908185f4ff901e623ce200435982708 WHIRLPOOL 311e16f4fd880182b1e81f9152edbebdd04abeb244f4ee68a0982dfa362dd8f8eca7d938caf413d1521c7c6db255ccaaaf1f384c9326e72e03d05149e617c3f0
+DIST kudzu-1.2.57.1.tar.gz 165855 SHA256 436a3fe44eb906155b954c85887c15d2d9e7ee5107641437443db8997b300687 SHA512 799e7cea840b7495fc007f4e34adc50fecd2fa7ceda2e2779e39639d0b93b10419bd44a0eb910b2e47024a49a4376330653a6fd96e5560c4828d55e18ab5d641 WHIRLPOOL dbed78dbcde3d73627c7950f9a6b8ee96fed0f7585b936b4ec3fe0839472546e64c81b4b65f0eabec95a00c13741090dd10d1b473c4254bfadebaf2c5479a804
+EBUILD libkudzu-1.2.57.1.ebuild 1252 SHA256 16dda0233a5eddf336b6947acfe69db3582967b45c9eace5343c20636bb999bd SHA512 ebed822a652dd36abeca95b8d397e4b181c2ba5719bc309847e678e57bd4448321b40251e518fe838619193cb71fc7acb2e4ee8f7a35ef0379e13628f84b0594 WHIRLPOOL 4e1505108164368dab974618975550a709ac1ec53fe80d3361cf78aca350db4715cbe7ecbc8425e287b52c5fa10f8fbe52041da131d13dd1e7a6cdec60b1f055
+MISC ChangeLog 2687 SHA256 e516f54034a410e8ed499337be36882b590aa2d11f1742480fe7ed0053046271 SHA512 1a41953dba7f52aabec99637dcbd657364ffb906558cd86597f80ff268428b1919ba8a683a120bf7e14ffd9b0d4121e39ec60e98420211c6bc992795d109a1b5 WHIRLPOOL a18dddc7f5e9dbd92158fe2b1475f210b0d6e726481217b73975cd29b5d44656ac86e541773acec8e58f4d5e3ec3e8260acc5b4374daa5fd24289f9d924c87f9
+MISC ChangeLog-2015 6402 SHA256 afaf302a5dc7a6d3c1e7b89b4f0f72d322b450f2fd672dee3c7c54986979f178 SHA512 879c8a7a7d41a32951aed26af0644d28f34589c5615fbd0e825f2d41218a0e8212bccab15408fb048b2b09c3f8741ab874602a809b42a9e684a64c3def29797a WHIRLPOOL 9a55e0d3d1fa376e2f1c2fa6135de738c5ca019203680730e3f05fc01a9e2c034f8b4ed46f1a8d45b6148d8b84abd1492121b6630d0d52f689e64a977b031eb9
+MISC metadata.xml 251 SHA256 64aac5f4a42f3b20222048411f52dbf0c57134b8d5aecd25dee154d75d1c0b73 SHA512 2da7a6b2b1b7153b8803cc52201fa006313bf75a25f7d917f26eadd7a6426529e4b30a57c3c24cca20865d9dc4f3d56fdfa14b10254158bea2dfeb2c64fcc18c WHIRLPOOL 5fb64a7c924e2d96d98db3c80ebaa98d19bf644a2936b65d63c3642673cb259670411265eb7c2647697f09aae62d503ee21334e1f1c8aa68d85e6521cf83608f
diff --git a/sys-libs/libkudzu/files/kudzu-1.2.57.1-sbusfix.patch b/sys-libs/libkudzu/files/kudzu-1.2.57.1-sbusfix.patch
new file mode 100644
index 000000000000..5c186ed631da
--- /dev/null
+++ b/sys-libs/libkudzu/files/kudzu-1.2.57.1-sbusfix.patch
@@ -0,0 +1,72 @@
+--- a/sbus.c
++++ b/sbus.c
+@@ -162,6 +162,7 @@
+ devClass = CLASS_NETWORK;
+ } else if (!strcmp(prop, "le")) {
+ type = "Sun Lance Ethernet";
++ module = "sunlance";
+ devClass = CLASS_NETWORK;
+ } else if (!strcmp(prop, "qe")) {
+ prop = prom_getproperty("channel#", &len);
+@@ -206,9 +207,11 @@
+ devClass = CLASS_SCSI;
+ } else if (!strcmp(prop, "esp")) {
+ type = "Sun Enhanced SCSI Processor (ESP)";
++ module = "esp";
+ devClass = CLASS_SCSI;
+ } else if (!strcmp(prop, "fas")) {
+ type = "Sun Swift (ESP)";
++ module = "esp";
+ devClass = CLASS_SCSI;
+ } else if (!strcmp(prop, "ptisp")) {
+ type = "Performance Technologies ISP";
+@@ -232,19 +235,19 @@
+ while ((*prop >= 'A' && *prop <= 'Z') || *prop == ',')
+ if (*prop++ == ',') break;
+ if (!strcmp(prop, "audio")) {
+- type = "AMD7930";
+- module = "amd7930";
++ type = "Sun|AMD7930";
++ module = "snd-sun-amd7930";
+ devClass = CLASS_AUDIO;
+ } else if (!strcmp(prop, "CS4231")) {
+ if (ebus)
+- type = "CS4231 EB2 DMA (PCI)";
++ type = "Sun|CS4231 EB2 DMA (PCI)";
+ else
+- type = "CS4231 APC DMA (SBUS)";
+- module = "cs4231";
++ type = "Sun|CS4231 APC DMA (SBUS)";
++ module = "snd-sun-cs4231";
+ devClass = CLASS_AUDIO;
+ } else if (!strcmp(prop, "DBRIe")) {
+- type = "SS10/SS20 DBRI";
+- module = "dbri";
++ type = "Sun|SS10/SS20 DBRI";
++ module = "snd-sun-dbri";
+ devClass = CLASS_AUDIO;
+ }
+ prop = prom_getproperty("device_type", &len);
+@@ -452,22 +455,6 @@
+
+ struct device *sbusProbe( enum deviceClass probeClass, int probeFlags,
+ struct device *devlist) {
+- if (probeClass & CLASS_MOUSE) {
+- int fd;
+- struct sbusDevice *mousedev;
+-
+- if ((fd = open("/dev/sunmouse", O_RDONLY)) != -1) {
+- /* FIXME: Should probably talk to the mouse to see
+- if the connector is not empty. */
+- close (fd);
+- mousedev = sbusNewDevice(NULL);
+- mousedev->type = CLASS_MOUSE;
+- mousedev->device = strdup("sunmouse");
+- mousedev->desc = strdup("Sun Mouse");
+- mousedev->next = devlist;
+- devlist = (struct device *)mousedev;
+- }
+- }
+ if (
+ (probeClass & CLASS_OTHER) ||
+ (probeClass & CLASS_NETWORK) ||
diff --git a/sys-libs/libkudzu/files/kudzu-1.2.57.1-sparc-keyboard.patch b/sys-libs/libkudzu/files/kudzu-1.2.57.1-sparc-keyboard.patch
new file mode 100644
index 000000000000..5626a357345d
--- /dev/null
+++ b/sys-libs/libkudzu/files/kudzu-1.2.57.1-sparc-keyboard.patch
@@ -0,0 +1,195 @@
+--- a/keyboard.c
++++ b/keyboard.c
+@@ -21,7 +21,6 @@
+ #include "keyboard.h"
+
+ #ifdef __sparc__
+-#include <asm/kbio.h>
+ #include <asm/openpromio.h>
+ #include <asm/types.h>
+ #endif
+@@ -96,7 +95,15 @@
+ {0, 0}
+ };
+
+-#if !defined(__s390__) && !defined(__s390x__)
++#if defined(__sparc__)
++static int termcmp(struct termios *a, struct termios *b)
++{
++ if (a->c_iflag != b->c_iflag || a->c_oflag != b->c_oflag ||
++ a->c_cflag != b->c_cflag || a->c_lflag != b->c_lflag)
++ return 1;
++ return memcmp(a->c_cc, b->c_cc, sizeof(a->c_cc));
++}
++#elif !defined(__s390__) && !defined(__s390x__)
+ static int termcmp(struct termios *a, struct termios *b)
+ {
+ if (a->c_iflag != b->c_iflag || a->c_oflag != b->c_oflag ||
+@@ -110,150 +117,6 @@
+ struct device *keyboardProbe(enum deviceClass probeClass, int probeFlags,
+ struct device *devlist)
+ {
+-#ifdef __sparc__
+- int fd;
+- char buf[256];
+- struct keyboardDevice *kbddev;
+-
+- if (probeClass & CLASS_KEYBOARD) {
+- static struct {
+- int layout0, layout1, layout2;
+- char *symbols;
+- int use_iso9995_3;
+- } sunkbd_translate[] = {
+- { 0, 33, 80, "", 0, },
+- { 1, 34, 81, "", 0, },
+- { 2, -1, -1, "fr_BE", 0, },
+- { 3, -1, -1, "ca", 0, },
+- { 4, 36, 83, "dk", 1, },
+- { 5, 37, 84, "de", 1, },
+- { 6, 38, 85, "it", 1, },
+- { 7, 39, 86, "nl", 0, },
+- { 8, 40, 87, "no", 1, },
+- { 9, 41, 88, "pt", 1, },
+- { 10, 42, 89, "es", 1, },
+- { 11, 43, 90, "se", 1, },
+- { 12, 44, 91, "fr_CH",1, },
+- { 13, 45, 92, "de_CH",1, },
+- { 14, 46, 93, "gb", 1, },
+- { 16, 47, 94, "ko", 0, },
+- { 17, 48, 95, "tw", 0, },
+- { 32, 49, 96, "jp", 0, },
+- { 50, 97, -1, "fr_CA",0, },
+- { 51, -1, -1, "hu", 0, },
+- { 52, -1, -1, "pl", 0, },
+- { 53, -1, -1, "cs", 0, },
+- { 54, -1, -1, "ru", 0, },
+- { -1, -1, -1, NULL, 0, }
+- };
+-
+- char twelve = 12;
+- int fdstd = 0;
+- char buf[4096];
+-
+- for (fd = 0; fd <= 2; fd++) {
+- sprintf (buf, "/proc/self/fd/%d", fd);
+- if (readlink (buf, buf, 4096) == 12 &&
+- !strncmp (buf, "/dev/console", 12)) {
+- fdstd = 1;
+- break;
+- }
+- }
+- if (!fdstd) {
+- fd = open("/dev/console", O_RDWR);
+- if (fd < 0) return devlist;
+- }
+-
+- kbddev=keyboardNewDevice(NULL);
+- kbddev->type=CLASS_KEYBOARD;
+- if (devlist)
+- kbddev->next = devlist;
+- devlist = (struct device *) kbddev;
+-
+- if (ioctl (fd, TIOCLINUX, &twelve) < 0) {
+- /* Serial console */
+- char desc[64];
+- struct serial_struct si;
+- int line = 0;
+-
+- if (ioctl (fd, TIOCGSERIAL, &si) >= 0) {
+- if (si.line & 1)
+- /* ttyb */
+- line = 1;
+- }
+- if (!fdstd) close(fd);
+- sprintf (desc, "Serial console tty%c", line + 'a');
+- fd = open("/dev/openprom", O_RDONLY);
+- if (fd >= 0) {
+- struct openpromio *op = (struct openpromio *)buf;
+- sprintf (op->oprom_array, "tty%c-mode", line + 'a');
+- op->oprom_size = 4096-128-4;
+- if (ioctl (fd, OPROMGETOPT, op) >= 0 &&
+- op->oprom_size > 0 && op->oprom_size < 40) {
+- strcat (desc, " ");
+- op->oprom_array [op->oprom_size] = 0;
+- strcat (desc, op->oprom_array);
+- }
+- close (fd);
+- }
+- kbddev->desc=strdup(desc);
+- kbddev->device=strdup("console");
+- return devlist;
+- }
+-
+- if (!fdstd) close(fd);
+- fd=open("/dev/kbd", O_RDWR);
+- if (fd < 0) {
+- /* PS/2 keyboard */
+- kbddev->desc=strdup("Generic PS/2 Keyboard");
+- } else {
+- /* Sun keyboard */
+- int kbdtype, kbdlayout, i;
+- char *desc, *desclayout = NULL;
+-
+- kbddev->device=strdup("kbd");
+- desc = "Sun Type4 ";
+- if (ioctl(fd, KIOCTYPE, &kbdtype) >= 0)
+- switch (kbdtype) {
+- case 2: desc = "Sun Type2 "; break;
+- case 3: desc = "Sun Type3 "; break;
+- case 4: ioctl(fd, KIOCLAYOUT, &kbdlayout);
+- if (kbdlayout < 33)
+- desc = "Sun Type4 ";
+- else switch (kbdlayout) {
+- case 33: case 47: case 48: case 49:
+- case 80: case 94: case 95: case 96:
+- desc = "Sun Type5 "; break;
+- case 34: case 81:
+- desc = "Sun Type5 Unix "; break;
+- default:
+- desc = "Sun Type5 Euro "; break;
+- }
+- for (i = 0; sunkbd_translate[i].layout0 != -1; i++) {
+- if (sunkbd_translate[i].layout0 == kbdlayout ||
+- sunkbd_translate[i].layout1 == kbdlayout ||
+- sunkbd_translate[i].layout2 == kbdlayout)
+- break;
+- }
+- if (sunkbd_translate[i].layout0 != -1 &&
+- sunkbd_translate[i].symbols[0])
+- desclayout = sunkbd_translate[i].symbols;
+- break;
+- }
+- if (desclayout) {
+- kbddev->desc = malloc(strlen(desc) + strlen(desclayout) + 1 + strlen("Keyboard") + 1);
+- strcpy (kbddev->desc, desc);
+- strcat (kbddev->desc, desclayout);
+- strcat (kbddev->desc, " Keyboard");
+- } else {
+- kbddev->desc = malloc(strlen(desc) + strlen("Keyboard") + 1);
+- strcpy (kbddev->desc, desc);
+- strcat (kbddev->desc, "Keyboard");
+- }
+- }
+- close (fd);
+- }
+-#else
+ int fd;
+ char twelve = 12;
+ int fdstd = 0;
+@@ -311,7 +174,7 @@
+ kbddev->device = strdup("ttySG0");
+ }
+ #endif
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__) || defined(__sparc__)
+ int cfd;
+ struct termios cmode, mode;
+
+@@ -397,7 +260,6 @@
+ kbddev->device=strdup(desc);
+ }
+ }
+-#endif
+ out:
+ return devlist;
+ }
diff --git a/sys-libs/libkudzu/libkudzu-1.2.57.1.ebuild b/sys-libs/libkudzu/libkudzu-1.2.57.1.ebuild
new file mode 100644
index 000000000000..c7b44d76b7b2
--- /dev/null
+++ b/sys-libs/libkudzu/libkudzu-1.2.57.1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils linux-info flag-o-matic toolchain-funcs
+
+DESCRIPTION="Red Hat Hardware detection tools"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+SRC_URI="mirror://gentoo/kudzu-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 -mips ppc ppc64 sparc x86"
+IUSE="zlib"
+
+DEPEND="
+ dev-libs/popt
+ >=sys-apps/pciutils-2.2.4[zlib?]
+ zlib? ( sys-libs/zlib )
+"
+RDEPEND="
+ ${DEPEND}
+ sys-apps/hwdata-gentoo
+ !sys-apps/kudzu
+"
+
+S=${WORKDIR}/kudzu-${PV}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/kudzu-${PV}-sbusfix.patch \
+ "${FILESDIR}"/kudzu-${PV}-sparc-keyboard.patch
+}
+
+src_configure() {
+ if use zlib; then
+ sed -i -e 's| -lpci| -lz -lpci|g' Makefile || die
+ fi
+ # Fix the modules directory to match Gentoo layout.
+ sed -i -e 's|/etc/modutils/kudzu|/etc/modules.d/kudzu|g' *.* || die
+
+ tc-export CC
+}
+
+src_compile() {
+ emake \
+ $( usex ppc ARCH='ppc' ARCH=$(tc-arch-kernel) ) \
+ AR=$(tc-getAR) \
+ RANLIB=$(tc-getRANLIB) \
+ RPM_OPT_FLAGS="${CFLAGS}" \
+ libkudzu.a libkudzu_loader.a
+}
+
+src_install() {
+ insinto /usr/include/kudzu
+ doins *.h
+
+ dolib.a libkudzu.a libkudzu_loader.a
+
+ keepdir /etc/sysconfig
+}
diff --git a/sys-libs/libkudzu/metadata.xml b/sys-libs/libkudzu/metadata.xml
new file mode 100644
index 000000000000..767266dca141
--- /dev/null
+++ b/sys-libs/libkudzu/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 type="project">
+ <email>livecd@gentoo.org</email>
+ <name>Gentoo LiveCD Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libmath++/Manifest b/sys-libs/libmath++/Manifest
new file mode 100644
index 000000000000..db4157cda91d
--- /dev/null
+++ b/sys-libs/libmath++/Manifest
@@ -0,0 +1,5 @@
+DIST libmath++-0.0.4.tar.gz 51107 SHA256 9bfeb340a1331d53b43fcd0f0c3aef0b985985ee9bfffac7c42eb57405db3414 SHA512 4ee86f365f9eb4f8a122beef430041b5133da1b780a595627ec43c53bb45a6b5a5836a1f2453d2c93f6771ff45683b1143a1d1432f3904ba5b6317c50f010bbc WHIRLPOOL 47c80adcfab7fd0599fde2a53d71c297dfa61bb7b19a4e9fd6c6d486c870aa28135b3b1be6a09836ac36fa4aef1f4ff37f81636cecffc562cfe10a0884f2ec76
+EBUILD libmath++-0.0.4-r1.ebuild 1068 SHA256 19719491da26dc60d152cee225b4e96f4f246c5bf5803a9d8fd5868d003547cd SHA512 92862df579342654e69a54990b31b82feece5d2eb80492313f9fcebd9294d996a83efbbbd00a48b3770558b38ce57a5ba1892c4ddc34b40f4649afca5c272a8f WHIRLPOOL fd188c8c0479615faa2ffafb8e3f09f8164f6b0f907cdce568416ccbc1e93043b7fd325b44972dd9cff85806521711da21c6c0bbeb2b472f4a8478ad6d2f6808
+MISC ChangeLog 2706 SHA256 48e442a86f47bc71e11b943b66b7706177f083fb1fff8d36112eb7b3ee429b86 SHA512 4dbb436f74cdb88435cf8173f3d7644971976dce2d25dd049b026f2a59d45a67a73d1b25f66c33ce0fff9cbbaa4923a78adb39f24c65cfd2b30201d0754fbf68 WHIRLPOOL 096a09d1791d09ed8cccd0ce52412433bddbcc254c59bb29a69628c1bf1ac91ea03213972aa2986aa63b2f7768377e52afa1b1081b1c2442e598075d9162e2be
+MISC ChangeLog-2015 2412 SHA256 88d077f62f77ce814fed70a5ac66650a5d7ee9c16760c5feecf12fa83b942502 SHA512 a2070e4f12445554b64977bee30874113bb9e11bdd14bfca1fe600898f375946f141888868aa8a0625ff4df8f8b2989887bd265b4e38ebe0d4eafc479daeeadf WHIRLPOOL 4d9263f8130612383947167f8bfb86d3c2b6e2a5bb4b32cd44f9cc52d49eb6134c5cb39cf0f94aadf1bceb16251714cc17e8a7e0a50f5c1fec17c1c0636fd8e1
+MISC metadata.xml 245 SHA256 2d55ae4b33723b881e2cd48221560da36aec5b304b8bf2b440a9e2588875dba9 SHA512 b098db4fb4d9ea116f6246bc6caf0f49e80e236d2fad78d287b638dbd5add7bfaf7feb1ca081ca557b23dde9227ce42fa808f3f6fd8eaba6a7e9cae93342f9c6 WHIRLPOOL edd2e34ed3775c96bf085c9c0a95bd448028cb5ba6a2bfa7d7253b54878c888b62fa579483265c47c2602ca454fd656d32346eaa7351067cc3a36295d1e1e861
diff --git a/sys-libs/libmath++/libmath++-0.0.4-r1.ebuild b/sys-libs/libmath++/libmath++-0.0.4-r1.ebuild
new file mode 100644
index 000000000000..51c67b20bf19
--- /dev/null
+++ b/sys-libs/libmath++/libmath++-0.0.4-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1 # bug #474098
+inherit autotools-utils
+
+DESCRIPTION="template based math library, written in C++, for symbolic and numeric calculus applications"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="1"
+KEYWORDS="amd64 ppc ~s390 x86"
+IUSE="doc static-libs"
+
+DEPEND="doc? ( app-doc/doxygen )"
+RDEPEND=""
+
+DOCS=( AUTHORS README TODO )
+
+src_prepare() {
+ # Autotools 1.13 compatibility, bug #471950
+ sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.in || die 'sed on configure.in failed'
+
+ autotools-utils_src_prepare
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+ if use doc; then
+ pushd "${AUTOTOOLS_BUILD_DIR}" >/dev/null
+ emake -C doc api-doc
+ popd >/dev/null
+ fi
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if use doc; then
+ pushd "${AUTOTOOLS_BUILD_DIR}" >/dev/null
+ dohtml -r doc/user-api/*
+ popd >/dev/null
+ fi
+}
diff --git a/sys-libs/libmath++/metadata.xml b/sys-libs/libmath++/metadata.xml
new file mode 100644
index 000000000000..41cd682e0ecf
--- /dev/null
+++ b/sys-libs/libmath++/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 type="project">
+ <email>cpp@gentoo.org</email>
+ <name>Gentoo C++ Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libnih/Manifest b/sys-libs/libnih/Manifest
new file mode 100644
index 000000000000..3294fcead719
--- /dev/null
+++ b/sys-libs/libnih/Manifest
@@ -0,0 +1,8 @@
+AUX libnih-1.0.3-optional-dbus.patch 1162 SHA256 93e81914a402ebc512c7df46e00f85b54ed073a66fcf9fe465cb58d757546abf SHA512 bd979f8e9d27d775e12b3a93082084b8837bc9eb4f48476c3356aa4b4f865eda517e6fcf90f5575686dbcdc0fef4a21c640e413d9d3611bb1f1077bfa9fd8c86 WHIRLPOOL 2eb2421f74c9ced344791ab3477035b5e71516962ebfc886f4a21837977854092aec28e68ba81345305f06ee00cf8e466bb5d3863c75d0291c0a9992aba17a6a
+AUX libnih-1.0.3-pkg-config.patch 2491 SHA256 cefe32c74c2c23f991e78bb8eaf97da8bcd1b4f252c1aed334e75027568f24d7 SHA512 b99d580f4487cf3d25fa37f3f7b62ce32d9df80c6c0b01ad04b6850215ec0cc24cfea48aaf8ff89afe28db239b5ed212f139e86353d9991152d488c6edce5017 WHIRLPOOL e6a6f4c2d88e4e2da3cbdba8f4b2a43f608ba7e0042f63c6b881653d23a51527d2061bea56924bb624bee5751bea69f4bdc4a206aa32ad62abcf29ea3c6999bc
+AUX libnih-1.0.3-signal-race.patch 2081 SHA256 e7c67f06c0812cabf4f2af05f8d66ecd8819278416f29e7dd6122d9091b6368e SHA512 5367cb0c6382004cc2a829b9b71f0c02a09e4983940afac90c4c5c0bfbda53fb36a6cc7e38ede7a895ce28f99a4f69e89392ebaadefdc536eb7efa90c2426ff8 WHIRLPOOL 2435627ed636ffff2e45b5a2708999a20b88525f438f3382a9acaa08c1ca4b81a7b4d926a6b7930add8c5b692f5790b52af8145cd8a0f8cac8b7f069a7ef4046
+DIST libnih-1.0.3.tar.gz 1187624 SHA256 897572df7565c0a90a81532671e23c63f99b4efde2eecbbf11e7857fbc61f405 SHA512 fce40d2445b28c27b8838631681ca3206a4f053b2dd4fc488fc9ef98bbd3d933e3d62b82cf346be2ef1677f6457f692cf5544cd915a6bb1e5c618f98ffa101b4 WHIRLPOOL da001ba05111d3a654e6800cf283e11b5508e53d6d91b37ed277df5a889a1138e90ae13161e0af81bdcac929b105bf889e4dcdc443789f28417c6e3f61530d8c
+EBUILD libnih-1.0.3-r3.ebuild 1483 SHA256 95c11d6f8d8ed90d225143744082ba4a85c74b26a75346dcb4d893c5fb14ee19 SHA512 e4986f22dd8460c14604cc3d7caba029ba8cb17d38593c5bc4f044613ccd1590b1cafab8c7593c8e3efb96b17597bcb3437b3993d7abb5296c131bdddbb20fba WHIRLPOOL c02c7f140db5a4d28406ed584bc740cba1ff6e7e4133057f312e373800b673b0078c400b9d433246906bab85b381ab00594df81d40a5419180cbe0e8fa0c8610
+MISC ChangeLog 4544 SHA256 e878c4735432e6e2c98c006b610bed9f2bb678b1657a0cdfbf064c52df9315ac SHA512 cec37c31c9f56f0fab6aa6b6272ee7b3df1b7e93e02cb0d7c77df09e0b6b679e8dad9b53f1d9988dafa3eb79d6dd8b2084ba05843fd22acc8773805444fe6abe WHIRLPOOL 4fe869f3982e66b81adb65385370dd0091d74421609222b74934949a7083e404667c10d65be378674b1ec4e63b3a228883e6b94b557c431d65af07a6cf8b50ec
+MISC ChangeLog-2015 1319 SHA256 8a3331765ca6aa2bf6f762377b07f96cd81bd6191d7be48d013afe62992fd9f0 SHA512 688f83b3d22960c4048fbd834b052f4f2975dd71745b24df1ca9f82999bb90cea7eb7d4cab1b7824d9d4659c8057660bd5555efd70359154b3240a49dc4ac57f WHIRLPOOL af96b664b92ad80649247f9751822e5f0869e77f419697129420bcce4e87755eb2f41310f43070c82679d44ca3199edd07414363c23d908e24465949a9f8f66d
+MISC metadata.xml 357 SHA256 b2b2590a099343e5a92652941311b719c648b1dd33325e9d19d3298e5a213bf7 SHA512 c9748a867960a45077282ebfbb48051e3995bee6648f14547ac5385b8baddcd36f927bfd94dfcd1656342de935ee97a2f376e687470720ea761e035c7c5feddd WHIRLPOOL d4e69e09195bbca0713c2c13c5d107560d0854ec1f6d545a84b529e518ec20e76ec89d25b6b3d33cb2f5bd32ac2ecf36fe89074408d39567a4ddc3fca4800c31
diff --git a/sys-libs/libnih/files/libnih-1.0.3-optional-dbus.patch b/sys-libs/libnih/files/libnih-1.0.3-optional-dbus.patch
new file mode 100644
index 000000000000..afe43749b6b0
--- /dev/null
+++ b/sys-libs/libnih/files/libnih-1.0.3-optional-dbus.patch
@@ -0,0 +1,40 @@
+--- libnih-1.0.1/configure.ac
++++ libnih-1.0.1/configure.ac
+@@ -23,12 +23,21 @@
+ PKG_PROG_PKG_CONFIG([0.22])
+
+ # Checks for libraries.
+-PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
+-AC_CHECK_LIB([expat], [XML_ParserCreate],
++AC_ARG_WITH([dbus],
++ [AS_HELP_STRING([--without-dbus],
++ [disable support for dbus])],
++ [],
++ [with_dbus=yes])
++
++AS_IF([test "x$with_dbus" != xno],[
++ PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
++ AC_CHECK_LIB([expat], [XML_ParserCreate],
+ [AC_CHECK_LIB([expat], [XML_StopParser],
+ [AC_SUBST([EXPAT_LIBS], [-lexpat])],
+ [AC_MSG_ERROR([expat >= 2.0.0 required])])],
+- [AC_MSG_ERROR([expat library not found])])
++ [AC_MSG_ERROR([expat library not found])])])
++
++AM_CONDITIONAL([DBUS_SUPPORT], [test "x$with_dbus" != xno])
+
+ # Checks for header files.
+ AC_CHECK_HEADERS([valgrind/valgrind.h])
+--- libnih-1.0.1.orig/Makefile.am
++++ libnih-1.0.1/Makefile.am
+@@ -1,6 +1,9 @@
+ ## Process this file with automake to produce Makefile.in
+
+-SUBDIRS = m4 intl nih nih-dbus nih-dbus-tool po
++SUBDIRS = m4 intl nih po
++if DBUS_SUPPORT
++SUBDIRS += nih-dbus nih-dbus-tool
++endif
+
+ EXTRA_DIST = HACKING
+
diff --git a/sys-libs/libnih/files/libnih-1.0.3-pkg-config.patch b/sys-libs/libnih/files/libnih-1.0.3-pkg-config.patch
new file mode 100644
index 000000000000..979e363f2157
--- /dev/null
+++ b/sys-libs/libnih/files/libnih-1.0.3-pkg-config.patch
@@ -0,0 +1,56 @@
+# Bazaar merge directive format 2 (Bazaar 0.90)
+# revision_id: vapier@gentoo.org-20111019170935-fheqs03szv6mhh3o
+# target_branch: http://bazaar.launchpad.net/~scott/libnih/trunk/
+# testament_sha1: 84b368e08fdd9f8276611cdfe97d34f51cd90598
+# timestamp: 2011-10-19 13:13:52 -0400
+# base_revision_id: scott@netsplit.com-20110901184103-d2xbvc5hbt0vqxf0
+#
+# Begin patch
+=== modified file 'nih-dbus/Makefile.am'
+--- nih-dbus/Makefile.am 2009-11-21 21:44:23 +0000
++++ nih-dbus/Makefile.am 2011-10-19 17:09:35 +0000
+@@ -49,7 +49,7 @@
+ test_dbus.h
+
+
+-pkgconfigdir = $(prefix)/lib/pkgconfig
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = libnih-dbus.pc
+
+
+
+=== modified file 'nih/Makefile.am'
+--- nih/Makefile.am 2009-11-21 21:44:23 +0000
++++ nih/Makefile.am 2011-10-19 17:09:35 +0000
+@@ -71,7 +71,7 @@
+ test_hash.h
+
+
+-pkgconfigdir = $(prefix)/lib/pkgconfig
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = libnih.pc
+
+
+
+# Begin bundle
+IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWerAspcAAhZfgAAQVGf/93Mi
+DAC/7//wUASW8VttRtyKRaUhJU00ZTUab1GBT9JpNNqeiAADEEpDUwp5Gk9KeiZAANAAABIo0hE9
+GTTJJ5AMo8oB6IwmmMNDQAAAaAAAAAEkgQBGTCGmmoZQPSIxoCJYV1m4Z59VmltTEiVlNBLfEBWL
+DPUvZdcke3iHe+YuVhuGNtnl+0Xxmwcuy+RkTlRw9Ct83uYaZ7PH3vOd/AqYc6mhoKnwOCJD7ej5
+jS/rj7FmeOwxohzIMw9Ftarf11sHFhfFyWQEWL15gMctp9IL8d5sOYp0YoMOIw5htiyuYikcaPZ+
+xeB0ZI+IpppnCWQD3qlFKeI1NHACFmRBrQ2Sn1nmVurFZLNeqWK2Xy7eKAJK1SuguZhs8DekVjKE
+YGJwURdteHklA3WkfNMdKKNMQHQqnTtxAg1ShnXAzzkjnDtTSCwNhnuoY0WM1bLLCJlFM6NphCLS
+CGV+ZxUbN6YirSh9tVJWBzJKQaE5HEstAsAuqdVKlAlNKIrkYPSb3oy9WkKNsyyLYUiplUvi8C3i
+ioz+SscYWhwHzkxL/k0TPk8tL6l5FzzBa8FCKRWbDCTa0nbGzEhoJmaYEfwBog+pmXpsuVNUZmF4
+OreOMqF7JyNA1HJJ14+yxa6SRpJ51jBFyaNAojQK2ai7BtxEVZFoG3TYZiaTnR8LwZPDCtw7GqpA
+6mKFWiqtj/KxW+zQNmQbh9XE5eCCdFBTQzJmb7H3fDQpKW1njIoLHI+HeAXGDxYmu7HJ3DoZtH3Z
+7UfYYlEO8WoZpHZIMdDSCTWUE41kdp0nBWlshTuqcODflplwgnc03YlpZF9eBKQsUJi4gRvOhwmO
+XzuHW8qzc+JojHueBjZGJRiZQktKmJFoSD3k4+SOEue4uOh88jC0uRC8zDtbDCuz1fd6m5nsBrXh
+4KCGR5mWo4953Ie6CdWVops43mZdcboGGpUVirZZC+SPwwvwVSDuTAzASyFMevBBdbmdy3y0L0Y2
+oqRD3LY5+RqPM9R4/XEkdVuXmAxvF7GgrzRSIuDsTD2MANhmBxuF+EEbTKN/ciAzAUxnOdie1hol
+lqAkHxA44ja0WMKzYlmGU28kSdqB1i6h4nLevOVCnK+WtEKLpuOy6eZFThX5IsRrjenja/BSN2iu
+FFE+cHoYwJzGRI9yFKvpRUQ+H0qqaIoI5lP18lEqsPiBhRHMkpPIHqMuoiGiZyQxSXC0ynqSTYNX
+80VoGbTVLspApI9vo8XZBOScj6oHLR6qkjlnhkwwNQ8/wZdSfNBI0NSKLNasgKl6LF7FVbx4MCcj
+jYREWWzVEEVd81rloiAfu+h8H33/8DPhciqmx3QHdcdLEOKQ1mHIp8NQLYDAhQjJPmRA4hvGfSG+
+dwTBj1rKUFKGB7BYiKJ+C3dZ91NewHQ8kxHGlS0rSLioLvwrlwNSrRgtyZzWVFTWB8C7kinChIdW
+BZS4
diff --git a/sys-libs/libnih/files/libnih-1.0.3-signal-race.patch b/sys-libs/libnih/files/libnih-1.0.3-signal-race.patch
new file mode 100644
index 000000000000..4cba5ae4ded3
--- /dev/null
+++ b/sys-libs/libnih/files/libnih-1.0.3-signal-race.patch
@@ -0,0 +1,60 @@
+https://bugs.launchpad.net/libnih/+bug/518921
+
+fix race in signal processing leading to lost signals
+
+The current loop will walk all signals one by one and run the handler
+for it if any signals were pending. Then it clears the array. But if
+a signal comes in for an earlier checked signal, it will get clobbered
+when the final clear runs.
+
+Change the logic so that we only clear entries for signals whose handler
+we explicitly call. If a different signal comes in, we'll process it
+the next time around.
+
+This was discovered & triaged by Jeffy Chen from Rockchip.
+
+=== modified file 'nih/signal.c'
+--- nih/signal.c 2009-06-23 09:29:37 +0000
++++ nih/signal.c 2015-05-21 08:12:11 +0000
+@@ -337,17 +337,37 @@
+
+ nih_signal_init ();
+
++ /* Since this poller runs w/out signals masked, we do not want to try
++ * and clear any other signals (like zeroing the caught array at the
++ * end). If we do that, we open a race:
++ * - Walk the list of signals.
++ * - First one is not set so we move on to the second one.
++ * - First signal comes in while processing second and increments the
++ * caught array entry.
++ * - Finish walking the whole list.
++ * - Zero out the whole list and thus throw away the first signal.
++ * Since the signal handlers can take any length of time, this race
++ * can be open for a variable amount of time.
++ */
++
+ NIH_LIST_FOREACH_SAFE (nih_signals, iter) {
+ NihSignal *signal = (NihSignal *)iter;
+
+ if (! signals_caught[signal->signum])
+ continue;
+
++ /* Now that we know we're going to process this signal, clear
++ * out all pending counts for it. There is a slight race here
++ * where the same signal can come in, but the API has never
++ * guaranteed exact coverage since POSIX does not provide it --
++ * more than one signal can be collapsed into one event. All
++ * we can guarantee is that we'll notice signals that come in
++ * once the handler runs.
++ */
++ signals_caught[signal->signum] = 0;
++
+ signal->handler (signal->data, signal);
+ }
+-
+- for (s = 0; s < NUM_SIGNALS; s++)
+- signals_caught[s] = 0;
+ }
+
+
+
diff --git a/sys-libs/libnih/libnih-1.0.3-r3.ebuild b/sys-libs/libnih/libnih-1.0.3-r3.ebuild
new file mode 100644
index 000000000000..5d3f7fd41060
--- /dev/null
+++ b/sys-libs/libnih/libnih-1.0.3-r3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit versionator eutils autotools toolchain-funcs multilib flag-o-matic
+
+DESCRIPTION="Light-weight 'standard library' of C functions"
+HOMEPAGE="https://launchpad.net/libnih"
+SRC_URI="https://launchpad.net/${PN}/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE="+dbus nls static-libs +threads"
+
+# The configure phase will check for valgrind headers, and the tests will use
+# that header, but only to do dynamic valgrind detection. The tests aren't
+# run directly through valgrind, only by developers directly. So don't bother
+# depending on valgrind here. #559830
+RDEPEND="dbus? ( dev-libs/expat >=sys-apps/dbus-1.2.16 )"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0.3-optional-dbus.patch
+ epatch "${FILESDIR}"/${PN}-1.0.3-pkg-config.patch
+ epatch "${FILESDIR}"/${PN}-1.0.3-signal-race.patch
+ eautoreconf
+}
+
+src_configure() {
+ append-lfs-flags
+ econf \
+ $(use_with dbus) \
+ $(use_enable nls) \
+ $(use_enable static-libs static) \
+ $(use_enable threads) \
+ $(use_enable threads threading)
+}
+
+src_install() {
+ default
+
+ # we need to be in / because upstart needs libnih
+ gen_usr_ldscript -a nih $(use dbus && echo nih-dbus)
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/*.la
+}
diff --git a/sys-libs/libnih/metadata.xml b/sys-libs/libnih/metadata.xml
new file mode 100644
index 000000000000..a889a8646dfc
--- /dev/null
+++ b/sys-libs/libnih/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 type="person">
+ <email>vapier@gentoo.org</email>
+ <description>feel free to update however you like</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="launchpad">libnih</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest
new file mode 100644
index 000000000000..b39728d7bcb4
--- /dev/null
+++ b/sys-libs/libomp/Manifest
@@ -0,0 +1,21 @@
+AUX 4.0.1/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch 3456 SHA256 c88bbb1d1c81b69bcece498ae8d4861bd6cbca465d294a9a681796ce5eed96f1 SHA512 677d6d7e316d6df028ebed606cde1a4225ed6e06bacbe81cd527acf57c705858ab5aed2f71946c2404336033bfa985dafee2d56423204a59954a80424ca856e0 WHIRLPOOL cdea0f06b3436f48c1860da75e4c887c08ad031d938f080f1da7d334d73adbb0ae44ed56c94950f3665fb08d680046484f09277101093fbaa1483b5e29679b25
+AUX libomp-3.7.0-no_compat_symlinks.patch 845 SHA256 d91c4104e158e8c8c9d90ffb0f28c08e683c47d6febc822ac3f9374834d7701f SHA512 4878cf052790638717fad4d1926354fbfc3370b2e65ebe228702649f78e20bc1d22e5eb3340f58d04d3288f310a68ed22c4fb882b74b14db319f87841329a67b WHIRLPOOL 5bfa0b674715133b28cdb15367c8b18dd1593a0062179667f1f3a0dae9f1cffb4b773492094840b392b55a40112acadc697922ccad1d0acf105752e9500e1d74
+AUX libomp-3.7.0-os_detection.patch 1235 SHA256 9372541a923b0a3c3b573fdfb3c92b1261f0aea5dc216d2432ab19c928da8e0f SHA512 d023b73312ea8aacb2cbc18cdd43ae4bbb4c4dde3fd02f499d3daab2dc8c74ace68a3077fd2f6f05727dc32d5641c5514b108e24e663eb6f84cc77818cac534b WHIRLPOOL b3edd1106f90040d2e8a99d8e4e6f35b2c6354df52fdba5fce4548ae11daa8fb91bd627692269e0d2b718e8793631abda0b3cb741eb0cc6b67273213c7b758e9
+AUX libomp-3.9.0-musl-strerror_r.patch 1159 SHA256 b1aa6d44d4d613cb1383975831ad49ccf433de5e6ff80fec1686ec161edf3ee7 SHA512 f35c5b9b1acf3cc636b505b8935a974796080fa71d96aee46e4edb559a5c5c03bf95457b27e1f026b4330a052654de539d556c4098f1b4a02cd2f95740bc3a4f WHIRLPOOL debde3f0265408f1a5c1376fcf4b84d6c210b9a8824343e22f86fdd8e1485ac20c2d8668e04ee692f14c8d8a7a13b1eaf0b117fde4565f21cc80aada9f498bb0
+AUX libomp-3.9.0-optional-aliases.patch 2536 SHA256 31c143bdb761a969888348ced721f22be7af7413da0b5238642a75efd8c2fcd7 SHA512 0cf501decca0997ee84754bc6c5b3401dbf408571dc169bbfd3fe892f6d0c730785a1bb4293e55eb47f8e808707810e22fac15702853a06cd7531d7a37c54265 WHIRLPOOL fa722bd91c74307217d7c419a27d6d6a55730bcd144a5e2630c0ab48a974b9ce4686e1a2dc82da735dec525f8ad5c96885a5c27b900cc5ce0057a32c146ef414
+DIST openmp-3.7.1.src.tar.xz 2026988 SHA256 9a702e20c247014f6de8c45b738c6ea586eca0559304520f565ac9a7cba4bf9a SHA512 ec29f2665c9de4dee184f86a980a90c87a99e7728bb9c46c9e513801c30b28b6496bfcfbe4cefbd90ef63b761886cd74c19cf8e26a8854d8569e357b78633f6a WHIRLPOOL e69f2ef825df7f438db3647d2405d0fe6e6b00d8614efe0783e1fef5ae72db11b4a5f231383f3cc66402cb0785a025610187cc69fba2edbafa51136bd990453e
+DIST openmp-3.8.1.src.tar.xz 2009572 SHA256 68fcde6ef34e0275884a2de3450a31e931caf1d6fda8606ef14f89c4123617dc SHA512 406e9077817c50bcd58dd50bd334258ebf4b81c3ecce830ae1f427bd7c1fc9376b63fdeb3459c953c341becde82d83be18069bfcd34cbaeee6f1478267c0b2bc WHIRLPOOL b733b7f8f965be86af49af5b02892ec8aacaafe00d310a21c8cc0155f1699da66d1c8aa7709eb230810c4ff68f63896d5a7548777c100ca91a8af998922bdca0
+DIST openmp-3.9.0.src.tar.xz 2257596 SHA256 df88f90d7e5b5e9525a35fa2e2b93cbbb83c4882f91df494e87ee3ceddacac91 SHA512 030432bb10d86016f0f1c4f4d8b25f78acdb4aed33c604baf07c825bbcc6198306f2f71a3e56030f20864a92ab0187357aff94d34e47f7166991faf539c0104d WHIRLPOOL 7bfb362c0f087d3867c8cab04ebba23c8e6337d34ddcdfeda1cbe960611eacf1e4356e99bf4d6316b60c9f4b9f9fb23eecdb346feaae72b9cd168ee0aa3cca2a
+DIST openmp-3.9.1.src.tar.xz 2031588 SHA256 d23b324e422c0d5f3d64bae5f550ff1132c37a070e43c7ca93991676c86c7766 SHA512 80924a6f9765f634d24d7b0aa036d92c912dbd8e067487a14bdd03b4c587fdfc92e83eb29926bfa637ef45be3f133a924f77ab12099ea3706c18e9c42774708b WHIRLPOOL b6ec75d4f9d2b86bb8e2927791cb46e61ff8657fc21f9e0ba9893d81d3382522aca330564f3156c1fbbf765de0499e875e41e11199abe2da8ed1bef057d5e8d8
+DIST openmp-4.0.1.src.tar.xz 2275240 SHA256 ec693b170e0600daa7b372240a06e66341ace790d89eaf4a843e8d56d5f4ada4 SHA512 0b737dde832c5907a0cac41fe1d594b61e85dd405eee42b39f09233db62b44543204ccc775e52e2981f9c9f0683b234526e288a3a7a04f712280fb3a575abcaf WHIRLPOOL 102f4b6984e6bc4dc08349e7f1f0ff31646bad923018cfd342e0bee760d8b1036f0c54c565af3b0730c470d584e37ed905bcbfa1ffc2325dafa0a02d91088b05
+DIST openmp-5.0.0.src.tar.xz 2074004 SHA256 c0ef081b05e0725a04e8711d9ecea2e90d6c3fbb1622845336d3d095d0a3f7c5 SHA512 038cc1d262414fac9a05eabdce97b21eb04fc1b3609d07f8da2c9da6b1aaa143f8b26953cb799e7dde82f708103539fe03fe939ba7323a71bd3e9e3925bd5513 WHIRLPOOL e32436cc925173db2f58dc0b454ed046c733877edce3383da0a621ea90e9c30d9e45c0063451feb9b0dc95102893db02832d97bfb3a200e3440e4cad7fb9720a
+EBUILD libomp-3.7.1.ebuild 1368 SHA256 fc595016c19b8ac57c43fe6d7a42c101c418ff21b56fb437f8994d4eedd8b6f7 SHA512 ae3b3688f05694e867d98f1a02ef70a36d95b457f0fb369c0f60c86ee4b1a37fab860d1866bf437c6a4344b96904618e717b3a3a5ec7e6756065e4d5e35c9a3a WHIRLPOOL 2da154ac123cf8a7d921621dec560299ad2f5913f4a062f083807df3872f66161ad5c2ee17c511399bd1188e75d56a9fdbd7aec902d017b3af188ff393444b96
+EBUILD libomp-3.8.1.ebuild 1368 SHA256 72f9dcaaed1359a623d483773c1548598e550141bf3e4aac6b015f64f6ec3281 SHA512 7ba7b4fccdbc2e9a69f73f5fafd985f862b4b28eb3f775d2650e78a2596826b1d8d947aa6e19f708572409139ea094da0d1c24ee35fb3d8812f8363bd948b3c7 WHIRLPOOL fe4043b740e6fd756650c3d722757a58bf50638699fe53d2b86ac66898bfcada958911a1b7ecba526e7e1bbd17eeec65e5b8f826516ecb71c2576aa38ac9d44a
+EBUILD libomp-3.9.0.ebuild 1264 SHA256 fc643ce90c5d7a2e102316716d0877a78ce975480458898c3bd8c3d6fc7ece2e SHA512 e0772254fd1ccf735a4325a41bcd30eaaeec30063a541b9f77a5295e1674e0b4a38af86738bfc9a71f4196b81945cd7c08655fc468105aa11d24c38d303aac0a WHIRLPOOL 72987a3143339c37b89d45a6bde2c2d2495bf2747b871eab304eea9f6796cc3dace4c70eb26aabe9fa4d8901ebe94e25b8bedeb934d96811b629965e7b516632
+EBUILD libomp-3.9.1.ebuild 1326 SHA256 6b973aaa8ae527a06aeac418bea5fc6b744bb448613cc8f9356a68c606dfff18 SHA512 99afa3364dfe73c52792e1f0c4cc19c9beb1fdb28d7fd009a778c351f86fd1759a1c4bfcd46194890b51f227844c063fed53085d78c0b91351858ed517e42794 WHIRLPOOL 151b52008b00b06e8e28dbcf4a32f790b3f184e32118de701aa6846fd0293b72dd04164e00cb8b63430f7ec3a84477b4c40a110beb5c86d8453d4364e0da75b7
+EBUILD libomp-4.0.1.ebuild 1961 SHA256 f75f49ca7226a70f06f506938e99e534795958a5efeee6cfce84d9f2a29e8366 SHA512 7ab537285eb1493a2e5ea56e8df8281ecc3f413579ecd342bf47257b80bdee0e861760af86b42d2a55215b70ce3bd4518120a10948e07b300f3cedc775448351 WHIRLPOOL ea92a34085e7cb0573236b8ec8f6853cb5836cfa066d058bed831cf8b8b42ba2dc945801a90f95c8798e3603c36163a18843e3a4838eae393cf637929939909f
+EBUILD libomp-5.0.0.ebuild 1854 SHA256 b56ff7e80747d9356597e8f24fa17a146d0b6f7bcca8f7d559d41fdb84c638ec SHA512 b4a288850dcebdc278fea6ac838fdd5326c4af41d65b28d7b11572811eb8985eb512aae32104abb53c0f94315d2126c4b17f71126e6101573d7f23b3e717601b WHIRLPOOL 1d96fc826897047644d43d3420d1d51957e808987a0657ee6ca865d4853641ad81ed83feb26c56de06c0b6aa23336b6298daca4cd553a62d30b27d16bc6f2d31
+EBUILD libomp-5.0.9999.ebuild 1867 SHA256 09a6b094903aaee60a3305daab10750e66e93e06e01d20097861a0647f1623f4 SHA512 0b79eef5f12b0f2056c5353c887f096ee05ff628b75dd634be4fbb70e45a82c13845a91c06d076398c2df5d7e426854f29ead69e9de615bbcbf0b0b25c62cde0 WHIRLPOOL ec6a5086cd3622939557d19177d58598bc1975f66bf00913891f0b1bec5b73d4a536bc959cdfab8c08ef0d041535f44bed02507eab8848ee7e0db9dd5af1da51
+EBUILD libomp-9999.ebuild 1944 SHA256 2de75d1398bc08c0e9aee540902204ec1f7af8030c0aa0f175137d36a198569d SHA512 c609649bf0cbae868d52a07f242ef060a779a2db87b18da0df04b4057f4d8fdc33d191a8b815c8f3db8449247e4895216d6fa7f4bd4e3e713995452e844bc7e6 WHIRLPOOL c40ba87d9259e1c9980f37492d270d9bac27c4930b5eaadf97c67430feaafe17bc022d02c7e0522c751a33fa20faea802ecf4fb28358b41c3d52357e0ffea7be
+MISC ChangeLog 3330 SHA256 adc90fa866b023f27a776d00d8ed8fabed42db351d87d2dd3fd5fb96b48842ba SHA512 f4565bca8edf184e494547d6d5a27a8a4cd1ded1bad4c75bfb1c915a05c33ef5db706d81800046d617a7b018325c15b6d30ca87046023cca57e9ab1783ddaa0a WHIRLPOOL 74edae6e0a95dbcec22a9a2737793641262a8b51f46d092988b99255051b96ae5541873dc548e89b976950c269184a2acc8c9d214a7d2d94990d67a92f0e8e6a
+MISC metadata.xml 670 SHA256 c32e97e9d85d756302a38aac03d55a14d3e5b43cc910f1dff35b9f0c8bea03b1 SHA512 d4269bb7192e00feed26327bb2ac36db3b1c4f5d55417c22efb9a64fa5a006c17dd39459ecc305e8a9a3a954271ad10013fe5c9159a30ea609513aabddebf485 WHIRLPOOL d0022a64d2cad055eab1c6921cdfd4372fcf9cabd40c5ba7bf74d49eaff5f3498545fe29bbfc20bbee2cc3fed596e6a4d9f408d912f39900bbfb1c6c4aabb61a
diff --git a/sys-libs/libomp/files/4.0.1/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch b/sys-libs/libomp/files/4.0.1/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch
new file mode 100644
index 000000000000..688175583269
--- /dev/null
+++ b/sys-libs/libomp/files/4.0.1/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch
@@ -0,0 +1,94 @@
+From 7bd70635240f69fcd4da4d98a4aca8aaa779dd11 Mon Sep 17 00:00:00 2001
+From: Michal Gorny <mgorny@gentoo.org>
+Date: Fri, 24 Feb 2017 22:15:24 +0000
+Subject: [PATCH] [test] Try to link -latomic to provide atomics when available
+
+When using -rtlib=libgcc, the fallback implementation of __atomic_*
+builtins is provided via libatomic (included in GCC). However, neither
+GCC itself nor clang link libatomic implicitly, and it seems that GCC
+upstream expects projects to link it explicitly as necessary.
+
+Since compiler-rt provides __atomic_* builtins directly in the main
+library, check if they are provided by the default libraries first.
+If they are not, check if -latomic is available to provide them
+and add explicit -latomic for tests in this case.
+
+This fixes unresolved __atomic_load() references when running openmp
+tests on i386 with libgcc backend.
+
+Differential Revision: https://reviews.llvm.org/D30083
+
+git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@296183 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ runtime/test/CMakeLists.txt | 13 +++++++++++++
+ runtime/test/lit.cfg | 2 ++
+ runtime/test/lit.site.cfg.in | 2 +-
+ 3 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/runtime/test/CMakeLists.txt b/runtime/test/CMakeLists.txt
+index 8162855..88c02c8 100644
+--- a/runtime/test/CMakeLists.txt
++++ b/runtime/test/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ # CMakeLists.txt file for unit testing OpenMP Library
+ include(FindPythonInterp)
+ include(CheckTypeSize)
++include(CheckFunctionExists)
+ include(CheckLibraryExists)
+
+ if(NOT PYTHONINTERP_FOUND)
+@@ -11,6 +12,17 @@ endif()
+
+ # Some tests use math functions
+ check_library_exists(m sqrt "" LIBOMP_HAVE_LIBM)
++# When using libgcc, -latomic may be needed for atomics
++# (but when using compiler-rt, the atomics will be built-in)
++# Note: we can not check for __atomic_load because clang treats it
++# as special built-in and that breaks CMake checks
++check_function_exists(__atomic_load_1 LIBOMP_HAVE_BUILTIN_ATOMIC)
++if(NOT LIBOMP_HAVE_BUILTIN_ATOMIC)
++ check_library_exists(atomic __atomic_load_1 "" LIBOMP_HAVE_LIBATOMIC)
++else()
++ # not needed
++ set(LIBOMP_HAVE_LIBATOMIC 0)
++endif()
+
+ macro(pythonize_bool var)
+ if (${var})
+@@ -25,6 +37,7 @@ pythonize_bool(LIBOMP_OMPT_SUPPORT)
+ pythonize_bool(LIBOMP_OMPT_BLAME)
+ pythonize_bool(LIBOMP_OMPT_TRACE)
+ pythonize_bool(LIBOMP_HAVE_LIBM)
++pythonize_bool(LIBOMP_HAVE_LIBATOMIC)
+
+ set(LIBOMP_TEST_CFLAGS "" CACHE STRING
+ "Extra compiler flags to send to the test compiler")
+diff --git a/runtime/test/lit.cfg b/runtime/test/lit.cfg
+index 7f18da4..bef61d4 100644
+--- a/runtime/test/lit.cfg
++++ b/runtime/test/lit.cfg
+@@ -52,6 +52,8 @@ config.test_cflags = config.test_openmp_flag + \
+ libs = ""
+ if config.has_libm:
+ libs += " -lm"
++if config.has_libatomic:
++ libs += " -latomic"
+
+ # Allow XFAIL to work
+ config.target_triple = [ ]
+diff --git a/runtime/test/lit.site.cfg.in b/runtime/test/lit.site.cfg.in
+index 448132e..b0d57ce 100644
+--- a/runtime/test/lit.site.cfg.in
++++ b/runtime/test/lit.site.cfg.in
+@@ -12,7 +12,7 @@ config.hwloc_library_dir = "@LIBOMP_HWLOC_LIBRARY_DIR@"
+ config.using_hwloc = @LIBOMP_USE_HWLOC@
+ config.has_ompt = @LIBOMP_OMPT_SUPPORT@ and @LIBOMP_OMPT_BLAME@ and @LIBOMP_OMPT_TRACE@
+ config.has_libm = @LIBOMP_HAVE_LIBM@
++config.has_libatomic = @LIBOMP_HAVE_LIBATOMIC@
+
+ # Let the main config do the real work.
+ lit_config.load_config(config, "@LIBOMP_BASE_DIR@/test/lit.cfg")
+-
+--
+2.12.0
+
diff --git a/sys-libs/libomp/files/libomp-3.7.0-no_compat_symlinks.patch b/sys-libs/libomp/files/libomp-3.7.0-no_compat_symlinks.patch
new file mode 100644
index 000000000000..c8b56e2bc89d
--- /dev/null
+++ b/sys-libs/libomp/files/libomp-3.7.0-no_compat_symlinks.patch
@@ -0,0 +1,17 @@
+diff -Naur openmp-3.7.0.src.orig/runtime/src/CMakeLists.txt openmp-3.7.0.src/runtime/src/CMakeLists.txt
+--- openmp-3.7.0.src.orig/runtime/src/CMakeLists.txt 2015-07-15 23:41:36.000000000 +0200
++++ openmp-3.7.0.src/runtime/src/CMakeLists.txt 2015-09-05 23:41:17.105242541 +0200
+@@ -288,13 +288,6 @@
+ endforeach()
+ else()
+ install(TARGETS omp LIBRARY DESTINATION lib${LIBOMP_LIBDIR_SUFFIX})
+- # Create aliases (symlinks) of the library for backwards compatibility
+- set(LIBOMP_ALIASES "libgomp;libiomp5")
+- foreach(alias IN LISTS LIBOMP_ALIASES)
+- install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
+- \"${alias}${CMAKE_SHARED_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
+- \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})")
+- endforeach()
+ endif()
+ install(
+ FILES
diff --git a/sys-libs/libomp/files/libomp-3.7.0-os_detection.patch b/sys-libs/libomp/files/libomp-3.7.0-os_detection.patch
new file mode 100644
index 000000000000..a0b2aad375f1
--- /dev/null
+++ b/sys-libs/libomp/files/libomp-3.7.0-os_detection.patch
@@ -0,0 +1,19 @@
+diff -Naur openmp-3.7.0.src.orig/runtime/tools/lib/Uname.pm openmp-3.7.0.src/runtime/tools/lib/Uname.pm
+--- openmp-3.7.0.src.orig/runtime/tools/lib/Uname.pm 2015-01-19 19:29:35.000000000 +0100
++++ openmp-3.7.0.src/runtime/tools/lib/Uname.pm 2015-09-04 19:30:25.821746740 +0200
+@@ -236,15 +236,6 @@
+ $bulk =~ m{^DISTRIB_ID\s*=\s*(.*?)\s*$}m
+ or runtime_error( "$release: There is no DISTRIB_ID:", $bulk, "(eof)" );
+ $values{ operating_system_name } = $1;
+- $bulk =~ m{^DISTRIB_RELEASE\s*=\s*(.*?)\s*$}m
+- or runtime_error( "$release: There is no DISTRIB_RELEASE:", $bulk, "(eof)" );
+- $values{ operating_system_release } = $1;
+- $bulk =~ m{^DISTRIB_CODENAME\s*=\s*(.*?)\s*$}m
+- or runtime_error( "$release: There is no DISTRIB_CODENAME:", $bulk, "(eof)" );
+- $values{ operating_system_codename } = $1;
+- $bulk =~ m{^DISTRIB_DESCRIPTION\s*="?\s*(.*?)"?\s*$}m
+- or runtime_error( "$release: There is no DISTRIB_DESCRIPTION:", $bulk, "(eof)" );
+- $values{ operating_system_description } = $1;
+ } else {
+ # Oops. lsb-release is missed or not informative. Try other *-release files.
+ $release = "/etc/system-release";
diff --git a/sys-libs/libomp/files/libomp-3.9.0-musl-strerror_r.patch b/sys-libs/libomp/files/libomp-3.9.0-musl-strerror_r.patch
new file mode 100644
index 000000000000..4fbf9f691c05
--- /dev/null
+++ b/sys-libs/libomp/files/libomp-3.9.0-musl-strerror_r.patch
@@ -0,0 +1,35 @@
+From 4fa7d5e207a4f7ef79b423b7d9658b7625795f5c Mon Sep 17 00:00:00 2001
+From: Michal Gorny <mgorny@gentoo.org>
+Date: Tue, 18 Oct 2016 16:38:44 +0000
+Subject: [PATCH] Fix a compile error on musl-libc due to strerror_r()
+ prototype
+
+Function strerror_r() has different signatures in different
+implementations of libc: glibc's version returns a char*, while BSDs
+and musl return a int. libomp unconditionally assumes glibc on Linux
+and thus fails to compile against musl-libc. This patch addresses this
+issue.
+
+Differential Revision: https://reviews.llvm.org/D25071
+
+git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@284492 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ runtime/src/kmp_i18n.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/runtime/src/kmp_i18n.c b/runtime/src/kmp_i18n.c
+index 546e693..e008d1f 100644
+--- a/runtime/src/kmp_i18n.c
++++ b/runtime/src/kmp_i18n.c
+@@ -809,7 +809,7 @@ sys_error(
+ int strerror_r( int, char *, size_t ); // XSI version
+ */
+
+- #if KMP_OS_LINUX
++ #if defined(__GLIBC__) && defined(_GNU_SOURCE)
+
+ // GNU version of strerror_r.
+
+--
+2.10.1
+
diff --git a/sys-libs/libomp/files/libomp-3.9.0-optional-aliases.patch b/sys-libs/libomp/files/libomp-3.9.0-optional-aliases.patch
new file mode 100644
index 000000000000..faf5bb51bca9
--- /dev/null
+++ b/sys-libs/libomp/files/libomp-3.9.0-optional-aliases.patch
@@ -0,0 +1,63 @@
+From 89ab78e360b7b20ebe1bc89736880a8e4aaa9e6e Mon Sep 17 00:00:00 2001
+From: Michal Gorny <mgorny@gentoo.org>
+Date: Wed, 14 Sep 2016 17:46:27 +0000
+Subject: [PATCH] [cmake] Make libgomp & libiomp5 alias install optional
+
+Introduce a new LIBOMP_INSTALL_VARIABLES cache variable that can be used
+to disable creating libgomp and libiomp5 aliases on 'make install'.
+Those aliases are undesired e.g. on Gentoo systems where libomp is used
+purely by clang.
+
+Differential Revision: https://reviews.llvm.org/D24563
+
+git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@281512 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ runtime/CMakeLists.txt | 4 ++++
+ runtime/src/CMakeLists.txt | 16 +++++++++-------
+ 2 files changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
+index 9db058b..e8e9a74 100644
+--- a/runtime/CMakeLists.txt
++++ b/runtime/CMakeLists.txt
+@@ -340,6 +340,10 @@ endif()
+
+ set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${LIBOMP_LIBRARY_SUFFIX})
+
++# Optional backwards compatibility aliases.
++set(LIBOMP_INSTALL_ALIASES TRUE CACHE BOOL
++ "Install libgomp and libiomp5 library aliases for backwards compatibility")
++
+ # Print configuration after all variables are set.
+ if(${LIBOMP_STANDALONE_BUILD})
+ libomp_say("Operating System -- ${CMAKE_SYSTEM_NAME}")
+diff --git a/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt
+index 777434d..c80f88d 100644
+--- a/runtime/src/CMakeLists.txt
++++ b/runtime/src/CMakeLists.txt
+@@ -305,13 +305,15 @@ else()
+
+ install(TARGETS omp ${LIBOMP_INSTALL_KIND} DESTINATION lib${LIBOMP_LIBDIR_SUFFIX})
+
+- # Create aliases (symlinks) of the library for backwards compatibility
+- set(LIBOMP_ALIASES "libgomp;libiomp5")
+- foreach(alias IN LISTS LIBOMP_ALIASES)
+- install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
+- \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
+- \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})")
+- endforeach()
++ if(${LIBOMP_INSTALL_ALIASES})
++ # Create aliases (symlinks) of the library for backwards compatibility
++ set(LIBOMP_ALIASES "libgomp;libiomp5")
++ foreach(alias IN LISTS LIBOMP_ALIASES)
++ install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
++ \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
++ \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})")
++ endforeach()
++ endif()
+ endif()
+ install(
+ FILES
+--
+2.4.10
+
diff --git a/sys-libs/libomp/libomp-3.7.1.ebuild b/sys-libs/libomp/libomp-3.7.1.ebuild
new file mode 100644
index 000000000000..16091c3c0b9c
--- /dev/null
+++ b/sys-libs/libomp/libomp-3.7.1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+
+inherit cmake-utils multilib-minimal
+
+MY_P=openmp-${PV}
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
+HOMEPAGE="https://openmp.llvm.org"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+# Additional licenses:
+# - MIT-licensed Intel code,
+# - LLVM Software Grant from Intel.
+
+LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
+SLOT="0/3.7"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}.src"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.7.0-os_detection.patch
+ "${FILESDIR}"/${PN}-3.7.0-no_compat_symlinks.patch
+ )
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if ! test-flag-CXX -std=c++11; then
+ eerror "${P} requires C++11-capable C++ compiler. Your current compiler"
+ eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+ eerror "to gcc-4.7 or an equivalent version supporting C++11."
+ die "Currently active compiler does not support -std=c++11"
+ fi
+ fi
+}
+
+multilib_src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=( "-DLIBOMP_LIBDIR_SUFFIX=${libdir#lib}" )
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+}
diff --git a/sys-libs/libomp/libomp-3.8.1.ebuild b/sys-libs/libomp/libomp-3.8.1.ebuild
new file mode 100644
index 000000000000..3db23e409e13
--- /dev/null
+++ b/sys-libs/libomp/libomp-3.8.1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+
+inherit cmake-utils multilib-minimal
+
+MY_P=openmp-${PV}
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
+HOMEPAGE="https://openmp.llvm.org"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+# Additional licenses:
+# - MIT-licensed Intel code,
+# - LLVM Software Grant from Intel.
+
+LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
+SLOT="0/3.8"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}.src"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.7.0-os_detection.patch
+ "${FILESDIR}"/${PN}-3.7.0-no_compat_symlinks.patch
+ )
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if ! test-flag-CXX -std=c++11; then
+ eerror "${P} requires C++11-capable C++ compiler. Your current compiler"
+ eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+ eerror "to gcc-4.7 or an equivalent version supporting C++11."
+ die "Currently active compiler does not support -std=c++11"
+ fi
+ fi
+}
+
+multilib_src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=( "-DLIBOMP_LIBDIR_SUFFIX=${libdir#lib}" )
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+}
diff --git a/sys-libs/libomp/libomp-3.9.0.ebuild b/sys-libs/libomp/libomp-3.9.0.ebuild
new file mode 100644
index 000000000000..b72ad15d2b73
--- /dev/null
+++ b/sys-libs/libomp/libomp-3.9.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+
+inherit cmake-multilib
+
+MY_P=openmp-${PV}
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
+HOMEPAGE="https://openmp.llvm.org"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+# Additional licenses:
+# - MIT-licensed Intel code,
+# - LLVM Software Grant from Intel.
+
+LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
+SLOT="0/3.9"
+KEYWORDS="~amd64 ~x86"
+IUSE="hwloc ompt"
+
+RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ dev-lang/perl"
+
+S="${WORKDIR}/${MY_P}.src"
+
+PATCHES=(
+ # backport of https://reviews.llvm.org/D24563
+ "${FILESDIR}"/${PN}-3.9.0-optional-aliases.patch
+ # backport of https://reviews.llvm.org/D25071
+ "${FILESDIR}"/${PN}-3.9.0-musl-strerror_r.patch
+)
+
+multilib_src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=(
+ -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMP_USE_HWLOC=$(usex hwloc)
+ -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
+ # do not install libgomp.so & libiomp5.so aliases
+ -DLIBOMP_INSTALL_ALIASES=OFF
+ # disable unnecessary hack copying stuff back to srcdir
+ -DLIBOMP_COPY_EXPORTS=OFF
+ )
+ cmake-utils_src_configure
+}
diff --git a/sys-libs/libomp/libomp-3.9.1.ebuild b/sys-libs/libomp/libomp-3.9.1.ebuild
new file mode 100644
index 000000000000..f52c0d168fd3
--- /dev/null
+++ b/sys-libs/libomp/libomp-3.9.1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+
+inherit cmake-multilib
+
+MY_P=openmp-${PV}
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
+HOMEPAGE="https://openmp.llvm.org"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+# Additional licenses:
+# - MIT-licensed Intel code,
+# - LLVM Software Grant from Intel.
+
+LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
+SLOT="0/3.9"
+KEYWORDS="amd64 ~arm64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="hwloc ompt"
+
+RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ dev-lang/perl"
+
+S="${WORKDIR}/${MY_P}.src"
+
+PATCHES=(
+ # backport of https://reviews.llvm.org/D24563
+ "${FILESDIR}"/${PN}-3.9.0-optional-aliases.patch
+ # backport of https://reviews.llvm.org/D25071
+ "${FILESDIR}"/${PN}-3.9.0-musl-strerror_r.patch
+)
+
+multilib_src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=(
+ -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMP_USE_HWLOC=$(usex hwloc)
+ -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
+ # do not install libgomp.so & libiomp5.so aliases
+ -DLIBOMP_INSTALL_ALIASES=OFF
+ # disable unnecessary hack copying stuff back to srcdir
+ -DLIBOMP_COPY_EXPORTS=OFF
+ )
+ cmake-utils_src_configure
+}
diff --git a/sys-libs/libomp/libomp-4.0.1.ebuild b/sys-libs/libomp/libomp-4.0.1.ebuild
new file mode 100644
index 000000000000..6b5290fbe402
--- /dev/null
+++ b/sys-libs/libomp/libomp-4.0.1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib python-any-r1
+
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
+HOMEPAGE="https://openmp.llvm.org"
+SRC_URI="https://releases.llvm.org/${PV/_//}/openmp-${PV/_/}.src.tar.xz"
+
+# Additional licenses:
+# - MIT-licensed Intel code,
+# - LLVM Software Grant from Intel.
+
+LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="hwloc ompt test"
+
+RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )"
+# tests:
+# - dev-python/lit provides the test runner
+# - sys-devel/llvm provide test utils (e.g. FileCheck)
+# - sys-devel/clang provides the compiler to run tests
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ test? (
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
+ sys-devel/llvm
+ >=sys-devel/clang-3.9.0
+ )"
+
+S=${WORKDIR}/openmp-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ # fix atomic tests with gcc
+ eapply "${FILESDIR}"/4.0.1/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch
+
+ eapply_user
+}
+
+multilib_src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=(
+ -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMP_USE_HWLOC=$(usex hwloc)
+ -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
+ # do not install libgomp.so & libiomp5.so aliases
+ -DLIBOMP_INSTALL_ALIASES=OFF
+ # disable unnecessary hack copying stuff back to srcdir
+ -DLIBOMP_COPY_EXPORTS=OFF
+ -DLIBOMP_TEST_COMPILER="$(type -P "${CHOST}-clang")"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-libomp
+}
diff --git a/sys-libs/libomp/libomp-5.0.0.ebuild b/sys-libs/libomp/libomp-5.0.0.ebuild
new file mode 100644
index 000000000000..633709ec57d9
--- /dev/null
+++ b/sys-libs/libomp/libomp-5.0.0.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib python-any-r1
+
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
+HOMEPAGE="https://openmp.llvm.org"
+SRC_URI="https://releases.llvm.org/${PV/_//}/openmp-${PV/_/}.src.tar.xz"
+
+# Additional licenses:
+# - MIT-licensed Intel code,
+# - LLVM Software Grant from Intel.
+
+LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="hwloc ompt test"
+
+RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )"
+# tests:
+# - dev-python/lit provides the test runner
+# - sys-devel/llvm provide test utils (e.g. FileCheck)
+# - sys-devel/clang provides the compiler to run tests
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ test? (
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
+ sys-devel/llvm
+ >=sys-devel/clang-3.9.0
+ )"
+
+S=${WORKDIR}/openmp-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=(
+ -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMPTARGET_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMP_USE_HWLOC=$(usex hwloc)
+ -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
+ # do not install libgomp.so & libiomp5.so aliases
+ -DLIBOMP_INSTALL_ALIASES=OFF
+ # disable unnecessary hack copying stuff back to srcdir
+ -DLIBOMP_COPY_EXPORTS=OFF
+ -DLIBOMP_TEST_COMPILER="$(type -P "${CHOST}-clang")"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-libomp
+}
diff --git a/sys-libs/libomp/libomp-5.0.9999.ebuild b/sys-libs/libomp/libomp-5.0.9999.ebuild
new file mode 100644
index 000000000000..086e4db0217d
--- /dev/null
+++ b/sys-libs/libomp/libomp-5.0.9999.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib git-r3 python-any-r1
+
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
+HOMEPAGE="https://openmp.llvm.org"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/openmp.git
+ https://github.com/llvm-mirror/openmp.git"
+EGIT_BRANCH="release_50"
+
+# Additional licenses:
+# - MIT-licensed Intel code,
+# - LLVM Software Grant from Intel.
+
+LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
+SLOT="0"
+KEYWORDS=""
+IUSE="hwloc ompt test"
+
+RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )"
+# tests:
+# - dev-python/lit provides the test runner
+# - sys-devel/llvm provide test utils (e.g. FileCheck)
+# - sys-devel/clang provides the compiler to run tests
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ test? (
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
+ sys-devel/llvm
+ >=sys-devel/clang-3.9.0
+ )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=(
+ -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMPTARGET_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMP_USE_HWLOC=$(usex hwloc)
+ -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
+ # do not install libgomp.so & libiomp5.so aliases
+ -DLIBOMP_INSTALL_ALIASES=OFF
+ # disable unnecessary hack copying stuff back to srcdir
+ -DLIBOMP_COPY_EXPORTS=OFF
+ -DLIBOMP_TEST_COMPILER="$(type -P "${CHOST}-clang")"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-libomp
+}
diff --git a/sys-libs/libomp/libomp-9999.ebuild b/sys-libs/libomp/libomp-9999.ebuild
new file mode 100644
index 000000000000..2235d0cc45f0
--- /dev/null
+++ b/sys-libs/libomp/libomp-9999.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-multilib git-r3 python-any-r1
+
+DESCRIPTION="OpenMP runtime library for LLVM/clang compiler"
+HOMEPAGE="https://openmp.llvm.org"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/openmp.git
+ https://github.com/llvm-mirror/openmp.git"
+
+# Additional licenses:
+# - MIT-licensed Intel code,
+# - LLVM Software Grant from Intel.
+
+LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant"
+SLOT="0"
+KEYWORDS=""
+IUSE="hwloc ompt test"
+
+RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )"
+# tests:
+# - dev-python/lit provides the test runner
+# - sys-devel/llvm provide test utils (e.g. FileCheck)
+# - sys-devel/clang provides the compiler to run tests
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ test? (
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
+ sys-devel/llvm
+ >=sys-devel/clang-3.9.0
+ )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ local libdir="$(get_libdir)"
+ local mycmakeargs=(
+ -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMPTARGET_LIBDIR_SUFFIX="${libdir#lib}"
+ -DLIBOMP_USE_HWLOC=$(usex hwloc)
+ -DLIBOMP_OMPT_SUPPORT=$(usex ompt)
+ # do not install libgomp.so & libiomp5.so aliases
+ -DLIBOMP_INSTALL_ALIASES=OFF
+ # disable unnecessary hack copying stuff back to srcdir
+ -DLIBOMP_COPY_EXPORTS=OFF
+ -DLIBOMP_TEST_COMPILER="$(type -P "${CHOST}-clang")"
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+
+ cmake-utils_src_make check-libomp
+}
diff --git a/sys-libs/libomp/metadata.xml b/sys-libs/libomp/metadata.xml
new file mode 100644
index 000000000000..ca91e84fce57
--- /dev/null
+++ b/sys-libs/libomp/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 type="person">
+ <email>voyageur@gentoo.org</email>
+ <name>Bernard Cafarelli</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='hwloc'>Enable CPU affinity support via hwloc</flag>
+ <flag name='ompt'>Enable OpenMP Tools Interface support</flag>
+ </use>
+ <longdescription>The OpenMP subproject of LLVM is intended to contain all of the components required to build an executing OpenMP program that are outside the compiler itself.</longdescription>
+</pkgmetadata>
diff --git a/sys-libs/libosinfo/Manifest b/sys-libs/libosinfo/Manifest
new file mode 100644
index 000000000000..1caefc4f40b1
--- /dev/null
+++ b/sys-libs/libosinfo/Manifest
@@ -0,0 +1,6 @@
+DIST libosinfo-1.0.0.tar.gz 896212 SHA256 f7b425ecde5197d200820eb44401c5033771a5d114bd6390230de768aad0396b SHA512 962b68b2f6639c70b1ab7377475bbddc99a056075e18d1f281e65188eb8a704b932e7ed26362a36ae805d53137e99b0f8303d18a5a1d7b840fad15eb188ab7d0 WHIRLPOOL b141f420db8f17ff3c904c2f9b0b2cb37d895813a0654e72d667e4d4a4543d607cfe52e10fdc385c1f80e2dadea96700d5c94968e0dfee0d60f14001a712912e
+EBUILD libosinfo-1.0.0-r1.ebuild 1396 SHA256 85d4deb834688aeedadb9362579ca9d68ccc404d89e34f5e7a5f3377c4b873c9 SHA512 f0ba90206910ac4ce04d9f125217cb42775f8d844ca1e087cdf13d10ffd7c45f91bd9fc699b29c7c4000a97d4d94f8a83a7cd93866765ad267a4ab732c3f7e29 WHIRLPOOL 17b0861dee9c8ab63e411974894a09de3a2f94c1c929c57acd39089ece6305c1cec2a8acfcf9cd90259530179f0c73dc5ea1bf8fdb4127340c234a0e983a9d18
+EBUILD libosinfo-1.0.0.ebuild 1084 SHA256 683fda36d5c316d35c87f27b79e909d0359710b09f2efa954d84d9ef5fdd409d SHA512 f352ebf34598cd9ddecb747b569ac3fad6dc3815a870279e5592a77c2a0f10683b55e7f7cd8274ace06541c2fbb9526c931a9c1b4b7c85d5bb2cbe56c9574641 WHIRLPOOL cd97b1d2a19810185db572d95bf1c59a9beb60e61d0151f76ae8294c897d01436eda973270a91f24e2ed931b6e8ba036a56bf03847ed1fbf2109701f67db5dab
+MISC ChangeLog 4509 SHA256 cebedddf7978ba3ec811fdc69989fe02cdf9917533c3efb6b7615e66cd4dcd06 SHA512 3f7a14e03dd0208e12c80c0e426bbaf54a43b1df3875b55cebf8099acbd1e418cef15944a60c48179b2462915c4ceb3511bbcab0f96fba1c9e269d3d15372a8f WHIRLPOOL 2d9e7b599cb9e19f00806e70e080a09b8260a1bb82f9c6a66170a01eb1eb3d9f96e0474356f2426537733024225704d7df51aa1e7b331fcd4923b71446213837
+MISC ChangeLog-2015 6034 SHA256 260a92275cf563ff91d257d7c647ddba0fecff024272c3805be21f26e9bb3112 SHA512 3aa72b800db16b9419279fc15018a999fa4d8065c69e07f4157af1f3d5922cb339bfeb6abddd4612772ddb4f94941d5ce85dba3ed047d3264d2aded002e4f97b WHIRLPOOL 53b70ebf10154c9aadb215cd1e06a6012e6fb6d3d07c9abedb05d6d5663468599465d4560e30c685157f009a44b158a07208578f0f4d157c965d4174b1d86f2a
+MISC metadata.xml 249 SHA256 4505b0bfeadff287958620b7dc7b7209699065a8f17139a237a5dd409a726a97 SHA512 c40662134899a5c9f0369a1017806f35adf3280a0b3c91726f7a8ca6012a073a8b471583f5bfb6fe95faac1dcf607e8e2e43f8c91d48ec46f4a8824e2f551506 WHIRLPOOL 333a938ee1d2124595596c572697bf5ebad523a92ba12005cfb12e6bb6270881a94a911f0cc9c1cf2bb571559e8271e07dfd307dabe50058236dbe7103562b92
diff --git a/sys-libs/libosinfo/libosinfo-1.0.0-r1.ebuild b/sys-libs/libosinfo/libosinfo-1.0.0-r1.ebuild
new file mode 100644
index 000000000000..d610203f02b5
--- /dev/null
+++ b/sys-libs/libosinfo/libosinfo-1.0.0-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+VALA_USE_DEPEND="vapigen"
+
+inherit gnome2 udev vala
+
+DESCRIPTION="GObject library for managing information about real and virtual OSes"
+HOMEPAGE="http://libosinfo.org/"
+SRC_URI="https://releases.pagure.org/libosinfo/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+
+IUSE="+introspection +vala test"
+REQUIRED_USE="vala? ( introspection )"
+
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 x86"
+
+# Unsure about osinfo-db-tools rdep, but at least fedora does it too
+RDEPEND="
+ >=dev-libs/glib-2.36.0:2
+ >=net-libs/libsoup-2.42:2.4
+ >=dev-libs/libxml2-2.6.0
+ >=dev-libs/libxslt-1.0.0
+ sys-apps/hwids[pci,usb]
+ sys-apps/osinfo-db-tools
+ sys-apps/osinfo-db
+ introspection? ( >=dev-libs/gobject-introspection-0.9.7:= )
+"
+# perl dep is for pod2man
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ dev-libs/gobject-introspection-common
+ >=dev-util/gtk-doc-am-1.10
+ >=dev-util/intltool-0.40.0
+ virtual/pkgconfig
+ test? ( dev-libs/check )
+ vala? ( $(vala_depend) )
+"
+
+src_prepare() {
+ gnome2_src_prepare
+ use vala && vala_src_prepare
+}
+
+src_configure() {
+ gnome2_src_configure \
+ --with-usb-ids-path=/usr/share/misc/usb.ids \
+ --with-pci-ids-path=/usr/share/misc/pci.ids \
+ --disable-static \
+ $(use_enable test tests) \
+ $(use_enable introspection) \
+ $(use_enable vala) \
+ --disable-coverage
+}
diff --git a/sys-libs/libosinfo/libosinfo-1.0.0.ebuild b/sys-libs/libosinfo/libosinfo-1.0.0.ebuild
new file mode 100644
index 000000000000..97da310d3301
--- /dev/null
+++ b/sys-libs/libosinfo/libosinfo-1.0.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+VALA_USE_DEPEND="vapigen"
+
+inherit gnome2 udev vala
+
+DESCRIPTION="GObject library for managing information about real and virtual OSes"
+HOMEPAGE="http://libosinfo.org/"
+SRC_URI="http://fedorahosted.org/releases/${PN:0:1}/${PN:1:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+
+IUSE="+introspection +vala test"
+REQUIRED_USE="vala? ( introspection )"
+
+KEYWORDS="~sparc"
+
+RDEPEND="
+ >=dev-libs/glib-2.36.0:2
+ >=dev-libs/libxslt-1.0.0:=
+ dev-libs/libxml2:=
+ >=net-libs/libsoup-2.42:2.4
+ sys-apps/hwids
+ introspection? ( >=dev-libs/gobject-introspection-0.9.7:= )
+"
+DEPEND="${RDEPEND}
+ dev-libs/gobject-introspection-common
+ >=dev-util/gtk-doc-am-1.10
+ virtual/pkgconfig
+ test? ( dev-libs/check )
+ vala? ( $(vala_depend) )
+"
+
+src_prepare() {
+ gnome2_src_prepare
+ use vala && vala_src_prepare
+}
+
+src_configure() {
+ gnome2_src_configure \
+ --disable-static \
+ $(use_enable test tests) \
+ $(use_enable introspection) \
+ $(use_enable vala) \
+ --disable-coverage
+}
diff --git a/sys-libs/libosinfo/metadata.xml b/sys-libs/libosinfo/metadata.xml
new file mode 100644
index 000000000000..39980802b1da
--- /dev/null
+++ b/sys-libs/libosinfo/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 type="project">
+ <email>gnome@gentoo.org</email>
+ <name>Gentoo GNOME Desktop</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libraw1394/Manifest b/sys-libs/libraw1394/Manifest
new file mode 100644
index 000000000000..76d69171ac78
--- /dev/null
+++ b/sys-libs/libraw1394/Manifest
@@ -0,0 +1,9 @@
+DIST libraw1394-2.1.0.tar.xz 291456 SHA256 0b3126d8158d156de9da2ff4d861c47857acc4318a7ac260258015a22071964f SHA512 04295c2b4391b1c61cc1c65dbe5921f5e208bbb311104366d5756a82a6c53f1339c368fe76077318b22e2402fd8f679236606d0be4898728a9dba2d7a8989b9e WHIRLPOOL f89a4abe1a1c5a7c22a88e8d397f03e6fe2943af18d721ab87eace027b43fb899658beea9b94ea6909398aa6b14920da58cbf8a3934df18acc0b587102b50d02
+DIST libraw1394-2.1.1.tar.xz 309396 SHA256 1bab9780189f9d1eb4e973df12679c04f979c21e024240fc98e536ff5b680ee9 SHA512 ed6acf10e50593e6070764e57cb6cc0eabb6f2bc4b4ed805a55cdfc37109c1975eb597dfbef9b6f8bc73a9e9270e7d643956489f54682f4c670fa510ef726fbe WHIRLPOOL 10e075374855c03395cefb7357f055fafd223b91b7e89ed22d96d691a398d3371db580e38fd53718305a5b1f2708bd52bc55cf1ccedfa5e508bd6e64bc04f6ad
+DIST libraw1394-2.1.2.tar.xz 313120 SHA256 03ccc69761d22c7deb1127fc301010dd13e70e44bb7134b8ff0d07590259a55e SHA512 1ef38961b747c4ebb18d823a4c38d5bf019f8bd0ac55547838d153b1899b91ae0ff56f5b6732e309d6975b55725d1ce989917ffcf605cf64f7d33624f54f0567 WHIRLPOOL 7a8a5c19cf57e114ed3b6582b1a76c49bda1714c32efbe4f5ca310e958b986a7b29a02b6ad76117bf73c06d600f607471748d47602a1467e81c0149662d57909
+EBUILD libraw1394-2.1.0-r1.ebuild 626 SHA256 48a7f604811a4f1b2c3258794bae7e1ccd05ffaa3938f4a4d2174d2da1c67a98 SHA512 86d9758b457944152ccb48fea9cf0a931d018c4fb762011dadd330539ecfc7b0be654b672e88f06d4a230c66ff9688f97d8e30ea85af563a6e4a355bbdbe0ea1 WHIRLPOOL 8537db81eb1938ff74f29a29fac545f01b78a4cda4185d446530c1abc6a34d62cb4169c5317b078f95b94c7a3ae70be3a7ea8ddeaef71beb9db815171876c7a3
+EBUILD libraw1394-2.1.1.ebuild 635 SHA256 2f9c15c427015f86ff5404670eb1e34f3d1b65d0b8eb302b54aeffce40f67c52 SHA512 9f8e4ca8b524a530619fa147aad902524255b5014b972e97e9cc0e99e8edda3fb3c3f2c5b68a928bae2e48ce28df0a3d810c479cc6b83672e327c02f62567747 WHIRLPOOL e1b3d8e4c0ac44e02355dd803407bb9ed4939548f1e81d1ba061374758e757fac16eb5a9d020a4c5b1d7d2d90b4d55bdf27a79e12e497be31f3f0b1cce62a7a1
+EBUILD libraw1394-2.1.2.ebuild 642 SHA256 b65631a3342190c60ea3784d3425036783e38f333f161e13c94322b69da2a089 SHA512 ab955d59a340b7492d5ed33392b4ecc2078571181bd4981d040e589c2db0c7a4bc94cdc2678d017531c7dfa9d130141e056436f48b75a7ee45661970ce66da6c WHIRLPOOL 645f521f66c4caa335e2a9c026a2450a85ee95fe3ec46e6afbd5a41d44cd9e55b1ac142bfa003d5082c9b931b1ae4ae48d0bee6e072392240d0cbd68a00191b2
+MISC ChangeLog 3697 SHA256 c45394839ad8325723f8627beeeb5445a16d98a30ca7014b7fdca8241fa42427 SHA512 39afebe53e234b05a8dfb5eb97a1e6dc2a8b626214601098d9194235b25beeec4ea66c57e662de84f23ed7aad9dccb971d47c5272e389156c2ebb09466b9ecad WHIRLPOOL cc743810e440c1a9141e5458cce577332099448f9532c7cee3abe701a2925f5b0533879b81a1bfe75d24346ba17e3017809de72ae047c4af9020a3a521359562
+MISC ChangeLog-2015 10025 SHA256 05c7945e968d789b387eee152d480ef80ca1337ba2feccff0c761e76b3005e80 SHA512 43f19221b4b85cc3571b0377f115d0b7b28fa2aec62013367a0d15f9b60f7da7b860395cd18c3fdccfa7a9fd0a1cd9e385609ca4e2acaacad70cb0be2688ef1b WHIRLPOOL a968fd8ca6055d4f8633b6481765972574fe511458bd53909368a5750f4cc8130416e2d421bf3ebd0bf59895a50e9df79d566798191aca6506036fa4ef384e7b
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-libs/libraw1394/libraw1394-2.1.0-r1.ebuild b/sys-libs/libraw1394/libraw1394-2.1.0-r1.ebuild
new file mode 100644
index 000000000000..e7f484ab5de5
--- /dev/null
+++ b/sys-libs/libraw1394/libraw1394-2.1.0-r1.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+
+inherit autotools-multilib
+
+DESCRIPTION="library that provides direct access to the IEEE 1394 bus"
+HOMEPAGE="https://ieee1394.wiki.kernel.org/"
+SRC_URI="mirror://kernel/linux/libs/ieee1394/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86"
+IUSE="static-libs"
+
+DEPEND="app-arch/xz-utils"
+RDEPEND="abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
diff --git a/sys-libs/libraw1394/libraw1394-2.1.1.ebuild b/sys-libs/libraw1394/libraw1394-2.1.1.ebuild
new file mode 100644
index 000000000000..65b0c7bf7d67
--- /dev/null
+++ b/sys-libs/libraw1394/libraw1394-2.1.1.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+
+inherit autotools-multilib
+
+DESCRIPTION="library that provides direct access to the IEEE 1394 bus"
+HOMEPAGE="https://ieee1394.wiki.kernel.org/"
+SRC_URI="mirror://kernel/linux/libs/ieee1394/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="static-libs"
+
+DEPEND="app-arch/xz-utils"
+RDEPEND="abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
diff --git a/sys-libs/libraw1394/libraw1394-2.1.2.ebuild b/sys-libs/libraw1394/libraw1394-2.1.2.ebuild
new file mode 100644
index 000000000000..b9be065a79c0
--- /dev/null
+++ b/sys-libs/libraw1394/libraw1394-2.1.2.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+
+inherit autotools-multilib
+
+DESCRIPTION="library that provides direct access to the IEEE 1394 bus"
+HOMEPAGE="https://ieee1394.wiki.kernel.org/"
+SRC_URI="mirror://kernel/linux/libs/ieee1394/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="static-libs"
+
+DEPEND="app-arch/xz-utils"
+RDEPEND="abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
diff --git a/sys-libs/libraw1394/metadata.xml b/sys-libs/libraw1394/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-libs/libraw1394/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/librtas/Manifest b/sys-libs/librtas/Manifest
new file mode 100644
index 000000000000..ebf838bc111c
--- /dev/null
+++ b/sys-libs/librtas/Manifest
@@ -0,0 +1,11 @@
+AUX librtas-1.3.6-symlink.patch 928 SHA256 8474ab2c51da8962eab949b5a426c8c256884441697e2b61a60862d91f0324e8 SHA512 b62c4deb72b2040f839a480133e2837ac4d7b988833621b3b1683f31d65d5ee2f4ecb4c65ff73d89228cd97e78ca7ab80f743e04773627ae204904b8077f39fd WHIRLPOOL df70cfd21851842983e643ed0745903ee5161f6f42c9d9b4395e9bb9d0ea69359cff36def02bb357658694bd0598c4d5b08f8ea217b369fb1001099a867d3567
+AUX librtas-1.3.8-symlink.patch 803 SHA256 844bbb500f7d7ba702c9f5f577083c1073a1cdc9c8919c680dae9e96d1f39d1c SHA512 cfd8ab71c098b2a7d69ca55008e4b483ba6e540c7dbfc38aa055baa8de85a4822da477eddcd6c1156392c4ed65abffe061a2710239e5ad1951108cf512491ac0 WHIRLPOOL e718b73df7dee94d642b71d51f057335f71062758f30c59450ef512c346fee0aabd2421b5fbe67cb7a89cc92fba60d066c8b5b0bc013ad35d3e3cd33ba5dd732
+DIST librtas-1.3.13.tar.gz 90959 SHA256 d5f2951b0934ffbd82bebf26acfa103cc21d89f4c90c7c41472acf7b4ec6d907 SHA512 1cd0dec624aff2fdf3e851913246d89a98c94c09ab9fe3ca80c3fca53a5d6ca5589e0680216c3722560e5701827b52a283ddefe7ab04228b352f5535f63a85c1 WHIRLPOOL 1dc10baf127aba6dbb57776fe7f99061234e875c9a8cdf19f653b24939b16c314927d43344081dd5affbe6281aa28924e867bf7d012111de8adcf81bd766ac2a
+DIST librtas-1.3.6.tar.gz 83828 SHA256 21b380586f801fba1f76573e97596078b588e8d716ee7b7c757a2815d2425a51 SHA512 f81271cf524218395c488aee6625b9f39c9acb81d7c109ca0dec9c7349ad013a6eb17e5324cc5243caf9f5c32b755831afd9bb74c6a2505ccc50d400734b26fa WHIRLPOOL 8f44bcb5f389cc2d13a9d74351a2e07704bf733b40f3b49af582b2d6c216e0445fd078fba0cd65d3a601892cab6e948b3e374b6e569ed6e195e521781111786a
+DIST librtas-1.3.8.tar.gz 221684 SHA256 97ae0168759bf2bc058dacad9c70bdb6403cf8ae617d25ad7230d702725407b3 SHA512 bb68369a10f0fb35e8631dc440fe68bb02b13d971be420539bb3fc0d29328421702a43f489941e90b20bff35863269a0d8fd159f65a18467d22cea7cfeed2cd2 WHIRLPOOL a843f0e2a88a48b3f75530c1242a087e92521ee98b281f26abde91aafa94724520d4b03efae09a8ad132cfc303ae6ea3be247a7c7a3425da1937e7557adea61f
+EBUILD librtas-1.3.13.ebuild 495 SHA256 917d21144297883f090a14849b8dbfe8cc1f66493a62da169ce1396517112baa SHA512 54844c83026e3d392e586faed15f5b6983379b49942bda7a3377b45602e346d04df40b8388de9edb4a5eeaeec27015ffd4adf69f2a6258c3b60dff17094edaa9 WHIRLPOOL a87c0d0e7d66a6f5c574a9406876b190b6fbcafcfa8cdda1f33882d37feda61e370208afc98510304a839d7a87d51460d6600255061b5651a6ac9154af65c362
+EBUILD librtas-1.3.6.ebuild 494 SHA256 c588f8ae15635cb5364c0634d4c052696b54301a6bfb08cc5150b75b50235148 SHA512 1333210cb31df41e6eebfe6fb2aba840b007b161a2528a42c2e83489f85fa6e5241a415bb0e8fad6e4f2810ebdc14e05aef25f79ad2ca4dc1a281482eaea7dc2 WHIRLPOOL f45c1f3277f5e0b83128e1e85ad789b60a5ef316e4203a8ca4140e28c79d96e1adb8abb4845c1f61da50ef67fafdc845718432ab0ff0df99d0f3ed972f6f7c30
+EBUILD librtas-1.3.8.ebuild 496 SHA256 f0ce5eaf52838a748d273d517e483272e6dc9e8934790d9ecef9531a59995dd0 SHA512 3eebb86f83d7e9efa8cf85c0fe438f472666d271858e043112615b3fa696f8b831e806d91414a733a03333a4a6f345252b91be4c65438d0fc08a1507b47a35b1 WHIRLPOOL 1c2a082f991d0738ed394f2652e1042413c100ab23d0f21969ffea7b8a3273a7cdd0607fbda0a0211b8134de0314c564200f1217ae51daf6ebf387e87f623365
+MISC ChangeLog 3091 SHA256 0efda50d07d294faaffd2c26854f458c2f72765abec70a86d7855cc1aa696238 SHA512 740d537a6afc124cb1e24a401c487e1f70697e9d678fb769d1f61d32937e4b78b376ac89327a4d85ec9270f2a92c73b566b61832b91dd5a43744b40b0ada8480 WHIRLPOOL dc1adac7a201dcdfcfae9fb1e4fb5aa061d296b6e9290b733007eaffe54b50ff948535460624aefe8681b6e47af56ca8eb524ca724fabf836e2816e7da327f74
+MISC ChangeLog-2015 3446 SHA256 ed496fbc283466fa0f3ff738f4e97de9a941396e25f2f4d6091834ccef72097d SHA512 ab57781b80461919616f69546df4a25e9e77069f8c987691170460009ca944dde16f756b213c1a21612dc8790db58e0f6bf5ae740a7df2e9e75eb1e2328c312e WHIRLPOOL ab923369145255f302941f8715185926381a496f324e6036884a537938b5a422ff0cd59f2cc1ff8c73b5ec93362a152b552c8835ff69f16358818deb444f36e2
+MISC metadata.xml 340 SHA256 f334cba1b615bf68b34b26b9718ee0b3cf36f4ec1d414a7079b8d15cb58345bf SHA512 54fcb0b54320053eb1f68f11107e8027a618351a78d539de2dffaad678aabe9b20972700af6ac2ba4bfa589c91e1cd2d91df517ab745ad365b1ad1ba7a4b0f3e WHIRLPOOL a691022d85bc63c216c22b427e539698ad1e759bd3e8db8a5b4c2d03d545f64d1a277fba1ad721d32f00d2beae7565fb64468c2c7b1bb10877931ed6284c1d46
diff --git a/sys-libs/librtas/files/librtas-1.3.6-symlink.patch b/sys-libs/librtas/files/librtas-1.3.6-symlink.patch
new file mode 100644
index 000000000000..f9536f427492
--- /dev/null
+++ b/sys-libs/librtas/files/librtas-1.3.6-symlink.patch
@@ -0,0 +1,24 @@
+QA Notice: Missing soname symlink(s):
+usr/lib64/libofdt.so.1 -> libofdt.so.1.3.6
+usr/lib64/librtas.so.1 -> librtas.so.1.3.6
+
+--- libofdt_src/Makefile
++++ libofdt_src/Makefile
+@@ -27,6 +27,7 @@
+ @$(call install_lib,$(LIBOFDT),$(DESTDIR))
+ @$(call install_inc,$(LIBOFDT_SHIP_HDR),$(DESTDIR))
+ @ln -sf $(LIBOFDT) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBOFDT))/$(LIBOFDT_SONAME)
++ @ln -sf $(LIBOFDT) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBOFDT))/$(LIBOFDT_SONAME).1
+
+ uninstall:
+ @$(call uninstall_lib,$(LIBOFDT),$(DESTDIR))
+--- librtas_src/Makefile
++++ librtas_src/Makefile
+@@ -33,6 +33,7 @@
+ @$(call install_lib,$(LIBRTAS),$(DESTDIR))
+ @$(call install_inc,$(HEADERS),$(DESTDIR))
+ @ln -sf $(LIBRTAS) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBRTAS))/$(LIBRTAS_SONAME)
++ @ln -sf $(LIBRTAS) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBRTAS))/$(LIBRTAS_SONAME).1
+
+ uninstall:
+ @$(call uninstall_lib,$(LIBRTAS),$(DESTDIR))
diff --git a/sys-libs/librtas/files/librtas-1.3.8-symlink.patch b/sys-libs/librtas/files/librtas-1.3.8-symlink.patch
new file mode 100644
index 000000000000..c3faeaf41e22
--- /dev/null
+++ b/sys-libs/librtas/files/librtas-1.3.8-symlink.patch
@@ -0,0 +1,20 @@
+--- libofdt_src/Makefile
++++ libofdt_src/Makefile
+@@ -27,6 +27,7 @@
+ @$(call install_lib,$(LIBOFDT),$(DESTDIR))
+ @$(call install_inc,$(LIBOFDT_SHIP_HDR),$(DESTDIR))
+ @ln -sf $(LIBOFDT) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBOFDT))/$(LIBOFDT_SONAME)
++ @ln -sf $(LIBOFDT) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBOFDT))/$(LIBOFDT_SONAME).1
+
+ uninstall:
+ @$(call uninstall_lib,$(LIBOFDT),$(DESTDIR))
+--- librtas_src/Makefile
++++ librtas_src/Makefile
+@@ -33,6 +33,7 @@
+ @$(call install_lib,$(LIBRTAS),$(DESTDIR))
+ @$(call install_inc,$(HEADERS),$(DESTDIR))
+ @ln -sf $(LIBRTAS) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBRTAS))/$(LIBRTAS_SONAME)
++ @ln -sf $(LIBRTAS) $(DESTDIR)/$(LIB_DIR)$(call is_lib64,$(LIBRTAS))/$(LIBRTAS_SONAME).1
+
+ uninstall:
+ @$(call uninstall_lib,$(LIBRTAS),$(DESTDIR))
diff --git a/sys-libs/librtas/librtas-1.3.13.ebuild b/sys-libs/librtas/librtas-1.3.13.ebuild
new file mode 100644
index 000000000000..97bb5bc07d27
--- /dev/null
+++ b/sys-libs/librtas/librtas-1.3.13.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="A set of libraries for userspace access to RTAS on the PowerPC platform(s)"
+HOMEPAGE="https://sourceforge.net/projects/librtas/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~ppc ~ppc64"
+
+DOCS="README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.3.8-symlink.patch
+ sed -i -e '/install_doc/d' Makefile || die
+}
diff --git a/sys-libs/librtas/librtas-1.3.6.ebuild b/sys-libs/librtas/librtas-1.3.6.ebuild
new file mode 100644
index 000000000000..6abf168d6c43
--- /dev/null
+++ b/sys-libs/librtas/librtas-1.3.6.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="A set of libraries for userspace access to RTAS on the PowerPC platform(s)"
+HOMEPAGE="https://sourceforge.net/projects/librtas/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="ppc ppc64"
+IUSE=""
+
+DOCS="README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-symlink.patch
+ sed -i -e '/install_doc/d' Makefile || die
+}
diff --git a/sys-libs/librtas/librtas-1.3.8.ebuild b/sys-libs/librtas/librtas-1.3.8.ebuild
new file mode 100644
index 000000000000..6609d3be98db
--- /dev/null
+++ b/sys-libs/librtas/librtas-1.3.8.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="A set of libraries for userspace access to RTAS on the PowerPC platform(s)"
+HOMEPAGE="https://sourceforge.net/projects/librtas/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~ppc ~ppc64"
+IUSE=""
+
+DOCS="README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-symlink.patch
+ sed -i -e '/install_doc/d' Makefile || die
+}
diff --git a/sys-libs/librtas/metadata.xml b/sys-libs/librtas/metadata.xml
new file mode 100644
index 000000000000..7971ce089c64
--- /dev/null
+++ b/sys-libs/librtas/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 type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">librtas</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libseccomp/Manifest b/sys-libs/libseccomp/Manifest
new file mode 100644
index 000000000000..7637d5da643b
--- /dev/null
+++ b/sys-libs/libseccomp/Manifest
@@ -0,0 +1,9 @@
+DIST libseccomp-2.3.0.tar.gz 546948 SHA256 d756e3a77578259a808698a50c43d44612aae3339ea42ab5b15ea983f26b901d SHA512 398643af0920ff446b37a74e48f7a96ad2bec4f514e92fc6f8242b7515dcb8f5d06c2894790b22f62387c2d9b75efd54a4d5944f973239a05f06ec840f2a5a0b WHIRLPOOL 45ced8e8cc5636fdd9861408582277183daf7c6e3b35bc9f16ea16249a27f86cf82ec45c7e9f898a843b91b9c37ff5ab5b0a4a2b79ac2564e92cecaf8a39d61d
+DIST libseccomp-2.3.1.tar.gz 552299 SHA256 ff5bdd2168790f1979e24eaa498f8606c2f2d96f08a8dc4006a2e88affa4562b SHA512 246b30e1c513d5e1fa35a47905d99036e276c1e6483a96f3e79ddca536a8c6f641c11bf324ed10c9c8d18fa27d73667c9c72fc7459f827d2883926769ac1cb45 WHIRLPOOL 2ffb97f5f45d7cda354b6e52f6b604e4fc1fb7b6b804defeabb377c108bbcbf0099fc6f78d3104f96d37ce65e837914a0823a9a6d90812d893a7a367cf09a3b9
+DIST libseccomp-2.3.2.tar.gz 559238 SHA256 3ddc8c037956c0a5ac19664ece4194743f59e1ccd4adde848f4f0dae7f77bca1 SHA512 0864a53ba2be61d0207f7361af94bcda4acff84a1814f915e6ccb19ab24f6ccc978da0eedc5cee047fa655dc1a583e2eeb7ab985ebfc77491c6a2606727b79ec WHIRLPOOL e5212eff7d2e916a161bae864fc60c8d634c700b7e553886b0701b930796a9d14ea1428e74d50470ab6aa459dcacf5b7d3174249bb723735aa6e466a9ec109ae
+EBUILD libseccomp-2.3.0.ebuild 955 SHA256 9fb8bb4fa4927f20014fdd43e7d7a970e0a8526c60f82a7b20a6d942d954c9e4 SHA512 cef9191e4a27650afb955eeef4ae61ac7bf5ed8e08fd39e4645d0fb7658c4fa6f3896b5f6105054da97eaf63158ef778f58f2cb735e46ea774537533c9726dd8 WHIRLPOOL 944ed4840159daae03bc3b31f8c9aa3b94397869f8e9aa0948ef5bfb606f59054b5b94fbef422ae922460396fd325493c22eb0a2727936b534947f60612bd590
+EBUILD libseccomp-2.3.1.ebuild 962 SHA256 8bfbeea136cd4d3d835b40945ec8920f02c5161e9cb41e29dcb55ee9a8996c18 SHA512 58e7fd61a982923ced093c7a861b15838f38fb0fcf64fa87e3a6669985ba28e4b30896e76c0373b9be42a9bcbc6e71393dd31a50ed090441fde2cc707481a208 WHIRLPOOL b8322ec31c4150c897d42e19476db9fd6dc456e6feb506f93d99e2350743f56f5f174f8a3059a4e7717088cb7210a0662cbef6bccb6d0e07b07e643f94ce5792
+EBUILD libseccomp-2.3.2.ebuild 957 SHA256 a665301dee61a1c12a1fa6b6a81f68401469eb0a9bc4f801126bd56beba0e7c2 SHA512 0c2367d7e52e642d689ca37246fbb694f22ee7de0858f96605ff2f89c775b7fe888889ad78beb0d3277db884e5c621ccccdb30ceeb73ef232bf3781667397975 WHIRLPOOL b663a6560d7aa9022eb3c2009e2c0d6424e47d4bcbfa982f0cb643be4460251d6933b4b2c54db810d7280a17b83a8fd21ef77cf02056f99e41217174ee06bb41
+MISC ChangeLog 5065 SHA256 bb6d880322eefa63f6ef1b3cd50b8fdfe668f54201bfaad43d000eb8f3601580 SHA512 d6671c51d06ba982a61debc7b163286b27938e4e3ba083b64979a291d7dfed03a2cf4ce93ac711375ba10a7f7e70d23edd0cf2dcb83318b51dbaf6a9b0eaa4e8 WHIRLPOOL 0b66d913eb8d09451d0b94ebe4b37d455ef4df2e17d8c99d3c2c6bf281c362d739bbb0d6daf35bc4429b5ee326d4061e0de32839acfb6934b2c5d4a09e0821dd
+MISC ChangeLog-2015 2307 SHA256 7d912bfa9ccaf0767367603bae549e68efe5e3011bd549598ebd4e95574a32ef SHA512 3d227e666fde1eb2e8b49133dc4499d16929404509824dc49e20e883bea76aaa46377ddfb10ffa18314b2a59360e687a0743491585cb8a2d44bd4e8f47d88046 WHIRLPOOL 0b23594f3c1a731cdfd67ddbf09aee87dd6de5fa502b6dc01afaf56b81db3815f18373ae337fc3f0da29b05fccfd9efe7ca44e68782675ff9556690e1b75e90b
+MISC metadata.xml 355 SHA256 8087b7a37ab380f3809766fad5e5d72b88795e76a9856ea19b062e54bc8b5447 SHA512 dbf3c5decd7e918af6092ae690a2566c98f9b5386eee17c363dde79c03ca7d3a4103926a9327711aa059cf82916a4cb36360ce3c762093301aa44bc8cfd70f42 WHIRLPOOL 98020ffdc094b2a3a8d0a60d645bd34167feb0fdc280d3f366020a1daf2d540b6bca34a3f8a070c46b439d91104425417d07338c8afb3245260f33f57852b335
diff --git a/sys-libs/libseccomp/libseccomp-2.3.0.ebuild b/sys-libs/libseccomp/libseccomp-2.3.0.ebuild
new file mode 100644
index 000000000000..d7f9b58e8f50
--- /dev/null
+++ b/sys-libs/libseccomp/libseccomp-2.3.0.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# TODO: Add python support.
+
+EAPI="5"
+
+inherit eutils multilib-minimal
+
+DESCRIPTION="high level interface to Linux seccomp filter"
+HOMEPAGE="https://github.com/seccomp/libseccomp"
+SRC_URI="https://github.com/seccomp/libseccomp/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="-* amd64 arm arm64 ~mips ppc ppc64 s390 x86"
+IUSE="static-libs"
+
+# We need newer kernel headers; we don't keep strict control of the exact
+# version here, just be safe and pull in the latest stable ones. #551248
+DEPEND=">=sys-kernel/linux-headers-4.3"
+
+src_prepare() {
+ sed -i \
+ -e '/_LDFLAGS/s:-static::' \
+ tools/Makefile.in || die
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable static-libs static) \
+ --disable-python
+}
+
+multilib_src_install_all() {
+ find "${ED}" -name libseccomp.la -delete
+ einstalldocs
+}
diff --git a/sys-libs/libseccomp/libseccomp-2.3.1.ebuild b/sys-libs/libseccomp/libseccomp-2.3.1.ebuild
new file mode 100644
index 000000000000..520288136b09
--- /dev/null
+++ b/sys-libs/libseccomp/libseccomp-2.3.1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# TODO: Add python support.
+
+EAPI="5"
+
+inherit eutils multilib-minimal
+
+DESCRIPTION="high level interface to Linux seccomp filter"
+HOMEPAGE="https://github.com/seccomp/libseccomp"
+SRC_URI="https://github.com/seccomp/libseccomp/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~s390 ~x86"
+IUSE="static-libs"
+
+# We need newer kernel headers; we don't keep strict control of the exact
+# version here, just be safe and pull in the latest stable ones. #551248
+DEPEND=">=sys-kernel/linux-headers-4.3"
+
+src_prepare() {
+ sed -i \
+ -e '/_LDFLAGS/s:-static::' \
+ tools/Makefile.in || die
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable static-libs static) \
+ --disable-python
+}
+
+multilib_src_install_all() {
+ find "${ED}" -name libseccomp.la -delete
+ einstalldocs
+}
diff --git a/sys-libs/libseccomp/libseccomp-2.3.2.ebuild b/sys-libs/libseccomp/libseccomp-2.3.2.ebuild
new file mode 100644
index 000000000000..503a145f6af7
--- /dev/null
+++ b/sys-libs/libseccomp/libseccomp-2.3.2.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# TODO: Add python support.
+
+EAPI="5"
+
+inherit eutils multilib-minimal
+
+DESCRIPTION="high level interface to Linux seccomp filter"
+HOMEPAGE="https://github.com/seccomp/libseccomp"
+SRC_URI="https://github.com/seccomp/libseccomp/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="-* amd64 arm ~arm64 ~mips ppc ppc64 ~s390 x86"
+IUSE="static-libs"
+
+# We need newer kernel headers; we don't keep strict control of the exact
+# version here, just be safe and pull in the latest stable ones. #551248
+DEPEND=">=sys-kernel/linux-headers-4.3"
+
+src_prepare() {
+ sed -i \
+ -e '/_LDFLAGS/s:-static::' \
+ tools/Makefile.in || die
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable static-libs static) \
+ --disable-python
+}
+
+multilib_src_install_all() {
+ find "${ED}" -name libseccomp.la -delete
+ einstalldocs
+}
diff --git a/sys-libs/libseccomp/metadata.xml b/sys-libs/libseccomp/metadata.xml
new file mode 100644
index 000000000000..3a6400d9d03e
--- /dev/null
+++ b/sys-libs/libseccomp/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 type="person">
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">seccomp/libseccomp</remote-id>
+ <remote-id type="sourceforge">libseccomp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libselinux/Manifest b/sys-libs/libselinux/Manifest
new file mode 100644
index 000000000000..22b7550c14e8
--- /dev/null
+++ b/sys-libs/libselinux/Manifest
@@ -0,0 +1,14 @@
+AUX 0005-use-ruby-include-with-rubylibver.patch 634 SHA256 ca87111f9eb48b45b7271f4863ad4fbae99b64fd28a457cb15920250b0ded834 SHA512 6755c06e39a924dacc8cd21e8b56138938b55a54e76baddd2243bb4ec2cb99a92ca9d825f2f789ea84e87b1d795334a6b936e627d45b097ff724f00eb566c118 WHIRLPOOL 76a35b23454c941c32efdb2ed87a3fa3b044929d24acdcec53ab36f7d300bc94d6d8165a7b55483cc26ad21b4415aa47cb1540c07c498d3eeef2717f60a8ec3c
+AUX 0007-build-related-fixes-bug-500674-for-2.5.patch 2918 SHA256 15b6e58c721fa81ed4332a534e3e048e4daeacddbb847ce93c7c921b1131da30 SHA512 e8a30a382be1ebe04af2a161a7ea523af0218220302f339dec2a518075d8b06db966a3d30a28fb45183023709b003b90e366a6626b530c66e1e7cc0baff9a853 WHIRLPOOL 4ef3cf46569ecfcfdeee1c47b684ebb708f6c33d6c0db6204c5cd2505c54d0fc586b67bd2db8b57da3ae3765905b40401261dc46172a10e454ba74bbc5b086a5
+AUX libselinux-2.5-0001-only-mount-proc-if-necessary.patch 1612 SHA256 0f9bec3bfd575cf4b805bc9b6773f68fc23c6f9bab55321ae63990ae3d722c15 SHA512 dbe76ba56bd3bd223b0733dd0645c5869bd3beda8ee502862c0c156d7b8532e94894edd488b64071f5e9dde070bd078ec9f529445a2377d092da65a941e5b5dd WHIRLPOOL 6e64be7cbae5bf3c67a633181b4bde4b5533fc40ce64db809ef542e60359b4a4b5bdb7fb03299ce877fcb21a08e7cd57ff9a8952e24a533953deea5616b5ba82
+AUX libselinux-2.5-0002-Avoid-mounting-proc-outside-of-selinux_init_load_pol.patch 3418 SHA256 f575d32566a4ed03701c2d4f57029da0a5d182d87842f276145e31b0e2f5eea5 SHA512 05dd4f39fb1b849551e944847a02d32f0cccf9f1fa07b12ed3648dfb2351241036eb3afe791c83b753c53234c16d9b124f490fb40ff122d97800e7fbf57174ac WHIRLPOOL 9b0176237815d741550eb937b0bf9ad22c964d578ca6f414c1a92149c38f44323d3d941e5580a415e22cd110b294a386dbf9dc63d94a56412cec790e15a0813f
+AUX libselinux-2.5-0003-Change-the-location-of-_selinux.so.patch 1810 SHA256 61a833d92d233546bab338ccefa449e6f4b1cb70ac78c11d1ce94e6286bde9d1 SHA512 93b56eb3864dfee200d90f2e54ada3998219076b1408b028890fb4111264781374dfef47db774fcad12aa7e98c9737b566eccd436302ece0bd54f94055578dba WHIRLPOOL 289a6ba5f5e84ec686a3b93876cc989cde55a2aaca2ab6e5429bfec9a546a09c09f98dc66301933471ca5c540ed71becb770eaed3c793acf865a37b996087264
+AUX libselinux-2.6-0007-build-related-fixes-bug-500674.patch 3565 SHA256 2d7aef43e8fadb9becbc2ba7e0a478314540a50be6dbd205d0c56fcb2db13a7d SHA512 d377c6be001edb874e443d1a3992633bffef8b243ba73757e83b348d9db988be1af1239820471f4d319ea76a308148b5b06c23178910bfd032892ea861a47cd4 WHIRLPOOL fec6f0f05c5c7b62a37784ad7de78d03329b321e95ad351e9fcca4e17b522d744d17f67b78325893efa537988d68b020baf6c490303f556841bceb6fe7db3c54
+DIST libselinux-2.6.tar.gz 203119 SHA256 4ea2dde50665c202253ba5caac7738370ea0337c47b251ba981c60d24e1a118a SHA512 906e1bf98c669862ab4f4e883d511db8d739a5763dc857c9405ad3cc6c70766a482853d07134698a1a98257a8632cc756d0549a7640c2915d051714f502ff14b WHIRLPOOL bf60ce907b7057ada5d19e3a0cd1f092a7dfc2de774e504762424c325c657a4f144fbe252e7d908f7c6d902d80388517e15134a289f4358e564c8720ea6534d9
+DIST libselinux-2.7.tar.gz 187574 SHA256 d0fec0769b3ad60aa7baf9b9a4b7a056827769dc2dadda0dc0eb59b3d1c18c57 SHA512 415d10306692d4323455b61fb61d7e56e53b9144276ff206d72760e1df9b04ab07c62a4d6f04bf4e5fa708f9f14b21a9801069b16ece0a0aade886950941ab8d WHIRLPOOL dd9175c91fa8f6f87add7b0ad1b90706b1fb203ade866b42d886faeb3710e1138fc08a2d7d371fbc8c9480148f8fdec6f0a6dd3f7142f194da580365cd527351
+EBUILD libselinux-2.6.ebuild 4243 SHA256 f6ce0f1dcd1f12848ed3a91b7233ed3ba3b1f63378a7ff59fd2251b629da19a1 SHA512 696a399320ae12e0b1db84558e8470f166b261ad9b16ca28ddcc140957ded2a8ccaffe52bac3f6134e45841ee4bfffd6e8114bc50b57197b05f6644f7d713367 WHIRLPOOL a1c1b6c09913dde2fb9940954dddc5431472349bf7ddac38a382592ed13f295a35c1dfab8131b1df534a98c08588dd61fad2e984d3ac27ae429b99aa5d6b4478
+EBUILD libselinux-2.7.ebuild 4111 SHA256 94458649c550e69167a28f8f695c9990d8b12f8358cce6bfdee875e2caf9c5a4 SHA512 ba62e1a04a4c14441b55f4866cbf62a15175585ebf3c82be27940bcf75eee62f23ae9c2224a06d1d2845b27ca321061207d4d9c4ba73b85f996469b30d25183e WHIRLPOOL 4c4bdd1ae34fcb213b8e0ba5b820d7886449fea1bcb4f6e1bad25bcc36d5cf63149c9de3493dde53981abdb891d7396ef45c85c2c0096eb8628fc805c5c2dfa0
+EBUILD libselinux-9999.ebuild 4113 SHA256 7d082e7734d04cc969a7eda5fa1b3c91b4a7264e56252c732411a715ee4165c5 SHA512 d74dc1b851c8abbadf86d0bd77a798cf1e5a7e2b26fbb4453371c77f2179dcc2e03333522a1ad81ca074a6a83f0a1e3fc06882551badbdcd4d95879a3c058290 WHIRLPOOL b9156add2f82c59717dfba185fc7ffe1260348a758661ff29170fd4d2c705d497e6d2fd413794d6b8ac131e9af99452ce93c2ff42c1d3712c449a7d2ce496804
+MISC ChangeLog 6847 SHA256 3e40e0f2ca279c7920652ad62724b5b7ec615c34de1b1a2f471419bac8607a24 SHA512 6479a9db84e15e74200be39225ce77c7ca12f6970d2b0aaa550bc267ba08a25185d4b20411b07e0fcd9733f888ceda62d6b8e44e647e3cadb243c67a6f50cb0a WHIRLPOOL ad5e53aefd225d47b0d5334a4063239d6ff6981cbfd5b089005571a8b83731a2a5d18f9994086a81f2f950b50b26d8cce495693a6759d1ddc17db1ab197805e4
+MISC ChangeLog-2015 21667 SHA256 3c8ecd29df3b5dd6b0b751dde592c1be7ad4d3c58fc6abc4ff5ddf1fa0dff484 SHA512 d9599d12aa78d4b97f74d989132b5def6d3ad3f34792457795bea1b3bdc1a06f0532cafb3d932339dbf7576fa68bd2422af1e5f5cccb36f74d0ca09dfc6145e1 WHIRLPOOL e5901ad1fbcf84db8c915e51d56da7f72d3703410113e82cddaf08979bf79a4886a5618cfa922a1f564ad2fb14694e6f46a97b3519a31e33d983f84e2ca414fe
+MISC metadata.xml 676 SHA256 288211da34dc4cabaeaa85c52462c3ad2792347abbf88f78eae812a4e3dc8c8c SHA512 7b33e0d113637a129a7894d8720feb9024d67466b86d475fbc3398f514b2ecc28c70dc759952376208d2022a00658eb120fc3561edbb9c7ecdc4404bed5f57a7 WHIRLPOOL bd4938862e3ec119c1da448d5bc8c99a6063704a65c8a906514f5160adf65851af64c6a1c4626e97438e9f4a7288ef002b06a876b9d73e67d70e38ca31cc1319
diff --git a/sys-libs/libselinux/files/0005-use-ruby-include-with-rubylibver.patch b/sys-libs/libselinux/files/0005-use-ruby-include-with-rubylibver.patch
new file mode 100644
index 000000000000..0fc84141a3db
--- /dev/null
+++ b/sys-libs/libselinux/files/0005-use-ruby-include-with-rubylibver.patch
@@ -0,0 +1,12 @@
+diff -uNr libselinux-2.2.2.orig/src/Makefile libselinux-2.2.2/src/Makefile
+--- libselinux-2.2.2.orig/src/Makefile 2013-11-06 20:56:30.000000000 +0100
++++ libselinux-2.2.2/src/Makefile 2013-11-25 21:02:05.327561766 +0100
+@@ -16,7 +16,7 @@
+ PYLIBDIR ?= $(LIBDIR)/$(PYLIBVER)
+ RUBYLIBVER ?= $(shell $(RUBY) -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
+ RUBYPLATFORM ?= $(shell $(RUBY) -e 'print RUBY_PLATFORM')
+-RUBYINC ?= $(shell pkg-config --cflags ruby)
++RUBYINC ?= $(shell pkg-config --cflags ruby-$(RUBYLIBVER))
+ RUBYINSTALL ?= $(LIBDIR)/ruby/site_ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
+ LIBBASE ?= $(shell basename $(LIBDIR))
+
diff --git a/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch b/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch
new file mode 100644
index 000000000000..67e47ad40a67
--- /dev/null
+++ b/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch
@@ -0,0 +1,69 @@
+https://bugs.gentoo.org/500674
+
+random fixes:
+- make sure PCRE_CFLAGS get used
+- use PCRE_LIBS via pkg-config
+- move LDFLAGS to before objects, not after
+- do not hardcode -L$(LIBDIR) (let the toolchain handle it)
+- do not hardcode -I$(INCLUDEDIR) (let the toolchain handle it)
+
+diff -uNr libselinux-2.5.orig/src/Makefile libselinux-2.5/src/Makefile
+--- libselinux-2.5.orig/src/Makefile 2016-03-13 19:27:07.091000000 +0100
++++ libselinux-2.5/src/Makefile 2016-03-13 19:27:16.495000000 +0100
+@@ -73,7 +73,7 @@
+ -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
+ -Werror -Wno-aggregate-return -Wno-redundant-decls
+
+-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(EMFLAGS)
++override CFLAGS += -I../include $(PCRE_CFLAGS) -D_GNU_SOURCE $(EMFLAGS)
+
+ SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter \
+ -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations
+@@ -102,17 +102,17 @@
+ $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
+
+ $(SWIGSO): $(SWIGLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $< -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux
+
+ $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux
+
+ $(LIBA): $(OBJS)
+ $(AR) rcs $@ $^
+ $(RANLIB) $@
+
+ $(LIBSO): $(LOBJS)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -lpcre -ldl $(LDFLAGS) -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -ldl $(PCRE_LIBS) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
+ ln -sf $@ $(TARGET)
+
+ $(LIBPC): $(LIBPC).in ../VERSION
+@@ -125,7 +125,7 @@
+ $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
+
+ $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -L. $(LDFLAGS) -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a
+
+ %.o: %.c policy.h
+ $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
+diff -uNr libselinux-2.5.orig/utils/Makefile libselinux-2.5/utils/Makefile
+--- libselinux-2.5.orig/utils/Makefile 2016-03-13 19:27:07.102000000 +0100
++++ libselinux-2.5/utils/Makefile 2016-03-13 19:27:40.297000000 +0100
+@@ -24,11 +24,12 @@
+ -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
+ -Werror -Wno-aggregate-return -Wno-redundant-decls
+ override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
+-LDLIBS += -L../src -lselinux -L$(LIBDIR)
++LDLIBS += -L../src -lselinux
+
+ TARGETS=$(patsubst %.c,%,$(wildcard *.c))
+
+-sefcontext_compile: LDLIBS += -lpcre ../src/libselinux.a -lsepol
++sefcontext_compile: CFLAGS += $(PCRE_FLAGS)
++sefcontext_compile: LDLIBS += $(PCRE_LIBS) -lsepol ../src/libselinux.a
+
+ selinux_restorecon: LDLIBS += -lsepol
+
diff --git a/sys-libs/libselinux/files/libselinux-2.5-0001-only-mount-proc-if-necessary.patch b/sys-libs/libselinux/files/libselinux-2.5-0001-only-mount-proc-if-necessary.patch
new file mode 100644
index 000000000000..dfa6a0fa5553
--- /dev/null
+++ b/sys-libs/libselinux/files/libselinux-2.5-0001-only-mount-proc-if-necessary.patch
@@ -0,0 +1,54 @@
+From 5a8d8c499b2ef80eaa7b5abe2ec68d7101e613bf Mon Sep 17 00:00:00 2001
+From: Stephen Smalley <sds@tycho.nsa.gov>
+Date: Mon, 29 Feb 2016 10:10:55 -0500
+Subject: [PATCH] libselinux: only mount /proc if necessary
+
+Commit 9df498884665d ("libselinux: Mount procfs before checking
+/proc/filesystems") changed selinuxfs_exists() to always try
+mounting /proc before reading /proc/filesystems. However, this is
+unnecessary if /proc is already mounted and can produce avc denials
+if the process is not allowed to perform the mount. Check first
+to see if /proc is already present and only try the mount if it is not.
+
+Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
+---
+ libselinux/src/init.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/libselinux/src/init.c b/libselinux/src/init.c
+index 3db4de0..3530594 100644
+--- libselinux/src/init.c
++++ libselinux/src/init.c
+@@ -12,6 +12,7 @@
+ #include <stdint.h>
+ #include <limits.h>
+ #include <sys/mount.h>
++#include <linux/magic.h>
+
+ #include "dso.h"
+ #include "policy.h"
+@@ -57,13 +58,19 @@ static int verify_selinuxmnt(const char *mnt)
+
+ int selinuxfs_exists(void)
+ {
+- int exists = 0, mnt_rc = 0;
++ int exists = 0, mnt_rc = -1, rc;
++ struct statfs sb;
+ FILE *fp = NULL;
+ char *buf = NULL;
+ size_t len;
+ ssize_t num;
+
+- mnt_rc = mount("proc", "/proc", "proc", 0, 0);
++ do {
++ rc = statfs("/proc", &sb);
++ } while (rc < 0 && errno == EINTR);
++
++ if (rc == 0 && ((uint32_t)sb.f_type != (uint32_t)PROC_SUPER_MAGIC))
++ mnt_rc = mount("proc", "/proc", "proc", 0, 0);
+
+ fp = fopen("/proc/filesystems", "r");
+ if (!fp) {
+--
+2.7.3
+
diff --git a/sys-libs/libselinux/files/libselinux-2.5-0002-Avoid-mounting-proc-outside-of-selinux_init_load_pol.patch b/sys-libs/libselinux/files/libselinux-2.5-0002-Avoid-mounting-proc-outside-of-selinux_init_load_pol.patch
new file mode 100644
index 000000000000..c811450ba396
--- /dev/null
+++ b/sys-libs/libselinux/files/libselinux-2.5-0002-Avoid-mounting-proc-outside-of-selinux_init_load_pol.patch
@@ -0,0 +1,129 @@
+From 32773a99b1f0cf2b61b5f5a33359684b18aab1ed Mon Sep 17 00:00:00 2001
+From: Stephen Smalley <sds@tycho.nsa.gov>
+Date: Fri, 13 May 2016 11:59:47 -0400
+Subject: [PATCH] Avoid mounting /proc outside of selinux_init_load_policy().
+
+Temporarily mounting /proc within selinuxfs_exists() can cause
+problems since it can be called by a libselinux constructor and
+therefore may be invoked by every program linked with libselinux.
+Since this was only motivated originally by a situation where
+selinuxfs_exists() was called from selinux_init_load_policy()
+before /proc was mounted, fix it in selinux_init_load_policy() instead.
+
+This reverts commit 5a8d8c499b2ef80eaa7b5abe2ec68d7101e613bf
+("libselinux: only mount /proc if necessary") and
+commit 9df498884665d79474b79f0f30d1cd67df11bd3e
+("libselinux: Mount procfs before checking /proc/filesystems").
+
+Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
+---
+ libselinux/src/init.c | 27 +++------------------------
+ libselinux/src/load_policy.c | 15 ++++++++++-----
+ 2 files changed, 13 insertions(+), 29 deletions(-)
+
+diff --git a/libselinux/src/init.c b/libselinux/src/init.c
+index 3530594..3c687a2 100644
+--- libselinux/src/init.c
++++ libselinux/src/init.c
+@@ -11,8 +11,6 @@
+ #include <sys/vfs.h>
+ #include <stdint.h>
+ #include <limits.h>
+-#include <sys/mount.h>
+-#include <linux/magic.h>
+
+ #include "dso.h"
+ #include "policy.h"
+@@ -58,26 +56,15 @@ static int verify_selinuxmnt(const char *mnt)
+
+ int selinuxfs_exists(void)
+ {
+- int exists = 0, mnt_rc = -1, rc;
+- struct statfs sb;
++ int exists = 0;
+ FILE *fp = NULL;
+ char *buf = NULL;
+ size_t len;
+ ssize_t num;
+
+- do {
+- rc = statfs("/proc", &sb);
+- } while (rc < 0 && errno == EINTR);
+-
+- if (rc == 0 && ((uint32_t)sb.f_type != (uint32_t)PROC_SUPER_MAGIC))
+- mnt_rc = mount("proc", "/proc", "proc", 0, 0);
+-
+ fp = fopen("/proc/filesystems", "r");
+- if (!fp) {
+- exists = 1; /* Fail as if it exists */
+- goto out;
+- }
+-
++ if (!fp)
++ return 1; /* Fail as if it exists */
+ __fsetlocking(fp, FSETLOCKING_BYCALLER);
+
+ num = getline(&buf, &len, fp);
+@@ -91,14 +78,6 @@ int selinuxfs_exists(void)
+
+ free(buf);
+ fclose(fp);
+-
+-out:
+-#ifndef MNT_DETACH
+-#define MNT_DETACH 2
+-#endif
+- if (mnt_rc == 0)
+- umount2("/proc", MNT_DETACH);
+-
+ return exists;
+ }
+ hidden_def(selinuxfs_exists)
+diff --git a/libselinux/src/load_policy.c b/libselinux/src/load_policy.c
+index 21ee58b..4f39fc7 100644
+--- libselinux/src/load_policy.c
++++ libselinux/src/load_policy.c
+@@ -17,6 +17,10 @@
+ #include "policy.h"
+ #include <limits.h>
+
++#ifndef MNT_DETACH
++#define MNT_DETACH 2
++#endif
++
+ int security_load_policy(void *data, size_t len)
+ {
+ char path[PATH_MAX];
+@@ -348,11 +352,6 @@ int selinux_init_load_policy(int *enforce)
+ fclose(cfg);
+ free(buf);
+ }
+-#ifndef MNT_DETACH
+-#define MNT_DETACH 2
+-#endif
+- if (rc == 0)
+- umount2("/proc", MNT_DETACH);
+
+ /*
+ * Determine the final desired mode.
+@@ -400,11 +399,17 @@ int selinux_init_load_policy(int *enforce)
+ /* Only emit this error if selinux was not disabled */
+ fprintf(stderr, "Mount failed for selinuxfs on %s: %s\n", SELINUXMNT, strerror(errno));
+ }
++
++ if (rc == 0)
++ umount2("/proc", MNT_DETACH);
+
+ goto noload;
+ }
+ set_selinuxmnt(mntpoint);
+
++ if (rc == 0)
++ umount2("/proc", MNT_DETACH);
++
+ /*
+ * Note: The following code depends on having selinuxfs
+ * already mounted and selinuxmnt set above.
+--
+2.7.3
+
diff --git a/sys-libs/libselinux/files/libselinux-2.5-0003-Change-the-location-of-_selinux.so.patch b/sys-libs/libselinux/files/libselinux-2.5-0003-Change-the-location-of-_selinux.so.patch
new file mode 100644
index 000000000000..542acfdc2437
--- /dev/null
+++ b/sys-libs/libselinux/files/libselinux-2.5-0003-Change-the-location-of-_selinux.so.patch
@@ -0,0 +1,44 @@
+From a9604c30a5e2f71007d31aa6ba41cf7b95d94822 Mon Sep 17 00:00:00 2001
+From: Petr Lautrbach <plautrba@redhat.com>
+Date: Mon, 27 Jun 2016 10:46:13 +0200
+Subject: [PATCH] libselinux: Change the location of _selinux.so
+
+There was a change in swig-3.10 to use importlib instead of imp. While
+the implementation with imp looked for _selinux.so also into the same directory
+as __init__.py is, a new module with importlib searchs only standard paths.
+It means that we need to move _selinux.so from $(PYLIBDIR)/site-packages/selinux/
+to $(PYLIBDIR)/site-packages/.
+
+Fixes:
+>>> import selinux
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 21, in <module>
+ _selinux = swig_import_helper()
+ File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 20, in swig_import_helper
+ return importlib.import_module('_selinux')
+ File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
+ __import__(name)
+ImportError: No module named _selinux
+
+Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
+---
+ libselinux/src/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
+index d94163e..37d01af 100644
+--- libselinux/src/Makefile
++++ libselinux/src/Makefile
+@@ -156,7 +156,7 @@ install: all
+
+ install-pywrap: pywrap
+ test -d $(PYLIBDIR)/site-packages/selinux || install -m 755 -d $(PYLIBDIR)/site-packages/selinux
+- install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/selinux/_selinux.so
++ install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/_selinux.so
+ install -m 755 $(AUDIT2WHYSO) $(PYLIBDIR)/site-packages/selinux/audit2why.so
+ install -m 644 $(SWIGPYOUT) $(PYLIBDIR)/site-packages/selinux/__init__.py
+
+--
+2.7.3
+
diff --git a/sys-libs/libselinux/files/libselinux-2.6-0007-build-related-fixes-bug-500674.patch b/sys-libs/libselinux/files/libselinux-2.6-0007-build-related-fixes-bug-500674.patch
new file mode 100644
index 000000000000..83596e8e0a7f
--- /dev/null
+++ b/sys-libs/libselinux/files/libselinux-2.6-0007-build-related-fixes-bug-500674.patch
@@ -0,0 +1,91 @@
+https://bugs.gentoo.org/500674
+
+random fixes:
+- make sure PCRE_CFLAGS get used
+- use PCRE_LIBS via pkg-config
+- move LDFLAGS to before objects, not after
+- do not hardcode -L$(LIBDIR) (let the toolchain handle it)
+- do not hardcode -I$(INCLUDEDIR) (let the toolchain handle it)
+
+diff --git a/libselinux/Makefile b/libselinux/Makefile
+index baa0db3..4dc5aa0 100644
+--- libselinux/Makefile
++++ libselinux/Makefile
+@@ -1,5 +1,6 @@
+ SUBDIRS = src include utils man
+
++PKG_CONFIG ?= pkg-config
+ DISABLE_SETRANS ?= n
+ DISABLE_RPM ?= n
+ ANDROID_HOST ?= n
+@@ -20,10 +21,11 @@ export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST
+
+ USE_PCRE2 ?= n
+ ifeq ($(USE_PCRE2),y)
+- PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
+- PCRE_LDFLAGS := -lpcre2-8
++ PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
++ PCRE_LDFLAGS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
+ else
+- PCRE_LDFLAGS := -lpcre
++ PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
++ PCRE_LDFLAGS := $(shell $(PKG_CONFIG) --libs libpcre)
+ endif
+ export PCRE_CFLAGS PCRE_LDFLAGS
+
+diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
+index 13501cd..42cb2f6 100644
+--- libselinux/src/Makefile
++++ libselinux/src/Makefile
+@@ -67,7 +67,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi
+
+ PCRE_LDFLAGS ?= -lpcre
+
+-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
++override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
+
+ SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter \
+ -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations
+@@ -107,17 +107,17 @@ $(SWIGRUBYLOBJ): $(SWIGRUBYCOUT)
+ $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
+
+ $(SWIGSO): $(SWIGLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $< -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux
+
+ $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux
+
+ $(LIBA): $(OBJS)
+ $(AR) rcs $@ $^
+ $(RANLIB) $@
+
+ $(LIBSO): $(LOBJS)
+- $(CC) $(CFLAGS) -shared -o $@ $^ $(PCRE_LDFLAGS) -ldl $(LDFLAGS) -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(PCRE_LDFLAGS) -ldl -Wl,-soname,$(LIBSO),-z,defs,-z,relro
+ ln -sf $@ $(TARGET)
+
+ $(LIBPC): $(LIBPC).in ../VERSION
+@@ -130,7 +130,7 @@ $(AUDIT2WHYLOBJ): audit2why.c
+ $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
+
+ $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
+- $(CC) $(CFLAGS) -shared -o $@ $^ -L. $(LDFLAGS) -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a
+
+ %.o: %.c policy.h
+ $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
+diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile
+index e56a953..6fd205a 100644
+--- libselinux/utils/Makefile
++++ libselinux/utils/Makefile
+@@ -25,7 +25,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi
+ -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
+ -Werror -Wno-aggregate-return -Wno-redundant-decls
+ override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
+-LDLIBS += -L../src -lselinux -L$(LIBDIR)
++LDLIBS += -L../src -lselinux
+ PCRE_LDFLAGS ?= -lpcre
+
+ ifeq ($(ANDROID_HOST),y)
diff --git a/sys-libs/libselinux/libselinux-2.6.ebuild b/sys-libs/libselinux/libselinux-2.6.ebuild
new file mode 100644
index 000000000000..c92bb50d3950
--- /dev/null
+++ b/sys-libs/libselinux/libselinux-2.6.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 )
+USE_RUBY="ruby22 ruby23"
+
+# No, I am not calling ruby-ng
+inherit multilib python-r1 toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+SEPOL_VER="${PV}"
+MY_RELEASEDATE="20161014"
+
+DESCRIPTION="SELinux userland library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="public-domain"
+SLOT="0"
+IUSE="pcre2 python ruby static-libs ruby_targets_ruby21 ruby_targets_ruby22 ruby_targets_ruby23"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}:=[${MULTILIB_USEDEP}]
+ !pcre2? ( >=dev-libs/libpcre-8.33-r1:=[static-libs?,${MULTILIB_USEDEP}] )
+ pcre2? ( dev-libs/libpcre2:=[static-libs?,${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} )
+ ruby? (
+ ruby_targets_ruby22? ( dev-lang/ruby:2.2 )
+ ruby_targets_ruby23? ( dev-lang/ruby:2.3 )
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ python? ( >=dev-lang/swig-2.0.9 )"
+
+src_prepare() {
+ if [[ ${PV} != 9999 ]] ; then
+ # If needed for live builds, place them in /etc/portage/patches
+ eapply "${FILESDIR}/libselinux-2.6-0007-build-related-fixes-bug-500674.patch"
+ fi
+
+ eapply_user
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export AR CC PKG_CONFIG RANLIB
+
+ emake \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ LDFLAGS="-fPIC ${LDFLAGS} -pthread" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ all
+
+ if multilib_is_native_abi && use python; then
+ building() {
+ python_export PYTHON_INCLUDEDIR PYTHON_LIBPATH
+ emake \
+ PYINC="-I${PYTHON_INCLUDEDIR}" \
+ LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ pywrap
+ }
+ python_foreach_impl building
+ fi
+
+ if multilib_is_native_abi && use ruby; then
+ building() {
+ einfo "Calling rubywrap for ${1}"
+ # Clean up .lo file to force rebuild
+ rm -f src/selinuxswig_ruby_wrap.lo || die
+ emake \
+ RUBY=${1} \
+ LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ rubywrap
+ }
+ for RUBYTARGET in ${USE_RUBY}; do
+ use ruby_targets_${RUBYTARGET} || continue
+
+ building ${RUBYTARGET}
+ done
+ fi
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install
+
+ if multilib_is_native_abi && use python; then
+ installation() {
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install-pywrap
+ python_optimize # bug 531638
+ }
+ python_foreach_impl installation
+ fi
+
+ if multilib_is_native_abi && use ruby; then
+ installation() {
+ einfo "Calling install-rubywrap for ${1}"
+ # Forcing (re)build here as otherwise the resulting SO file is used for all ruby versions
+ rm src/selinuxswig_ruby_wrap.lo
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ RUBY=${1} \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install-rubywrap
+ }
+ for RUBYTARGET in ${USE_RUBY}; do
+ use ruby_targets_${RUBYTARGET} || continue
+
+ installation ${RUBYTARGET}
+ done
+ fi
+
+ use static-libs || rm "${D}"/usr/lib*/*.a || die
+}
+
+pkg_postinst() {
+ # Fix bug 473502
+ for POLTYPE in ${POLICY_TYPES};
+ do
+ mkdir -p /etc/selinux/${POLTYPE}/contexts/files || die
+ touch /etc/selinux/${POLTYPE}/contexts/files/file_contexts.local || die
+ # Fix bug 516608
+ for EXPRFILE in file_contexts file_contexts.homedirs file_contexts.local ; do
+ if [[ -f "/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" ]]; then
+ sefcontext_compile /etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE} \
+ || die "Failed to recompile contexts"
+ fi
+ done
+ done
+}
diff --git a/sys-libs/libselinux/libselinux-2.7.ebuild b/sys-libs/libselinux/libselinux-2.7.ebuild
new file mode 100644
index 000000000000..a8ed808fe471
--- /dev/null
+++ b/sys-libs/libselinux/libselinux-2.7.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 )
+USE_RUBY="ruby22 ruby23"
+
+# No, I am not calling ruby-ng
+inherit multilib python-r1 toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+SEPOL_VER="${PV}"
+MY_RELEASEDATE="20170804"
+
+DESCRIPTION="SELinux userland library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="public-domain"
+SLOT="0"
+IUSE="pcre2 python ruby static-libs ruby_targets_ruby21 ruby_targets_ruby22 ruby_targets_ruby23"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}:=[${MULTILIB_USEDEP}]
+ !pcre2? ( >=dev-libs/libpcre-8.33-r1:=[static-libs?,${MULTILIB_USEDEP}] )
+ pcre2? ( dev-libs/libpcre2:=[static-libs?,${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} )
+ ruby? (
+ ruby_targets_ruby22? ( dev-lang/ruby:2.2 )
+ ruby_targets_ruby23? ( dev-lang/ruby:2.3 )
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ python? ( >=dev-lang/swig-2.0.9 )"
+
+src_prepare() {
+ eapply_user
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export AR CC PKG_CONFIG RANLIB
+
+ emake \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ LDFLAGS="-fPIC ${LDFLAGS} -pthread" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ all
+
+ if multilib_is_native_abi && use python; then
+ building() {
+ emake \
+ LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ pywrap
+ }
+ python_foreach_impl building
+ fi
+
+ if multilib_is_native_abi && use ruby; then
+ building() {
+ einfo "Calling rubywrap for ${1}"
+ # Clean up .lo file to force rebuild
+ rm -f src/selinuxswig_ruby_wrap.lo || die
+ emake \
+ RUBY=${1} \
+ LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ rubywrap
+ }
+ for RUBYTARGET in ${USE_RUBY}; do
+ use ruby_targets_${RUBYTARGET} || continue
+
+ building ${RUBYTARGET}
+ done
+ fi
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install
+
+ if multilib_is_native_abi && use python; then
+ installation() {
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install-pywrap
+ python_optimize # bug 531638
+ }
+ python_foreach_impl installation
+ fi
+
+ if multilib_is_native_abi && use ruby; then
+ installation() {
+ einfo "Calling install-rubywrap for ${1}"
+ # Forcing (re)build here as otherwise the resulting SO file is used for all ruby versions
+ rm src/selinuxswig_ruby_wrap.lo
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \
+ RUBY=${1} \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install-rubywrap
+ }
+ for RUBYTARGET in ${USE_RUBY}; do
+ use ruby_targets_${RUBYTARGET} || continue
+
+ installation ${RUBYTARGET}
+ done
+ fi
+
+ use static-libs || rm "${D}"/usr/lib*/*.a || die
+}
+
+pkg_postinst() {
+ # Fix bug 473502
+ for POLTYPE in ${POLICY_TYPES};
+ do
+ mkdir -p /etc/selinux/${POLTYPE}/contexts/files || die
+ touch /etc/selinux/${POLTYPE}/contexts/files/file_contexts.local || die
+ # Fix bug 516608
+ for EXPRFILE in file_contexts file_contexts.homedirs file_contexts.local ; do
+ if [[ -f "/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" ]]; then
+ sefcontext_compile /etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE} \
+ || die "Failed to recompile contexts"
+ fi
+ done
+ done
+}
diff --git a/sys-libs/libselinux/libselinux-9999.ebuild b/sys-libs/libselinux/libselinux-9999.ebuild
new file mode 100644
index 000000000000..fdd6f7fd3330
--- /dev/null
+++ b/sys-libs/libselinux/libselinux-9999.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 )
+USE_RUBY="ruby22 ruby23"
+
+# No, I am not calling ruby-ng
+inherit multilib python-r1 toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+SEPOL_VER="${PV}"
+MY_RELEASEDATE="20170804"
+
+DESCRIPTION="SELinux userland library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="public-domain"
+SLOT="0"
+IUSE="pcre2 python ruby static-libs ruby_targets_ruby21 ruby_targets_ruby22 ruby_targets_ruby23"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}:=[${MULTILIB_USEDEP}]
+ !pcre2? ( >=dev-libs/libpcre-8.33-r1:=[static-libs?,${MULTILIB_USEDEP}] )
+ pcre2? ( dev-libs/libpcre2:=[static-libs?,${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} )
+ ruby? (
+ ruby_targets_ruby22? ( dev-lang/ruby:2.2 )
+ ruby_targets_ruby23? ( dev-lang/ruby:2.3 )
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ python? ( >=dev-lang/swig-2.0.9 )"
+
+src_prepare() {
+ eapply_user
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export AR CC PKG_CONFIG RANLIB
+
+ emake \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ LDFLAGS="-fPIC ${LDFLAGS} -pthread" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ all
+
+ if multilib_is_native_abi && use python; then
+ building() {
+ emake \
+ LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ pywrap
+ }
+ python_foreach_impl building
+ fi
+
+ if multilib_is_native_abi && use ruby; then
+ building() {
+ einfo "Calling rubywrap for ${1}"
+ # Clean up .lo file to force rebuild
+ rm -f src/selinuxswig_ruby_wrap.lo || die
+ emake \
+ RUBY=${1} \
+ LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ rubywrap
+ }
+ for RUBYTARGET in ${USE_RUBY}; do
+ use ruby_targets_${RUBYTARGET} || continue
+
+ building ${RUBYTARGET}
+ done
+ fi
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install
+
+ if multilib_is_native_abi && use python; then
+ installation() {
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install-pywrap
+ python_optimize # bug 531638
+ }
+ python_foreach_impl installation
+ fi
+
+ if multilib_is_native_abi && use ruby; then
+ installation() {
+ einfo "Calling install-rubywrap for ${1}"
+ # Forcing (re)build here as otherwise the resulting SO file is used for all ruby versions
+ rm src/selinuxswig_ruby_wrap.lo
+ emake DESTDIR="${D}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \
+ RUBY=${1} \
+ USE_PCRE2="$(usex pcre2 y n)" \
+ install-rubywrap
+ }
+ for RUBYTARGET in ${USE_RUBY}; do
+ use ruby_targets_${RUBYTARGET} || continue
+
+ installation ${RUBYTARGET}
+ done
+ fi
+
+ use static-libs || rm "${D}"/usr/lib*/*.a || die
+}
+
+pkg_postinst() {
+ # Fix bug 473502
+ for POLTYPE in ${POLICY_TYPES};
+ do
+ mkdir -p /etc/selinux/${POLTYPE}/contexts/files || die
+ touch /etc/selinux/${POLTYPE}/contexts/files/file_contexts.local || die
+ # Fix bug 516608
+ for EXPRFILE in file_contexts file_contexts.homedirs file_contexts.local ; do
+ if [[ -f "/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" ]]; then
+ sefcontext_compile /etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE} \
+ || die "Failed to recompile contexts"
+ fi
+ done
+ done
+}
diff --git a/sys-libs/libselinux/metadata.xml b/sys-libs/libselinux/metadata.xml
new file mode 100644
index 000000000000..537e0aa97df3
--- /dev/null
+++ b/sys-libs/libselinux/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 type="project">
+ <email>selinux@gentoo.org</email>
+ <name>SELinux Team</name>
+ </maintainer>
+ <longdescription>
+ Libselinux provides an API for SELinux applications to get and set
+ process and file security contexts and to obtain security policy
+ decisions. Required for any applications that use the SELinux API.
+ </longdescription>
+ <use>
+ <flag name="pcre2">Use <pkg>dev-libs/libpcre2</pkg> for fcontext regexes</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">SELinuxProject/selinux</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libsemanage/Manifest b/sys-libs/libsemanage/Manifest
new file mode 100644
index 000000000000..6af7ddebcef9
--- /dev/null
+++ b/sys-libs/libsemanage/Manifest
@@ -0,0 +1,11 @@
+AUX libsemanage-2.4-build-paths.patch 1322 SHA256 2c0b7a433b450a1af1fe700be31b64add02694fb5b850dcee859a140320be697 SHA512 dc667b90503847702c80e456549c2d4f94b6e4aa56d0babcb15dfd16a8f0f77db6807858eb8ddd204af8856bdcff0e34fb23f77f88b37a02f74f823d97dafb61 WHIRLPOOL 8fc48dc15f123d5001b5ee96be8b86a9c28f55d682db4d4aa495ccd1c3edf5774b318fa93036024fb1bed7d10c7cfa52cbbf7c4ea70d854a177d487a3478212b
+AUX libsemanage-2.6-0001-libsemanage-genhomedircon-only-set-MLS-level-if-MLS-.patch 1370 SHA256 4964db92ab8ad5289f3fe2c45af745564e565b922e0a32dcd9af11983bf51458 SHA512 08663502d489730b2bcc2ea2e1a15fc3cb0874dff4d2b9e650fc6b71f74d8e395a6787186ba1d138bfa99897ba44a9acbbe7b695e88e98591a8ea9f4bc3857c3 WHIRLPOOL f729306d3247fee8df47e9479029207025748dcff87e4743ac77ffc2db276f0bbbc2c08f236364d0c6d2fe92736cc0a5037466eb950f58069c4b94333eba5909
+AUX libsemanage-2.6-build-paths.patch 1325 SHA256 83429eb03458ca686f6a682a7d815b6726935cf2f8de27e9e43357a57c9a2065 SHA512 06fb96608f27169efde64bf679b8cc3e337857e4b6cf0743953f96be7df382e11ea0a20837d854c73dc5c216cee8f9723e23b17fa1a7844d3a4b7ef4ebe937d2 WHIRLPOOL 45fb38af7936b535f196cd9f028e89c80d5138cece7fb8e575c38c1043b961e9f6fc8c8f9378685b3cd12eab6c234d3dc80589f5b0aa99c76d26905f8b181583
+DIST libsemanage-2.6.tar.gz 155897 SHA256 4f81541047290b751f2ffb926fcd381c186f22db18d9fe671b0b4a6a54e8cfce SHA512 38741d6e6f7a2669bfeee362e42d6bfd720cceeaf61331e329b2210fdc070444e529656ce86dd82e94aa248eafcfaea4c5d013d9cce76c1039be6fc6a6b2c790 WHIRLPOOL 9fb781c637c4725dd48fa07898fd5db4b2f1e47264e80468e3c9b48fd8afc6bcb6494a44ccbfb0e48dec10dc5db461ab8e1941251d625854ebbebdbfdacb971c
+DIST libsemanage-2.7.tar.gz 153465 SHA256 07e9477714ce6a4557a1fe924ea4cb06501b62d0fa0e3c0dc32a2cf47cb8d476 SHA512 6b30ea87f1ab3944935188539bbf869c8e287e05c174ea61cd19722a89cf8156518f336476e23b4117a5a05aec9a99a4db679b58a6952bf0c31ad809e9ab91d9 WHIRLPOOL b1acccb13b54cacd6d956d615a954c5aef4bd97ec225702ccd6818f7a4d64244f60f13c5b8cc02d4fd453e103b6e409919562406510fe2614c1fc6338c19ad67
+EBUILD libsemanage-2.6.ebuild 4890 SHA256 afad97143eaedb88b2cdd730770570e0e165e957a252d400448ff33b5c2c8dbc SHA512 c00a4c4ebe3b09458176bc65138b47491b528880bced8a3313cd30fdd65caca48042042d1bb909a6abd48f68e31a11cafba426bf70f308971ab063167a817d91 WHIRLPOOL b1a265e966ee4737b828cef7b9e9824bdce074b12d6392f5948b90501b2f8e95a08ef67a456302d4b221fc307c05feda4c05fdeae73c8fac5ac5e574b06dab9c
+EBUILD libsemanage-2.7.ebuild 4754 SHA256 32bf136cade6890c9dbab36267ea0ba8811f1a6b63ef73936cff28658983b120 SHA512 845728f9434535df540cfea380cf73a15aa13318913a323b9a0575ea08d46680d9f0bc3d6236710c56de0ab36d146037c5600729bbca4d4462bc59298ba09d8d WHIRLPOOL f794bcc0675c8ba3dc7fc617607aae8af92bf0ad245b9bd3f1d57b50ce6c2f78dc45230e907107a0e97133bb8dd95d492c8c2f6efe281b92c024343d5b8166b5
+EBUILD libsemanage-9999.ebuild 4756 SHA256 840297e111e2bd1c6dd1635e79b64f9a63255fabb04847ed380802f6aed581c1 SHA512 e03ec8650939ce65fff76ace83fc7c8fa31263cd4a01d8feaca97553a6e8dd533a615a6df3a64967ed956f8ed1ff53396b8d5209236dc7b8747316b56998498b WHIRLPOOL 71a4136af89a9039e82c492f3e7af81d932fedec7c0c719ee3e68921a0e406fbad6a34b2bb49f0cca0134028e9799a59a9fa739991a5348e14c0b400e6f7d83d
+MISC ChangeLog 6750 SHA256 7c693ec390e212643e6cc8117effd450417f5dca794b20f020c09d9ca6c02bd2 SHA512 031b1102c2f3820ea470702fe41996027604c6ca68edce9ebf0235c515dd21160e714c03fec2531cc8366d99212b7cd00e381696df186e4e63f9885aa796f714 WHIRLPOOL 6f560bfc07f6c17fe3854530ce3336deb7711ff18e76cf7a6cd500a792b05f4dee5b58b3ed8e9de6df7043081927e6a83cb39a53914e92d49df22ec30f0eae64
+MISC ChangeLog-2015 13938 SHA256 d7938bb036a37dc37a0d2654be04c655b30cf54cb8c4f019e4f6549ffe3179da SHA512 e006775684003b4a7bd9e77f9fdf173bc1402e3cf05aad684b2e31c1942e8d2a268e7ffa19164a94e04e07f7977c1fdefbaaabf021f4ea4e6e8e8e463f69be3c WHIRLPOOL e87415fff3ee0136db7905a45881fdeed6a46b5dbbbf487fc62adba321a99f747f4eb5c549feb8093ffa22bc8369a60e5370638674a4db2c0aa2a4c020cf4230
+MISC metadata.xml 406 SHA256 0209a41b2fe792b837de815e5e6b2a34fd06890b015a0cb578961d4c63b50381 SHA512 742aba47cdd9ad8f97fcb03a01cc2552c6e1d715f6b717c9dff2ae86ab34b850745888e4f2e3963ec2c258cf16a33cb161205f4ea72563446eada82f6c298479 WHIRLPOOL e00029ce45c8ffa5247ab3a4bcd7afc3f36e4d4a61038ec2075bba0e984cbe6a68a2ffe79a7aee9b3954bbabce5c985376889ce9187613f32bf898bb3300a59b
diff --git a/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch b/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch
new file mode 100644
index 000000000000..7eeb9befb318
--- /dev/null
+++ b/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch
@@ -0,0 +1,35 @@
+there's no point in using -I/-L flags to the system paths and this breaks
+cross-compiling. just drop them.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -60,7 +60,7 @@
+ SWIG_CFLAGS += -Wno-error -Wno-unused-but-set-variable -Wno-unused-variable -Wno-shadow \
+ -Wno-unused-parameter
+
+-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE
++override CFLAGS += -I../include -D_GNU_SOURCE
+ RANLIB=ranlib
+
+ SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
+@@ -82,17 +82,17 @@
+ $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
+
+ $(SWIGSO): $(SWIGLOBJ)
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage
+
+ $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage
+
+ $(LIBA): $(OBJS)
+ $(AR) rcs $@ $^
+ $(RANLIB) $@
+
+ $(LIBSO): $(LOBJS)
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -lustr -L$(LIBDIR) -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -lustr -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
+ ln -sf $@ $(TARGET)
+
+ $(LIBPC): $(LIBPC).in ../VERSION
diff --git a/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-genhomedircon-only-set-MLS-level-if-MLS-.patch b/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-genhomedircon-only-set-MLS-level-if-MLS-.patch
new file mode 100644
index 000000000000..e3123ed70fe0
--- /dev/null
+++ b/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-genhomedircon-only-set-MLS-level-if-MLS-.patch
@@ -0,0 +1,38 @@
+From 4cf9b9ce2df06fd5a29e5264a6552c9b02ec0b5b Mon Sep 17 00:00:00 2001
+From: Stephen Smalley <sds@tycho.nsa.gov>
+Date: Fri, 14 Oct 2016 13:36:37 -0400
+Subject: [PATCH] libsemanage: genhomedircon: only set MLS level if MLS is
+ enabled
+
+When a non-MLS policy was used with genhomedircon context_from_record()
+in sepol would report an error because an MLS level was present when MLS
+is disabled. Based on a patch by Gary Tierney, amended to use
+sepol_policydb_mls_enabled rather than semanage_mls_enabled because
+we are testing the temporary working policy, not the active policy.
+
+Reported-by: Jason Zaman <jason@perfinion.com>
+Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
+---
+ libsemanage/src/genhomedircon.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c
+index 6991fff..5e9d722 100644
+--- libsemanage/src/genhomedircon.c
++++ libsemanage/src/genhomedircon.c
+@@ -638,7 +638,11 @@ static int write_contexts(genhomedircon_settings_t *s, FILE *out,
+ goto fail;
+ }
+
+- if (sepol_context_set_user(sepolh, context, user->sename) < 0 ||
++ if (sepol_context_set_user(sepolh, context, user->sename) < 0) {
++ goto fail;
++ }
++
++ if (sepol_policydb_mls_enabled(s->policydb) &&
+ sepol_context_set_mls(sepolh, context, user->level) < 0) {
+ goto fail;
+ }
+--
+2.7.3
+
diff --git a/sys-libs/libsemanage/files/libsemanage-2.6-build-paths.patch b/sys-libs/libsemanage/files/libsemanage-2.6-build-paths.patch
new file mode 100644
index 000000000000..86e5c7e9a6b7
--- /dev/null
+++ b/sys-libs/libsemanage/files/libsemanage-2.6-build-paths.patch
@@ -0,0 +1,35 @@
+there's no point in using -I/-L flags to the system paths and this breaks
+cross-compiling. just drop them.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -60,7 +60,7 @@
+ SWIG_CFLAGS += -Wno-error -Wno-unused-but-set-variable -Wno-unused-variable -Wno-shadow \
+ -Wno-unused-parameter
+
+-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE
++override CFLAGS += -I../include -D_GNU_SOURCE
+ RANLIB ?= ranlib
+
+ SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
+@@ -82,17 +82,17 @@
+ $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
+
+ $(SWIGSO): $(SWIGLOBJ)
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage
+
+ $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage -L$(LIBDIR)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage
+
+ $(LIBA): $(OBJS)
+ $(AR) rcs $@ $^
+ $(RANLIB) $@
+
+ $(LIBSO): $(LOBJS)
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -lustr -L$(LIBDIR) -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -lustr -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
+ ln -sf $@ $(TARGET)
+
+ $(LIBPC): $(LIBPC).in ../VERSION
diff --git a/sys-libs/libsemanage/libsemanage-2.6.ebuild b/sys-libs/libsemanage/libsemanage-2.6.ebuild
new file mode 100644
index 000000000000..e027c1f35ac8
--- /dev/null
+++ b/sys-libs/libsemanage/libsemanage-2.6.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit multilib python-r1 toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+MY_RELEASEDATE="20161014"
+
+SEPOL_VER="${PV}"
+SELNX_VER="${PV}"
+
+DESCRIPTION="SELinux kernel and policy management library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}[${MULTILIB_USEDEP}]
+ >=sys-libs/libselinux-${SELNX_VER}[${MULTILIB_USEDEP}]
+ >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}]
+ >=dev-libs/ustr-1.0.4-r2[${MULTILIB_USEDEP}]
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex
+ python? (
+ >=dev-lang/swig-2.0.4-r1
+ virtual/pkgconfig
+ )"
+
+# tests are not meant to be run outside of the
+# full SELinux userland repo
+RESTRICT="test"
+
+src_prepare() {
+ echo "# Set this to true to save the linked policy." >> "${S}/src/semanage.conf"
+ echo "# This is normally only useful for analysis" >> "${S}/src/semanage.conf"
+ echo "# or debugging of policy." >> "${S}/src/semanage.conf"
+ echo "save-linked=false" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Set this to 0 to disable assertion checking." >> "${S}/src/semanage.conf"
+ echo "# This should speed up building the kernel policy" >> "${S}/src/semanage.conf"
+ echo "# from policy modules, but may leave you open to" >> "${S}/src/semanage.conf"
+ echo "# dangerous rules which assertion checking" >> "${S}/src/semanage.conf"
+ echo "# would catch." >> "${S}/src/semanage.conf"
+ echo "expand-check=1" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Modules in the module store can be compressed" >> "${S}/src/semanage.conf"
+ echo "# with bzip2. Set this to the bzip2 blocksize" >> "${S}/src/semanage.conf"
+ echo "# 1-9 when compressing. The higher the number," >> "${S}/src/semanage.conf"
+ echo "# the more memory is traded off for disk space." >> "${S}/src/semanage.conf"
+ echo "# Set to 0 to disable bzip2 compression." >> "${S}/src/semanage.conf"
+ echo "bzip-blocksize=0" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Reduce memory usage for bzip2 compression and" >> "${S}/src/semanage.conf"
+ echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
+ echo "bzip-small=true" >> "${S}/src/semanage.conf"
+
+ eapply "${FILESDIR}"/${PN}-2.6-build-paths.patch
+ eapply "${FILESDIR}"/${PN}-2.6-0001-libsemanage-genhomedircon-only-set-MLS-level-if-MLS-.patch
+
+ eapply_user
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ all
+
+ if multilib_is_native_abi && use python; then
+ building_py() {
+ python_export PYTHON_INCLUDEDIR PYTHON_LIBPATH
+ emake CC="$(tc-getCC)" PYINC="-I${PYTHON_INCLUDEDIR}" PYTHONLBIDIR="${PYTHON_LIBPATH}" PYPREFIX="${EPYTHON##*/}" "$@"
+ }
+ python_foreach_impl building_py swigify
+ python_foreach_impl building_py pywrap
+ fi
+}
+
+multilib_src_install() {
+ emake \
+ LIBDIR="${ED}/usr/$(get_libdir)" \
+ SHLIBDIR="${ED}/usr/$(get_libdir)" \
+ DESTDIR="${ED}" install
+
+ if multilib_is_native_abi && use python; then
+ installation_py() {
+ emake DESTDIR="${ED}" LIBDIR="${ED}/usr/$(get_libdir)" \
+ SHLIBDIR="${ED}/usr/$(get_libdir)" install-pywrap
+ python_optimize # bug 531638
+ }
+ python_foreach_impl installation_py
+ fi
+}
+
+pkg_postinst() {
+ # Migrate the SELinux semanage configuration store if not done already
+ local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null)
+ if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then
+ ewarn "Since the 2.4 SELinux userspace, the policy module store is moved"
+ ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now."
+ ewarn "If there are any issues, it can be done manually by running:"
+ ewarn "/usr/libexec/selinux/semanage_migrate_store"
+ ewarn "For more information, please see"
+ ewarn "- https://github.com/SELinuxProject/selinux/wiki/Policy-Store-Migration"
+ fi
+
+ # Run the store migration without rebuilds
+ for POLICY_TYPE in ${POLICY_TYPES} ; do
+ if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
+ einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)."
+ /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}"
+ fi
+ done
+}
diff --git a/sys-libs/libsemanage/libsemanage-2.7.ebuild b/sys-libs/libsemanage/libsemanage-2.7.ebuild
new file mode 100644
index 000000000000..0d8a7240a2a7
--- /dev/null
+++ b/sys-libs/libsemanage/libsemanage-2.7.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit multilib python-r1 toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+MY_RELEASEDATE="20170804"
+
+SEPOL_VER="${PV}"
+SELNX_VER="${PV}"
+
+DESCRIPTION="SELinux kernel and policy management library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}[${MULTILIB_USEDEP}]
+ >=sys-libs/libselinux-${SELNX_VER}[${MULTILIB_USEDEP}]
+ >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}]
+ >=dev-libs/ustr-1.0.4-r2[${MULTILIB_USEDEP}]
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex
+ python? (
+ >=dev-lang/swig-2.0.4-r1
+ virtual/pkgconfig
+ )"
+
+# tests are not meant to be run outside of the
+# full SELinux userland repo
+RESTRICT="test"
+
+src_prepare() {
+ echo "# Set this to true to save the linked policy." >> "${S}/src/semanage.conf"
+ echo "# This is normally only useful for analysis" >> "${S}/src/semanage.conf"
+ echo "# or debugging of policy." >> "${S}/src/semanage.conf"
+ echo "save-linked=false" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Set this to 0 to disable assertion checking." >> "${S}/src/semanage.conf"
+ echo "# This should speed up building the kernel policy" >> "${S}/src/semanage.conf"
+ echo "# from policy modules, but may leave you open to" >> "${S}/src/semanage.conf"
+ echo "# dangerous rules which assertion checking" >> "${S}/src/semanage.conf"
+ echo "# would catch." >> "${S}/src/semanage.conf"
+ echo "expand-check=1" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Modules in the module store can be compressed" >> "${S}/src/semanage.conf"
+ echo "# with bzip2. Set this to the bzip2 blocksize" >> "${S}/src/semanage.conf"
+ echo "# 1-9 when compressing. The higher the number," >> "${S}/src/semanage.conf"
+ echo "# the more memory is traded off for disk space." >> "${S}/src/semanage.conf"
+ echo "# Set to 0 to disable bzip2 compression." >> "${S}/src/semanage.conf"
+ echo "bzip-blocksize=0" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Reduce memory usage for bzip2 compression and" >> "${S}/src/semanage.conf"
+ echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
+ echo "bzip-small=true" >> "${S}/src/semanage.conf"
+
+ eapply_user
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ all
+
+ if multilib_is_native_abi && use python; then
+ building_py() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ "$@"
+ }
+ python_foreach_impl building_py swigify
+ python_foreach_impl building_py pywrap
+ fi
+}
+
+multilib_src_install() {
+ emake \
+ LIBDIR="${ED}/usr/$(get_libdir)" \
+ SHLIBDIR="${ED}/usr/$(get_libdir)" \
+ DESTDIR="${ED}" install
+
+ if multilib_is_native_abi && use python; then
+ installation_py() {
+ emake DESTDIR="${ED}" \
+ LIBDIR="${ED}/usr/$(get_libdir)" \
+ SHLIBDIR="${ED}/usr/$(get_libdir)" \
+ LIBSEPOLA="${EPREFIX%/}/usr/$(get_libdir)/libsepol.a" \
+ install-pywrap
+ python_optimize # bug 531638
+ }
+ python_foreach_impl installation_py
+ fi
+}
+
+pkg_postinst() {
+ # Migrate the SELinux semanage configuration store if not done already
+ local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null)
+ if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then
+ ewarn "Since the 2.4 SELinux userspace, the policy module store is moved"
+ ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now."
+ ewarn "If there are any issues, it can be done manually by running:"
+ ewarn "/usr/libexec/selinux/semanage_migrate_store"
+ ewarn "For more information, please see"
+ ewarn "- https://github.com/SELinuxProject/selinux/wiki/Policy-Store-Migration"
+ fi
+
+ # Run the store migration without rebuilds
+ for POLICY_TYPE in ${POLICY_TYPES} ; do
+ if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
+ einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)."
+ /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}"
+ fi
+ done
+}
diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild
new file mode 100644
index 000000000000..5015c4e9fc9e
--- /dev/null
+++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit multilib python-r1 toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+MY_RELEASEDATE="20170804"
+
+SEPOL_VER="${PV}"
+SELNX_VER="${PV}"
+
+DESCRIPTION="SELinux kernel and policy management library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}[${MULTILIB_USEDEP}]
+ >=sys-libs/libselinux-${SELNX_VER}[${MULTILIB_USEDEP}]
+ >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}]
+ >=dev-libs/ustr-1.0.4-r2[${MULTILIB_USEDEP}]
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex
+ python? (
+ >=dev-lang/swig-2.0.4-r1
+ virtual/pkgconfig
+ )"
+
+# tests are not meant to be run outside of the
+# full SELinux userland repo
+RESTRICT="test"
+
+src_prepare() {
+ echo "# Set this to true to save the linked policy." >> "${S}/src/semanage.conf"
+ echo "# This is normally only useful for analysis" >> "${S}/src/semanage.conf"
+ echo "# or debugging of policy." >> "${S}/src/semanage.conf"
+ echo "save-linked=false" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Set this to 0 to disable assertion checking." >> "${S}/src/semanage.conf"
+ echo "# This should speed up building the kernel policy" >> "${S}/src/semanage.conf"
+ echo "# from policy modules, but may leave you open to" >> "${S}/src/semanage.conf"
+ echo "# dangerous rules which assertion checking" >> "${S}/src/semanage.conf"
+ echo "# would catch." >> "${S}/src/semanage.conf"
+ echo "expand-check=1" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Modules in the module store can be compressed" >> "${S}/src/semanage.conf"
+ echo "# with bzip2. Set this to the bzip2 blocksize" >> "${S}/src/semanage.conf"
+ echo "# 1-9 when compressing. The higher the number," >> "${S}/src/semanage.conf"
+ echo "# the more memory is traded off for disk space." >> "${S}/src/semanage.conf"
+ echo "# Set to 0 to disable bzip2 compression." >> "${S}/src/semanage.conf"
+ echo "bzip-blocksize=0" >> "${S}/src/semanage.conf"
+ echo >> "${S}/src/semanage.conf"
+ echo "# Reduce memory usage for bzip2 compression and" >> "${S}/src/semanage.conf"
+ echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
+ echo "bzip-small=true" >> "${S}/src/semanage.conf"
+
+ eapply_user
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ all
+
+ if multilib_is_native_abi && use python; then
+ building_py() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ "$@"
+ }
+ python_foreach_impl building_py swigify
+ python_foreach_impl building_py pywrap
+ fi
+}
+
+multilib_src_install() {
+ emake \
+ LIBDIR="${ED}/usr/$(get_libdir)" \
+ SHLIBDIR="${ED}/usr/$(get_libdir)" \
+ DESTDIR="${ED}" install
+
+ if multilib_is_native_abi && use python; then
+ installation_py() {
+ emake DESTDIR="${ED}" \
+ LIBDIR="${ED}/usr/$(get_libdir)" \
+ SHLIBDIR="${ED}/usr/$(get_libdir)" \
+ LIBSEPOLA="${EPREFIX%/}/usr/$(get_libdir)/libsepol.a" \
+ install-pywrap
+ python_optimize # bug 531638
+ }
+ python_foreach_impl installation_py
+ fi
+}
+
+pkg_postinst() {
+ # Migrate the SELinux semanage configuration store if not done already
+ local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null)
+ if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${mcs}/active ] ; then
+ ewarn "Since the 2.4 SELinux userspace, the policy module store is moved"
+ ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now."
+ ewarn "If there are any issues, it can be done manually by running:"
+ ewarn "/usr/libexec/selinux/semanage_migrate_store"
+ ewarn "For more information, please see"
+ ewarn "- https://github.com/SELinuxProject/selinux/wiki/Policy-Store-Migration"
+ fi
+
+ # Run the store migration without rebuilds
+ for POLICY_TYPE in ${POLICY_TYPES} ; do
+ if [ ! -d "${EROOT}/var/lib/selinux/${POLICY_TYPE}/active" ] ; then
+ einfo "Migrating store ${POLICY_TYPE} (without policy rebuild)."
+ /usr/libexec/selinux/semanage_migrate_store -n -s "${POLICY_TYPE}" || die "Failed to migrate store ${POLICY_TYPE}"
+ fi
+ done
+}
diff --git a/sys-libs/libsemanage/metadata.xml b/sys-libs/libsemanage/metadata.xml
new file mode 100644
index 000000000000..d4dc9ab41f9f
--- /dev/null
+++ b/sys-libs/libsemanage/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 type="project">
+ <email>selinux@gentoo.org</email>
+ <name>SELinux Team</name>
+ </maintainer>
+ <longdescription>SELinux policy management libraries</longdescription>
+ <upstream>
+ <remote-id type="github">SELinuxProject/selinux</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libsepol/Manifest b/sys-libs/libsepol/Manifest
new file mode 100644
index 000000000000..d964025439c5
--- /dev/null
+++ b/sys-libs/libsepol/Manifest
@@ -0,0 +1,8 @@
+DIST libsepol-2.6.tar.gz 442549 SHA256 d856d6506054f52abeaa3543ea2f2344595a3dc05d0d873ed7f724f7a16b1874 SHA512 17d007857634e3d581fcc9bafcbb75674a06e382bb258c2c6b3656c141d71493699c42b78c8e1917c628476aeb8ead73bb86e8ccf43d7ce59aa0b7884bea132a WHIRLPOOL c02b9dc9dcf13ce3f200293695565dec4a220f7a6b29c76121ba5a4f8c05fb347a034763f417927ed7b1952a4989a7738c9327dc47cd976410db695fd6e662ae
+DIST libsepol-2.7.tar.gz 471147 SHA256 d69d3bd8ec901a3bd5adf2be2fb47fb1a685ed73066ab482e7e505371a48f9e7 SHA512 1d308c17bfea2659f9dc4877ab685449a5a33dff7260e62b603cde9551bed2010360b71a896c6dfcdb8b9fe86ecebc9f6b3225e6c3573a80fca8578a9d561b47 WHIRLPOOL d89ac1e892a3b1a05221bcdaecab2e9bdb1dbe035133da052b04868152891ee994d266a64508ae4077a3859863a10efc49088f6ae12a5cf5beef571c1c932c80
+EBUILD libsepol-2.6.ebuild 1160 SHA256 9cd02e55eb411cc8958535b3d469b7e4dd82e722136ac999ba35d6ed33bd6bb7 SHA512 cdcdd05098775b6ad5ecd293261f6a3e8af7f7178f1a6fa4650844cd3d136c73a0332e73deff98b5f4e1605a3cdc94aab3b283ea867996b38de5178cb5b037dd WHIRLPOOL 12f549fdaaec47b451609a1a2dbd3380bb900cf51c9f86e2a4e5e42910d2ffaa92955cc28cd61577e0719f7b1ca4f2b34b62bbe29bc211bdecae0d3b54846028
+EBUILD libsepol-2.7.ebuild 1160 SHA256 3070b8cd436384041ffe740bf830cd9b825229b3babb465e34305fd450e7e9c9 SHA512 5783c3475e553ca8da4885c5122ecc10ed8f7a87857e37840a8e2a9198504ad3d2ffb968ce1df8745db229f001ab4b6adef3bba1d88020b325eedf9f06cf1b36 WHIRLPOOL fe8a692498d5b2203403b10acfd06a8c5e48908d18b36a1894347db546e8b820567cedbca6ee687985e65e970f1bae64d33bcda5dc694dc3798d25334379b4d0
+EBUILD libsepol-9999.ebuild 1162 SHA256 f4272520bd79c34b5e780d6877ea5457a1009040530632193d27e57436480f00 SHA512 83c0abc60fb1f72880cb1be790b466a7b62a07c73874ca073f379b2e7e445ae1cb78dcfff1c5bd2cce83fb41010ea6bd45f5f504a5f94fad4edba89df8999d15 WHIRLPOOL 1076a36c0adced0fc5405d1614d1a90d8a946a980e04898f71be925ec57db834681ff8edb9963fd4e10dc956618260e3c707fef22607e1dd8feddf0592edcc0b
+MISC ChangeLog 3948 SHA256 968e00ac890425e7308776daec076202980b8ea7d1f890f91e01fa7ca37b697c SHA512 db3651de9189e1329dccf064d40292c33155d208b18874e5d62c2cae92074592873a405207f05080f331bbff4912bd8f6f37ff542f522307b25fc89a24706436 WHIRLPOOL f94c44a0263efba218a9efb656ac4f5d2e165cba01798e6ed77eeab086f0bcc3a708ee975ce5934b53b4ff622e78b16809cfa30da64e1de8f9c078b792a62df2
+MISC ChangeLog-2015 10342 SHA256 a41401fcb4dfd0082c5d55d20e95da9b3eff6a309f6e2ef97b9034f53cd96184 SHA512 be504b6afa14d27e557d678a504466eab37fd519ca7fb1f083f2a8a247d9a5ba832c820d6a5096a5ca0a0f13b54d5b1c527def12e134137535440493122d3184 WHIRLPOOL 2973b3b8e6449ad1ec6f6a250a9a148800a5d6d533abfbe58795e74aff9e82610bb032c5031ea7465c2058e0b3cac7585dea9da3c58421194793847a3fbbe238
+MISC metadata.xml 428 SHA256 786c53bd0eee5b2d84990b9fc63ef2ef1ca8d0455f48f912a4b3e76c84b6c99f SHA512 14093ec1e86ac7b7521ab02ace725347013e11628e22cf3ed5362cfe7f30a180374ab00747b58ae251afbb3fabbeb4e328bda798e512bfac9bad643206835192 WHIRLPOOL ccaea270553624ba0a42e06d15d001b78c384df8708dadbc26f064d049feb9808993d1353ecf3a8a69200d490de54e34d8a0db9d0b397ea02207c1f4e9d24aa1
diff --git a/sys-libs/libsepol/libsepol-2.6.ebuild b/sys-libs/libsepol/libsepol-2.6.ebuild
new file mode 100644
index 000000000000..d53577659dc1
--- /dev/null
+++ b/sys-libs/libsepol/libsepol-2.6.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit multilib toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+MY_RELEASEDATE="20161014"
+
+DESCRIPTION="SELinux binary policy representation library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+# tests are not meant to be run outside of the full SELinux userland repo
+RESTRICT="test"
+
+src_prepare() {
+ eapply_user
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export RANLIB;
+ LIBDIR="\$(PREFIX)/$(get_libdir)" SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ emake AR="$(tc-getAR)" CC="$(tc-getCC)"
+}
+
+multilib_src_install() {
+ LIBDIR="\$(PREFIX)/$(get_libdir)" SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ emake DESTDIR="${D}" install
+}
diff --git a/sys-libs/libsepol/libsepol-2.7.ebuild b/sys-libs/libsepol/libsepol-2.7.ebuild
new file mode 100644
index 000000000000..9b566349dc01
--- /dev/null
+++ b/sys-libs/libsepol/libsepol-2.7.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit multilib toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+MY_RELEASEDATE="20170804"
+
+DESCRIPTION="SELinux binary policy representation library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~mips x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+# tests are not meant to be run outside of the full SELinux userland repo
+RESTRICT="test"
+
+src_prepare() {
+ eapply_user
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export RANLIB;
+ LIBDIR="\$(PREFIX)/$(get_libdir)" SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ emake AR="$(tc-getAR)" CC="$(tc-getCC)"
+}
+
+multilib_src_install() {
+ LIBDIR="\$(PREFIX)/$(get_libdir)" SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ emake DESTDIR="${D}" install
+}
diff --git a/sys-libs/libsepol/libsepol-9999.ebuild b/sys-libs/libsepol/libsepol-9999.ebuild
new file mode 100644
index 000000000000..e68451424fce
--- /dev/null
+++ b/sys-libs/libsepol/libsepol-9999.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit multilib toolchain-funcs multilib-minimal
+
+MY_P="${P//_/-}"
+MY_RELEASEDATE="20170804"
+
+DESCRIPTION="SELinux binary policy representation library"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+# tests are not meant to be run outside of the full SELinux userland repo
+RESTRICT="test"
+
+src_prepare() {
+ eapply_user
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export RANLIB;
+ LIBDIR="\$(PREFIX)/$(get_libdir)" SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ emake AR="$(tc-getAR)" CC="$(tc-getCC)"
+}
+
+multilib_src_install() {
+ LIBDIR="\$(PREFIX)/$(get_libdir)" SHLIBDIR="\$(DESTDIR)/$(get_libdir)" \
+ emake DESTDIR="${D}" install
+}
diff --git a/sys-libs/libsepol/metadata.xml b/sys-libs/libsepol/metadata.xml
new file mode 100644
index 000000000000..ef117d5eac5e
--- /dev/null
+++ b/sys-libs/libsepol/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 type="project">
+ <email>selinux@gentoo.org</email>
+ <name>SELinux Team</name>
+ </maintainer>
+ <longdescription>SELinux library for manipulating binary security policies</longdescription>
+ <upstream>
+ <remote-id type="github">SELinuxProject/selinux</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libservicelog/Manifest b/sys-libs/libservicelog/Manifest
new file mode 100644
index 000000000000..c05212b98ece
--- /dev/null
+++ b/sys-libs/libservicelog/Manifest
@@ -0,0 +1,13 @@
+AUX libservicelog-1.0.1.patch 479 SHA256 94b390327234efd1a322c97ac232c08eb8b4b6117606d51cdedcbee9e0791258 SHA512 9c19ae05608a2fb2116a569ef50cb0b4831c3f3c346068ca7f1d9fb572b2fcc4af3a57e91c5848ae8a1a60e73d6c31c5963daddcfe3115338377a4fcdd36a0ae WHIRLPOOL 10fef692c4c1bd1c42699815a8500c4adb387f30fe417bda5c0453d4ade3da5654f95fb3ab8ec8b391cb039d735fdce3d9c8ec019a7543f637e2d38dabc1e7a1
+AUX libservicelog-1.1.11.patch 286 SHA256 6f599bb4603baf9e586d923717af22eb7f55aae7091e8efed5242be084aa3664 SHA512 0d0786e33db00a7b3009609f63a00f8409f89f25827ae7dcda74e2520dd96b9945ee2873d933ec74bcd5a4c7b6641bc3dfada192f092ca6a399046a8177ddf85 WHIRLPOOL 509e45c0b424b28349f002df87b4de9e18abbfe8f9b5ceeeaed5bb935ce27372223baf80766e56ac5420103dd3b1e89a48930cb9d76668cb917abdd92273a005
+DIST libservicelog-1.0.1.tar.gz 673264 SHA256 562d0160da772732002fb749e7f704b5e20ab57a8b73908638afd1a75d8cf944 SHA512 a4b2eaad7d382440767f33aded804732acc2828466e83a4596cc66a98ccfd53d048e9af5984b71a45b937bebf3526062d96f5c10be27d44dbbc808b980c1d7db WHIRLPOOL 4c1eb2925db24d022555a5fb9e8a254debc4de4d06a8ab75c293e72ac4b0065ca7d0400649e4daf0c5b663def4e2df5618892daf781b677e1f9cf1a5cfc7d546
+DIST libservicelog-1.1.11.tar.gz 905377 SHA256 c371be75e5941b58b8409b9e403bec30bc65a86ffd420e43be755d5d7852b587 SHA512 7706e108573d79e7973bb6004fb987833b04a2896c088fc259a84f17192a6e5fc0e760f59031f1b0b28306a9043534a9fa5690dde099060f9546e046fa8d0f5b WHIRLPOOL 1ba6c249141fff06d2cf62cb7778db51be7902158e402d333bdafaebba94d4552e953d16a0a72e9cbdef70f7e334c817cfde8d872575ecaf98e4423c0cb8fef9
+DIST libservicelog-1.1.15.tar.gz 392259 SHA256 981c85cef132153fde7da0635fd65f487d1f90adf0e929cef54b5ecc9d43230d SHA512 70cdf8340a8b0df39bc5669976feab022917b5884256370281ed3356633100cc9c7e69c6cc1bd0784bfedc65d388d9ecc50f6dd37e6ed19f796bb7f55bb436f7 WHIRLPOOL 4b76babbd98e125c89f757223b70ee83cbc448304caaff6e8f9382466ef3d8c49e378199079fb3427c980314c6a7f8d61033fcd1fecb8befdbff47732e480fa6
+DIST libservicelog-1.1.16.tar.gz 396055 SHA256 5933496afca2c63a7e2f771f1f1b3684d92075cdb108acb9bb7e45ba882ee790 SHA512 7008a26c8b143b2e498b05cfb5da0c7b76b0ee56106e1d261e202b8ebc0c93abce719230b037fd6bcade078daa5c464428ea2adb466269f30951e909211ae307 WHIRLPOOL 2242edb740c1aeb9346b275fafebf1f5f4a80196b8737c20807ecf92c85c09c81d419705ec77918a145e45ac6fec72069085fc7920ac401d70489fa81369c453
+EBUILD libservicelog-1.0.1.ebuild 613 SHA256 c7abb33a1963cce4d5a7710c3cc3726049b5377cd1b49d42458b9930688ab674 SHA512 5ff8ff8450f0031611e884880f09115f701a5ec8c202f5a0b056b50640a8aa7b3f3583e809bd1eb6879e4395c4cba8cd94726efcc492f96a82c16b67249082b5 WHIRLPOOL 97b9b2629883665cdb02278d9ab9a5cd8f05ade9e543edefe1489cb7472aab026c3b0da0b69fa219ccabd23b2a89d183972d6a4127bf85f5f202a09d8e6970e4
+EBUILD libservicelog-1.1.11.ebuild 600 SHA256 52c385140e754008e822576bc553a2cae2338b9da2dd87395c475383d321f360 SHA512 b64db3bb2a2c813237deec07b7db68c71dd6da6ee081cd2da217642c06389fa6ab69bf89f8a5d11d377fd80425c761108f6c20d141bd69d56b777ab6ac6c5d0a WHIRLPOOL cc132c2d183fed91d567bc3b5938fd57d6ace7adbd59fef7ee4273abff7caa4ccee615b0963d7241a7ee93495dce295085ead6b65001f6cf880592b1a5d767ce
+EBUILD libservicelog-1.1.15.ebuild 592 SHA256 0f0fc80c1ed3f1a68d3680b11fa6c8fd3edb75d611100b179cc505a2e111ac85 SHA512 f55d9b77c760b770522a123b12ff0288eb0d4a9fa41366ebc56dd30325d4199f2cc033fa953217d2a7662e9857abd1c24dbdfa7ab5859c013365f0c7b6bbe8f1 WHIRLPOOL eac21a44ea18ae220e344f552eb8d77b5f4d6d9fa261fa29cf0e9ad872d76fdc79f6e9f019e0243acd76419695d11b61ed7ad421ba9d34fa4e8b7287a00faa28
+EBUILD libservicelog-1.1.16.ebuild 592 SHA256 0f0fc80c1ed3f1a68d3680b11fa6c8fd3edb75d611100b179cc505a2e111ac85 SHA512 f55d9b77c760b770522a123b12ff0288eb0d4a9fa41366ebc56dd30325d4199f2cc033fa953217d2a7662e9857abd1c24dbdfa7ab5859c013365f0c7b6bbe8f1 WHIRLPOOL eac21a44ea18ae220e344f552eb8d77b5f4d6d9fa261fa29cf0e9ad872d76fdc79f6e9f019e0243acd76419695d11b61ed7ad421ba9d34fa4e8b7287a00faa28
+MISC ChangeLog 2816 SHA256 80f33805ff28d7e7615c0ea0500e9d8086bb9b73914b7eb7eaa47a428aaf764b SHA512 a6d074c0ca31efcd5a530f25e6dd54a1cb4514629f449dbe0f05ac5e32dd873a5d86b23759d6e0b97a0aef44640b2d99f6975eca8c9ef9f88d33bc933f9ce8bd WHIRLPOOL dcdd381b8b2e5b7ab998d3f77f5eff49a4c7ecb118298d4c5cb7d6d98a7a8e06cd42efb921fa1dbed4bd9c2ae12619507d6980fd040d6f9828b44e3929dc5fdd
+MISC ChangeLog-2015 1440 SHA256 1170b68470248c0a3c9f705cd63a2de8f9c3943ece2d941b1260dfd09a53e75f SHA512 842fdd0a08fa2e6d6d57e9c13b5d276d6a8dadcf9a652bf31ce740fd04416e9559c83f31ec7807b75247613bfd8ecb10893580b2ad5674547125da913442f774 WHIRLPOOL 781b6a5b68a1c4e28e585eade48b83b5e9e9aafd841ac297e278037d08c38c3bac166dfd656d14aee2a069021e43715500ab9112970397bfc6c8cf60a9f060fb
+MISC metadata.xml 343 SHA256 cb43aa113871ee8701e807f65f0bc9f0aa239bee5f1c5d93b11894ecd2477917 SHA512 42f1b8b76a107cfa61ae9db8b900aed22a3bc8e8d3573dbb3c507ebde688ef2c50f7f79847eb345e738365fbb99ba22d99aee56e302c6eed064379ddc1e3a710 WHIRLPOOL 04ce53dd94bcc65b2c05bbb4b8fdedaf856bafe33ea4e045b904cd531f1598a839aaaf280c9bd1714d8b6a4bc91ff7945806cd46c40d28fe585651a87d5b0c2d
diff --git a/sys-libs/libservicelog/files/libservicelog-1.0.1.patch b/sys-libs/libservicelog/files/libservicelog-1.0.1.patch
new file mode 100644
index 000000000000..712421271ed0
--- /dev/null
+++ b/sys-libs/libservicelog/files/libservicelog-1.0.1.patch
@@ -0,0 +1,10 @@
+diff -Naur libservicelog-1.0.1.orig/Makefile.am libservicelog-1.0.1/Makefile.am
+--- libservicelog-1.0.1.orig/Makefile.am 2008-08-16 19:01:37.000000000 -0500
++++ libservicelog-1.0.1/Makefile.am 2008-10-20 19:11:17.000000000 -0500
+@@ -19,5 +19,5 @@
+ library_include_HEADERS = servicelog-1/servicelog.h
+
+ install-exec-hook:
+- install -D --mode=754 --group=service servicelog.db \
++ install -D --mode=754 --group=wheel servicelog.db \
+ ${DESTDIR}/var/lib/servicelog/servicelog.db
diff --git a/sys-libs/libservicelog/files/libservicelog-1.1.11.patch b/sys-libs/libservicelog/files/libservicelog-1.1.11.patch
new file mode 100644
index 000000000000..092ac15482ab
--- /dev/null
+++ b/sys-libs/libservicelog/files/libservicelog-1.1.11.patch
@@ -0,0 +1,9 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -19,5 +19,5 @@
+ library_include_HEADERS = servicelog-1/servicelog.h
+
+ install-exec-hook:
+- install -D --mode=754 --group=service servicelog.db \
++ install -D --mode=754 --group=wheel servicelog.db \
+ ${DESTDIR}/var/lib/servicelog/servicelog.db
diff --git a/sys-libs/libservicelog/libservicelog-1.0.1.ebuild b/sys-libs/libservicelog/libservicelog-1.0.1.ebuild
new file mode 100644
index 000000000000..7bbb044fecd3
--- /dev/null
+++ b/sys-libs/libservicelog/libservicelog-1.0.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils autotools
+
+DESCRIPTION="Provides a library for logging service-related events"
+SRC_URI="mirror://sourceforge/linux-diag/${P}.tar.gz"
+HOMEPAGE="http://linux-diag.sourceforge.net/servicelog/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="ppc ppc64"
+IUSE=""
+
+DEPEND="dev-db/sqlite"
+
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/libservicelog-1.0.1.patch
+
+ eautoreconf
+}
+
+src_install () {
+ emake install DESTDIR="${D}" || die
+ dodoc ChangeLog || die
+}
diff --git a/sys-libs/libservicelog/libservicelog-1.1.11.ebuild b/sys-libs/libservicelog/libservicelog-1.1.11.ebuild
new file mode 100644
index 000000000000..ed6ce4fef201
--- /dev/null
+++ b/sys-libs/libservicelog/libservicelog-1.1.11.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils autotools
+
+DESCRIPTION="Provides a library for logging service-related events"
+SRC_URI="mirror://sourceforge/linux-diag/${P}.tar.gz"
+HOMEPAGE="http://linux-diag.sourceforge.net/servicelog/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+IUSE=""
+
+DEPEND="dev-db/sqlite"
+
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${P}.patch
+
+ eautoreconf
+}
+
+src_install () {
+ emake install DESTDIR="${D}" || die
+ dodoc ChangeLog || die
+}
diff --git a/sys-libs/libservicelog/libservicelog-1.1.15.ebuild b/sys-libs/libservicelog/libservicelog-1.1.15.ebuild
new file mode 100644
index 000000000000..a0b3fce98f48
--- /dev/null
+++ b/sys-libs/libservicelog/libservicelog-1.1.15.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="Provides a library for logging service-related events"
+SRC_URI="mirror://sourceforge/linux-diag/${P}.tar.gz"
+HOMEPAGE="http://linux-diag.sourceforge.net/servicelog/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+IUSE="static-libs"
+
+DEPEND="
+ dev-db/sqlite:=
+ sys-libs/librtas
+"
+RDEPEND="
+ ${DEPEND}
+ virtual/logger
+"
+
+DOCS=( ChangeLog )
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+}
diff --git a/sys-libs/libservicelog/libservicelog-1.1.16.ebuild b/sys-libs/libservicelog/libservicelog-1.1.16.ebuild
new file mode 100644
index 000000000000..a0b3fce98f48
--- /dev/null
+++ b/sys-libs/libservicelog/libservicelog-1.1.16.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="Provides a library for logging service-related events"
+SRC_URI="mirror://sourceforge/linux-diag/${P}.tar.gz"
+HOMEPAGE="http://linux-diag.sourceforge.net/servicelog/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+IUSE="static-libs"
+
+DEPEND="
+ dev-db/sqlite:=
+ sys-libs/librtas
+"
+RDEPEND="
+ ${DEPEND}
+ virtual/logger
+"
+
+DOCS=( ChangeLog )
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+}
diff --git a/sys-libs/libservicelog/metadata.xml b/sys-libs/libservicelog/metadata.xml
new file mode 100644
index 000000000000..2b8aee36a4fc
--- /dev/null
+++ b/sys-libs/libservicelog/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 type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">linux-diag</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libsmbios/Manifest b/sys-libs/libsmbios/Manifest
new file mode 100644
index 000000000000..7f1ab55d5cc9
--- /dev/null
+++ b/sys-libs/libsmbios/Manifest
@@ -0,0 +1,13 @@
+AUX libsmbios-2.2.28-cppunit-tests.patch 350 SHA256 cd9ad94636ae8af4ad5606e012f2da5571210d7369c3bd8a003bb044516b4834 SHA512 51cfb62fce69afaf73659a2c4c819aa3554831b48d69bc35c1b299cd2e0b4d3be7f156a2cb57912cf10f21182e49fd5ce17aad0205a25d151f55ab3e0e58ddd7 WHIRLPOOL 5b3a49ba5da5fc1f0d47af78d99525c02c5fec83194c9315be206379e9e81967f5e7799cb215a683718a4a8859f91208557cd201e3b4dac5963518ac36d0115f
+AUX libsmbios-2.3.0-doxygen_target.patch 305 SHA256 c2c7ddceef497a88fb5e17970ce3310f337fde5349ad812243cd27c91a7fa042 SHA512 f1f85f052265d88f4735a18ce0205a56256dba5416e6153291d27a4f958bbe9618401b1b70a5e462d12287490a42fe5a6e5e196091b9ec2afa01728a7910815d WHIRLPOOL f0e3770f0143d7bacbfa448d33ca50ffdd500c939960ec24211e4b76df7ac04a817c5616412b8522fb182c2451aed9e5eb69aab17211da848f523298e7db0438
+AUX libsmbios-2.3.3-doxygen_target.patch 351 SHA256 6e4a79056d177b9d5b9c7bc77d2d776117c749fc9b66292efa0f2b87cc50e0eb SHA512 d86df4b1c3ab389360d07f4fab84219bb03e270e77984996d7c53d55b4a0e5a29e2d097e79da5a49f7be0ff9118722aaa955acdbffd4d59cbefa7a1a0ad6f1c3 WHIRLPOOL b423b37de8721d33473aa823a738f1eddc6d54ec88232816c165a8d1566d1d3bc6cd184dc1ed366889bc2610658e0e5ece8108be4bb3aa16de63255f0e98eaf4
+AUX libsmbios-fix-pie.patch 816 SHA256 de81310aa499ad6bacc4b095cb3e90d45c35f035bbdeb18850a9921c71bc4328 SHA512 2567fe1dfe2e858103c3732e7059888731c207234022a24c1cd4b158253330699af6b2e90cf98881e57e0b7cb8c70a8627fe1d7eb370f2cbb3969189538baf7e WHIRLPOOL b16a585cf2d5652ce8efce8a293485317957c55ac97f2427cac1f34d2e8c2c7cf005dd55ad2bac64c383a507ee3c69b0d40c96e42fcf1067f2be98253889b1ff
+DIST libsmbios-2.3.0.tar.xz 830840 SHA256 c71f040df170f6b55a874f292929792449ba1fad6029ba18544ed04a88343c1c SHA512 944df2dde0df8a02d4c5a84ff6e535e112e6d72b81177c8faba7c45b349ec8c8b2149439c4dc6ea834c5eedad1ac59d8bf073a3d48bf7caccc73d0317f00e216 WHIRLPOOL ac2acbb780f45ebcc9c616881432c981fc9907682b3b4d1e7164921cfa6beeef1a25bdde949375455843209556938ce45a92df8b2a190ab689f1673e72561ac9
+DIST libsmbios-2.3.2.tar.gz 800862 SHA256 527874a2abad8f8a9320eeb6b5dd11b6d5b8fff6cdc90bb0f757c39da519714f SHA512 6ef3d71892e157d81fc466689b67c19b83567ee1c4893816da935cfc42738cf958f972eed811aad375fee5bb7d4a6b4e13fb1b5760cd0d7cdb5e65170ebeb129 WHIRLPOOL 499c27d690b2f7b26272423ac9835c7726ef6667e34ed9212cb41d1ff207fddd75749228995de746b2daf5c24b9c4bb7d6d6e72b009c56f4fd53caa455ecf755
+DIST libsmbios-2.3.3.tar.gz 801164 SHA256 272ba8c9fa4a468938b8fa81b23a09c72acc97371f3be7c882bb222c1ae7157d SHA512 d4ee556fc0b734827e1a0def9c9914e79130ce9f164f62a5aa752276772f9ed27874fd8a285b65e016f16f001cdfa23c7c9d228533bb8a03134db90b9cc4f96d WHIRLPOOL 78f3d136ee56ec3c6a6708d03df2eef8ea43fba11639448a26300dcaf7ae340f21c7656b58e7a00ba035f2b4227d43eea3007a9f2289ed8e923b068fe66a90ad
+EBUILD libsmbios-2.3.0-r1.ebuild 1825 SHA256 2c6290b0e7c0d1359b3801a0491e311a17f827f1237073c61027b0439d2a54ab SHA512 62b0a7bca4d2c04f529f379eaaf3e8b68bf8932f8bd9700be223a25a98040d26ce1a075dcbeef254cf5da784fc088abe32af8f75ca0e15527da4d2f9b10bee41 WHIRLPOOL c0497ab579eeae8b0673817487db0d868cbc540c4f6df0cca4ef2398d91c2a189661da6e66afca3aafa9a97199bdec6426319ea11b74f36bf07fe187311f5594
+EBUILD libsmbios-2.3.2.ebuild 1894 SHA256 30da0307a0640515b6ea515f7771b646f67a11fe34473abf4968258b673508db SHA512 2b3faf9733451392aaacb4e6859b64673b41d1aa19e5a4cad815a67dfce39bac07aa3c4f7ab20104024312d830320ba1dda9d372475be7c2055b0042554a85a8 WHIRLPOOL 9f81c802d823309152c2ba9a935b7ecb152eeb9edf14a2a71cef740aa052cc0ad940b3ed4440ab6114784eea918dbee843cadb1fd3ab18b0c4eeb65d7f990820
+EBUILD libsmbios-2.3.3.ebuild 1788 SHA256 cd2fc184c042b89edfe9478bd0d75d0cb74cb2b71dd8c4017552b6d75c1c72f3 SHA512 be969d82ec9f0d5f18b0b9c397bde36ee5eea184c1a41320cce25427f2d6eafa2d9565ad14c029222b978e20038d17071e345065cb6c2c9cf3e72f3639f4b354 WHIRLPOOL 4f1ba3c975c9ee4d9c6b455dc45f3d00998cbc63134f15bf1309aa6085b6ad61a679676702a3d849960f4fbe90e91df55947b940c0eeb538ef21474aac6f0ff7
+MISC ChangeLog 3510 SHA256 5773d6042b8e2fc451ad683e3281cb2fe24b59e35f7575de1dbd0f07b6bec7a9 SHA512 fc7590fa88188d6c2a8492dd56c07cc7a881c631e85a1bf1011f69d0990cf26e631c26e7630afd3f3d32f3d2a1272ba5ea28a326790619e7c0c3d3a0e529552f WHIRLPOOL c91f17364fb64a7f769065d31c26fc3d833dd04241161455f204829f207f368b49b275813c4694e88a55fa11ef5aa70c50323ac0dab0a8b0a93c4eb7c296efc1
+MISC ChangeLog-2015 6812 SHA256 d3122f7dc6cc89ac87433101dbb440766dd858ee086f30615cd602a8b7f5c93f SHA512 10c10ea7d73cf6dc23b61abaae766c18435cef681a17154ec68ea4507513ca69544618c76c54d9a56b1d08ad79bfbcb9ab1a2417e203d9cdbb53202f2710548b WHIRLPOOL aece36375fcb7c8a6af19b4e1e39a67c6be246821d96c7f81f41acaca8a880433b756792cf540c90e596b2842358090697df37a103f3c80f8d0e088b863e3263
+MISC metadata.xml 564 SHA256 0d622e90e8ab6e8fce3098ee24c756fe1c0942968bc95b9e01c03686b17f424f SHA512 d32499f8dc915da23ef8ce3b0f799d213d5cf700da8b80c83a94770d7fef72bc22ddbfbecf92e49c8ea0f56c4c2b718e53563a450870a77d7cdd3d3c5f610b1a WHIRLPOOL 6619e3435896d9964712070d2365d6ca8d80205382d46a6948d8371277a74d23e4ef0c1a77892308f2cb598f2515f6816ab60f4d045907f4a4b433e189bc6165
diff --git a/sys-libs/libsmbios/files/libsmbios-2.2.28-cppunit-tests.patch b/sys-libs/libsmbios/files/libsmbios-2.2.28-cppunit-tests.patch
new file mode 100644
index 000000000000..ed8599ecff9c
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-2.2.28-cppunit-tests.patch
@@ -0,0 +1,10 @@
+--- libsmbios-2.2.28/src/libsmbios_c/smi/smi_linux.c
++++ libsmbios-2.2.28/src/libsmbios_c/smi/smi_linux.c
+@@ -48,6 +48,7 @@
+ #define bufsize 256
+
+ // not in header file. for private use by unit tests.
++LIBSMBIOS_C_DLL_SPEC void set_basedir(const char *); // needed to link tests
+ void set_basedir(const char *newdir)
+ {
+ sysfs_basedir = newdir;
diff --git a/sys-libs/libsmbios/files/libsmbios-2.3.0-doxygen_target.patch b/sys-libs/libsmbios/files/libsmbios-2.3.0-doxygen_target.patch
new file mode 100644
index 000000000000..ebe6798bd731
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-2.3.0-doxygen_target.patch
@@ -0,0 +1,16 @@
+--- libsmbios-2.3.0/Makefile.am
++++ libsmbios-2.3.0/Makefile.am
+@@ -89,10 +89,12 @@
+
+
+ ########## DOCS ################
+-all: doxygen
+ if HAVE_DOXYGEN
++all: doxygen
+ DOXYGEN_DEPS=out/libsmbios_c/html/index.html out/libsmbios_c++/html/index.html
+ doxygen: $(DOXYGEN_DEPS)
++else
++all:
+ endif
+
+ DOT=@DOT@
diff --git a/sys-libs/libsmbios/files/libsmbios-2.3.3-doxygen_target.patch b/sys-libs/libsmbios/files/libsmbios-2.3.3-doxygen_target.patch
new file mode 100644
index 000000000000..4adca14f21d8
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-2.3.3-doxygen_target.patch
@@ -0,0 +1,19 @@
+--- libsmbios-2.3.3/Makefile.am
++++ libsmbios-2.3.3/Makefile.am
+@@ -89,13 +89,15 @@
+
+
+ ########## DOCS ################
+-all: doxygen
+ if HAVE_DOXYGEN
++all: doxygen
+ DOXYGEN_DEPS=out/libsmbios_c/html/index.html
+ if BUILD_LIBSMBIOS_CXX
+ DOXYGEN_DEPS+=out/libsmbios_c++/html/index.html
+ endif
+ doxygen: $(DOXYGEN_DEPS)
++else
++all:
+ endif
+
+ DOT=@DOT@
diff --git a/sys-libs/libsmbios/files/libsmbios-fix-pie.patch b/sys-libs/libsmbios/files/libsmbios-fix-pie.patch
new file mode 100644
index 000000000000..3ab404e8ea2e
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-fix-pie.patch
@@ -0,0 +1,29 @@
+--- libsmbios-2.2.19/src/bin/dellMediaDirectCtl.cpp
++++ libsmbios-2.2.19/src/bin/dellMediaDirectCtl.cpp
+@@ -183,16 +183,21 @@
+ {
+ iopl(3);
+
++ u32 tmpebx;
+ __asm__ __volatile__ (
+- // magic port
+- "outb %%al, %%dx \n\t"
+-
++ "movl %%ebx,%[tmpebx]\n\t"
++ "movl %[ebx],%%ebx\n\t"
++ // magic port
++ "outb %%al, %%dx \n\t"
++ "movl %%ebx,%[ebx]\n\t"
++ "movl %[tmpebx],%%ebx\n\t"
+ : /* output args */
+ "=a" (r->eax),
+- "=b" (r->ebx),
++ [ebx] "=rm" (r->ebx),
+ "=c" (r->ecx),
+ "=S" (r->esi),
+- "=D" (r->edi)
++ "=D" (r->edi),
++ [tmpebx] "+m" (tmpebx)
+ : /* input args */
+ "0" (r->eax),
+ "1" (r->ebx),
diff --git a/sys-libs/libsmbios/libsmbios-2.3.0-r1.ebuild b/sys-libs/libsmbios/libsmbios-2.3.0-r1.ebuild
new file mode 100644
index 000000000000..9c7ce6e794e9
--- /dev/null
+++ b/sys-libs/libsmbios/libsmbios-2.3.0-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils flag-o-matic python-single-r1
+
+DESCRIPTION="Provide access to (SM)BIOS information"
+HOMEPAGE="http://linux.dell.com/libsmbios/main/index.html"
+SRC_URI="http://linux.dell.com/libsmbios/download/libsmbios/${P}/${P}.tar.xz
+ http://linux.dell.com/libsmbios/download/libsmbios/old/${P}/${P}.tar.xz"
+
+LICENSE="GPL-2 OSL-2.0"
+SLOT="0"
+KEYWORDS="amd64 ia64 x86"
+IUSE="doc graphviz nls python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="dev-libs/libxml2
+ sys-libs/zlib
+ nls? ( virtual/libintl )
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ graphviz? ( media-gfx/graphviz )
+ nls? ( sys-devel/gettext )
+ test? ( >=dev-util/cppunit-1.9.6 )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-fix-pie.patch"
+ "${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
+ "${FILESDIR}/${PN}-2.3.0-doxygen_target.patch"
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # Don't build yum-plugin - we don't need it
+ sed '/yum-plugin/d' -i Makefile.am || die
+
+ eautoreconf
+}
+
+src_configure() {
+ #Remove -O3 for bug #290097
+ replace-flags -O3 -O2
+
+ econf \
+ $(use_enable doc doxygen) \
+ $(use_enable graphviz) \
+ $(use_enable nls) \
+ $(use_enable python) \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+
+ if use python ; then
+ python_scriptinto /usr/sbin
+ python_doscript "${ED%/}"/usr/sbin/smbios-{{keyboard,thermal,token,wakeup,wireless}-ctl,lcd-brightness,passwd,rbu-bios-update,sys-info}
+ fi
+
+ insinto /usr/include/
+ doins -r src/include/smbios/
+
+ dodoc AUTHORS ChangeLog NEWS README TODO
+
+ use static-libs || prune_libtool_files --all
+}
diff --git a/sys-libs/libsmbios/libsmbios-2.3.2.ebuild b/sys-libs/libsmbios/libsmbios-2.3.2.ebuild
new file mode 100644
index 000000000000..d2777066e17c
--- /dev/null
+++ b/sys-libs/libsmbios/libsmbios-2.3.2.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools flag-o-matic python-single-r1 versionator
+
+DESCRIPTION="Provide access to (SM)BIOS information"
+HOMEPAGE="http://linux.dell.com/files/libsmbios/"
+SRC_URI="https://github.com/dell/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2 OSL-2.0"
+SLOT="0"
+KEYWORDS="amd64 ia64 x86"
+IUSE="doc graphviz nls python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="dev-libs/libxml2
+ sys-libs/zlib
+ nls? ( virtual/libintl )
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ graphviz? ( media-gfx/graphviz )
+ nls? ( sys-devel/gettext )
+ test? ( >=dev-util/cppunit-1.9.6 )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-fix-pie.patch"
+ "${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
+ "${FILESDIR}/${PN}-2.3.0-doxygen_target.patch"
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # Don't build yum-plugin - we don't need it
+ sed '/yum-plugin/d' -i Makefile.am || die
+
+ # Fix version string in build system
+ sed "/release_micro_version/s@\[1\]@[$(get_version_component_range 3)]@" \
+ -i configure.ac || die
+
+ eautoreconf
+}
+
+src_configure() {
+ #Remove -O3 for bug #290097
+ replace-flags -O3 -O2
+
+ econf \
+ $(use_enable doc doxygen) \
+ $(use_enable graphviz) \
+ $(use_enable nls) \
+ $(use_enable python) \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+
+ if use python ; then
+ python_scriptinto /usr/sbin
+ python_doscript "${ED%/}"/usr/sbin/smbios-{{keyboard,thermal,token,wakeup,wireless}-ctl,lcd-brightness,passwd,sys-info}
+ fi
+
+ insinto /usr/include/
+ doins -r src/include/smbios/
+
+ einstalldocs
+
+ if ! use static-libs ; then
+ find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
+ fi
+}
diff --git a/sys-libs/libsmbios/libsmbios-2.3.3.ebuild b/sys-libs/libsmbios/libsmbios-2.3.3.ebuild
new file mode 100644
index 000000000000..f6024bfa3475
--- /dev/null
+++ b/sys-libs/libsmbios/libsmbios-2.3.3.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools flag-o-matic python-single-r1 versionator
+
+DESCRIPTION="Provide access to (SM)BIOS information"
+HOMEPAGE="http://linux.dell.com/files/libsmbios/"
+SRC_URI="https://github.com/dell/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2 OSL-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~x86"
+IUSE="doc graphviz nls python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="dev-libs/libxml2
+ sys-libs/zlib
+ nls? ( virtual/libintl )
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ graphviz? ( media-gfx/graphviz )
+ nls? ( sys-devel/gettext )
+ test? ( >=dev-util/cppunit-1.9.6 )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-fix-pie.patch"
+ "${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
+ "${FILESDIR}/${PN}-2.3.3-doxygen_target.patch"
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # Don't build yum-plugin - we don't need it
+ sed '/yum-plugin/d' -i Makefile.am || die
+
+ eautoreconf
+}
+
+src_configure() {
+ #Remove -O3 for bug #290097
+ replace-flags -O3 -O2
+
+ econf \
+ $(use_enable doc doxygen) \
+ $(use_enable graphviz) \
+ $(use_enable nls) \
+ $(use_enable python) \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+
+ if use python ; then
+ python_scriptinto /usr/sbin
+ python_doscript "${ED%/}"/usr/sbin/smbios-{{keyboard,thermal,token,wakeup,wireless}-ctl,lcd-brightness,passwd,sys-info}
+ fi
+
+ insinto /usr/include/
+ doins -r src/include/smbios/
+ doins -r src/include/smbios_c
+
+ einstalldocs
+
+ if ! use static-libs ; then
+ find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
+ fi
+}
diff --git a/sys-libs/libsmbios/metadata.xml b/sys-libs/libsmbios/metadata.xml
new file mode 100644
index 000000000000..5da9415b6118
--- /dev/null
+++ b/sys-libs/libsmbios/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 type="person">
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <longdescription>The libsmbios project aims towards providing access to as much
+BIOS information as possible. It does this by providing a library of functions
+that can be used as well as sample binaries.</longdescription>
+ <upstream>
+ <remote-id type="github">dell/libsmbios</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libspe2/Manifest b/sys-libs/libspe2/Manifest
new file mode 100644
index 000000000000..1212832d25ef
--- /dev/null
+++ b/sys-libs/libspe2/Manifest
@@ -0,0 +1,8 @@
+AUX spe.rc6 904 SHA256 90e34529decb8755c17cc8659a3b9b23458fbcfe0c14ac80be05beed22eadd01 SHA512 3661fd96629b7c0326308de48b6a48fbead8d24ffe66e31e7a0313936edb39c44c8d5480b2b3d80ea9219690fb454ec5f385cf06ed4d434e67d46ec8e5038d80 WHIRLPOOL ca77ada50476ba83c4bf743c548a4d9f0b40725ee7f91e246a8c121b486a02d0d947356470eaab71e46b998748bcc7efa630e7f7bb27b7cc3ddd4638c5b89f20
+DIST libspe2-2.2.80-95.tar.gz 153122 SHA256 a8160fb41faa83247ffe132a25502fdd2237427a55ed3a22344058f3dc5e2a44 SHA512 8ae0665e37f1ba98972f2906831007dfde2a35bb46b317604aee1327dd19ea8556a01d84c990ec6735004a7ee1e67439c0e0cba34f0df749f4e98766ca26021b WHIRLPOOL f58a31899df6bc99d2239fd6d25cc23b1ce4e9af5d34f51766450e499b67e3ed01e8a32cdbeac4a4ce04931ec1e175316cc1aac166402387fd014d1f8876c888
+DIST libspe2-2.3.0.135.tar.gz 197848 SHA256 35b26c2f478feabce9b94ecca2b28726b462e29578aa49f38fb104f8ecf2d23a SHA512 31f4e9593d76de50ec5ab903aa82450fb5d9dea9300298831aeb408b083297ba88398fddc2110818bfdd5c13850cae95b9eced3b88f6627b732ea5a76e5d7435 WHIRLPOOL eaa641c1cc35afb5058c4e3ef677755317cf482747f7505e890ea5e6c6fe42ce4ef9953413154d5a27aeaeafeea03cf0aa33b6864bacf34723e8413acf12f3d5
+EBUILD libspe2-2.2.80_p95-r1.ebuild 1592 SHA256 7a80082195496277d2e8cce3a9efafeba741a8a332aaa5e867a7f4a6749e9766 SHA512 16a72044aa175d251598046969b16cd84df9a6d8801db062c903b06217b5f9dd6d8f1a71e565840ec4bfb94c00bff903689531d628a7100cb9f1e8abe6317d5e WHIRLPOOL 501559c4efe18a707bee901b0bc8c0c9fe5bbd30ce46c086321c81f4cceae17e2793091cb3c58b3091bbe9f205d5a07bbb1b7b901fd18390b8ff98fa460a09b2
+EBUILD libspe2-2.3.0_p135.ebuild 1608 SHA256 813e24bcbe926dbb3d3d08373195948960ff6bfd10fe730b97c8c6188099a3ee SHA512 3fb2cb26f87a54c12e59e0495c32139d620c02057ccc80bfc86f099fec0029d3e4f7fbce3af74914bc09bf06cc8272c4ed996859c57da6adfa0eb142c864bf7f WHIRLPOOL 7440706aed663c19eddc6059fa32b590b5a8786f1c330cb94e4a64cebd3f03bb9b4939ec80ebadd545702a7aeed053855c027f26230bb7f1414f2c2b2ca46a78
+MISC ChangeLog 2543 SHA256 212dc3af5e539e405179ce692957d8b941f6becca21b552339b91e6339255724 SHA512 7bb13abfe0dbb6a69e90201f0f62f92186dcfda1e6f8b8c7fe016b96fbbccb708d78ee82be708ea612b98000cf7137ac5813308ead4d6f3030e5a5f484abfac8 WHIRLPOOL 119ba2d17f0558a92bb7dda601caf52b9ad77b52084210096455822ee55f04555b774168ec933f12e0b65d447aa8d23bdc50ab2338e659e389ba11b905bc4ec0
+MISC ChangeLog-2015 1178 SHA256 6523cacb51f1649c59cb012c9d5aa747a5e7274f5d96c2a412f17c6d5ee25b75 SHA512 bf3c65475a16e803eadccf09d789c3adc3fbc5dcb067467b170f8698488175634fb94cc72a5ddcd67416b8b02839faf615926449f66756014250dae80265d4ad WHIRLPOOL 58c60c1162d09bc113e64596315659c1dc0ed31e73b7c8cd5e0352bbf04db99168f8e9f2d0521fd2dbdeb8f0fe496cf84c10f960933773c3ed46373ddbae4d2d
+MISC metadata.xml 294 SHA256 9009317e3a2291c4f217c7d5d6ab6c1c33e4344ddf989f48cd70ef45608b9370 SHA512 f27b273f7396a60b20a0a8ddbec4a93b8b87730b00a190913a561f3f767248bb0dd0956c24f93ecb6f6423cc9fd3413f20ebe47f6b3cf2b94a900605482ca62e WHIRLPOOL 5b570d026d199a31123d11f0aa4d123cab43d7f883772f615cb56419232149a11babe3c0242fb9d6dce08b94d7ac627a00e67ea0bbd94f1637dbd1d7364b0291
diff --git a/sys-libs/libspe2/files/spe.rc6 b/sys-libs/libspe2/files/spe.rc6
new file mode 100644
index 000000000000..76c1c5cb29d3
--- /dev/null
+++ b/sys-libs/libspe2/files/spe.rc6
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ # you need the elfspe bin
+ need localmount
+}
+
+start() {
+ ebegin "Registering elfspe to binfmt"
+
+ if test -f /proc/sys/fs/binfmt_misc/spe
+ then
+ eerror "elfspe already registered"
+ return 1
+ else
+ if test -f /proc/sys/fs/binfmt_misc/register
+ then
+ echo ':spe:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x17::/usr/bin/elfspe:' >/proc/sys/fs/binfmt_misc/register
+ eend $?
+ else
+ eerror "binfmt not available"
+ return 1
+ fi
+ fi
+}
+
+stop() {
+ if ! test -f /proc/sys/fs/binfmt_misc/spe
+ then
+ eerror "elfspe not present"
+ return 1
+ else
+ echo -1 > /proc/sys/fs/binfmt_misc/spe
+ eend $?
+ fi
+}
diff --git a/sys-libs/libspe2/libspe2-2.2.80_p95-r1.ebuild b/sys-libs/libspe2/libspe2-2.2.80_p95-r1.ebuild
new file mode 100644
index 000000000000..ea48e49741ca
--- /dev/null
+++ b/sys-libs/libspe2/libspe2-2.2.80_p95-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+inherit eutils
+
+MY_P=${P/_p/-}
+
+DESCRIPTION="A wrapper library to adapt the JSRE SPU usage model to SPUFS"
+HOMEPAGE="https://sourceforge.net/projects/libspe"
+SRC_URI="mirror://sourceforge/libspe/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="ppc ppc64"
+IUSE="debug"
+
+S="${WORKDIR}/${P//_p*}"
+
+DEPEND=""
+# This packages also provides libspe1
+RDEPEND="!sys-libs/libspe"
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ SYSROOT=""
+else
+ SYSROOT="/usr/${CTARGET}"
+fi
+
+src_unpack () {
+ unpack ${A}
+ #just in case something is missing
+ cd "${S}"
+}
+
+src_compile() {
+ myconf=""
+ use debug && myconf="${myconf} DEBUG=1"
+ make all elfspe-all CROSS="${CTARGET}-" \
+ prefix=/usr SYSROOT="$SYSROOT" ${myconf} \
+ speinclude=/usr/spu-elf/include || die
+}
+
+src_install() {
+ make CROSS="${CTARGET}-" prefix=/usr \
+ speinclude=/usr/spu-elf/include \
+ SYSROOT="$SYSROOT" \
+ DESTDIR="$D" install elfspe-install || die
+ newinitd "${FILESDIR}/spe.rc6" elfspe
+}
+
+pkg_postinst() {
+ einfo "You may want to register elfspe to binfmt using the"
+ einfo "provided initscript"
+ einfo "# rc-update add elfspe boot"
+ ewarn "make sure your fstab contains the following line"
+ ewarn "none /spu spufs defaults
+ 0 0"
+ ewarn "and that you have spufs support enabled in the kernel"
+}
diff --git a/sys-libs/libspe2/libspe2-2.3.0_p135.ebuild b/sys-libs/libspe2/libspe2-2.3.0_p135.ebuild
new file mode 100644
index 000000000000..ce24d660f808
--- /dev/null
+++ b/sys-libs/libspe2/libspe2-2.3.0_p135.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+inherit eutils
+
+MY_P=${P/_p/.}
+
+DESCRIPTION="A wrapper library to adapt the JSRE SPU usage model to SPUFS"
+HOMEPAGE="https://sourceforge.net/projects/libspe"
+SRC_URI="mirror://sourceforge/libspe/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~ppc ~ppc64"
+IUSE="debug"
+
+S="${WORKDIR}/${P/_p*//}"
+
+DEPEND=""
+# This packages also provides libspe1
+RDEPEND="!sys-libs/libspe"
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ SYSROOT=""
+else
+ SYSROOT="/usr/${CTARGET}"
+fi
+
+src_unpack () {
+ unpack ${A}
+ #just in case something is missing
+ cd "${S}"
+ echo "${S}"
+}
+
+src_compile() {
+ myconf=""
+ use debug && myconf="${myconf} DEBUG=1"
+ make all elfspe-all CROSS="${CTARGET}-" \
+ prefix=/usr SYSROOT="$SYSROOT" ${myconf} \
+ speinclude=/usr/spu-elf/include || die
+}
+
+src_install() {
+ make CROSS="${CTARGET}-" prefix=/usr \
+ speinclude=/usr/spu-elf/include \
+ SYSROOT="$SYSROOT" \
+ DESTDIR="$D" install elfspe-install || die
+ newinitd "${FILESDIR}/spe.rc6" elfspe
+}
+
+pkg_postinst() {
+ einfo "You may want to register elfspe to binfmt using the"
+ einfo "provided initscript"
+ einfo "# rc-update add elfspe boot"
+ ewarn "make sure your fstab contains the following line"
+ ewarn "none /spu spufs defaults
+ 0 0"
+ ewarn "and that you have spufs support enabled in the kernel"
+}
diff --git a/sys-libs/libspe2/metadata.xml b/sys-libs/libspe2/metadata.xml
new file mode 100644
index 000000000000..118d82b0c46f
--- /dev/null
+++ b/sys-libs/libspe2/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 type="person">
+ <email>lu_zero@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">libspe</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libstatgrab/Manifest b/sys-libs/libstatgrab/Manifest
new file mode 100644
index 000000000000..cb6f38d0b1c3
--- /dev/null
+++ b/sys-libs/libstatgrab/Manifest
@@ -0,0 +1,8 @@
+AUX libstatgrab-0.91-tinfo.patch 1833 SHA256 b3b963fbf189c604ca26f2fc9b4f5a25b110f29b302b5b483f579b902508175d SHA512 71908cdac0684e4b6fae04f30156ca390d9bd525467f0954e94b5725e9ef5fe368cfd78ece333d8ffca5e02fc33b66e993655960a3cd1b9667a479be73943b6b WHIRLPOOL 596385d5558747fee4d050229f8c1dea5a33dd5f569163f8bcce77fdb91a45bc8eefdf6dafb0062c3df65159ea6ad657cfb09a115f8b57430cd924c784c5978d
+DIST libstatgrab-0.17.tar.gz 463224 SHA256 bbaa88c6bde8bd3cf2720b81a26528cc055a7e83e4ea3bdb1d0a3c4287cceb88 SHA512 feb8d8aa345d57a9036700d580a7d1e21aed9bb2063b46b2c57a59fce00eb20a22590e5e391c8a9a1f43055c14a6ce3fcf648b98f1fec3b4efd270455a2933e3 WHIRLPOOL fb317f471a2669389c4b3a8267d609a54c09d34c87c86ae833fe5bdb06619e895ed7224272238fc8449f573da8e4e4eda31affaea39a09e83bd85fa0c754f02b
+DIST libstatgrab-0.91.tar.gz 776046 SHA256 03e9328e4857c2c9dcc1b0347724ae4cd741a72ee11acc991784e8ef45b7f1ab SHA512 f360f2e1b185bf9603b1d9c50649b0050e9502128ff81a9f4de88457e2f5203deafe7fd7ac13ebc4cc56e6ecd1bdf8aacae64987bdf36af0c9929e30626915f6 WHIRLPOOL 185f895093e1a91204acf856847ee5dd3f1da7d3b25fb6987d8a30ec1b962ada0168b84f032b3f9974942ac41643c1ad12cee1b1b797faca5fe806d21a491048
+EBUILD libstatgrab-0.17.ebuild 776 SHA256 c54bf9fcc20bfa010be78784036f7519ae5dc3d797474301d2362e22d445f676 SHA512 e13d4dc6f30aa1c354b9239b99d1d813b400930dfb7ec61ef51c3ef4697b46a3c1470460d1acceeb1dd97db62969396bf977facd1c1e3bbbab97f3b6f842834c WHIRLPOOL 08b5c9a4ac43db8a37b02419bb05e562cd5d1ddfb5f5d513f960ca310ec33d789b48b066971312cde0cf266f37c1c150467deb5f10ef0ccf4d85f95446dba6ed
+EBUILD libstatgrab-0.91.ebuild 1029 SHA256 15bce9ffa941ec324ddbf0cb84e49b066ac453d8c4f398fece14a3cea754cd33 SHA512 675735af91c7e2a96adf5fb181aaeca63ecb94b0f978ac03b2bb0fad9ae9edad9277c207a801feb0ff2bd6db2252a990e55fe89136f8dc93807371d36148d50f WHIRLPOOL 0f431f6508c38f15bdcd8aa5e012e83da3e822cbbb3f8867e48af4c481ce923746b61858d7f724b6299a8b5fdd504b499919813f0355893c392866fc2775a5ce
+MISC ChangeLog 2629 SHA256 eee38590a34bf10b01d6262e1411254b6facded0398343b2a91c9c3204176493 SHA512 449d5b844b68955a80e2860a8d360245e37011aa82602938cd8306f6f820adfb40c76e515222bed581428ce03e9f775d0ab897f584855aa15abab40e16d58ae2 WHIRLPOOL e2dad2e0dfc2acb9bcfe3c69ee641842d90738e0500d67060ca511eec1289110a993e555f5d971d12f6209aa502d7369485caea904be147e5b4775ac89042967
+MISC ChangeLog-2015 4873 SHA256 f4376f077b95ed73996be21ab677f7f081dbfea406585b861b97f0fd9611cb03 SHA512 bc45c18fe7e0f807cbdb40e3a8453c529fe952a6ce83dfa295818a8dc1a8c91152022e2468175058b3911399ff4b82246a6d03326e240414ca9f4101a88f5ac4 WHIRLPOOL 328c4e427215ed1e3f65d1471b08309f729f5d092546a8448674125c733b035f47ae170a37a31bd83328d246230f6c444e7ea4e8ce04f35df3899a392baa4c8c
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/sys-libs/libstatgrab/files/libstatgrab-0.91-tinfo.patch b/sys-libs/libstatgrab/files/libstatgrab-0.91-tinfo.patch
new file mode 100644
index 000000000000..b0eb94cbcd8e
--- /dev/null
+++ b/sys-libs/libstatgrab/files/libstatgrab-0.91-tinfo.patch
@@ -0,0 +1,43 @@
+--- a/m4/ax_ncurses.m4
++++ b/m4/ax_ncurses.m4
+@@ -12,24 +12,31 @@
+
+ AS_IF([test "x$with_ncurses" != "xno"], [
+ AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, [
+- LIBS="$mp_save_LIBS $SAIDARLIBS -lncurses"
++ LIBS="$mp_save_LIBS $SAIDARLIBS -lncurses -ltinfo"
+ CPPFLAGS="$mp_save_CPPFLAGS $SAIDARCPPFLAGS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ncurses.h>], [testcode])], [
+ mp_cv_ncurses="ncurses.h"
+- CURSES_LIB="-lncurses"
++ CURSES_LIB="-lncurses -ltinfo"
+ ], [
+ LIBS="$mp_save_LIBS $SAIDARLIBS -lncurses"
+ CPPFLAGS="$mp_save_CPPFLAGS $SAIDARCPPFLAGS"
+- AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ncurses/ncurses.h>], [testcode])], [
+- mp_cv_ncurses="ncurses/ncurses.h"
++ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ncurses.h>], [testcode])], [
++ mp_cv_ncurses="ncurses.h"
+ CURSES_LIB="-lncurses"
+ ], [
+- LIBS="$mp_save_LIBS $SAIDARLIBS -lcurses"
++ LIBS="$mp_save_LIBS $SAIDARLIBS -lncurses"
+ CPPFLAGS="$mp_save_CPPFLAGS $SAIDARCPPFLAGS"
+- AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <curses.h>], [testcode])], [
+- mp_cv_ncurses="curses.h"
+- CURSES_LIB="-lcurses"
+- ], [mp_cv_ncurses=no])
++ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ncurses/ncurses.h>], [testcode])], [
++ mp_cv_ncurses="ncurses/ncurses.h"
++ CURSES_LIB="-lncurses"
++ ], [
++ LIBS="$mp_save_LIBS $SAIDARLIBS -lcurses"
++ CPPFLAGS="$mp_save_CPPFLAGS $SAIDARCPPFLAGS"
++ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <curses.h>], [testcode])], [
++ mp_cv_ncurses="curses.h"
++ CURSES_LIB="-lcurses"
++ ], [mp_cv_ncurses=no])
++ ])
+ ])
+ ])
+ ])
diff --git a/sys-libs/libstatgrab/libstatgrab-0.17.ebuild b/sys-libs/libstatgrab/libstatgrab-0.17.ebuild
new file mode 100644
index 000000000000..58260ce4f121
--- /dev/null
+++ b/sys-libs/libstatgrab/libstatgrab-0.17.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit autotools-utils
+
+DESCRIPTION="A tool to provide access to statistics about the system on which it's run"
+HOMEPAGE="http://www.i-scream.org/libstatgrab/"
+SRC_URI="http://www.mirrorservice.org/sites/ftp.i-scream.org/pub/i-scream/libstatgrab/${P}.tar.gz"
+
+LICENSE="|| ( GPL-2 LGPL-2.1 )"
+SLOT=0
+KEYWORDS="amd64 ~arm ~ia64 ppc x86"
+IUSE="static-libs"
+
+RDEPEND="sys-libs/ncurses"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog PLATFORMS NEWS AUTHORS README )
+
+src_configure() {
+ local myeconfargs=(
+ --disable-setgid-binaries
+ --disable-setuid-binaries
+ --disable-deprecated
+ --with-ncurses
+ $(use_enable static-libs static)
+ )
+ autotools-utils_src_configure
+}
diff --git a/sys-libs/libstatgrab/libstatgrab-0.91.ebuild b/sys-libs/libstatgrab/libstatgrab-0.91.ebuild
new file mode 100644
index 000000000000..66d6b6f489ea
--- /dev/null
+++ b/sys-libs/libstatgrab/libstatgrab-0.91.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=frob
+inherit autotools-utils
+
+DESCRIPTION="A tool to provide access to statistics about the system on which it's run"
+HOMEPAGE="http://www.i-scream.org/libstatgrab/"
+SRC_URI="http://www.mirrorservice.org/sites/ftp.i-scream.org/pub/i-scream/libstatgrab/${P}.tar.gz"
+
+LICENSE="|| ( GPL-2 LGPL-2.1 )"
+SLOT=0
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~x86"
+IUSE="doc examples static-libs"
+
+RDEPEND="sys-libs/ncurses"
+DEPEND="${RDEPEND}"
+
+DOCS=( ChangeLog PLATFORMS NEWS AUTHORS README )
+
+PATCHES=( "${FILESDIR}"/${P}-tinfo.patch )
+
+src_configure() {
+ local myeconfargs=(
+ --disable-setgid-binaries
+ --disable-setuid-binaries
+ --with-ncurses
+ $(use_enable static-libs static)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ docompress -x /usr/share/doc/${PF}/examples
+ insinto /usr/share/doc/${PF}/examples
+ doins -r examples/*
+ fi
+}
diff --git a/sys-libs/libstatgrab/metadata.xml b/sys-libs/libstatgrab/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/sys-libs/libstatgrab/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/sys-libs/libstdc++-v3-bin/Manifest b/sys-libs/libstdc++-v3-bin/Manifest
new file mode 100644
index 000000000000..c9de7abc20f2
--- /dev/null
+++ b/sys-libs/libstdc++-v3-bin/Manifest
@@ -0,0 +1,6 @@
+DIST libstdc++-v3-bin-ia64-3.3.6.tbz2 325449 SHA256 280bd169f7c2608cf102d296be70a71d0d2d20812c2b35c03d17ca11e841708c SHA512 c20dba994af3d5e0a2c85c9599c7ccc0260a105330ff6337030928c81e8300fe3e84925fe815d3bf42d050402b69490f6762fbd8ff9225a4621fa8e693c7b63a WHIRLPOOL 6a42e2a18f774dede0b2a186146619c8760f00baae44d30fb62b33e38b9fbdc3abed0a64964813c6bd5dab17978d05304cd4169cb42f7f3981da98256f841550
+DIST libstdc++-v3-bin-ppc64-3.3.6.tbz2 301670 SHA256 b0e62a415f57e8870049fa6ca4f8d56aed6fd2359782b178d0e9fd1c5ae9d1a1 SHA512 167d9863e6c54a6e85b2fd36f46f8c5269679c47f1ed50816718c502836bdefdc52949295a223b2870935bc1aca23a2c9fb967d51a02ba278d269b70cc82a8f6 WHIRLPOOL 41656751218576c94934477c9b30cd9dd2e528a6dc7e5d328ffd9e74b2b600915618c67ada0b2788f2cb94dc13aa71620ff0fa996f529fabe53bac48735c2115
+EBUILD libstdc++-v3-bin-3.3.6.ebuild 556 SHA256 cceb34a4129ef05ce00092cf0c71223a8a173f4bad4a4071997c4373492aa099 SHA512 dfdef71a2e46479f82c8fbe945ee6b47f353159fd63ee4ecdaf4b8b521683203e7f7cbb22d3d7af31c4f5c4a43da0b0adb6c0d885ca96d12d1d3382207719cfc WHIRLPOOL 8f6901bf1032b2953fb92e603bcf4456101c12d6f2c4ecb942e093fedcf2e3056393d8386298ab1b136aab71be14dee0e222c54169fc22cb33018ceeb787299e
+MISC ChangeLog 2617 SHA256 be65be25e5b619f3e648e5a7b7eea602c4bdf5023a41b937d3e62492f1da49aa SHA512 0ab856bc60bad1bc12e2accbcff03cf79f8914fe1e33cded6949782ec3d0c634ab976c125a1dd33a31acf25215378b3498363635d5d4efd8a709978f8ba1eaa4 WHIRLPOOL 81294ca3d317fbff2548e2f45efd936163ba34a2fa96c9e203327591f6395fb4588c8d7957bf7403b2715b8357847e56924fef442900cab44ba043272f284813
+MISC ChangeLog-2015 572 SHA256 e4895e4941c2406f3fa5639bed7d5e6ce9c918ccbaaa8e8b2bef2fe359c7c51a SHA512 850c92d3ef7d4aec3cda779ebb01a98b39c2fff086bdade9cb4fa57fe41c84cc562cc8ead87ab736dddc580638b593b5115081febe6459e6d6fc2d92c13c9dc8 WHIRLPOOL c90da1a2e83d79cde5e4603c8caaab7a3cdbd650dd94d200e491c99f6225fda3e7002baa0f7d3c029aad4042752b1b876fa0769c4a63e8aa38728d0920ab6006
+MISC metadata.xml 259 SHA256 e7ac6b67c4c89040a00b23bda7a3b2fd4ac8affc1055daf3015ccc8580640f6f SHA512 ca71b1781806d20022c238e5b5d10f9154c78e0fa51f2603de34c48ecbe4cbc2c3190cf046526840546743644c691ee7fe51e31a4617b01bb7602dde803c1538 WHIRLPOOL 2a2aa19a448eca4dea84d129fd194a7ee4d77bdc1b5120abd3b667ce156cdeeb4616a7c7cd23fbccb7ba08e6e166aaba0fac63a6afa208d826acee37b0e560fe
diff --git a/sys-libs/libstdc++-v3-bin/libstdc++-v3-bin-3.3.6.ebuild b/sys-libs/libstdc++-v3-bin/libstdc++-v3-bin-3.3.6.ebuild
new file mode 100644
index 000000000000..fccdd1264efd
--- /dev/null
+++ b/sys-libs/libstdc++-v3-bin/libstdc++-v3-bin-3.3.6.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="Compatibility package for running binaries linked against a pre gcc 3.4 libstdc++"
+HOMEPAGE="https://gcc.gnu.org/libstdc++/"
+SRC_URI="ia64? ( mirror://gentoo/${PN}-ia64-${PV}.tbz2 )
+ ppc64? ( mirror://gentoo/${PN}-ppc64-${PV}.tbz2 )"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="ia64 ppc64"
+IUSE=""
+
+DEPEND=""
+RDEPEND="sys-libs/glibc"
+
+RESTRICT="strip"
+
+src_install() {
+ cp -pPR "${WORKDIR}"/* "${D}"/ || die "copying files failed!"
+}
diff --git a/sys-libs/libstdc++-v3-bin/metadata.xml b/sys-libs/libstdc++-v3-bin/metadata.xml
new file mode 100644
index 000000000000..5eb05198076b
--- /dev/null
+++ b/sys-libs/libstdc++-v3-bin/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 type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libstdc++-v3/Manifest b/sys-libs/libstdc++-v3/Manifest
new file mode 100644
index 000000000000..4f4c02fdc8be
--- /dev/null
+++ b/sys-libs/libstdc++-v3/Manifest
@@ -0,0 +1,6 @@
+DIST gcc-3.3.6-patches-1.9.tar.bz2 51760 SHA256 9759a4dc139c9c739a179fdabff484c8b2d036707f0be03ca54fdb7f7d4ffdb4 SHA512 306220c537c5cd90af7638431e6547ee9a80199c384629b5fbda06c28b2d6168fcf1dd448c0e178b104f41e03a8ebda4f389489d205b9e66ade6637e4747196c WHIRLPOOL 0a49ae8fe42f24c8c0e1a9d7671c462219e501bbe2fb27c78a723889cb084632899403d78230e7618899d2cb639bdeada0d5c577949a87c1d249891cd22a5b01
+DIST gcc-3.3.6.tar.bz2 23972413 SHA256 1c1aa533c67e9da5e55ed4f5736258dc753466bd716bdae3fb88fb66e6ff1d7f SHA512 576b88e2fa675314a79a85f180684fe5af370c596476a0bf02e33e8ae0e2be838417ea80675ce4194a8213792cf7ada50cae5131149e4b890ab61e0b8d50d0ed WHIRLPOOL 27372f9d12cdedaad38e75c3efea3430d6873d92f85ec0024e2cc5ad986c710ed940edecc926a4c25ce14d14cddc1aec3eb35ac2c29e8c85309685d525a99cf1
+EBUILD libstdc++-v3-3.3.6-r1.ebuild 4824 SHA256 e1ef8ffa730db39bb56ecab81ff4ebe896e586c73da649bd7d87895d5e60a5b7 SHA512 54c0a0965ecedd0ea53921e2449076c00d040ff6e4d50989bf87c310597983be5d558ba533433964bc074080e6235aa84a21bc15554685b8c5581939d00c1c09 WHIRLPOOL 90edef6c41997e114034226db25aaa4a89e39b1509bec2aaf40bc62a9728bd71650f389a6a97c190e6abe832234b2c35b9b704430ebd30f2f9a30e7ca5d7b741
+MISC ChangeLog 2701 SHA256 3f5004aac9577d13734fdab011d3812e88ea95d59c19676908e4235317f72e76 SHA512 097ab80e968d1ac6cffa73ae990eefa16ff733b0b55f90dd2d9a8c58739ca10a3ab1a10ece67974d8373ff0ea36e845e70e47cc8d1536540504ea54196d4a6a0 WHIRLPOOL efb1c03c74542a3e4df06b4f68b27e92ffc9f51b5889967a5918f7f0f46221e667db50f42182cc333760ef475f71b7d8983619e5e21879abffc68234ee5949a9
+MISC ChangeLog-2015 11470 SHA256 4c79150897353689b4dfcbc21ef5bea00c038b6c1aab96a38b92158c814adf90 SHA512 2305e860eef9f2b445dc9aac62ea6eb9f5e3cab6714ad21c493eb1b790b161c2f7d1f49e01b741fb884bc6fb9596c2ec428be1d0b140564dbfa60f3a29d20ce1 WHIRLPOOL d9ea9df196d1d599d9498b0541c331742c55b5713b1425ed046ccc3ab2c3e3d50c4a136980716a6e6e826a9feba4ca22f206a7990aaf4cbeed977992a4fd65d9
+MISC metadata.xml 257 SHA256 fcb691c3299a07a5fe4f936baa5aa146b8aa3cb9491ba88fd12547cb540b02c2 SHA512 fd85d9cf15f6b7db96e4d184e32ae6f1503a5b70cb4cb1ce930ba13a1d5d4c4b24971781e95b7f3f9ead58b31760f84c368bc6fa2a793b4b5baf78259b047ff1 WHIRLPOOL 62b62e3e5489b8983ddd7bfc6017411d5e02f9710763206baa84b826388c8685fe7bdc0bb6a76c029e73ae4c160e9af6c8544406dc70a203c7c3d65d4aa15400
diff --git a/sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r1.ebuild b/sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r1.ebuild
new file mode 100644
index 000000000000..53ec501f081d
--- /dev/null
+++ b/sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r1.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils flag-o-matic libtool multilib
+
+transform_known_flags() {
+ declare setting
+
+ # and on x86, we just need to filter the 3.4 specific amd64 -marchs
+ replace-cpu-flags k8 athlon64 opteron x86-64
+
+ # gcc 3.3 doesn't support -march=pentium-m
+ replace-cpu-flags pentium-m pentium3m pentium3
+
+ #GCC 3.3 does not understand G3, G4, G5 on ppc
+ replace-cpu-flags G3 750
+ replace-cpu-flags G4 7400
+ replace-cpu-flags G5 7400
+}
+
+is_arch_allowed() {
+ i386_processor_table="i386 i486 i586 pentium pentium-mmx winchip-c6 \
+ winchip2 c3 i686 pentiumpro pentium2 pentium3 pentium4 prescott \
+ nocona k6 k6-2 k6-3 athlon athlon-tbird x86-64 athlon-4 athlon-xp \
+ athlon-mp"
+
+ for proc in ${i386_processor_table} ; do
+ [ "${proc}" == "${1}" ] && return 0
+ done
+
+ mips_processor_table="mips1 mips2 mips3 mips4 mips32 mips64 r3000 r2000 \
+ r3900 r6000 r4000 vr4100 vr4111 vr4120 vr4300 r4400 r4600 orion \
+ r4650 r8000 vr5000 vr5400 vr5500 4kc 4kp 5kc 20kc sr71000 sb1"
+
+ for proc in ${mips_processor_table} ; do
+ [ "${proc}" == "${1}" ] && return 0
+ done
+
+ rs6000_processor_table="common power power2 power3 power4 powerpc \
+ powerpc64 rios rios1 rsc rsc1 rios2 rs64a 401 403 405 505 601 602 \
+ 603 603e ec603e 604 604e 620 630 740 750 7400 7450 8540 801 821 823 \
+ 860"
+
+ for proc in ${rs6000_processor_table} ; do
+ [ "${proc}" == "${1}" ] && return 0
+ done
+
+ return 1
+}
+
+do_filter_flags() {
+ declare setting
+
+ # In general gcc does not like optimization, and add -O2 where
+ # it is safe. This is especially true for gcc 3.3 + 3.4
+ replace-flags -O? -O2
+
+ # gcc 3.3 doesn't support -mtune on numerous archs, so xgcc will fail
+ setting="`get-flag mtune`"
+ [ ! -z "${setting}" ] && filter-flags -mtune="${setting}"
+
+ # in gcc 3.3 there is a bug on ppc64 where if -mcpu is used
+ # the compiler incorrectly assumes the code you are about to build
+ # is 32 bit
+ use ppc64 && setting="`get-flag mcpu`"
+ [ ! -z "${setting}" ] && filter-flags -mcpu="${setting}"
+
+ # only allow the flags that we -know- are supported
+ transform_known_flags
+ setting="`get-flag march`"
+ if [ ! -z "${setting}" ] ; then
+ is_arch_allowed "${setting}" || filter-flags -march="${setting}"
+ fi
+ setting="`get-flag mcpu`"
+ if [ ! -z "${setting}" ] ; then
+ is_arch_allowed "${setting}" || filter-flags -mcpu="${setting}"
+ fi
+
+ # xgcc wont understand gcc 3.4 flags...
+ filter-flags -fno-unit-at-a-time
+ filter-flags -funit-at-a-time
+ filter-flags -fweb
+ filter-flags -fno-web
+ filter-flags -mno-tls-direct-seg-refs
+
+ # xgcc isnt patched with propolice
+ filter-flags -fstack-protector-all
+ filter-flags -fno-stack-protector-all
+ filter-flags -fstack-protector
+ filter-flags -fno-stack-protector
+
+ # xgcc isnt patched with the gcc symbol visibility patch
+ filter-flags -fvisibility-inlines-hidden
+ filter-flags -fvisibility=hidden
+
+ # Bug #269433 & #290202
+ filter-flags -fno-strict-overflow
+ filter-flags -fstrict-overflow
+
+ # Bug #442784
+ filter-flags '-W*'
+
+ filter-flags -frecord-gcc-switches
+ filter-flags '-fdiagnostics-color*'
+
+ # ...sure, why not?
+ strip-unsupported-flags
+
+ strip-flags
+}
+
+PATCH_VER="1.9"
+
+DESCRIPTION="Compatibility package for binaries linked against a pre gcc 3.4 libstdc++"
+HOMEPAGE="https://gcc.gnu.org/libstdc++/"
+SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/gcc-${PV}/gcc-${PV}.tar.bz2
+ mirror://gentoo/gcc-${PV}-patches-${PATCH_VER}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="5"
+KEYWORDS="amd64 ~mips ppc -ppc64 sparc x86 ~x86-fbsd"
+IUSE="multilib nls"
+
+DEPEND="sys-devel/bison"
+RDEPEND=""
+
+S=${WORKDIR}/gcc-${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ elibtoolize --portage --shallow
+ ./contrib/gcc_update --touch
+ mkdir -p "${WORKDIR}"/build
+
+ if use multilib && [[ ${SYMLINK_LIB} == "yes" ]] ; then
+ # ugh, this shit has to match the way we've hacked gcc else
+ # the build falls apart #259215
+ sed -i \
+ -e 's:\(MULTILIB_OSDIRNAMES = \).*:\1../lib64 ../lib32:' \
+ "${S}"/gcc/config/i386/t-linux64 \
+ || die "sed failed!"
+ fi
+}
+
+src_compile() {
+ cd "${WORKDIR}"/build
+ do_filter_flags
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-shared \
+ --with-system-zlib \
+ --enable-languages=c++ \
+ --enable-threads=posix \
+ --enable-long-long \
+ --disable-checking \
+ --enable-cstdio=stdio \
+ --enable-__cxa_atexit \
+ $(use_enable multilib) \
+ $(use_enable nls) \
+ $(use_with !nls included-gettext)
+
+ touch "${S}"/gcc/c-gperf.h
+
+ emake all-target-libstdc++-v3 || die
+}
+
+src_install() {
+ emake -j1 \
+ -C "${WORKDIR}"/build \
+ DESTDIR="${D}" \
+ install-target-libstdc++-v3 || die
+
+ # scrub everything but the library we care about
+ pushd "${D}" >/dev/null
+ mv usr/lib* . || die
+ rm -rf usr
+ rm -f lib*/*.{a,la,so} || die
+ dodir /usr
+ mv lib* usr/ || die
+}
diff --git a/sys-libs/libstdc++-v3/metadata.xml b/sys-libs/libstdc++-v3/metadata.xml
new file mode 100644
index 000000000000..e396f3755977
--- /dev/null
+++ b/sys-libs/libstdc++-v3/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 type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libtermcap-compat/Manifest b/sys-libs/libtermcap-compat/Manifest
new file mode 100644
index 000000000000..7ba0504afed6
--- /dev/null
+++ b/sys-libs/libtermcap-compat/Manifest
@@ -0,0 +1,10 @@
+DIST termcap-2.0.8-patches-1.tar.bz2 10573 SHA256 0f77dc3ac217f8800e0f70f5c47e93b8bd253f20bb53552356bcdb690a21cef9 SHA512 74ccfa95338574cb234faf4bda6ec3d4aa5bb45b2a59d6ef03a0b33fecc8d2da07e8df80d441de90e26f0eac06346dd697fbdcd9c0ec3068f179e12cd82405f2 WHIRLPOOL fb93e0e78984f884cb01d8a3712c90c2a356f227726c97b8b99630ece32fae1a114c9674d89edc8afee4f234674b272a3d8c8fb309fc18d2cdaecdd668a84409
+DIST termcap-2.0.8-patches-2.tar.bz2 11589 SHA256 9e6e623445070f351c3c5fcc0a13da9f8df93687b3429160f7a8c2e7928f795a SHA512 24d871007191a051dca604635f6d4e2dec67b675c2c9a0c728a0458a6a501ac268f5d4c4203356a6f64e718edba5c8ec970276c244435a25bef11c6fba0e837d WHIRLPOOL 97562be3b39aaf023e8e177cf6e02e3b38aecd105dffe02fbfb56a80e1223b06e4acb5cbd5ca0ca2a34ed654054dc9dd53d6346a355d2526acea453e3bda7929
+DIST termcap-2.0.8.tar.bz2 211523 SHA256 293fb17823ae10b01902465d9f83625598b784e7bf72dde5425914c1c718f917 SHA512 1aca52f5bcda60933229143085416296fed1aa981bae4440f30424f1e2bd9d90e9836f05c5a5a53af77d20dbb1d2425bf2b7c5fa2952258e2b4a2a5babaddaad WHIRLPOOL 1893929d35ca9fa8a68a9ea7ed8a424709d3393c4671f01e75995f4ed9bef8c70f3c5026dae2edcc4f88a1bb29542398477dae33915dadf4011f80bd4f6ca04e
+DIST termtypes.tc.gz 228329 SHA256 c4fa04257fea6e968d4caa28cc18dbbf9eea4769a463296eaca21ceea757a728 SHA512 13a2ee2cd0bc349d69af7efb8e8122f655b67f4bcbe0dc5cbf8a9ba22649548086a097de8bc148fb71ceba1640434a6b94763410beb3b915e03c3a6b46e8a678 WHIRLPOOL ee07db90257172a651e067e5313b2c9240b6a4cb60f376fd699f70ae95d20c1c7ed36cdb954259b21ecd48b7f997fe67f1be6ab5555ce8bdc3f65f7f3d6fa18f
+EBUILD libtermcap-compat-2.0.8-r2.ebuild 1382 SHA256 a0ca987621327ba4532dbdf5aa1c6dd09b9d542ae3594f0da7c3ffa39a50a731 SHA512 d576becb8c22b60b6aa945716d02a35c15010d6d8e701eab8f7fdc8cc7eb6fef3041c9f17ae5ae4f3c66ad511f3c248b6f526778fb35c63bda114f0bd85a063b WHIRLPOOL 33c3fe0889335b214d2549d7b636b2381e43141f82bd47f9cf74903e0508ec4dec5ae414892720645114cd031a7014bc34fe7c3f828fced73a06354d44232b5e
+EBUILD libtermcap-compat-2.0.8-r3.ebuild 1113 SHA256 bf7520f6246f672d31be28a2a82c2558ad6bc0f2186072e3629f609e201d7c3d SHA512 11983377a273f8435c2941ac86a196b54583510b807428cabb3897dab53c1d987a228b423143d4f4c3e9a53dc98e2f0d1cfa087f5657f071a9cb47b9c6233fb7 WHIRLPOOL 6d38f8365b90eac3e61bbf966a854618301f2642f74d999718bd3bab69ee623b696376b2fe4c3e232c26e7b836d0990234844ee3487bd3359255297bf1b65093
+EBUILD libtermcap-compat-2.0.8-r4.ebuild 1200 SHA256 66a451f8a89c1f7fd76bb4390d92ed29fa308d8183d83370b507a1a3274cd40d SHA512 ee86770f5a49c2f0697900c0763c460cae87d97ec464a1aea45cb0345d06650e09c11a798aa4e996ae4f46fe6e7725fa772818368ea3363467d4dd4ae5cee938 WHIRLPOOL 58ae4d061b36e28c4f6613a17646825fde47b90907744a0a44e85ab287c881ef8f1341ab52791e0dc673dea8d0f3982519b73d99a59efdbf05029b777039fdf6
+MISC ChangeLog 3310 SHA256 07887194d11c6d104096d215c7e3ceba70c9710148692105506320bedf286604 SHA512 c521132030cee2324c00a39911f1215de72dc5c443c9601d382eca9ed62ce20d5f9d549f72c2ae84947970624bb3e910637be98db7c99a8e999be82272396bf6 WHIRLPOOL 561ccb1a872831c0085c8fdd33310421930ab918cd2a4d7e3937832587996f292fb274136853530f1de8c5fea86bd3a8165c2d12a5cb97536024bc4f2f8c89bb
+MISC ChangeLog-2015 6493 SHA256 e1fb6be0dc77a9825b56da0fdca985cfedbb3df2b91a771eb3f373ce851bbe9f SHA512 748499c1f7e4b7d591825e6017588b0fff0f9a02f9e591c60c94c820b1d65c9fe370bb4382f46373c0d55071d95567aa55e1704d495629be25bd9dc95536d7f9 WHIRLPOOL 63b24ab6c816d55a013899eb1a856bc2a6cdae6886405ec32de9eda49b144ebab821f9597c501f8acc3190f299c30599be76a09ce1e5142d6f7019ae202c2038
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r2.ebuild b/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r2.ebuild
new file mode 100644
index 000000000000..93635728143a
--- /dev/null
+++ b/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r2.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# we only want this for binary-only packages, so we will only be installing
+# the lib used at runtime; no headers and no files to link against
+
+inherit eutils multilib
+
+PATCHVER=1
+
+MY_P="termcap-${PV}"
+DESCRIPTION="Compatibility package for old termcap-based programs"
+HOMEPAGE="http://www.catb.org/~esr/terminfo/"
+SRC_URI="http://www.catb.org/~esr/terminfo/termtypes.tc.gz
+ mirror://gentoo/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2 BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ppc sparc x86"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${A}
+
+ EPATCH_SOURCE="${WORKDIR}/patch"
+ EPATCH_SUFFIX="patch"
+
+ cd "${WORKDIR}"
+ mv termtypes.tc termcap || die
+ epatch "${EPATCH_SOURCE}"/tc.file
+
+ cd "${S}"
+ epatch "${EPATCH_SOURCE}"
+}
+
+src_compile() {
+ emake prefix="/" CFLAGS="${CFLAGS} -I." || die
+}
+
+src_install() {
+ dodir /lib /include
+ emake prefix="${D}" OWNER="root:root" install || die
+ dodoc ChangeLog README
+
+ insinto /etc
+ doins "${WORKDIR}"/termcap
+
+ # now punt everything used for compiling
+ cd "${D}"
+ rm -r include || die
+
+ if [[ $(get_libdir) != "lib" ]] ; then
+ mv lib $(get_libdir) || die
+ fi
+ dosym libtermcap.so.${PV} /$(get_libdir)/libtermcap.so.2
+ cd $(get_libdir)
+ rm -f libtermcap.{a,so}
+}
diff --git a/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r3.ebuild b/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r3.ebuild
new file mode 100644
index 000000000000..8b6922348686
--- /dev/null
+++ b/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# we only want this for binary-only packages, so we will only be installing
+# the lib used at runtime; no headers and no files to link against
+
+EAPI="4"
+
+inherit eutils multilib toolchain-funcs
+
+PATCHVER="2"
+
+MY_P="termcap-${PV}"
+DESCRIPTION="Compatibility package for old termcap-based programs"
+HOMEPAGE="http://www.catb.org/~esr/terminfo/"
+SRC_URI="http://www.catb.org/~esr/terminfo/termtypes.tc.gz
+ mirror://gentoo/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2 BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ppc sparc x86"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ EPATCH_SOURCE="${WORKDIR}/patch"
+ EPATCH_SUFFIX="patch"
+ epatch "${EPATCH_SOURCE}"
+
+ cd "${WORKDIR}"
+ mv termtypes.tc termcap || die
+ epatch "${EPATCH_SOURCE}"/tc.file
+}
+
+src_configure() {
+ tc-export CC
+}
+
+src_install() {
+ dolib.so libtermcap.so.${PV}
+ dosym libtermcap.so.${PV} /usr/$(get_libdir)/libtermcap.so.2
+
+ insinto /etc
+ doins "${WORKDIR}"/termcap
+
+ dodoc ChangeLog README
+}
diff --git a/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r4.ebuild b/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r4.ebuild
new file mode 100644
index 000000000000..422d2e748b9c
--- /dev/null
+++ b/sys-libs/libtermcap-compat/libtermcap-compat-2.0.8-r4.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# we only want this for binary-only packages, so we will only be installing
+# the lib used at runtime; no headers and no files to link against
+
+EAPI="5"
+
+inherit eutils multilib toolchain-funcs multilib-minimal
+
+PATCHVER="2"
+
+MY_P="termcap-${PV}"
+DESCRIPTION="Compatibility package for old termcap-based programs"
+HOMEPAGE="http://www.catb.org/~esr/terminfo/"
+SRC_URI="http://www.catb.org/~esr/terminfo/termtypes.tc.gz
+ mirror://gentoo/${MY_P}.tar.bz2
+ mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2 BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ EPATCH_SOURCE="${WORKDIR}/patch"
+ EPATCH_SUFFIX="patch"
+ epatch "${EPATCH_SOURCE}"
+
+ cd "${WORKDIR}"
+ mv termtypes.tc termcap || die
+ epatch "${EPATCH_SOURCE}"/tc.file
+
+ multilib_copy_sources
+}
+
+src_configure() {
+ tc-export CC
+}
+
+multilib_src_install() {
+ dolib.so libtermcap.so.${PV}
+ dosym libtermcap.so.${PV} /usr/$(get_libdir)/libtermcap.so.2
+}
+
+multilib_src_install_all() {
+ insinto /etc
+ doins "${WORKDIR}"/termcap
+
+ dodoc ChangeLog README
+}
diff --git a/sys-libs/libtermcap-compat/metadata.xml b/sys-libs/libtermcap-compat/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-libs/libtermcap-compat/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libudev-compat/Manifest b/sys-libs/libudev-compat/Manifest
new file mode 100644
index 000000000000..79c9a6efdc54
--- /dev/null
+++ b/sys-libs/libudev-compat/Manifest
@@ -0,0 +1,4 @@
+AUX udev_old.c 895 SHA256 f550e51ace2be9a2470dc6479920b4b0a9062876df5ce88b32b4517e1e6895b8 SHA512 4eafd908621857d0f4b415b7349d8ab992f40e5c2297270973462bd022b1b3e34cb365d4969e2f7801ad41c303f55649ea7bcfe9d8a32c997dd681bdc41a0237 WHIRLPOOL b6caa2b4731b701328d72d55b1ffc92ac7aca4d819efa7efa58be2007c38470188755eaa7ec4323a81faf4382bd4a9410d3510ce3aac47480d1093b7e76c5236
+EBUILD libudev-compat-186.ebuild 1000 SHA256 6aced8088f8c7a45c7becfd6d683c33271b2b9bed0264059718783706ecda2c5 SHA512 55123134505ecc5d35558fbcc56ce00a4c95897335b1cb52b4a2951e898474ed62431449acd47bc66d88a4509b2cd1cd844f7e12635246337032c321515c8ec7 WHIRLPOOL efb7906ef2b2e6ef1f138fd27f2de4ca055f7418f927f54108be2dc0aa267e601ba0b0e40899d1110f8577a0af21381d3a2f7b3aa2b43a0eb059a1d0e8524f71
+MISC ChangeLog 809 SHA256 b917da29e6c0f4d154116f8ce94f1254e871b83e84af9e26a246c3d3c7b2dd76 SHA512 04271c8d604bd4ba20b6954b0f311fe8919842208db96d07fb93085c19322142fbb94fbad52a19cb897a55c75bc9b9779f6381c22a3d130084e8c7878e29e063 WHIRLPOOL 7c333e26a8159e83c71d429a8b97627f2e14562bb441000a481022f533adf0b10343620bdd614b09e394e34386e64b36c71729dd6e7fcb457f54779df21c64c1
+MISC metadata.xml 249 SHA256 8534f4fc5fd50be364db0706c0b071b464a28fcff3aafab287c1380fa1c68fa5 SHA512 36526fd8f0e093e6b90968fb0f8baa7add223b6f351b1d9a9a41ef1ddbb13ba980826f3023f0677dcc5919c8183b4a679b9192f87f427e6d6de48eccbdc1e317 WHIRLPOOL 5acecd2084b13877891019c60ccc0267f90e1108730a3700e0e661cd8bdb2e756469fc72221725c8973d242ccd44a265cd27c668858d73dd19a990d79b50babd
diff --git a/sys-libs/libudev-compat/files/udev_old.c b/sys-libs/libudev-compat/files/udev_old.c
new file mode 100644
index 000000000000..584644ad0064
--- /dev/null
+++ b/sys-libs/libudev-compat/files/udev_old.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015 Jonathan Callen <jcallen@gentoo.org>
+ * Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ */
+
+#include <errno.h>
+#include <stddef.h>
+
+void *udev_monitor_new_from_socket(void *udev, const void *path) {
+ errno = ENOSYS;
+ return NULL;
+}
+
+void *udev_queue_get_failed_list_entry(void *udev_queue) {
+ errno = ENOSYS;
+ return NULL;
+}
+
+const char *udev_get_sys_path(void *udev) {
+ if (!udev) return NULL;
+ return "/sys";
+}
+
+const char *udev_get_dev_path(void *udev) {
+ if (!udev) return NULL;
+ return "/dev";
+}
+
+const char *udev_get_run_path(void *udev) {
+ if (!udev) return NULL;
+ return "/run/udev";
+}
diff --git a/sys-libs/libudev-compat/libudev-compat-186.ebuild b/sys-libs/libudev-compat/libudev-compat-186.ebuild
new file mode 100644
index 000000000000..d732f6780be5
--- /dev/null
+++ b/sys-libs/libudev-compat/libudev-compat-186.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib multilib-minimal toolchain-funcs
+
+DESCRIPTION="Wrapper around libudev.so.1 for packages needing the old libudev.so.0"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="virtual/libudev:0/1[${MULTILIB_USEDEP}]"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ mkdir "${S}" || die
+ cp "${FILESDIR}"/udev_old.c "${S}" || die
+}
+
+multilib_src_configure() { :; }
+
+echo_and_run() {
+ echo "$@"
+ "$@"
+}
+
+multilib_src_compile() {
+ # Note: --no-as-needed is used explictly here to ensure that libudev.so.1
+ # is pulled in, even though nothing in udev_old.c otherwise requires it
+ echo_and_run $(tc-getCC) \
+ ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} \
+ -fpic -shared \
+ -Wl,-soname,libudev.so.0 \
+ -o libudev.so.0 \
+ "${S}"/udev_old.c \
+ -Wl,--no-as-needed \
+ -ludev || die
+}
+
+multilib_src_install() {
+ dolib.so libudev.so.0
+}
diff --git a/sys-libs/libudev-compat/metadata.xml b/sys-libs/libudev-compat/metadata.xml
new file mode 100644
index 000000000000..2be6412c0184
--- /dev/null
+++ b/sys-libs/libudev-compat/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 type="person">
+ <email>jcallen@gentoo.org</email>
+ <name>Jonathan Callen</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libunwind/Manifest b/sys-libs/libunwind/Manifest
new file mode 100644
index 000000000000..92b365321a42
--- /dev/null
+++ b/sys-libs/libunwind/Manifest
@@ -0,0 +1,15 @@
+AUX libunwind-1.1-fix-CVE-2015-3239.patch 523 SHA256 3d37676dfaf88e267fd2e0422db93b9613f91af40fc5f4189806a64a23b07de9 SHA512 71f28720486c07cbbc31cf2747096e324cc43dd57c4ec9312da12fd4aa9d5af83e4cbe80071b6192cdf14a2e2afd090c136e57476ac981204a933db67d609c01 WHIRLPOOL 5c2b15253ca2ef597ebf6a6ae1b26c5728ce50dd5468c6115546b0af83e19b73c5becf3d1885b275e7619318f279dbb0eab531905b64c3bc87c8fb2cdd1fc31b
+AUX libunwind-1.1-lzma.patch 3004 SHA256 84716d048c507862761f4889871ab6428f9ca5818baeb3bddbc5612d5ff3ef15 SHA512 d15f849d743426fd030de2990d683a5373273ecfc407b081280e7f5fb2e65350496badb7b094911719e5b3f6bdac5ddf2653e556391c58a8559938a11f60250c WHIRLPOOL 3d56eed2a93fa373516d923bf0c491c68c464e62c0302ba0bc995d2491b27b01b109dd750bc47079f66c163c5f1a1a5d13c541709c0090ff78926bcdc98da992
+AUX libunwind-1.2-coredump-regs.patch 619 SHA256 81383383135b5f12aab63d62fa54c18bf13fe659e1a5a8a5ae35dba95b72c755 SHA512 48536ef54590221b42a3ca568ec781e526807b3d8aed3e33e19e6efacfa05a428a6101d3a51e79ea5d3e1d783bcba9acb92f7623c121d3e00cd3e1a17d13e282 WHIRLPOOL caa4a9a7b9fa1ee2aede2e2af5010472a459076d093191994496afd0beb7446b18e619041594cce346e03313808413fead02a0f4e65ef91da5a66d38f51e2e0a
+AUX libunwind-1.2-ia64-missing.patch 3863 SHA256 e5163247366ca68c5e2671208f2a848e1e25c23d1e56099ddabe0b65d36c538e SHA512 e8f65d706839770d993f9801371e1e294a0231c4bfe29b497e4a859567b7f5b6561b0a15d59b1626311e549fe57149046f5a76424a2ad69c521610aaa3019c17 WHIRLPOOL 10304bd170ce4e23bf82ca656ab460ff1d7ba0414b103329916afb6eea238155e001b70d83c4a138e950b095b5d259e966c00733c8f750e6e748a5fd577b11f9
+AUX libunwind-1.2-ia64-ptrace-coredump.patch 1445 SHA256 003e6a4724cb2ffb25bd5f18666e0b5866d5f701ca26275a8a1c90617ae79e73 SHA512 0bab310ff16294d7617077ffa1261fe9c1a6aaeb4339c96918869c4dd9a2b1b73fbe2ebb5c895f1a420ff7922da85cbb44ccfcd69df6e2518c1f2ff64b7b2d76 WHIRLPOOL 56878f6eed550b99dac1104d7a227d3954d57ad3e374bdee8049599035cd508945df2ec98c51376e9f0b719dc30b76295087df208609e5d0494e4215f918b106
+AUX libunwind-1.2-ia64-undwarf.patch 581 SHA256 24dc59a2e18c8638430cb492e2c0655a1b4f9a5e14166fc89be403878913ea28 SHA512 a83dd2d2bea706fb0f57b854015c6f1db882d649e931e12bb1a5524c8176e326d7d4a448f986c9475d1bd4c6e22a0e9a1c813c7a5b47fcd61457806c1f32fe85 WHIRLPOOL 2e0b3fb09b96312ad492d62cc7ce00ab5277bca810725e45f71a77a441acc46f6fe7719bc8a9809999a0f2b44323f56ccd4d3d105419e243f24359945f89bda7
+DIST libunwind-1.1.tar.gz 1098603 SHA256 9dfe0fcae2a866de9d3942c66995e4b460230446887dbdab302d41a8aee8d09a SHA512 bfe04f2bfac9f9e47c37f0b23ed2f264d8d3d3d6f1392fe9d794ee13cad216b3740979e922e4276fb65c1ccdc836fce48812cb5459ecdd2a89a621036a35d7c1 WHIRLPOOL 1a0e566edf92c0563cb5525203f2718c3454bc0be25ec8079cde8441de08b6d8951db7cbf2f0a02a4a0f1e6c350e74e551a482d9094996daefa216a79bc9d383
+DIST libunwind-1.2.1.tar.gz 780774 SHA256 3f3ecb90e28cbe53fba7a4a27ccce7aad188d3210bb1964a923a731a27a75acb SHA512 af7c280d2a963779a4a2711887618bc96383011e4e5d52e4085aa7fb351e55e357468f6ff85e66a216f1c6826538f498335a917a5970575c93be74c96316319b WHIRLPOOL 68cd0bd09b08000b11edb0912ccb7b6b17c8a4ac73fa3c409f17eb9581ac29e7ca015a37cb13a9741725e89caba58d91fa4f5cd18995449593188aedccbddc25
+DIST libunwind-1.2.tar.gz 747369 SHA256 1de38ffbdc88bd694d10081865871cd2bfbb02ad8ef9e1606aee18d65532b992 SHA512 985d0817944e3cafd99aaa5642862d878972e0851f7954289247e808c9319f399ca29342395f0571cb6568a1104a82bd92d585936f2ca888dda37ac796fde0d4 WHIRLPOOL d110ab7243157a617c1a9f01a5e7941cd4a63032317a7a6d372dd656aad9c1b49769909b3f37ff7dbbdb82a21f2d25dc00548cb5cac4d89c2b825b1e5e5fa634
+EBUILD libunwind-1.1-r1.ebuild 2444 SHA256 ec4fdc08f6f53dce5dc6c90afdb7318972cf1aa47db5c2203d896b67308de078 SHA512 d6c4099defbbe27c2a0c7df12299a21be655345b6480a61d3a67dea4dd3f732088b734f28eba4a5ee43ac7323ca6cef45fdba05e9c79d2d8e8b41ef5667299eb WHIRLPOOL 7181963d52710f9e4213874344f35e21f2113d1cd959292098281277c9f1339e0423e6e1bbd64ed66f102d0bd68a4cdd51f38bc23a5c5ee49cea724d98903045
+EBUILD libunwind-1.2.1.ebuild 2981 SHA256 628755816e805b5f3edbe66172b1b9bcaadc0a835867f471bf76a7a7b673c388 SHA512 85902b3910fbb16a518fab6ad93a163b2f8693f5280f7729bb685d53e7b15b9a366e77b7821cc23a94cad6fea5f496da310d6b5f7acc234fbb242fc2d6e96f47 WHIRLPOOL cda23fdd3a1ba59c204f4a9cbc90d7101c97f2ef6b35dd6759201e77d32d3bc5a25c257c7a0d48c469bd6f642604421be9686b53af44b92ec05ec490267e5d15
+EBUILD libunwind-1.2.ebuild 3178 SHA256 0d87457df73bb415da671922d85a06e76773a4709dc3960f012fabd4ef3c46f3 SHA512 8c2cf271f613eb43552631444d262ed3bc163d943d9913fb2c130ef2ef2c45012059ff8db0a1564ba40f50408f7c97e5004c69f9625a60f07bd9ff835aaa2bd6 WHIRLPOOL ece5ec06972421f95c39dac4f97e724e68272ae5c6d754ebe7a6e59a9a4018711f4095357b22b4751d6aee48de9ef95976fbc3d9cf8e08659c17a61a0849d177
+MISC ChangeLog 6364 SHA256 cfdfcb71b6f9c7e74e972401a53343e62bdb9c32a5f4958a3033e943d9009454 SHA512 6c697712de3611c72b4f1ed067408330349ce4c079b556b1d4d3bb29b165647350057aabedd0196629ebfbc7f943f3a660380838c900a43fb3188b10632f242b WHIRLPOOL 41907c911741205ea9e6b20090287ac3e5836686232ec554d31cd6a67d273465e1ec550b1f2a426ba73ce059eea39f9d55a4b668af22bdbea2ac7b27dc3e03cb
+MISC ChangeLog-2015 5849 SHA256 4cadfc068be0783f052df0873eaa0173dbacb45cbc30fc6074f5ac8af84ba028 SHA512 747ecf107b7d043e535fd4c70e4b76b4ad5e8179e25bc7f0afb9276627b804ba871a311c5f7d0612cc7a8fff86bc34da7ce9663136ccfdacda14a458d174cebb WHIRLPOOL b65f5e6cd656b950a0db442ab0beb55f48bb6da7dc76f9e37084e2d6479501b9b85ed4c56e1150f21ecf4f722837bca5850963662c2d9bcdddaec053d6dc603e
+MISC metadata.xml 489 SHA256 e9634971ffc782bc0996a6a2433b586950ac81f33823251aadbe43ccd8c1a3b0 SHA512 d7586420e24a7b841cb090ce8dc7bb1c1260a3e2afbc6606d0a974243ca20c0586b4aa3e770b5b98787f8d34b8255846d87550c16f68da6e9d3f55f8b57bde40 WHIRLPOOL 74078c66b9b85d6e3c36c21ee5d1c0cdc9fb0d5bbacd31e771a972b8c15af7fce1d9f6872ff2230f8ebf6e7ce5833361b130dc7d6f7df6aa3770eb686ab09fc8
diff --git a/sys-libs/libunwind/files/libunwind-1.1-fix-CVE-2015-3239.patch b/sys-libs/libunwind/files/libunwind-1.1-fix-CVE-2015-3239.patch
new file mode 100644
index 000000000000..153108bbb151
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.1-fix-CVE-2015-3239.patch
@@ -0,0 +1,15 @@
+taken from Fedora
+
+https://bugs.gentoo.org/585830
+
+--- libunwind-1.1/include/dwarf_i.h.CVE20153239
++++ libunwind-1.1/include/dwarf_i.h
+@@ -20,7 +20,7 @@
+ extern const uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH];
+ /* REG is evaluated multiple times; it better be side-effects free! */
+ # define dwarf_to_unw_regnum(reg) \
+- (((reg) <= DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
++ (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
+ #endif
+
+ #ifdef UNW_LOCAL_ONLY
diff --git a/sys-libs/libunwind/files/libunwind-1.1-lzma.patch b/sys-libs/libunwind/files/libunwind-1.1-lzma.patch
new file mode 100644
index 000000000000..09cefa028539
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.1-lzma.patch
@@ -0,0 +1,63 @@
+From 38c349bb000b427c376e756e3ecdb764a2b4d297 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 15 Feb 2014 21:00:59 -0500
+Subject: [PATCH] link sublibs against liblzma as needed
+
+The coredump/elf32/elf64/elfxx libs use lzma funcs but don't link against
+it. This produces sub-shared libs that don't link against lzma and can
+make the linker angry due to underlinking like so:
+
+libtool: link: x86_64-pc-linux-gnu-gcc -O2 -march=amdfam10 -pipe -g \
+ -frecord-gcc-switches -Wimplicit-function-declaration -fexceptions \
+ -Wall -Wsign-compare -Wl,-O1 -Wl,--hash-style=gnu \
+ -o .libs/test-coredump-unwind test-coredump-unwind.o \
+ ../src/.libs/libunwind-coredump.so ../src/.libs/libunwind-x86_64.so
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_stream_footer_decode'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_buffer_decode'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_size'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_end'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_index_uncompressed_size'
+../src/.libs/libunwind-coredump.so: error: undefined reference to 'lzma_stream_buffer_decode'
+collect2: error: ld returned 1 exit status
+
+So add LIBLZMA to the right LIBADD for each of these libraries.
+
+URL: https://bugs.gentoo.org/444050
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ src/Makefile.am | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -169,7 +169,7 @@ libunwind_arm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libunwind_arm_la_LDFLAGS) $(LDFLAGS) -o $@
+ @ARCH_ARM_TRUE@am_libunwind_arm_la_rpath = -rpath $(libdir)
+-libunwind_coredump_la_LIBADD =
++libunwind_coredump_la_LIBADD = $(LIBLZMA)
+ am__libunwind_coredump_la_SOURCES_DIST = coredump/_UCD_accessors.c \
+ coredump/_UCD_create.c coredump/_UCD_destroy.c \
+ coredump/_UCD_access_mem.c coredump/_UCD_elf_map_image.c \
+@@ -214,15 +214,15 @@ am_libunwind_dwarf_local_la_OBJECTS = dwarf/Lexpr.lo dwarf/Lfde.lo \
+ libunwind_dwarf_local_la_OBJECTS = \
+ $(am_libunwind_dwarf_local_la_OBJECTS)
+ @REMOTE_ONLY_FALSE@@USE_DWARF_TRUE@am_libunwind_dwarf_local_la_rpath =
+-libunwind_elf32_la_LIBADD =
++libunwind_elf32_la_LIBADD = $(LIBLZMA)
+ am_libunwind_elf32_la_OBJECTS = elf32.lo
+ libunwind_elf32_la_OBJECTS = $(am_libunwind_elf32_la_OBJECTS)
+ @USE_ELF32_TRUE@am_libunwind_elf32_la_rpath =
+-libunwind_elf64_la_LIBADD =
++libunwind_elf64_la_LIBADD = $(LIBLZMA)
+ am_libunwind_elf64_la_OBJECTS = elf64.lo
+ libunwind_elf64_la_OBJECTS = $(am_libunwind_elf64_la_OBJECTS)
+ @USE_ELF64_TRUE@am_libunwind_elf64_la_rpath =
+-libunwind_elfxx_la_LIBADD =
++libunwind_elfxx_la_LIBADD = $(LIBLZMA)
+ am_libunwind_elfxx_la_OBJECTS = elfxx.lo
+ libunwind_elfxx_la_OBJECTS = $(am_libunwind_elfxx_la_OBJECTS)
+ @USE_ELFXX_TRUE@am_libunwind_elfxx_la_rpath =
+--
+1.8.5.5
+
diff --git a/sys-libs/libunwind/files/libunwind-1.2-coredump-regs.patch b/sys-libs/libunwind/files/libunwind-1.2-coredump-regs.patch
new file mode 100644
index 000000000000..3ddc610d4afc
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.2-coredump-regs.patch
@@ -0,0 +1,16 @@
+https://bugs.gentoo.org/586092
+
+this might not be correct, but at least it builds, and doesn't crash
+
+--- a/src/coredump/_UCD_access_reg_linux.c
++++ b/src/coredump/_UCD_access_reg_linux.c
+@@ -51,6 +51,9 @@ _UCD_access_reg (unw_addr_space_t as,
+ #elif defined(UNW_TARGET_TILEGX)
+ if (regnum < 0 || regnum > UNW_TILEGX_CFA)
+ goto badreg;
++#elif defined(UNW_TARGET_IA64) || defined(UNW_TARGET_HPPA) || defined(UNW_TARGET_PPC32) || defined(UNW_TARGET_PPC64)
++ if (regnum < 0 || regnum >= ARRAY_SIZE(ui->prstatus->pr_reg))
++ goto badreg;
+ #else
+ #if defined(UNW_TARGET_MIPS)
+ static const uint8_t remap_regs[] =
diff --git a/sys-libs/libunwind/files/libunwind-1.2-ia64-missing.patch b/sys-libs/libunwind/files/libunwind-1.2-ia64-missing.patch
new file mode 100644
index 000000000000..e15250b4c61f
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.2-ia64-missing.patch
@@ -0,0 +1,93 @@
+Original libunwind release is missing a few ia64-specific files in tarball.
+diff --git a/src/ia64/mk_Gcursor_i.c b/src/ia64/mk_Gcursor_i.c
+new file mode 100644
+index 0000000..67b14d5
+--- /dev/null
++++ b/src/ia64/mk_Gcursor_i.c
+@@ -0,0 +1,65 @@
++/* libunwind - a platform-independent unwind library
++ Copyright (C) 2003 Hewlett-Packard Co
++ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
++
++/* Utility to generate cursor_i.h. */
++
++#include "libunwind_i.h"
++
++#ifdef offsetof
++# undef offsetof
++#endif
++
++#define offsetof(type,field) ((char *) &((type *) 0)->field - (char *) 0)
++
++#define OFFSET(sym, offset) \
++ asm volatile("\n->" #sym " %0" : : "i" (offset))
++
++int
++main (void)
++{
++ OFFSET("IP_OFF", offsetof (struct cursor, ip));
++ OFFSET("PR_OFF", offsetof (struct cursor, pr));
++ OFFSET("BSP_OFF", offsetof (struct cursor, bsp));
++ OFFSET("PSP_OFF", offsetof (struct cursor, psp));
++ OFFSET("PFS_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_PFS]));
++ OFFSET("RNAT_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_RNAT]));
++ OFFSET("UNAT_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_UNAT]));
++ OFFSET("LC_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_LC]));
++ OFFSET("FPSR_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_FPSR]));
++ OFFSET("B1_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B1]));
++ OFFSET("B2_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B2]));
++ OFFSET("B3_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B3]));
++ OFFSET("B4_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B4]));
++ OFFSET("B5_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B5]));
++ OFFSET("F2_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F2]));
++ OFFSET("F3_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F3]));
++ OFFSET("F4_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F4]));
++ OFFSET("F5_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F5]));
++ OFFSET("FR_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F16]));
++ OFFSET("LOC_SIZE",
++ (offsetof (struct cursor, loc[1]) - offsetof (struct cursor, loc[0])));
++ OFFSET("SIGCONTEXT_ADDR_OFF", offsetof (struct cursor, sigcontext_addr));
++ return 0;
++}
+diff --git a/src/ia64/mk_Lcursor_i.c b/src/ia64/mk_Lcursor_i.c
+new file mode 100644
+index 0000000..aee2e7e
+--- /dev/null
++++ b/src/ia64/mk_Lcursor_i.c
+@@ -0,0 +1,2 @@
++#define UNW_LOCAL_ONLY
++#include "mk_Gcursor_i.c"
+diff --git a/src/ia64/mk_cursor_i b/src/ia64/mk_cursor_i
+new file mode 100755
+index 0000000..9211f91
+--- /dev/null
++++ b/src/ia64/mk_cursor_i
+@@ -0,0 +1,7 @@
++#!/bin/sh
++test -z "$1" && exit 1
++echo "/* GENERATED */"
++echo "#ifndef cursor_i_h"
++echo "#define cursor_i_h"
++sed -ne 's/^->"\(\S*\)" \(\d*\)/#define \1 \2/p' < $1 || exit $?
++echo "#endif"
diff --git a/sys-libs/libunwind/files/libunwind-1.2-ia64-ptrace-coredump.patch b/sys-libs/libunwind/files/libunwind-1.2-ia64-ptrace-coredump.patch
new file mode 100644
index 000000000000..3785d8820cd9
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.2-ia64-ptrace-coredump.patch
@@ -0,0 +1,34 @@
+Fix build failure on ia64.
+ coredump/_UPT_get_dyn_info_list_addr.c
+is almost identical to
+ ptrace/_UPT_get_dyn_info_list_addr.c
+It's clearly an __ia64 implementation copy.
+diff --git a/src/coredump/_UPT_get_dyn_info_list_addr.c b/src/coredump/_UPT_get_dyn_info_list_addr.c
+index 0d11905..176b146 100644
+--- a/src/coredump/_UPT_get_dyn_info_list_addr.c
++++ b/src/coredump/_UPT_get_dyn_info_list_addr.c
+@@ -31,2 +31,3 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+ # include "os-linux.h"
++# include "../ptrace/_UPT_internal.h"
+
+@@ -40,3 +41,2 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
+ char path[PATH_MAX];
+- unw_dyn_info_t *di;
+ unw_word_t res;
+@@ -50,5 +50,5 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
+
+- invalidate_edi (&ui->edi);
++ invalidate_edi(&ui->edi);
+
+- if (elf_map_image (&ui->ei, path) < 0)
++ if (elf_map_image (&ui->edi.ei, path) < 0)
+ /* ignore unmappable stuff like "/SYSV00001b58 (deleted)" */
+@@ -58,6 +58,5 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
+
+- di = tdep_find_unwind_table (&ui->edi, as, path, lo, off);
+- if (di)
++ if (tdep_find_unwind_table (&ui->edi, as, path, lo, off, 0) > 0)
+ {
+- res = _Uia64_find_dyn_list (as, di, arg);
++ res = _Uia64_find_dyn_list (as, &ui->edi.di_cache, arg);
+ if (res && count++ == 0)
diff --git a/sys-libs/libunwind/files/libunwind-1.2-ia64-undwarf.patch b/sys-libs/libunwind/files/libunwind-1.2-ia64-undwarf.patch
new file mode 100644
index 000000000000..1e3e2489828e
--- /dev/null
+++ b/sys-libs/libunwind/files/libunwind-1.2-ia64-undwarf.patch
@@ -0,0 +1,17 @@
+diff --git a/src/mi/Gget_proc_name.c b/src/mi/Gget_proc_name.c
+index 5376f82..64d2503 100644
+--- a/src/mi/Gget_proc_name.c
++++ b/src/mi/Gget_proc_name.c
+@@ -106,8 +106,12 @@ unw_get_proc_name (unw_cursor_t *cursor, char *buf, size_t buf_len,
+ ip = tdep_get_ip (c);
++#if !defined(__ia64)
+ if (c->dwarf.use_prev_instr)
+ --ip;
++#endif
+ error = get_proc_name (tdep_get_as (c), ip, buf, buf_len, offp,
+ tdep_get_as_arg (c));
++#if !defined(__ia64)
+ if (c->dwarf.use_prev_instr && offp != NULL && error == 0)
+ *offp += 1;
++#endif
+ return error;
diff --git a/sys-libs/libunwind/libunwind-1.1-r1.ebuild b/sys-libs/libunwind/libunwind-1.1-r1.ebuild
new file mode 100644
index 000000000000..466898099cff
--- /dev/null
+++ b/sys-libs/libunwind/libunwind-1.1-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils libtool
+
+DESCRIPTION="Portable and efficient API to determine the call-chain of a program"
+HOMEPAGE="https://savannah.nongnu.org/projects/libunwind"
+SRC_URI="mirror://nongnu/libunwind/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="7"
+KEYWORDS="amd64 arm hppa ia64 ~mips ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="debug debug-frame libatomic lzma +static-libs"
+
+RESTRICT="test" #461958 -- re-enable tests with >1.1 again for retesting, this is here for #461394
+
+# We just use the header from libatomic.
+RDEPEND="lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ libatomic? ( dev-libs/libatomic_ops )"
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+QA_DT_NEEDED_x86_fbsd="usr/lib/libunwind.so.7.0.0"
+
+src_prepare() {
+ # These tests like to fail. bleh.
+ echo 'int main(){return 0;}' > tests/Gtest-dyn1.c
+ echo 'int main(){return 0;}' > tests/Ltest-dyn1.c
+
+ # Since we have tests disabled via RESTRICT, disable building in the subdir
+ # entirely. This worksaround some build errors too. #484846
+ sed -i -e '/^SUBDIRS/s:tests::' Makefile.in || die
+
+ sed -i -e '/LIBLZMA/s:-lzma:-llzma:' configure{.ac,} || die #444050
+ epatch "${FILESDIR}"/${P}-lzma.patch #444050
+ epatch "${FILESDIR}"/${P}-fix-CVE-2015-3239.patch #585830
+ elibtoolize
+}
+
+src_configure() {
+ # https://savannah.nongnu.org/bugs/index.php?34324
+ # --enable-cxx-exceptions: always enable it, headers provide the interface
+ # and on some archs it is disabled by default causing a mismatch between the
+ # API and the ABI, bug #418253
+ # conservative-checks: validate memory addresses before use; as of 1.0.1,
+ # only x86_64 supports this, yet may be useful for debugging, couple it with
+ # debug useflag.
+ ac_cv_header_atomic_ops_h=$(usex libatomic) \
+ econf \
+ --enable-cxx-exceptions \
+ $(use_enable debug-frame) \
+ $(use_enable lzma minidebuginfo) \
+ $(use_enable static-libs static) \
+ $(use_enable debug conservative_checks) \
+ $(use_enable debug)
+}
+
+src_test() {
+ # Explicitly allow parallel build of tests.
+ # Sandbox causes some tests to freak out.
+ SANDBOX_ON=0 emake check
+}
+
+src_install() {
+ default
+ # libunwind-ptrace.a (and libunwind-ptrace.h) is separate API and without
+ # shared library, so we keep it in any case
+ use static-libs || find "${ED}"usr '(' -name 'libunwind-generic.a' -o -name 'libunwind*.la' ')' -delete
+}
diff --git a/sys-libs/libunwind/libunwind-1.2.1.ebuild b/sys-libs/libunwind/libunwind-1.2.1.ebuild
new file mode 100644
index 000000000000..7b3677c4a1a2
--- /dev/null
+++ b/sys-libs/libunwind/libunwind-1.2.1.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+inherit eutils libtool multilib-minimal
+
+DESCRIPTION="Portable and efficient API to determine the call-chain of a program"
+HOMEPAGE="https://savannah.nongnu.org/projects/libunwind"
+SRC_URI="mirror://nongnu/libunwind/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="7"
+KEYWORDS="amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="debug debug-frame doc libatomic lzma +static-libs"
+
+RESTRICT="test" # half of tests are broken (toolchain version dependent)
+
+# We just use the header from libatomic.
+RDEPEND="lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ libatomic? ( dev-libs/libatomic_ops )"
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/libunwind.h
+
+ # see libunwind.h for the full list of arch-specific headers
+ /usr/include/libunwind-aarch64.h
+ /usr/include/libunwind-arm.h
+ /usr/include/libunwind-hppa.h
+ /usr/include/libunwind-ia64.h
+ /usr/include/libunwind-mips.h
+ /usr/include/libunwind-ppc32.h
+ /usr/include/libunwind-ppc64.h
+ /usr/include/libunwind-sh.h
+ /usr/include/libunwind-tilegx.h
+ /usr/include/libunwind-x86.h
+ /usr/include/libunwind-x86_64.h
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.2-coredump-regs.patch #586092
+ "${FILESDIR}"/${PN}-1.2-ia64-undwarf.patch
+ "${FILESDIR}"/${PN}-1.2-ia64-ptrace-coredump.patch
+ "${FILESDIR}"/${PN}-1.2-ia64-missing.patch
+)
+
+src_prepare() {
+ default
+ chmod +x src/ia64/mk_cursor_i || die
+ # Since we have tests disabled via RESTRICT, disable building in the subdir
+ # entirely. This worksaround some build errors too. #484846
+ sed -i -e '/^SUBDIRS/s:tests::' Makefile.in || die
+
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # --enable-cxx-exceptions: always enable it, headers provide the interface
+ # and on some archs it is disabled by default causing a mismatch between the
+ # API and the ABI, bug #418253
+ # conservative-checks: validate memory addresses before use; as of 1.0.1,
+ # only x86_64 supports this, yet may be useful for debugging, couple it with
+ # debug useflag.
+ ECONF_SOURCE="${S}" \
+ ac_cv_header_atomic_ops_h=$(usex libatomic) \
+ econf \
+ --enable-cxx-exceptions \
+ --enable-coredump \
+ --enable-ptrace \
+ --enable-setjmp \
+ $(use_enable debug-frame) \
+ $(use_enable doc documentation) \
+ $(use_enable lzma minidebuginfo) \
+ $(use_enable static-libs static) \
+ $(use_enable debug conservative_checks) \
+ $(use_enable debug)
+}
+
+multilib_src_compile() {
+ # Bug 586208
+ CCACHE_NODIRECT=1 default
+}
+
+multilib_src_test() {
+ # Explicitly allow parallel build of tests.
+ # Sandbox causes some tests to freak out.
+ SANDBOX_ON=0 emake check
+}
+
+multilib_src_install() {
+ default
+ # libunwind-ptrace.a (and libunwind-ptrace.h) is separate API and without
+ # shared library, so we keep it in any case
+ use static-libs || find "${ED}"usr '(' -name 'libunwind-generic.a' -o -name 'libunwind*.la' ')' -delete
+}
diff --git a/sys-libs/libunwind/libunwind-1.2.ebuild b/sys-libs/libunwind/libunwind-1.2.ebuild
new file mode 100644
index 000000000000..8528582e02c7
--- /dev/null
+++ b/sys-libs/libunwind/libunwind-1.2.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+inherit eutils libtool multilib-minimal
+
+DESCRIPTION="Portable and efficient API to determine the call-chain of a program"
+HOMEPAGE="https://savannah.nongnu.org/projects/libunwind"
+SRC_URI="mirror://nongnu/libunwind/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="7"
+KEYWORDS="~amd64 ~arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="debug debug-frame doc libatomic lzma +static-libs"
+
+RESTRICT="test" #461958 -- re-enable tests with >1.1 again for retesting, this is here for #461394
+
+# We just use the header from libatomic.
+RDEPEND="lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ libatomic? ( dev-libs/libatomic_ops )"
+
+QA_DT_NEEDED_x86_fbsd="usr/lib/libunwind.so.7.0.0"
+
+# Bug 586208
+CCACHE_NODIRECT=1
+
+S="${WORKDIR}/${MY_P}"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/libunwind.h
+
+ # see libunwind.h for the full list of arch-specific headers
+ /usr/include/libunwind-aarch64.h
+ /usr/include/libunwind-arm.h
+ /usr/include/libunwind-hppa.h
+ /usr/include/libunwind-ia64.h
+ /usr/include/libunwind-mips.h
+ /usr/include/libunwind-ppc32.h
+ /usr/include/libunwind-ppc64.h
+ /usr/include/libunwind-sh.h
+ /usr/include/libunwind-tilegx.h
+ /usr/include/libunwind-x86.h
+ /usr/include/libunwind-x86_64.h
+)
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.2-coredump-regs.patch #586092
+ epatch "${FILESDIR}"/${PN}-1.2-ia64-undwarf.patch
+ epatch "${FILESDIR}"/${PN}-1.2-ia64-ptrace-coredump.patch
+ epatch -p1 "${FILESDIR}"/${PN}-1.2-ia64-missing.patch
+ chmod +x src/ia64/mk_cursor_i || die
+
+ # These tests like to fail. bleh.
+ echo 'int main(){return 0;}' > tests/Gtest-dyn1.c
+ echo 'int main(){return 0;}' > tests/Ltest-dyn1.c
+
+ # Since we have tests disabled via RESTRICT, disable building in the subdir
+ # entirely. This worksaround some build errors too. #484846
+ sed -i -e '/^SUBDIRS/s:tests::' Makefile.in || die
+
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # --enable-cxx-exceptions: always enable it, headers provide the interface
+ # and on some archs it is disabled by default causing a mismatch between the
+ # API and the ABI, bug #418253
+ # conservative-checks: validate memory addresses before use; as of 1.0.1,
+ # only x86_64 supports this, yet may be useful for debugging, couple it with
+ # debug useflag.
+ ECONF_SOURCE="${S}" \
+ ac_cv_header_atomic_ops_h=$(usex libatomic) \
+ econf \
+ --enable-cxx-exceptions \
+ --enable-coredump \
+ --enable-ptrace \
+ --enable-setjmp \
+ $(use_enable debug-frame) \
+ $(use_enable doc documentation) \
+ $(use_enable lzma minidebuginfo) \
+ $(use_enable static-libs static) \
+ $(use_enable debug conservative_checks) \
+ $(use_enable debug)
+}
+
+multilib_src_test() {
+ # Explicitly allow parallel build of tests.
+ # Sandbox causes some tests to freak out.
+ SANDBOX_ON=0 emake check
+}
+
+multilib_src_install() {
+ default
+ # libunwind-ptrace.a (and libunwind-ptrace.h) is separate API and without
+ # shared library, so we keep it in any case
+ use static-libs || find "${ED}"usr '(' -name 'libunwind-generic.a' -o -name 'libunwind*.la' ')' -delete
+}
diff --git a/sys-libs/libunwind/metadata.xml b/sys-libs/libunwind/metadata.xml
new file mode 100644
index 000000000000..95faca4e7634
--- /dev/null
+++ b/sys-libs/libunwind/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 type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <use>
+ <flag name="debug-frame">Adds support for DWARF .debug_frame section: Use the information from this section if available</flag>
+ <flag name="libatomic">Use libatomic instead of builtin atomic operations</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/libutempter/Manifest b/sys-libs/libutempter/Manifest
new file mode 100644
index 000000000000..b5e83902c962
--- /dev/null
+++ b/sys-libs/libutempter/Manifest
@@ -0,0 +1,5 @@
+DIST libutempter-1.1.6.tar.bz2 15705 SHA256 b898565f31ced7e5c1fa0a2eaa0f6ff0ed862b5fe375d26375b64bfbdfeac397 SHA512 6ada410b981d157ae20b578de8ce20997ec0446ec6de6859549b080aa65976fc9900d211600dab09dc3d0d109daabad0994a648b093b8781b442ff26ca17fede WHIRLPOOL c94d42d6929754608f9504defec3ab5b4c5c61fd0baa373e07508a11167241c07de4ecf26e14271e2c9914b731afba12ff7930e8ecd0126da1f472dccabdea30
+EBUILD libutempter-1.1.6-r2.ebuild 1739 SHA256 18528f4232c8ba72e23169121163e9096cce832e80dd74749f6cf0802fcc3a6c SHA512 fb296595516373403d65637b6162772b0ca9e211c26829603182415dd283671bfbc9c81983fd790d876244716217c80f950dab65417e125161985ffa55df34d6 WHIRLPOOL 0ebbfdec7a89626740255e872e4f98a76a2167a53a43583cecf9f6dfd02db4334b9814ef32fe8e0bd28877a53303ca1a9f3738a6e3b4d2604dfef8d553fc61c9
+MISC ChangeLog 3200 SHA256 6fb116509f3cb9faaae2f7c44a97cd68ec2025b65435303347c81e3b76436c62 SHA512 0751ef0a2de20b7c98093874e5f86d269ca6761324b3cda8d8e153f7c7ebab331cc7c1c34711fe1968f37f86cc9aa1f256051cba04f6673548ecfd23a9144496 WHIRLPOOL 2a7e0aceea4fe55630af016847c5b80da26cd7621d6c370ad7efd7d7c4403ce25d457c342b5c6565f64124f35bddf923c201698591fe7daa0b2612f0b3ea4f1b
+MISC ChangeLog-2015 7010 SHA256 b55d02cbd8c6d4d38914d9f065a8235c1ebac69ed8e73d5f416a08d02a07058f SHA512 45fab39dfd3e003a40351ce6d583eba0e9ab79188268639b78942de4c0a63244d2fecd68b78f62390853d4bbfdfb9ec00b01894939d5234ed86f4da5ef0e547c WHIRLPOOL 081f3d353fd0687d18681ba3f52f77489301d579442690bcbb411f1c18900cb8d988f174e2547b465c2e6efe4bbc120002b7befec7ca2c925375358734f79992
+MISC metadata.xml 344 SHA256 c1ff5b28d97a3d25b8bdd7bdf1f44d583b364107c662ae469624bfdca7aa8efd SHA512 77307533cb1ddb71561957493f7062330c1748f62ab1381f369c5fb864f0e2a6608cfa5c86005b816c2a9a2523bb9a2264c807f1d6c31a5e2bb6177876b94ed9 WHIRLPOOL 91066d3e43d3147d614f2b55a5af5bc346b05b6264d1bc806c8a927609d0b757c2b287643fa389505fd4c959d161a7a36919c7a038fd4e3617de84b07b67204e
diff --git a/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild b/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild
new file mode 100644
index 000000000000..f64862b3abc0
--- /dev/null
+++ b/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit user multilib flag-o-matic
+
+DESCRIPTION="Library that allows non-privileged apps to write utmp (login) info, which need root access"
+HOMEPAGE="http://altlinux.org/index.php?module=sisyphus&package=libutempter"
+SRC_URI="ftp://ftp.altlinux.org/pub/people/ldv/${PN}/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="static-libs elibc_FreeBSD"
+
+RDEPEND="!sys-apps/utempter"
+
+pkg_setup() {
+ enewgroup utmp 406
+}
+
+src_prepare() {
+ local args=(
+ -e "/^libdir /s:/usr/lib:${EPREFIX}/usr/$(get_libdir):"
+ -e '/^libexecdir /s:=.*:= $(libdir)/misc:'
+ -e '/^CFLAGS = $(RPM_OPT_FLAGS)/d'
+ -e 's:,-stats::'
+ -e "/^includedir /s:/usr/include:${EPREFIX}/usr/include:"
+ -e "/^mandir /s:=.*:= ${EPREFIX}/usr/share/man:"
+ )
+ use static-libs || args+=(
+ -e '/^STATICLIB/d'
+ -e '/INSTALL.*STATICLIB/d'
+ )
+ sed -i "${args[@]}" Makefile || die
+}
+
+src_configure() {
+ use elibc_FreeBSD && append-libs -lutil
+ tc-export AR CC
+}
+
+src_compile() {
+ emake LDLIBS="${LIBS}"
+}
+
+src_install() {
+ default
+
+ if ! use prefix ; then
+ fowners root:utmp /usr/$(get_libdir)/misc/utempter/utempter
+ fperms 2755 /usr/$(get_libdir)/misc/utempter/utempter
+ fi
+ dodir /usr/sbin
+ dosym ../$(get_libdir)/misc/utempter/utempter /usr/sbin/utempter
+}
+
+pkg_postinst() {
+ if [ -f "${EROOT}/var/log/wtmp" ] ; then
+ chown root:utmp "${EROOT}/var/log/wtmp"
+ chmod 664 "${EROOT}/var/log/wtmp"
+ fi
+
+ if [ -f "${EROOT}/var/run/utmp" ] ; then
+ chown root:utmp "${EROOT}/var/run/utmp"
+ chmod 664 "${EROOT}/var/run/utmp"
+ fi
+}
diff --git a/sys-libs/libutempter/metadata.xml b/sys-libs/libutempter/metadata.xml
new file mode 100644
index 000000000000..910808b6e1f8
--- /dev/null
+++ b/sys-libs/libutempter/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/libuuid/Manifest b/sys-libs/libuuid/Manifest
new file mode 100644
index 000000000000..714891c6fc2d
--- /dev/null
+++ b/sys-libs/libuuid/Manifest
@@ -0,0 +1,4 @@
+DIST libuuid-1.0.3.tar.gz 318256 SHA256 46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644 SHA512 77488caccc66503f6f2ded7bdfc4d3bc2c20b24a8dc95b2051633c695e99ec27876ffbafe38269b939826e1fdb06eea328f07b796c9e0aaca12331a787175507 WHIRLPOOL c89b7fd83830b93cbeaf40d2783f1e7074c6df41b9399ae184e78a9b84175b3cd5bd99079513a89c8d1046c1277d4312d8ce19c0fee9a6a09d822a380f2c4211
+EBUILD libuuid-1.0.3.ebuild 516 SHA256 db29bce21fdca4ef9e4b4004e12288595c13c6cb1d8d476ac0a4b7673373cdae SHA512 dbcdf6d96b4925cc025a391903b0e363e746b1d52c71fa2477ec31926d40ad712fe4ee8bf5e97da50af23eb85503aba61c769440b9665c95b18186bd77679857 WHIRLPOOL bbe8e05c91d966641289cad98fc294d13b2d3ccb483de9bd58ea95b4d6f6df80d06bb01c107b6a786285981d7279ffbb99cc0c5ccf9fc8bb177afa6c871a9a1f
+MISC ChangeLog 330 SHA256 bd9aff234f6c9be6b81417e16b39f5ac65b2dd3fd3f9f541084bcac608131571 SHA512 5e7f63670add4b8fd95fae5b20660acfbdb9fc183fa09c4ff0c9fe165501469a4d85a89f5ef54e44892073f5322358324cce938f1e4dc65581a0b90e1d18bb87 WHIRLPOOL 8aae54b0446bfd9be690e27645eae5586d92b595dacf7d94fe552a5032db712698e9e647ad11729679fcc67cd5b3dc020d8e5d7684fceaedceebe872421b0b5e
+MISC metadata.xml 508 SHA256 dd2af9195718ed17534c812008da0f7fb7408829372be86542aa370305da7f98 SHA512 228b4fdea521eebd03e869547ffde1156aabee76fdf08f034308109e9b4ea030d953fc8c8fccdc4121863a5660a5b24e0aa40b30fdef01477280cc8b7bec3361 WHIRLPOOL 23f7de1ef846762fd60540d75354d9934a25d1886435449d0c01cf7b2d66b5419f621c7d6cf863d066362ec9b54e81d63b51d988495035147f840f08644bd333
diff --git a/sys-libs/libuuid/libuuid-1.0.3.ebuild b/sys-libs/libuuid/libuuid-1.0.3.ebuild
new file mode 100644
index 000000000000..aad8ae81cd2a
--- /dev/null
+++ b/sys-libs/libuuid/libuuid-1.0.3.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit libtool
+
+DESCRIPTION="Portable uuid C library"
+HOMEPAGE="http://libuuid.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~x64-solaris ~x86-solaris"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ eapply_user
+ elibtoolize
+}
+
+src_configure() {
+ econf --disable-static
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/usr/lib/*.la || die
+}
diff --git a/sys-libs/libuuid/metadata.xml b/sys-libs/libuuid/metadata.xml
new file mode 100644
index 000000000000..5e0aa119415d
--- /dev/null
+++ b/sys-libs/libuuid/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 type="person">
+ <email>grobian@gentoo.org</email>
+ <name>Fabian Groffen</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>prefix@gentoo.org</email>
+ <name>Gentoo Prefix</name>
+ </maintainer>
+ <longdescription lang="en">
+ Portable uuid C library
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">libuuid</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libvpd/Manifest b/sys-libs/libvpd/Manifest
new file mode 100644
index 000000000000..85807a009549
--- /dev/null
+++ b/sys-libs/libvpd/Manifest
@@ -0,0 +1,9 @@
+DIST libvpd-2.1.3.tar.gz 116493 SHA256 18390b1c272c774b153615a84d4f4e683da08156daf5a0b001c3c07f54d422ae SHA512 f5aac9253752552674ac6c54dd3e6dbdd7ff79867740076d6e19782940b809e53736a11e668978d8d73bf636d92d1daeb78080e5fd31c4febc2257e5497c373c WHIRLPOOL a0f34265c865282a755092c854521d538bbb633b92ff8004a7b8f4949a91bfd924ca156edd4357f67fbf62c7456e0785887a6e62e67f385d348aae8836c4b199
+DIST libvpd-2.2.4.tar.gz 374665 SHA256 13a44a156cfe60b6ee7c1f4dc9171335657bfd5903c59a686abf1149b1b12c12 SHA512 89f7e235e957393fe33e484b23fce15fbf36274db6115e7245027a17b7535e387f835c048a7063f317f10de2351a78acf2ca72b10adee0020ce62a035bfe787e WHIRLPOOL e902455cd34262f581af2af160c9f16c542a63a5c58121116be2d6eb3bf58cc6ec2ee2074ad45959f7d0add9836129bba884d264e970ac9b62edb720f19157ec
+DIST libvpd-2.2.5.tar.gz 374311 SHA256 6ce194d2c929ca45b6640b858587580c5d158db52a85d59ba7bd846c4a4f3faf SHA512 06969e61d2882a30ebff13b6432397edb0119adc0b0f8ea603973c6ef439320c39c1cbc218fab154d595fadc966bfef07a4a9c4e4ec8fd772cf7d396000864b0 WHIRLPOOL 61137227612ebc71c76689bf444dae59e1c2b12a7e1a66aa940cf414f70fb22c81dbc46b438ca7462e48916ae66f53715d1a4dc338ea7db811b73992c4cf9f1d
+EBUILD libvpd-2.1.3.ebuild 624 SHA256 3431ec236e024330347c3380322a9b2ebe19560ca4ad19850e81d72a7e2733a7 SHA512 6cdc971a2aa280ce24825440c08c695282140983166767f27631bfc8f439400c1e51dbb7dc843be2690d0ed17744015c971e07442490cce657eb1bc3f98c2964 WHIRLPOOL 2192239b6dac1b2b60c4a179249f700ea846c6a4fa97b1450216c9d29f1a64d72184b628fa19fe36eb24a21baf2ca3ba3318c406113ed9e93c666581064ee075
+EBUILD libvpd-2.2.4.ebuild 820 SHA256 86849a5159886a01f2d41a685821a9a88b333b9412d4ee8583a0189c88394ae3 SHA512 d3fae1e5629c32f8fc6bd8b36c0886a067d492373430a2a104566601c91132228b1f258dbe44e6d1443e042f18d31ef2006538a60571e10f8a38dca95b0834fb WHIRLPOOL be846f6c12412cec186a26b94a013eb3db922dbafa1b298536ef0accd67084649b6021a711cae43fba93432ff43c2a5ff4be9646181c6647dc1fb85a41a70009
+EBUILD libvpd-2.2.5.ebuild 820 SHA256 86849a5159886a01f2d41a685821a9a88b333b9412d4ee8583a0189c88394ae3 SHA512 d3fae1e5629c32f8fc6bd8b36c0886a067d492373430a2a104566601c91132228b1f258dbe44e6d1443e042f18d31ef2006538a60571e10f8a38dca95b0834fb WHIRLPOOL be846f6c12412cec186a26b94a013eb3db922dbafa1b298536ef0accd67084649b6021a711cae43fba93432ff43c2a5ff4be9646181c6647dc1fb85a41a70009
+MISC ChangeLog 3325 SHA256 fb0cebc6c0a7f113c0ccfaaf73958116a64f6c2be0daec522012feb14ce97e4b SHA512 7234fb28c1cd393b89592aed686a7e47f8f3c2ddcbbc6a0133ecac3581ba32388f694a07db677cf4b2a26673b24c446ccef55469a7027b78b97f75ae78833bc6 WHIRLPOOL 9e69efc6348367e0c6e29072555ec93a88e1a9177262168414079b9b6b3263cd5d1fd3ce488c319d58b942e86e8313c31841ede93cd587743e6db70c74784244
+MISC ChangeLog-2015 744 SHA256 e539b65c0d05db6874f0bc812102abf422a2c258d13e070d2d36ca330ac1e7d9 SHA512 d1a340fc91216091ee1bf543ce992722f78ad642936bc1a594a17f167342872717419c3ded2e9691a60f84bc341c8a2616f388d28faaa0c33ab87ac856cbbd64 WHIRLPOOL 68e2ae2fd8a4a1e8025e70067e1504cfafda7d5a1eef072e2c2899b751834765224ec3111428ec4f3715841949a0cb0beef691d6e729258ed9d2bbd239ee70a9
+MISC metadata.xml 343 SHA256 cb43aa113871ee8701e807f65f0bc9f0aa239bee5f1c5d93b11894ecd2477917 SHA512 42f1b8b76a107cfa61ae9db8b900aed22a3bc8e8d3573dbb3c507ebde688ef2c50f7f79847eb345e738365fbb99ba22d99aee56e302c6eed064379ddc1e3a710 WHIRLPOOL 04ce53dd94bcc65b2c05bbb4b8fdedaf856bafe33ea4e045b904cd531f1598a839aaaf280c9bd1714d8b6a4bc91ff7945806cd46c40d28fe585651a87d5b0c2d
diff --git a/sys-libs/libvpd/libvpd-2.1.3.ebuild b/sys-libs/libvpd/libvpd-2.1.3.ebuild
new file mode 100644
index 000000000000..27e6ba634462
--- /dev/null
+++ b/sys-libs/libvpd/libvpd-2.1.3.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+DESCRIPTION="Library implementation for listing vpds"
+HOMEPAGE="https://sourceforge.net/projects/linux-diag/"
+SRC_URI="https://sourceforge.net/projects/linux-diag/files/libvpd/${PV}/libvpd-${PV}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="ppc ppc64"
+IUSE=""
+
+DEPEND=">=dev-db/sqlite-3.7.8
+ sys-libs/zlib"
+
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_configure() {
+ ./bootstrap.sh
+ econf || die "Unable to configure"
+}
+
+src_install(){
+ emake DESTDIR="${D}" install || die "Something went wrong"
+
+}
diff --git a/sys-libs/libvpd/libvpd-2.2.4.ebuild b/sys-libs/libvpd/libvpd-2.2.4.ebuild
new file mode 100644
index 000000000000..5c1e86328768
--- /dev/null
+++ b/sys-libs/libvpd/libvpd-2.2.4.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils udev
+
+DESCRIPTION="Library implementation for listing vpds"
+HOMEPAGE="https://sourceforge.net/projects/linux-diag/"
+SRC_URI="https://sourceforge.net/projects/linux-diag/files/libvpd/${PV}/libvpd-${PV}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~ppc ~ppc64"
+IUSE="static-libs"
+
+DEPEND="
+ >=dev-db/sqlite-3.7.8
+ sys-libs/zlib
+"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ # sysconfdir is used only to establish where the udev rules file should go
+ # unfortunately it also adds the subdirs on its own so we strip it down to
+ # dirname
+ econf \
+ $(use_enable static-libs static) \
+ --sysconfdir="$( dirname $(get_udevdir) )"
+}
+
+src_install(){
+ emake DESTDIR="${D}" install
+ prune_libtool_files
+
+}
diff --git a/sys-libs/libvpd/libvpd-2.2.5.ebuild b/sys-libs/libvpd/libvpd-2.2.5.ebuild
new file mode 100644
index 000000000000..5c1e86328768
--- /dev/null
+++ b/sys-libs/libvpd/libvpd-2.2.5.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils udev
+
+DESCRIPTION="Library implementation for listing vpds"
+HOMEPAGE="https://sourceforge.net/projects/linux-diag/"
+SRC_URI="https://sourceforge.net/projects/linux-diag/files/libvpd/${PV}/libvpd-${PV}.tar.gz"
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~ppc ~ppc64"
+IUSE="static-libs"
+
+DEPEND="
+ >=dev-db/sqlite-3.7.8
+ sys-libs/zlib
+"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ # sysconfdir is used only to establish where the udev rules file should go
+ # unfortunately it also adds the subdirs on its own so we strip it down to
+ # dirname
+ econf \
+ $(use_enable static-libs static) \
+ --sysconfdir="$( dirname $(get_udevdir) )"
+}
+
+src_install(){
+ emake DESTDIR="${D}" install
+ prune_libtool_files
+
+}
diff --git a/sys-libs/libvpd/metadata.xml b/sys-libs/libvpd/metadata.xml
new file mode 100644
index 000000000000..2b8aee36a4fc
--- /dev/null
+++ b/sys-libs/libvpd/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 type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">linux-diag</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/libxcrypt/Manifest b/sys-libs/libxcrypt/Manifest
new file mode 100644
index 000000000000..9fb548365d90
--- /dev/null
+++ b/sys-libs/libxcrypt/Manifest
@@ -0,0 +1,8 @@
+AUX libxcrypt-2.4-glibc-2.16.patch 1024 SHA256 015041d4a9ee23eacc9b3c18216fedb2a6ac12d43c53e946695737de9212e746 SHA512 72dc3944ea6ad600887d99ba0a9b3c0acb9d107f6591a139f863032a45a5efa516ec8b08a06e564552694d14febed0a1e065b96dc4aef06cd274aebf98baedcd WHIRLPOOL 7cf000a35ad37af82b469310cc47e3c916240e8c89088c078ad5fd1707de370d98a6cee17115efd9c8c068b271e35b331bf85dfbb8fee6ee75caac2f60248b5e
+DIST libxcrypt-2.0.tar.bz2 255228 SHA256 176ed37cfdd3b1fe6f9e01cb75c5f864287906bb5741d22fa586d6239ad672a8 SHA512 670042994180186f0f2ae765ac29750790b693e6aa29622f994b90bc59a493287568c2ca0d94d2bc5ed964126de1c2a9a74d206d43ec1d4b77e6d7fb283c9b4b WHIRLPOOL 4010520d8bc7d0bf451f0fb21632d5efb6fce56e12102ce5cd4036c63eb75397429955368726aa90d78a6af69370be7afd622b3bff4a614fd95b5f212874f5f7
+DIST libxcrypt_2.4.orig.tar.gz 361503 SHA256 4207aee39c4454c1955b26a3d77f33e730eae94c20406976b6de80c3a3cfb1cd SHA512 7171ce1b5b7f949232c4db94cf98bdd6396c3e2a8f2f483c041cab92d752e3a2fa93d564ede7efece57c069df129e6cc03049cf3e3f07bd3556031a7c4197cbf WHIRLPOOL 7f23673dacf2d3c6b7f8967aaeb3c2e23039a8f61149372df0dfb700ef5a316ea661be0a76a2caf63e32007a505626c13d8667885935693454bd44c7fc1849c8
+EBUILD libxcrypt-2.0.ebuild 436 SHA256 28767cbc5c39c4d35c6e009e64fa8d526a8aa731a49e2ee33e92f368f6a72658 SHA512 da1595f82a4bd76c439f880580d960f799244a1ee22e5ad91b04c186a5eba147e4c36da75392c4c4fe5202596d4145250b0d3da8370f2351ab9b66c2e58a81c2 WHIRLPOOL 0dde8437a92c94d11f2014649ffa9dec0bf744ce5758bab6e99dc6748d10994cf76ebc6a61508cbec531eaed6b162b9bc5d16b374af47b6321fdab0d2bf629ab
+EBUILD libxcrypt-2.4.ebuild 644 SHA256 0800e220d77aa47aaaf148565fe7abd744d1e4a7b41360948cc4d7cc99dc586c SHA512 b619989540baabbe0a88c8536b2c2fd0c1ba5d60e701228e5d34d1c276bb67c27c9ae4ef8eff8cdf18ffbd87d331ecbc1d5846196b089425fb9d4dbed3888388 WHIRLPOOL d0a91d43e2f826ac705d0c1d481284e894656ee9cf45ba9914ee807469ba1c63f965b86b5bb3852e10fc9949bd0dda198496ab5ca0b595b79d43c807578ede19
+MISC ChangeLog 2522 SHA256 c488ed4c34b09abebf9dfd579f3bfdd31ff28059aee3af92c83dcc310b418cb4 SHA512 165afc2a63231381276fda6b7a60270989c12bb8ee570bc811b3a1b53e7e2696193b29ce072c8ec8f149ce2daf1f4e4655433177461d30f439167617cb093985 WHIRLPOOL 9fd4596cecfaa91d040a79e9e83d8547c41bc99faad003b5c50d2ad90fa7284f37cf794b4b8eb4d7b7e299342535c2a1d19b63b49b0b24b4eb47bb6235149b75
+MISC ChangeLog-2015 1439 SHA256 df5a0246b454413ece623eb8463f9fc185ae7d71b0be6ac138cb38b73e9fb754 SHA512 1234ad2019bdc0d294898366d0842cbd44cc5178dfcaf1e9bdce5354313b0edc9afe4d5aaba51a3b480f0aaabc0983b04acd38d2068f3b3dc5f08cbe3c015d57 WHIRLPOOL 7982987ae22831857147e388133b5fb7f316b3707419a7c488a099e154020c1dcb075f269873e79388044aad318abf183ae56361671649f7c3c52caeef0f11f1
+MISC metadata.xml 483 SHA256 c711ff047000f2523fd3fccf2972875e39ecfa4b88118d7ce479324bb4833637 SHA512 4caf2b033aa710f33a3570d9c7148d603f228ffc1926b8ca14d418f2fc54bd5a51401b555316e4f5d7a1fb8e131d1445caf3f9c64a03bcff4a16c0f60fbe7050 WHIRLPOOL ad3d052d0fce79063298c573ed8f17922d16728ae76ccfd3a69dc5016f147680996d7769eec1496b5e9ec68a23e499e842919e249b65f5a81de47b89605a8845
diff --git a/sys-libs/libxcrypt/files/libxcrypt-2.4-glibc-2.16.patch b/sys-libs/libxcrypt/files/libxcrypt-2.4-glibc-2.16.patch
new file mode 100644
index 000000000000..150ff99ab2f9
--- /dev/null
+++ b/sys-libs/libxcrypt/files/libxcrypt-2.4-glibc-2.16.patch
@@ -0,0 +1,40 @@
+diff -urN libxcrypt-3.0.2/src/crypt_util.c libxcrypt-3.0.2.new/src/crypt_util.c
+--- libxcrypt-3.0.2/src/crypt_util.c 2007-10-25 15:17:46.000000000 +0200
++++ libxcrypt-3.0.2.new/src/crypt_util.c 2013-02-04 12:45:20.560191479 +0100
+@@ -30,8 +30,7 @@
+ #endif
+ #include <string.h>
+
+-#include <bits/libc-lock.h>
+-#define __libc_lock_t pthread_mutex_t
++#include <pthread.h>
+
+ #ifndef STATIC
+ #define STATIC static
+@@ -265,7 +264,7 @@
+ */
+ struct crypt_data _ufc_foobar;
+
+-__libc_lock_define_initialized (static, _ufc_tables_lock)
++static pthread_mutex_t _ufc_tables_lock = PTHREAD_MUTEX_INITIALIZER;
+
+ #ifdef DEBUG
+
+@@ -362,7 +361,7 @@
+ #endif
+
+ if(small_tables_initialized == 0) {
+- __libc_lock_lock (_ufc_tables_lock);
++ pthread_mutex_lock (&_ufc_tables_lock);
+ if(small_tables_initialized)
+ goto small_tables_done;
+
+@@ -471,7 +470,7 @@
+ }
+ small_tables_initialized = 1;
+ small_tables_done:
+- __libc_lock_unlock(_ufc_tables_lock);
++ pthread_mutex_unlock (&_ufc_tables_lock);
+ }
+
+ /*
diff --git a/sys-libs/libxcrypt/libxcrypt-2.0.ebuild b/sys-libs/libxcrypt/libxcrypt-2.0.ebuild
new file mode 100644
index 000000000000..a4055681cff7
--- /dev/null
+++ b/sys-libs/libxcrypt/libxcrypt-2.0.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="A replacement for libcrypt with DES, MD5 and blowfish support"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+HOMEPAGE="http://www.suse.de/us/private/products/suse_linux/i386/packages_personal/libxcrypt.html"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+}
diff --git a/sys-libs/libxcrypt/libxcrypt-2.4.ebuild b/sys-libs/libxcrypt/libxcrypt-2.4.ebuild
new file mode 100644
index 000000000000..af69e83f0d57
--- /dev/null
+++ b/sys-libs/libxcrypt/libxcrypt-2.4.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils multilib
+
+DESCRIPTION="A replacement for libcrypt with DES, MD5 and blowfish support"
+SRC_URI="mirror://debian/pool/main/libx/${PN}/${PN}_${PV}.orig.tar.gz"
+HOMEPAGE="http://packages.debian.org/sid/libxcrypt1"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.4-glibc-2.16.patch"
+}
+
+src_configure() {
+ # Do not install into /usr so that tcb and pam can use us.
+ econf --libdir=/$(get_libdir) --disable-static
+}
+
+src_install() {
+ default
+ prune_libtool_files
+}
diff --git a/sys-libs/libxcrypt/metadata.xml b/sys-libs/libxcrypt/metadata.xml
new file mode 100644
index 000000000000..3f12685cdb12
--- /dev/null
+++ b/sys-libs/libxcrypt/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 type="project">
+ <email>hardened@gentoo.org</email>
+ <name>Gentoo Hardened</name>
+ </maintainer>
+ <longdescription>
+ Crypt library for DES, MD5, and blowfish. Libxcrypt is a replacement for
+ libcrypt, which comes with the GNU C Library. It supports DES crypt,
+ MD5, and passwords with blowfish encryption.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest
new file mode 100644
index 000000000000..a6fbac794598
--- /dev/null
+++ b/sys-libs/llvm-libunwind/Manifest
@@ -0,0 +1,16 @@
+AUX libunwind-3.8-cmake.patch 3454 SHA256 3946db9aea188c3ad8f80fcec25ea2c696e17b17fc4510ace553e87d41b1aa7f SHA512 5d0a72e91a99e60f22239d56bf0998b0ae1df448ebf461c00bf6fe9eed0fa0579041bd98a9b50dfbe2d6a4490bbb8ede5c9b2fe76743f9f5b84770b4563377f1 WHIRLPOOL b6089ef2eb3a4f47e529f9efb585677cc8fbd0c1d64f84c4c4d3bddc393055742eefc9256baaad16febc2d6acec52e9fb38088f69dd1a226288b45fa214511d4
+AUX libunwind-3.9-cmake-static-lib.patch 1855 SHA256 1b6d6abbb687eb691a1907288c309cc89e55432d60d70b712021b723bcd90a33 SHA512 1d0c5859394d027fd0b30ae30caa0aaee94e3880a16d1f46f318221f3062e126c25c6f20cdf087dc9b37d92517df499b0f79294a6e17c8ac5da694c0d825e9bc WHIRLPOOL 54d3264a06d8e293bce73bc6be4e9c8922ed8894840e3df382e3737de19c6a24b73b166c32a53efd96101e64fb43dd64fe000b08f4d9fe6fb719291784772fc5
+DIST libunwind-3.8.1.src.tar.xz 60596 SHA256 21e58ce09a5982255ecf86b86359179ddb0be4f8f284a95be14201df90e48453 SHA512 2a60d7c4b0aee6c58f50089ac9fa2b756ab1d74faaee32f7436ddace4510589c7ffdd20478919966ed2fa8a23ee1b5d1b26115dbd8ee2834b00b5bcd61d00b14 WHIRLPOOL f2756de12d39de2df9bf06be3024327b3ca37f2537aae17efda6e94fb9807c31cab1a2eb070aca8e7e44467ab51c69fecbeef063e07472ec59657309a16bdd1c
+DIST libunwind-3.9.0.src.tar.xz 61764 SHA256 66675ddec5ba0d36689757da6008cb2596ee1a9067f4f598d89ce5a3b43f4c2b SHA512 dce384bea99ed61b363b847e20946fc9d70377389a227cc7054fbaa916e7cb5ba0b9d89f0df6ed33409dbf38beefd3654c18c1abcf0e50b5d0315ce0135a1d25 WHIRLPOOL 3fddaf6a06390143beee04d0e73ac0b66fb27c5497b80309ca314a52fd67d49ae3806b2b7588f07185c49339a75b7549bbf303f50224916f1ed65f6ad82415d0
+DIST libunwind-3.9.1.src.tar.xz 61788 SHA256 0b0bc73264d7ab77d384f8a7498729e3c4da8ffee00e1c85ad02a2f85e91f0e6 SHA512 a80f5d0660e209f5bf709316b5df2ca63b9f0db49f5f74dfe9c9e580c654f61a15acc071a739fdb84baf5ffa9420b92498f8560331173642d80f6b74e1e2afb7 WHIRLPOOL d79928771468e344bd4c73ec458f4994fbfa04b4f625e559f3ef20c75d504d06f8edc1051d1444d8b4260f253716333ecd4bc7a18e8aca822dd77245a5a99ac2
+DIST libunwind-4.0.1.src.tar.xz 63388 SHA256 3b072e33b764b4f9b5172698e080886d1f4d606531ab227772a7fc08d6a92555 SHA512 8a0552a8ab830010d81420f4b778a3b831bff85b19bcce972958fc30e1ba5a2fa26a3deba499985a43dd7a103690775f6a20e7b3edda55f4eaff3541002d6b59 WHIRLPOOL 2544b14afb6a2d545ed68c267389e7438c3dd4d244dd1cce8583f2aba2e90017a027c27c87a9a7336ea3c5ada3388414d4e357ad1c1db0d23ee52b178f45b563
+DIST libunwind-5.0.0.src.tar.xz 72236 SHA256 9a70e2333d54f97760623d89512c4831d6af29e78b77a33d824413ce98587f6f SHA512 20d54d5342d67425f5e36e9c690f1bb67bc2a3b7184b3ad546b689e510728d7c596f178d4f5186daf7480409ed4e455848b4ad1d9d896370fac1db69885fc793 WHIRLPOOL 0ecdf40e6cde7012f6949015b5030a4206b2c0d293159864466b58a9f34b193245daf90c95417b66e3c15191b1418a94b65893efbe216d144a4de4ffb6107925
+EBUILD llvm-libunwind-3.8.1.ebuild 887 SHA256 51b32550f00919810d206c0c3da9958422b4217aa7587e33a23bab0de2c25633 SHA512 bbb072b142bf07850f2ff7ae59d4f46693bd7b43b326860c76c232d206fc129541eb658e6f31d5103115b572ecc5af408617be4ab3af04ed520000360df38bad WHIRLPOOL 84a77b2b7766a888982b1a164ae9f55071ce0c6990cc607157286ff4726997014089174daae676b4c5876f4368c0f79d6ef4a247db83ba061b376845dabadf74
+EBUILD llvm-libunwind-3.9.0-r1.ebuild 1182 SHA256 06ce2ebb20c2668dafb9b4619857ee6c0af34ee7c53430a045c7321de0558c00 SHA512 409250525e1697964c71d8abf80d64da6da8361324db073fb4ab6facc5dd4a93d65a98aec0a52ff895ed865d7d102c8ba2c9c4fa51cc6cffd9bd73f1477d6992 WHIRLPOOL 889bf6ab4c284cc80f221dfbe130704675532314d0a81e3f12b70c386098f05d08b856e1d6d73eb13f3a98d22ff545e2e3aaaafea3ec6b2aa762486c52ccbc35
+EBUILD llvm-libunwind-3.9.1.ebuild 1187 SHA256 a4c3fdca9c6b62e95aeb4a18d423895d1f942de1e3ecdc390c8f096b1d59f025 SHA512 bdd65eb012df3af046c71406af02927255f3502aaf92e53fa9dbf2adfa0150b68e4325cfef2f07d1893738ba6ba3f009a89e37861ffe7999752ea77fc3963a0b WHIRLPOOL 8f98d6c556943c07c0822e2bfec7b7848ca7d75b052479b4af110fd68cba63650cf1237a37a7eb21803d677402c50a3daba0b5db091f5cf66fdf73f24d9dd645
+EBUILD llvm-libunwind-4.0.1.ebuild 1096 SHA256 aa03301ac66383ca475bcf8431e6049bc33b264930368a78da742977ad591204 SHA512 8ff88efcf19f55a6880f4fba24126645b6429eb667ea8cdd90aaa800ec856f1f83c2ce2ebfc4a8074ee25af2f68ddc67216e1a1423cbc2f744accf0a075bbcb6 WHIRLPOOL ef1e94cb5328f40df84cb13a8b906e7ad99fd26653e9bcf97088ea828128442fda089af96e07713b067b6fd1f1184657184531db500ae978d1a4261eb90ea2ad
+EBUILD llvm-libunwind-5.0.0.ebuild 1096 SHA256 aa03301ac66383ca475bcf8431e6049bc33b264930368a78da742977ad591204 SHA512 8ff88efcf19f55a6880f4fba24126645b6429eb667ea8cdd90aaa800ec856f1f83c2ce2ebfc4a8074ee25af2f68ddc67216e1a1423cbc2f744accf0a075bbcb6 WHIRLPOOL ef1e94cb5328f40df84cb13a8b906e7ad99fd26653e9bcf97088ea828128442fda089af96e07713b067b6fd1f1184657184531db500ae978d1a4261eb90ea2ad
+EBUILD llvm-libunwind-5.0.9999.ebuild 1109 SHA256 68f4e7ecf519f1599ed4979ee35f826a24cc8b6b3f4f6dbee76682cf75dd6250 SHA512 926839a7f702a1827cebdb45289560409056f63c77d1a4a57a2b00b8b9b813353b06b8742628d6a23d7dd4c94864af6fb059b9b6d045fa31819af4a7513046c5 WHIRLPOOL f76ebdfc606c8d7951b40dfbc9cbe188ecc283372a604f6747dccb412c776f6e705cd202df3c144a90cdd216bff0f8db9e673d68489e3c90433bdad7752bfbea
+EBUILD llvm-libunwind-9999.ebuild 1084 SHA256 e71d3206f29333d7d34d23007301eb8016f1390b9362c06c0abfbd62b704eeb3 SHA512 9393e7fafe3a5b0416c0206a1d25ba9f0601dfc329293c9d4b02d61859aaf7f5b1c1be1fc7e82429f278385f70890f1ab49b8db0785c33ac0d2e193877741cd7 WHIRLPOOL 11826d09f3e7b06b92598137134c43e977a0911851d12b6d5e7512244b684c0aac4f16e196bbdfe02b53c2c924e73f9634b4e7427fa03da6fd870bc840d256b0
+MISC ChangeLog 1632 SHA256 b53287c438bcd44ae5f83379f90b140589fa914bad4f3f9ca9ffcf30440ed23d SHA512 0bd16c4e745548f2e80fccd162123a45dbf9cbf0ba414344ae4f5b690062f122b1813c23ce7a90efc2544b2a4f5ec2a3bfc15fac265391fc4046334781242245 WHIRLPOOL a7259e499c13e8e8d1abb1bb5e122df4f53db7ad6a6ada2f1387cd39bf5af1b94fa107373172f105132960f2594d20a599b4c353f704f72eeb3842e161f334ff
+MISC metadata.xml 302 SHA256 5227e633c064b7502b07a2e2be7113a335bec46d874c9f66e0aa01ce5baf6dae SHA512 3afaef82e6a495a81e221524ae7604dc170ef5c103333728674faf0417c45ba7996118c10466eaa24f8feef9ed8f0fc60d535a5195462317d61c61a531c8a285 WHIRLPOOL 14e6f06ebcebb26488bfb2f9c636fed244acec33548c39dce5450546b535a9eede8e4a7a235e60a76c58c9ed6de9b23d87e68c73165e84c22644fcbe16da6c8c
diff --git a/sys-libs/llvm-libunwind/files/libunwind-3.8-cmake.patch b/sys-libs/llvm-libunwind/files/libunwind-3.8-cmake.patch
new file mode 100644
index 000000000000..5f995be5051a
--- /dev/null
+++ b/sys-libs/llvm-libunwind/files/libunwind-3.8-cmake.patch
@@ -0,0 +1,82 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d9b2367..b6bb5fd 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -43,7 +43,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+ set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
+ set(LLVM_LIT_PATH "${LLVM_PATH}/utils/lit/lit.py")
+- else ()
++ elseif (NOT LIBUNWIND_BUILT_STANDALONE)
+ message(FATAL_ERROR "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. "
+ "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config "
+ "or -DLLVM_PATH=path/to/llvm-source-root.")
+@@ -53,7 +53,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+ include("${LLVM_CMAKE_PATH}/AddLLVM.cmake")
+ include("${LLVM_CMAKE_PATH}/HandleLLVMOptions.cmake")
+- else ()
++ elseif (NOT LIBUNWIND_BUILT_STANDALONE)
+ message(FATAL_ERROR "Not found: ${LLVM_CMAKE_PATH}")
+ endif ()
+
+@@ -103,6 +103,7 @@ option(LIBUNWIND_ENABLE_ASSERTIONS "Enable assertions independent of build mode.
+ option(LIBUNWIND_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
+ option(LIBUNWIND_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
+ option(LIBUNWIND_ENABLE_SHARED "Build libunwind as a shared library." ON)
++option(LIBUNWIND_ENABLE_STATIC "Build libunwind as a static library." OFF)
+
+ set(LIBUNWIND_GCC_TOOLCHAIN "" CACHE STRING "GCC toolchain for cross compiling.")
+ set(LIBUNWIND_SYSROOT "" CACHE STRING "Sysroot for cross compiling.")
+@@ -136,9 +137,9 @@ macro(append_if list condition var)
+ endmacro()
+
+ set(LIBUNWIND_C_FLAGS "")
+-set(LIBUNWIND_CXX_FLAGS "")
++set(LIBUNWIND_CXX_FLAGS "-std=c++11")
+ set(LIBUNWIND_COMPILE_FLAGS "")
+-set(LIBUNWIND_LINK_FLAGS "")
++set(LIBUNWIND_LINK_FLAGS "-Wl,-z,noexecstack")
+
+ append_if(LIBUNWIND_COMPILE_FLAGS LIBUNWIND_HAS_WERROR_FLAG -Werror=return-type)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index ee01e9a..c66673e 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -18,7 +18,8 @@ set(LIBUNWIND_ASM_SOURCES
+ UnwindRegistersSave.S)
+ set_source_files_properties(${LIBUNWIND_ASM_SOURCES}
+ PROPERTIES
+- LANGUAGE C)
++ LANGUAGE C
++ COMPILE_FLAGS "-Wa,--noexecstack")
+
+ set(LIBUNWIND_HEADERS
+ AddressSpace.hpp
+@@ -51,8 +52,10 @@ set(LIBUNWIND_SOURCES
+
+ if (LIBUNWIND_ENABLE_SHARED)
+ add_library(unwind SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+-else()
+- add_library(unwind STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++endif ()
++if (LIBUNWIND_ENABLE_STATIC)
++ add_library(unwind_static STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++ set_target_properties(unwind_static PROPERTIES OUTPUT_NAME unwind)
+ endif ()
+
+ # Generate library list.
+@@ -106,7 +109,10 @@ set_target_properties(unwind
+ set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
+ APPEND_STRING PROPERTY COMPILE_FLAGS "${LIBUNWIND_CXX_FLAGS}")
+
+-install(TARGETS unwind
+- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++if (LIBUNWIND_ENABLE_SHARED)
++ install(TARGETS unwind LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
++if (LIBUNWIND_ENABLE_STATIC)
++ install(TARGETS unwind_static ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
diff --git a/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch b/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch
new file mode 100644
index 000000000000..82beb4481410
--- /dev/null
+++ b/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 806b825..4b330f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -104,6 +104,7 @@ option(LIBUNWIND_ENABLE_ASSERTIONS "Enable assertions independent of build mode.
+ option(LIBUNWIND_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
+ option(LIBUNWIND_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
+ option(LIBUNWIND_ENABLE_SHARED "Build libunwind as a shared library." ON)
++option(LIBUNWIND_ENABLE_STATIC "Build libunwind as a static library." OFF)
+ option(LIBUNWIND_ENABLE_CROSS_UNWINDING "Enable cross-platform unwinding support." OFF)
+ option(LIBUNWIND_ENABLE_ARM_WMMX "Enable unwinding support for ARM WMMX registers." OFF)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index b7c2d63..7c453de 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -51,8 +51,10 @@ set(LIBUNWIND_SOURCES
+
+ if (LIBUNWIND_ENABLE_SHARED)
+ add_library(unwind SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+-else()
+- add_library(unwind STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++endif()
++if (LIBUNWIND_ENABLE_STATIC)
++ add_library(unwind_static STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++ set_target_properties(unwind_static PROPERTIES OUTPUT_NAME unwind)
+ endif ()
+
+ # Generate library list.
+@@ -109,7 +111,9 @@ set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
+ set_property(SOURCE ${LIBUNWIND_C_SOURCES}
+ APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_C_FLAGS} ${LIBUNWIND_C_FLAGS}")
+
+-install(TARGETS unwind
+- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+-
++if (LIBUNWIND_ENABLE_SHARED)
++ install(TARGETS unwind LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
++if (LIBUNWIND_ENABLE_STATIC)
++ install(TARGETS unwind_static ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-3.8.1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-3.8.1.ebuild
new file mode 100644
index 000000000000..617dedb11566
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-3.8.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils
+
+MY_P="libunwind-${PV}"
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+static-libs"
+
+DEPEND=""
+RDEPEND="!sys-libs/libunwind"
+
+S="${WORKDIR}/${MY_P}.src"
+
+src_prepare() {
+ default
+ eapply "${FILESDIR}/libunwind-3.8-cmake.patch"
+}
+
+src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ # work-around attempting to use llvm-config to get llvm sources
+ # (that are not needed at all)
+ -DLLVM_CONFIG=OFF
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_BUILT_STANDALONE=ON
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0-r1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0-r1.ebuild
new file mode 100644
index 000000000000..f40325bc0c02
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+inherit cmake-multilib
+
+MY_P="libunwind-${PV}"
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# llvm-config and cmake files needed to get proper flags
+# (3.9.0 needed because cmake file install path changed)
+DEPEND=">=sys-devel/llvm-3.9.0[${MULTILIB_USEDEP}]"
+
+S="${WORKDIR}/${MY_P}.src"
+
+src_prepare() {
+ # add switch for static-libs; accepted upstream
+ eapply "${FILESDIR}/libunwind-3.9-cmake-static-lib.patch"
+ default
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-3.9.1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.1.ebuild
new file mode 100644
index 000000000000..6a132e567b55
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+inherit cmake-multilib
+
+MY_P="libunwind-${PV}"
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# llvm-config and cmake files needed to get proper flags
+# (3.9.0 needed because cmake file install path changed)
+DEPEND=">=sys-devel/llvm-3.9.0[${MULTILIB_USEDEP}]"
+
+S="${WORKDIR}/${MY_P}.src"
+
+src_prepare() {
+ # add switch for static-libs; accepted upstream
+ eapply "${FILESDIR}/libunwind-3.9-cmake-static-lib.patch"
+ default
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-4.0.1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-4.0.1.ebuild
new file mode 100644
index 000000000000..a85458427d14
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-4.0.1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+inherit cmake-multilib llvm
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://releases.llvm.org/${PV/_//}/libunwind-${PV/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND=">=sys-devel/llvm-4"
+
+S=${WORKDIR}/libunwind-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-5.0.0.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-5.0.0.ebuild
new file mode 100644
index 000000000000..a85458427d14
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-5.0.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+inherit cmake-multilib llvm
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://releases.llvm.org/${PV/_//}/libunwind-${PV/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND=">=sys-devel/llvm-4"
+
+S=${WORKDIR}/libunwind-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-5.0.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-5.0.9999.ebuild
new file mode 100644
index 000000000000..fc8c13fc44bf
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-5.0.9999.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+inherit cmake-multilib git-r3 llvm
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/libunwind.git
+ https://github.com/llvm-mirror/libunwind.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND=">=sys-devel/llvm-4"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-9999.ebuild
new file mode 100644
index 000000000000..88f7a92b6c9c
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-9999.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+inherit cmake-multilib git-r3 llvm
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/libunwind.git
+ https://github.com/llvm-mirror/libunwind.git"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND=">=sys-devel/llvm-4"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/metadata.xml b/sys-libs/llvm-libunwind/metadata.xml
new file mode 100644
index 000000000000..cfce3f1a81b3
--- /dev/null
+++ b/sys-libs/llvm-libunwind/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 type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">llvm-mirror/libunwind</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/lrmi/Manifest b/sys-libs/lrmi/Manifest
new file mode 100644
index 000000000000..cb90ad31ccf2
--- /dev/null
+++ b/sys-libs/lrmi/Manifest
@@ -0,0 +1,7 @@
+AUX lrmi-0.10-kernel-2.6.26.patch 593 SHA256 44249d94d58bcac734683c3a15b5b9bcefc815b7aa4df1e053172e90c3c3ab9d SHA512 286d0a0381a8939a6d4b1af695ed2312bf397a21c07607ec589c9ada9c6b2d8bb38227d2b831f1951b090437417f20fe863bae99659f7b70a24a90c3793ed4ad WHIRLPOOL f983ae2eebb0285c3392c06670102370e54f51a169c9d84d05ac99ea2eefe2f23f27e16e1d133f59e0381ddd47e2ead38fe1ead097e774ef7d3a482952257ff7
+AUX lrmi-0.10-ldflags.patch 934 SHA256 0df1dbe616c8236666f0bb19b812cf38a1cb3a871613f710ccdf6e1e8f7696a6 SHA512 e00b164b1dd4e44549f3c78602ca5e030b130b5f201bc610652d1befe7ea400edaf0a58754ff9a06b5c4f5c81ddb770eb2ca2acdf3f33b6b38bf4005cae1c3d1 WHIRLPOOL 24af46071a78e2427dcd55b54ec40ad031169a78a23860d077f744a4af56755ec1cb88cb0d95c29e9585bb0f405b35c351775d9e707cfd3c1007fb254ea3f5ff
+DIST lrmi-0.10.tar.gz 10271 SHA256 b0be55c14407f586dc10836e8f348b3a002c461a9b47a302071eac0ef85770da SHA512 61d4f228ab712376cb8d47ef9e1049c89b9916f2fc04723ced03524b716f5e034ffb8ce7aa9b2b4d9d67aa93608020fc7dd1fb7a9778f211eb25a22713a538f1 WHIRLPOOL d194bba1e4e54bb2344f2c46427b56456e67636671f6a6b904cf2ae382b58218f5ac0fdd17afb2549dc58de1827eb50732e8c78e4c6db5123e7f6b874e7b44d9
+EBUILD lrmi-0.10-r1.ebuild 925 SHA256 8bdda9ee6157100b46c5beb6d657dd759bcf8ffd9cc3470b240115af09dbeae1 SHA512 ecafb27a7762ea7ac2bc482081838d053a6f34d3a18506a3d437e9003a9ef9c470fa9f17efc1506ceb1b1da04f8239054b3bd7cede56ae2bfd6ca6c77b1ef229 WHIRLPOOL 0e508815e326e2c944784632cb402ec5f136b625d7c5a4c0aba7035e5163a8d20fd6fd86ed5b6473fe3c873713fa7a606aa56899f8459cc3eeff2bfd615d1606
+MISC ChangeLog 2993 SHA256 7faef6aeffc979a962d65d097ccbb0d14ffbd028d33ca3b9fcd9f69211a86335 SHA512 e6a329b442c769fa4967cab19a5d058010a57b3452fdf62e871da45709fe8bdadbbe8bb8f5cd039e83eb6ab2538dc92b14eaab5688f8540ed6238689d8118a16 WHIRLPOOL 60df200c202458e1c598028f1ecff3137d80c32cb6988225e38322e0bf56f0ad518ea6a1ef1974803c1a071b6d71e79afabd2a754368743895989519de413dc0
+MISC ChangeLog-2015 2659 SHA256 63412ad5ef18609b55f9575e234998731eda8cefd4a047ae8d2ca3f25f96df3a SHA512 5e9cc58e9f9a448a7dc9eb8aa029e4ee296439e0a5a9da4223408811f54bc21f0906d46bd4ba9b9d82974f27be43dcf7da50a4f56609dc9ada07f2994289422d WHIRLPOOL e82a2634dc285c83c6f8186b4c5970da5ec93e96d5200a44f7414279750f02e1e15a7c33d2dddf58a0b779a5f91e3ece14b4749021870c80f83a8d926692fbb3
+MISC metadata.xml 324 SHA256 f4d6a49dd048a146d84834275087c59126b04e549230028c281d45248bb459c8 SHA512 74a5d88a930a6b5367b61de0a0587a8438ee8d83e19a85bc9832db44481532e3a491da16b2788ae70164bf370280ed44a8245eb1505d113b8a293a3d38c6a5e1 WHIRLPOOL 95008c0c3b435635ddc4af847dec8c1571bf46b1ced10fb40feb014fceac21396af6fe57f7f4083619ec84d5e78db495034bb38f4639c71f3938fd07e6f6f503
diff --git a/sys-libs/lrmi/files/lrmi-0.10-kernel-2.6.26.patch b/sys-libs/lrmi/files/lrmi-0.10-kernel-2.6.26.patch
new file mode 100644
index 000000000000..9547439376a3
--- /dev/null
+++ b/sys-libs/lrmi/files/lrmi-0.10-kernel-2.6.26.patch
@@ -0,0 +1,18 @@
+diff -Naurp lrmi-0.10-orig/lrmi.c lrmi-0.10/lrmi.c
+--- lrmi-0.10-orig/lrmi.c 2008-08-23 14:39:44.000000000 +0200
++++ lrmi-0.10/lrmi.c 2008-08-23 14:40:25.000000000 +0200
+@@ -61,6 +61,14 @@ OTHER DEALINGS IN THE SOFTWARE.
+
+ #include "lrmi.h"
+
++/* 2.6.26+ kernels don't define the legacy masks. */
++#if defined(__linux__) && !defined(TF_MASK)
++ #define TF_MASK X86_EFLAGS_TF
++ #define IF_MASK X86_EFLAGS_IF
++ #define VIF_MASK X86_EFLAGS_VIF
++ #define IOPL_MASK X86_EFLAGS_IOPL
++#endif
++
+ #define REAL_MEM_BASE ((void *)0x10000)
+ #define REAL_MEM_SIZE 0x40000
+ #define REAL_MEM_BLOCKS 0x100
diff --git a/sys-libs/lrmi/files/lrmi-0.10-ldflags.patch b/sys-libs/lrmi/files/lrmi-0.10-ldflags.patch
new file mode 100644
index 000000000000..b23bd9c5cdf8
--- /dev/null
+++ b/sys-libs/lrmi/files/lrmi-0.10-ldflags.patch
@@ -0,0 +1,26 @@
+diff -Naurp lrmi-0.10-orig/Makefile lrmi-0.10/Makefile
+--- lrmi-0.10-orig/Makefile 2010-08-20 15:03:17.093144820 +0200
++++ lrmi-0.10/Makefile 2010-08-20 15:03:47.761144267 +0200
+@@ -2,6 +2,7 @@ LIBDIR ?= /usr/local/lib
+ INCDIR ?= /usr/local/include
+
+ CFLAGS = -g -Wall
++LDFLAGS =
+
+ sources = lrmi.c
+ objects = lrmi.o
+@@ -26,12 +27,12 @@ liblrmi.a: $(objects)
+
+ liblrmi.so: $(pic_objects)
+ # $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -shared -o $@ $^
+- $(CC) $(CPPFLAGS) $(CFLAGS) -Wl,-soname,$(LIBNAME).so.$(MAJOR) -fPIC -shared -o $(LIBNAME).so.$(VERSION) $^
++ $(CC) $(CPPFLAGS) $(CFLAGS) -Wl,-soname,$(LIBNAME).so.$(MAJOR) $(LDFLAGS) -fPIC -shared -o $(LIBNAME).so.$(VERSION) $^
+ ln -sf $(LIBNAME).so.$(VERSION) $(LIBNAME).so.$(MAJOR)
+ ln -sf $(LIBNAME).so.$(MAJOR) $(LIBNAME).so
+
+ vbetest: vbetest.c liblrmi.a
+- $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ install:
+ mkdir -p $(LIBDIR)
diff --git a/sys-libs/lrmi/lrmi-0.10-r1.ebuild b/sys-libs/lrmi/lrmi-0.10-r1.ebuild
new file mode 100644
index 000000000000..d1b50a4091fc
--- /dev/null
+++ b/sys-libs/lrmi/lrmi-0.10-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="library for calling real mode BIOS routines under Linux"
+HOMEPAGE="http://www.sourceforge.net/projects/lrmi/"
+SRC_URI="mirror://sourceforge/lrmi/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="x86"
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-kernel-2.6.26.patch
+ epatch "${FILESDIR}"/${P}-ldflags.patch
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+ emake CFLAGS="${CFLAGS} -Wall" LDFLAGS="${LDFLAGS}" || die "emake failed."
+}
+
+src_install() {
+ dobin vbetest || die "dobin failed."
+ dolib.a liblrmi.a || die "dolib.a failed."
+ dolib.so liblrmi.so.${PV} || die "dolib.so failed."
+ dosym liblrmi.so.${PV} /usr/lib/liblrmi.so
+ dosym liblrmi.so.${PV} /usr/lib/liblrmi.so.${PV%%.*}
+
+ insinto /usr/include
+ doins lrmi.h vbe.h || die "doins failed."
+}
diff --git a/sys-libs/lrmi/metadata.xml b/sys-libs/lrmi/metadata.xml
new file mode 100644
index 000000000000..89ed3cff124d
--- /dev/null
+++ b/sys-libs/lrmi/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">lrmi</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/lwp/Manifest b/sys-libs/lwp/Manifest
new file mode 100644
index 000000000000..fc8d06f226b8
--- /dev/null
+++ b/sys-libs/lwp/Manifest
@@ -0,0 +1,10 @@
+AUX lwp-2.0-amd64.patch 866 SHA256 801eedce6758cb0765ebf2d215854797eef15f984af4311a7e7220cb1819f38d SHA512 f66c3d7111673ddf503a8ebd82fe22db9bf92dcc4bb7d9ce8fbfd3c65fb699a4f240c04700fcdb08c582a4f2be8da7ed870ba07cbc3d81110b2fc29f69028dd0 WHIRLPOOL 8cadba58a25d8bc9258ec8d1af2d4b82126fd8ed40507952b7d86d21d8a09bdd99f293a9b82f8673d1f775cf270991c0c34cd6563d5209b08e1bbea4e64055cf
+DIST lwp-2.2.tar.gz 376136 SHA256 64a3570559083bee657551b6673037161f33b71ad55ee45812612c29df2924b0 SHA512 a5fa52c0483e04fdbface5f0e9cc85bab5db59c4d730a3cb3c538ccaa3a88aaa916b37478e4c5450e77bcc45638987610ba619995a75541d728f138f103c5d7e WHIRLPOOL 93015bf3741508d284cd55482ca5201bf1a0c6d9b880e42c9cd3aa0147727e6bda6266231dc61056b1f6ac8a10a21b0fb874674163fa5866a72a1500407a5ae4
+DIST lwp-2.6.tar.gz 372225 SHA256 4887fd7f74564552f53dfe42440f4777808a82b1249b2733ecfd062849a4d32d SHA512 ad8374ddf55ef9fddf9ce0b8d7c2ae0dc206e5108a01f278a37486070ab70e5bd7312f057863254b4fc430cfbed2c36f589807813e6a99067933142d5225395b WHIRLPOOL 205836226f86e77dfbc795bdf667f51b2c40b99cbc7bf5b998361472b6ad46b102c519d88e1afc503b259c9073ac7b155e322d134f5787d770517f3bf3a2e54d
+DIST lwp-2.8.tar.xz 270008 SHA256 689c1ab8a16dc013fb1aedcc0aa3e4b11074b22efc4cafc251b8f707a1467e5f SHA512 c56f3b350e888b5bcb2bffb41086f8926e975aafae236be7f1d2153bb178a37564b77d7598db1aa915714ce8e2ed1904663ce2113f5d0853173cf5e189958bf0 WHIRLPOOL 3afbd93d0c5c77d067b110243682900e71ef289b6a480c9954305aa096c4f8587517c37c3eb701a78f9cf825696d4c2ea9fc8b17132028e697ea46eb1a88cb7b
+EBUILD lwp-2.2.ebuild 735 SHA256 a3b2842aec10e6451abdb6a2fabfca07eee9b293757049480c58dcf2f4e2465f SHA512 c9d778fadd11090b29496c8f57aec1347d5c83140742c0ff19321d859da0715bc72c9200f5a565620e341bf3cd9aae31e51827112fb6dcec64d629e01eb44811 WHIRLPOOL 9c16a28745e8111394c7c238b9587b756322b97ab6b8a2bbe4c732e854f4d060b911083f99543f22958bc42047145113b845db043fb23c0ead94ab7093597774
+EBUILD lwp-2.6-r1.ebuild 524 SHA256 4ca81e7ac7fae7c783f944965dfc87f9a7517ec6e4f2bf27fc84904700087c49 SHA512 59b622850763aa9e36733f3a72ad037cb94168fa9fe0ffd7e7a3d870601f252a72deecfa457d2a7ae79c5b75d0d011449b940597a8df856b4dae714ff699d3e9 WHIRLPOOL 761db20781da89859ae8a5ea93141f3e27ed60116dcba5aaf551d8e487db2408196703ebcab4393139b0eb576e9d431d54c09be9223ad205d1ce7c984cb04904
+EBUILD lwp-2.8.ebuild 488 SHA256 ed260fb9aa0bda0848aa228ffb2d27b777608c543b9d84c30100ade8416b9919 SHA512 26d0e09306c369147ad3777baa0642375233febe76cdfeece2fe4ecfca7ac8101dc8d4f1bf49038c98c82b3e5a002184869affe3838035f65dd0edbf905a25e0 WHIRLPOOL 2a4eb92b1b63732cf594d113923cebb59984b987829f3ece969a803e960e387fa6f5a6fa29ccaee1163e3f4b03e3cd0376f7f1f3533757c29fd4c0a44ccb3708
+MISC ChangeLog 2550 SHA256 b7ae2e838760d72c00d9de18199c827a412a0534c1dada6303d275bc54bd633d SHA512 1063d5193d8f1f232d81e6d622ffba5e5ba401718f0c28e990058ce439ca5f36857e3c7229b54dd98b6d851f29d9070469c50ffb10fe475afbf98129eb8adcaa WHIRLPOOL cb31b72e0922faad7f57abf7e42693057cbcbaa6ee2a2b40b59f78b2808fd29f32ec5b281ff319a9dc676de33a8f8b1b9001787c6daebd40405fa9195d6bbb11
+MISC ChangeLog-2015 5381 SHA256 628e7b95d0164d56314d166dd3f555db6b0aac20c7ef4bac8a34fca6f74b4899 SHA512 0bec6d81c0bd4a5b3cd8a239707f0edf46faab38c857c454e3725bdd12fa0cf2ba0ce06aeb2a99b2208b883071afcf9f964c6e934d6e54dd3325140334e13f72 WHIRLPOOL cb103f7c1f7705976619bad8677851c02e548a89a8afde9efe63b61b7de46821025547f8e41bd3da6d2ea3889349d539ad61937d168bc57e8c5a108783556b34
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/sys-libs/lwp/files/lwp-2.0-amd64.patch b/sys-libs/lwp/files/lwp-2.0-amd64.patch
new file mode 100644
index 000000000000..64a1576f0894
--- /dev/null
+++ b/sys-libs/lwp/files/lwp-2.0-amd64.patch
@@ -0,0 +1,28 @@
+diff -ruN lwp-2.0/src/lwp.c lwp-2.0-fixed/src/lwp.c
+--- lwp-2.0/src/lwp.c 2005-03-25 17:50:56.000000000 +0100
++++ lwp-2.0-fixed/src/lwp.c 2005-05-05 14:32:56.580753096 +0200
+@@ -463,6 +463,16 @@
+ #ifndef MMAP_LWP_STACKS
+ stackptr = (char *) malloc(stacksize);
+ #else
++ pagesize = getpagesize();
++
++#if defined(__x86_64__)
++ /* [gb] Ensure minimal stack size. Heuristically determined
++ through tdb test that 2048 is too small when printf() et al. come
++ into action. */
++ if (stacksize < pagesize)
++ stacksize = pagesize;
++#endif
++
+ #ifdef MAP_ANON
+ stackptr = mmap(lwp_stackbase, stacksize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+@@ -483,7 +493,6 @@
+ perror("stack: ");
+ assert(0);
+ }
+- pagesize = getpagesize();
+ lwp_stackbase += ((stacksize/pagesize) + 2) * pagesize;
+ #endif
+ if (!stackptr)
diff --git a/sys-libs/lwp/lwp-2.2.ebuild b/sys-libs/lwp/lwp-2.2.ebuild
new file mode 100644
index 000000000000..b632f923305b
--- /dev/null
+++ b/sys-libs/lwp/lwp-2.2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils
+
+DESCRIPTION="Light weight process library (used by Coda). This is NOT libwww-perl"
+HOMEPAGE="http://www.coda.cs.cmu.edu/"
+SRC_URI="http://www.coda.cs.cmu.edu/pub/lwp/src/${P}.tar.gz"
+
+SLOT="1"
+LICENSE="LGPL-2.1"
+KEYWORDS="alpha amd64 ~hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE=""
+
+DEPEND="sys-apps/grep
+ sys-apps/sed
+ sys-devel/libtool
+ sys-devel/gcc"
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Was introduced for bug #34542, not sure if still needed
+ use amd64 && epatch "${FILESDIR}"/lwp-2.0-amd64.patch
+}
+
+src_install() {
+ einstall || die "einstall failed."
+ dodoc AUTHORS NEWS PORTING README
+}
diff --git a/sys-libs/lwp/lwp-2.6-r1.ebuild b/sys-libs/lwp/lwp-2.6-r1.ebuild
new file mode 100644
index 000000000000..f4206728130a
--- /dev/null
+++ b/sys-libs/lwp/lwp-2.6-r1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Light-weight process library (used by Coda)"
+HOMEPAGE="http://www.coda.cs.cmu.edu/"
+SRC_URI="http://www.coda.cs.cmu.edu/pub/lwp/src/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="1"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+src_prepare() {
+ eapply_user
+ # Was introduced for bug #34542, not sure if still needed
+ use amd64 && eapply "${FILESDIR}"/lwp-2.0-amd64.patch
+}
diff --git a/sys-libs/lwp/lwp-2.8.ebuild b/sys-libs/lwp/lwp-2.8.ebuild
new file mode 100644
index 000000000000..9f58c389b04d
--- /dev/null
+++ b/sys-libs/lwp/lwp-2.8.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit ltprune
+
+DESCRIPTION="Light-weight process library (used by Coda)"
+HOMEPAGE="http://www.coda.cs.cmu.edu/"
+SRC_URI="http://www.coda.cs.cmu.edu/pub/lwp/src/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="1"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+src_configure() {
+ econf --disable-static
+}
+
+src_install() {
+ default
+ prune_libtool_files
+}
diff --git a/sys-libs/lwp/metadata.xml b/sys-libs/lwp/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/sys-libs/lwp/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/sys-libs/mars/Manifest b/sys-libs/mars/Manifest
new file mode 100644
index 000000000000..aeacc1eea0b9
--- /dev/null
+++ b/sys-libs/mars/Manifest
@@ -0,0 +1,5 @@
+DIST mars-src-1.0.1.tar.gz 1264844 SHA256 f61e60fb219c265344e65f34976cd5db2ea55dea05b51fd7107d50f263dd5234 SHA512 56f46a19377b7c4058457082a54835d59ddae3c97e509eda1a977b637628edd352f14e0b2f8f8653e2f2de76ff73a5a4ed1b011213a7addc286c085a9c7c2a6e WHIRLPOOL b9b1eeb1e552a850f6b5c3ab9e3f8c397c91635bcad90306d774194d23c592bf591ac2239b9868af0c77be67c961dc0125fb091984af290f00f4b27509a4c2c0
+EBUILD mars-1.0.1.ebuild 828 SHA256 0bba03c239373fedff25275796ebb8fc7a78c8abff7163675eb7c221ac4b4e7d SHA512 70054d5008923d4b13db4b3901ea5840fa42c910735e4125c3979f02bcc8d2e6a0b4266db5cba36225c04151f9050d29dd364a0ee58c5109f3ad7af149c8cd1f WHIRLPOOL 2655d3595dc82e94c9d59bb9d67d8510159cb28c714df7a51c773be6b7dfcc46482fe405710ecad3b8c890f9270089d150eae2279a1a44f80c0ee3f4e5c8014d
+MISC ChangeLog 2167 SHA256 db61307743d6fbab63cb312d784acc3d25f127dbb49b1b0f16d85d5841da7ea8 SHA512 960279666640f283054a128a8bbc55aa8f78898e3584f23d843081e06625f4149927cf9c209f3a253463f4cb5efe3b882fba5703c1f13c1d0b7c6705fa247bb4 WHIRLPOOL 88b24a734291b755c5133cb13a79588df9802938258bf02d51c6667d182b167d92eb2b30175f0378d1b1e30983581ab29a8b5994a9dd6142739b99507a6742f5
+MISC ChangeLog-2015 454 SHA256 3d9ab46c54c76c6bc58b6d21e78dfbdf4f0c32e9eac3e8304006d82737c58d2f SHA512 4086a6ee17ccab0e4601b0ab25f20060119500610c152647148739efc4621762ecf843a2a3fe4d20142d923d1e53d7de0f0f28e071122def760a9c92001dcc2d WHIRLPOOL 6c2ce67ce28a3d91007e76654bd246d5f2bfabdb2f481835b62fd1eb4787cb1da630f99c3c2627b6d9c900a73c8b9589dce50299aa149feea728358b1cdab88e
+MISC metadata.xml 215 SHA256 ec941e5a9b17fa2573265412968cbb8492b06a48563c5fd46e7d8d3a856d345b SHA512 49695b6fe6c6840d991013455f167da37a67fa9fd326f2241778caeab2b7ab38bbb36b2f383ca6736c465b65cce7338ebb90468ceb30bdf5b5989449bb2d2ebd WHIRLPOOL 8e4e516fcbea41dd0d5bab3cb9029ef9e25e7d4bbdb3f30fe55b2fea193600b116d470070b6787b66770caf66cc62f183dbc56e48b26968c758b6a6164c83eb9
diff --git a/sys-libs/mars/mars-1.0.1.ebuild b/sys-libs/mars/mars-1.0.1.ebuild
new file mode 100644
index 000000000000..76bed6e21924
--- /dev/null
+++ b/sys-libs/mars/mars-1.0.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit autotools
+
+MY_P=${P/mars/mars-src}
+
+DESCRIPTION="Multicore Application Runtime System"
+HOMEPAGE="ftp://ftp.infradead.org/pub/Sony-PS3/mars/"
+SRC_URI="ftp://ftp.infradead.org/pub/Sony-PS3/mars/1.0.1/${MY_P}.tar.gz"
+
+LICENSE="MIT_Plus MIT"
+SLOT="0"
+KEYWORDS="~ppc64"
+IUSE=""
+
+DEPEND="sys-libs/libspe2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}/core"
+
+src_unpack () {
+ unpack ${A}
+ cd "${S}"
+ # repeat after me: "dummy tuples are bogus"
+ sed -i -e "s:/spu:/spu-elf:" \
+ -e "s:--host=spu:--host=spu-elf:" configure.ac
+ eautoreconf
+}
+
+src_compile () {
+ unset CFLAGS
+ unset CXXFLAGS
+ unset CFLAGS_ppc64
+ econf --with-mars-platform=cell || die
+ emake || die
+}
+
+src_install () {
+ emake -j1 DESTDIR="${D}" install
+}
diff --git a/sys-libs/mars/metadata.xml b/sys-libs/mars/metadata.xml
new file mode 100644
index 000000000000..dccede93222c
--- /dev/null
+++ b/sys-libs/mars/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 type="person">
+ <email>lu_zero@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/metadata.xml b/sys-libs/metadata.xml
new file mode 100644
index 000000000000..bb3bb995d357
--- /dev/null
+++ b/sys-libs/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 sys-libs category contains various system-level libraries.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría sys-libs contiene varias librerías del sistema.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie sys-libs enthält verschiedene Systembibliotheken.
+ </longdescription>
+ <longdescription lang="ja">
+ sys-libsカテゴリには様々なシステムレベルライブラリが含まれます。
+ </longdescription>
+ <longdescription lang="nl">
+ De sys-libs categorie bevat verschillende systeembibliotheken.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm sys-libs chứa các thư viện cấp hệ thống.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria sys-libs contiene varie librerie di sistema.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria sys-libs contém várias bibliotecas de sistema.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria sys-libs zawiera biblioteki systemowe.
+ </longdescription>
+</catmetadata>
+
diff --git a/sys-libs/mtdev/Manifest b/sys-libs/mtdev/Manifest
new file mode 100644
index 000000000000..33d401959601
--- /dev/null
+++ b/sys-libs/mtdev/Manifest
@@ -0,0 +1,7 @@
+DIST mtdev-1.1.4.tar.bz2 273780 SHA256 6b59b055ff22f2b91d4284187c2515826c338b81f6f33bd90f6bedc7c1fb9a38 SHA512 75da652e720cce9efcc23c2b72a0d8050096f054eff1338e02477816e107d469a7f9c5f4973146d38d939c3515ea39e926c70cf8f2ca0372c83c75506c61732b WHIRLPOOL 7cab0a478f342d019aae9103da36c18fdef137463d820f2f688fab18639e89a7f26b721a551b295df811262bd7d2466a9a405513b033c06abb9fd386a045fec3
+DIST mtdev-1.1.5.tar.bz2 274162 SHA256 6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f SHA512 78477a4af784e3f846df867f1428ffdc458e3ff33d465d45a84247a7e52f0e215cace397d72be64f6e641f07e0b97a930eff0e07fe9507e0138fb028a4037d6d WHIRLPOOL a0231e159b9a88ab2b46e72d64db1cfb9ae3734f8dc014c3be7bcde6e7c20b9587f0e0be83d5d37fddb5a1896f3419b58a80e97ab669993e6c01b2b1a19da1f2
+EBUILD mtdev-1.1.4.ebuild 552 SHA256 ecc140fc9dbc493c8da5b36dd4be93a6cff438a5db4cf467d628600b5ede4a0a SHA512 3e1df19fee71c0864c1564c80bb44391b8ddb88d929d11648e82210599000edb4b406602e022f29fa1e5217cb554e65219acd97db3078d6a58392b20a931787c WHIRLPOOL d1d7de09dba5e7ce4842bff990f707a89b085d0ba602e7045c56812a16112ce81cbdf1c192c2c48bcad9435ec926e955ac1246863d38325fef95d9043d3ae5a4
+EBUILD mtdev-1.1.5.ebuild 559 SHA256 999a9412a568837654f36cbfaf8cc35df2a59e7972f9e5cf11257e550eeb2647 SHA512 b1d733bfbbd319adcad7cb1527a37fef61949793b462fc44d6a74921cd9fd5c57bbdd6b88c9e4819043797c3188f051109f2310104e0706c7fa6e455d38d07f3 WHIRLPOOL 32c59f142528d81343e25a89bd5d34426705e2c21be6f25ab9efa9746b1b7aedb856a03c6c79e2ba82d043889d87457698232f7f7f890c06edd312168d65b759
+MISC ChangeLog 2469 SHA256 3bb3bef0384b93a4e6b28feaa50f4774f1cc45de58808ad6a26ec56d5c28f1b4 SHA512 071f74f49a7ee1ed82d84f50b444627b3aa459bf7d154b38caeb1492fd5fb294d895b1bd319206e368cd23da49a1dc4909f6843533b957f821913d3dbe572efb WHIRLPOOL 51e3780de328271d3fdbe6c3ce9e4cc28d0c7518af92ecb700aa89c72a7456c4aae726783a3f89173bb8eebf6ddb0a687d66988dd1111f98b1321cf65b48f7f9
+MISC ChangeLog-2015 5782 SHA256 c304abd5966a312ca2befba72c8b8f73aba412ed2b8236f28c36856c1c878895 SHA512 d72cefbc47e56199667fb92fa62ef8659706296f520b4f643d09385ee799a2269aa1992c5a7430597649d2a063adf33852af69b4f888f0556c8ed6422e97fce1 WHIRLPOOL 8939c56236b0126185c0d1e134a24552a08cebbc78a6e5db6a1a5c18321eb7ca284d47ff9613d27ef661fc13b1dbdc78ceb1fb5f3724c206beb68b672f63ec48
+MISC metadata.xml 307 SHA256 f6c5cd688b462a6fcb86824dfb90dd5a7659a8f66c22f623d35fa398c1aac957 SHA512 5765f66767b8854edcb68efbed96d5ad33a6b9dee582020b742de2136c19050bde444ac16359cefbf7ee463c842eb2ab6c6a46564a034497683d158e2d841ad5 WHIRLPOOL f45e23899ad68fa29c6a378e0e625de6f08a66988d68d9cb29d976d0e2b9d44cb3e0571e812c75d0a8a67d466bebbed69d538f244da2b503f5fd464a23670f30
diff --git a/sys-libs/mtdev/metadata.xml b/sys-libs/mtdev/metadata.xml
new file mode 100644
index 000000000000..01ea67263abc
--- /dev/null
+++ b/sys-libs/mtdev/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 type="person">
+ <email>naota@gentoo.org</email>
+</maintainer>
+<maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/mtdev/mtdev-1.1.4.ebuild b/sys-libs/mtdev/mtdev-1.1.4.ebuild
new file mode 100644
index 000000000000..61f8a84b8b86
--- /dev/null
+++ b/sys-libs/mtdev/mtdev-1.1.4.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="Multitouch Protocol Translation Library"
+HOMEPAGE="http://bitmath.org/code/mtdev/"
+SRC_URI="http://bitmath.org/code/mtdev/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE="static-libs"
+
+DEPEND=">=sys-kernel/linux-headers-2.6.31"
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/sys-libs/mtdev/mtdev-1.1.5.ebuild b/sys-libs/mtdev/mtdev-1.1.5.ebuild
new file mode 100644
index 000000000000..506e4fa49bc4
--- /dev/null
+++ b/sys-libs/mtdev/mtdev-1.1.5.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="Multitouch Protocol Translation Library"
+HOMEPAGE="http://bitmath.org/code/mtdev/"
+SRC_URI="http://bitmath.org/code/mtdev/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE="static-libs"
+
+DEPEND=">=sys-kernel/linux-headers-2.6.31"
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/sys-libs/musl-nscd/Manifest b/sys-libs/musl-nscd/Manifest
new file mode 100644
index 000000000000..75e6b3df2c91
--- /dev/null
+++ b/sys-libs/musl-nscd/Manifest
@@ -0,0 +1,6 @@
+AUX nscd.initd 1415 SHA256 e8043aabd7f0b6f9993d83cf041e2d9d55d2c05284cc6fe4f1dd3a5761591c95 SHA512 e0d5c6d7ea19043518755518adea00e9155902ad6c4095ecc653582f6c0b9f056eb64dd32814f799ae2ff0d51b8709166360a13a14126de015706d30b84af6ab WHIRLPOOL 395176fa21048f47eee072f2208f0ae28f2db6f0753f16fc36d055fd0a288ee4094866458c06c15e98fdbe20ab778b5d1890bf1e090e138c5373c5787330b13f
+AUX nscd.service 337 SHA256 de7bc9946309d34f0ab44aa22a4d3cf259fe91c57e8000d741cb09ecd3a6caa0 SHA512 2001100f3b054843c69b6fd2d38852c7c824282aa8998c25a3c0352db993705429d25c70d8ce6cb3579f836b7089644c520acac423ebd69cb1b36e94a77c5bea WHIRLPOOL f01d191971b0dc45f541c9ebaaa1a40f3497e2cc838cff6a20a7b1828d726c248abbd94322a5a5ff30c33ddb7d9086cd4d2ba3bdc1811fed59ff292ef3983a72
+AUX nscd.tmpfilesd 111 SHA256 f0f64c4612d2097173854d2ec2e94ecbf4b77c7a6e94d950874e37346aa90d72 SHA512 53b80b331e1a85d8ee16eb2ce547a7249e944926c3d1cdd4a47a5301a5c842ffc7ec1e3dc0a731542a8facf8261c1c57121802d01741aa89898a3476c09da340 WHIRLPOOL cf1fed1a7e2ac1623a84f1cfa2062645afe3f791da2f4ace3859d12aa05df0e282b4c2e367a460015956ac2a8d01fee4cda84917a3adf2c38561dff200335270
+EBUILD musl-nscd-9999.ebuild 664 SHA256 afffb7dfd80421a672192f28435eecf87d84516c19bb8b106387cb7cdc0af642 SHA512 a30eeab05e0cfe0427a59b40740b819cf236005f0cbbbca3e25990124d30040d141cc681e15947a47c6695e8ed8f9932a7ab72566cb6fd4d359ea941fcb0daf8 WHIRLPOOL 6cea6c9407b5f29523afba9a38e71be6fed2caf1a1a6ec60e142904db794d1af38cbeb47381dd313a9c380b6f7b523c06f736d2511d4e3498bb56ced07225f8c
+MISC ChangeLog 456 SHA256 82b5ec7b15aea90fc4697c6b84497fed12adfc79ec7d8ebfe50f71de62839045 SHA512 fdc6e3f42e8c99e4bcb14f000830d183ad8f2ad5b4c6e989a929cb59563e6f59516652e1c0fef170be8a7cc5baac4f0358fb463856d78251fcc36b3b21f0b54d WHIRLPOOL c8430000e88427a2376a238e422054b5da9b9629e8d5b6ab0626503c01e326b8ec9e6393bfb25290f51e1943b4a74dc9c8fe19711cdda6f75a19737ea3b90d68
+MISC metadata.xml 402 SHA256 0d54a9356015fce546623e40afe99d762f1a69c0ca19d2344ef5a49acd9ac1f2 SHA512 365e5b780076080f19c4377606fd39a4c4f321e5383ed41d7a644601e705942a9c5264acd4a5390c2a57bb3d9bfcd5df00ad961bd07c5e7f28e4d5123b1a24f8 WHIRLPOOL aaa7eeab92d759486ed5ef48f36436e66c4e651f3155209a49d90b79259c28e29b2eb26678f02ad284bd806d9ea7b00c07410c79f0bf3911debce6f6bee63b94
diff --git a/sys-libs/musl-nscd/files/nscd.initd b/sys-libs/musl-nscd/files/nscd.initd
new file mode 100644
index 000000000000..1bf83e7808af
--- /dev/null
+++ b/sys-libs/musl-nscd/files/nscd.initd
@@ -0,0 +1,59 @@
+#!/sbin/openrc-run
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use dns ldap net slapd
+}
+
+checkconfig() {
+ if [ ! -d /var/run/nscd ] ; then
+ mkdir -p /var/run/nscd
+ chmod 755 /var/run/nscd
+ fi
+ if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then
+ echo ""
+ ewarn "nscd run dir is not world readable, you should reset the perms:"
+ ewarn "chmod 755 /var/run/nscd"
+ ewarn "chmod a+rw /var/run/nscd/socket"
+ echo ""
+ ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd"
+ echo ""
+ fi
+}
+
+start() {
+ checkconfig
+
+ ebegin "Starting Name Service Cache Daemon"
+ local secure=`while read curline ; do
+ table=${curline%:*}
+ entries=${curline##$table:}
+ table=${table%%[^a-z]*}
+ case $table in
+ passwd*|group*|hosts)
+ for entry in $entries ; do
+ case $entry in
+ nisplus*)
+ /usr/sbin/nscd_nischeck $table || \
+ /echo "-S $table,yes"
+ ;;
+ esac
+ done
+ ;;
+ esac
+ done < /etc/nsswitch.conf`
+ mkdir -p "$(dirname ${PIDFILE:-/var/run/nscd/nscd.pid})"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/nscd --pidfile "${PIDFILE:-/var/run/nscd/nscd.pid}" \
+ -- $secure
+ eend $?
+}
+
+stop() {
+ ebegin "Shutting down Name Service Cache Daemon"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/nscd --pidfile "${PIDFILE:-/var/run/nscd/nscd.pid}"
+ eend $?
+}
+
+# vim:ts=4
diff --git a/sys-libs/musl-nscd/files/nscd.service b/sys-libs/musl-nscd/files/nscd.service
new file mode 100644
index 000000000000..25a3b1d9be0a
--- /dev/null
+++ b/sys-libs/musl-nscd/files/nscd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Name Service Cache Daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/nscd -F
+ExecStop=/usr/sbin/nscd --shutdown
+ExecReload=/usr/sbin/nscd -i passwd
+ExecReload=/usr/sbin/nscd -i group
+ExecReload=/usr/sbin/nscd -i hosts
+ExecReload=/usr/sbin/nscd -i services
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-libs/musl-nscd/files/nscd.tmpfilesd b/sys-libs/musl-nscd/files/nscd.tmpfilesd
new file mode 100644
index 000000000000..52edbba673cf
--- /dev/null
+++ b/sys-libs/musl-nscd/files/nscd.tmpfilesd
@@ -0,0 +1,4 @@
+# Configuration to create /run/nscd directory
+# Used as part of systemd's tmpfiles
+
+d /run/nscd 0755 root root
diff --git a/sys-libs/musl-nscd/metadata.xml b/sys-libs/musl-nscd/metadata.xml
new file mode 100644
index 000000000000..7a97e61f8d53
--- /dev/null
+++ b/sys-libs/musl-nscd/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 type="person">
+ <email>lejonet@gentoo.org</email>
+ <name>Daniel Kuehn</name>
+ </maintainer>
+ <use>
+ <flag name="minimal">Only installs the header files</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">pikhq/musl-nscd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/musl-nscd/musl-nscd-9999.ebuild b/sys-libs/musl-nscd/musl-nscd-9999.ebuild
new file mode 100644
index 000000000000..cdee80a89452
--- /dev/null
+++ b/sys-libs/musl-nscd/musl-nscd-9999.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit git-r3 systemd
+
+DESCRIPTION="musl-nscd is an implementation of the NSCD protocol for the musl libc"
+HOMEPAGE="https://github.com/pikhq/musl-nscd"
+EGIT_REPO_URI="https://github.com/pikhq/musl-nscd"
+EGIT_BRANCH=master
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="minimal"
+
+src_install() {
+ if use minimal; then
+ emake DESTDIR="${D}" install-headers
+ else
+ emake DESTDIR="${D}" install
+
+ newinitd "${FILESDIR}"/nscd.initd nscd
+ systemd_dounit "${FILESDIR}"/nscd.service
+ systemd_newtmpfilesd "${FILESDIR}"/nscd.tmpfilesd nscd.conf
+
+ dodoc README
+ fi
+}
diff --git a/sys-libs/musl/Manifest b/sys-libs/musl/Manifest
new file mode 100644
index 000000000000..d88796c94fe7
--- /dev/null
+++ b/sys-libs/musl/Manifest
@@ -0,0 +1,15 @@
+AUX getent 1168 SHA256 391f5e2bf876d1a5d0ebc4bd80f15e297049cf3296252dfee6549d32e9b43f6a SHA512 60e10b9ac073e5b648b2c22c8e75a3f2c8a26e28f6d50059e4b921f17adbd0f6d7aa65d8441ebab19f07b21592425962b736071c55d0c274855bc1dbb2567382 WHIRLPOOL 4c0422d73eb5f4cfe91c49e95364778cf3453409c3948b375dc5e021be1e0186c110b9d0f674722db211f772cb4da1414ea06aaaed75cd853d31cb13bb70b5c0
+AUX ldconfig.in 2552 SHA256 a20122f108d85b4e632fcef92588561e854593a63aa67ae2b6264f3f2d33f06a SHA512 59f1b57361196363d3f127366764f05d26c23dbe3d3dbcdba9bd3c8ca26a671fd713b96d31c509d22805c57ada2b596d979a3f5795bcf0a4d3ac7d168f3bf377 WHIRLPOOL 35d6ec22820b6b02f112b102fbc56a8c38757e0d3a94798784f14de2d87bdc3c89b00fc6099736a9ede148d09a3066039b19c7ed63646b9135157f11caa0e04a
+AUX musl-1.1.15-CVE.patch 2588 SHA256 21b955f86d577bd674efdfb391d00294d6c9b3b04840c6ad04eba86642810d0f SHA512 3cd3fefb47e24b82d4f08d9f4915a84e0844568d8bd94a0e94358fa1578a36dfdbe26e190c57a8e3ce4428aa75edc4f1bbae53ee859d653ced00d1cbabea2a16 WHIRLPOOL dfa39568c5fa714920273412ea76144b1bb5a3d4593d4b6e5adc9e917572bf422358b95f9614cd4c51ed3082aa8d0ec084b7b9089771f8bcb2f1b0e8f68812e5
+AUX musl-1.1.15-assert.patch 1473 SHA256 e002678e5facf04d7b74a6b53bedaa8cc212bbf54c43dbd22a801471f861ed5d SHA512 b456862f48c09d42c44705ba45e1d3a9a8dff964f8db53304da8328e926c82a090a641e20b89fe2074fba3121ee5d6dd120bdcf02afae39a6b04519d08e107b0 WHIRLPOOL 3e2199bd58b977fbd480c980636822335618fdf3335c1176f2ede1a5a5bedea91b3f0101df25d572e7b1703fc910c82903ed6a25fce216ca98a92dbf06a8e07f
+DIST getconf.c 11614 SHA256 d87d0cbb3690ae2c5d8cc218349fd8278b93855dd625deaf7ae50e320aad247c SHA512 0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d WHIRLPOOL 279170a21cd6d5b560b0c834236acf4989f1a7f5e9ecf9d7e594abc21b65f8aeb26a26475c49f4052d5f9b4f9d95032d22b1790dbd99e3f55c3677eb9fc6df8b
+DIST getent.c 9438 SHA256 68373a55e89ce85c562d941ccf588337d6cc6c9c17689d695f65cd7607134bbe SHA512 b35de9847353b273516162ed4828a810c6130fc5b7de44ee4433003b3f99647b25792d9b1c40dfc67069add11f3fb850e5c35d4f1912dccac108059bbbdfd5a2 WHIRLPOOL 473e54a9158e70c411f4c84e590bcfd245051212a3346a3c6dd45df9f09a5fbccbc8900ad7f8691eb5ebb8cd1002caf9519abaffb1753175d4f8acb1d32236b4
+DIST iconv.c 2577 SHA256 f79a2930a2e5bb0624321589edf8b889d1e9b603e01e6b7ae214616605b3fdd7 SHA512 9d42d66fb1facce2b85dad919be5be819ee290bd26ca2db00982b2f8e055a0196290a008711cbe2b18ec9eee8d2270e3b3a4692c5a1b807013baa5c2b70a2bbf WHIRLPOOL 8b067d7f3e5b8c9862cf78cf727fa748d9b6b23be518df382251d1e3e0a6eb386b1fd7788ba3b36dadba03aa5b43e25eb25528efcadc74fa543c38a61650c5bc
+DIST musl-1.1.15.tar.gz 911600 SHA256 97e447c7ee2a7f613186ec54a93054fe15469fe34d7d323080f7ef38f5ecb0fa SHA512 9e923572c0d6bad3dc2d2646d4b0699c10b477ce6300ac6c6224895192a90667f581ddf6eda2ab8c4c16f47bde4bccb03bb90478638d136d9df721430f4d0163 WHIRLPOOL 68c510cf7d4216ccc5775466fa23f76ebecf1658552d613dee523bb7cc3a9f824959fe76355d1ce47326b276bf2657c9b4f3f557d81bf9c1a873f18405ad8ebf
+DIST musl-1.1.16.tar.gz 927178 SHA256 937185a5e5d721050306cf106507a006c3f1f86d86cd550024ea7be909071011 SHA512 47c00e50b7605102fb4aebe1f9ba9db94d26fac64805f6d744c9c557a05b8a58dff7f9558ff7c8d66b5d7c43740cdc2dd79448bacac47f1414e6ada99c210140 WHIRLPOOL d4e84ef591a1cee0a64d4abf258b7cb2eeacfa7b11695b1bfa89bafde0404e8310a02ab04814df2d4a9ac812a640bbcf8695bab10807f8b8d64c5bdb9d468ca4
+EBUILD musl-1.1.15-r2.ebuild 3112 SHA256 d5cb6b8240cb48671c54c0c906cc5223ab8bdc01c6b295005c551d1837ad3252 SHA512 cd2729c1c59507222057f5a2c437717bbffe1ed7b1020e499db5bb70984dbaecb582aa05a17366cd99e43924a516b9846cedc5e942e756238870dabfac0e6f9b WHIRLPOOL a1f3204fae061481daa2419114b230c66d9a032df040150c65f3f001b29aced8affaa0e144b42824dbc8d660cab79405b4f823c08576cdd816177f8273cff1a2
+EBUILD musl-1.1.16.ebuild 3035 SHA256 bb5f2d4ad83a43b117974b653f4541624991d9ab717455397287517d9ee8188d SHA512 ee3070225a21e9190b4decc0e941ee459dc0e1c63e8a6b8eb3e2fe188489f3773a7495cc3df97c4f677004a256f8b4e9340496fd317ae321965656fe406af80d WHIRLPOOL 393abd3f6e99bb1b068ef5dea174bc841450fe52bdd2e01034161f6a0b95c6ec2594fec8fe51a4951c485aabdcc94ac4486e0d42cc32f3cd496fa947d5854b3a
+EBUILD musl-9999.ebuild 3039 SHA256 2385034fd93004b9d1aa0de1096c5970550de8b8efd02164d072acee3722f80f SHA512 ab442afb391fdff836903fd3e4c992ed8e7dcd08f1dc0215b9d736a0ac31ce8de050aae0310a0e2936a3bf63ceb39bb6ad8cb3c8f039f0e51e3cb03c621f1627 WHIRLPOOL e78dd737b434115a01f93da36ae8c0c7debc10697eab6303f82eeef333cff68c88308f21155bee9489528799dc9ce98f6f1b510e6c0f57fbe8dbc422120291b6
+MISC ChangeLog 8991 SHA256 71210d4c919758cfbf25b3fbc793333491064e5bce9b9129000db56987d2a463 SHA512 50bd06fa95a6983bbfce3772504a1d153551af1b6a07fc578330ab8064c951bce9b310aac41ba7ca63fd7ccd365be84076843a4f062c3c2fbe07f9d9e2447cf3 WHIRLPOOL ebbf5bcddeb3a2b012d86b601bc4c207eb9b7f340ffceb13822d5c9007f7a2c14ba0d5747722ad73d3b3bcc9307635fe40a53bd7a8c2c662e1f6ba2aaca6e780
+MISC ChangeLog-2015 9169 SHA256 e19f60cbf940f7b138a478c51370443f09f0eddb00ab04cf8cf9977f67aec7ef SHA512 2c1a8f01d3e939fcf7d1e1c6781b4d09b0ab4c60c4911366d892333f62d62abdb2c8d5a7178dcb5ac3eae5a971e34a2d1c801ed44066dc2c68f0896732954dba WHIRLPOOL 137f3308e2edee1a1d836d04cc46bb00b4d2022eb3c7d882f5b54d47e91edf250a559aa9cf922fe0a3d874bf880f619230a53cdf24ac89822f358b8cd50f40d8
+MISC metadata.xml 452 SHA256 90358b6f07879cb68c7a5f476ea8e1ce1db78e286fdb5ed005963427b2267fed SHA512 676d8122179a5cb56e0b9c7aeb7f0aec8c19b5d7b604a19c9ee01aeca837a74cc4284e87cc743d0eaf527f0c79afdfeb1f238c204a8a6c1c5590b2718bbc9b03 WHIRLPOOL ed9e1e5b6ba088a271d5080803449aecfc3110ba4f0f5b373f6fb5cc089344fe2ad952d05a970ad5c3f5acaa9a187b891b89a5e0404ff9ff5949470c31173033
diff --git a/sys-libs/musl/files/getent b/sys-libs/musl/files/getent
new file mode 100644
index 000000000000..b7de424354b6
--- /dev/null
+++ b/sys-libs/musl/files/getent
@@ -0,0 +1,45 @@
+#!/bin/sh
+# This files is part of uClibc.
+# Distributed under the terms of the Lesser GNU General Public License v2
+#
+# Closely (not perfectly) emulate the behavior of glibc's getent utility
+#
+#passwd|shadow|group|aliases|hosts|networks|ethers|netgroup|protocols|services|rpc
+# only returns the first match (by design)
+# dns based search is not supported (hosts,networks)
+# case-insensitive matches not supported (ethers; others?)
+# may return false-positives (hosts,protocols,rpc,services,ethers)
+
+[ -z "$PATH" ] && PATH="/bin:/usr/bin" || PATH="${PATH}:/bin:/usr/bin"
+export PATH
+
+file="/etc/$1"
+case $1 in
+ passwd|group)
+ match="^$2:\|^[^:]*:[^:]*:$2:" ;;
+ shadow)
+ match="^$2:" ;;
+ networks|netgroup)
+ match="^[[:space:]]*$2\>" ;;
+ hosts|protocols|rpc|services|ethers)
+ match="\<$2\>" ;;
+ aliases)
+ match="^[[:space:]]*$2[[:space:]]*:" ;;
+ ""|-h|--help)
+ echo "USAGE: $0 database [key]"
+ exit 0 ;;
+ *)
+ echo "$0: Unknown database: $1" 1>&2
+ exit 1 ;;
+esac
+
+if [ ! -f "$file" ] ; then
+ echo "$0: Could not find database file for $1" 1>&2
+ exit 1
+fi
+
+if [ $# -eq 1 ] ; then
+ exec cat "$file"
+else
+ sed "s/#.*//; /$match/q; d" "$file" | grep . || exit 2
+fi
diff --git a/sys-libs/musl/files/ldconfig.in b/sys-libs/musl/files/ldconfig.in
new file mode 100644
index 000000000000..19c94d85353a
--- /dev/null
+++ b/sys-libs/musl/files/ldconfig.in
@@ -0,0 +1,144 @@
+#!/bin/bash -e
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+ROOT="/"
+
+LDSO_CONF="/etc/ld.so.conf"
+if [[ ! -e $LDSO_CONF ]]; then
+ echo "$LDSO_CONF not found" >&2
+ exit 1
+fi
+
+LDSO_CONF_DIR=$(dirname $LDSO_CONF)
+
+VERBOSE=0
+
+UPDATE_LINKS=1
+
+get_options() {
+ while getopts "vnNXf:C:r:p" opt "$@"; do
+ case $opt in
+ v)
+ echo "ldconfig for musl in Gentoo"
+ VERBOSE=1
+ ;;
+ r)
+ ROOT=$OPTARG
+ ;;
+ f)
+ LDSO_CONF=$OPTARG
+ ;;
+ X)
+ UPDATE_LINKS=0
+ ;;
+ \?)
+ echo "Invalid option: -$opt" >&2
+ exit 1
+ ;;
+ n|N|C|p)
+ echo "Unimplemented option: -$opt" >&2
+ exit 1
+ ;;
+ esac
+ done
+
+ if [[ $UPDATE_LINKS == 1 ]]; then
+ echo "Updating links is not implemented."
+ fi
+}
+
+
+repeated() {
+ local l=$1
+ local drs="${@:2}"
+ for m in $drs; do
+ [[ $m == $l ]] && return 0
+ done
+ return 1
+}
+
+expand() {
+ # We are assuming the ld.so.conf's 'include' is not recursive
+ local f line l
+ local glob="$LDSO_CONF_DIR/$1"
+ local drs="${@:2} "
+
+ for f in $glob; do
+ [[ ! -f $f ]] && continue
+ while read line; do
+ line=${line%%#*}
+ line=${line//:/ }
+ line=${line//,/ }
+ for l in $line; do
+ #We must add this whether or not the directory exists
+ repeated $l $drs && continue
+ drs+=" $l "
+ done
+ done < $f
+ done
+
+ echo $drs
+}
+
+read_ldso_conf() {
+ local drs=" "
+
+ while read line; do
+ # Sanitize the line - see ldconfig(8) for delimiters
+ # Note: bash read turns tabs into spaces and read already
+ # delimits on newlines with the default $IFS
+ line=${line%%#*} # Remove comments
+ line=${line//:/ } # Change colon delimiter to space
+ line=${line//,/ } # Change comma delimiter to space
+
+ next=0
+ for l in $line; do
+ if [[ $next == 1 ]]; then
+ next=0
+ drs=$(expand $l $drs)
+ elif [[ $l == "include" ]]; then
+ next=1
+ else
+ # glibc's ldconfig silently skips non directories
+ if [[ -d $l ]]; then
+ repeated $l $drs && continue
+ drs+=" $l "
+ fi
+ fi
+ done
+ done < $1
+
+ echo $drs
+}
+
+sanitize() {
+ local drs=$@
+
+ repeated "/lib" $drs || drs="/lib $drs"
+ repeated "/usr/lib" $drs || drs="/usr/lib $drs"
+
+ echo $drs
+}
+
+get_options "$@"
+drs=$(read_ldso_conf "$LDSO_CONF")
+drs=$(sanitize $drs)
+
+ARCH=@@ARCH@@
+LDSO_PATH="/lib/ld-musl-${ARCH}.so.1"
+if [[ ! -e $LDSO_PATH ]]; then
+ echo "$LDSO_PATH not found" >&2
+ exit 1
+fi
+
+LDSO_ARCH=$(basename $LDSO_PATH)
+LDSO_NAME=${LDSO_ARCH%.so.1}
+ETC_LDSO_PATH=/etc/${LDSO_NAME}.path
+
+X=$(mktemp -p /tmp ${LDSO_NAME}.XXXXXX)
+for d in $drs; do
+ echo $d >> $X
+done
+chmod 644 $X
+mv $X $ETC_LDSO_PATH
diff --git a/sys-libs/musl/files/musl-1.1.15-CVE.patch b/sys-libs/musl/files/musl-1.1.15-CVE.patch
new file mode 100644
index 000000000000..64fbbdcd8eb1
--- /dev/null
+++ b/sys-libs/musl/files/musl-1.1.15-CVE.patch
@@ -0,0 +1,68 @@
+From c3edc06d1e1360f3570db9155d6b318ae0d0f0f7 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Thu, 06 Oct 2016 22:34:58 +0000
+Subject: fix missing integer overflow checks in regexec buffer size computations
+
+most of the possible overflows were already ruled out in practice by
+regcomp having already succeeded performing larger allocations.
+however at least the num_states*num_tags multiplication can clearly
+overflow in practice. for safety, check them all, and use the proper
+type, size_t, rather than int.
+
+also improve comments, use calloc in place of malloc+memset, and
+remove bogus casts.
+---
+diff --git a/src/regex/regexec.c b/src/regex/regexec.c
+index 16c5d0a..dd52319 100644
+--- a/src/regex/regexec.c
++++ b/src/regex/regexec.c
+@@ -34,6 +34,7 @@
+ #include <wchar.h>
+ #include <wctype.h>
+ #include <limits.h>
++#include <stdint.h>
+
+ #include <regex.h>
+
+@@ -206,11 +207,24 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string,
+
+ /* Allocate memory for temporary data required for matching. This needs to
+ be done for every matching operation to be thread safe. This allocates
+- everything in a single large block from the stack frame using alloca()
+- or with malloc() if alloca is unavailable. */
++ everything in a single large block with calloc(). */
+ {
+- int tbytes, rbytes, pbytes, xbytes, total_bytes;
++ size_t tbytes, rbytes, pbytes, xbytes, total_bytes;
+ char *tmp_buf;
++
++ /* Ensure that tbytes and xbytes*num_states cannot overflow, and that
++ * they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */
++ if (num_tags > SIZE_MAX/(8 * sizeof(int) * tnfa->num_states))
++ goto error_exit;
++
++ /* Likewise check rbytes. */
++ if (tnfa->num_states+1 > SIZE_MAX/(8 * sizeof(*reach_next)))
++ goto error_exit;
++
++ /* Likewise check pbytes. */
++ if (tnfa->num_states > SIZE_MAX/(8 * sizeof(*reach_pos)))
++ goto error_exit;
++
+ /* Compute the length of the block we need. */
+ tbytes = sizeof(*tmp_tags) * num_tags;
+ rbytes = sizeof(*reach_next) * (tnfa->num_states + 1);
+@@ -221,10 +235,9 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string,
+ + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes;
+
+ /* Allocate the memory. */
+- buf = xmalloc((unsigned)total_bytes);
++ buf = calloc(total_bytes, 1);
+ if (buf == NULL)
+ return REG_ESPACE;
+- memset(buf, 0, (size_t)total_bytes);
+
+ /* Get the various pointers within tmp_buf (properly aligned). */
+ tmp_tags = (void *)buf;
+--
+cgit v0.9.0.3-65-g4555
diff --git a/sys-libs/musl/files/musl-1.1.15-assert.patch b/sys-libs/musl/files/musl-1.1.15-assert.patch
new file mode 100644
index 000000000000..d531d1727642
--- /dev/null
+++ b/sys-libs/musl/files/musl-1.1.15-assert.patch
@@ -0,0 +1,43 @@
+From e738b8cbe64b6dd3ed9f47b6d4cd7eb2c422b38d Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Tue, 30 Aug 2016 20:39:54 +0000
+Subject: restore _Noreturn to __assert_fail
+
+this reverts commit 2c1f8fd5da3306fd7c8a2267467e44eb61f12dd4. without
+the _Noreturn attribute, the compiler cannot use asserts to perform
+reachability/range analysis. this leads to missed optimizations and
+spurious warnings.
+
+the original backtrace problem that prompted the removal of _Noreturn
+was not clearly documented at the time, but it seems to happen only
+when libc was built without -g, which also breaks many other
+backtracing cases.
+---
+diff --git a/include/assert.h b/include/assert.h
+index e679adb..d14ec94 100644
+--- a/include/assert.h
++++ b/include/assert.h
+@@ -16,7 +16,7 @@
+ extern "C" {
+ #endif
+
+-void __assert_fail (const char *, const char *, int, const char *);
++_Noreturn void __assert_fail (const char *, const char *, int, const char *);
+
+ #ifdef __cplusplus
+ }
+diff --git a/src/exit/assert.c b/src/exit/assert.c
+index e87442a..49b0dc3 100644
+--- a/src/exit/assert.c
++++ b/src/exit/assert.c
+@@ -1,7 +1,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+
+-void __assert_fail(const char *expr, const char *file, int line, const char *func)
++_Noreturn void __assert_fail(const char *expr, const char *file, int line, const char *func)
+ {
+ fprintf(stderr, "Assertion failed: %s (%s: %s: %d)\n", expr, file, func, line);
+ fflush(NULL);
+--
+cgit v0.9.0.3-65-g4555
diff --git a/sys-libs/musl/metadata.xml b/sys-libs/musl/metadata.xml
new file mode 100644
index 000000000000..cd4b91b3e67d
--- /dev/null
+++ b/sys-libs/musl/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 type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>lu_zero@gentoo.org</email>
+ </maintainer>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/musl/musl-1.1.15-r2.ebuild b/sys-libs/musl/musl-1.1.15-r2.ebuild
new file mode 100644
index 000000000000..38374a823493
--- /dev/null
+++ b/sys-libs/musl/musl-1.1.15-r2.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.musl-libc.org/musl"
+ inherit git-r3
+ SRC_URI="
+ https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+ https://dev.gentoo.org/~blueness/musl-misc/getent.c
+ https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
+ KEYWORDS=""
+else
+ SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz
+ https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+ https://dev.gentoo.org/~blueness/musl-misc/getent.c
+ https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
+ KEYWORDS="-* amd64 arm ~mips ppc x86"
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
+HOMEPAGE="http://www.musl-libc.org/"
+LICENSE="MIT LGPL-2 GPL-2"
+SLOT="0"
+IUSE="crosscompile_opts_headers-only"
+
+QA_SONAME="/usr/lib/libc.so"
+QA_DT_NEEDED="/usr/lib/libc.so"
+
+PATCHES=(
+ "${FILESDIR}/${P}-assert.patch"
+ "${FILESDIR}/${P}-CVE.patch"
+ )
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+pkg_setup() {
+ if [ ${CTARGET} == ${CHOST} ] ; then
+ case ${CHOST} in
+ *-musl*) ;;
+ *) die "Use sys-devel/crossdev to build a musl toolchain" ;;
+ esac
+ fi
+}
+
+src_configure() {
+ tc-getCC ${CTARGET}
+ just_headers && export CC=true
+
+ local sysroot
+ is_crosscompile && sysroot=/usr/${CTARGET}
+ ./configure \
+ --target=${CTARGET} \
+ --prefix=${sysroot}/usr \
+ --syslibdir=${sysroot}/lib \
+ --disable-gcc-wrapper || die
+}
+
+src_compile() {
+ emake obj/include/bits/alltypes.h
+ just_headers && return 0
+
+ emake
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/getconf.c -o "${T}"/getconf || die
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/getent.c -o "${T}"/getent || die
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/iconv.c -o "${T}"/iconv || die
+}
+
+src_install() {
+ local target="install"
+ just_headers && target="install-headers"
+ emake DESTDIR="${D}" ${target}
+ just_headers && return 0
+
+ # musl provides ldd via a sym link to its ld.so
+ local sysroot
+ is_crosscompile && sysroot=/usr/${CTARGET}
+ local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
+ dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
+
+ if [[ ${CATEGORY} != cross-* ]] ; then
+ local arch=$("${D}"usr/lib/libc.so 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p')
+ [[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
+ cp "${FILESDIR}"/ldconfig.in "${T}" || die
+ sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
+ into /
+ dosbin "${T}"/ldconfig
+ into /usr
+ dobin "${T}"/getconf
+ dobin "${T}"/getent
+ dobin "${T}"/iconv
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die
+ doenvd "${T}"/00musl || die
+ fi
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ [ "${ROOT}" != "/" ] && return 0
+
+ ldconfig || die
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/musl/musl-1.1.16.ebuild b/sys-libs/musl/musl-1.1.16.ebuild
new file mode 100644
index 000000000000..af34891af2d5
--- /dev/null
+++ b/sys-libs/musl/musl-1.1.16.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.musl-libc.org/musl"
+ inherit git-r3
+ SRC_URI="
+ https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+ https://dev.gentoo.org/~blueness/musl-misc/getent.c
+ https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
+ KEYWORDS=""
+else
+ SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz
+ https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+ https://dev.gentoo.org/~blueness/musl-misc/getent.c
+ https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
+ KEYWORDS="-* amd64 arm ~mips ppc x86"
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
+HOMEPAGE="http://www.musl-libc.org/"
+LICENSE="MIT LGPL-2 GPL-2"
+SLOT="0"
+IUSE="crosscompile_opts_headers-only"
+
+QA_SONAME="/usr/lib/libc.so"
+QA_DT_NEEDED="/usr/lib/libc.so"
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+pkg_setup() {
+ if [ ${CTARGET} == ${CHOST} ] ; then
+ case ${CHOST} in
+ *-musl*) ;;
+ *) die "Use sys-devel/crossdev to build a musl toolchain" ;;
+ esac
+ fi
+}
+
+src_configure() {
+ tc-getCC ${CTARGET}
+ just_headers && export CC=true
+
+ local sysroot
+ is_crosscompile && sysroot=/usr/${CTARGET}
+ ./configure \
+ --target=${CTARGET} \
+ --prefix=${sysroot}/usr \
+ --syslibdir=${sysroot}/lib \
+ --disable-gcc-wrapper || die
+}
+
+src_compile() {
+ emake obj/include/bits/alltypes.h
+ just_headers && return 0
+
+ emake
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/getconf.c -o "${T}"/getconf || die
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/getent.c -o "${T}"/getent || die
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/iconv.c -o "${T}"/iconv || die
+}
+
+src_install() {
+ local target="install"
+ just_headers && target="install-headers"
+ emake DESTDIR="${D}" ${target}
+ just_headers && return 0
+
+ # musl provides ldd via a sym link to its ld.so
+ local sysroot
+ is_crosscompile && sysroot=/usr/${CTARGET}
+ local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
+ dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
+
+ if [[ ${CATEGORY} != cross-* ]] ; then
+ local arch=$("${D}"usr/lib/libc.so 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p')
+ [[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
+ cp "${FILESDIR}"/ldconfig.in "${T}" || die
+ sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
+ into /
+ dosbin "${T}"/ldconfig
+ into /usr
+ dobin "${T}"/getconf
+ dobin "${T}"/getent
+ dobin "${T}"/iconv
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die
+ doenvd "${T}"/00musl || die
+ fi
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ [ "${ROOT}" != "/" ] && return 0
+
+ ldconfig || die
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/musl/musl-9999.ebuild b/sys-libs/musl/musl-9999.ebuild
new file mode 100644
index 000000000000..4b53b12d810a
--- /dev/null
+++ b/sys-libs/musl/musl-9999.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.musl-libc.org/musl"
+ inherit git-r3
+ SRC_URI="
+ https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+ https://dev.gentoo.org/~blueness/musl-misc/getent.c
+ https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
+ KEYWORDS=""
+else
+ SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz
+ https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+ https://dev.gentoo.org/~blueness/musl-misc/getent.c
+ https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
+ KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
+HOMEPAGE="http://www.musl-libc.org/"
+LICENSE="MIT LGPL-2 GPL-2"
+SLOT="0"
+IUSE="crosscompile_opts_headers-only"
+
+QA_SONAME="/usr/lib/libc.so"
+QA_DT_NEEDED="/usr/lib/libc.so"
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+pkg_setup() {
+ if [ ${CTARGET} == ${CHOST} ] ; then
+ case ${CHOST} in
+ *-musl*) ;;
+ *) die "Use sys-devel/crossdev to build a musl toolchain" ;;
+ esac
+ fi
+}
+
+src_configure() {
+ tc-getCC ${CTARGET}
+ just_headers && export CC=true
+
+ local sysroot
+ is_crosscompile && sysroot=/usr/${CTARGET}
+ ./configure \
+ --target=${CTARGET} \
+ --prefix=${sysroot}/usr \
+ --syslibdir=${sysroot}/lib \
+ --disable-gcc-wrapper || die
+}
+
+src_compile() {
+ emake obj/include/bits/alltypes.h
+ just_headers && return 0
+
+ emake
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/getconf.c -o "${T}"/getconf || die
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/getent.c -o "${T}"/getent || die
+ $(tc-getCC) ${CFLAGS} "${DISTDIR}"/iconv.c -o "${T}"/iconv || die
+}
+
+src_install() {
+ local target="install"
+ just_headers && target="install-headers"
+ emake DESTDIR="${D}" ${target}
+ just_headers && return 0
+
+ # musl provides ldd via a sym link to its ld.so
+ local sysroot
+ is_crosscompile && sysroot=/usr/${CTARGET}
+ local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
+ dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
+
+ if [[ ${CATEGORY} != cross-* ]] ; then
+ local arch=$("${D}"usr/lib/libc.so 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p')
+ [[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
+ cp "${FILESDIR}"/ldconfig.in "${T}" || die
+ sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
+ into /
+ dosbin "${T}"/ldconfig
+ into /usr
+ dobin "${T}"/getconf
+ dobin "${T}"/getent
+ dobin "${T}"/iconv
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die
+ doenvd "${T}"/00musl || die
+ fi
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ [ "${ROOT}" != "/" ] && return 0
+
+ ldconfig || die
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/ncurses/Manifest b/sys-libs/ncurses/Manifest
new file mode 100644
index 000000000000..879da35c871a
--- /dev/null
+++ b/sys-libs/ncurses/Manifest
@@ -0,0 +1,19 @@
+AUX ncurses-5.7-nongnu.patch 361 SHA256 7efcf3daf57d73e348bea1ea7ee77071aef5338631958fd0db595a011570cec4 SHA512 818a3ac1c68c1a11f23471195a32793c5546c5b37a724989cc58f3fad50fd3c8608762efc5d72e986f3c77ccdfbb72f27224f64ef415a96d71924a9f1d3b1b5f WHIRLPOOL a93e22415092ab51f769e42586813c8fed5b502e1dd86d09844f524876ac025ca81399dde483478087bb6241214f85c29a27f8b4ccadc2aec37be99dc7d6da1b
+AUX ncurses-5.8-gfbsd.patch 695 SHA256 68c405dcd1b2bbad1d4880d906ba9e02ad62691c63edfb363ad767ee01079e82 SHA512 d4c375107415b7eaf5f8e04b697ef16998855b5f1d745766a14a7e9523d12b24d0841e6559217eccf62535f54e0d240eabaa3da1571964f1bb150b0c0cd102a2 WHIRLPOOL 6c2f865bc22a3932f6f973f7b53c5a50254505c4944c656af95c2399933c31acc5d5536d59fe9fe7c59ef537ce0d39ca19c9d0558e4aaacb7122749a575cadac
+AUX ncurses-5.9-fix-clang-build.patch 1291 SHA256 0ffec4dbc7dc4a2356460c2a001b6ffbd8b060ae0afbdf3551a13575c20830d0 SHA512 d911441e2e2e2a752236f1eee42955b43ffabe37e47c337a86562c3708aca1fc2650ce77fe5aa6197eb8e9a67958a4b4db8f4344d22fe15868e25b933b175bb1 WHIRLPOOL d5d363f6d7cdcc350b195066c8183609bd9351a48603acdae2f374af13afb23a7bd05cbac86b13d2162daf5bd895eb5acce4769fce2f0b4b8da2896e00d1f846
+AUX ncurses-5.9-gcc-5.patch 1367 SHA256 6d40c4841e031fbb8b1ea6691b112aabc398d23b20b4458ec0b6eb78c33af88d SHA512 200388ee1e8d8f656620d067e8993f79a50ed1a6ebee41ce8bd32b2a61cbe10c93347e2604229b58299c457640b247261a4d05afe60802dd4cce80d17bc2f10c WHIRLPOOL afe4c3854c2fe8096ffa87b5b7e0076a4814ab90ab463346386e4f3ef24295c5c44ae588b8c3147399505072d8cbbf45b9970bacbffba709500bbbdb43a77bf3
+AUX ncurses-5.9-no-I-usr-include.patch 1431 SHA256 496e5dea489d60078344df651c3c2ea06d3dd083d83add0df60dde9104197154 SHA512 a58aec17e4c2edb3f8ed3f414ec6a89afe9f5fcc7cea898774a1fd7e7e892f9b66b1c2bdc74381dd5e8c9cf6968ad922406974f9ece8b38095b29e32d3ff0805 WHIRLPOOL d390ee0439f89dacaa9b5ea5402fc4e6bcf3d48b4bc77c93ff882fcd93f611f99ebd0ae4ce91eea1bec83b4d0191e0ead3361447448a84fc59496e6295116042
+AUX ncurses-5.9-pkg-config.patch 1022 SHA256 8b32d53c4a94eeb78f39c29b1e66813bdb2fd5225f96ab7c26950f96679b58fb SHA512 a5578a4a6c2a334a77084da21d61d4a9edd7b82f027d7f54ed7be194ace5076fe86dc51ada916388feeb970255bf3bfbb09cd33072b1ef21de0dbaa5ee45fdf6 WHIRLPOOL 9056961c1b617ca3286cc4c528a5b5da821a5472da105d82b56c925034454a600e818265627d2f17dbad5184ecf78ea4d14807838bed789ca01a85f39755b656
+AUX ncurses-5.9-rxvt-unicode-9.15.patch 3804 SHA256 ae684be42600ac3bbbf6e7be61e085524f65d86c20da8c453b10c27516e30b27 SHA512 82c0a9600f6ca8f36bbdce6f11a96906983fc9efd6b5f1e17134e12283e29b16d04f5e66c10edbcb7087cc4cb8fc23ddd065f9b6c8b0bf72ca684b68383e5131 WHIRLPOOL 1e2fe441d97671b84f49388555c351b235a93704fb7fcf13c14343db569cc91f21d75b60eb635c4c1c3ad18778bcb50e5aa63d25583224ed644edff35356dd2c
+AUX ncurses-6.0-cppflags-cross.patch 1240 SHA256 1303b209da347a5713386f1bf25af4a07697dedced1ec289a2b706584dc6e3d8 SHA512 db333b400ad23110bff80d86eca39e5656870caa06083b6d7098503fe34a46e387d207b135bf9aa9a0a1f2eca2a9b094f1d189ea8f8a17caaec4fc14b819fcc4 WHIRLPOOL f466db25747c957d549c61fc0690a2493b9a1cc834c9fbf11089c62ba68fb955b317d24b13397c280210d38e995898c0ac038a32d7fcb3fddc23d88d1147a7bf
+AUX ncurses-6.0-gfbsd.patch 687 SHA256 675cf7263b2baacf6db6db129aceb3fc7f7a16152f17b1f2a119e07d1226d733 SHA512 706425317e02448a31cdf1d66695292cb17b4cb174008218b0fe9e86ff4367fca5a80ad5eb017e06ad57f9bd75524e38c543618b5eeb6161c5baef15cb8d55ec WHIRLPOOL 7f738210e4f29b9aba30e89e3bd653e01ec9e9fb63cef53f8e3e6abcc84216faf7b2059faabfe7a0bc2d2e8cf2e3e16a98e46b1fda5393cb5c984750db11f3c6
+AUX ncurses-6.0-pkg-config.patch 386 SHA256 1cf7a9d6ba7777c57ad8cd10b6e43df39ce395a3211a568ae564f754ff36bd57 SHA512 8065f50a1d0b2ccd8c8d9b5b6bcf10b07351e2f5e51c17a825057235a63459839771ea249aac7fa50e09c7bacde5179a92f3efe587cf3cf6697ec663faf6caf3 WHIRLPOOL 33f5a7f448d801689c4afe478891ab690d06dc1da569290ab2144cc0d3854fc2f12545b937d18fd1ef734d6e2135f9694318683c1702112d1c05006507a0ef00
+AUX ncurses-6.0-rxvt-unicode-9.15.patch 3759 SHA256 79f2c54b0b52f9d918cd85e786d8ab32b527effaaa8342493086d3000b2fdd26 SHA512 5601446d34421453fb8ed0e7172b4a5230ab4f10a6ded27e6dc52f82f121cb0af510dfc8f60d9ba0d3b9a1d90a8a832c38e24256e394d8ffccbbf12a109e2da4 WHIRLPOOL fdaf16032bb85a5d71598c5ff72a515115e343a498b0f9cb585f7b1b09f5b1d345961306d32a19f98349b982aa2b3018490bc8a85461367bdcc9f9aa3f506326
+AUX ncurses-6.0-ticlib.patch 492 SHA256 c6b42752dfc086b8293066c918c108906f81ee208d2de8177eee1b6085bcb804 SHA512 291ed033118673aed1bc5d3b54730d099dffccad7bbe9cb47275bb216125ef9016225eaccae620fa3b06533b7633061a8029e19c8cb9f73c3e30499f587353d6 WHIRLPOOL 7e750c62ee65b405cbf2c49ccd04ba792bde93ca1991a1e43ca1752fa58a2b4ad6eb8b150931e9afd0993c574059aad85758d2eefc4375e65d37966d503795eb
+DIST ncurses-5.9.tar.gz 2826473 SHA256 9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b SHA512 d7c5e54b6d4d8b9211f0006ca8786f7609d180cc1aaebf4f25e7e35e12959779cf66447359a602daed625621ca32b0d910d67aef3eb8b6fdc3c373819a88faa1 WHIRLPOOL 069e98c6392ce9aca960c72a20f1a502387d33a4b237aaeaa95548024ce4d47b129eafbe0288d21c590e725fe71aaca21cacb300f11a660b7234cb39a777672a
+DIST ncurses-6.0.tar.gz 3131891 SHA256 f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260 SHA512 9ec194f4783dae6de8c529cac31b5cfbfcfea212c5d47b1f87cd49df013e38f8580a9e7aa1384918df0921b4ba999d5e73eb6d6362cce2d7287e64308b673963 WHIRLPOOL 25bef32a63113f07259e81e2cd34b7065e32b471d190c79d56df6e7187fa0d76ae4585ecb2a5d36b3a3dc4facecc9c928503aa97195344a8594ad031bae41949
+EBUILD ncurses-5.9-r101.ebuild 5384 SHA256 3aa6e035fd49725ea1e6673091e14bb3564b8d154b8e103c5dec384b0924652b SHA512 ecaf855054e211bbc3a098d78fb84112a27aff2a3d0d48d1b7a02355b60e8705161b1b6418535b804f8ca78920c86f4f1b3e24047a7e024df8987f7eecc63429 WHIRLPOOL e5667a9cb2e35f2241220577a0278b4afd5f7a9c91375702b3e23e676d4914cb9ad51c90766ae30dc96542f531085026065c73a04770a38db69dad7da7bc85d8
+EBUILD ncurses-6.0-r1.ebuild 8734 SHA256 ae73f9487d889ea8bf9358d43d4c642822c1bcac20a8733af729ee5042c72226 SHA512 7cf7364394f5e81124ad32fdb8f25dd495f80b5a795c2925921434c1cfdb251064d262de70a9303aeba25f7b17494a95b0e3b7fcc267972696e2c04e3a685666 WHIRLPOOL 1def5549fc435679f047b61fca162b13bd6b3fb968ca5b2e5bcf9bef35d7a8cac3298944dec7e8e5a30417282962a07a4203b0205fb8dd5b1e42d9d816cd33a7
+MISC ChangeLog 13035 SHA256 cf546329392c3598260d6a1db3d5f9b880d81149024813ee325c914b379522b6 SHA512 bbc47854aa5670507199ab0cd9773fe95659a2ca163d6ca589ec80151fdaafba4a984b3b02831cd6175a02f5c8d73f6089687204e54e9f4d1d4676dad824108a WHIRLPOOL cabefef541ec3b409cb9a7da1b3347721b570c95214beb03eb5382f7379465aa93a7e56b629acb8681cbfe63bc8c273eba4b16f0033df33e6febb6204351c40c
+MISC ChangeLog-2015 34227 SHA256 c270819f5451e01fb6cf955db5572216a7ff623276e8c2a637c85211301b2fc9 SHA512 276e5b0a59cc7e28d230728a4b6db5e1761893ce68b54e693e37d9f6a0d7e364840648079f7ae862869a25315d90f5ba62dcf575212d008c32273c8a3af02a8c WHIRLPOOL d34b60dc0d336349e0240c6ef01e6258def63970fe2e2ee6efb62a889dfa40c46c6e8b38195f4cf742def6fffe877ba8af110d5569c10aa26a08d9a63e72e507
+MISC metadata.xml 619 SHA256 7a2c714e9010b6a0b3a54556e501f368a531109e7958244fdb1ab51b8a7629f7 SHA512 3f28fd8aee675226f641d72d7437edf4c5840cdac3dca64b6a4c61902d4f4127d86f65acfefb270cba2fcfb0ba9d6ff9d3ca24930825b89c82f0eedc8160f9ef WHIRLPOOL 767d629c08272b2d886bfe9d1c89a28da693e8250bf7ad3b03fd719c379dca2c9fbddbfc102eebad16dbaaa982cc91ca425babb467eabe5c24ce9661bdc35d61
diff --git a/sys-libs/ncurses/files/ncurses-5.7-nongnu.patch b/sys-libs/ncurses/files/ncurses-5.7-nongnu.patch
new file mode 100644
index 000000000000..3f4a40520009
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-5.7-nongnu.patch
@@ -0,0 +1,11 @@
+--- ncurses-5.7/ncurses/curses.priv.h
++++ ncurses-5.7/ncurses/curses.priv.h
+@@ -1452,6 +1452,8 @@ extern NCURSES_EXPORT(void) _nc_expanded
+
+ /* charable.c */
+ #if USE_WIDEC_SUPPORT
++#include <wchar.h>
++
+ extern NCURSES_EXPORT(bool) _nc_is_charable(wchar_t);
+ extern NCURSES_EXPORT(int) _nc_to_char(wint_t);
+ extern NCURSES_EXPORT(wint_t) _nc_to_widechar(int);
diff --git a/sys-libs/ncurses/files/ncurses-5.8-gfbsd.patch b/sys-libs/ncurses/files/ncurses-5.8-gfbsd.patch
new file mode 100644
index 000000000000..0200a14462af
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-5.8-gfbsd.patch
@@ -0,0 +1,24 @@
+we'll hijack the freebsd* case that comes later
+
+--- ncurses-5.6/aclocal.m4
++++ ncurses-5.6/aclocal.m4
+@@ -3806,7 +3806,7 @@
+ fi
+ cf_cv_rm_so_locs=yes
+ ;;
+- linux*|gnu*|k*bsd*-gnu) #(vi
++ linux*|gnu*|k*bsd*-gnu|freebsd*|dragonfly*) #(vi
+ if test "$DFT_LWR_MODEL" = "shared" ; then
+ LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+--- ncurses-5.6/configure
++++ ncurses-5.6/configure
+@@ -3806,7 +3806,7 @@
+ fi
+ cf_cv_rm_so_locs=yes
+ ;;
+- linux*|gnu*|k*bsd*-gnu) #(vi
++ linux*|gnu*|k*bsd*-gnu|freebsd*|dragonfly*) #(vi
+ if test "$DFT_LWR_MODEL" = "shared" ; then
+ LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
diff --git a/sys-libs/ncurses/files/ncurses-5.9-fix-clang-build.patch b/sys-libs/ncurses/files/ncurses-5.9-fix-clang-build.patch
new file mode 100644
index 000000000000..0c6ca7acc4fc
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-5.9-fix-clang-build.patch
@@ -0,0 +1,44 @@
+diff --git a/ncurses-5.9/c++/cursesf.h b/ncurses-5.9/c++/cursesf.h
+index 70a30c3..db38063 100644
+--- a/ncurses-5.9/c++/cursesf.h
++++ b/ncurses-5.9/c++/cursesf.h
+@@ -677,7 +677,7 @@ protected:
+ }
+
+ public:
+- NCursesUserForm (NCursesFormField Fields[],
++ NCursesUserForm (NCursesFormField* Fields[],
+ const T* p_UserData = STATIC_CAST(T*)(0),
+ bool with_frame=FALSE,
+ bool autoDelete_Fields=FALSE)
+@@ -686,7 +686,7 @@ public:
+ set_user (const_cast<void *>(p_UserData));
+ };
+
+- NCursesUserForm (NCursesFormField Fields[],
++ NCursesUserForm (NCursesFormField* Fields[],
+ int nlines,
+ int ncols,
+ int begin_y = 0,
+diff --git a/ncurses-5.9/c++/cursesm.h b/ncurses-5.9/c++/cursesm.h
+index d9c2273..2d5b79a 100644
+--- a/ncurses-5.9/c++/cursesm.h
++++ b/ncurses-5.9/c++/cursesm.h
+@@ -635,7 +635,7 @@ protected:
+ }
+
+ public:
+- NCursesUserMenu (NCursesMenuItem Items[],
++ NCursesUserMenu (NCursesMenuItem* Items[],
+ const T* p_UserData = STATIC_CAST(T*)(0),
+ bool with_frame=FALSE,
+ bool autoDelete_Items=FALSE)
+@@ -644,7 +644,7 @@ public:
+ set_user (const_cast<void *>(p_UserData));
+ };
+
+- NCursesUserMenu (NCursesMenuItem Items[],
++ NCursesUserMenu (NCursesMenuItem* Items[],
+ int nlines,
+ int ncols,
+ int begin_y = 0,
diff --git a/sys-libs/ncurses/files/ncurses-5.9-gcc-5.patch b/sys-libs/ncurses/files/ncurses-5.9-gcc-5.patch
new file mode 100644
index 000000000000..2448229b88e1
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-5.9-gcc-5.patch
@@ -0,0 +1,46 @@
+https://bugs.gentoo.org/545114
+
+extracted from the upstream change (which had many unrelated commits in one)
+
+From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001
+From: "Thomas E. Dickey" <dickey@invisible-island.net>
+Date: Sun, 7 Dec 2014 03:10:09 +0000
+Subject: [PATCH] ncurses 5.9 - patch 20141206
+
++ modify MKlib_gen.sh to work around change in development version of
+ gcc introduced here:
+ https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
+ https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
+ (reports by Marcus Shawcroft, Maohui Lei).
+
+diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
+index d8cc3c9..b91398c 100755
+--- a/ncurses/base/MKlib_gen.sh
++++ b/ncurses/base/MKlib_gen.sh
+@@ -474,11 +474,22 @@ sed -n -f $ED1 \
+ -e 's/gen_$//' \
+ -e 's/ / /g' >>$TMP
+
++cat >$ED1 <<EOF
++s/ / /g
++s/^ //
++s/ $//
++s/P_NCURSES_BOOL/NCURSES_BOOL/g
++EOF
++
++# A patch discussed here:
++# https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
++# introduces spurious #line markers. Work around that by ignoring the system's
++# attempt to define "bool" and using our own symbol here.
++sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
++cat $ED2 >$TMP
++
+ $preprocessor $TMP 2>/dev/null \
+-| sed \
+- -e 's/ / /g' \
+- -e 's/^ //' \
+- -e 's/_Bool/NCURSES_BOOL/g' \
++| sed -f $ED1 \
+ | $AWK -f $AW2 \
+ | sed -f $ED3 \
+ | sed \
diff --git a/sys-libs/ncurses/files/ncurses-5.9-no-I-usr-include.patch b/sys-libs/ncurses/files/ncurses-5.9-no-I-usr-include.patch
new file mode 100644
index 000000000000..5c968e76c378
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-5.9-no-I-usr-include.patch
@@ -0,0 +1,45 @@
+https://bugs.gentoo.org/522586
+
+delete the -I$includedir paths that get added to CPPFLAGS. these are never
+needed when building natively or cross-compiling and really get in the way
+in both cases (upgrades/cross-compiling/etc...).
+
+extracted from the upstream change:
+http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff;h=9ee3995474454b7d956885e0fe5c8cac2ae25d42#patch5
+
+--- a/configure
++++ b/configure
+@@ -18596,33 +18596,11 @@ CPPFLAGS="$CPPFLAGS -I. -I../include"
+ if test "$srcdir" != "."; then
+ CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
+ fi
+-if test "$GCC" != yes; then
+- CPPFLAGS="$CPPFLAGS -I\${includedir}"
+-elif test "$includedir" != "/usr/include"; then
+- if test "$includedir" = '${prefix}/include' ; then
+- if test $prefix != /usr ; then
+- CPPFLAGS="$CPPFLAGS -I\${includedir}"
+- fi
+- else
+- CPPFLAGS="$CPPFLAGS -I\${includedir}"
+- fi
+-fi
+
+ ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
+ if test "$srcdir" != "."; then
+ ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
+ fi
+-if test "$GCC" != yes; then
+- ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+-elif test "$includedir" != "/usr/include"; then
+- if test "$includedir" = '${prefix}/include' ; then
+- if test $prefix != /usr ; then
+- ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+- fi
+- else
+- ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+- fi
+-fi
+
+ ### Build up pieces for makefile rules
+ echo "$as_me:18628: checking default library suffix" >&5
diff --git a/sys-libs/ncurses/files/ncurses-5.9-pkg-config.patch b/sys-libs/ncurses/files/ncurses-5.9-pkg-config.patch
new file mode 100644
index 000000000000..7c3c04a449f8
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-5.9-pkg-config.patch
@@ -0,0 +1,26 @@
+disable the $PATH search for the PKG_CONFIG tool. it isn't needed and just
+gets in the way when setting to a value that might not yet exist.
+
+disable the existence test for the PKG_CONFIG_LIBDIR dir. it breaks when you
+cross-compile for an ABI that doesn't exist in the root dir (--build).
+
+--- a/configure
++++ b/configure
+@@ -3582,7 +3582,7 @@ fi
+ esac
+
+ test -z "$PKG_CONFIG" && PKG_CONFIG=none
+-if test "$PKG_CONFIG" != none ; then
++if false ; then
+
+ if test "x$prefix" != xNONE; then
+ cf_path_syntax="$prefix"
+@@ -3626,7 +3626,7 @@ echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C
+ PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
+ fi
+ PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
+- if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
++ if test -n "$PKG_CONFIG_LIBDIR" ; then
+
+ # Check whether --enable-pc-files or --disable-pc-files was given.
+ if test "${enable_pc_files+set}" = set; then
diff --git a/sys-libs/ncurses/files/ncurses-5.9-rxvt-unicode-9.15.patch b/sys-libs/ncurses/files/ncurses-5.9-rxvt-unicode-9.15.patch
new file mode 100644
index 000000000000..b6d1924cbe7e
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-5.9-rxvt-unicode-9.15.patch
@@ -0,0 +1,191 @@
+Add rxvt-unicode terminfo, required by rxvt-unicode to function properly.
+
+Providing this in ncurses makes it widely available, much better than having to
+install rxvt-unicode everywhere.
+
+http://bugs.gentoo.org/show_bug.cgi?id=192083
+
+This patch uses the updated rxvt-unicode-9.15 terminfo
+which includes 256 color support and fixes Gentoo bug 383871
+
+http://bugs.gentoo.org/show_bug.cgi?id=383871
+
+--- misc/terminfo.src
++++ misc/terminfo.src
+@@ -4208,6 +4208,176 @@
+ rxvt-16color|xterm with 16 colors like aixterm,
+ ncv#32, use=ibm+16color, use=rxvt,
+
++# From: Thomas Dickey <dickey@clark.net> 04 Oct 1997
++# Updated: Özgür Kesim <kesim@math.fu-berlin.de> 02 Nov 1997
++# Updated: Marc Lehmann <schmorp@schmorp.de>, 17 Feb 2005
++# Updated: Marc Lehmann <schmorp@schmorp.de>, 04 Nov 2008: change init/reset sequences
++rxvt-unicode|rxvt-unicode terminal (X Window System),
++ am,
++ bce,
++ eo,
++ km,
++ msgr,
++ xenl,
++ hs,
++ cols#80,
++ it#8,
++ lines#24,
++ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~-A.B+C\,D0EhFiG,
++ bel=^G,
++ blink=\E[5m,
++ bold=\E[1m,
++ civis=\E[?25l,
++ clear=\E[H\E[2J,
++ cnorm=\E[?25h,
++ cr=^M,
++ csr=\E[%i%p1%d;%p2%dr,
++ cub=\E[%p1%dD,
++ cub1=^H,
++ cud=\E[%p1%dB,
++ cud1=^J,
++ cuf=\E[%p1%dC,
++ cuf1=\E[C,
++ cup=\E[%i%p1%d;%p2%dH,
++ cuu=\E[%p1%dA,
++ cuu1=\E[A,
++ cvvis=\E[?25h,
++ dch=\E[%p1%dP,
++ dch1=\E[P,
++ dl=\E[%p1%dM,
++ dl1=\E[M,
++ ed=\E[J,
++ el=\E[K,
++ el1=\E[1K,
++ flash=\E[?5h$<20/>\E[?5l,
++ home=\E[H,
++ hpa=\E[%i%p1%dG,
++ ht=^I,
++ hts=\EH,
++ ich=\E[%p1%d@,
++ ich1=\E[@,
++ il=\E[%p1%dL,
++ il1=\E[L,
++ ind=^J,
++ is1=\E[\041p,
++ is2=\E[r\E[m\E[2J\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
++ kDC=\E[3$,
++ kIC=\E[2$,
++ kEND=\E[8$,
++ kHOM=\E[7$,
++ kLFT=\E[d,
++ kNXT=\E[6$,
++ kPRV=\E[5$,
++ kRIT=\E[c,
++ kbs=\177,
++ ka1=\EOw,
++ ka3=\EOy,
++ kb2=\EOu,
++ kc1=\EOq,
++ kc3=\EOs,
++ kcbt=\E[Z,
++ kcub1=\E[D,
++ kcud1=\E[B,
++ kcuf1=\E[C,
++ kcuu1=\E[A,
++ kdch1=\E[3~,
++ kel=\E[8\^,
++ kend=\E[8~,
++ kent=\EOM,
++ kf1=\E[11~,
++ kf10=\E[21~,
++ kf11=\E[23~,
++ kf12=\E[24~,
++ kf13=\E[25~,
++ kf14=\E[26~,
++ kf15=\E[28~,
++ kf16=\E[29~,
++ kf17=\E[31~,
++ kf18=\E[32~,
++ kf19=\E[33~,
++ kf2=\E[12~,
++ kf20=\E[34~,
++ kf3=\E[13~,
++ kf4=\E[14~,
++ kf5=\E[15~,
++ kf6=\E[17~,
++ kf7=\E[18~,
++ kf8=\E[19~,
++ kf9=\E[20~,
++ kfnd=\E[1~,
++ khome=\E[7~,
++ kich1=\E[2~,
++ kmous=\E[M,
++ knp=\E[6~,
++ kpp=\E[5~,
++ kslt=\E[4~,
++ rc=\E8,
++ rev=\E[7m,
++ ri=\EM,
++ rmso=\E[27m,
++ rmul=\E[24m,
++ rs1=\Ec,
++ rs2=\E[r\E[m\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
++ sgr0=\E[m\E(B,
++ enacs=,
++ smacs=\E(0,
++ rmacs=\E(B,
++ smso=\E[7m,
++ smul=\E[4m,
++ tbc=\E[3g,
++ vpa=\E[%i%p1%dd,
++ colors#88,
++ pairs#7744,
++ btns#5,
++ lm#0,
++ ccc,
++ npc,
++ mc5i,
++ ncv#0,
++ mir,
++ xon,
++ bw,
++ ech=\E[%p1%dX,
++ mc0=\E[i,
++ mc4=\E[4i,
++ mc5=\E[5i,
++ sitm=\E[3m,
++ ritm=\E[23m,
++ smam=\E[?7h,
++ rmam=\E[?7l,
++ smir=\E[4h,
++ rmir=\E[4l,
++ smcup=\E[?1049h,
++ rmcup=\E[r\E[?1049l,
++ smkx=\E=,
++ rmkx=\E>,
++ indn=\E[%p1%dS,
++ rin=\E[%p1%dT,
++ sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;,
++ op=\E[39;49m,
++ setaf=\E[38;5;%p1%dm,
++ setab=\E[48;5;%p1%dm,
++ setf=%?%p1%{7}%>%t\E[38;5;%p1%dm%e\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
++ setb=%?%p1%{7}%>%t\E[48;5;%p1%dm%e\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
++ initc=\E]4;%p1%d;rgb\:%p2%{65535}%*%{1000}%/%4.4X/%p3%{65535}%*%{1000}%/%4.4X/%p4%{65535}%*%{1000}%/%4.4X\E\\,
++ sc=\E7,
++ s0ds=\E(B,
++ s1ds=\E(0,
++ s2ds=\E*B,
++ s3ds=\E+B,
++ u6=\E[%i%d;%dR,
++ u7=\E[6n,
++ u8=\E[?1;2c,
++ u9=\E[c,
++ tsl=\E]2;,
++ fsl=\007,
++ dsl=\E]2;\007,
++
++rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System),
++ colors#256,
++ pairs#32767,
++ use=rxvt-unicode,
++
+ # mrxvt 0.5.4
+ #
+ # mrxvt is based on rxvt 2.7.11, but has by default XTERM_FKEYS defined, which
diff --git a/sys-libs/ncurses/files/ncurses-6.0-cppflags-cross.patch b/sys-libs/ncurses/files/ncurses-6.0-cppflags-cross.patch
new file mode 100644
index 000000000000..decdc2677904
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-6.0-cppflags-cross.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/601426
+https://lists.gnu.org/archive/html/bug-ncurses/2015-02/msg00012.html
+
+From: John Vogel
+Subject: [PATCH] c++ binding missed when cross compiling
+Date: Mon, 16 Feb 2015 01:01:48 -0500
+
+The configure script hard codes the include dir to the prefix'ed include dir,
+when checking if c++ compiler works. This breaks the compiler's built-in search
+path. I've included two patches. The first works on the configure.in file, which
+requires your autoconf stuff to test and I'm not ready to meddle with at the
+moment. The other works directly on the configure file. I've tested the second
+one; it should mirror what the first patch tries to achieve and works for me.
+
+--- a/configure
++++ b/configure
+@@ -2938,10 +2938,6 @@
+ echo "$as_me:2938: checking if $CXX works" >&5
+ echo $ECHO_N "checking if $CXX works... $ECHO_C" >&6
+
+- save_CPPFLAGS="$CPPFLAGS"
+- eval cf_includedir=${includedir}
+- CPPFLAGS="$CPPFLAGS -I${cf_includedir}"
+-
+ cat >conftest.$ac_ext <<_ACEOF
+ #line 2946 "configure"
+ #include "confdefs.h"
+@@ -2978,7 +2974,6 @@
+ cf_cxx_works=no
+ fi
+ rm -f conftest.$ac_objext conftest.$ac_ext
+- CPPFLAGS="$save_CPPFLAGS"
+
+ echo "$as_me:2983: result: $cf_cxx_works" >&5
+ echo "${ECHO_T}$cf_cxx_works" >&6
diff --git a/sys-libs/ncurses/files/ncurses-6.0-gfbsd.patch b/sys-libs/ncurses/files/ncurses-6.0-gfbsd.patch
new file mode 100644
index 000000000000..1403a29c933c
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-6.0-gfbsd.patch
@@ -0,0 +1,24 @@
+we'll hijack the freebsd* case that comes later
+
+--- ncurses-6.0/aclocal.m4
++++ ncurses-6.0/aclocal.m4
+@@ -5711,7 +5711,7 @@
+ fi
+ cf_cv_rm_so_locs=yes
+ ;;
+- (linux*|gnu*|k*bsd*-gnu)
++ (linux*|gnu*|k*bsd*-gnu|freebsd*|dragonfly*)
+ if test "$DFT_LWR_MODEL" = "shared" ; then
+ LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+--- ncurses-6.0/configure
++++ ncurses-6.0/configure
+@@ -6188,7 +6188,7 @@
+ fi
+ cf_cv_rm_so_locs=yes
+ ;;
+- (linux*|gnu*|k*bsd*-gnu)
++ (linux*|gnu*|k*bsd*-gnu|freebsd*|dragonfly*)
+ if test "$DFT_LWR_MODEL" = "shared" ; then
+ LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
+ LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
diff --git a/sys-libs/ncurses/files/ncurses-6.0-pkg-config.patch b/sys-libs/ncurses/files/ncurses-6.0-pkg-config.patch
new file mode 100644
index 000000000000..6808319b9533
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-6.0-pkg-config.patch
@@ -0,0 +1,14 @@
+disable the $PATH search for the PKG_CONFIG tool. it isn't needed and just
+gets in the way when setting to a value that might not yet exist.
+
+--- ncurses-6.0/configure
++++ ncurses-6.0/configure
+@@ -3533,7 +3533,7 @@
+ esac
+
+ test -z "$PKG_CONFIG" && PKG_CONFIG=none
+-if test "$PKG_CONFIG" != none ; then
++if false ; then
+
+ if test "x$prefix" != xNONE; then
+ cf_path_syntax="$prefix"
diff --git a/sys-libs/ncurses/files/ncurses-6.0-rxvt-unicode-9.15.patch b/sys-libs/ncurses/files/ncurses-6.0-rxvt-unicode-9.15.patch
new file mode 100644
index 000000000000..af3df941d699
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-6.0-rxvt-unicode-9.15.patch
@@ -0,0 +1,191 @@
+Add rxvt-unicode terminfo, required by rxvt-unicode to function properly.
+
+Providing this in ncurses makes it widely available, much better than having to
+install rxvt-unicode everywhere.
+
+http://bugs.gentoo.org/show_bug.cgi?id=192083
+
+This patch uses the updated rxvt-unicode-9.15 terminfo
+which includes 256 color support and fixes Gentoo bug 383871
+
+http://bugs.gentoo.org/show_bug.cgi?id=383871
+
+--- ncurses-6.0/misc/terminfo.src
++++ ncurses-6.0/misc/terminfo.src
+@@ -5214,6 +5214,176 @@
+ rxvt-16color|rxvt with 16 colors like aixterm,
+ ncv#32, use=ibm+16color, use=rxvt,
+
++# From: Thomas Dickey <dickey@clark.net> 04 Oct 1997
++# Updated: Özgür Kesim <kesim@math.fu-berlin.de> 02 Nov 1997
++# Updated: Marc Lehmann <schmorp@schmorp.de>, 17 Feb 2005
++# Updated: Marc Lehmann <schmorp@schmorp.de>, 04 Nov 2008: change init/reset sequences
++rxvt-unicode|rxvt-unicode terminal (X Window System),
++ am,
++ bce,
++ eo,
++ km,
++ msgr,
++ xenl,
++ hs,
++ cols#80,
++ it#8,
++ lines#24,
++ acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~-A.B+C\,D0EhFiG,
++ bel=^G,
++ blink=\E[5m,
++ bold=\E[1m,
++ civis=\E[?25l,
++ clear=\E[H\E[2J,
++ cnorm=\E[?25h,
++ cr=^M,
++ csr=\E[%i%p1%d;%p2%dr,
++ cub=\E[%p1%dD,
++ cub1=^H,
++ cud=\E[%p1%dB,
++ cud1=^J,
++ cuf=\E[%p1%dC,
++ cuf1=\E[C,
++ cup=\E[%i%p1%d;%p2%dH,
++ cuu=\E[%p1%dA,
++ cuu1=\E[A,
++ cvvis=\E[?25h,
++ dch=\E[%p1%dP,
++ dch1=\E[P,
++ dl=\E[%p1%dM,
++ dl1=\E[M,
++ ed=\E[J,
++ el=\E[K,
++ el1=\E[1K,
++ flash=\E[?5h$<20/>\E[?5l,
++ home=\E[H,
++ hpa=\E[%i%p1%dG,
++ ht=^I,
++ hts=\EH,
++ ich=\E[%p1%d@,
++ ich1=\E[@,
++ il=\E[%p1%dL,
++ il1=\E[L,
++ ind=^J,
++ is1=\E[\041p,
++ is2=\E[r\E[m\E[2J\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
++ kDC=\E[3$,
++ kIC=\E[2$,
++ kEND=\E[8$,
++ kHOM=\E[7$,
++ kLFT=\E[d,
++ kNXT=\E[6$,
++ kPRV=\E[5$,
++ kRIT=\E[c,
++ kbs=\177,
++ ka1=\EOw,
++ ka3=\EOy,
++ kb2=\EOu,
++ kc1=\EOq,
++ kc3=\EOs,
++ kcbt=\E[Z,
++ kcub1=\E[D,
++ kcud1=\E[B,
++ kcuf1=\E[C,
++ kcuu1=\E[A,
++ kdch1=\E[3~,
++ kel=\E[8\^,
++ kend=\E[8~,
++ kent=\EOM,
++ kf1=\E[11~,
++ kf10=\E[21~,
++ kf11=\E[23~,
++ kf12=\E[24~,
++ kf13=\E[25~,
++ kf14=\E[26~,
++ kf15=\E[28~,
++ kf16=\E[29~,
++ kf17=\E[31~,
++ kf18=\E[32~,
++ kf19=\E[33~,
++ kf2=\E[12~,
++ kf20=\E[34~,
++ kf3=\E[13~,
++ kf4=\E[14~,
++ kf5=\E[15~,
++ kf6=\E[17~,
++ kf7=\E[18~,
++ kf8=\E[19~,
++ kf9=\E[20~,
++ kfnd=\E[1~,
++ khome=\E[7~,
++ kich1=\E[2~,
++ kmous=\E[M,
++ knp=\E[6~,
++ kpp=\E[5~,
++ kslt=\E[4~,
++ rc=\E8,
++ rev=\E[7m,
++ ri=\EM,
++ rmso=\E[27m,
++ rmul=\E[24m,
++ rs1=\Ec,
++ rs2=\E[r\E[m\E[?7;25h\E[?1;3;4;5;6;9;66;1000;1001;1049l\E[4l,
++ sgr0=\E[m\E(B,
++ enacs=,
++ smacs=\E(0,
++ rmacs=\E(B,
++ smso=\E[7m,
++ smul=\E[4m,
++ tbc=\E[3g,
++ vpa=\E[%i%p1%dd,
++ colors#88,
++ pairs#7744,
++ btns#5,
++ lm#0,
++ ccc,
++ npc,
++ mc5i,
++ ncv#0,
++ mir,
++ xon,
++ bw,
++ ech=\E[%p1%dX,
++ mc0=\E[i,
++ mc4=\E[4i,
++ mc5=\E[5i,
++ sitm=\E[3m,
++ ritm=\E[23m,
++ smam=\E[?7h,
++ rmam=\E[?7l,
++ smir=\E[4h,
++ rmir=\E[4l,
++ smcup=\E[?1049h,
++ rmcup=\E[r\E[?1049l,
++ smkx=\E=,
++ rmkx=\E>,
++ indn=\E[%p1%dS,
++ rin=\E[%p1%dT,
++ sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;,
++ op=\E[39;49m,
++ setaf=\E[38;5;%p1%dm,
++ setab=\E[48;5;%p1%dm,
++ setf=%?%p1%{7}%>%t\E[38;5;%p1%dm%e\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
++ setb=%?%p1%{7}%>%t\E[48;5;%p1%dm%e\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m%;,
++ initc=\E]4;%p1%d;rgb\:%p2%{65535}%*%{1000}%/%4.4X/%p3%{65535}%*%{1000}%/%4.4X/%p4%{65535}%*%{1000}%/%4.4X\E\\,
++ sc=\E7,
++ s0ds=\E(B,
++ s1ds=\E(0,
++ s2ds=\E*B,
++ s3ds=\E+B,
++ u6=\E[%i%d;%dR,
++ u7=\E[6n,
++ u8=\E[?1;2c,
++ u9=\E[c,
++ tsl=\E]2;,
++ fsl=\007,
++ dsl=\E]2;\007,
++
++rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System),
++ colors#256,
++ pairs#32767,
++ use=rxvt-unicode,
++
+ #### MRXVT
+ # mrxvt 0.5.4
+ #
diff --git a/sys-libs/ncurses/files/ncurses-6.0-ticlib.patch b/sys-libs/ncurses/files/ncurses-6.0-ticlib.patch
new file mode 100644
index 000000000000..188e6adff8c7
--- /dev/null
+++ b/sys-libs/ncurses/files/ncurses-6.0-ticlib.patch
@@ -0,0 +1,15 @@
+always include ticlib even when progs are disabled
+
+https://bugs.gentoo.org/557360
+
+--- a/configure
++++ b/configure
+@@ -21312,7 +21312,7 @@ echo "$as_me:21311: checking for library subsets" >&5
+ echo $ECHO_N "checking for library subsets... $ECHO_C" >&6
+ LIB_SUBSETS=
+
+-if test "x$cf_with_progs" = xyes || test "$with_ticlib" != no || test "$with_termcap" != no; then
++if true; then
+ LIB_SUBSETS="${LIB_SUBSETS}ticlib"
+ if test "$with_ticlib" != no ; then
+ LIB_SUBSETS="${LIB_SUBSETS} "
diff --git a/sys-libs/ncurses/metadata.xml b/sys-libs/ncurses/metadata.xml
new file mode 100644
index 000000000000..888a6adf6636
--- /dev/null
+++ b/sys-libs/ncurses/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="ada">Add bindings for the ADA programming language</flag>
+ <flag name="tinfo">
+ Build curses library (libncurses) sep from the low-level terminfo
+ library (libtinfo) -- usually needed only for binary packages -- but
+ it is binary compatible in either mode
+ </flag>
+ <flag name="trace">Enable test trace() support in ncurses calls</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-libs/ncurses/ncurses-5.9-r101.ebuild b/sys-libs/ncurses/ncurses-5.9-r101.ebuild
new file mode 100644
index 000000000000..76b8a76d3a72
--- /dev/null
+++ b/sys-libs/ncurses/ncurses-5.9-r101.ebuild
@@ -0,0 +1,201 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# This version is just for the ABI .5 library
+
+EAPI="5"
+
+inherit eutils toolchain-funcs multilib-minimal multiprocessing
+
+MY_PV=${PV:0:3}
+MY_P=${PN}-${MY_PV}
+DESCRIPTION="console display library"
+HOMEPAGE="https://www.gnu.org/software/ncurses/ http://dickey.his.com/ncurses/"
+SRC_URI="mirror://gnu/ncurses/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+# The subslot reflects the SONAME.
+SLOT="5/5"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="gpm tinfo unicode"
+
+DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )"
+# Block the ncurses-5 that installs the same lib. #557472
+RDEPEND="${DEPEND}
+ !<sys-libs/ncurses-6:0"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.8-gfbsd.patch
+ "${FILESDIR}"/${PN}-5.7-nongnu.patch
+ "${FILESDIR}"/${PN}-5.9-rxvt-unicode-9.15.patch #192083 #383871
+ "${FILESDIR}"/${PN}-5.9-fix-clang-build.patch #417763
+ "${FILESDIR}"/${PN}-5.9-pkg-config.patch
+ "${FILESDIR}"/${P}-no-I-usr-include.patch #522586
+ "${FILESDIR}"/${P}-gcc-5.patch #545114
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+}
+
+src_configure() {
+ unset TERMINFO #115036
+ tc-export_build_env BUILD_{CC,CPP}
+ BUILD_CPPFLAGS+=" -D_GNU_SOURCE" #214642
+
+ # Build the various variants of ncurses -- narrow, wide, and threaded. #510440
+ # Order matters here -- we want unicode/thread versions to come last so that the
+ # binaries in /usr/bin support both wide and narrow.
+ # The naming is also important as we use these directly with filenames and when
+ # checking configure flags.
+ NCURSES_TARGETS=(
+ ncurses
+ $(usex unicode 'ncursesw' '')
+ )
+
+ multijob_init
+
+ # When installing ncurses, we have to use a compatible version of tic.
+ # This comes up when cross-compiling, doing multilib builds, upgrading,
+ # or installing for the first time. Build a local copy of tic whenever
+ # the host version isn't available. #249363 #557598
+ if ! ROOT=/ has_version "~sys-libs/${P}" ; then
+ # We can't re-use the multilib BUILD_DIR because we run outside of it.
+ BUILD_DIR="${WORKDIR}" \
+ CHOST=${CBUILD} \
+ CFLAGS=${BUILD_CFLAGS} \
+ CXXFLAGS=${BUILD_CXXFLAGS} \
+ CPPFLAGS=${BUILD_CPPFLAGS} \
+ LDFLAGS="${BUILD_LDFLAGS} -static" \
+ multijob_child_init do_configure cross --without-shared --with-normal
+ fi
+ multilib-minimal_src_configure
+ multijob_finish
+}
+
+multilib_src_configure() {
+ local t
+ for t in "${NCURSES_TARGETS[@]}" ; do
+ multijob_child_init do_configure "${t}"
+ done
+}
+
+do_configure() {
+ local target=$1
+ shift
+
+ mkdir "${BUILD_DIR}/${target}"
+ cd "${BUILD_DIR}/${target}" || die
+
+ local conf=(
+ # We need the basic terminfo files in /etc, bug #37026. We will
+ # add '--with-terminfo-dirs' and then populate /etc/terminfo in
+ # src_install() ...
+ --with-terminfo-dirs="${EPREFIX}/etc/terminfo:${EPREFIX}/usr/share/terminfo"
+
+ # Now the rest of the various standard flags.
+ --without-hashed-db
+ --disable-pc-files
+ --with-shared
+ --without-hashed-db
+ --without-ada
+ --without-cxx
+ --without-cxx-binding
+ --without-debug
+ --without-profile
+ # The configure script uses ldd to parse the linked output which
+ # is flaky for cross-compiling/multilib/ldd versions/etc...
+ $(use_with gpm gpm libgpm.so.1)
+ --disable-termcap
+ --enable-symlinks
+ --with-rcs-ids
+ --with-manpage-format=normal
+ --enable-const
+ --enable-colorfgbg
+ --enable-echo
+ --disable-warnings
+ --without-assertions
+ --enable-leaks
+ --without-expanded
+ --with-macros
+ --without-progs
+ --without-tests
+ --without-trace
+ $(use_with tinfo termlib)
+
+ # The chtype/mmask-t settings below are to retain ABI compat
+ # with ncurses-5.4 so dont change em !
+ --with-chtype=long
+ --with-mmask-t=long
+ --disable-ext-colors
+ --disable-ext-mouse
+ --without-{pthread,reentrant}
+ )
+
+ if [[ ${target} == ncurses*w ]] ; then
+ conf+=( --enable-widec )
+ else
+ conf+=( --disable-widec )
+ fi
+ # Make sure each variant goes in a unique location.
+ if [[ ${target} != "ncurses" ]] ; then
+ conf+=( --includedir="${EPREFIX}"/usr/include/${target} )
+ fi
+ # See comments in src_configure.
+ if [[ ${target} != "cross" ]] ; then
+ local cross_path="${WORKDIR}/cross"
+ [[ -d ${cross_path} ]] && export TIC_PATH="${cross_path}/progs/tic"
+ else
+ conf+=( --with-progs )
+ fi
+
+ # Force bash until upstream rebuilds the configure script with a newer
+ # version of autotools. #545532
+ CONFIG_SHELL=/bin/bash \
+ ECONF_SOURCE=${S} \
+ econf "${conf[@]}" "$@"
+}
+
+src_compile() {
+ # See comments in src_configure.
+ if ! ROOT=/ has_version "~sys-libs/${P}" ; then
+ BUILD_DIR="${WORKDIR}" \
+ do_compile cross -C progs tic
+ fi
+
+ multilib-minimal_src_compile
+}
+
+multilib_src_compile() {
+ local t
+ for t in "${NCURSES_TARGETS[@]}" ; do
+ do_compile "${t}"
+ done
+}
+
+do_compile() {
+ local target=$1
+ shift
+
+ cd "${BUILD_DIR}/${target}" || die
+
+ # A little hack to fix parallel builds ... they break when
+ # generating sources so if we generate the sources first (in
+ # non-parallel), we can then build the rest of the package
+ # in parallel. This is not really a perf hit since the source
+ # generation is quite small.
+ emake -j1 sources
+ emake "$@"
+}
+
+multilib_src_install() {
+ local target lib
+ for target in "${NCURSES_TARGETS[@]}" ; do
+ cd "${BUILD_DIR}/${target}/lib" || die
+ for lib in *5.9 ; do
+ newlib.so "${lib}" "${lib%%.9}"
+ done
+ done
+}
diff --git a/sys-libs/ncurses/ncurses-6.0-r1.ebuild b/sys-libs/ncurses/ncurses-6.0-r1.ebuild
new file mode 100644
index 000000000000..2ab63de41d4c
--- /dev/null
+++ b/sys-libs/ncurses/ncurses-6.0-r1.ebuild
@@ -0,0 +1,289 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs multilib-minimal multiprocessing
+
+MY_PV=${PV:0:3}
+PV_SNAP=${PV:4}
+MY_P=${PN}-${MY_PV}
+DESCRIPTION="console display library"
+HOMEPAGE="https://www.gnu.org/software/ncurses/ http://dickey.his.com/ncurses/"
+SRC_URI="mirror://gnu/ncurses/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+# The subslot reflects the SONAME.
+SLOT="0/6"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="ada +cxx debug doc gpm minimal profile static-libs test threads tinfo trace unicode"
+
+DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )"
+# berkdb? ( sys-libs/db )"
+# Block the older ncurses that installed all files w/SLOT=5. #557472
+RDEPEND="${DEPEND}
+ !<=sys-libs/ncurses-5.9-r4:5
+ !<x11-terms/rxvt-unicode-9.06-r3
+ !<x11-terms/st-0.6-r1
+ !app-emulation/emul-linux-x86-baselibs"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+ "${FILESDIR}/${PN}-6.0-gfbsd.patch"
+ "${FILESDIR}/${PN}-5.7-nongnu.patch"
+ "${FILESDIR}/${PN}-6.0-rxvt-unicode-9.15.patch" #192083 #383871
+ "${FILESDIR}/${PN}-6.0-pkg-config.patch"
+ "${FILESDIR}/${PN}-5.9-gcc-5.patch" #545114
+ "${FILESDIR}/${PN}-6.0-ticlib.patch" #557360
+ "${FILESDIR}/${PN}-6.0-cppflags-cross.patch" #601426
+)
+
+src_prepare() {
+ [[ -n ${PV_SNAP} ]] && epatch "${WORKDIR}"/${MY_P}-${PV_SNAP}-patch.sh
+ epatch "${PATCHES[@]}"
+}
+
+src_configure() {
+ unset TERMINFO #115036
+ tc-export_build_env BUILD_{CC,CPP}
+ BUILD_CPPFLAGS+=" -D_GNU_SOURCE" #214642
+
+ # Build the various variants of ncurses -- narrow, wide, and threaded. #510440
+ # Order matters here -- we want unicode/thread versions to come last so that the
+ # binaries in /usr/bin support both wide and narrow.
+ # The naming is also important as we use these directly with filenames and when
+ # checking configure flags.
+ NCURSES_TARGETS=(
+ ncurses
+ $(usex unicode 'ncursesw' '')
+ $(usex threads 'ncursest' '')
+ $(use unicode && usex threads 'ncursestw' '')
+ )
+
+ multijob_init
+
+ # When installing ncurses, we have to use a compatible version of tic.
+ # This comes up when cross-compiling, doing multilib builds, upgrading,
+ # or installing for the first time. Build a local copy of tic whenever
+ # the host version isn't available. #249363 #557598
+ if ! ROOT=/ has_version "~sys-libs/${P}:0" ; then
+ local lbuildflags="-static"
+
+ # some toolchains don't quite support static linking
+ local dbuildflags="-Wl,-rpath,${WORKDIR}/lib"
+ case ${CHOST} in
+ *-darwin*) dbuildflags= ;;
+ *-aix*) dbuildflags= ;;
+ esac
+ echo "int main() {}" | \
+ $(tc-getCC) -o x -x c - ${lbuildflags} -pipe >& /dev/null \
+ || lbuildflags="${dbuildflags}"
+
+ # We can't re-use the multilib BUILD_DIR because we run outside of it.
+ BUILD_DIR="${WORKDIR}" \
+ CHOST=${CBUILD} \
+ CFLAGS=${BUILD_CFLAGS} \
+ CXXFLAGS=${BUILD_CXXFLAGS} \
+ CPPFLAGS=${BUILD_CPPFLAGS} \
+ LDFLAGS="${BUILD_LDFLAGS} ${lbuildflags}" \
+ multijob_child_init do_configure cross --without-shared --with-normal
+ fi
+ multilib-minimal_src_configure
+ multijob_finish
+}
+
+multilib_src_configure() {
+ local t
+ for t in "${NCURSES_TARGETS[@]}" ; do
+ multijob_child_init do_configure "${t}"
+ done
+}
+
+do_configure() {
+ local target=$1
+ shift
+
+ mkdir "${BUILD_DIR}/${target}"
+ cd "${BUILD_DIR}/${target}" || die
+
+ local conf=(
+ # We need the basic terminfo files in /etc, bug #37026. We will
+ # add '--with-terminfo-dirs' and then populate /etc/terminfo in
+ # src_install() ...
+ --with-terminfo-dirs="${EPREFIX}/etc/terminfo:${EPREFIX}/usr/share/terminfo"
+
+ # Disabled until #245417 is sorted out.
+ #$(use_with berkdb hashed-db)
+
+ # ncurses is dumb and doesn't install .pc files unless pkg-config
+ # is also installed. Force the tests to go our way. Note that it
+ # doesn't actually use pkg-config ... it just looks for set vars.
+ --enable-pc-files
+ --with-pkg-config="$(tc-getPKG_CONFIG)"
+ # This path is used to control where the .pc files are installed.
+ --with-pkg-config-libdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
+
+ # Now the rest of the various standard flags.
+ --with-shared
+ --without-hashed-db
+ $(use_with ada)
+ $(use_with cxx)
+ $(use_with cxx cxx-binding)
+ --with-cxx-shared
+ $(use_with debug)
+ $(use_with profile)
+ # The configure script uses ldd to parse the linked output which
+ # is flaky for cross-compiling/multilib/ldd versions/etc...
+ $(use_with gpm gpm libgpm.so.1)
+ --disable-termcap
+ --enable-symlinks
+ --with-rcs-ids
+ --with-manpage-format=normal
+ --enable-const
+ --enable-colorfgbg
+ --enable-hard-tabs
+ --enable-echo
+ $(use_enable !ada warnings)
+ $(use_with debug assertions)
+ $(use_enable !debug leaks)
+ $(use_with debug expanded)
+ $(use_with !debug macros)
+ $(multilib_native_with progs)
+ $(use_with test tests)
+ $(use_with trace)
+ $(use_with tinfo termlib)
+ )
+
+ if [[ ${target} == ncurses*w ]] ; then
+ conf+=( --enable-widec )
+ else
+ conf+=( --disable-widec )
+ fi
+ if [[ ${target} == ncursest* ]] ; then
+ conf+=( --with-{pthread,reentrant} )
+ else
+ conf+=( --without-{pthread,reentrant} )
+ fi
+ # Make sure each variant goes in a unique location.
+ if [[ ${target} == "ncurses" ]] ; then
+ # "ncurses" variant goes into "${EPREFIX}"/usr/include
+ # It is needed on Prefix because the configure script appends
+ # "ncurses" to "${prefix}/include" if "${prefix}" is not /usr.
+ conf+=( --enable-overwrite )
+ else
+ conf+=( --includedir="${EPREFIX}"/usr/include/${target} )
+ fi
+ # See comments in src_configure.
+ if [[ ${target} != "cross" ]] ; then
+ local cross_path="${WORKDIR}/cross"
+ [[ -d ${cross_path} ]] && export TIC_PATH="${cross_path}/progs/tic"
+ fi
+
+ # Force bash until upstream rebuilds the configure script with a newer
+ # version of autotools. #545532
+ CONFIG_SHELL=${EPREFIX}/bin/bash \
+ ECONF_SOURCE=${S} \
+ econf "${conf[@]}" "$@"
+}
+
+src_compile() {
+ # See comments in src_configure.
+ if ! ROOT=/ has_version "~sys-libs/${P}:0" ; then
+ BUILD_DIR="${WORKDIR}" \
+ do_compile cross -C progs tic
+ fi
+
+ multilib-minimal_src_compile
+}
+
+multilib_src_compile() {
+ local t
+ for t in "${NCURSES_TARGETS[@]}" ; do
+ do_compile "${t}"
+ done
+}
+
+do_compile() {
+ local target=$1
+ shift
+
+ cd "${BUILD_DIR}/${target}" || die
+
+ # A little hack to fix parallel builds ... they break when
+ # generating sources so if we generate the sources first (in
+ # non-parallel), we can then build the rest of the package
+ # in parallel. This is not really a perf hit since the source
+ # generation is quite small.
+ emake -j1 sources
+ # For some reason, sources depends on pc-files which depends on
+ # compiled libraries which depends on sources which ...
+ # Manually delete the pc-files file so the install step will
+ # create the .pc files we want.
+ rm -f misc/pc-files
+ emake "$@"
+}
+
+multilib_src_install() {
+ local target
+ for target in "${NCURSES_TARGETS[@]}" ; do
+ emake -C "${BUILD_DIR}/${target}" DESTDIR="${D}" install
+ done
+
+ # Move main libraries into /.
+ if multilib_is_native_abi ; then
+ gen_usr_ldscript -a \
+ "${NCURSES_TARGETS[@]}" \
+ $(use tinfo && usex unicode 'tinfow' '') \
+ $(usev tinfo)
+ fi
+ if ! tc-is-static-only ; then
+ # Provide a link for -lcurses.
+ ln -sf libncurses$(get_libname) "${ED}"/usr/$(get_libdir)/libcurses$(get_libname) || die
+ fi
+ use static-libs || find "${ED}"/usr/ -name '*.a' -delete
+
+ # Build fails to create this ...
+ dosym ../share/terminfo /usr/$(get_libdir)/terminfo
+}
+
+multilib_src_install_all() {
+# if ! use berkdb ; then
+ # We need the basic terminfo files in /etc, bug #37026
+ einfo "Installing basic terminfo files in /etc..."
+ for x in ansi console dumb linux rxvt rxvt-unicode screen sun vt{52,100,102,200,220} \
+ xterm xterm-color xterm-xfree86
+ do
+ local termfile=$(find "${ED}"/usr/share/terminfo/ -name "${x}" 2>/dev/null)
+ local basedir=$(basename $(dirname "${termfile}"))
+
+ if [[ -n ${termfile} ]] ; then
+ dodir /etc/terminfo/${basedir}
+ mv ${termfile} "${ED}"/etc/terminfo/${basedir}/
+ dosym ../../../../etc/terminfo/${basedir}/${x} \
+ /usr/share/terminfo/${basedir}/${x}
+ fi
+ done
+# fi
+
+ echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > "${T}"/50ncurses
+ doenvd "${T}"/50ncurses
+
+ use minimal && rm -r "${ED}"/usr/share/terminfo*
+ # Because ncurses5-config --terminfo returns the directory we keep it
+ keepdir /usr/share/terminfo #245374
+
+ cd "${S}"
+ dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc
+ use doc && dohtml -r doc/html/
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libncurses.so.5
+ use unicode && preserve_old_lib /$(get_libdir)/libncursesw.so.5
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libncurses.so.5
+ use unicode && preserve_old_lib_notify /$(get_libdir)/libncursesw.so.5
+}
diff --git a/sys-libs/netbsd-csu/Manifest b/sys-libs/netbsd-csu/Manifest
new file mode 100644
index 000000000000..e38ac0ac7099
--- /dev/null
+++ b/sys-libs/netbsd-csu/Manifest
@@ -0,0 +1,3 @@
+DIST netbsd-csu-7.1.tar.xz 993460 SHA256 8e0adb83d9fe0954b4b361eb317e6e56f202ddf3830034739875b4f08a04687b SHA512 834524a3ada2a4c02e7eb17d8be09cf023b91e64627f3b2abc32d4f3302e982dcf0939406dc8d6c0ec7ca5e641d2d1845885bb22a165b3d6a1979c2945e2aaad WHIRLPOOL 7a965d81d6a0d7116c2f4b34019cad0293f2d72a8953827dc4d951452e81bae4af3e96fb6528501353de9b07b5abff8dcd532bb4e65d66de337aa97b97e1142e
+EBUILD netbsd-csu-7.1.ebuild 3099 SHA256 674689951286339ccb35461da2c148d31a9553f3c1f8a374c19064ae820312d6 SHA512 6b2e25c5a2c38add7f9b91bf0c03fe4ae4baad4cd645c19d0cfc9004cd85ce16eec2c66bee701487a6b3f48b6985d317f04d87c74d9c7dbd0df48fcce8808f7c WHIRLPOOL 78c8562fb025bd7d5c39c64d8a8037721fa62e7ebadf9ab7dd10e1d7375ca17c28f5e47d5b15a30d8ce133225d04a7ba4caf093962c3eb76d2a402f46dcf5138
+MISC metadata.xml 216 SHA256 e94ba81dd2791908508a3993afdebf723cc617314c53c273b9bcca15a9c48327 SHA512 3485598147c953e72e1785693a489a7e7d73d59620b76054db9c0ce95d8bfa0e8ffec29da7f7a9d73a32e5b77eac07ca3306c56a972dc57fd89d477edaebf3d5 WHIRLPOOL 29145f5721e079e0548c5ef22424c65e6a5b2bfc4428918e923fcfdfc37e9b8749fb63e3c2eb5773c17fab276f7513dd66e326b906f1848911dceba7ae4b419a
diff --git a/sys-libs/netbsd-csu/metadata.xml b/sys-libs/netbsd-csu/metadata.xml
new file mode 100644
index 000000000000..89c4bdb96049
--- /dev/null
+++ b/sys-libs/netbsd-csu/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 type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
new file mode 100644
index 000000000000..bacdd60d24fa
--- /dev/null
+++ b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bsdmk multilib-minimal toolchain-funcs
+
+DESCRIPTION="crtbegin.o/crtend.o from NetBSD CSU for GCC-free toolchain"
+HOMEPAGE="http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/csu/"
+SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/xz-utils"
+
+S=${WORKDIR}/${P}/lib/csu
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ local inc_arch=${ABI:-${ARCH}}
+
+ # rewrite ARCH to match NetBSD includes
+ case "${inc_arch}" in
+ x86) inc_arch=i386;;
+ # x32 seems to be equivalent to amd64 as far as we're concerned
+ x32) inc_arch=amd64;;
+ arm64) inc_arch=aarch64;;
+ esac
+
+ # we need arch-specific headers for some assembler macros
+ if [[ ! -d ${WORKDIR}/${P}/sys/arch/${inc_arch} ]]; then
+ die "Unexpected ABI/ARCH: ${inc_arch}, please report"
+ fi
+ ln -s "${WORKDIR}/${P}/sys/arch/${inc_arch}/include" common/machine || die
+
+ local opts=(
+ CC="$(tc-getCC)"
+ OBJCOPY="$(tc-getOBJCOPY)"
+
+ MKPIC=yes
+ MKSTRIPIDENT=no
+ )
+ # rewrite MACHINE_ARCH to match names used in CSU
+ case "${inc_arch}" in
+ amd64) opts+=( MACHINE_ARCH=x86_64 );;
+ *) opts+=( MACHINE_ARCH="${inc_arch}" );;
+ esac
+
+ # we only need those files; crt1 and friends are provided by libc
+ opts+=( crtbegin.o crtbeginS.o crtend.o )
+
+ bsdmk_src_compile "${opts[@]}"
+}
+
+multilib_src_test() {
+ local cc=(
+ # -B sets prefix for internal gcc/clang file lookup
+ $(tc-getCC) -B"${BUILD_DIR}"
+ )
+
+ # 1. figure out the correct location for crt* files
+ if tc-is-gcc; then
+ # gcc requires crt*.o in multi-dir
+ local multidir=$("${cc[@]}" -print-multi-directory)
+ if [[ ${multidir} != . ]]; then
+ ln -s . "${multidir}" || die
+ fi
+ elif tc-is-clang; then
+ # clang is entirely happy with crt*.o in -B
+ :
+ else
+ eerror "Unsupported compiler for tests ($(tc-getCC))"
+ return
+ fi
+
+ # 2. verify that the compiler can use our crtbegin/crtend
+ local crtbegin=$("${cc[@]}" -print-file-name=crtbegin.o) || die
+ local crtend=$("${cc[@]}" -print-file-name=crtend.o) || die
+ if [[ ! ${crtbegin} -ef ${BUILD_DIR}/crtbegin.o ]]; then
+ die "Compiler uses wrong crtbegin: ${crtbegin}"
+ fi
+ if [[ ! ${crtend} -ef ${BUILD_DIR}/crtend.o ]]; then
+ die "Compiler uses wrong crtend: ${crtend}"
+ fi
+
+ cat > hello.c <<-EOF || die
+ #include <stdio.h>
+
+ __attribute__((constructor))
+ static void ctor_test()
+ {
+ fputs("ctor:", stdout);
+ }
+
+ __attribute__((destructor))
+ static void dtor_test()
+ {
+ fputs(":dtor", stdout);
+ }
+
+ int main()
+ {
+ fputs("main", stdout);
+ return 0;
+ }
+ EOF
+
+ emake -f /dev/null CC="${cc[*]}" hello
+
+ local out=$(./hello) || die
+ if [[ ${out} != ctor:main:dtor ]]; then
+ eerror "Invalid output from the test case."
+ eerror " Expected: ctor:main:dtor"
+ eerror " Output : ${out}"
+ die "Test failed for ${ABI:-${ARCH}}"
+ fi
+}
+
+multilib_src_install() {
+ dolib crtbegin.o crtbeginS.o crtend.o
+ dosym crtbegin.o "/usr/$(get_libdir)/crtbeginT.o"
+ dosym crtend.o "/usr/$(get_libdir)/crtendS.o"
+}
diff --git a/sys-libs/newlib/Manifest b/sys-libs/newlib/Manifest
new file mode 100644
index 000000000000..9b446f8645f6
--- /dev/null
+++ b/sys-libs/newlib/Manifest
@@ -0,0 +1,19 @@
+AUX newlib-2.1.0-msp430-destdir.patch 1271 SHA256 84128637a4d28c445d5e0203b7c22ac4ce8ced5a50e64ba969ffcda99dbc1f01 SHA512 094410eb6e259e05ee0ecdf7fc5db2a46af3f09cfb2ac6f3c96eb3d440c28eacfcd1c02e397240fd5e542cb97cf0ea1707ea08d4d1a85e6387769c83ad6df850 WHIRLPOOL de8aa40db0821fe515a9ee044f7c6d71026493372a16e4adb9268d2258f0fe8f153b81ef89b63283eab33857912433a3f36c7c7a976b3231675426c28114b4de
+DIST newlib-2.0.0.tar.gz 15868470 SHA256 49c29e9129325e7c3b221aa829743ddcd796d024440e47c80fc0d6769af72d8a SHA512 539cc6e3854a52a7871a822e35563ff0dff7124b667fd9471150b9c56f556c0bcc526dfb5503aba5160a5fb61955a3d0876df639374727d2a444b08f90dbf233 WHIRLPOOL f9fbd87e36c1bfc94cfabfdcfa3a347d611e275eafa9167f9c4b5adea6b1833b090960ba37503210146aec4060dc360f43c31dab5cb8def2d51db33fac935640
+DIST newlib-2.1.0.tar.gz 16199705 SHA256 3e4d5ab9f0508942b6231b8ade4f8e5048cf92c96ed574c2bd6bd3320a599a48 SHA512 6770864f9307abb2401a4e48f286845d3a4afc30b2ac987da4b964a5485cc3823b32d06a0abf61528e93c4ad8a3a0aa3cc1ecd3b033850e6b2bde6d9bbc9a547 WHIRLPOOL 6faba54a72c6242c694f43a7f2e62d23584fec658818201ee58e1d2954d45b58a5f4effd63f5274b99748ed7730db76e0cf2aa1ecfbdf7001f10929d7db6353c
+DIST newlib-2.2.0.20150423.tar.gz 17485660 SHA256 b1ff3642b246adc6ee546884cb9ea3b0913f17394cbf7ca4d3b82544fef759f7 SHA512 0eecaf5dbf6caf0e0fca3697dfd70e5f60ecbc0a3365852586bc40a32bd535ef0936fa7fc68fceda3426cdb9b6259de12ed00303cadeea09d95b5f1a07022bae WHIRLPOOL 37d78cf24a072819bcf098e3b384cf6fa3a11ded461d6fb12e8635169fcb8b638400622878ad947df55236957a6ce3884ad46f02f7351414842eb048ceed7d73
+DIST newlib-2.2.0.tar.gz 16521910 SHA256 f8add263b0737591aff451b12a00c262c2efac4fa87d741fa1c318fc3bb335be SHA512 ab9161f16845367c823b6709e3c5708969f29f05c77edb1cf969ff4202f358648f1e55080974599dcefed2fbced4694dc73748596e76c1aa37c50cddff6e4be3 WHIRLPOOL 8dfc23f93d774c5092d64d1482c3ecc6e3ba35395822bb1d52f5e3b86f644ee803927bff133883926f3e019cfd5d9f04ffe0dcaac20bdf144c542ba1dc3edff9
+DIST newlib-2.3.0.20160104.tar.gz 17674117 SHA256 c92a0e02904bd4fbe1dd416ed94e786c66afbaeae484e4c26be8bb7c7c1e4cd1 SHA512 d83ce298b1b72eabf92e4ec14af3afdf3122e34aff5e320295a398df077235a78aa87148895b441a4f7de3047815e7ce13ea06a06135dd86b69a200236514293 WHIRLPOOL 41ab57955b886dad8988bd06a18c1b5bbf21c7b554410711c17141bbc12d70af2f6ce6f9d3503c11180d46b42bcf305c6347ea58252d24459dc02c568aeb8497
+DIST newlib-2.4.0.tar.gz 17574364 SHA256 545b3d235e350d2c61491df8b9f775b1b972f191380db8f52ec0b1c829c52706 SHA512 c60665e793dce2368a5baf23560beb50f641e1831854d702d1d7629fb6e9200cf814527f29796792a3d2dff81afee4255723df99ceb0732f99dd9580a17d2ac0 WHIRLPOOL 34648a203286c8adc18bd38ae43ef389d0eb46e4280501250ab05b413d82e028a68abb4e331744e078eacad1d40c67178a1d12c39767da7cf89d0a49a7d8762f
+DIST newlib-2.5.0.tar.gz 17912392 SHA256 5b76a9b97c9464209772ed25ce55181a7bb144a66e5669aaec945aa64da3189b SHA512 4c99e8dfcb4a7ad0769b9e173ff06628d82e4993ef87d3adf9d6b5578626b14de81b4b3c5f0673ddbb49dc9f3d3628f9f8d4432dcded91f5cd3d27b7d44343cd WHIRLPOOL 45fdce47ecde0bb61367465ce2174cd3d00b5a034c0c204d19aba7850fd7d9151e89ad55c716ac0a7eba648f5e15d4ae0ca44f25cd7b27ed00f8968a53113f8a
+EBUILD newlib-2.0.0.ebuild 1616 SHA256 7f8ad6b468a631a1f558c50b580919d9e81471ae36166eb005426790b04a6818 SHA512 3732d242b676ba1f320ab759145a4f71a21e821414ebc73149ae88b77a522a474b7f58ecfb9907cd2f78b1a4da51c66137e8938ff1bab5ceaceadc4500ae80cf WHIRLPOOL cf547b93391f7d16766e3743eeee377f8af770eedb7ba89f8f39d6ddbe77500270cde8e5b46e1e80dff4717b3b2e82c36ad6e78ae974002cbe19729081fa15bf
+EBUILD newlib-2.1.0.ebuild 1711 SHA256 5f96a69ec3ff88005ca7f33525276040d873e6abd634e7e6f5388c9090589d01 SHA512 8d72568ac842863ac1c7147fbe586e6256319faa81a7801e79cb8523206408981c2cb774c96997e0575f5bd9ae90969e7fbe5f70b1f1f6819acb6ca6648ab838 WHIRLPOOL 22ffe527b7eeb7591318ab49b64f47e03b9e8ff147dc9803ef56d649613a540d0f8dc10e31eae58c82f1d16d1542ac70b5b6b450d3cc34ce838038d17629ed09
+EBUILD newlib-2.2.0.20150423.ebuild 1828 SHA256 ef5d17e6fd135392f3856851517976723642eb55601187b038ac72636aa1c41e SHA512 66ee2754b45093ba8c9f5c8ff7b3b6304cc43d28fb83233c25d80e91ebbe62423e8a3b2c44922616cd670ad232160fba5c972600252e775ef9d4b97027b51450 WHIRLPOOL 19296f721576cbaacc87e23643f127372d28b4837f5458dea0dd196d41411f23b37477b306ff44a64ad7a4c5034f2047d5ad4223969c2de2f07e0e5537bf9b25
+EBUILD newlib-2.2.0.ebuild 1846 SHA256 4d5f72db80ccd6fb23a3526ffd3639e4f39a7c336ab20c46a1f967716a519100 SHA512 134e8e06977de1e047b51994477d42013c8859f582729d352572c0e77a23e186e885a9318d26a07910bbdb2f2f8a11cc16c23f14c92c77c2214355bad997966b WHIRLPOOL cac57bc17817362d85c0550729239b18dd91ee3e8eac73c36a4fd087870b06a677d3e43a69ada84de143547b39c19d946455801f885fd93198b1848e5bd5f8e6
+EBUILD newlib-2.3.0.20160104.ebuild 1830 SHA256 9ab73135ef7f24be2057c2feb320218877ea59cb6328c790b4ce52a570814dba SHA512 96fd03cacb32c679f11014f62a6a70a62d1c81c830391eabd73b654766f80358c40b42f0297835bc0079f282b38f60129559495c2e820afed97029ae21cc10a6 WHIRLPOOL 3b1f425d716faaba2c424ed6c70009571a12ac28f0c307cce52a568a91bbe93c1b47c0b1f9ddc8acb88027ccde752d2a6934be63fe86ad79f1330836a1d221f6
+EBUILD newlib-2.4.0.ebuild 2023 SHA256 fa3e5a69ae2ad44f03496b995f8ca1d5514f3179e4b3629fd10a4c49f1ec019c SHA512 f3c1b79607e6cf986123b731f5e1bde625d2f54b876103378a5c1b22dcb39f292e571002b7c1466e82c5f0b573df742c7b75878b80633075eadf32fef49bd072 WHIRLPOOL 537933947c5bb191f880d1bbe3c4b4e00ca9154ac22722529864263d4dae43f4e8b69d8c6d3c742239858a0f1cb0e09fc841d8087823360bd45e42f3d049e93d
+EBUILD newlib-2.5.0.ebuild 1982 SHA256 9a7606709661451208302236c959c7d0e15d54de707cb7eb409117b8c8d7017b SHA512 15a86d859e9a82922b07316184caa42303862d10ab1d9137a1be34e6691980bc1e61e58155022cde59ca5eb5e667b96fda7db038ee2229bc376830535878f95f WHIRLPOOL b1d97fe3a6b2273def85932dfb2b8df0e4b82869710ddad89dcfd810738839241c68524c00b0f8ba47d48119670dbb551dd504ce016294c96789b8c45bab9895
+EBUILD newlib-9999.ebuild 1982 SHA256 9a7606709661451208302236c959c7d0e15d54de707cb7eb409117b8c8d7017b SHA512 15a86d859e9a82922b07316184caa42303862d10ab1d9137a1be34e6691980bc1e61e58155022cde59ca5eb5e667b96fda7db038ee2229bc376830535878f95f WHIRLPOOL b1d97fe3a6b2273def85932dfb2b8df0e4b82869710ddad89dcfd810738839241c68524c00b0f8ba47d48119670dbb551dd504ce016294c96789b8c45bab9895
+MISC ChangeLog 4107 SHA256 0a28521e4ba3bb5ee414ce44694a231cda410e1f11cb93c62ca5cf1eb55e26ca SHA512 f7d796fc9d275b9cd0facfa7e4adab672864c67c6c3b1b7c3415f3da94b04753111733d6410dea7e32d980199d6a3004c41d89cddb886918c5037e8230c2b986 WHIRLPOOL 1eabff09f60a43cbe41ed739f744243debf09cacd617c6ba2b23d8db95f1eabba288e8c6ed570129a148748b19f1508c2f1e7b4735233537b5b9ae0561da1d82
+MISC ChangeLog-2015 4945 SHA256 11f5d12456430577aa00981110408f04fa4f5c23d56cd61876f7e3988aa89347 SHA512 7270853c28263aba68292ce332d52d63df9f395e5981df673bdc2b016ec3457aac1eb7a56b52e8d1890dc3196d831ea836bd368ae0f8d93e13734fa4e397f2f0 WHIRLPOOL 2b785f7603e12bc149b306e95bf9f96311dbde252fab8c4b5f2c71441643945c818d80494393a2d99540cb541271578cf6181529eba70d547d33efc6c4b06f16
+MISC metadata.xml 330 SHA256 0d33786b6df216eaeff2ac74b7a0c68041b294190829c9f614aaad73551709d5 SHA512 cf10bd2100eec996bcd2668a2e8fda67321f6969c59b3969ca1a62bc814113a48d475dbdcae3f4d6ac2186e770ec61d5c8c90690de921ea05696dc8924ec50b5 WHIRLPOOL f1ff858e5271f1ee5e383588c21f763fe959953205ca4b416240584b4fdd36f8107ddf54dbfb6c6366c22c24ae7806b8edf050a7336b43fb5c2ea30aba9441ed
diff --git a/sys-libs/newlib/files/newlib-2.1.0-msp430-destdir.patch b/sys-libs/newlib/files/newlib-2.1.0-msp430-destdir.patch
new file mode 100644
index 000000000000..38fa2643dce3
--- /dev/null
+++ b/sys-libs/newlib/files/newlib-2.1.0-msp430-destdir.patch
@@ -0,0 +1,41 @@
+From 0a7009c61811b4451ff6cccda24f42ab07142603 Mon Sep 17 00:00:00 2001
+From: DJ Delorie <dj@redhat.com>
+Date: Thu, 23 Oct 2014 01:49:45 +0000
+Subject: [PATCH] 2014-10-22 Tim Harder <radhermit@gmail.com> *
+ msp430/Makefile.in: respect DESTDIR during install
+
+---
+ libgloss/ChangeLog | 4 ++++
+ libgloss/msp430/Makefile.in | 6 ++++--
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+2014-10-22 Tim Harder <radhermit@gmail.com>
+
+ * msp430/Makefile.in: respect DESTDIR during install
+
+diff --git a/libgloss/msp430/Makefile.in b/libgloss/msp430/Makefile.in
+index d72051d..b9f5a6a 100644
+--- a/libgloss/msp430/Makefile.in
++++ b/libgloss/msp430/Makefile.in
+@@ -12,6 +12,7 @@
+
+ # Makefile for libgloss/msp430.
+
++DESTDIR =
+ VPATH = @srcdir@
+ srcdir = @srcdir@
+ objdir = .
+@@ -138,11 +139,11 @@
+
+ install: $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT) $(SCRIPTS)
+ for c in $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT); do \
+- $(INSTALL_DATA) $$c $(tooldir)/lib${MULTISUBDIR}/$$c ;\
++ $(INSTALL_DATA) $$c $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$c ;\
+ done
+ for c in $(SCRIPTS); do \
+ b=`basename $$c`; \
+- $(INSTALL_DATA) $$c $(tooldir)/lib${MULTISUBDIR}/$$b ;\
++ $(INSTALL_DATA) $$c $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$b ;\
+ done
+
+ clean mostlyclean:
diff --git a/sys-libs/newlib/metadata.xml b/sys-libs/newlib/metadata.xml
new file mode 100644
index 000000000000..5025963793d5
--- /dev/null
+++ b/sys-libs/newlib/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 type="person">
+<email>lu_zero@gentoo.org</email>
+</maintainer>
+<maintainer type="project">
+<email>toolchain@gentoo.org</email>
+<name>Gentoo Toolchain Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/newlib/newlib-2.0.0.ebuild b/sys-libs/newlib/newlib-2.0.0.ebuild
new file mode 100644
index 000000000000..1e1ee8fed867
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.0.0.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="https://sourceware.org/newlib/"
+SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+KEYWORDS="-* arm hppa m68k ~mips ppc ppc64 sh sparc x86"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.1.0.ebuild b/sys-libs/newlib/newlib-2.1.0.ebuild
new file mode 100644
index 000000000000..3ee1e7eb83e0
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.1.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="https://sourceware.org/newlib/"
+SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-msp430-destdir.patch
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.2.0.20150423.ebuild b/sys-libs/newlib/newlib-2.2.0.20150423.ebuild
new file mode 100644
index 000000000000..df987d568b6a
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.2.0.20150423.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib-cygwin.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+ if [[ ${PV} != *.201[5-9]???? ]] ; then
+ KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+ fi
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="https://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.2.0.ebuild b/sys-libs/newlib/newlib-2.2.0.ebuild
new file mode 100644
index 000000000000..2754fda04d90
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.2.0.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib-cygwin.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+ KEYWORDS="-* arm hppa m68k ~mips ppc ppc64 sh sparc x86"
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="https://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# Handle the SLOT changes. #497344
+RDEPEND="!<${CATEGORY}/${PN}-2.1.0"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.3.0.20160104.ebuild b/sys-libs/newlib/newlib-2.3.0.20160104.ebuild
new file mode 100644
index 000000000000..43c6ac3aa91b
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.3.0.20160104.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib-cygwin.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+# if [[ ${PV} != *.201[5-9]???? ]] ; then
+ KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+# fi
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="https://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.4.0.ebuild b/sys-libs/newlib/newlib-2.4.0.ebuild
new file mode 100644
index 000000000000..e70a03bdcad2
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.4.0.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib-cygwin.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+# if [[ ${PV} != *.201[5-9]???? ]] ; then
+ KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+# fi
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="https://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=(
+ # Disable legacy syscall stub code in newlib. These have been
+ # moved to libgloss for a long time now, so the code in newlib
+ # itself just gets in the way.
+ --disable-newlib-supplied-syscalls
+ )
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf+=( --disable-newlib-multithread ) \
+ || myconf+=( $(use_enable threads newlib-multithread) )
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ "${myconf[@]}"
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.5.0.ebuild b/sys-libs/newlib/newlib-2.5.0.ebuild
new file mode 100644
index 000000000000..6a325c787586
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.5.0.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic toolchain-funcs
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib-cygwin.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+ if [[ ${PV} != *.201[5-9]???? ]] ; then
+ KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+ fi
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="https://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=(
+ # Disable legacy syscall stub code in newlib. These have been
+ # moved to libgloss for a long time now, so the code in newlib
+ # itself just gets in the way.
+ --disable-newlib-supplied-syscalls
+ )
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf+=( --disable-newlib-multithread ) \
+ || myconf+=( $(use_enable threads newlib-multithread) )
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ "${myconf[@]}"
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-9999.ebuild b/sys-libs/newlib/newlib-9999.ebuild
new file mode 100644
index 000000000000..6a325c787586
--- /dev/null
+++ b/sys-libs/newlib/newlib-9999.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic toolchain-funcs
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib-cygwin.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+ if [[ ${PV} != *.201[5-9]???? ]] ; then
+ KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+ fi
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="https://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=(
+ # Disable legacy syscall stub code in newlib. These have been
+ # moved to libgloss for a long time now, so the code in newlib
+ # itself just gets in the way.
+ --disable-newlib-supplied-syscalls
+ )
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf+=( --disable-newlib-multithread ) \
+ || myconf+=( $(use_enable threads newlib-multithread) )
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ "${myconf[@]}"
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/nss-usrfiles/Manifest b/sys-libs/nss-usrfiles/Manifest
new file mode 100644
index 000000000000..c763f70ea441
--- /dev/null
+++ b/sys-libs/nss-usrfiles/Manifest
@@ -0,0 +1,5 @@
+DIST nss-altfiles-2.18.1.zip 42369 SHA256 32eb1ecd94c7c789b540e2d047bb90f5a82d3ec02f8b4adbfc48ae55c32aa1d6 SHA512 d9e2c34ce2518a5310578a2b99a59fc1a8142c252c41e5dab0fd0c07e62ccfa2e3c5d2dd29e179514f3b37537bb0576e2bc3c850f459fa251cd57923438981af WHIRLPOOL 7a035ccb0844df32064f7dc6bf027a1cc55ac4421feda2832516445f904ec6616d67e1dcc3387b85553fdeacd566c7fcff970a24888587d16654c444247ae636
+EBUILD nss-usrfiles-2.18.1.ebuild 678 SHA256 ac054293deb2f55353ac4abfefa5bea89cc53679c2d8aa2786bfdfad246f6de9 SHA512 dad315420bb9a5f72acab271eab41c07ab045b5703d5b94ff4993b15156a77ddaf5f50ab64e4a2021e303239d59686cfd329a47ca15bd0aa73f2be3e418e5f8d WHIRLPOOL 84c2d53d42342c2546bd02be226a732f78f818e1d13cff037e23a97287c64987c0e74007b0059f744c6af4ace0e324ed622cee8ccc23b210dfc9e44945448663
+MISC ChangeLog 2193 SHA256 daab042d295760597236c0a1a3ca2848fba652dab0dedd2b0423b5c4cdfbe66c SHA512 50d3b7e782bc770755bb85a60290f6a7e05a87f324b9a1059b3d25d8198bc269222a7ed49e7a94fb7d1ab64be77d6fb9d5a8274180f26e85b1593ff100e5eb81 WHIRLPOOL e98fdfa903473b3d20f4f6241fb4bc4385d241beb03f4728f01ea4722d81fda3c22262864cef8585d90fa1979e589f96c66c5c434f6c4ba7ff6cefda0271b97e
+MISC ChangeLog-2015 553 SHA256 69231c447117e566d6c90b94fd24c7cd7ef650599bb329cc7fabb395223db6c2 SHA512 69aaa3ff10847d76902577d31b6a07ed61afe8008b32af34a6ccee67de91ce19af89e10f7ca30c1b374ddba2010b8e96ef50e46f1671653a2537fecc4a0cc1c4 WHIRLPOOL f413e2a71ff1a7f07aa7d7838c7606fb04abace8f7763641d6bbffcac5c7bbe9c90743b9bec113157dfd6664e754be75908bfca274ba20d2d3735182e39ecec5
+MISC metadata.xml 326 SHA256 41e91adf1c2e4605bdc1005b3731c55b57802d40a0cd8322e4c17edad4c08805 SHA512 1264c4689eb03ec6fa879b069d313d04bc72cfcc4a89a72f8644ed4c94739996792d921d60024a285c3719b5d311fa3e67d41c0d384cc609edc7e0379ac2b717 WHIRLPOOL b7d9b9f5ae6b2f91e8915cb8990e0343ed6cb690a05391b1365bd2eb01494d8b4c0fa44a7e8318c7c7114074493591b410d85c7aa98223568a7cd7cb395f5cc5
diff --git a/sys-libs/nss-usrfiles/metadata.xml b/sys-libs/nss-usrfiles/metadata.xml
new file mode 100644
index 000000000000..7b6e2601d4ca
--- /dev/null
+++ b/sys-libs/nss-usrfiles/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 type="person">
+ <email>ryao@gentoo.org</email>
+ <name>Richard Yao</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">coreos/nss-altfiles</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/nss-usrfiles/nss-usrfiles-2.18.1.ebuild b/sys-libs/nss-usrfiles/nss-usrfiles-2.18.1.ebuild
new file mode 100644
index 000000000000..4934b0ad75bb
--- /dev/null
+++ b/sys-libs/nss-usrfiles/nss-usrfiles-2.18.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_PN="nss-altfiles"
+MY_P="${MY_PN}-${PV}"
+DESCRIPTION="NSS module to read passwd/group files from CoreOS /usr location"
+HOMEPAGE="https://github.com/coreos/${MY_PN}"
+SRC_URI="https://github.com/coreos/${MY_PN}/archive/v${PV}.zip -> ${MY_P}.zip"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64-linux"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+S="${WORKDIR}/${MY_P}"
+
+src_configure() {
+ : # Don't bother with the custom configure script.
+}
+
+src_compile() {
+ emake DATADIR=/usr/share/baselayout MODULE_NAME=usrfiles
+}
+
+src_install() {
+ dolib.so libnss_usrfiles.so.2
+}
diff --git a/sys-libs/nss_wrapper/Manifest b/sys-libs/nss_wrapper/Manifest
new file mode 100644
index 000000000000..9d43ed824cad
--- /dev/null
+++ b/sys-libs/nss_wrapper/Manifest
@@ -0,0 +1,7 @@
+DIST nss_wrapper-1.1.2.tar.gz 53271 SHA256 0e65e22bf1c75c3a8931137c85679c6e5136eb5273ffcc6933dfd4f5312561c2 SHA512 127f06a8df66a6e7bee945c88a6e647300ba86c83a08efd9aac836e18fd889b9767378025eec88f5f2b50db40c61eee929a858dd9f9fae25862b107d4363faab WHIRLPOOL 7e9871cd15cfeaef3195cf801f6cacd02a81f9b733bff26cb21de72028c91bb75d9d6b51a4e5aacde1978396bf798f832c3db6f310f1f89a380e17bcac3913fe
+DIST nss_wrapper-1.1.3.tar.gz 53543 SHA256 c9b84c14c5bc6948cdad4cbdeefaaf8b471a11ef876535002896779411573aa3 SHA512 c48b176dcd55d4de01ba2fc04e4c2ab9cb77f67d26d3a3464ca4292e607e21a621a582c21d00504c9cadb50a495f4b11b086e9decba28625cff4ff44e5d33c8d WHIRLPOOL 0d5800d23b7bc6463e3928eeb33920ca6ad757bf9c31a94fef75d759975540eb577d35a9fe80e0e53fab2e622b41383052854c024561158b2404b63efe5ac128
+EBUILD nss_wrapper-1.1.2.ebuild 652 SHA256 ba1c96c7ebd28134b05cb2709aff7087f50f70f412dc80d71828b52cef5a33b5 SHA512 d68c8baf6cf24c588cdf12c3db8bf420fe70ae67259edb87ec66abdedcfd2d9ea9d9bbca7b561502bb1edbe8a93eb003e5e83f26d3fc69e6e4627a646bf6dcb8 WHIRLPOOL 2bf97220c51c7ee35ad908d96046c7cc5e2b368b1e38910329012ff614290629cf986e680762dd4f7c8f1c547bbc6d7c61b3281bc023b31bc86477b4b3def719
+EBUILD nss_wrapper-1.1.3.ebuild 687 SHA256 b2fa6accc4c51d99945deeab92b82688133b38b3a5cba5e6cdc6e6ee9f53920e SHA512 2e4aa77a5f29603bec7cbf198f1f39545cd875a4f79e8971b676cffa77509d31c179a10bdd2b8d286ef616733741e446aee7fcb4a81acab3bee4bf01ac6672a9 WHIRLPOOL 171467432c20b95376ff82efb4731bddcbd709afb714dbccfbb56e6d14c6b4d3a5dd7f896246521e2e2b71b45fda758ce9553d56935bd68ccc347b77fc3693be
+MISC ChangeLog 6589 SHA256 aa7ef81a3effdca26cf01ba4bd63b767b2d66748819e924b674246ceb5d33ae6 SHA512 36d98b08a0a4816133d5c1c54593cbb52407d16bc4631816ea2ba2842172205616ff9c2bcd7d827469b7c96da1cf67d8f92b305aac5f65db424aa5f11e7ef61b WHIRLPOOL b0215b1c97d0e0def83452052ad45f01a153128bde5cdeb717d95e7ede7e7fb608d8fe429e586a09513d5d091458d6010b0ef7ece496818b2759fd74afece253
+MISC ChangeLog-2015 391 SHA256 7d0b23966522c4ce5554ce4824dc1f288df683a0384c5648dd96da11f451dc4f SHA512 3a45f9910d4394723d7258bc38d0c13700b2e350416152cfc3f9e13ce31b93b4c60f35636a91d7d9885632c50d902f34843fb32009b338f9e56aa4e4a2570eb0 WHIRLPOOL e9996395f4c09225cc06ddb647657426b1edf84c503bfec085bba8e899549bbc2c7b9a5e70a3a643e2c438f822f40c167ed3b69b188fd5a10e6dc8802129d5d7
+MISC metadata.xml 360 SHA256 debc337b7549e12f55cf6ebdf900a95eb3b2370aa60daa49fd7ae97659ca5a85 SHA512 6cfeb9ed18b5c3b6c6e6875311bad627e9baffdf7b0846d70c8e0e36ce053ce849f867e963f7504292bbeb4b133c828e75a2d877c34fe7858ab3b9403ce533d2 WHIRLPOOL 1e6aa7563470c001516ce0b5f398d4fb5d854bb8a3a47a6631bd53f9b377950644ccb487a651f9648ead2815b815e8fd16d3cf7b6cd5c2d18958472b2a25c421
diff --git a/sys-libs/nss_wrapper/metadata.xml b/sys-libs/nss_wrapper/metadata.xml
new file mode 100644
index 000000000000..f05d1f266834
--- /dev/null
+++ b/sys-libs/nss_wrapper/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 type="person">
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+<maintainer type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/nss_wrapper/nss_wrapper-1.1.2.ebuild b/sys-libs/nss_wrapper/nss_wrapper-1.1.2.ebuild
new file mode 100644
index 000000000000..76aff5499f0a
--- /dev/null
+++ b/sys-libs/nss_wrapper/nss_wrapper-1.1.2.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit cmake-multilib
+
+DESCRIPTION="A wrapper for the user, group and hosts NSS API"
+HOMEPAGE="https://cwrap.org/nss_wrapper.html"
+SRC_URI="https://ftp.samba.org/pub/cwrap/${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~x86"
+IUSE="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+# Work around a problem with >=dev-util/cmake-3.3.0 (bug #558340)
+# Because of this we cannot use cmake-multilib_src_configure() here.
+multilib_src_configure() {
+ local mycmakeargs=( -DCMAKE_LIBRARY_PATH=/usr/$(get_libdir) )
+ cmake-utils_src_configure
+}
diff --git a/sys-libs/nss_wrapper/nss_wrapper-1.1.3.ebuild b/sys-libs/nss_wrapper/nss_wrapper-1.1.3.ebuild
new file mode 100644
index 000000000000..9c850eb8eab2
--- /dev/null
+++ b/sys-libs/nss_wrapper/nss_wrapper-1.1.3.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+DESCRIPTION="A wrapper for the user, group and hosts NSS API"
+HOMEPAGE="https://cwrap.org/nss_wrapper.html"
+SRC_URI="https://ftp.samba.org/pub/cwrap/${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 sparc x86"
+IUSE="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+# Work around a problem with >=dev-util/cmake-3.3.0 (bug #558340)
+# Because of this we cannot use cmake-multilib_src_configure() here.
+multilib_src_configure() {
+ local mycmakeargs=( -DCMAKE_LIBRARY_PATH=/usr/$(get_libdir) )
+ cmake-utils_src_configure
+}
diff --git a/sys-libs/ntdb/Manifest b/sys-libs/ntdb/Manifest
new file mode 100644
index 000000000000..5cd3b54a1e1b
--- /dev/null
+++ b/sys-libs/ntdb/Manifest
@@ -0,0 +1,5 @@
+DIST ntdb-1.0.tar.gz 794585 SHA256 817ae862b1e6976cab867468f209d8417a90c7c2fcf0ec079a45645d7e7ebf49 SHA512 27f550f85a7bfd105d4115b55f9919f1871964f576a8470688fe8040fb9e2be209246a291d78f55c61cf0920238d7f41917ad7e2d44b202382b3ea47c8c97100 WHIRLPOOL 71a007312eacf7805dadc0b0089f7344b270a628e9dc3c1d8aeb505efdeead3b66cb8006377550c672a15cbf814264cb16c93892f7319bc031b8fe669bf29747
+EBUILD ntdb-1.0-r1.ebuild 1122 SHA256 2dc6d5b3aa4f5afb36fa567cbde0995e112752f78aec6566669d9c2666012e7e SHA512 2a47af90a3485c713fcfc46f645f5cf73d2a0f562b40a94b6dd8268bda542cc5e976093b16d66673e32ccb4f9bfdb99abce78cac178f9936b71a0f17e58533fe WHIRLPOOL 0aa5f6f0c1fa35d2390f88e80cf03561f6d368ff315f773a95295e86288da6b6efc1c2c77ea69ff403546ad8c66ebcb541300f45b31c3426951fc709a80fdace
+MISC ChangeLog 4610 SHA256 1a77ce7bfe68b8f7efc656e99227aa6adadb1fa2675406de111f1f649f3f5256 SHA512 548dd846574ee4adf9cb3f81558f37decd551065210d73602193a6a6b5a54ef214d1f612e8444766e0b53c73c0a71e79b5f118c6d14473deed880e6d9bba67ee WHIRLPOOL 45d0cb520f6ad5b345a862c3caa664b226bdf73c3a2c4105f1e9bd2da412b7879db4393c3a73196dc1739eb2c9347af77f3725116e02ec14d9594318e88d60a4
+MISC ChangeLog-2015 1248 SHA256 8518dce99132635b816db48bab30cb4c6ea91d52240f930df968956f2f76df1f SHA512 f579b160127f8558904d95da7efe4a78ffb3a786afccce71b5b6c5e9dbb3c3e0016e2db5ed9d4396e1994707c9761cde8350d4f5d006377bdd630c2fba94e891 WHIRLPOOL 0d77b463dc0d2c0d1b5ad9d6e8157ae1da246cd369d4077f9b335e67e4fc395b1707ef0d97f052c8bb875032a27c3a8a1c6e739ea682ba4cec66a07a232fd545
+MISC metadata.xml 360 SHA256 debc337b7549e12f55cf6ebdf900a95eb3b2370aa60daa49fd7ae97659ca5a85 SHA512 6cfeb9ed18b5c3b6c6e6875311bad627e9baffdf7b0846d70c8e0e36ce053ce849f867e963f7504292bbeb4b133c828e75a2d877c34fe7858ab3b9403ce533d2 WHIRLPOOL 1e6aa7563470c001516ce0b5f398d4fb5d854bb8a3a47a6631bd53f9b377950644ccb487a651f9648ead2815b815e8fd16d3cf7b6cd5c2d18958472b2a25c421
diff --git a/sys-libs/ntdb/metadata.xml b/sys-libs/ntdb/metadata.xml
new file mode 100644
index 000000000000..f05d1f266834
--- /dev/null
+++ b/sys-libs/ntdb/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 type="person">
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+<maintainer type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/ntdb/ntdb-1.0-r1.ebuild b/sys-libs/ntdb/ntdb-1.0-r1.ebuild
new file mode 100644
index 000000000000..83fea05c3b18
--- /dev/null
+++ b/sys-libs/ntdb/ntdb-1.0-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit waf-utils multilib-minimal python-single-r1
+
+DESCRIPTION="A not-so trivial keyword/data database system"
+HOMEPAGE="http://tdb.samba.org/"
+SRC_URI="http://samba.org/ftp/tdb/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 sparc x86"
+IUSE="python"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="!<net-fs/samba-4.1.7
+ ${RDEPEND}
+ ${PYTHON_DEPS}
+ app-text/docbook-xml-dtd:4.2"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+src_prepare() {
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_test() {
+ # the default src_test runs 'make test' and 'make check', letting
+ # the tests fail occasionally (reason: unknown)
+ emake check
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+}
diff --git a/sys-libs/obstack-standalone/Manifest b/sys-libs/obstack-standalone/Manifest
new file mode 100644
index 000000000000..9244d27d495f
--- /dev/null
+++ b/sys-libs/obstack-standalone/Manifest
@@ -0,0 +1,3 @@
+DIST obstack-standalone-1.1.tar.gz 11561 SHA256 52a216613e7d55e8725e43d017bb2d49a4b1ffa1e06da472f03c7f9875df7d0d SHA512 e3a9956133d72a00663cf8d9720e62002142e113e7d67e2338a2bce1bdfac9eefd4290db8add15eabafdf01065f7fe9bb6754faa36b88df819c53d44fa140757 WHIRLPOOL 2db9b26af04dd06fe216969443ebe9ea1be232e1d51b367da6dab76220ef3e354a4acc9fcf57441f6f7396d407371f5c18940947472e1460666d73ddd58249a2
+EBUILD obstack-standalone-1.1.ebuild 769 SHA256 4719266242f8a8599797079e39c322c7ea720b583de47f8cab02f312fadd80eb SHA512 229822dad39325885d7fb6a7c809183a46d8e0e51d0a3b663eadb21be0b9728e04e4178ee9c415fd7b19f081942246b0a10a9e40300e8f36aec9ce17073066c7 WHIRLPOOL a69f21837832f7ec2550a834f45b37dfd74751d42e352334d5c5c68e0fd084b661cb645e32a2ba18fdc6b3c70d6fe8e8e47e715257c4315ec2caeb98985d3559
+MISC metadata.xml 444 SHA256 d0fa9b51d57934d7b1947211aca09a64cb3494de4e92c165cac490c887064d41 SHA512 0d325102ff1f4f72cc29d1f9acdf176dbf9d4dd70e4880f96b865404512c42c9d99bfe689bf479e84549e6afbe1f9d9131e1164775c22818abde5028b29d9cab WHIRLPOOL 045f60758827178e99fddeba89dc33dcbd04140d5d948ecab29837feec319de01536fce32dbadb588fb0ea8d31a59987dcc24b5d1578ce1c8e0d177fdade2814
diff --git a/sys-libs/obstack-standalone/metadata.xml b/sys-libs/obstack-standalone/metadata.xml
new file mode 100644
index 000000000000..2f10a3547c34
--- /dev/null
+++ b/sys-libs/obstack-standalone/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 type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>lluixhi@gmail.com</email>
+ <name>Aric Belsito</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">pullmoll/musl-obstack</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/obstack-standalone/obstack-standalone-1.1.ebuild b/sys-libs/obstack-standalone/obstack-standalone-1.1.ebuild
new file mode 100644
index 000000000000..99a82b88b7b2
--- /dev/null
+++ b/sys-libs/obstack-standalone/obstack-standalone-1.1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="A standalone library to implement GNU libc's obstack."
+HOMEPAGE="https://github.com/pullmoll/musl-obstack"
+SRC_URI="https://github.com/pullmoll/musl-obstack/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="static-libs"
+
+DEPEND="
+ !sys-libs/glibc
+ !sys-libs/uclibc"
+
+S="${WORKDIR}/musl-obstack-${PV}"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+ mv "${ED%/}"/usr/$(get_libdir)/pkgconfig/{musl-obstack,obstack-standalone}.pc || die
+}
diff --git a/sys-libs/openipmi/Manifest b/sys-libs/openipmi/Manifest
new file mode 100644
index 000000000000..1ed93ebb2a99
--- /dev/null
+++ b/sys-libs/openipmi/Manifest
@@ -0,0 +1,11 @@
+AUX openipmi-2.0.16-pthreads.patch 546 SHA256 1f40883f92842a1b3d634ed23294fc26ef4a78cd3906034ad7cdf9617331e2df SHA512 cadbcb8a1c08b467ca550e2b8510a415ca50749e752baf3fe8cc59c67c0d6bce0009850510e02d36b306894cb1e84aac3e4d2f947c75d56f8e7443315e4f8902 WHIRLPOOL af2650d00429ed02872549607090f87a42bd434f9a04fdbeadf79c8b725212a73662ba8c783f1576b53dd130ae14aa4e7fcd453c163537d1f8f1e72059a740ae
+AUX openipmi-2.0.21-tinfo.patch 818 SHA256 b2f99c59049764289f0c4dab05bac8002b31cd5a74b96e56acce6b4bc6470715 SHA512 2b3f7f10f6f7f1a71973f0f8f125171c33ad9149bdcd808b9b76571ac2d5a403db0b23bde0fbcb7763fba6101b5015775a3563ed77197f4a50d7ca98812f6d6d WHIRLPOOL c9ecc7d909829435d4ea3800fe7d200ef7ef3564dc6488a0c1abc0d223e7db7ff2bfbf67749787808ab2aa1ffdffbec23acbb68961ae594ff170880b7daeb6bf
+DIST OpenIPMI-2.0.18.tar.gz 2895686 SHA256 6c1679a1c16aade48dd929e5124d2640ff12224ac0de1bb3777e9f1030d62e01 SHA512 a6caf791fb6d5bd83234481ea3c84a408dad3eabc093dbc4681742d23b47b223d0a1715a71a9b977a03a80f5c350dd34f6591ece5ea0d9876cb6debfc80a39d4 WHIRLPOOL 3b9bd32e01c118a450c5f6ec744b5cad521d41091f786a59485b91cde05ca184bdb4d8c05d53e9494966a9a733c560190f85208bedaa3b40e2cac116e3e6a84a
+DIST OpenIPMI-2.0.22.tar.gz 3081893 SHA256 4988900043c35fcfa9b2bf275d6593904f6429221befb770ba6ecb5502108e55 SHA512 78017fc0b52ce6a83db45f595f50170410120c9f7394429869c177ee40ea5b924bcc0e36bb60f9368a75a2f78ff71c70ae3631ba55a207cfb6eb4f62aa44ff89 WHIRLPOOL 2948006a489fc44a836aed5a6147b766fa06ab851b1e01bc0901e1bcad6b7d1b19bc352d2dd0130edf6750ed1822fb24203439185eef1328e7ba6adfdbdefb1a
+DIST OpenIPMI-2.0.23-rc1.tar.gz 3225557 SHA256 25bf1ad2889d5c28094bea45e8222084966c30cd17660c2993840eda2d05e98f SHA512 4da3d74073fe19573b8bc5fda15ecfa4d500a074559155456010e0bac8a8c2d345e30c086a851a9a4e7266165dd9a7a6d8f618e65bad3c2b18fe86d8f4c362ab WHIRLPOOL f6e155cfa74f7654539bbe4940c646370c2faa57acfa72f29b07b29676323733f3f4a2887a317f8e39977abcb02a3a038b2fdb4ca8630d1de0e5a7f4e4cf83a3
+EBUILD openipmi-2.0.18-r1.ebuild 2698 SHA256 8d52f8b19c632244bd35b20ae3c7fc20e49cea946f8d518cd47383939db90c6b SHA512 2ebfd8d50855851c97019df5042958585417de4726cf4d95df1400db2af5935b41586160fd403f5bc98f003a60a2cd5d609b27605e1b8f0472ac04b1e4af2bdf WHIRLPOOL addfe3571d3ba242fb99bdc9877e11cc80ac8d864baf6c9f18c19db5c3c2fcd2d3562eb453de9150f5b22ebe00fb705c0e066de71d50ec30d7fa3c13fb01f9da
+EBUILD openipmi-2.0.22.ebuild 2737 SHA256 bb6fd6138d2629d3234140e253bc01ae3aee6858e5c1ea920c7f29c8b07c70c4 SHA512 f54d1fef56e74d71695020899e293de400ab225b443d6852dd35f5d9966dab904e4bc70e849fd63708cc885ebd6a96bcd3d35deec000e78220fb54aafa883e3a WHIRLPOOL a9b7c34f14aa480a9f4ed37926645b4986628141bedd3f76e30c7b0e9cf5e627db3bce27499f1b7bf859bf6f8dbe9d708a384aee9ab3202f0a3c2c7446dfbb83
+EBUILD openipmi-2.0.23_rc1.ebuild 2745 SHA256 a810fef08100ff42cc0748e423d09764370e4c66fba90ab84a2a2e2ea5d67043 SHA512 ca67943c717f30059aa426dad6669013d4dc940c5e5b1c581e17123496b3163c5d1152e86158dfd156b5bd0eb437070bb33767028a643998fdbd4d1faa11d804 WHIRLPOOL 528115aa7716818ab2907c403afdf1e3613bc581a0c8687c701dcc07583fcc7889b80632095e50e40266ec8dd35206aa5ef35e20a75cd64c7bb706701f1a7c89
+MISC ChangeLog 4306 SHA256 daac08f8d24fd4e5706ce54e8c491348dd595d71131d951169ae3d3cbfa3e0d9 SHA512 f8ddf5aa397bcddd4c08ec6166aca47b2ad63008a5afbb1960e02aa7530cd335fe5b9722c2d2c65dd399be0262246bf01de9b1a6194458fbe20d06b2ea78e024 WHIRLPOOL 458085fed1fccfb1be1eccba88b71fb50b216e7c9d0c8fd9f5595aac071d8bf44733087f52221186ced6c7e715303215fdb710bd8492c0b820a942741485a7a9
+MISC ChangeLog-2015 4937 SHA256 6ecdffc256fe756474714631f49826a4d541b55d3fbf7632a598ebb4b90fab49 SHA512 b840295b8800a26467509f45a06a9938e74a2ed945badf2eeb142dc35e6f0afc6cd71f99fdaba961250b3888bc4584c13c0a2c31aac8789c3d1ed8038afda312 WHIRLPOOL b86762d8fd115ffa34b2c538374d86ee518b064759295fc8ac1e9421c8268e1daf093dcbf629fb97c857fbd5e4ccef36304d0be24bd96bc004bbbc42201f73b4
+MISC metadata.xml 347 SHA256 83aef1618b181b9ca05d7483f4e8de1fec5b9c67ab6fad9619a27038312b5df3 SHA512 f67b97714b2b543109c2bc90d8f474df13e8915b7a14fdc3a16b62f1dfbc59ac27c8e64d19429b87a63ee2c1e4812cee26d8fb797591028484b2072b1951231f WHIRLPOOL 949da3b4c48b9ffaecf817925c9df8b7b0d67aa76f6081d927d9b35c4def0277564f900e3d14ded9f88c06bfe4e5495c028cd93b7b7ee94c24c2e9a1b7f406ac
diff --git a/sys-libs/openipmi/files/openipmi-2.0.16-pthreads.patch b/sys-libs/openipmi/files/openipmi-2.0.16-pthreads.patch
new file mode 100644
index 000000000000..7666e34e936f
--- /dev/null
+++ b/sys-libs/openipmi/files/openipmi-2.0.16-pthreads.patch
@@ -0,0 +1,12 @@
+diff -ruN OpenIPMI-2.0.16.orig/OpenIPMIpthread.pc.in OpenIPMI-2.0.16/OpenIPMIpthread.pc.in
+--- OpenIPMI-2.0.16.orig/OpenIPMIpthread.pc.in 2005-08-17 05:56:02.000000000 +0200
++++ OpenIPMI-2.0.16/OpenIPMIpthread.pc.in 2010-10-31 21:35:56.126933520 +0100
+@@ -6,6 +6,6 @@
+ Name: OpenIPMIpthread
+ Description: Pthread OS handler for OpenIPMI
+ Version: @VERSION@
+-Requires: OpenIPMI pthread
+-Libs: -L${libdir} -lOpenIPMIutils -lOpenIPMIpthread
++Requires: OpenIPMI
++Libs: -L${libdir} -lOpenIPMIutils -lOpenIPMIpthread -lpthread
+ Cflags: -I${includedir}
diff --git a/sys-libs/openipmi/files/openipmi-2.0.21-tinfo.patch b/sys-libs/openipmi/files/openipmi-2.0.21-tinfo.patch
new file mode 100644
index 000000000000..5eb8642ab2e4
--- /dev/null
+++ b/sys-libs/openipmi/files/openipmi-2.0.21-tinfo.patch
@@ -0,0 +1,18 @@
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac 2014-01-28 20:35:02.000000000 +0100
++++ b/configure.ac 2015-09-23 17:05:03.526010122 +0200
+@@ -861,10 +861,12 @@
+ *-sun-*) AC_DEFINE([_SUNOS], [], [Solaris's term.h does horrid things.]);;
+ esac
+
+-AC_CHECK_LIB(curses, tgetent, TERM_LIBS=-lcurses,
++PKG_CHECK_MODULES(ncurses, ncurses, TERM_LIBS=$ncurses_LIBS,
++ [AC_CHECK_LIB(tinfo, tgetent, TERM_LIBS=-ltinfo,
++ [AC_CHECK_LIB(curses, tgetent, TERM_LIBS=-lcurses,
+ [AC_CHECK_LIB(ncursesw, tgetent, TERM_LIBS=-lncursesw,
+ [AC_CHECK_LIB(ncurses, tgetent, TERM_LIBS=-lncurses,
+- [AC_MSG_ERROR([libtermcap, libcurses or libncurses are required!])])] )] )
++ [AC_MSG_ERROR([libtinfo, libtermcap, libcurses or libncurses are required!])])] )] )] )] )
+
+ # Checks for header files.
+ AC_FUNC_ALLOCA
diff --git a/sys-libs/openipmi/metadata.xml b/sys-libs/openipmi/metadata.xml
new file mode 100644
index 000000000000..beb9542e8460
--- /dev/null
+++ b/sys-libs/openipmi/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 type="project">
+ <email>sysadmin@gentoo.org</email>
+ <name>Gentoo Sysadmin Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">openipmi</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/openipmi/openipmi-2.0.18-r1.ebuild b/sys-libs/openipmi/openipmi-2.0.18-r1.ebuild
new file mode 100644
index 000000000000..e2cc89751394
--- /dev/null
+++ b/sys-libs/openipmi/openipmi-2.0.18-r1.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils autotools python-single-r1
+
+DESCRIPTION="Library interface to IPMI"
+HOMEPAGE="https://sourceforge.net/projects/openipmi/"
+MY_PN="OpenIPMI"
+MY_P="${MY_PN}-${PV}"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ia64 ppc x86"
+IUSE="crypt snmp perl tcl python"
+S="${WORKDIR}/${MY_P}"
+RESTRICT='test'
+
+RDEPEND="
+ dev-libs/glib:2
+ sys-libs/gdbm
+ sys-libs/ncurses:0=
+ crypt? ( dev-libs/openssl:0= )
+ snmp? ( net-analyzer/net-snmp )
+ perl? ( dev-lang/perl )
+ python? ( ${PYTHON_DEPS} )
+ tcl? ( dev-lang/tcl:0= )"
+DEPEND="${RDEPEND}
+ >=dev-lang/swig-1.3.21
+ virtual/pkgconfig"
+# Gui is broken!
+# python? ( tcl? ( tk? ( dev-lang/tk dev-tcltk/tix ) ) )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Bug #338499: The installed OpenIPMIpthread.pc depends on a non-existing
+ # pthread.pc. We patch it to link -lpthread directly instead.
+ epatch "${FILESDIR}/${PN}-2.0.16-pthreads.patch"
+ # Bug #290763: The buildsys tries to compile+optimize the py file during
+ # install, when the .so might not be been added yet. We just skip the files
+ # and use python_optimize ourselves later instead.
+ sed -r -i \
+ -e '/INSTALL.*\.py[oc] /d' \
+ -e '/install-exec-local/s,OpenIPMI.pyc OpenIPMI.pyo,,g' \
+ swig/python/Makefile.{am,in}
+
+ # Bug #298250: parallel install fix.
+ sed -r -i \
+ -e '/^install-data-local:/s,$, install-exec-am,g' \
+ cmdlang/Makefile.{am,in}
+
+ # We touch the .in and .am above because if we use the below, the Perl stuff
+ # is very fragile, and often fails to link.
+ #cd "${S}"
+ #elibtoolize
+ #eautoreconf
+}
+
+src_configure() {
+ local myconf=""
+ myconf="${myconf} `use_with snmp ucdsnmp yes`"
+ myconf="${myconf} `use_with crypt openssl yes`"
+ myconf="${myconf} `use_with perl perl yes`"
+ myconf="${myconf} `use_with tcl tcl yes`"
+ myconf="${myconf} `use_with python python yes`"
+
+ # GUI is broken
+ #use tk && use python && use !tcl && \
+ # ewarn "Not building Tk GUI because it needs both Python AND Tcl"
+ #if use python && use tcl; then
+ # myconf="${myconf} `use_yesno tk tkinter yes`"
+ #else
+ # myconf="${myconf} `use_yesno tk tkinter no`"
+ #fi
+
+ myconf="${myconf} --without-tkinter"
+ myconf="${myconf} --with-glib --with-swig"
+ # these binaries are for root!
+ econf ${myconf} --bindir=/usr/sbin
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README* FAQ ChangeLog TODO doc/IPMI.pdf lanserv/README.emulator
+ newdoc cmdlang/README README.cmdlang
+
+ use python && python_optimize
+}
diff --git a/sys-libs/openipmi/openipmi-2.0.22.ebuild b/sys-libs/openipmi/openipmi-2.0.22.ebuild
new file mode 100644
index 000000000000..d6e064b0e91d
--- /dev/null
+++ b/sys-libs/openipmi/openipmi-2.0.22.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils autotools python-single-r1
+
+DESCRIPTION="Library interface to IPMI"
+HOMEPAGE="https://sourceforge.net/projects/openipmi/"
+MY_PN="OpenIPMI"
+MY_P="${MY_PN}-${PV}"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ia64 ppc x86"
+IUSE="crypt snmp perl python tcl"
+S="${WORKDIR}/${MY_P}"
+RESTRICT='test'
+
+RDEPEND="
+ dev-libs/glib:2
+ sys-libs/gdbm
+ sys-libs/ncurses:0=
+ crypt? ( dev-libs/openssl:0= )
+ snmp? ( net-analyzer/net-snmp )
+ perl? ( dev-lang/perl )
+ python? ( ${PYTHON_DEPS} )
+ tcl? ( dev-lang/tcl:0= )"
+DEPEND="${RDEPEND}
+ >=dev-lang/swig-1.3.21
+ virtual/pkgconfig"
+# Gui is broken!
+# python? ( tcl? ( tk? ( dev-lang/tk dev-tcltk/tix ) ) )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+ # Bug #338499: The installed OpenIPMIpthread.pc depends on a non-existing
+ # pthread.pc. We patch it to link -lpthread directly instead.
+ "${FILESDIR}/${PN}-2.0.16-pthreads.patch"
+
+ # https://bugs.gentoo.org/501510
+ "${FILESDIR}/${PN}-2.0.21-tinfo.patch"
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # Bug #290763: The buildsys tries to compile+optimize the py file during
+ # install, when the .so might not be been added yet. We just skip the files
+ # and use python_optimize ourselves later instead.
+ sed -r -i \
+ -e '/INSTALL.*\.py[oc] /d' \
+ -e '/install-exec-local/s,OpenIPMI.pyc OpenIPMI.pyo,,g' \
+ swig/python/Makefile.{am,in}
+
+ # Bug #298250: parallel install fix.
+ sed -r -i \
+ -e '/^install-data-local:/s,$, install-exec-am,g' \
+ cmdlang/Makefile.{am,in}
+
+ # We touch the .in and .am above because if we use the below, the Perl stuff
+ # is very fragile, and often fails to link.
+ #cd "${S}"
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=()
+ myconf+=( $(use_with snmp ucdsnmp yes) )
+ myconf+=( $(use_with crypt openssl yes) )
+ myconf+=( $(use_with perl perl yes) )
+ myconf+=( $(use_with tcl tcl yes) )
+ myconf+=( $(use_with python python yes) )
+
+ # GUI is broken
+ #use tk && use python && use !tcl && \
+ # ewarn "Not building Tk GUI because it needs both Python AND Tcl"
+ #if use python && use tcl; then
+ # myconf+=( $(use_with tk tkinter) )
+ #else
+ # myconf+=( --without-tkinter )
+ #fi
+
+ myconf+=( --without-tkinter )
+ myconf+=( --with-glib --with-glibver=2.0 --with-glib12=no --with-swig )
+ # these binaries are for root!
+ econf ${myconf[@]} --bindir=/usr/sbin
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README* FAQ ChangeLog TODO doc/IPMI.pdf lanserv/README.vm
+ newdoc cmdlang/README README.cmdlang
+
+ use python && python_optimize
+}
diff --git a/sys-libs/openipmi/openipmi-2.0.23_rc1.ebuild b/sys-libs/openipmi/openipmi-2.0.23_rc1.ebuild
new file mode 100644
index 000000000000..3f4ded19e175
--- /dev/null
+++ b/sys-libs/openipmi/openipmi-2.0.23_rc1.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils autotools python-single-r1
+
+DESCRIPTION="Library interface to IPMI"
+HOMEPAGE="https://sourceforge.net/projects/openipmi/"
+MY_PN="OpenIPMI"
+MY_P="${MY_PN}-${PV/_/-}"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~x86"
+IUSE="crypt snmp perl python tcl"
+S="${WORKDIR}/${MY_P}"
+RESTRICT='test'
+
+RDEPEND="
+ dev-libs/glib:2
+ sys-libs/gdbm
+ sys-libs/ncurses:0=
+ crypt? ( dev-libs/openssl:0= )
+ snmp? ( net-analyzer/net-snmp )
+ perl? ( dev-lang/perl )
+ python? ( ${PYTHON_DEPS} )
+ tcl? ( dev-lang/tcl:0= )"
+DEPEND="${RDEPEND}
+ >=dev-lang/swig-1.3.21
+ virtual/pkgconfig"
+# Gui is broken!
+# python? ( tcl? ( tk? ( dev-lang/tk dev-tcltk/tix ) ) )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+ # Bug #338499: The installed OpenIPMIpthread.pc depends on a non-existing
+ # pthread.pc. We patch it to link -lpthread directly instead.
+ "${FILESDIR}/${PN}-2.0.16-pthreads.patch"
+
+ # https://bugs.gentoo.org/501510
+ "${FILESDIR}/${PN}-2.0.21-tinfo.patch"
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # Bug #290763: The buildsys tries to compile+optimize the py file during
+ # install, when the .so might not be been added yet. We just skip the files
+ # and use python_optimize ourselves later instead.
+ sed -r -i \
+ -e '/INSTALL.*\.py[oc] /d' \
+ -e '/install-exec-local/s,OpenIPMI.pyc OpenIPMI.pyo,,g' \
+ swig/python/Makefile.{am,in}
+
+ # Bug #298250: parallel install fix.
+ sed -r -i \
+ -e '/^install-data-local:/s,$, install-exec-am,g' \
+ cmdlang/Makefile.{am,in}
+
+ # We touch the .in and .am above because if we use the below, the Perl stuff
+ # is very fragile, and often fails to link.
+ #cd "${S}"
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=()
+ myconf+=( $(use_with snmp ucdsnmp yes) )
+ myconf+=( $(use_with crypt openssl yes) )
+ myconf+=( $(use_with perl perl yes) )
+ myconf+=( $(use_with tcl tcl yes) )
+ myconf+=( $(use_with python python yes) )
+
+ # GUI is broken
+ #use tk && use python && use !tcl && \
+ # ewarn "Not building Tk GUI because it needs both Python AND Tcl"
+ #if use python && use tcl; then
+ # myconf+=( $(use_with tk tkinter) )
+ #else
+ # myconf+=( --without-tkinter )
+ #fi
+
+ myconf+=( --without-tkinter )
+ myconf+=( --with-glib --with-glibver=2.0 --with-glib12=no --with-swig )
+ # these binaries are for root!
+ econf ${myconf[@]} --bindir=/usr/sbin
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README* FAQ ChangeLog TODO doc/IPMI.pdf lanserv/README.vm
+ newdoc cmdlang/README README.cmdlang
+
+ use python && python_optimize
+}
diff --git a/sys-libs/pam/Manifest b/sys-libs/pam/Manifest
new file mode 100644
index 000000000000..91e8abdc6fe6
--- /dev/null
+++ b/sys-libs/pam/Manifest
@@ -0,0 +1,10 @@
+DIST Linux-PAM-1.2.0-docs.tar.bz2 490586 SHA256 3bc9ae398f759e372dbf4065ceed2df8b1ac5ab62c6688cb5f7849ce773df2c3 SHA512 028b7f9d6b0a5cf38f063e0f82ac3d0955e1e41d77c9f3fc803363d9ea710d71366e0a91f31b418cac397bb6639442de908fa00f02cd94cf612496d1b43c7e4c WHIRLPOOL 9a329b610d840c904050b2261e5ce34ac54232b0c7d51c12ee45c9e758ab6659ea8562e032fa9815c2beab0cfa1ea455dbfbf3cdef39d30d299a8bc5286f7a14
+DIST Linux-PAM-1.2.1.tar.bz2 1279523 SHA256 342b1211c0d3b203a7df2540a5b03a428a087bd8a48c17e49ae268f992b334d9 SHA512 4572aa1eaf5a1312410c74b5ed055b2592c5efe2bb82f59981da4e9e93555ad40aee3a89f446d9dc6c6af79efc04c33f739f66db9edc07e02479475a14e426da WHIRLPOOL 562917945b3b3a407955cc5bf5cd251ff7e257a94055d7cfbf06d5c2619b58d61624f16848de3512ddf61636ad8618315de3f7bd8e4e51b3b7d109adfa212c8a
+DIST Linux-PAM-1.3.0-docs.tar.bz2 492805 SHA256 8610b48703f036f6755c1d2bd8bcdeaddd9d99a1631f2d7668ec69b444d972a0 SHA512 b6b8497e6a4307b3f9a2af1c74456a0577b848cbc5417fb88fabe305b67ca022a6bcf632d68faaaacc701cdcf6254ec196707551a1ea70985cdde6add68bbbfe WHIRLPOOL a98b28c020de3170f2437b396176efc900683ea2ea85cb3db48306a944595f2d371cce95ee1233a874faa1fb55a06fcbe58068da7a2cc190c93809473938c821
+DIST Linux-PAM-1.3.0.tar.bz2 1302820 SHA256 241aed1ef522f66ed672719ecf2205ec513fd0075ed80cda8e086a5b1a01d1bb SHA512 4a89ca4b6f4676107aca4018f7c11addf03495266b209cb11c913f8b5d191d9a1f72197715dcf2a69216b4036de88780bcbbb5a8652e386910d71ba1b6282e42 WHIRLPOOL bb8615c8296eda83a784ffd9e9fc5ad6d401f18b8769f7859a4b94f5782decdbde7a66dc5e22e960fe723943e1562b2f5fa55e64f4836188cf57a7631edb8dcb
+EBUILD pam-1.2.1-r1.ebuild 6334 SHA256 e2b7a21786a59f98fcd56338888cd3cc6955fe1228c56f699b46154f54609439 SHA512 32a6c36f328b7f51a297e6db24877b9e304696e94531aa08627b88997c2040fa7cd0359352b265cdefb44167e13c59c33c1598bc1808d2dc99f8a2173ea67e90 WHIRLPOOL 8274cd2bb90d68a2feb0d918f322affc1f4ec5843e626213f3306541a1426672a3d18eb3e30d3faac2c6bd8f8ab81179c691101227421bc176ccfd5a29bcea08
+EBUILD pam-1.2.1.ebuild 6096 SHA256 dd460c331711b9c5fa349eebfb12c1670bbe52f198b6e4836e2754fe2ef4a9a0 SHA512 0d3d9292c2eed4fd83076f4920588d69c411ec4d0ec1fbf714145f7a16895bb10659f4259706747f1f1c91efe6180a5a888ef8dc60612a00d409d5389a41a6e8 WHIRLPOOL 3977b89a71a6b477fc0a7861185a9c6149e2e0ccf871eef724cbc047ca1a285a70fdef1d28a912f234282a1a12251b8fdf25f8beacc23a1d4ebd1e33d97465c8
+EBUILD pam-1.3.0.ebuild 6030 SHA256 04420fd00f8e33e63446e312979ba4b7826be2a08a82fadc56e32bd0f64b210b SHA512 13b3b4e1ea3eb8da2e58d1654b1ee60242abe029ca9f98b1169d9d11cef1c7a83ce5b41652f264d0b36f3345bd1ad3566b3066cefd39340b61abcc41b95d4e69 WHIRLPOOL 3934fa3ef726820cafc442941f0a2b4bcfe07f854d9d9c2e065ac1fcf55f315980452ecd0f3d2a9cb22bc3bff9203c22de2ce3414b00f806424bd653a3f64cf1
+MISC ChangeLog 5510 SHA256 0f7c574f984fddc8d23b49a5739dce1e5e9f798fab812b30b920890b59ea8d87 SHA512 cc7d97c566de0ff68b5f9a64f83a1adec39a97d150ad916ec7e41ae4f9bf3264dd5f90f74264fb0f651a3d2179c86df4f3cd5fb30b4b430ba97a7652a13a479d WHIRLPOOL 36b075a427e0e9cb1ed84f7ce7f1b61223a7002c64e612e57833e734a05560d63c0b4cb2c89e314684a90361af67a94ad5a63006540b59be434212f4aa892a5d
+MISC ChangeLog-2015 56879 SHA256 1d6672e1e44f22c74a18b024729d90402209f412b7f24e5e87511bd720cb4073 SHA512 01b442a6401e1992ef563b52745ba90724a1d291e3572497d3b5dbf8fa756dc6d220ad61e55c9fe6139e7e4e64ee3b380e457153725fa9d0516113b3ee3914d7 WHIRLPOOL 88ef69921a8811210393f045f61742b7cf3c3fec051d83d28d9dcc0eb60373c488a31c44d9d216e06b5c890cdf357c83cb17df0ed395f5372c5a8e3904ad7bdb
+MISC metadata.xml 1135 SHA256 19e87cb2aa29dcd1b12d3fd5a001a7fe08fcb9153cc80045d0b95a88c4cad3d7 SHA512 de2a617918085c4e6a7a1976447ed2c0bcdb8eb257d28351e095b29ea219382ce8964206ba0fcdefe9b69db9ab17a52556371cfbee3ed4d5c5293c8d21738d55 WHIRLPOOL abf1d986d9fb8a6654db2ecb982ef50a4aea376c5386f3b68baec1faa19811a6b58f1a08e617711737879f173db729e34d92c8be29ee4acb47f2a0deec5241fc
diff --git a/sys-libs/pam/metadata.xml b/sys-libs/pam/metadata.xml
new file mode 100644
index 000000000000..2933b7ddf8c8
--- /dev/null
+++ b/sys-libs/pam/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>pam-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="berkdb">
+ Build the pam_userdb module, that allows to authenticate users
+ against a Berkeley DB file. Please note that enabling this USE
+ flag will create a PAM module that links to the Berkeley DB (as
+ provided by <pkg>sys-libs/db</pkg>) installed in /usr/lib and
+ will thus not work for boot-critical services authentication.
+ </flag>
+
+ <flag name="cracklib">
+ Build the pam_cracklib module, that allows to verify the chosen
+ passwords' strength through the use of
+ <pkg>sys-libs/cracklib</pkg>. Please note that simply enabling
+ the USE flag on this package will not make use of pam_cracklib
+ by default, you should also enable it in
+ <pkg>sys-auth/pambase</pkg> as well as update your configuration
+ files.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:kernel:linux-pam</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/pam/pam-1.2.1-r1.ebuild b/sys-libs/pam/pam-1.2.1-r1.ebuild
new file mode 100644
index 000000000000..65ce86df7cb5
--- /dev/null
+++ b/sys-libs/pam/pam-1.2.1-r1.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit libtool multilib multilib-minimal eutils pam toolchain-funcs flag-o-matic db-use fcaps
+
+MY_PN="Linux-PAM"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Linux-PAM (Pluggable Authentication Modules)"
+HOMEPAGE="http://www.linux-pam.org/ https://fedorahosted.org/linux-pam/"
+SRC_URI="http://www.linux-pam.org/library/${MY_P}.tar.bz2
+ http://www.linux-pam.org/documentation/${MY_PN}-1.2.0-docs.tar.bz2"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="audit berkdb cracklib debug nis nls +pie selinux test vim-syntax"
+
+RDEPEND="nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )
+ cracklib? ( >=sys-libs/cracklib-2.9.1-r1[${MULTILIB_USEDEP}] )
+ audit? ( >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ berkdb? ( >=sys-libs/db-4.8.30-r1:=[${MULTILIB_USEDEP}] )
+ nis? ( >=net-libs/libtirpc-0.2.4-r2[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2
+ >=sys-devel/flex-2.5.39-r1[${MULTILIB_USEDEP}]
+ nls? ( sys-devel/gettext )
+ nis? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )"
+PDEPEND="sys-auth/pambase
+ vim-syntax? ( app-vim/pam-syntax )"
+RDEPEND="${RDEPEND}
+ !<sys-apps/openrc-0.11.8
+ !sys-auth/openpam
+ !sys-auth/pam_userdb
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S="${WORKDIR}/${MY_P}"
+
+check_old_modules() {
+ local retval="0"
+
+ if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | fgrep -q pam_stack.so; then
+ eerror ""
+ eerror "Your current setup is using the pam_stack module."
+ eerror "This module is deprecated and no longer supported, and since version"
+ eerror "0.99 is no longer installed, nor provided by any other package."
+ eerror "The package will be built (to allow binary package builds), but will"
+ eerror "not be installed."
+ eerror "Please replace pam_stack usage with proper include directive usage,"
+ eerror "following the PAM Upgrade guide at the following URL"
+ eerror " https://wiki.gentoo.org/wiki/Project:PAM/Upgrade_to_0.99"
+ eerror ""
+
+ retval=1
+ fi
+
+ if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | egrep -q 'pam_(pwdb|console)'; then
+ eerror ""
+ eerror "Your current setup is using one or more of the following modules,"
+ eerror "that are not built or supported anymore:"
+ eerror "pam_pwdb, pam_console"
+ eerror "If you are in real need for these modules, please contact the maintainers"
+ eerror "of PAM through https://bugs.gentoo.org/ providing information about its"
+ eerror "use cases."
+ eerror "Please also make sure to read the PAM Upgrade guide at the following URL:"
+ eerror " https://wiki.gentoo.org/wiki/Project:PAM/Upgrade_to_0.99"
+ eerror ""
+
+ retval=1
+ fi
+
+ return ${retval}
+}
+
+pkg_pretend() {
+ # do not error out, this is just a warning, one could build a binpkg
+ # with old modules enabled.
+ check_old_modules
+}
+
+src_unpack() {
+ # Upstream didn't release a new doc tarball (since nothing changed?).
+ unpack ${MY_PN}-1.2.0-docs.tar.bz2
+ # Update timestamps to avoid regenerating at build time. #569338
+ find -type f -exec touch -r "${T}" {} + || die
+ mv Linux-PAM-1.2.{0,1} || die
+ unpack ${MY_P}.tar.bz2
+}
+
+src_prepare() {
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Do not let user's BROWSER setting mess us up. #549684
+ unset BROWSER
+
+ # Disable automatic detection of libxcrypt; we _don't_ want the
+ # user to link libxcrypt in by default, since we won't track the
+ # dependency and allow to break PAM this way.
+ export ac_cv_header_xcrypt_h=no
+
+ local myconf=(
+ --docdir='$(datarootdir)'/doc/${PF}
+ --htmldir='$(docdir)/html'
+ --libdir='$(prefix)'/$(get_libdir)
+ --enable-securedir="${EPREFIX}"/$(get_libdir)/security
+ --enable-isadir='.' #464016
+ $(use_enable nls)
+ $(use_enable selinux)
+ $(use_enable cracklib)
+ $(use_enable audit)
+ $(use_enable debug)
+ $(use_enable berkdb db)
+ $(use_enable nis)
+ $(use_enable pie)
+ --with-db-uniquename=-$(db_findver sys-libs/db)
+ --disable-prelude
+ --disable-regenerate-docu
+ )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake sepermitlockdir="${EPREFIX}/run/sepermit"
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install \
+ sepermitlockdir="${EPREFIX}/run/sepermit"
+
+ local prefix
+ if multilib_is_native_abi; then
+ prefix=
+ gen_usr_ldscript -a pam pamc pam_misc
+ else
+ prefix=/usr
+ fi
+
+ # create extra symlinks just in case something depends on them...
+ local lib
+ for lib in pam pamc pam_misc; do
+ if ! [[ -f "${ED}"${prefix}/$(get_libdir)/lib${lib}$(get_libname) ]]; then
+ dosym lib${lib}$(get_libname 0) ${prefix}/$(get_libdir)/lib${lib}$(get_libname)
+ fi
+ done
+}
+
+DOCS=( CHANGELOG ChangeLog README AUTHORS Copyright NEWS )
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files --all
+
+ docinto modules
+ local dir
+ for dir in modules/pam_*; do
+ newdoc "${dir}"/README README."$(basename "${dir}")"
+ done
+
+ if use selinux; then
+ dodir /usr/lib/tmpfiles.d
+ cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
+d /run/sepermit 0755 root root
+EOF
+ fi
+}
+
+pkg_preinst() {
+ check_old_modules || die "deprecated PAM modules still used"
+}
+
+pkg_postinst() {
+ ewarn "Some software with pre-loaded PAM libraries might experience"
+ ewarn "warnings or failures related to missing symbols and/or versions"
+ ewarn "after any update. While unfortunate this is a limit of the"
+ ewarn "implementation of PAM and the software, and it requires you to"
+ ewarn "restart the software manually after the update."
+ ewarn ""
+ ewarn "You can get a list of such software running a command like"
+ ewarn " lsof / | egrep -i 'del.*libpam\\.so'"
+ ewarn ""
+ ewarn "Alternatively, simply reboot your system."
+ if [[ -x "${EROOT}"/var/log/tallylog ]] ; then
+ elog ""
+ elog "Because of a bug present up to version 1.1.1-r2, you have"
+ elog "an executable /var/log/tallylog file. You can safely"
+ elog "correct it by running the command"
+ elog " chmod -x /var/log/tallylog"
+ elog ""
+ fi
+
+ # The pam_unix module needs to check the password of the user which requires
+ # read access to /etc/shadow only.
+ fcaps cap_dac_override sbin/unix_chkpwd
+}
diff --git a/sys-libs/pam/pam-1.2.1.ebuild b/sys-libs/pam/pam-1.2.1.ebuild
new file mode 100644
index 000000000000..e154b4c88b17
--- /dev/null
+++ b/sys-libs/pam/pam-1.2.1.ebuild
@@ -0,0 +1,201 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit libtool multilib multilib-minimal eutils pam toolchain-funcs flag-o-matic db-use
+
+MY_PN="Linux-PAM"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Linux-PAM (Pluggable Authentication Modules)"
+HOMEPAGE="http://www.linux-pam.org/ https://fedorahosted.org/linux-pam/"
+SRC_URI="http://www.linux-pam.org/library/${MY_P}.tar.bz2
+ http://www.linux-pam.org/documentation/${MY_PN}-1.2.0-docs.tar.bz2"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+IUSE="audit berkdb cracklib debug nis nls +pie selinux test vim-syntax"
+
+RDEPEND="nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )
+ cracklib? ( >=sys-libs/cracklib-2.9.1-r1[${MULTILIB_USEDEP}] )
+ audit? ( >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ berkdb? ( >=sys-libs/db-4.8.30-r1:=[${MULTILIB_USEDEP}] )
+ nis? ( >=net-libs/libtirpc-0.2.4-r2[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2
+ >=sys-devel/flex-2.5.39-r1[${MULTILIB_USEDEP}]
+ nls? ( sys-devel/gettext )
+ nis? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )"
+PDEPEND="sys-auth/pambase
+ vim-syntax? ( app-vim/pam-syntax )"
+RDEPEND="${RDEPEND}
+ !<sys-apps/openrc-0.11.8
+ !sys-auth/openpam
+ !sys-auth/pam_userdb
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S="${WORKDIR}/${MY_P}"
+
+check_old_modules() {
+ local retval="0"
+
+ if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | fgrep -q pam_stack.so; then
+ eerror ""
+ eerror "Your current setup is using the pam_stack module."
+ eerror "This module is deprecated and no longer supported, and since version"
+ eerror "0.99 is no longer installed, nor provided by any other package."
+ eerror "The package will be built (to allow binary package builds), but will"
+ eerror "not be installed."
+ eerror "Please replace pam_stack usage with proper include directive usage,"
+ eerror "following the PAM Upgrade guide at the following URL"
+ eerror " https://wiki.gentoo.org/wiki/Project:PAM/Upgrade_to_0.99"
+ eerror ""
+
+ retval=1
+ fi
+
+ if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | egrep -q 'pam_(pwdb|console)'; then
+ eerror ""
+ eerror "Your current setup is using one or more of the following modules,"
+ eerror "that are not built or supported anymore:"
+ eerror "pam_pwdb, pam_console"
+ eerror "If you are in real need for these modules, please contact the maintainers"
+ eerror "of PAM through https://bugs.gentoo.org/ providing information about its"
+ eerror "use cases."
+ eerror "Please also make sure to read the PAM Upgrade guide at the following URL:"
+ eerror " https://wiki.gentoo.org/wiki/Project:PAM/Upgrade_to_0.99"
+ eerror ""
+
+ retval=1
+ fi
+
+ return ${retval}
+}
+
+pkg_pretend() {
+ # do not error out, this is just a warning, one could build a binpkg
+ # with old modules enabled.
+ check_old_modules
+}
+
+src_unpack() {
+ # Upstream didn't release a new doc tarball (since nothing changed?).
+ unpack ${MY_PN}-1.2.0-docs.tar.bz2
+ mv Linux-PAM-1.2.{0,1} || die
+ unpack ${MY_P}.tar.bz2
+}
+
+src_prepare() {
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Do not let user's BROWSER setting mess us up. #549684
+ unset BROWSER
+
+ # Disable automatic detection of libxcrypt; we _don't_ want the
+ # user to link libxcrypt in by default, since we won't track the
+ # dependency and allow to break PAM this way.
+ export ac_cv_header_xcrypt_h=no
+
+ local myconf=(
+ --docdir='$(datarootdir)'/doc/${PF}
+ --htmldir='$(docdir)/html'
+ --libdir='$(prefix)'/$(get_libdir)
+ --enable-securedir="${EPREFIX}"/$(get_libdir)/security
+ --enable-isadir='.' #464016
+ $(use_enable nls)
+ $(use_enable selinux)
+ $(use_enable cracklib)
+ $(use_enable audit)
+ $(use_enable debug)
+ $(use_enable berkdb db)
+ $(use_enable nis)
+ $(use_enable pie)
+ --with-db-uniquename=-$(db_findver sys-libs/db)
+ --disable-prelude
+ --disable-regenerate-docu
+ )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake sepermitlockdir="${EPREFIX}/run/sepermit"
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install \
+ sepermitlockdir="${EPREFIX}/run/sepermit"
+
+ local prefix
+ if multilib_is_native_abi; then
+ prefix=
+ gen_usr_ldscript -a pam pamc pam_misc
+ else
+ prefix=/usr
+ fi
+
+ # create extra symlinks just in case something depends on them...
+ local lib
+ for lib in pam pamc pam_misc; do
+ if ! [[ -f "${ED}"${prefix}/$(get_libdir)/lib${lib}$(get_libname) ]]; then
+ dosym lib${lib}$(get_libname 0) ${prefix}/$(get_libdir)/lib${lib}$(get_libname)
+ fi
+ done
+}
+
+DOCS=( CHANGELOG ChangeLog README AUTHORS Copyright NEWS )
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files --all
+
+ # Need to be suid
+ fperms 4711 /sbin/unix_chkpwd
+
+ docinto modules
+ local dir
+ for dir in modules/pam_*; do
+ newdoc "${dir}"/README README."$(basename "${dir}")"
+ done
+
+ if use selinux; then
+ dodir /usr/lib/tmpfiles.d
+ cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
+d /run/sepermit 0755 root root
+EOF
+ fi
+}
+
+pkg_preinst() {
+ check_old_modules || die "deprecated PAM modules still used"
+}
+
+pkg_postinst() {
+ ewarn "Some software with pre-loaded PAM libraries might experience"
+ ewarn "warnings or failures related to missing symbols and/or versions"
+ ewarn "after any update. While unfortunate this is a limit of the"
+ ewarn "implementation of PAM and the software, and it requires you to"
+ ewarn "restart the software manually after the update."
+ ewarn ""
+ ewarn "You can get a list of such software running a command like"
+ ewarn " lsof / | egrep -i 'del.*libpam\\.so'"
+ ewarn ""
+ ewarn "Alternatively, simply reboot your system."
+ if [[ -x "${EROOT}"/var/log/tallylog ]] ; then
+ elog ""
+ elog "Because of a bug present up to version 1.1.1-r2, you have"
+ elog "an executable /var/log/tallylog file. You can safely"
+ elog "correct it by running the command"
+ elog " chmod -x /var/log/tallylog"
+ elog ""
+ fi
+}
diff --git a/sys-libs/pam/pam-1.3.0.ebuild b/sys-libs/pam/pam-1.3.0.ebuild
new file mode 100644
index 000000000000..14a9ccc30e79
--- /dev/null
+++ b/sys-libs/pam/pam-1.3.0.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit libtool multilib multilib-minimal eutils pam toolchain-funcs flag-o-matic db-use fcaps
+
+MY_PN="Linux-PAM"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Linux-PAM (Pluggable Authentication Modules)"
+HOMEPAGE="http://www.linux-pam.org/ https://fedorahosted.org/linux-pam/"
+SRC_URI="http://www.linux-pam.org/library/${MY_P}.tar.bz2
+ http://www.linux-pam.org/library/${MY_P}-docs.tar.bz2"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="audit berkdb cracklib debug nis nls +pie selinux test vim-syntax"
+
+RDEPEND="nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )
+ cracklib? ( >=sys-libs/cracklib-2.9.1-r1[${MULTILIB_USEDEP}] )
+ audit? ( >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ berkdb? ( >=sys-libs/db-4.8.30-r1:=[${MULTILIB_USEDEP}] )
+ nis? ( >=net-libs/libtirpc-0.2.4-r2[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2
+ >=sys-devel/flex-2.5.39-r1[${MULTILIB_USEDEP}]
+ nls? ( sys-devel/gettext )
+ nis? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )"
+PDEPEND="sys-auth/pambase
+ vim-syntax? ( app-vim/pam-syntax )"
+RDEPEND="${RDEPEND}
+ !<sys-apps/openrc-0.11.8
+ !sys-auth/openpam
+ !sys-auth/pam_userdb"
+
+S="${WORKDIR}/${MY_P}"
+
+check_old_modules() {
+ local retval="0"
+
+ if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | fgrep -q pam_stack.so; then
+ eerror ""
+ eerror "Your current setup is using the pam_stack module."
+ eerror "This module is deprecated and no longer supported, and since version"
+ eerror "0.99 is no longer installed, nor provided by any other package."
+ eerror "The package will be built (to allow binary package builds), but will"
+ eerror "not be installed."
+ eerror "Please replace pam_stack usage with proper include directive usage,"
+ eerror "following the PAM Upgrade guide at the following URL"
+ eerror " https://wiki.gentoo.org/wiki/Project:PAM/Upgrade_to_0.99"
+ eerror ""
+
+ retval=1
+ fi
+
+ if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | egrep -q 'pam_(pwdb|console)'; then
+ eerror ""
+ eerror "Your current setup is using one or more of the following modules,"
+ eerror "that are not built or supported anymore:"
+ eerror "pam_pwdb, pam_console"
+ eerror "If you are in real need for these modules, please contact the maintainers"
+ eerror "of PAM through https://bugs.gentoo.org/ providing information about its"
+ eerror "use cases."
+ eerror "Please also make sure to read the PAM Upgrade guide at the following URL:"
+ eerror " https://wiki.gentoo.org/wiki/Project:PAM/Upgrade_to_0.99"
+ eerror ""
+
+ retval=1
+ fi
+
+ return ${retval}
+}
+
+pkg_pretend() {
+ # do not error out, this is just a warning, one could build a binpkg
+ # with old modules enabled.
+ check_old_modules
+}
+
+src_prepare() {
+ # Fix non-POSIX shell code.
+ # https://fedorahosted.org/linux-pam/ticket/60
+ sed -i \
+ -e '/ test /s:==:=:' \
+ configure || die
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Do not let user's BROWSER setting mess us up. #549684
+ unset BROWSER
+
+ # Disable automatic detection of libxcrypt; we _don't_ want the
+ # user to link libxcrypt in by default, since we won't track the
+ # dependency and allow to break PAM this way.
+ export ac_cv_header_xcrypt_h=no
+
+ local myconf=(
+ --docdir='$(datarootdir)'/doc/${PF}
+ --htmldir='$(docdir)/html'
+ --libdir='$(prefix)'/$(get_libdir)
+ --enable-securedir="${EPREFIX}"/$(get_libdir)/security
+ --enable-isadir='.' #464016
+ $(use_enable nls)
+ $(use_enable selinux)
+ $(use_enable cracklib)
+ $(use_enable audit)
+ $(use_enable debug)
+ $(use_enable berkdb db)
+ $(use_enable nis)
+ $(use_enable pie)
+ --with-db-uniquename=-$(db_findver sys-libs/db)
+ --disable-prelude
+ --disable-regenerate-docu
+ )
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake sepermitlockdir="${EPREFIX}/run/sepermit"
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install \
+ sepermitlockdir="${EPREFIX}/run/sepermit"
+
+ local prefix
+ if multilib_is_native_abi; then
+ prefix=
+ gen_usr_ldscript -a pam pamc pam_misc
+ else
+ prefix=/usr
+ fi
+
+ # create extra symlinks just in case something depends on them...
+ local lib
+ for lib in pam pamc pam_misc; do
+ if ! [[ -f "${ED}"${prefix}/$(get_libdir)/lib${lib}$(get_libname) ]]; then
+ dosym lib${lib}$(get_libname 0) ${prefix}/$(get_libdir)/lib${lib}$(get_libname)
+ fi
+ done
+}
+
+DOCS=( CHANGELOG ChangeLog README AUTHORS Copyright NEWS )
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files --all
+
+ docinto modules
+ local dir
+ for dir in modules/pam_*; do
+ newdoc "${dir}"/README README."$(basename "${dir}")"
+ done
+
+ if use selinux; then
+ dodir /usr/lib/tmpfiles.d
+ cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
+d /run/sepermit 0755 root root
+EOF
+ fi
+}
+
+pkg_preinst() {
+ check_old_modules || die "deprecated PAM modules still used"
+}
+
+pkg_postinst() {
+ ewarn "Some software with pre-loaded PAM libraries might experience"
+ ewarn "warnings or failures related to missing symbols and/or versions"
+ ewarn "after any update. While unfortunate this is a limit of the"
+ ewarn "implementation of PAM and the software, and it requires you to"
+ ewarn "restart the software manually after the update."
+ ewarn ""
+ ewarn "You can get a list of such software running a command like"
+ ewarn " lsof / | egrep -i 'del.*libpam\\.so'"
+ ewarn ""
+ ewarn "Alternatively, simply reboot your system."
+ if [[ -x "${EROOT}"/var/log/tallylog ]] ; then
+ elog ""
+ elog "Because of a bug present up to version 1.1.1-r2, you have"
+ elog "an executable /var/log/tallylog file. You can safely"
+ elog "correct it by running the command"
+ elog " chmod -x /var/log/tallylog"
+ elog ""
+ fi
+
+ # The pam_unix module needs to check the password of the user which requires
+ # read access to /etc/shadow only.
+ fcaps cap_dac_override sbin/unix_chkpwd
+}
diff --git a/sys-libs/pinktrace/Manifest b/sys-libs/pinktrace/Manifest
new file mode 100644
index 000000000000..0e214bb9bfdf
--- /dev/null
+++ b/sys-libs/pinktrace/Manifest
@@ -0,0 +1,3 @@
+DIST pinktrace-0.9.3.tar.bz2 405153 SHA256 ba915a47c08b1d937704dc5916fcb610dc872b5ed699cc42b92e3e3927fcc880 SHA512 8250699d5c7c48b0d8c7df795a81f0aea724471bc32d81aeea1163b8c763028c36905b812e9c3eeb8d7642583bd32200d659d019edafb146835232f9736b6591 WHIRLPOOL 36ef2ec01b58a8a867a4353851c1de2586037f05b4aaeab6434f326561be0f0337b318bb08f6853bda546977598680bc97e41587de11cc1d89e3ab660b3e3bbf
+EBUILD pinktrace-0.9.3.ebuild 547 SHA256 0ff7146630270b17ca404e3b1088859d221a89b7d045f84503bb325da0ccda2e SHA512 c55cf4f6fc125594a5e96a316c811da94ed80fae344f516182931d08b66c75999f9518f4f1688130902cba749f1aa89725f1d2a00455d8eb818e8217855286bd WHIRLPOOL e9a306c91fbf9cedfcb674f3b31c1337ede4c71c32aeda3d8d75339c1505231f1d9902dbe27ea429a1c58ad4a3e03eb20b1f1508b0665a8bbd5a94523fb809c3
+MISC metadata.xml 247 SHA256 34d6ed4186bad4ac57e0b4c08b657b14e28852a83c4ccf4d8a62f7829063b1cf SHA512 d6e2ea8a9d74791bcbf3d6311a66bafc20b8f4db3a576d9a8d54b86d7afb231122b8d87f71f3f46360980adf8d815c633b6d5041f9a30fc8656e8fb66057a282 WHIRLPOOL fbd18b3e6e3d777e8d78e91b8d32c5e357fd2a1c754d2c9add4622be682521e59556f466cba397d913f0e63265202744ceaf76dc7823be0a172a9bf4da6a2579
diff --git a/sys-libs/pinktrace/metadata.xml b/sys-libs/pinktrace/metadata.xml
new file mode 100644
index 000000000000..0319eec4c8be
--- /dev/null
+++ b/sys-libs/pinktrace/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 type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/pinktrace/pinktrace-0.9.3.ebuild b/sys-libs/pinktrace/pinktrace-0.9.3.ebuild
new file mode 100644
index 000000000000..52e6628349fe
--- /dev/null
+++ b/sys-libs/pinktrace/pinktrace-0.9.3.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="ptrace() easy wrapper library"
+HOMEPAGE="https://dev.exherbo.org/~alip/pinktrace/"
+SRC_URI="http://distfiles.exherbo.org/distfiles/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0/0.9"
+KEYWORDS="~amd64"
+IUSE="ipv6"
+
+src_configure() {
+ local myconf=(
+ $(use_enable ipv6)
+ --disable-doxygen
+ --disable-python
+ --disable-python-doc
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+}
diff --git a/sys-libs/pwdb/Manifest b/sys-libs/pwdb/Manifest
new file mode 100644
index 000000000000..1980d280134a
--- /dev/null
+++ b/sys-libs/pwdb/Manifest
@@ -0,0 +1,7 @@
+AUX pwdb-0.62-build.patch 2920 SHA256 39203b664af9404a4c10271d695c7644a8de1540c1e2d8b66c389d7bb2cc3852 SHA512 fb6b1bb322daf4a343b31fd8cadb1c546682421775670a361721272ea5811cb87b8215aa1c7bad624334da826ddab4776a4809fce0613346a4560ffce8af3bba WHIRLPOOL 7e4dd3e41690300f1b38c3c329691b3285d8bbd67690092f3c86271c2d6dce5486c31ba7478f4cfd5ca7131deae4896dc3138cfb14bd40058bbefe646fbf2ff1
+AUX pwdb-0.62-selinux.patch 10371 SHA256 cb8fad56d4ade81a0ad3ff117508638736a1b58c9b27dcb1a402911baf4e9496 SHA512 63cb33af31179183c32f738c90ac2144e8d8092034faa5bcd0c5420832e51018e7e9ffcea59c8354ee0ae598e53dbd120cd9338ab80b0e5df6cc1c53eb75b818 WHIRLPOOL c89023691c93a6ece7d7edf40250cb52fe306c12f8062149a2a4c07ae2e0db2efec5891786aecc7af5a9f09a12d52e6676c610bc9815ef89ce32f7540587aa8f
+DIST pwdb-0.62.tar.gz 133183 SHA256 1e0420b92c9996f82b3364b982f7d6c62460c513afa329b78317b3037dc3d4b9 SHA512 baba1f42125a4773f2e645129be79e0e5fbd0b0da7c6624f4b1d13e59cb65f5807bd22997aa1ba360c7627f2aff93c9949b2bb5fbd27d74b516853bcbca96ef4 WHIRLPOOL 02148b696ff00099101d0d9488a0c42c1848cd42db377a14154c3d983bdbb7b4a7d4364e7f29060771ca74e530279f3bc33d49960c0d697dae8bf6a3de8d33f2
+EBUILD pwdb-0.62.ebuild 1368 SHA256 a6d8adca4f910a1673246123c5403a4b4a52411abb0bc18f3569c925d8916f98 SHA512 e98a4769a546ad856d15730ec1337b47fbdac1379d6ed9e8fd9f6dec62eec44947d87333da96cb1494886a2f6c787082c8f26c6a25df712260c87c29ab84047c WHIRLPOOL de5db6b23785219c8ea3a1722ef3878ebc417c115981ddf1b32dfb1325ac14613c75f21fad6f9fccf6c930a056015b8a34d20cd84193181f36d395d87f219125
+MISC ChangeLog 3332 SHA256 9087eee9aebd8700cccd8fc368c5cb620aec00db4a625dcb325fe3853cd48d03 SHA512 a2e47037ef71c92cf7fd98f71ad9308e2c24b28df68e2a76ea2f01eab89f1feb3a0cb4aa50a93c3d6cde7d26b89651c067f308701fa3cede20cd26742af18376 WHIRLPOOL 26b6ef3457d91383aff52ab5fbc6009deb9f2ab0cb8c97737fe6f8a55235967eb88f1d82888786335cd26443aeaa20ac885fe0326e42502842585372d0bfcab4
+MISC ChangeLog-2015 5067 SHA256 4a6b679b2ba91a8530235b79585455e4aac6a768cacce556501cce2b063c24f2 SHA512 d6a85bd4de03f49d17afa3ac59aa9c049e9010c09c9f63109e6c297a77015a713c53d486c85d3371293a4511367ccbcadc85138f0e48d327b9e10471810b82bc WHIRLPOOL 8b10c703c7353dc41408790f90c567d1248000a9c94bc9e5dc2a8ea7aeb85f09e75d90316d0984a16bc34ee760a407db054e9862f794344f90a097dc4b98ffb1
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-libs/pwdb/files/pwdb-0.62-build.patch b/sys-libs/pwdb/files/pwdb-0.62-build.patch
new file mode 100644
index 000000000000..ecef517b1ca3
--- /dev/null
+++ b/sys-libs/pwdb/files/pwdb-0.62-build.patch
@@ -0,0 +1,114 @@
+ - drop ldconfig junk
+ - fix types used in socket functions (socklen_t, not int)
+
+http://bugs.gentoo.org/126977
+ - respect user LDFLAGS
+
+http://bugs.gentoo.org/126695
+ - add missing headers
+ - add missing comma to supp_entry
+
+http://bugs.gentoo.org/137134
+ - don't show traditional warnings
+
+--- Makefile
++++ Makefile
+@@ -71,7 +71,7 @@
+
+ WARNINGS += -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
+ -Wcast-qual -Wcast-align \
+- -Wtraditional -Wstrict-prototypes -Wmissing-prototypes \
++ -Wstrict-prototypes -Wmissing-prototypes \
+ -Wnested-externs -Winline -Wshadow
+ INCLUDEDIR=-I$(CRTDIR)/include
+
+--- libpwdb/Makefile
++++ libpwdb/Makefile
+@@ -50,7 +50,7 @@
+
+
+ $(LIBDYNAME): $(LIBOBJ)
+- $(LD) -soname $(LIBSONAME) -x -shared -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl -lc
++ $(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIBSONAME) -Wl,-x -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl $(LDLIBS)
+ @ln -sf $(LIBFILENAME) $@
+
+ $(LIBSTATIC): $(LIBOBJ)
+@@ -68,7 +68,7 @@
+ $(INSTALL) -m 644 radius.h $(INCLUDED)/radius.h
+ $(INSTALL) -m 644 _pwdb_macros.h $(INCLUDED)/_pwdb_macros.h
+ $(INSTALL) -m 755 $(LIBFILENAME) $(LIBDIR)
+- $(LDCONFIG)
++ ln -sf $(LIBFILENAME) $(LIBDIR)/$(LIBSONAME)
+ ln -sf $(LIBFILENAME) $(LIBDIR)/$(LIBDYNAME)
+ $(INSTALL) -m 644 $(LIBSTATIC) $(LIBDIR)
+
+--- libpwdb/posix/pwd.c
++++ libpwdb/posix/pwd.c
+@@ -7,6 +7,7 @@
+ */
+
+ #include <stdio.h>
++#include <string.h>
+
+ #define PWDB_HARD_CORE 1
+ #include <pwdb/pwdb_public.h>
+--- libpwdb/posix/undefined.c
++++ libpwdb/posix/undefined.c
+@@ -5,6 +5,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+
+ #define PWDB_HARD_CORE 1
+ #include <pwdb/pwdb_public.h>
+--- libpwdb/pwdb/pwdb_helper.c
++++ libpwdb/pwdb/pwdb_helper.c
+@@ -18,6 +18,7 @@
+ *
+ */
+
++#include <string.h>
+ #include "pwdb_public.h"
+ #include "pwdb_module.h"
+
+--- libpwdb/pwdb/interface/shadow/group.c
++++ libpwdb/pwdb/interface/shadow/group.c
+@@ -533,7 +533,7 @@
+
+ static const char *supp_entry[] = {
+ "group", "passwd",
+- "users", "admins" /* these are from /etc/group */
++ "users", "admins", /* these are from /etc/group */
+ "groups", /* these are serviced by requests */
+ NULL
+ };
+--- libpwdb/radius/radius.c
++++ libpwdb/radius/radius.c
+@@ -145,7 +145,7 @@
+ const char* password,
+ RADIUS_RESULT *rad_result)
+ {
+- int salen;
++ socklen_t salen;
+ int sockfd;
+ struct sockaddr saremote;
+ struct sockaddr_in *s_in;
+@@ -333,7 +333,7 @@
+ const char* new_password,
+ RADIUS_RESULT *rad_result)
+ {
+- int salen;
++ socklen_t salen;
+ int sockfd;
+ struct sockaddr saremote;
+ struct sockaddr_in *s_in;
+@@ -535,7 +535,7 @@
+ int sense,
+ int session_time)
+ {
+- int salen;
++ socklen_t salen;
+ int sockfd;
+ struct sockaddr saremote;
+ struct sockaddr_in *s_in;
diff --git a/sys-libs/pwdb/files/pwdb-0.62-selinux.patch b/sys-libs/pwdb/files/pwdb-0.62-selinux.patch
new file mode 100644
index 000000000000..106be5645176
--- /dev/null
+++ b/sys-libs/pwdb/files/pwdb-0.62-selinux.patch
@@ -0,0 +1,443 @@
+--- pwdb-0.62/examples/Makefile.pwdbselinux 1998-10-06 19:57:04.000000000 -0400
++++ pwdb-0.62/examples/Makefile 2003-07-09 14:45:54.702663000 -0400
+@@ -4,6 +4,8 @@ PROGS = posix gentest tpwdb radtest grou
+ SRCS = $(addsuffix .c,$(PROGS))
+ OBJS = $(addsuffix .o,$(PROGS))
+
++SELINUXLIBS = -lselinux
++
+ # rules
+ junk:
+ @echo "this is not a top-level Makefile"
+@@ -14,20 +16,20 @@ junk:
+
+ all: ${PROGS} ../libpwdb/libpwdb.a
+
+-posix: posix.o ../libpwdb/libpwdb.a
+- $(CC) -o $@ $< ../libpwdb/libpwdb.a -lnsl
++posix: posix.o ../libpwdb/libpwdb.a
++ $(CC) -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ tpwdb: tpwdb.o ../libpwdb/libpwdb.a
+- ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl
++ ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ radtest: radtest.o ../libpwdb/libpwdb.a
+- ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl
++ ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ gentest: gentest.o ../libpwdb/libpwdb.a
+- ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl
++ ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ grouptest: grouptest.o ../libpwdb/libpwdb.a
+- ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl
++ ${CC} -g -o $@ $< ../libpwdb/libpwdb.a -lnsl ${SELINUXLIBS}
+
+ clean:
+ rm -f ${PROGS} *.o *~
+--- pwdb-0.62/libpwdb/shadow/shadowio.c.pwdbselinux 1998-10-06 16:58:43.000000000 -0400
++++ pwdb-0.62/libpwdb/shadow/shadowio.c 2003-07-09 14:45:54.705662544 -0400
+@@ -16,6 +16,12 @@
+
+ #include "../_pwdb_internal.h"
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++static int selinux_enabled=0;
++static security_context_t prev_context=NULL;
++#endif
++
+ struct spw_file_entry {
+ char *spwf_line;
+ int spwf_changed;
+@@ -259,8 +265,28 @@ int __pwdb_spw_close (void)
+ if (fstat (fileno (spwfp), &sb))
+ return 0;
+
+- if (create_backup_file(spwfp, backup, &sb))
+- return 0;
++#ifdef WITH_SELINUX
++ if (selinux_enabled=is_selinux_enabled()) {
++ security_context_t passwd_context=NULL;
++ if (fgetfilecon(fileno (spwfp),&passwd_context)<0) {
++ return 0;
++ };
++ if (getfscreatecon(&prev_context)<0) {
++ freecon(passwd_context);
++ return 0;
++ }
++ if (setfscreatecon(passwd_context)) {
++ freecon(passwd_context);
++ freecon(prev_context);
++ return 0;
++ }
++ freecon(passwd_context);
++ }
++#endif
++ if (create_backup_file(spwfp, backup, &sb)){
++ errors++;
++ goto errorexit;
++ }
+
+ isopen = 0;
+ (void) fclose (spwfp);
+@@ -278,11 +304,15 @@ int __pwdb_spw_close (void)
+ */
+
+ spwfp = fopen_with_umask(newfile, "w", 0777);
+- if (!spwfp)
+- return 0;
++ if (!spwfp){
++ errors++;
++ goto errorexit;
++ }
+ if (chown(newfile, sb.st_uid, sb.st_gid) ||
+- chmod(newfile, sb.st_mode))
+- return 0;
++ chmod(newfile, sb.st_mode)){
++ errors++;
++ goto errorexit;
++ }
+
+ /*
+ * Check each member in the list and write out any elements
+@@ -308,7 +338,7 @@ int __pwdb_spw_close (void)
+
+ if (errors) {
+ unlink (newfile);
+- return 0;
++ goto errorexit;
+ }
+
+ /*
+@@ -352,7 +382,20 @@ int __pwdb_spw_close (void)
+ }
+ spwf_tail = 0;
+ isopen = 0;
+- return 1;
++
++ errorexit:
++#ifdef WITH_SELINUX
++ if (selinux_enabled) {
++ if (setfscreatecon(prev_context)) {
++ errors++;
++ }
++ if (prev_context != NULL) {
++ freecon(prev_context);
++ prev_context=NULL;
++ }
++ }
++#endif
++ return errors==0;
+ }
+
+ int __pwdb_spw_update (const struct __pwdb_spwd *spwd)
+--- pwdb-0.62/libpwdb/shadow/sgroupio.c.pwdbselinux 1998-10-06 16:58:43.000000000 -0400
++++ pwdb-0.62/libpwdb/shadow/sgroupio.c 2003-07-09 14:45:54.704662696 -0400
+@@ -16,6 +16,12 @@
+
+ #include "../_pwdb_internal.h"
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++static int selinux_enabled=0;
++static security_context_t prev_context=NULL;
++#endif
++
+ static int islocked;
+ static int isopen;
+ static int open_modes;
+@@ -278,8 +284,28 @@ int __pwdb_sgr_close (void)
+ if (fstat (fileno (sgrfp), &sb))
+ return 0;
+
+- if (create_backup_file(sgrfp, backup, &sb))
+- return 0;
++#ifdef WITH_SELINUX
++ if (selinux_enabled=is_selinux_enabled()) {
++ security_context_t passwd_context=NULL;
++ if (fgetfilecon(fileno (sgrfp),&passwd_context)<0) {
++ return 0;
++ };
++ if (getfscreatecon(&prev_context)<0) {
++ freecon(passwd_context);
++ return 0;
++ }
++ if (setfscreatecon(passwd_context)) {
++ freecon(passwd_context);
++ freecon(prev_context);
++ return 0;
++ }
++ freecon(passwd_context);
++ }
++#endif
++ if (create_backup_file(sgrfp, backup, &sb)){
++ errors++;
++ goto errorexit;
++ }
+
+ isopen = 0;
+ (void) fclose (sgrfp);
+@@ -296,11 +322,15 @@ int __pwdb_sgr_close (void)
+ */
+
+ sgrfp = fopen_with_umask(newfile, "w", 0777);
+- if (!sgrfp)
+- return 0;
++ if (!sgrfp){
++ errors++;
++ goto errorexit;
++ }
+ if (chown(newfile, sb.st_uid, sb.st_gid) ||
+- chmod(newfile, sb.st_mode))
+- return 0;
++ chmod(newfile, sb.st_mode)){
++ errors++;
++ goto errorexit;
++ }
+
+ /*
+ * Check each member in the list and write out any elements
+@@ -326,7 +356,7 @@ int __pwdb_sgr_close (void)
+
+ if (errors) {
+ unlink (newfile);
+- return 0;
++ goto errorexit;
+ }
+
+ /*
+@@ -370,7 +400,20 @@ int __pwdb_sgr_close (void)
+ }
+ sgr_tail = 0;
+ isopen = 0;
+- return 1;
++
++ errorexit:
++#ifdef WITH_SELINUX
++ if (selinux_enabled) {
++ if (setfscreatecon(prev_context)) {
++ errors++;
++ }
++ if (prev_context != NULL) {
++ freecon(prev_context);
++ prev_context=NULL;
++ }
++ }
++#endif
++ return errors==0;
+ }
+
+ int __pwdb_sgr_update (const struct __pwdb_sgrp *sgrent)
+--- pwdb-0.62/libpwdb/unix/pwio.c.pwdbselinux 1998-10-06 16:58:43.000000000 -0400
++++ pwdb-0.62/libpwdb/unix/pwio.c 2003-07-09 14:45:54.707662240 -0400
+@@ -16,6 +16,11 @@
+
+ #include "../_pwdb_internal.h"
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++static int selinux_enabled=0;
++static security_context_t prev_context=NULL;
++#endif
+ struct pw_file_entry {
+ char *pwf_line;
+ int pwf_changed;
+@@ -204,8 +209,28 @@ int __pwdb_pw_close (void)
+ if (fstat (fileno (pwfp), &sb))
+ return 0;
+
+- if (create_backup_file(pwfp, backup, &sb))
+- return 0;
++#ifdef WITH_SELINUX
++ if (selinux_enabled=is_selinux_enabled()) {
++ security_context_t passwd_context=NULL;
++ if (fgetfilecon(fileno (pwfp),&passwd_context)<0) {
++ return 0;
++ };
++ if (getfscreatecon(&prev_context)<0) {
++ freecon(passwd_context);
++ return 0;
++ }
++ if (setfscreatecon(passwd_context)) {
++ freecon(passwd_context);
++ freecon(prev_context);
++ return 0;
++ }
++ freecon(passwd_context);
++ }
++#endif
++ if (create_backup_file(pwfp, backup, &sb)) {
++ errors++;
++ goto errorexit;
++ }
+
+ isopen = 0;
+ (void) fclose (pwfp);
+@@ -222,11 +247,15 @@ int __pwdb_pw_close (void)
+ */
+
+ pwfp = fopen_with_umask(newfile, "w", 0777);
+- if (!pwfp)
+- return 0;
++ if (!pwfp) {
++ errors++;
++ goto errorexit;
++ }
+ if (chown(newfile, sb.st_uid, sb.st_gid) ||
+- chmod(newfile, sb.st_mode))
+- return 0;
++ chmod(newfile, sb.st_mode)) {
++ errors++;
++ goto errorexit;
++ }
+
+ /*
+ * Check each member in the list and write out any elements
+@@ -251,7 +280,7 @@ int __pwdb_pw_close (void)
+
+ if (errors) {
+ unlink (newfile);
+- return 0;
++ goto errorexit;
+ }
+
+ /*
+@@ -294,7 +323,20 @@ int __pwdb_pw_close (void)
+ }
+ pwf_tail = 0;
+ isopen = 0;
+- return 1;
++
++ errorexit:
++#ifdef WITH_SELINUX
++ if (selinux_enabled) {
++ if (setfscreatecon(prev_context)) {
++ errors++;
++ }
++ if (prev_context != NULL) {
++ freecon(prev_context);
++ prev_context=NULL;
++ }
++ }
++#endif
++ return errors==0;
+ }
+
+ /*
+--- pwdb-0.62/libpwdb/unix/groupio.c.pwdbselinux 1998-10-06 16:58:43.000000000 -0400
++++ pwdb-0.62/libpwdb/unix/groupio.c 2003-07-09 14:45:54.708662088 -0400
+@@ -11,6 +11,12 @@
+ #include "../_pwdb_internal.h"
+
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++int selinux_enabled=0;
++static security_context_t prev_context=NULL;
++#endif
++
+ static int islocked;
+ static int isopen;
+ static int open_modes;
+@@ -259,8 +265,28 @@ int __pwdb_gr_close (void)
+ if (fstat (fileno (grfp), &sb))
+ return 0;
+
+- if (create_backup_file(grfp, backup, &sb))
+- return 0;
++#ifdef WITH_SELINUX
++ if (selinux_enabled=is_selinux_enabled()) {
++ security_context_t group_context=NULL;
++ if (fgetfilecon(fileno (grfp),&group_context)<0) {
++ return 0;
++ };
++ if (getfscreatecon(&prev_context)<0) {
++ freecon(group_context);
++ return 0;
++ }
++ if (setfscreatecon(group_context)) {
++ freecon(group_context);
++ freecon(prev_context);
++ return 0;
++ }
++ freecon(group_context);
++ }
++#endif
++ if (create_backup_file(grfp, backup, &sb)) {
++ errors++;
++ goto errorexit;
++ }
+
+ isopen = 0;
+ (void) fclose (grfp);
+@@ -278,11 +304,15 @@ int __pwdb_gr_close (void)
+ */
+
+ grfp = fopen_with_umask(newfile, "w", 0777);
+- if (!grfp)
+- return 0;
++ if (!grfp) {
++ errors++;
++ goto errorexit;
++ }
+ if (chown(newfile, sb.st_uid, sb.st_gid) ||
+- chmod(newfile, sb.st_mode))
+- return 0;
++ chmod(newfile, sb.st_mode)) {
++ errors++;
++ goto errorexit;
++ }
+
+ /*
+ * Check each member in the list and write out any elements
+@@ -308,7 +338,7 @@ int __pwdb_gr_close (void)
+
+ if (errors) {
+ unlink (newfile);
+- return 0;
++ goto errorexit;
+ }
+
+ /*
+@@ -351,7 +381,19 @@ int __pwdb_gr_close (void)
+ }
+ grf_tail = 0;
+ isopen = 0;
+- return 1;
++ errorexit:
++#ifdef WITH_SELINUX
++ if (selinux_enabled) {
++ if (setfscreatecon(prev_context)) {
++ errors++;
++ }
++ if (prev_context != NULL) {
++ freecon(prev_context);
++ prev_context=NULL;
++ }
++ }
++#endif
++ return errors==0;
+ }
+
+ /* update an entry */
+--- pwdb-0.62/libpwdb/Makefile.pwdbselinux 1999-04-10 05:31:20.000000000 -0400
++++ pwdb-0.62/libpwdb/Makefile 2003-07-09 14:45:54.709661936 -0400
+@@ -22,7 +22,7 @@ HEADERS = pwdb/pwdb_public.h pwdb/pwdb_c
+
+ # needed for generic interface compilation
+ # if header files are not installed (CG)
+-CFLAGS+=-I.
++CFLAGS+=-I. -DWITH_SELINUX
+
+ CFLAGS+=# -DDEBUG
+
+@@ -50,6 +50,7 @@
+
+ all: $(LIBSTATIC) $(LIBDYNAME)
+
++$(LIBDYNAME): LDLIBS += -lselinux
+
+ $(LIBDYNAME): $(LIBOBJ)
+ $(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIBSONAME) -Wl,-x -o $(LIBFILENAME) $(LIBOBJ) -lcrypt -lnsl $(LDLIBS)
diff --git a/sys-libs/pwdb/metadata.xml b/sys-libs/pwdb/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-libs/pwdb/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/pwdb/pwdb-0.62.ebuild b/sys-libs/pwdb/pwdb-0.62.ebuild
new file mode 100644
index 000000000000..28bcc00b9e71
--- /dev/null
+++ b/sys-libs/pwdb/pwdb-0.62.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="Password database"
+HOMEPAGE="https://packages.gentoo.org/package/sys-libs/pwdb"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="selinux"
+RESTRICT="test" #122603
+
+# Note: NIS could probably be made conditional if anyone cared ...
+RDEPEND="selinux? ( sys-libs/libselinux )
+ net-libs/libtirpc"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+
+ use selinux && epatch "${FILESDIR}"/${P}-selinux.patch
+
+ append-cppflags $($(tc-getPKG_CONFIG) --cflags libtirpc)
+ export LDLIBS=$($(tc-getPKG_CONFIG) --libs libtirpc)
+
+ sed -i \
+ -e "s/^DIRS = .*/DIRS = libpwdb/" \
+ -e "s:EXTRAS += :EXTRAS += ${CFLAGS} :" \
+ Makefile || die
+ sed -i \
+ -e "s:=gcc:=$(tc-getCC):g" \
+ -e "s:=ar:=$(tc-getAR):g" \
+ -e "s:=ranlib:=$(tc-getRANLIB):g" \
+ default.defs || die
+}
+
+src_install() {
+ dodir /usr/$(get_libdir) /usr/include/pwdb
+ emake \
+ INCLUDED="${D}"/usr/include/pwdb \
+ LIBDIR="${D}"/usr/$(get_libdir) \
+ LDCONFIG="echo" \
+ install
+
+ gen_usr_ldscript -a pwdb
+
+ insinto /etc
+ doins conf/pwdb.conf
+
+ dodoc CHANGES CREDITS README doc/*.txt
+ dohtml -r doc/html/*
+}
diff --git a/sys-libs/readline/Manifest b/sys-libs/readline/Manifest
new file mode 100644
index 000000000000..1a2590d47cdf
--- /dev/null
+++ b/sys-libs/readline/Manifest
@@ -0,0 +1,48 @@
+AUX readline-5.0-no_rpath.patch 363 SHA256 59df6107772d1a93550bacc267a2c00f9dfd6d5380b8497d8fd756a7191b9e4b SHA512 c0344c5b831433ad3a8499a91d36615e849a9b520f8ca35cd9cae6d5bc55729adbf97d003e335d210cb3806b2f39af273b4b5f98380dac371dc184053e245bb2 WHIRLPOOL c0d2fe9d1d1f36cf89279f315c373a7385d255ebbeab8ebf1ede7b99196660611499c7db85554b036ad3df4f0b4375558b1d1ce7cbae5f5731172181f7d167ac
+AUX readline-5.2-no-ignore-shlib-errors.patch 688 SHA256 2c585c4e2d69d6b91157f378a3dd11cb49beefab808eef3350cf1b8357b2efc6 SHA512 23f88aee11a9ebe15406293695f3de2a7a6c52b8b138c199c64f9dbb9b59d9063f12f8693656e61611e72f6298f7d919016cd240434e78ea2232876690a8b738 WHIRLPOOL ae87d544fa32dbd2b6f27f164dd4e6d0e8a3f399d4a9bde81bcb631985c6e69db11705dc372c21a4f9d3a26cf4279023aeae97fd0d243ca8e1c0e547b59084a4
+AUX readline-6.2-rlfe-tgoto.patch 379 SHA256 6bd5db93cba1cdf751b424a25a1f08c87bae2b42ff59c6c0aa34d659115cbfc1 SHA512 1d2c3aafc949d92fdf6abbee60a60c80f0327f81694d5d8f3a166f1c24d37346caca3e72c9971106b96b2758a9a01269346954fe20bc381eb9da2e6a2737fc3c WHIRLPOOL daab79312136fa728ea77839d6ad663554055e2acd7acff036b8d168f4a0791d57503aa196be4f834caf32ba72ec73c3125adb9b11b5d6898bb796016e83175a
+AUX readline-6.3-fix-long-prompt-vi-search.patch 736 SHA256 42177ae7f747eeac432c60d67d31d6903edb919d0fd6bf31137ff4459061d99e SHA512 ad5bb44ba00f6f5e355b95078209e2e51f8d8ba9a924d00ef6aa3286e09c15fe0024efa0817f9e6d86b7aecb73150fcd69d0051a0f7fb37475921478f62ce0e0 WHIRLPOOL 117e007fa59669f73c69dd9acb02896231fb58524feab8bfeded9538dc9d4106ac678279e31c48cccb41a14c281aee9a94f5943d540fdddd99f768d53ee24a67
+AUX readline-6.3-read-eof.patch 1913 SHA256 508323403e752296a63619e9a3fe4fdcd233f368f0f9944ccdc2c6bd69eebc2c SHA512 99728e35d64b466e2bea570412eec719c70841d205a5190c0000bcae55cf3ac2d659ae18e57b4c332525261d83e160054800cd89f4009ce3c76d1c3b4ac27223 WHIRLPOOL beda5876ea05f69f0b2e8005c60dca8290cc7943475352b6c26ab656273290d06a07ae62f28e3fc21c3c31ae628c744a6e5a8ebbc5328fa896f215d419dea270
+AUX readline-7.0-headers.patch 576 SHA256 4bc1027ecb36f7b2dee7c0ecf3358abe8d06835a372d0717d07e96bd3ee0c907 SHA512 51b7acaed6078ffe4bc4f3c2565d21c426d4507e9ae59b03bbbd5d4eeb956896e07929528d4070285c92e022f0eecb9fad86eadb694d845e3d49dc791b0b20ff WHIRLPOOL 7579a0b4874e32511f878e8d385567b40603d82fbadf1d5d7b2c1f12ed63f965824e7aa12ab90cc01e6f1f6ff613882761224a74909b92d8b0f1117004206f73
+AUX readline-7.0-missing-echo-proto.patch 492 SHA256 b0bd748fcc80b322b489a33375752f0ad40d5f06d8adb7be19e2f70185da13c7 SHA512 481ff7fb7dbe5eaea24b378d12deb78b6cb3f80ef89239b9ac1bcf6fa4bf1d05bfc93c1bf24da0983bee6b4c2e2665bac6788ba23b74208d5ae67ec4c4a76d88 WHIRLPOOL b91cd3407b5c39f8d391c6e8aeca68bd69e0263be4637cb91a6aafefe291db7ec36a8a1b0953bd04c62c8630bf43e689d66d208e619ffc0f3c48a7afb7dff6a0
+DIST readline-4.3.tar.gz 961662 SHA256 eeaf6f050b9f515b0636e5b4f2c153f9ef78e9061ee5dd74f612fab54c77bf88 SHA512 4dbc4d9f16a453f8cf6adefb5723b0f35ef79b8db7dcdfcdd2d6465cb62ca961035e5e9547bfa46d4cb1370d738b042e0e10f9233c3751925c6bccab41e7d182 WHIRLPOOL bad0852f5a97b747c79923bbef29dc48bb7730b96ba86dd444f63d9ee78fe0dda3edd249607dbaf98b3a8932b69cbcf0f79592cfc3757887791e38673dccb352
+DIST readline-5.2.tar.gz 2037705 SHA256 12e88d96aee2cd1192500356f0535540db499282ca7f76339fb4228c31249f45 SHA512 74318b32c56e888716bda2507228ecc374a24e85b2faeec4778227a9f04eb19de1fc8468c78746954c84f9e616a06dd0f8a4332ba4b438fefb7e222699baa379 WHIRLPOOL 8641abf42316ab278207c0a25d9155d4d4fddaf0e704255b40708875b9f31bd3e6caf903550783c15b160bd2b86ffc129b2eb7a1fb4a641d8d58edc3b53145c3
+DIST readline-6.3.tar.gz 2468560 SHA256 56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43 SHA512 f70efaf46d570b85c7637172b0ee2eb9a4aa73ba38a62bb45075e665929d9701b96fba0aea6c767fd9a2a0d39dfe8e70ab06da08f8524aee76a7c502f370a401 WHIRLPOOL 7c68627559890dbebf1394b911cfd4675ec8862b84d4e067a207dd37a0a94482c8d92216195df2873bcdf03a0a86150663a9604cd65a0d78363376bc8ee4cfda
+DIST readline-7.0.tar.gz 2910016 SHA256 750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 SHA512 18243189d39bf0d4c8a76cddcce75243c1bae8824c686e9b6ba352667607e5b10c5feb79372a1093c1c388d821841670702e940df12eae94bcebdeed90047870 WHIRLPOOL a01a000bde533e4c6cd379e0be1ac1694517d1ae5abe67d000c02f9c8d38313725c6769e33db584660431eeb63ea415ac8a182bcb89ae3728c7d8f9942f83fc7
+DIST readline43-001 1126 SHA256 787244afefceeaf8bfbdc95eef0c4d163ab05ecf178bb631fff287354df0d955 SHA512 1bfcaf9fd36d154230682ef66a9561281822f09629f9923acfbacbaafd650974b4d94267e1bf74ab4a66f0e2da95e64894c78373c82bee593bd9afbae4af58bc WHIRLPOOL 080c0cffb0637bba2f6819524291c8efd1832b42b7ca619fda551b00ed82558d9c03a6f739b350b8a1de2c32e6ab92fd86137a9620473439c5b6ced6d3a06f91
+DIST readline43-002 738 SHA256 3fd4694c4043b61010c44778ed61581073ac5ddee53436b0e4e1ad2bbe4da226 SHA512 546a7bfab27dd0b77f8b0683b82358a295d47e4e249e01d2e49612a2f113c18580c8276b17451e1edab61a26ddcff0267457a804120d5e0052dfe8e88632ddd2 WHIRLPOOL d3b43145a4ed207f353c5b95b52bdb81be31bd5b077ad60152799333ca582c7524c5587a4e0d9a0fc9246a114552f0c26933d2bc8f60e9de2536a8b6ec9f2cda
+DIST readline43-003 2202 SHA256 346120970e3860c776e3cf5fd78e4f09b0d326a3b633a508f35f3f0b56f4412b SHA512 fbabbe5a11c2a17dd0cb47adfb40940c860069f0e99b1478546b0351471663094d032c8049e1a2ca060f4b51835bb6a824276e1864a627711e0805268386cb8e WHIRLPOOL 076d101812e7a98d445fd447d816fd0b15c9690869f4a567d76287c495c257f85e4e79f11f7e6e8354093613ca1c0a758514672cec98d303279daf597dee2577
+DIST readline43-004 3140 SHA256 82ede838829d2f39109851eddf2dc0144885d9fdeec4e07e0814f3465320edfd SHA512 8bc87915f5340f7f88266af0bb3aa976b40d8636373def11ec23dc412d112bc314eeac5ee2832be7993a03f2d0e38643964e838d69321c7d3e2e9ea1c606df79 WHIRLPOOL aa9e8152c600f891f2b2f40d3c3b986969eb787906cf78bd305cac5d4ab97cb47cf4e0f7fe868f62abc72f254e2e562ea4caa6fde0c0fecf7de859561abe324e
+DIST readline43-005 1056 SHA256 7a06494282519d47cd7a0c13447f93d9178de43548a645a9808017cfa9bdb233 SHA512 853fcb9cacce7a9ad0d29abe979a60291253fcb3fcae1fc067718a75d123ceb16e60d11a31583c8b5bd217d5f2460ebc77d8d2c89487a7331627348d5901281c WHIRLPOOL 68e67ae313cca750d50eea0291be11cf9c69732481a5ecc75dbbc72b2ade3202fcc610f5b511bfa7a13c82103aef3a53d97b43e5966feeceab22b676ba5dff6d
+DIST readline52-001 874 SHA256 eac304c369154059f93049ada328739faaf40338d3cb1fb4b544c93d5ce3f8d5 SHA512 65b92b5e03c20566eb3c7626e3ee9631e2b26932c34f2f95d88ae731df2805bcf63fc1215b97c97a2948e83b9373e3985ca1f64a598d84f1457bb33b605e5d9c WHIRLPOOL a11176d2bd2e02c5d81dc2791946251e89133d74d8621874db638a3854415e184934589b9c04d066035ca83f00b0de5e06876fddc7d6ca8e33203559b1eeda9c
+DIST readline52-002 1433 SHA256 9deacaef25507a0c2ae0b661bf9342559b59a2954d66ea3c5f5bcd900fdfcf78 SHA512 9d5b5549c355e80608d76b532bdf358a4e26dac0b62f7c51055bb15ea831a74ad2ef25391ddc2b1615bff8974a2e89a8045567fb0c6d2726dde37aa02a0e6b31 WHIRLPOOL f45f3641984fbb519344f8be6cffb863ee9dd07dd4a59c83d8a722770e84d35be8722970e87afa47b7db6c568bf45cea8904136a92dcfab85e0c5f6b04591077
+DIST readline52-003 1204 SHA256 2a55d2ecb1c9b0147aeb193a6323616ab31c1c525a83b2db3a994b15594ba934 SHA512 7f1722adea9bb9a94277cfbc66d47f600654a0d43bce7def1405e1bb925e5fb324615dd588d1ff2555e6bdebbe3b4609237ba7f52d80689a45f80935e440a37c WHIRLPOOL ad2bf92f7bcdd50f1bf2cacf917339590a9614237712f55f6432f0f6b7354b1a4c336be7784689749809d91b8f9e1b8e518642d315f84ee2a2fb4ff3235d1ad9
+DIST readline52-004 2192 SHA256 a03b65633781efa7c3aae5d57162985e7b7a3c10acf0f2621be610e16f27e5f2 SHA512 e0c0f87ca14a3d473aa31627385f1cb9c2daaf685d8bc0c25bfb2214d5665077a74c4589e3ff5bbc6d0e8b5321ac7fe0c4f7620761d46bbdca787a751e6dbd02 WHIRLPOOL c4f95b2bdc4d2e87983f307d484276cac5e8cd1a14fdef316cba91f53e274a87928f5b7701e098d6d8e9e522320925b086786513f70599cc749dd010e27f9638
+DIST readline52-005 8029 SHA256 06001896514148a757ea6edbbd40c4fc4331dc653847244386c37b138b150f64 SHA512 bd7af4e71f1572811b37bccb68d5ebc20f2e7c21850d9ec55bc48fdf756f9ebaac888b0fc6d83b70e94e335056646e5021ec86b26100a976883ff72ee6d8d521 WHIRLPOOL 6fed5902600d880b181cde7962d0d8eb8f1552770cddf7e80fa2547da7f8f1b8da4dda06d1875510974c897136cfe36079c80aaa83ce81aafab5af39675f393b
+DIST readline52-006 2820 SHA256 dfef3e982c0adf8bb5a9b7d0468ec8f5f18138b325e28759437464de5be71013 SHA512 3523800517b24fa512f3bc8750ecb83be73d57c7d48636ac3aa6b681ee185b6460ce8461a046734b64d78834f89d18d4c9c1de92d1eee94294eeae7e2911ce93 WHIRLPOOL b85c88d1bba3ac13d7379a6018d1d2a8c5fde78af37b28eeaf18e2ce3257e220b7ed36e106b649bd35f45b83703e7d5749a7ebe7e606857a8c774f4197a5f648
+DIST readline52-007 1523 SHA256 775b028c7b761397ac6ae1bdfbac7e896dc3b9b3adc2f91312499180ca13bdd1 SHA512 fe9471b237713ef7ce53fd0cf7bbb5a60720c64ec3df9dc58146d9c187511f0a6f480ae3f3b65168723e416ba4f08c67a2add0b01ede1149f72e7fc2ef21050f WHIRLPOOL 0a737ca595dcf8ce11f22e07b0927ba35f76981b7dcab38931536f38f9f94cf57882a555f3d0993b3b9d986156deaa8742db5ad50767beb7b68bda4cd067d3ba
+DIST readline52-008 2277 SHA256 a21b4e0bf0530b878bad24d5be23d18a9e03a75a31ae30844dc0933bb3d77ecd SHA512 a864e970006146533dac885b00f53dcf1471f95d6143d8874fe8c8e056477d6c237cf2814625bf2031844285484757fa0ccf66d064ac2065ac62a21384d67c93 WHIRLPOOL 2ec34f16bb51f2def75d6ba70a99073a8164157000bc2cdd84590060e7192c7c5aaedb67a89fa8602b02c5db3636262f6bd6d49321ca1130b9571d6d5c6285b4
+DIST readline52-009 1332 SHA256 138d5e0f0709a47a2d1621295a3dd5e3cc73b63b5cc28dab03abc4e94fe95ecf SHA512 a19ca5b5875208f8ea4804461c1ba1b0e27feabb0a2a0db1fe9ea94b8d84e366e754688f5d8840f48c6bc22a02b0abcbaf35dd3361784b7db4e9e83629d840be WHIRLPOOL 707c8bbe7492f7744d43b8c90e4ae83a44fae0932bb7007725d6e75c0748cac4bb3a6b20823cb546760d1c0009c31ebaac6088e6e3a71b0ffc5bf8329538301f
+DIST readline52-010 1543 SHA256 83f8c1aadb86b1a2fad8821a9c6be72a8de5afd7fd9fde58a30b3b57d939693e SHA512 851b7ee9fa3ab84e570723d445ade084fbb5af17fd4131520650f53000e93cb7c799c56cb00e8f906b230524b2fdda60970e72a44d1673d9bcd2c4de7ae400f8 WHIRLPOOL c491a42ac29463172c56408362ac3f3787b5f18e7050a72e73ed1191519c0093591b1ff095b8ec056af001016b47f654d4db46df86fd02b643b9ff3e8ee8ecee
+DIST readline52-011 886 SHA256 08ad3384ab0906e6fa4cc417eb8c43ff59375bcead15fd5c8e31730f0413b3d6 SHA512 b4d813c3aa9c1f35962ea8ca6ad1abb34f4ed3ab91dd31eb1fc5e9b9e54da032e6fbfea583e472cc6d8c6baa4f2ad8f63efc22c749fd713e0704474aad74f0ae WHIRLPOOL 4d3b05ed68601a96d2046a917051f87263ee60b5a4f5e44211f8f6d4dd26cd55e88f119ef0fd1c92dace7de88e981155dbfc64e595f2d59d2af430585f70adad
+DIST readline52-012 3870 SHA256 20f0243be2299c23213492cc2c19cfd15cc528d2b566a76a2de58306bb9e4c9e SHA512 2964c1c3a234223216ca3a099c42d8ee7de94fa7bee73ac346cc9991b9a11ad0406d3f9d785548f15170bf803714f4ffb0c2dfad19bb633358805c9b2e2873d3 WHIRLPOOL fa4bb64304b266dc24565ca4c5396aec8a5192998bb2322906be45e40389ef10141f0bdf243a33438384508d74387b4fb645b9189264742ae6a10e5600a57af3
+DIST readline52-013 5147 SHA256 0cc649516a5bdfa61c5e56937407570288b6972d75aa1bd060ad30ebe98144d5 SHA512 6c9addc3b130d5f034488cc9506f22bd183794fd1a8ac820c674b39761c8c47df1b69dc41c8be60054a068b2ae5fb63a76268b977ea07b33a8fcc4a829b55a8f WHIRLPOOL 17a956bb00d99819067f81dbe73ab1e573f0079b0c328ecede4082b98a03b20ff2d5629daf639abc1ff19b3b9d13e3c8d23a5bfa85b4712337611ef3a4d91aff
+DIST readline52-014 1244 SHA256 6f1a68320d01522ca1ea5a737124ecc8739f3dcbfea2dee21e3ccf839a21a817 SHA512 d262861e67b79059de3967ba820ce02a7d28eff33175ecb30b748d24c08f3a151da3c53430fc2d26da5934f198075c55d2f616b93fabd297d60b9c82bae17cf0 WHIRLPOOL ff137bf6e56989e24a378dfc15c1831a7f0f458442781bffe07c429e04f21d674993ab523198341918a1cd540d2bd8806ec0c9283f879d7346f0c26b920eeca8
+DIST readline63-001 1366 SHA256 1a79bbb6eaee750e0d6f7f3d059b30a45fc54e8e388a8e05e9c3ae598590146f SHA512 e70f89ca52a4eae7e1cddd70de6a7162252231ee029c89bb3fcb0f6c8c8b46c666be910c8b2eee72e96983ec2f1a23663694dc222f67228d82e8e4684f1504a2 WHIRLPOOL ed0b0ce066ab4764851d81e44d708cc9e2f3fe36ac4788243c81b3e25aa0995d054c1caf0a788c25969c7cdc6b2bad55a9c9c64286f485194b4e76bc453edf74
+DIST readline63-002 1297 SHA256 39e304c7a526888f9e112e733848215736fb7b9d540729b9e31f3347b7a1e0a5 SHA512 4e23bd67433577e6e361d10a6c32768ea9e13b10e77493e565b870f56069b673fbcb0b860225f79fa9931845fc91d35c9a82c1385c23f8b757ebfd59f27851f4 WHIRLPOOL ca878e614ee233748f7017f5606fe2e96bb8374b33e4a571c5901594d7f329fd19b217abcf9cb844fa96374bff9e044712ed1017d6d99936f700da030202231d
+DIST readline63-003 985 SHA256 ec41bdd8b00fd884e847708513df41d51b1243cecb680189e31b7173d01ca52f SHA512 6bfb84a5b980091b995e2b96bdf5680f97fe670e6cac1b8606d2d75a1ef922ff5bd4e73f029f7af98a115006b7ab7828146f2cd6986287543d8a29987c91dc12 WHIRLPOOL 3615b462024e836f0854c2ffaf1282b42462a0da90c8ce248a47e9ea5a0ce00892135c1b725f9fb8ef1fafb1e88e02649c664373ba41683ca2457aafdd12ac93
+DIST readline63-004 1363 SHA256 4547b906fb2570866c21887807de5dee19838a60a1afb66385b272155e4355cc SHA512 6b683e9fe28831885135391b5a23bc580cacf0ffe720951a80f545574eda4eb064fe189801d44329b2eb2d3577db5a90f9e5ad9ed131e7e8a8ae349511632721 WHIRLPOOL 49deb89325cb582538027855169067c4224504d8aa944f8c6f34c07afd0bab30690e01a573ab67279d851b75c6e33e236f19a9fc9eb0271cd1f10d9b91fd0203
+DIST readline63-005 1664 SHA256 877788f9228d1a9907a4bcfe3d6dd0439c08d728949458b41208d9bf9060274b SHA512 b0332d7f999376788155341319d138a899a2278c338a6faaac89ecf3ed1e2248a07413dd810a76996bf25f211de787182b55f34ab3d7d31eb7519d7a48ebed32 WHIRLPOOL d10a4a6a9ea20e2e9bb9180e0a0511796ea0ca247bec17f2357ee8a759ac5adc877f5f838c3d1f45157014d88306f1b1dc7e9633c2bbd4a7125b9b8df5c0c0e8
+DIST readline63-006 1982 SHA256 5c237ab3c6c97c23cf52b2a118adc265b7fb411b57c93a5f7c221d50fafbe556 SHA512 e9fbfa38d7b03ab2aff2e9e48918b85b4b67a729862ee47d1cc8e0aeb90c3224394a79f68829951e1377cae65742aa5385eae865f75e9c0b2e2abde42889431c WHIRLPOOL 7b88ad9fcad9eee0762d881307d2f865c66a9ee246bc1a648d6203677fc307759ca7ee216fb632114d3da76ca27a67222aefd830bcf99ee9a96d1ba2f2105290
+DIST readline63-007 1428 SHA256 4d79b5a2adec3c2e8114cbd3d63c1771f7c6cf64035368624903d257014f5bea SHA512 abee331894846b360203a521d9a66fa02c03214120d5cafbd1cb4d680bd7bbef14321ae845dd67f7b5e8c87322801fd96fc9a5fd0ae026b41d98dc24a8949854 WHIRLPOOL fc9d866a6e0f0c2a2f752c65e6fcae56a1b0e1b5cef45154ff51b5d1b49fc75ffaa30bdf90c221fb6493381b9d67eb20168bdfd273fa0dd89602f18680bb3e5f
+DIST readline63-008 1452 SHA256 3bc093cf526ceac23eb80256b0ec87fa1735540d659742107b6284d635c43787 SHA512 8e30bbca3aa5cea8c2ee511abe0ec8f131608d74fe5ab24d68bcf452267f0f97446ed6e7cd482360876ce6c027280e4f4450cae05eb18f56046240f4c224841c WHIRLPOOL 94d9371e6ca35e72565c1990e0ec8bedf8a141f0a3d061e4928f6184c3ef4a4b472f4278d443b990a53977ad6f3f7bdbf41e51a999202b48414df3a946bb9796
+DIST readline70-001 1777 SHA256 9ac1b3ac2ec7b1bf0709af047f2d7d2a34ccde353684e57c6b47ebca77d7a376 SHA512 4402186905af8cd42c609d640c2e13b9ad61c7778e5a3fd2c2d9da301f0deab05b04d7836f31527262f44f406517823dbb18cb07f2c73931186c806b494699ec WHIRLPOOL 3f52c3e5b0c5a600585e58ed2e013cdba2dee47f3604e7db96b811d715618f19fd75835a5cd9790f582493a32f54993cbac69ee04fa6c73775f14741c215fd65
+DIST readline70-002 2953 SHA256 8747c92c35d5db32eae99af66f17b384abaca961653e185677f9c9a571ed2d58 SHA512 13d1489578508d4d2c3a1618024198a709dbce74a6bbf0f6d7ec67d2419c55bfec9f0ca9de0ed93f129d21d5c3a94307ccdc49408455bbb301c5e3a772b03185 WHIRLPOOL cef977cae25be029b5188703c3a4597c8b27dff9ff8f0e39824f4a156a4d771fa8f61092d5f7f70fad63dc51773b07f6670f4ccce73b5266988cdb273755bf53
+DIST readline70-003 1294 SHA256 9e43aa93378c7e9f7001d8174b1beb948deefa6799b6f581673f465b7d9d4780 SHA512 eaf962a1480eb3870519017b81ecc5cef171e4c41fcf8c17da61ccbfd0379ed6bca85c17b03e2207ae4d51509f33fd010294c75f4bd0433a52118015d4160385 WHIRLPOOL 14480a2b7f653dbc466a1f7b9785f176af8ddc93ffd0ebab1e5ae89898a6f0feab1f86f6a8550271fc5f8e76cd7abcefcc9e4a2f86692244cc583aaa67c8039c
+EBUILD readline-4.3_p5.ebuild 1541 SHA256 51e01823e80f69b0ceaed61d6830f4f9452ff086054c2da42f7af5fac8aad7b8 SHA512 3675fb0346094bf360035c5a9e3ffe1577b284024b0d5287a121999db7f81b5c40caddd9f71ec76c76d63216df6b094c98aeac0eb5ccbf9bde6d265506d0df03 WHIRLPOOL d6494f41a3de2992c47ffa7445d29f41eaa5dbe625daab4af62a3f96c0aac58c18e639eb1c00108780a8b08a83d3961388e4dcee063b37e591c3ac14363352f2
+EBUILD readline-5.2_p14.ebuild 1610 SHA256 7e6758c0dbe06da1c5fac6735cd3b9f61fc19ed79f157ea3bbee35f3310a142c SHA512 0e4a5350507a2c42249bc142ac62e8c88698285e765ec63168ad878496b1b08d7ef0e3a8a05d99331a67eb490380ae5e6431c9289e21b4f6ae59477cbe8c9766 WHIRLPOOL f99da105e86bedf54c8a87f4033fa879903d24369b26bd97fe82d559ee49a8879a94068c0fcaa1d05b81e6eb82491545782d3ee07228e9e73e00e14176d445a1
+EBUILD readline-6.3_p8-r3.ebuild 4536 SHA256 69a6eac8a35514570b93631b41de75b7c2db6c1296690aef8bb565150d6b6ba4 SHA512 0f93d51c70b05b5103d05dd481b64ed5ad133ad6348e0799f2937fb944f1cc2c388a65940e6c405d3684b261e27586ce4d8f70063c53b2e4421888afdec674c9 WHIRLPOOL c8edade1f199aefa8506423aff7a2c2ee7749372b9fdab465c697b59aab35683a2fda39c3ab17dcaacb0c2abd9f5e45c7af06bf015630b7bcb99046dad0bf2ed
+EBUILD readline-7.0_p3.ebuild 4633 SHA256 ad5e73dd43cd93b69d71a5cb39c8df91c136de90e8289b373739d296a0b4f4f2 SHA512 bc261d1bf4cf3f67967b487329722a9a568f4a98276df5247e093b69fe14cd373faaa79acc963661cac9227afd5601eadf346ecb1515ceeb84e551b1cc485c9f WHIRLPOOL a6926352970ec1c87b35a727b0687f0feb14c6b938ff30dc614444d951a81f22b917f58105776f1fecb73e1e7aaa568f35343b556c11f8d1c82a3bf103b2190c
+MISC ChangeLog 8257 SHA256 28fefbfc5669860b97e0bed2a316ed194802397ff4c62e2aa454dbb45f119ff3 SHA512 f554c4d7e5accd8c26de245116ac8867378f00a56e6940395523291259eb47563fc5bdf7611dd998caf0b1d0a444d49f5767a9652e537395e7ec2bbfc6199208 WHIRLPOOL 5a1184e4c8801e89c90c9b45d3df3a8e4fbeb1c66f8ca5e594badc4228a1985bcc19141f200d03a8069e2d242fe82ff5d05e71bc4ffc2a203851fbe696ab02fb
+MISC ChangeLog-2015 30949 SHA256 c5b14aa54438b8a51d21198b6e9d57759cc88d5be3724e8e70cb472707dd8541 SHA512 d6d1fd54d62e4b69742153c23d8bf7026644daa30f4f405ee6fd2766528bbd530ebfe77778d14c7aa6a79ca1edefac5edf6be9e2f0e641a7dfac7a8d9ced5bf2 WHIRLPOOL 3cb3cd7617334cb3dd169960ab4ad9a456fe0dc9b12610e387ee21c5b5e6ff2902afa429957433e2724b9e2709bf9c8dd910d0c706fdc43007c5af043675901c
+MISC metadata.xml 394 SHA256 519b98bf07abee8e31ef1d4ace6ba59c135920001350d227193caa360d160896 SHA512 e27930a59d80535721eda0d3c481b1d13a66915c6d9552d960c9ac788f3dcdb0ef3fc411803a36cc98441ebbb8a4e0c1086bc2bda01511549fbf2921a7017784 WHIRLPOOL 670e626c2f68cadb403c3b6110a1a809bad6cd2508c5fcd6ca0692969132e5e434289c7ab1ecc3f1d06396ca63ee125e1a83486dd9ad036df935ef9a81012411
diff --git a/sys-libs/readline/files/readline-5.0-no_rpath.patch b/sys-libs/readline/files/readline-5.0-no_rpath.patch
new file mode 100644
index 000000000000..624b2d7dea2b
--- /dev/null
+++ b/sys-libs/readline/files/readline-5.0-no_rpath.patch
@@ -0,0 +1,13 @@
+ripped from Fedora
+
+--- support/shobj-conf
++++ support/shobj-conf
+@@ -102,7 +102,7 @@
+ SHOBJ_LD='${CC}'
+ SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+
+- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
++ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+ ;;
+
diff --git a/sys-libs/readline/files/readline-5.2-no-ignore-shlib-errors.patch b/sys-libs/readline/files/readline-5.2-no-ignore-shlib-errors.patch
new file mode 100644
index 000000000000..fc6349113167
--- /dev/null
+++ b/sys-libs/readline/files/readline-5.2-no-ignore-shlib-errors.patch
@@ -0,0 +1,24 @@
+dont ignore errors in the shlib subdir
+
+http://bugs.gentoo.org/216952
+
+--- Makefile.in
++++ Makefile.in
+@@ -194,7 +194,7 @@
+
+ shared: force
+ -test -d shlib || mkdir shlib
+- -( cd shlib ; ${MAKE} ${MFLAGS} all )
++ ( cd shlib ; ${MAKE} ${MFLAGS} all )
+
+ documentation: force
+ -test -d doc || mkdir doc
+@@ -238,7 +238,7 @@
+ -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
+
+ install-shared: installdirs install-headers shared install-doc
+- -( cd shlib ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
++ ( cd shlib ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
+
+ uninstall-shared: maybe-uninstall-headers
+ -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
diff --git a/sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch b/sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch
new file mode 100644
index 000000000000..b898bf053ecc
--- /dev/null
+++ b/sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch
@@ -0,0 +1,14 @@
+https://bugs.gentoo.org/385091
+
+https://lists.gnu.org/archive/html/bug-readline/2011-10/msg00000.html
+
+--- a/examples/rlfe/configure
++++ b/examples/rlfe/configure
+@@ -4062,6 +4062,7 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+
++extern char *tgoto(char *, int, int);
+ main()
+ {
+ exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
diff --git a/sys-libs/readline/files/readline-6.3-fix-long-prompt-vi-search.patch b/sys-libs/readline/files/readline-6.3-fix-long-prompt-vi-search.patch
new file mode 100644
index 000000000000..23d785054e75
--- /dev/null
+++ b/sys-libs/readline/files/readline-6.3-fix-long-prompt-vi-search.patch
@@ -0,0 +1,26 @@
+https://lists.gnu.org/archive/html/bug-bash/2014-08/msg00082.html
+
+From 2774192e93991e3d85ccc37c714aa018e442af6d Mon Sep 17 00:00:00 2001
+From: Dylan Cali <calid1984@gmail.com>
+Date: Sat, 23 Aug 2014 02:26:05 -0500
+Subject: [PATCH] fix vi search prompt bug for long prompts
+
+---
+ display.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/display.c b/display.c
+index 4df1f73..e575b16 100644
+--- a/display.c
++++ b/display.c
+@@ -2259,7 +2259,7 @@ rl_message (va_alist)
+ va_start (args);
+ format = va_arg (args, char *);
+ #endif
+- vsnprintf (msg_buf, msg_bufsiz - 1, format, args);
++ vsnprintf (msg_buf, msg_bufsiz, format, args);
+ }
+ #else
+ vsprintf (msg_buf, format, args);
+--
+1.7.10.4
diff --git a/sys-libs/readline/files/readline-6.3-read-eof.patch b/sys-libs/readline/files/readline-6.3-read-eof.patch
new file mode 100644
index 000000000000..f74aad63be1f
--- /dev/null
+++ b/sys-libs/readline/files/readline-6.3-read-eof.patch
@@ -0,0 +1,54 @@
+http://lists.gnu.org/archive/html/bug-bash/2014-12/msg00152.html
+
+*** ../bash-4.3-patched/lib/readline/readline.c 2014-10-01 13:08:28.000000000 -0400
+--- lib/readline/readline.c 2014-12-20 22:37:28.000000000 -0500
+***************
+*** 580,592 ****
+ }
+
+! /* EOF typed to a non-blank line is a <NL>. If we want to change this,
+! to force any existing line to be ignored when read(2) reads EOF,
+! for example, this is the place to change. */
+ if (c == EOF && rl_end)
+! c = NEWLINE;
+
+ /* The character _rl_eof_char typed to blank line, and not as the
+! previous character is interpreted as EOF. */
+! if (((c == _rl_eof_char && lastc != c) || c == EOF) && !rl_end)
+ {
+ #if defined (READLINE_CALLBACKS)
+--- 587,620 ----
+ }
+
+! /* EOF typed to a non-blank line is ^D the first time, EOF the second
+! time in a row. This won't return any partial line read from the tty.
+! If we want to change this, to force any existing line to be returned
+! when read(2) reads EOF, for example, this is the place to change. */
+ if (c == EOF && rl_end)
+! {
+! if (RL_SIG_RECEIVED ())
+! {
+! RL_CHECK_SIGNALS ();
+! if (rl_signal_event_hook)
+! (*rl_signal_event_hook) (); /* XXX */
+! }
+!
+! /* XXX - reading two consecutive EOFs returns EOF */
+! if (RL_ISSTATE (RL_STATE_TERMPREPPED))
+! {
+! if (lastc == _rl_eof_char || lastc == EOF)
+! rl_end = 0;
+! else
+! c = _rl_eof_char;
+! }
+! else
+! c = NEWLINE;
+! }
+
+ /* The character _rl_eof_char typed to blank line, and not as the
+! previous character is interpreted as EOF. This doesn't work when
+! READLINE_CALLBACKS is defined, so hitting a series of ^Ds will
+! erase all the chars on the line and then return EOF. */
+! if (((c == _rl_eof_char && lastc != c) || c == EOF) && rl_end == 0)
+ {
+ #if defined (READLINE_CALLBACKS)
diff --git a/sys-libs/readline/files/readline-7.0-headers.patch b/sys-libs/readline/files/readline-7.0-headers.patch
new file mode 100644
index 000000000000..dfe4e22ad1ae
--- /dev/null
+++ b/sys-libs/readline/files/readline-7.0-headers.patch
@@ -0,0 +1,24 @@
+From 4bc0aa68aff12a59628dd3c99a53360a9aa1ce93 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 11 Aug 2016 17:49:27 +0800
+Subject: [PATCH] include ctype.h for isdigit usage
+
+---
+ lib/readline/histexpand.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/readline/histexpand.c b/lib/readline/histexpand.c
+index 46a99aa62e30..13248db83048 100644
+--- a/lib/readline/histexpand.c
++++ b/lib/readline/histexpand.c
+@@ -26,6 +26,7 @@
+ #endif
+
+ #include <stdio.h>
++#include <ctype.h>
+
+ #if defined (HAVE_STDLIB_H)
+ # include <stdlib.h>
+--
+2.9.0
+
diff --git a/sys-libs/readline/files/readline-7.0-missing-echo-proto.patch b/sys-libs/readline/files/readline-7.0-missing-echo-proto.patch
new file mode 100644
index 000000000000..fe945be72530
--- /dev/null
+++ b/sys-libs/readline/files/readline-7.0-missing-echo-proto.patch
@@ -0,0 +1,14 @@
+https://lists.gnu.org/archive/html/bug-readline/2016-11/msg00000.html
+
+fix from upstream
+
+--- a/lib/readline/readline.h
++++ b/lib/readline/readline.h
+@@ -413,6 +413,7 @@
+ extern void rl_tty_set_default_bindings PARAMS((Keymap));
+ extern void rl_tty_unset_default_bindings PARAMS((Keymap));
+
++extern int rl_tty_set_echoing PARAMS((int));
+ extern int rl_reset_terminal PARAMS((const char *));
+ extern void rl_resize_terminal PARAMS((void));
+ extern void rl_set_screen_size PARAMS((int, int));
diff --git a/sys-libs/readline/metadata.xml b/sys-libs/readline/metadata.xml
new file mode 100644
index 000000000000..49d63436c4b4
--- /dev/null
+++ b/sys-libs/readline/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="utils">Install rlfe (ReadLine Front-End) helper tool -- a wrapper program for making any stdin use readline</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-libs/readline/readline-4.3_p5.ebuild b/sys-libs/readline/readline-4.3_p5.ebuild
new file mode 100644
index 000000000000..27cc5342b1bc
--- /dev/null
+++ b/sys-libs/readline/readline-4.3_p5.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# This version is just for the ABI .4 library
+
+EAPI="5"
+
+inherit eutils multilib-minimal flag-o-matic
+
+# Official patches
+# See ftp://ftp.cwru.edu/pub/bash/readline-4.3-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+ [[ ${PLEVEL} -eq 0 ]] && return 1
+ local opt=$1
+ eval set -- {1..${PLEVEL}}
+ set -- $(printf "${PN}${MY_PV/\.}-%03d " "$@")
+ if [[ ${opt} == -s ]] ; then
+ echo "${@/#/${DISTDIR}/}"
+ else
+ local u
+ for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${PN} ; do
+ printf "${u}/${PN}-${MY_PV}-patches/%s " "$@"
+ done
+ fi
+}
+
+DESCRIPTION="Another cute console display library"
+HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz $(patches)"
+
+LICENSE="GPL-2"
+SLOT="${PV:0:1}"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE=""
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2:0=[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+ # force ncurses linking #71420
+ sed -i -e 's:^SHLIB_LIBS=:SHLIB_LIBS=-lncurses:' support/shobj-conf || die "sed"
+}
+
+multilib_src_configure() {
+ append-cppflags -D_GNU_SOURCE
+ ECONF_SOURCE=${S} \
+ econf --with-curses --disable-static
+}
+
+multilib_src_compile() {
+ emake -C shlib
+}
+
+multilib_src_install() {
+ emake -C shlib DESTDIR="${D}" install
+ rm -f "${D}"/usr/lib*/*.so
+}
diff --git a/sys-libs/readline/readline-5.2_p14.ebuild b/sys-libs/readline/readline-5.2_p14.ebuild
new file mode 100644
index 000000000000..1b9d4fdd8656
--- /dev/null
+++ b/sys-libs/readline/readline-5.2_p14.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# This version is just for the ABI .5 library
+
+EAPI="5"
+
+inherit eutils multilib-minimal flag-o-matic
+
+# Official patches
+# See ftp://ftp.cwru.edu/pub/bash/readline-5.1-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+ [[ ${PLEVEL} -eq 0 ]] && return 1
+ local opt=$1
+ eval set -- {1..${PLEVEL}}
+ set -- $(printf "${PN}${MY_PV/\.}-%03d " "$@")
+ if [[ ${opt} == -s ]] ; then
+ echo "${@/#/${DISTDIR}/}"
+ else
+ local u
+ for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${PN} ; do
+ printf "${u}/${PN}-${MY_PV}-patches/%s " "$@"
+ done
+ fi
+}
+
+DESCRIPTION="Another cute console display library"
+HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz $(patches)"
+
+LICENSE="GPL-2"
+SLOT="${PV:0:1}"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2:0=[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+ epatch "${FILESDIR}"/${PN}-5.0-no_rpath.patch
+ # force ncurses linking #71420
+ sed -i -e 's:^SHLIB_LIBS=:SHLIB_LIBS=-lncurses:' support/shobj-conf || die "sed"
+}
+
+multilib_src_configure() {
+ append-cppflags -D_GNU_SOURCE
+ ECONF_SOURCE=${S} \
+ econf --with-curses --disable-static
+}
+
+multilib_src_compile() {
+ emake -C shlib
+}
+
+multilib_src_install() {
+ emake -C shlib DESTDIR="${D}" install
+ rm -f "${D}"/usr/lib*/*.so
+}
diff --git a/sys-libs/readline/readline-6.3_p8-r3.ebuild b/sys-libs/readline/readline-6.3_p8-r3.ebuild
new file mode 100644
index 000000000000..a4a3e6cfeb4b
--- /dev/null
+++ b/sys-libs/readline/readline-6.3_p8-r3.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs flag-o-matic multilib-minimal
+
+# Official patches
+# See ftp://ftp.cwru.edu/pub/bash/readline-6.3-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+ [[ ${PLEVEL} -eq 0 ]] && return 1
+ local opt=$1
+ eval set -- {1..${PLEVEL}}
+ set -- $(printf "${PN}${MY_PV/\.}-%03d " "$@")
+ if [[ ${opt} == -s ]] ; then
+ echo "${@/#/${DISTDIR}/}"
+ else
+ local u
+ for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${PN} ; do
+ printf "${u}/${PN}-${MY_PV}-patches/%s " "$@"
+ done
+ fi
+}
+
+DESCRIPTION="Another cute console display library"
+HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz $(patches)"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="static-libs utils"
+
+RDEPEND=">=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r7
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.0-no_rpath.patch
+ "${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch #385091
+ "${FILESDIR}"/${PN}-6.3-fix-long-prompt-vi-search.patch
+ "${FILESDIR}"/${PN}-6.3-read-eof.patch
+)
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+ epatch "${PATCHES[@]}"
+
+ # Force ncurses linking. #71420
+ # Use pkg-config to get the right values. #457558
+ local ncurses_libs=$($(tc-getPKG_CONFIG) ncurses --libs)
+ sed -i \
+ -e "/^SHLIB_LIBS=/s:=.*:='${ncurses_libs}':" \
+ support/shobj-conf || die
+ sed -i \
+ -e "/^[[:space:]]*LIBS=.-lncurses/s:-lncurses:${ncurses_libs}:" \
+ examples/rlfe/configure || die
+
+ # fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated
+ # objformat for years, so we don't want to rely on that.
+ sed -i -e '/objformat/s:if .*; then:if true; then:' support/shobj-conf || die
+
+ ln -s ../.. examples/rlfe/readline # for local readline headers
+}
+
+src_configure() {
+ # fix implicit decls with widechar funcs
+ append-cppflags -D_GNU_SOURCE
+ # https://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html
+ append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free
+
+ # Make sure configure picks a better ar than `ar`. #484866
+ export ac_cv_prog_AR=$(tc-getAR)
+
+ # Force the test since we used sed above to force it.
+ export bash_cv_termcap_lib=ncurses
+
+ # Control cross-compiling cases when we know the right answer.
+ # In cases where the C library doesn't support wide characters, readline
+ # itself won't work correctly, so forcing the answer below should be OK.
+ if tc-is-cross-compiler ; then
+ export bash_cv_func_sigsetjmp='present'
+ export bash_cv_func_ctype_nonascii='yes'
+ export bash_cv_wcwidth_broken='no' #503312
+ fi
+
+ # This is for rlfe, but we need to make sure LDFLAGS doesn't change
+ # so we can re-use the config cache file between the two.
+ append-ldflags -L.
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ --cache-file="${BUILD_DIR}"/config.cache \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ --with-curses \
+ $(use_enable static-libs static)
+
+ if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then
+ # code is full of AC_TRY_RUN()
+ mkdir -p examples/rlfe || die
+ cd examples/rlfe || die
+ ECONF_SOURCE=${S}/examples/rlfe \
+ econf --cache-file="${BUILD_DIR}"/config.cache
+ fi
+}
+
+multilib_src_compile() {
+ emake
+
+ if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then
+ # code is full of AC_TRY_RUN()
+ cd examples/rlfe || die
+ local l
+ for l in readline history ; do
+ ln -s ../../shlib/lib${l}$(get_libname)* lib${l}$(get_libname)
+ ln -sf ../../lib${l}.a lib${l}.a
+ done
+ emake
+ fi
+}
+
+multilib_src_install() {
+ default
+
+ if multilib_is_native_abi ; then
+ gen_usr_ldscript -a readline history #4411
+
+ if use utils && ! tc-is-cross-compiler; then
+ dobin examples/rlfe/rlfe
+ fi
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc USAGE
+ dohtml -r doc/.
+ docinto ps
+ dodoc doc/*.ps
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/lib{history,readline}.so.{4,5} #29865
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/lib{history,readline}.so.{4,5}
+}
diff --git a/sys-libs/readline/readline-7.0_p3.ebuild b/sys-libs/readline/readline-7.0_p3.ebuild
new file mode 100644
index 000000000000..2dbcb4b12cb5
--- /dev/null
+++ b/sys-libs/readline/readline-7.0_p3.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils multilib toolchain-funcs flag-o-matic multilib-minimal
+
+# Official patches
+# See ftp://ftp.cwru.edu/pub/bash/readline-7.0-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+ [[ ${PLEVEL} -eq 0 ]] && return 1
+ local opt=$1
+ eval set -- {1..${PLEVEL}}
+ set -- $(printf "${PN}${MY_PV/\.}-%03d " "$@")
+ if [[ ${opt} == -s ]] ; then
+ echo "${@/#/${DISTDIR}/}"
+ else
+ local u
+ for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${PN} ; do
+ printf "${u}/${PN}-${MY_PV}-patches/%s " "$@"
+ done
+ fi
+}
+
+DESCRIPTION="Another cute console display library"
+HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+case ${PV} in
+*_alpha*|*_beta*|*_rc*) SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" ;;
+*) SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz $(patches)" ;;
+esac
+
+LICENSE="GPL-3"
+SLOT="0/7" # subslot matches SONAME major
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="static-libs utils"
+
+RDEPEND=">=sys-libs/ncurses-5.9-r3:0=[static-libs?,${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+ epatch "${FILESDIR}"/${PN}-5.0-no_rpath.patch
+ epatch "${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch #385091
+ epatch "${FILESDIR}"/${PN}-7.0-headers.patch
+ epatch "${FILESDIR}"/${PN}-7.0-missing-echo-proto.patch
+
+ # Force ncurses linking. #71420
+ # Use pkg-config to get the right values. #457558
+ local ncurses_libs=$($(tc-getPKG_CONFIG) ncurses --libs)
+ sed -i \
+ -e "/^SHLIB_LIBS=/s:=.*:='${ncurses_libs}':" \
+ support/shobj-conf || die
+ sed -i \
+ -e "/^[[:space:]]*LIBS=.-lncurses/s:-lncurses:${ncurses_libs}:" \
+ examples/rlfe/configure || die
+
+ # fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated
+ # objformat for years, so we don't want to rely on that.
+ sed -i -e '/objformat/s:if .*; then:if true; then:' support/shobj-conf || die
+
+ ln -s ../.. examples/rlfe/readline # for local readline headers
+}
+
+src_configure() {
+ # fix implicit decls with widechar funcs
+ append-cppflags -D_GNU_SOURCE
+ # https://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html
+ append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free
+
+ # Make sure configure picks a better ar than `ar`. #484866
+ export ac_cv_prog_AR=$(tc-getAR)
+
+ # Force the test since we used sed above to force it.
+ export bash_cv_termcap_lib=ncurses
+
+ # Control cross-compiling cases when we know the right answer.
+ # In cases where the C library doesn't support wide characters, readline
+ # itself won't work correctly, so forcing the answer below should be OK.
+ if tc-is-cross-compiler ; then
+ export bash_cv_func_sigsetjmp='present'
+ export bash_cv_func_ctype_nonascii='yes'
+ export bash_cv_wcwidth_broken='no' #503312
+ fi
+
+ # This is for rlfe, but we need to make sure LDFLAGS doesn't change
+ # so we can re-use the config cache file between the two.
+ append-ldflags -L.
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ --cache-file="${BUILD_DIR}"/config.cache \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ --with-curses \
+ $(use_enable static-libs static)
+
+ if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then
+ # code is full of AC_TRY_RUN()
+ mkdir -p examples/rlfe || die
+ cd examples/rlfe || die
+ ECONF_SOURCE=${S}/examples/rlfe \
+ econf --cache-file="${BUILD_DIR}"/config.cache
+ fi
+}
+
+multilib_src_compile() {
+ emake
+
+ if use utils && multilib_is_native_abi && ! tc-is-cross-compiler ; then
+ # code is full of AC_TRY_RUN()
+ cd examples/rlfe || die
+ local l
+ for l in readline history ; do
+ ln -s ../../shlib/lib${l}$(get_libname)* lib${l}$(get_libname)
+ ln -sf ../../lib${l}.a lib${l}.a
+ done
+ emake
+ fi
+}
+
+multilib_src_install() {
+ default
+
+ if multilib_is_native_abi ; then
+ gen_usr_ldscript -a readline history #4411
+
+ if use utils && ! tc-is-cross-compiler; then
+ dobin examples/rlfe/rlfe
+ fi
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc USAGE
+ dohtml -r doc/.
+ docinto ps
+ dodoc doc/*.ps
+}
+pkg_preinst() {
+ # bug #29865
+ # Reappeared in #595324 with paludis so keeping this for now...
+ preserve_old_lib /$(get_libdir)/lib{history,readline}.so.{4,5,6}
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/lib{history,readline}.so.{4,5,6}
+}
diff --git a/sys-libs/rvm/Manifest b/sys-libs/rvm/Manifest
new file mode 100644
index 000000000000..baed1a874382
--- /dev/null
+++ b/sys-libs/rvm/Manifest
@@ -0,0 +1,7 @@
+DIST rvm-1.12.tar.gz 532869 SHA256 62de522fd70fc22ce87767e3a942e331d50fb696c43cf7e80349258f9787192c SHA512 34fedf1b6f87b2285417dc9f0ba2f203bd75f9a0fa2e8be280a36e27ab4aba4302b4a19cf7c373b93b22822a32f2104b956777f10b9a341107f66ac34fbab205 WHIRLPOOL 8e32698c56c865af54c2346885fdc3a52785b5cf7e097615fe8918023792f01a656ad6828211c696e4b3ed1ca5def6935c16448ceca10b347df87ef2ba1447ae
+DIST rvm-1.17.tar.gz 558574 SHA256 ae560ce39ba54b57b3fcb08d37ec9e525b0f97dbb816fadbbeaddf76d609c27d SHA512 31956541e1e254fe9ecf3310e43f7395c847bab87e57bffe6e4f678a0077a21d0fb6af90e9bd79c599fc7f66255cd25dc99f85439c9e827319ff2c8bff4feb5d WHIRLPOOL 1e29fc5c44f1ede31696e8cd8319b6c4213d6f54c21df2f4c7f0bada6ce2822f2725eabea0e02f057087269b1fc51f50723ff3b561048f48ef8503cf75023a79
+EBUILD rvm-1.12.ebuild 534 SHA256 e057ed8aa1e770e54192aa63da09318eaf2b024f1e61221e495da1f31e0be436 SHA512 7212feea8d3ded8a689f58e6a51ed1f733d1647d33dca16581b8cc8d31f99828aa1f2faef851240c9c32e3237fb164ee07913e8d70ddeeba5475930896b21aa5 WHIRLPOOL 3e546a6ca26f59d9e01260165d62e82bb97a6de5db2cc3ae2c3eac33fdcd40a67b1a9f6f937c2351cc8655f6ce5fa7b0ead609d556173f6288df4fcf5c109825
+EBUILD rvm-1.17-r1.ebuild 453 SHA256 e26d3de47cf221e9afdf3e8363236581f4ffcc656b11a7ef4c1e22c309b07361 SHA512 647207b1b4ff6bb8b0c82237caf1caadffbd4aeb307f0dc64c4bf554164b8b615bb2f5ad048877b9e0fa08d7e11a4c5a59fb56cbfaff16d71976cba1b92156f3 WHIRLPOOL a47a4c40a35c2c205eaec51f5bd9b2690918cd50a7de5c5461a1164e5fbb5ee8e512e092bfbae13196a53e44a4c814d4247f49b255cb362d1ae09b50111da2b3
+MISC ChangeLog 2993 SHA256 94ffc88e26247a228db63b1f5f0c7a4be775ad13424fa8992c9b0c09c673bf18 SHA512 3316376f6bf0758a9a943bff6a5df1e20eeaaaca7f92d61f19fe51e945120dd51108c9784b2a826f7cda39ec5239eb68b60c787c498848d5710cfd509d1c3916 WHIRLPOOL 8fc3e7ad715f5d34def5cbf47f7b64e3becffeeb1d291f4f7a0d196b0cecfa5080fe5470cacf62394ebca3848713185049e300e95e49ba31d4b583d97a9861e8
+MISC ChangeLog-2015 3741 SHA256 9beba86d6cb9c95f3649018ff29e075012976af440a50576151df8316dea70eb SHA512 73d1a7ce143a1b416f2466fcfc6dc22533282008a52fdc05905b45a079dcc83c58714f4529ffc21e0776951bf26f297d85f2d389490c7e3925cff999c0f7313e WHIRLPOOL e65100bed595b62faba5616f67a7f1b53c684d18a49aa182b0f3db49557be2afec2a323d88ba5f34c4e29f9f0f8359ad242c173749d514ec421054f56a3e0e75
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/sys-libs/rvm/metadata.xml b/sys-libs/rvm/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/sys-libs/rvm/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/sys-libs/rvm/rvm-1.12.ebuild b/sys-libs/rvm/rvm-1.12.ebuild
new file mode 100644
index 000000000000..2419d2d103f2
--- /dev/null
+++ b/sys-libs/rvm/rvm-1.12.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="Recoverable Virtual Memory (used by Coda)"
+HOMEPAGE="http://www.coda.cs.cmu.edu/"
+SRC_URI="http://www.coda.cs.cmu.edu/pub/rvm/src/${P}.tar.gz"
+IUSE=""
+SLOT="1"
+LICENSE="LGPL-2.1"
+KEYWORDS="~alpha ~amd64 ~hppa ia64 ~mips ~ppc ~sparc x86"
+
+DEPEND=">=sys-libs/lwp-2.0
+ sys-apps/grep
+ sys-devel/libtool
+ sys-devel/gcc"
+
+RDEPEND=">=sys-libs/lwp-2.0"
+
+src_install() {
+ make DESTDIR="${D}" install || die
+
+ dodoc NEWS
+}
diff --git a/sys-libs/rvm/rvm-1.17-r1.ebuild b/sys-libs/rvm/rvm-1.17-r1.ebuild
new file mode 100644
index 000000000000..155981310f56
--- /dev/null
+++ b/sys-libs/rvm/rvm-1.17-r1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Recoverable Virtual Memory (used by Coda)"
+HOMEPAGE="http://www.coda.cs.cmu.edu/"
+SRC_URI="http://www.coda.cs.cmu.edu/pub/rvm/src/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="1"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~sparc ~x86"
+IUSE=""
+
+RDEPEND=">=sys-libs/lwp-2.5"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( NEWS )
diff --git a/sys-libs/slang/Manifest b/sys-libs/slang/Manifest
new file mode 100644
index 000000000000..99bbe5d8945a
--- /dev/null
+++ b/sys-libs/slang/Manifest
@@ -0,0 +1,10 @@
+AUX slang-2.2.3-slsh-libs.patch 678 SHA256 820bb560dc76105756a0fa75661dd3cbf6fc6ecb7802dcbdb9fc4625de4ffb22 SHA512 62ce13a54178432463873e1f31e50bd47559ef0fff6c0a58497cfb908b055ea2f80d1af5d2c5bdafdf6e85e7c75d48bd0d39905977d1591e7559a285685a9b72 WHIRLPOOL 135fc5ea00fc3dcc7580753c5e9f02985762ecf758593728f273e8b252e3b86573ff50249cbb26d8da0678a7cd1fe965319e8bf9d7073c4158e57211c72bf707
+AUX slang-2.2.4-memset.patch 1054 SHA256 d389884d73811314a6dbdb6223a7241bca5abc97f8984eb4f238d327b30c1fad SHA512 ddbbd089c3d1128353951438fc527b6cc7e2268d5dc7384123fcf36dc198872a0cf229c850b3e6c1538807adaf3b426d3748f3ed2fd4b021080d5ebda30d56ee WHIRLPOOL b68492ca72f6ee35c28bde22fd87d8c33c85c47fcb820c9d17ec496301b7df46a4741e7baa9b3522b4142c9643a2942d8e619364039beba80cc9e59bb8131910
+AUX slang-2.3.1-slsh-libs.patch 761 SHA256 c4f48f04bbf4279f4f3de0708edc4dcf94e08e9b8936a349270ef4301514d5c3 SHA512 77516f0b0373a08fbf61765e4eb83cbfa91b29a58a41e0006d1041672c6107dc5a2410056d65dd64fe68de40e01c211feb9f748a8238473cd5c98dfe2125f7b2 WHIRLPOOL 98fb61a3090168ad8b45f1714d16b6847d451a1dda25066a6a73d2763e7a10d556c2f13f0fc0b9309dcfadadb0f20127c71c735e5553c53c0bb40a913f7f3f7e
+DIST slang-2.3.0.tar.bz2 1532986 SHA256 f95224060f45e0d8212a5039b339afa5f1a94a1bb0298e796104e5b12e926129 SHA512 0b04d916409c59f66301877c078bcca63c8b71e5dfa6c1d804353e41949bca16e664a79381c4156068b1f878c333e618f1de165e4059b09831fa83a794613050 WHIRLPOOL 395dc36d2f571ed19d88ee1f1c3594ab50d3a955949724d46582191430aa0c23cf3f78f966b184f3220ab86f2939e4601821160455159783793df30597c53257
+DIST slang-2.3.1a.tar.bz2 1577749 SHA256 54f0c3007fde918039c058965dffdfd6c5aec0bad0f4227192cc486021f08c36 SHA512 e7236a189081ebcbaf4e7f0506671226a4d46aede8826e1a558f1a2f57bcbe3ad58eadeabe2df99cd3d8bacb4c93749996bcbce4f51d338fc9396e0f945933e7 WHIRLPOOL 08ff5cf3e72e32a603f1f87f20767ef96a7cdb02579bde16e45478cb4350e4ad22d4a3ec39b367deb7048a65e25e9774184e2cddf5a01aa6c22317984283b8e9
+EBUILD slang-2.3.0.ebuild 2293 SHA256 100ac8948a2bd6750215a80ae3178675dd246cccad2e25e8f777396601e63bdc SHA512 6ec3a75d32f79cf003ef60ba2fb5bd269ef9414a846eea029babe27079720be3b50765d8d07f81cd0c346bf22dde7422094918ae0a598da757d47e44ff2bba6d WHIRLPOOL 6ba23f0316dd4a6f61b518dcc5a603906fd1ea360ad1b9b3d3c5f60451d99e476c67c7307e3aa9fa790b0240fbaebb89e923ae2f96afda85ad3127b905896050
+EBUILD slang-2.3.1a.ebuild 2291 SHA256 6474f2475544345ac0b49e4d37fc0c37c28bf026518a17bd2b9b3f67d379df5a SHA512 bf22bb6fa9a108380cdbb5a971124f140d56c10e3b777d438ce9e1e9f8acce67647d07226ebb4f8edd299ae7268e1b4a212d12c94d6b3684bfdd625ec79102c9 WHIRLPOOL 87940f195dddf51764155d1f71bae36cdd0c4e41d94c80623caf99975c4960ae45f29dd0e4c0518fcf480e12e087c9421da97988bd74b6b043cf2b559f1d02ef
+MISC ChangeLog 3810 SHA256 e292b094cb5ae45fd90056218e449e1ded36594a0961b79e52a8ea50fc9b029b SHA512 94fdab2071b7181ba919fb20a878f9a029cba23ad62ce17cb4712f36bd684049924e679556abb928290f2a2ca62eb2d6b0ed75ce1079180d7aa61f4af0a1ee48 WHIRLPOOL be2231385dc58a08d6fc4d0f36737b405141ef936af6bf2696716df3258ee8e72bbe8396d547995c35bf068d975bc8c46310063f7ec08a72217c4912e505d0fe
+MISC ChangeLog-2015 18580 SHA256 9d53f950ed48c7fedc2366ec68655c18009ad714b6b2b80c0a0d903be0a1982b SHA512 03dc0c0d481a94d5bae01ff9c753631a05c72ad4b0f8e7831739097ed5790bace751b1968f2650a8b6ab2d685862097bbe685515dd038e2b751c3537f904cb0f WHIRLPOOL 1c70afeda60c7c7af3a3fe4608bae3ef8cf1db87f890ee7cd3741c778d9eb7c97591d0e41f420c8b4ab272ae8d8380732d003f4c2ddc7f01f2b4ed8b4f288155
+MISC metadata.xml 234 SHA256 5ee3f7d7197cf269efebe240796a0484e0bd2da3cff78e63b87c32cb4297c175 SHA512 16ea852f76297335e7ef70c8019fe09d46c0455922c049ba6e92696232e957955fd671d467ebdd0bf7837d39a26083d5be2a6f8abeba53807f0b8c5b97f2e441 WHIRLPOOL a29087cfdc7418c4dfdeffc62f80a934a759de3f014f9599dc3be9a8292c4717165dc75c1a565b4dca34479115f4ae17ddb62aa6960e93ad71e12b4c26c8040d
diff --git a/sys-libs/slang/files/slang-2.2.3-slsh-libs.patch b/sys-libs/slang/files/slang-2.2.3-slsh-libs.patch
new file mode 100644
index 000000000000..2c999fb184d3
--- /dev/null
+++ b/sys-libs/slang/files/slang-2.2.3-slsh-libs.patch
@@ -0,0 +1,11 @@
+--- slsh/Makefile.in
++++ slsh/Makefile.in
+@@ -80,7 +80,7 @@
+ $(OBJDIR)/slsh_exe: $(OBJDIR)/slsh.o $(OBJDIR)/readline.o
+ $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh_exe $(LDFLAGS) $(SRC_LIBS)
+ $(OBJDIR)/slsh: $(OBJDIR)/slsh.o $(OBJDIR)/readline.o
+- $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh $(LDFLAGS) $(INST_LIBS)
++ $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh $(LDFLAGS) $(SRC_LIBS)
+ $(OBJDIR)/slsh.o: $(OBJDIR) slsh.c slsh.h config.h Makefile
+ cd $(OBJDIR) && $(CC) -c $(CFLAGS) $(SLANG_SRCINC) $(DEFS) $(SRCDIR)/slsh.c
+ $(OBJDIR)/readline.o: $(OBJDIR) readline.c slsh.h config.h Makefile
diff --git a/sys-libs/slang/files/slang-2.2.4-memset.patch b/sys-libs/slang/files/slang-2.2.4-memset.patch
new file mode 100644
index 000000000000..0be90fdc3091
--- /dev/null
+++ b/sys-libs/slang/files/slang-2.2.4-memset.patch
@@ -0,0 +1,32 @@
+From e06be392e42c23dd9bd7205445f3c5232ddb9ed7 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Tue, 19 Nov 2013 15:17:52 +0300
+Subject: [PATCH] modules/png-module.c: add declaration of 'memset'
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+ * QA Notice: Package triggers severe warnings which indicate that it
+ * may exhibit random runtime failures.
+ * /tmp/portage/sys-libs/slang-2.2.4/work/slang-2.2.4/modules/png-module.c:122:2: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default]
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ modules/png-module.c | 1 +
+ 3 files changed, 403 insertions(+), 259 deletions(-)
+
+diff --git a/modules/png-module.c b/modules/png-module.c
+index 92ede3d..fed9392 100644
+--- a/modules/png-module.c
++++ b/modules/png-module.c
+@@ -23,6 +23,7 @@ USA.
+ #include "config.h"
+
+ #include <stdio.h>
++#include <string.h> /* memset() */
+ #include <errno.h>
+ #include <slang.h>
+
+--
+1.8.4
+
diff --git a/sys-libs/slang/files/slang-2.3.1-slsh-libs.patch b/sys-libs/slang/files/slang-2.3.1-slsh-libs.patch
new file mode 100644
index 000000000000..b31d8a1c45dd
--- /dev/null
+++ b/sys-libs/slang/files/slang-2.3.1-slsh-libs.patch
@@ -0,0 +1,11 @@
+--- slang-2.3.1/slsh/Makefile.in
++++ slang-2.3.1/slsh/Makefile.in
+@@ -92,7 +92,7 @@
+ $(OBJDIR)/slsh_exe: $(OBJDIR)/slsh.o $(OBJDIR)/readline.o
+ $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh_exe $(LDFLAGS) $(DLINK_FLAGS) $(SRC_LIBS)
+ $(OBJDIR)/slsh: $(OBJDIR)/slsh.o $(OBJDIR)/readline.o
+- $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh $(LDFLAGS) $(DLINK_FLAGS) $(INST_LIBS)
++ $(CC) $(CFLAGS) $(OBJDIR)/slsh.o $(OBJDIR)/readline.o -o $(OBJDIR)/slsh $(LDFLAGS) $(DLINK_FLAGS) $(SRC_LIBS)
+ $(OBJDIR)/slsh.o: $(OBJDIR_TSTAMP) slsh.c slsh.h config.h Makefile
+ cd $(OBJDIR) && $(CC) $(SLANG_SRCINC) $(CFLAGS) -c $(DEFS) $(SRCDIR)/slsh.c
+ $(OBJDIR)/readline.o: $(OBJDIR_TSTAMP) readline.c slsh.h config.h Makefile
diff --git a/sys-libs/slang/metadata.xml b/sys-libs/slang/metadata.xml
new file mode 100644
index 000000000000..6f2ca22da233
--- /dev/null
+++ b/sys-libs/slang/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 type="project">
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/slang/slang-2.3.0.ebuild b/sys-libs/slang/slang-2.3.0.ebuild
new file mode 100644
index 000000000000..3589c61994eb
--- /dev/null
+++ b/sys-libs/slang/slang-2.3.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils multilib-minimal
+
+DESCRIPTION="A multi-platform programmer's library designed to allow a developer to create robust software"
+HOMEPAGE="http://www.jedsoft.org/slang/"
+SRC_URI="http://www.jedsoft.org/releases/${PN}/${P}.tar.bz2
+ http://www.jedsoft.org/releases/${PN}/old/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="cjk pcre png readline static-libs zlib"
+
+# ncurses for ncurses5-config to get terminfo directory
+RDEPEND="sys-libs/ncurses:0=
+ pcre? ( >=dev-libs/libpcre-8.33-r1[${MULTILIB_USEDEP}] )
+ png? ( >=media-libs/libpng-1.6.10:0[${MULTILIB_USEDEP}] )
+ cjk? ( >=dev-libs/oniguruma-5.9.5:=[${MULTILIB_USEDEP}] )
+ readline? ( >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}] )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r1
+ )"
+DEPEND="${RDEPEND}"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.2.3-slsh-libs.patch
+ epatch "${FILESDIR}"/${PN}-2.2.4-memset.patch
+
+ # avoid linking to -ltermcap race with some systems
+ sed -i -e '/^TERMCAP=/s:=.*:=:' configure || die
+ # we use the GNU linker also on Solaris
+ sed -i -e 's/-G -fPIC/-shared -fPIC/g' \
+ -e 's/-Wl,-h,/-Wl,-soname,/g' configure || die
+
+ # slang does not support configuration from another dir
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=slang
+ use readline && myconf=gnu
+
+ econf \
+ --with-readline=${myconf} \
+ $(use_with pcre) \
+ $(use_with cjk onig) \
+ $(use_with png) \
+ $(use_with zlib z)
+}
+
+multilib_src_compile() {
+ emake elf $(use static-libs && echo static)
+
+ pushd slsh >/dev/null
+ emake slsh
+ popd
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install $(use static-libs && echo install-static)
+}
+
+multilib_src_install_all() {
+ rm -rf "${ED}"/usr/share/doc/{slang,slsh}
+ dodoc NEWS README *.txt doc/{,internal,text}/*.txt
+ dohtml doc/slangdoc.html slsh/doc/html/*.html
+}
diff --git a/sys-libs/slang/slang-2.3.1a.ebuild b/sys-libs/slang/slang-2.3.1a.ebuild
new file mode 100644
index 000000000000..96347bb2b788
--- /dev/null
+++ b/sys-libs/slang/slang-2.3.1a.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils multilib-minimal
+
+DESCRIPTION="A multi-platform programmer's library designed to allow a developer to create robust software"
+HOMEPAGE="http://www.jedsoft.org/slang/"
+SRC_URI="http://www.jedsoft.org/releases/${PN}/${P}.tar.bz2
+ http://www.jedsoft.org/releases/${PN}/old/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="cjk pcre png readline static-libs zlib"
+
+# ncurses for ncurses5-config to get terminfo directory
+RDEPEND="sys-libs/ncurses:0=
+ pcre? ( >=dev-libs/libpcre-8.33-r1[${MULTILIB_USEDEP}] )
+ png? ( >=media-libs/libpng-1.6.10:0=[${MULTILIB_USEDEP}] )
+ cjk? ( >=dev-libs/oniguruma-5.9.5:=[${MULTILIB_USEDEP}] )
+ readline? ( >=sys-libs/readline-6.2_p5-r1:0=[${MULTILIB_USEDEP}] )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r1
+ )"
+DEPEND="${RDEPEND}"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.3.1-slsh-libs.patch
+)
+
+src_prepare() {
+ default
+
+ # avoid linking to -ltermcap race with some systems
+ sed -i -e '/^TERMCAP=/s:=.*:=:' configure || die
+ # we use the GNU linker also on Solaris
+ sed -i -e 's/-G -fPIC/-shared -fPIC/g' \
+ -e 's/-Wl,-h,/-Wl,-soname,/g' configure || die
+
+ # slang does not support configuration from another dir
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=slang
+ use readline && myconf=gnu
+
+ econf \
+ --with-readline=${myconf} \
+ $(use_with pcre) \
+ $(use_with cjk onig) \
+ $(use_with png) \
+ $(use_with zlib z)
+}
+
+multilib_src_compile() {
+ emake elf $(use static-libs && echo static)
+
+ pushd slsh >/dev/null
+ emake slsh
+ popd
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install $(use static-libs && echo install-static)
+}
+
+multilib_src_install_all() {
+ rm -r "${ED}"/usr/share/doc/{slang,slsh} || die
+ dodoc NEWS README *.txt doc/{,internal,text}/*.txt
+ docinto html
+ dodoc doc/slangdoc.html slsh/doc/html/*.html
+}
diff --git a/sys-libs/suacomp/Manifest b/sys-libs/suacomp/Manifest
new file mode 100644
index 000000000000..3713a37c8a2d
--- /dev/null
+++ b/sys-libs/suacomp/Manifest
@@ -0,0 +1,7 @@
+AUX suacomp-0.6.14-strtoll.patch 1456 SHA256 774318dfb6e7505362c03a240f38817bef7b28d59e562cb140579fba85fef2fb SHA512 603c49683d7cce6f6edc0b12a1aefddfffd0e9d3c57b34ae176fa94139d3b427bee5993f7d2cd35a575113a8c42becce8b49c4c334dc8cc8fe4902b49bf9cda3 WHIRLPOOL e21dea456f2017d7659d04a55ca329c09b07a5424d9987f6cd35599566a5cf91e8c42561026b426af29e97fedcc31ff87f5de1690b0785e7f5da37564c257f30
+DIST suacomp-0.6.14.tar.gz 36712 SHA256 453c64c9c6c7f255a14fa19250696e7f3acc3a72498340b76eb681eb648df1a2 SHA512 6e559059c18c1412611d837bf2f5fad08deaf9145464347f712fdb0cd4e0dfae1b7b46253ef086bd4c98cc1555111872b6b5af5272b77a88c767e9008143b7f1 WHIRLPOOL 2e95569a5884c382682ed9ddfb2516246a2898eba8a24a5d9365152b55440ca3d1909392009fdf0f4134a1476865e0a2c8284c555d5ccdf6fa84ee38f62a46d8
+EBUILD suacomp-0.6.14.ebuild 1319 SHA256 075c8500bae5c90ae1d4319457afeb6af31bd7615f8bba79cbcc323961d8d239 SHA512 0371812d7a64eb176e2095a278c2b73456587f5f47abe8d7c02846c44cb1d6ffaeaf129598a9717646c474a5611b49d0f2b2d5c340997d6e48f55242c2aee054 WHIRLPOOL c6056a20e1b48de82cd86e48da1c979355a74a3fb3466036c612502d760158e6924ae78bcc43eae1abd8754489970dd345b6008569ba42bf345fab5b63493b19
+EBUILD suacomp-9999.ebuild 1150 SHA256 a8b6d3ec16d2696ab946202cd6f39035d3a8928ddd4f56daafe3db4cafbd09a0 SHA512 51d3774eb0fe134150ff13b82629fb9be1debef49ce870eaf329cfbde3666c4289829ff1d3703a6ce8535f659383331047e8e255b1d30747c72909d40491db4f WHIRLPOOL ae8c80f4e137b93a5a15f209442f86d987d9aa3c46b36e5205d780623403e46f4284f0c8699e16a1fa49b100acc6221d32d2856d80e20794d1f26f26b09afa2a
+MISC ChangeLog 2867 SHA256 b33763dbd93b52a763dad17abed1750e19bd75fc1daa22a21bea252a5db537b2 SHA512 94a58bb0690b9fe3ba2b1e1e51d76ae5d3aacff797210e1d96e4481bfe898dea2ae1cd5bedd6bd7b3a0b94c87191c868e027beab5733ff0e2197a1c8ffb08bbe WHIRLPOOL b09b365f143bfcdd7c1f01f94f8c88bb1af9c3e98f9ad234dce98a43635c66f344aff42b9db01b5d6c8feba9f598d53380ec267753a68c5b80815ac5ed2dc4e1
+MISC ChangeLog-2015 2836 SHA256 26c7ab0f66bd4279e708559f66d6c257e740f79e000576f5b128fc3266787f1f SHA512 0d05b1be5b2dc8f6112cb062c87793a1f41ecf7744b750266a088a36a2975858e628eff9abca1014d84d19bf28feda70caf417e4f1e2369b254f9c8a0e462b91 WHIRLPOOL f10017fff04b63b0877b511abafe42f150c806b62618630f9cf3dae880ac287bb0b419ac8a0263b3d685179bc1adc548ab0bac7a6f39d3b32ff9f3958839bc0f
+MISC metadata.xml 548 SHA256 699d1ec8a88d76212f750f00d007b33d90137365e1d58f664483b25c381a8b44 SHA512 a7a233b0f745af85c510fa021dded0cf5d6c57845c1517451d6e939c2784453fda9413c450cb9e8160ac2cdfbb7a898f45733f6505b19102bcfe7c1d28b81b99 WHIRLPOOL 948bc1ca4e3e19b1ed2815a7b64ddd7e7782ba904dff9fa576813398d71750d843453930a1e651d044b6926e9a480491c922a2c6c439b31ef5dd13c7e6091127
diff --git a/sys-libs/suacomp/files/suacomp-0.6.14-strtoll.patch b/sys-libs/suacomp/files/suacomp-0.6.14-strtoll.patch
new file mode 100644
index 000000000000..16ee7f4e5c41
--- /dev/null
+++ b/sys-libs/suacomp/files/suacomp-0.6.14-strtoll.patch
@@ -0,0 +1,44 @@
+From a498772e5fe942eafe06ed62a00a21c4b99164b5 Mon Sep 17 00:00:00 2001
+From: David Holm <dholmster@gmail.com>
+Date: Fri, 14 Sep 2012 20:57:30 +0200
+Subject: [PATCH] Fixes build issues on SUA 6.0
+
+The prototypes for strto[u]ll.c in SUA 6.0 use C99 and are defined using (u_)quad_t. This will cause compilation to fail since there is a mismatch between stdlib.h and the implementation in suacomp. This change switches to the C99 definition and undefines strto[u]ll in case stdlib.h wants to map them to existing implementations.
+
+https://sourceforge.net/p/suacomp/tickets/1/
+---
+ strtoll.c | 3 ++-
+ strtoull.c | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/strtoll.c b/strtoll.c
+index 12f9886..c9e34b8 100644
+--- a/strtoll.c
++++ b/strtoll.c
+@@ -9,7 +9,8 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+
+-long long int strtoll(const char* nptr, char** endptr, int base) {
++#undef strtoll
++quad_t strtoll(const char* nptr, char** endptr, int base) {
+ long long int ret;
+ DT("enter: %p, %p, %d\n", nptr, endptr, base);
+
+diff --git a/strtoull.c b/strtoull.c
+index d0e0e67..622ee9b 100644
+--- a/strtoull.c
++++ b/strtoull.c
+@@ -9,7 +9,8 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+
+-long long int strtoull(const char* nptr, char** endptr, int base) {
++#undef strtoull
++u_quad_t strtoull(const char* nptr, char** endptr, int base) {
+ long long int ret;
+ DT("enter: %p, %p, %d\n", nptr, endptr, base);
+
+--
+1.7.6.1
+
diff --git a/sys-libs/suacomp/metadata.xml b/sys-libs/suacomp/metadata.xml
new file mode 100644
index 000000000000..0d95d5d4e805
--- /dev/null
+++ b/sys-libs/suacomp/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 type="person">
+ <email>haubi@gentoo.org</email>
+ <name>Michael Haubenwallner</name>
+ </maintainer>
+ <longdescription lang="en">
+ A small library, trying to overcome the problems occuring when building
+ (and using) gentoo-prefix on an interix based system. This has no use
+ on non-interix systems.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">suacomp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/suacomp/suacomp-0.6.14.ebuild b/sys-libs/suacomp/suacomp-0.6.14.ebuild
new file mode 100644
index 000000000000..be3cecaf4bfc
--- /dev/null
+++ b/sys-libs/suacomp/suacomp-0.6.14.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=3
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="library wrapping the interix lib-c to make it less buggy"
+HOMEPAGE="http://suacomp.sf.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BEER-WARE"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug"
+
+DEPEND=""
+RDEPEND=""
+
+get_opts() {
+ local shlibc=
+ local stlibc=
+
+ for dir in /usr/lib /usr/lib/x86; do
+ [[ -f ${dir}/libc.a ]] && stlibc=${dir}/libc.a
+
+ for name in libc.so.5.2 libc.so.3.5; do
+ [[ -f ${dir}/${name} ]] && { shlibc=${dir}/${name}; break; }
+ done
+
+ [[ -f ${shlibc} && -f ${stlibc} ]] && break
+ done
+
+ echo "SHARED_LIBC=${shlibc} STATIC_LIBC=${stlibc}"
+}
+
+pkg_setup() {
+ if use debug; then
+ append-flags -D_DEBUG -D_DEBUG_TRACE
+ fi
+}
+
+src_prepare() {
+ [[ ${CHOST} == *-interix6* ]] && epatch "${FILESDIR}"/${P}-strtoll.patch
+}
+
+src_compile() {
+ emake all CC=$(tc-getCC) $(get_opts) CFLAGS="${CFLAGS}" || die "emake failed"
+}
+
+src_install() {
+ emake install PREFIX="${EPREFIX}/usr" DESTDIR="${D}" $(get_opts) \
+ CFLAGS="${CFLAGS}" || die "emake install failed"
+}
+
+src_test() {
+ local v=
+
+ use debug && v="TEST_VERBOSE=1"
+ use debug && export SUACOMP_DEBUG_OUT=stderr
+
+ emake check $(get_opts) ${v} || die "emake check failed"
+}
diff --git a/sys-libs/suacomp/suacomp-9999.ebuild b/sys-libs/suacomp/suacomp-9999.ebuild
new file mode 100644
index 000000000000..c40821304da1
--- /dev/null
+++ b/sys-libs/suacomp/suacomp-9999.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit toolchain-funcs flag-o-matic git-2
+
+DESCRIPTION="library wrapping the interix lib-c to make it less buggy"
+HOMEPAGE="http://suacomp.sf.net"
+EGIT_REPO_URI="https://git.code.sf.net/p/suacomp/git"
+
+LICENSE="BEER-WARE"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug"
+
+DEPEND=""
+RDEPEND=""
+
+get_opts() {
+ local shlibc=
+ local stlibc=
+
+ for dir in /usr/lib /usr/lib/x86; do
+ [[ -f ${dir}/libc.a ]] && stlibc=${dir}/libc.a
+
+ for name in libc.so.5.2 libc.so.3.5; do
+ [[ -f ${dir}/${name} ]] && { shlibc=${dir}/${name}; break; }
+ done
+
+ [[ -f ${shlibc} && -f ${stlibc} ]] && break
+ done
+
+ echo "SHARED_LIBC=${shlibc} STATIC_LIBC=${stlibc}"
+}
+
+pkg_setup() {
+ if use debug; then
+ append-flags -D_DEBUG -D_DEBUG_TRACE
+ fi
+}
+
+src_compile() {
+ emake all CC=$(tc-getCC) $(get_opts) CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake install PREFIX="${EPREFIX}/usr" DESTDIR="${D}" $(get_opts) \
+ CFLAGS="${CFLAGS}"
+}
+
+src_test() {
+ local v=
+
+ use debug && v="TEST_VERBOSE=1"
+ use debug && export SUACOMP_DEBUG_OUT=stderr
+
+ emake check $(get_opts) ${v}
+}
diff --git a/sys-libs/system-config-base/Manifest b/sys-libs/system-config-base/Manifest
new file mode 100644
index 000000000000..832ab9bba7ad
--- /dev/null
+++ b/sys-libs/system-config-base/Manifest
@@ -0,0 +1,6 @@
+AUX 1-r1-pam-0.99.8.0-r2-compat.patch 365 SHA256 0f59607fcea7767b344fc49c94875c7f89f1b80a6fe7c71faa2e6a6e6654c326 SHA512 810d36519db977c3d43f17d7e8f744ce67b160e6e5465b3da1d298f3f793be9325befc1943176f0260979e16bed52d92ab428b3b7c177dbcb08e5ec873b8ed27 WHIRLPOOL dc79f15d258f86beb279811fad47f58cf0bfeda021f57539daf8a0008475ab7f3975a9297e28e3bdf775edd7634c70667d6ea2756c6b0a79f1aa5be02a3594b3
+AUX config-util 232 SHA256 4f10f27a970924ba9f636f2d5fdb4267c3ada93f7b4eee1bc3ad05c33406e76c SHA512 ff1ff0f0d64a31ca4f792c3d3155c8e0c0439f0afc36a4734d3cf7ab3256561455e4964b1d96aa4c6695e4fb4e556bda6ccfd8ff8938cbeb13c888221b58fda9 WHIRLPOOL 2c88ab81c3a265dfa1dcf79e9671b788300a21eb3954c6baa4c3e5f3f349a8b487aa9d2f818f2e51ac90b753ead870687102bf1b2885ebd3b2b3429a961c8a75
+EBUILD system-config-base-1-r1.ebuild 869 SHA256 e42ec18942bc1130811c2a1c4e5e4f55ecbc3392d01efc1e7382d4ed14e064b8 SHA512 1bf3d2b5efaff5745ae141aace92bb731214f4173f22144de360428abaab4aa5fc01b3b039eb000513262acfe4fddd2d70a3f00c2d1ed1ebe971d563b0385838 WHIRLPOOL 775f9fa307fdef203062de4ad47ec66ce4a514806a00dc9baa24391fc837d3faca930aeccde9f59621d2af479cf1a051a81dd4c1a23b47b799a65f66d2a4f8ad
+MISC ChangeLog 2651 SHA256 ac7ca1733f15da91778f764c1870ef575ecccd9c86ea251a27c4c88f84aab4c5 SHA512 d171c87b8b3758404d8666e63155a6b43a4b33dba830bb22914c0bd7d03614ccca05cbde821545d656990354813de5507017e1411536b6a1062bb293458fbf9e WHIRLPOOL 3d1c393938213c702e153877707185ca7b0f06fcb59bba9ceb6c8f82d55324de8f63119d7016b89cfd785b76055f21534362cef421fbf87b70c008c9c29cbf94
+MISC ChangeLog-2015 1451 SHA256 1e568ee00f987c87485ad164b8f7417e0455515541f2aa316906d029220f68a8 SHA512 f865626ac4b7e8045679c8f8db98201617d3a953d74978eb5439feb3abc58f5e554fcb30e695d272f64f2879d27457879db9fc1087842e91cd84f0692559044c WHIRLPOOL 467691c16c697409d7ee04f4a5c954d9ce00b500318d4f29c9363837c2b9c25fad53a861511dc59d888107c241705c034fcaa57687d4cbe0e5e2f78e09a9467c
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/sys-libs/system-config-base/files/1-r1-pam-0.99.8.0-r2-compat.patch b/sys-libs/system-config-base/files/1-r1-pam-0.99.8.0-r2-compat.patch
new file mode 100644
index 000000000000..821bc7e29f5e
--- /dev/null
+++ b/sys-libs/system-config-base/files/1-r1-pam-0.99.8.0-r2-compat.patch
@@ -0,0 +1,11 @@
+--- config-util.orig 2007-07-14 12:56:13.000000000 -0700
++++ config-util 2007-07-14 12:56:18.000000000 -0700
+@@ -1,8 +1,6 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+-auth sufficient pam_timestamp.so
+ auth include system-auth
+ account required pam_permit.so
+ session required pam_permit.so
+ session optional pam_xauth.so
+-session optional pam_timestamp.so
diff --git a/sys-libs/system-config-base/files/config-util b/sys-libs/system-config-base/files/config-util
new file mode 100644
index 000000000000..8e70d9aba1da
--- /dev/null
+++ b/sys-libs/system-config-base/files/config-util
@@ -0,0 +1,8 @@
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth sufficient pam_timestamp.so
+auth include system-auth
+account required pam_permit.so
+session required pam_permit.so
+session optional pam_xauth.so
+session optional pam_timestamp.so
diff --git a/sys-libs/system-config-base/metadata.xml b/sys-libs/system-config-base/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/sys-libs/system-config-base/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/sys-libs/system-config-base/system-config-base-1-r1.ebuild b/sys-libs/system-config-base/system-config-base-1-r1.ebuild
new file mode 100644
index 000000000000..e495de7519d3
--- /dev/null
+++ b/sys-libs/system-config-base/system-config-base-1-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils pam
+
+DESCRIPTION="system-config-* layout package"
+SRC_URI=""
+HOMEPAGE="https://www.gentoo.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="virtual/pam"
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${FILESDIR}"/config-util . || die "failed to copy config-util"
+ epatch "${FILESDIR}"/${PVR}-pam-0.99.8.0-r2-compat.patch
+}
+
+src_install() {
+ dopamd config-util
+}
+
+pkg_postinst() {
+ if [ "$(stat -c%a ${ROOT}etc/default/useradd)" != "644" ] ; then
+ echo
+ ewarn
+ ewarn "Your ${ROOT}etc/default/useradd file must be world-readable"
+ ewarn "for the system-config-* utilities to work properly."
+ ewarn "If you did not change them on purpose, consider running:"
+ ewarn
+ ewarn " chmod 0644 ${ROOT}etc/default/useradd"
+ echo
+ fi
+}
diff --git a/sys-libs/talloc/Manifest b/sys-libs/talloc/Manifest
new file mode 100644
index 000000000000..e8c74c6806b5
--- /dev/null
+++ b/sys-libs/talloc/Manifest
@@ -0,0 +1,9 @@
+DIST talloc-2.1.10.tar.gz 441645 SHA256 c985e94bebd6ec2f6af3d95dcc3fcb192a2ddb7781a021d70ee899e26221f619 SHA512 215e70056f37ade8f67c20ab2b79dcb40f071989ec908de81144f8a0160637bbdec9a94123dea73475ba42425415df4c1eb8c1986485a00e2e03323719a03ce3 WHIRLPOOL dd87d828d645e976dfba8464bc25daeb58de781cc826d43e4a953f47b975e1580139814724f315d8c2a181231e2abdc5e13764d3df7155d8eb2457b0ab1e1a4a
+DIST talloc-2.1.5.tar.gz 436193 SHA256 3833e750cf0b8c3439186cba38800cba9e26adfbce10ee98ba709c24eb1cdddd SHA512 b938d67fcf4c6618f1149b4ec665957a604e3b07ee26e96ed36d94312db8f56b50498f69f9a07782f7f10a25047604e32b0d1786e1051d5f36b696c2755f8741 WHIRLPOOL 4cbdd527fb1adfe09052b93b38227f6e01f8aa86920aa093b7aa9a0ca63ad03f1ddcc148c996c487c55b1ba6e681b185d1df0311ed388ef9a8e6ab35c4b111ab
+DIST talloc-2.1.9.tar.gz 440335 SHA256 f0aad4cb88a3322207c82136ddc07bed48a37c2c21f82962d6c5ccb422711062 SHA512 a8f051bb15aba769ca286acad0946605d0053b0d149b4da2e6ecc333345f3e603d13a7f062452ae0f165615a4170ebdd7f41fc1b46c7a360000d5308bc304cbb WHIRLPOOL 3ceb93836f7381737e7718278db648cba61d73fd0b4bed1db3715cd2f784df2d5b02ad20ac6c68e477d4717d11e29bd916feb569aa4f399f24ee922bbb86334e
+EBUILD talloc-2.1.10.ebuild 2437 SHA256 bd845979e0cb4baee6b13e2c66b70dd0dc94888cb9413bf1d8031281e29a01f7 SHA512 c5ea953fc332dfc1d9e968a45f437fadd43ae2e591fc2486753e1cbf43ebb7fa25549ef99c8c322a05be8edb504cdeb36f241e359cd392f6bb0d17a3db702972 WHIRLPOOL f9eabad77364ed38cb43a037a79b4158eaf61aecb5cb131ff4d718b5f8fd552c4d95a58b66f8f6e52b9c096aecd373e3245fec86469f4d432011265a094438ec
+EBUILD talloc-2.1.5.ebuild 2233 SHA256 37c6e640450331fbd7d21296e9812cb5debe1f062c28d5ffe9c13968927b921c SHA512 2dd70ea43f7a12c428a76b9b09416ef6ec5d0c48439ac6cdc20734cd1122685952ac34a183f7592c0b784aa0887a5bd8fbf6e9938801e0e0bbac128accef16b5 WHIRLPOOL 71efd7340c07375c65ec87c021ad22cef48bb981fd016feea4ff4591488c2dd13e3c67624b67df85a642650122895b6880307eac15bf7591be0b8e1fe6ade4c6
+EBUILD talloc-2.1.9.ebuild 2417 SHA256 20c663004306f093467281805dca7921456d9c07e7bdf971484d279ac8b8a3e4 SHA512 5b66620818c11cd306b822745bc3531eef6d70e155aa938bd1bfb9a1a9c1191b4a0e5f602e5b6b20815505b93b1105b29e86f12d548e4b34d0bb8552f018d699 WHIRLPOOL a0c0d18c40135aaaf0e5ba3257b2fa9e755bc346885e2f9f82e030695e951898881938c41a2f3b9f79da68e3570ffe85faf7ed3c3960e3abf304a984bb7e1bd6
+MISC ChangeLog 7292 SHA256 440310b0f2609ee065022e1be365a9071c78945b5f69b0f2aee1d38dc58057f5 SHA512 c721a4f4816c05e82c2c96c16e7a434f1959d9208ce07f5c70c7badce7ecc0eb4ca692c171b049545b09be51600bfda981529a1cfa52f1db4c32d4f9aa7380b5 WHIRLPOOL 7c3dfa9697077003ff0a649780ab6431c9cdb6efc9e3213878a4b26eae3456710ceda09962376f1e733a5f243165e0a27bb01d3d238f7ca51a69b12ba7856a28
+MISC ChangeLog-2015 11247 SHA256 6db1fb636ed8cf66d64b977a5151b5dff79f24575144c762107ba90b201036d8 SHA512 dc4f614e906b7b169bdf9a44e81ab5a4139c74d6ddc2a61683345fdd1f0718762ab837ed071311bfc1193e14f44abd0f7434d99e050cf9c496d468714a92d796 WHIRLPOOL 253f19a8968874b47ed4e0f11987c32317287f692c9db6c08e99e8da1987777944fc24eed520369014328a7d593b4944d9bdcd9a3aeeba1c83f61da362c5d4bd
+MISC metadata.xml 439 SHA256 1ada965eca76363431e96b05d3220a25d5100e9de31f189c5a07145760894cbd SHA512 e583aa7aa9a641067b3b38bf398ad6266980ee961e11d81b5d7c6d32cb8948879e27777a33a72376f79beca6f71aa79613db65049e6a1221922869239de9ccf3 WHIRLPOOL 14b29f433af8722d9a94f3b351f3ed46c85f32f7e6169586fc8d41239e1f1bd2f6bc8b657fd5ce4ad4facf14bbf25edf683d0f6f7aaa4d6b911d92cab24586ca
diff --git a/sys-libs/talloc/metadata.xml b/sys-libs/talloc/metadata.xml
new file mode 100644
index 000000000000..afa647617059
--- /dev/null
+++ b/sys-libs/talloc/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 type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba</name>
+ </maintainer>
+ <use>
+ <flag name="compat">Enable extra compatibility stuff</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/talloc/talloc-2.1.10.ebuild b/sys-libs/talloc/talloc-2.1.10.ebuild
new file mode 100644
index 000000000000..c2248eef4b60
--- /dev/null
+++ b/sys-libs/talloc/talloc-2.1.10.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit waf-utils python-single-r1 multilib multilib-minimal
+
+DESCRIPTION="Samba talloc library"
+HOMEPAGE="http://talloc.samba.org/"
+SRC_URI="http://samba.org/ftp/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3 LGPL-3+ LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~sparc-solaris ~x64-solaris"
+IUSE="compat +python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )
+ !!<sys-libs/talloc-2.0.5"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ dev-libs/libxslt
+ ${PYTHON_DEPS}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+RESTRICT="test"
+
+MULTILIB_WRAPPED_HEADERS=(
+ # python goes only for native
+ /usr/include/pytalloc.h
+)
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # what would you expect of waf? i won't even waste time trying.
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+
+ use compat && extra_opts+=( --enable-talloc-compat1 )
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_compile() {
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ # waf is stupid, and no, we can't fix the build-system, since it's provided
+ # as a brilliant binary blob thats decompressed on the fly
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libtalloc.2.0.5.dylib || die
+ if use python ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libpytalloc-util.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${D}"$(python_get_sitedir)/talloc.bundle || die
+ fi
+ fi
+}
diff --git a/sys-libs/talloc/talloc-2.1.5.ebuild b/sys-libs/talloc/talloc-2.1.5.ebuild
new file mode 100644
index 000000000000..94d826fd52c4
--- /dev/null
+++ b/sys-libs/talloc/talloc-2.1.5.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit waf-utils python-single-r1 multilib multilib-minimal
+
+DESCRIPTION="Samba talloc library"
+HOMEPAGE="http://talloc.samba.org/"
+SRC_URI="http://samba.org/ftp/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3 LGPL-3+ LGPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~sparc-solaris"
+IUSE="compat +python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )
+ !!<sys-libs/talloc-2.0.5"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ dev-libs/libxslt
+ ${PYTHON_DEPS}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+RESTRICT="test"
+
+MULTILIB_WRAPPED_HEADERS=(
+ # python goes only for native
+ /usr/include/pytalloc.h
+)
+
+src_prepare() {
+ # what would you expect of waf? i won't even waste time trying.
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+
+ use compat && extra_opts+=( --enable-talloc-compat1 )
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_compile() {
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ # waf is stupid, and no, we can't fix the build-system, since it's provided
+ # as a brilliant binary blob thats decompressed on the fly
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libtalloc.2.0.5.dylib || die
+ if use python ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libpytalloc-util.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${D}"$(python_get_sitedir)/talloc.bundle || die
+ fi
+ fi
+}
diff --git a/sys-libs/talloc/talloc-2.1.9.ebuild b/sys-libs/talloc/talloc-2.1.9.ebuild
new file mode 100644
index 000000000000..cd00e27a3d43
--- /dev/null
+++ b/sys-libs/talloc/talloc-2.1.9.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit waf-utils python-single-r1 multilib multilib-minimal
+
+DESCRIPTION="Samba talloc library"
+HOMEPAGE="http://talloc.samba.org/"
+SRC_URI="http://samba.org/ftp/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3 LGPL-3+ LGPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~sparc-solaris"
+IUSE="compat +python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )
+ !!<sys-libs/talloc-2.0.5"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ dev-libs/libxslt
+ ${PYTHON_DEPS}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+RESTRICT="test"
+
+MULTILIB_WRAPPED_HEADERS=(
+ # python goes only for native
+ /usr/include/pytalloc.h
+)
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # what would you expect of waf? i won't even waste time trying.
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+
+ use compat && extra_opts+=( --enable-talloc-compat1 )
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_compile() {
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ # waf is stupid, and no, we can't fix the build-system, since it's provided
+ # as a brilliant binary blob thats decompressed on the fly
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libtalloc.2.0.5.dylib || die
+ if use python ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libpytalloc-util.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${D}"$(python_get_sitedir)/talloc.bundle || die
+ fi
+ fi
+}
diff --git a/sys-libs/tapi/Manifest b/sys-libs/tapi/Manifest
new file mode 100644
index 000000000000..6fbb259020a0
--- /dev/null
+++ b/sys-libs/tapi/Manifest
@@ -0,0 +1,7 @@
+AUX tapi-1.30-allow-all-clients.patch 792 SHA256 1b8d4bb9de1a0e5dfd2e94662a8718c9ecd70246908ccc2f45ac12f3e3d8da1d SHA512 08116c81611554ab8c07176d89762016f12a18d9b38fa47a541abc7c94194007d0cc1067e15abf25479ef0c10708ef8d37ef3c9234dbaaa294c372018a283be7 WHIRLPOOL 3ab012c1ba6dd1ca6881a7bdf88d6bba929790cc622798a290e4ae46e80956322a1e12381f7887c35b63d2e4686d97ba8d0262ad1714879ceec174ba5cb4a7e9
+AUX tapi-1.30-llvm-config.patch 360 SHA256 5617c045e17cf2ec3f0d7b01d13dbd5ded0accc84107d903ea8dfd0012eb3a4f SHA512 77958e021478299c7aba6a38a861de5c7602ae70d97a3bb008f8d0a456afb303d445244a19a7043d555f7669fcbac3eaa924e93d3e1753479748e29b33c7a34e WHIRLPOOL 40d66fe6106b0245a02923d0efa3064da4102688658899d8bff16f4ffa7248518cca8a132734db5fdcdcdd82a1ae43a2ef601b108a838f54733107be3b9ea76f
+AUX tapi-1.30-llvm-new-error-api.patch 1714 SHA256 c8cfaccc519adeaa379571102548e8047d3cac28f1067a730d8611bba989bead SHA512 2fa31ea8ca320aeb78458c2ab88771ab7978da565dfe81aaaf22ff8d18c859379001dc226b4f4330b981e3c73195ef283af37a0db1142caaeb71052f6c3cf354 WHIRLPOOL 976c6d08273a4f4ff252a62cf14f5d72b366c18bccff3cbba85785e3ef7ae56f6289ce2d5af9a31850aec2379410e66c0a6726c7f5bed71bb1fbe7293dd82f65
+AUX tapi-1.30-llvm-out-of-tree.patch 368 SHA256 75a1ba1187e7df57e2c3dc574ee93bd6486721ad47ff69bd47f512d524d33627 SHA512 51d3fb6148dc42108f144e35d57000b5ade9ec792860bf0d14a4d5e15a677184293d761bc36e9ea81e541849e9815f3c9d5bffca2ce92f160ff75697e145ea9c WHIRLPOOL db3a8ac7877fd16ca44fa970c5709cadb1fad3f515e67d9e6487ff0bd3750489b0f07b5e23b817e0b8e25f93405d9f96c96cf2ee5c31473f70285bdd36cceb59
+DIST tapi-1.30.tar.gz 29071 SHA256 be2f3732c4ba7e9d78696fe43f0b31fa4963925ee6e4e5e11cc45603a83ff9a1 SHA512 fa495da150c6b6ff9e0bf667a9a06f0b932363297b75379fd59a5c728168a3ac103a656d1a59fa1b0c0012a18c9874439237bbf2a3c26f9bdf202b4d78e31520 WHIRLPOOL 966cfd8149ab9952858d1985c96039b2f21cccc6d415b557c860d307823ea323bf66cec03a1ab572e160ad21590fd2584ea9037a5c3d769b22aeaacc934fcfe2
+EBUILD tapi-1.30.ebuild 962 SHA256 9124ad8c129e1a666d055915f2a22538272517c283234412efea4e397bafb0c3 SHA512 edfd3a4f3277e517eb8fd09f4aa276d5ec5130b80296098dd906d3d5f0262302d7dc6c7857c5375de14a9f96a2ed04e4222e4f6275b824c4a1645cb070373e91 WHIRLPOOL 1ae6464751b51a39943e79c2276c0f4ea981af09e72406d526aaed5adce0b9ba6b998dbdceb7c08088458b5ddbc593d8e5d1973d36d91fde41fa4aada21a2f63
+MISC metadata.xml 247 SHA256 beb9a5395fe6fcde3c82e31b0cde4a75ea911efb59294b0419f76b71e4518366 SHA512 ae91bc559b2380b04af0bacbaf419deb042e9a9235c596c1afdbbb3933e59ba4f895c6e7ebf8fa4884702d5b39febedfdcce109ab912d6ef4f51b3696bc82c18 WHIRLPOOL b82c282b0539e6427a6d6dc1d6742794f922e0b6276dbc7acb805735d6654c79600eb6f650a9c1e36cd727a63d1f1655d728535082154a218c6fb40c01eb8fe0
diff --git a/sys-libs/tapi/files/tapi-1.30-allow-all-clients.patch b/sys-libs/tapi/files/tapi-1.30-allow-all-clients.patch
new file mode 100644
index 000000000000..98309132cf70
--- /dev/null
+++ b/sys-libs/tapi/files/tapi-1.30-allow-all-clients.patch
@@ -0,0 +1,17 @@
+libtapi is by default limited to be linked to binaries called ld only. When
+trying to link it into e.g. our ld64 we get:
+
+ld: cannot link directly with ${EPREFIX}/usr/lib/libtapi.dylib for architecture
+x86_64
+
+Drop that limitation in order to be able to use the library.
+
+--- libtapi-1.30/tools/libtapi/CMakeLists.txt.orig 2017-02-12 17:35:55.000000000 +0100
++++ libtapi-1.30/tools/libtapi/CMakeLists.txt 2017-02-12 17:36:17.000000000 +0100
+@@ -18,5 +18,5 @@
+
+ set_property(TARGET libtapi APPEND_STRING
+ PROPERTY
+- LINK_FLAGS " -current_version ${TAPI_VERSION_MAJOR}.${TAPI_VERSION_MINOR}.${TAPI_VERSION_PATCH} -compatibility_version 1 -allowable_client ld"
++ LINK_FLAGS " -current_version ${TAPI_VERSION_MAJOR}.${TAPI_VERSION_MINOR}.${TAPI_VERSION_PATCH} -compatibility_version 1"
+ )
diff --git a/sys-libs/tapi/files/tapi-1.30-llvm-config.patch b/sys-libs/tapi/files/tapi-1.30-llvm-config.patch
new file mode 100644
index 000000000000..ea5a462c025b
--- /dev/null
+++ b/sys-libs/tapi/files/tapi-1.30-llvm-config.patch
@@ -0,0 +1,11 @@
+--- libtapi-1.30/lib/Core/Symbol.cpp.orig 2017-02-11 21:51:53.000000000 +0100
++++ libtapi-1.30/lib/Core/Symbol.cpp 2017-02-11 21:52:00.000000000 +0100
+@@ -9,7 +9,7 @@
+
+ #include "tapi/Core/Symbol.h"
+ #include "tapi/Core/LLVM.h"
+-#include "llvm/Config/config.h"
++#include "llvm/Config/llvm-config.h"
+ #include "llvm/Support/raw_ostream.h"
+
+ #if HAVE_CXXABI_H
diff --git a/sys-libs/tapi/files/tapi-1.30-llvm-new-error-api.patch b/sys-libs/tapi/files/tapi-1.30-llvm-new-error-api.patch
new file mode 100644
index 000000000000..814ca30879a0
--- /dev/null
+++ b/sys-libs/tapi/files/tapi-1.30-llvm-new-error-api.patch
@@ -0,0 +1,65 @@
+--- libtapi-1.30/lib/Core/MachODylibReader.cpp.orig 2017-02-11 21:36:40.000000000 +0100
++++ libtapi-1.30/lib/Core/MachODylibReader.cpp 2017-02-11 21:48:25.000000000 +0100
+@@ -37,7 +37,11 @@
+ }
+
+ auto binaryOrErr = createBinary(bufferRef);
++#if LLVM_NEW_ERROR_API
++ if (binaryOrErr.takeError())
++#else
+ if (binaryOrErr.getError())
++#endif
+ return FileType::Invalid;
+
+ Binary &bin = *binaryOrErr.get();
+@@ -49,7 +53,11 @@
+ for (auto OI = UB->begin_objects(), OE = UB->end_objects(); OI != OE; ++OI) {
+ auto objOrErr = OI->getAsObjectFile();
+ // Ignore archives.
++#if LLVM_NEW_ERROR_API
++ if (objOrErr.takeError())
++#else
+ if (objOrErr.getError())
++#endif
+ continue;
+
+ auto &obj = *objOrErr.get();
+@@ -228,7 +236,11 @@
+ ? SymbolFlags::WeakReferenced
+ : SymbolFlags::None;
+ auto symbolName = symbol.getName();
++#if LLVM_NEW_ERROR_API
++ if (symbolName.takeError())
++#else
+ if (symbolName.getError())
++#endif
+ continue;
+
+ StringRef name;
+@@ -244,8 +256,14 @@
+ file->setPath(memBuffer.getBufferIdentifier());
+
+ auto binaryOrErr = createBinary(memBuffer);
++// no way to figure this out from the headers :-(
++#if LLVM_NEW_ERROR_API
++ if (auto ec = binaryOrErr.takeError()) {
++ file->setErrorCode(llvm::errorToErrorCode(std::move(ec)));
++#else
+ if (auto ec = binaryOrErr.getError()) {
+ file->setErrorCode(ec);
++#endif
+ return std::move(file);
+ }
+
+@@ -263,7 +281,11 @@
+ auto objOrErr = OI->getAsObjectFile();
+
+ // Ignore archives.
++#if LLVM_NEW_ERROR_API
++ if (objOrErr.takeError())
++#else
+ if (objOrErr.getError())
++#endif
+ continue;
+
+ auto &object = *objOrErr.get();
diff --git a/sys-libs/tapi/files/tapi-1.30-llvm-out-of-tree.patch b/sys-libs/tapi/files/tapi-1.30-llvm-out-of-tree.patch
new file mode 100644
index 000000000000..56386476994a
--- /dev/null
+++ b/sys-libs/tapi/files/tapi-1.30-llvm-out-of-tree.patch
@@ -0,0 +1,10 @@
+--- libtapi-1.30/CMakeLists.txt.orig 2017-02-11 21:04:56.000000000 +0100
++++ libtapi-1.30/CMakeLists.txt 2017-02-11 21:05:12.000000000 +0100
+@@ -34,6 +34,7 @@
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/tapi/Version.inc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/include/tapi/Version.inc)
+
++include(AddLLVM)
+ macro(add_tapi_library name)
+ cmake_parse_arguments(ARG
+ "SHARED"
diff --git a/sys-libs/tapi/metadata.xml b/sys-libs/tapi/metadata.xml
new file mode 100644
index 000000000000..0c982d881307
--- /dev/null
+++ b/sys-libs/tapi/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 type="project">
+ <email>prefix@gentoo.org</email>
+ <name>Gentoo Prefix</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/tapi/tapi-1.30.ebuild b/sys-libs/tapi/tapi-1.30.ebuild
new file mode 100644
index 000000000000..c3f24900a40f
--- /dev/null
+++ b/sys-libs/tapi/tapi-1.30.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils flag-o-matic
+
+DESCRIPTION="Text-based Application Programming Interface"
+HOMEPAGE="https://opensource.apple.com/source/tapi"
+SRC_URI="https://opensource.apple.com/tarballs/${PN}/${P}.tar.gz"
+S="${WORKDIR}/lib${P}"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~x64-macos ~x86-macos"
+
+DOCS=( Readme.md )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.30-llvm-out-of-tree.patch
+ "${FILESDIR}"/${PN}-1.30-llvm-new-error-api.patch
+ "${FILESDIR}"/${PN}-1.30-llvm-config.patch
+ "${FILESDIR}"/${PN}-1.30-allow-all-clients.patch
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_MODULE_PATH="${EPREFIX}/usr/lib/cmake/llvm;${EPREFIX}/usr/share/llvm/cmake"
+ )
+
+ # poor man's configure
+ [ -f "${EPREFIX}"/usr/include/llvm/Support/Error.h ] && \
+ append-cxxflags -DLLVM_NEW_ERROR_API=1
+
+ append-cxxflags -std=c++11
+ cmake-utils_src_configure
+}
diff --git a/sys-libs/tdb/Manifest b/sys-libs/tdb/Manifest
new file mode 100644
index 000000000000..ca476ec249a7
--- /dev/null
+++ b/sys-libs/tdb/Manifest
@@ -0,0 +1,11 @@
+DIST tdb-1.3.13.tar.gz 498002 SHA256 0db04678ae16a8150e0976f6958ee4db46aaef789b9d3e40dab53f0f6414b868 SHA512 d12382a2f75e56d62d151df3390b3ae41c7502d67582812ec6da30913b13feb7ee98572ab5ad5b5ed3bceb41666c3154855727cf5ce249ef583c033819c05f0f WHIRLPOOL 9e361d11c635625e13f0aa2525af742634247bda0bd5a470d2dbb265338f7745a258a839443cffc4cc0b5beaa27d21708da9b87147d3e4fd77ebbf21c97542a3
+DIST tdb-1.3.14.tar.gz 500877 SHA256 3a7d4bb79229460df530c7e1c7067ba9fb9d370aa61fff537fdc2bdf918acbe9 SHA512 776b736d5c61cb796e19731141a85606cbe90e09943d813e0b7bf45066656d4a92ba449d0116664f65b9d8e5729bde4526170bbb1b7b46fd7a2fac1508f3841b WHIRLPOOL f61d8eed1777ca4483691094ae8864752a8b1901c07274244c48c41b81d2f3fa58e313a1708a12e7b0f8d3223b34b4cd26f8c062958a1e3c98020eb57625ee34
+DIST tdb-1.3.15.tar.gz 502627 SHA256 b4a1bf3833601bd9f10aff363cb750860aef9ce5b4617989239923192f946728 SHA512 553246d5e7a7c22ea1b00962ac635d608f6d2344201862e796cad3b1a20610da1f5652ec9dbcb0187867fbd25f36247fcc34e9b4b2c3488c15d7202c9fb13bbb WHIRLPOOL 23016ccb0ca79ac526086de4eaa97f8736bb3a2619047b3674c8659083c0780bcc76deb0e429c0685c9c3bde8132ec6b3406a665e1dc61fc133688f55d777b09
+DIST tdb-1.3.8.tar.gz 494106 SHA256 0605ac0427eac9c23bf61ebfd8206a07d5ece198498eab1769cd0cfb6e7de6b1 SHA512 9a7040206bbaae419a296714fe14fcbd3b67c0cef2b0f33563d52336aac2fe814049f5136a148fb049a273bb36fe81e3d777df58869c93f45d6e42b4adf9970b WHIRLPOOL 61070a71aba9b44d5141844ffac6b4657ddc938850934fe00ff7312d9f76e1c318e37764b60fbac255ff5b8dc8d8226f668f80315fccdc67550eeb9bd1c4bc25
+EBUILD tdb-1.3.13.ebuild 1343 SHA256 50e4885c97e2eac263ab56bd519a187d7a53d0de73e2b34bcfd455fd09cf56ef SHA512 5bdf225b005d2e1490b54b10abaecff466467b58832f9fd0651bdaf9d600c77988270792feeb1d4ec73528962784a85d399eb26d5daed50c218ebb885c6a2473 WHIRLPOOL e914df35a95508d68610e12a1a2418a4d66f98b94a8303f9a70de839afa0c3011608355a0a7162137164448c0a7931d2629c03b36ffb4cea9a6af42f943a67ef
+EBUILD tdb-1.3.14.ebuild 1350 SHA256 52b380613d26231ef1484164d9e813c8674b98cbd391a93d7e6778f83ab1c62d SHA512 4eec0eff750748e4d8e5b6f35559638d64c84b1f665070bf49cb509a1ecde1a303f0c7e6859a287e1ad5d0dc1fe1126d472915de94bdf50ce1532f5aa95520e1 WHIRLPOOL 15848370464e921b8faab7a81940dc837407636b4416d5a41e844d44b26de63211ff005cfb4a51ee06986da0b475aa5a2db833611fbc1e11984ca20c02a0cff4
+EBUILD tdb-1.3.15.ebuild 1350 SHA256 52b380613d26231ef1484164d9e813c8674b98cbd391a93d7e6778f83ab1c62d SHA512 4eec0eff750748e4d8e5b6f35559638d64c84b1f665070bf49cb509a1ecde1a303f0c7e6859a287e1ad5d0dc1fe1126d472915de94bdf50ce1532f5aa95520e1 WHIRLPOOL 15848370464e921b8faab7a81940dc837407636b4416d5a41e844d44b26de63211ff005cfb4a51ee06986da0b475aa5a2db833611fbc1e11984ca20c02a0cff4
+EBUILD tdb-1.3.8.ebuild 1339 SHA256 15695a580027b5dfae65efbebefcbd68cfeac3617f5289554696345d8893e258 SHA512 d92c9a6976e6e89140e864e2a55108df593064054de209b9c6fc0d30032fc9febc06d90602c48c4dacc50f73072dd6ec37244f7d8c3c857aa7f4ee1d0302812b WHIRLPOOL 1e602897f3cd213242c9820444338f08a3526873ccbb2e8f1cfee95bf8adeca104ddd7ff5e2417238a0c65c6c3c12834e2f028d302e725a8141acdb22c8bc34d
+MISC ChangeLog 6227 SHA256 c0715432ee52890e72d6e64e242115db759a5d22b79629ecbe81c72c5ccd39a3 SHA512 c38dddd45bf17b246bd5870ca7b429b1b301c82f689ffa4d6d8eb594abd9d805f55c28e1d43bebbfc79af2a5e5c4ae53c7d6e85c3b9f0599463e89d95c890d6f WHIRLPOOL be7660191255b72cd109f02cb294f11380beae86bc589236261708b8ec644d2561b1ad4816da39edbc8561cd6485033338172b8f2a6568ca6fee2573f61313ee
+MISC ChangeLog-2015 10789 SHA256 1bb910d8c68511c73b356cc9e77591fa92bcade8e8547b3828ff8251e9902cc1 SHA512 65da20134221c0588c7b772dbac6170c101ec2d9386569052af14da87a57e226b66f2353510b0fda6fb870ae3aa12ccf006730bd2b0346b4bbef2fe1db561b80 WHIRLPOOL 7b3a8814bbe259d8cd4b0978f9c8f5b066f98918c98838dfa4739703a5af6edda6217854e0ef3943941e6e00544913b11285f2503fbf5b6eb84d4375f1e06b5c
+MISC metadata.xml 356 SHA256 0990f052548eb3a00ce43438f8753a35456ea27c1d3da699f00b12e66a5039cd SHA512 59095952e57315232ef95494f2c30f520f13538f279df25f17a923a836194c4df78e11a03ff6fab814c1db1fe5a81cae2cf20988d77ef30e0c0d47f9a74f01cb WHIRLPOOL 3460b24cad2050d51f7196967aba58b491cce004285b5fb41ec7d879e7fff5551dad15ec4ec797567383e906f5fde716f55945ed81f9b16624636b92caaa833d
diff --git a/sys-libs/tdb/metadata.xml b/sys-libs/tdb/metadata.xml
new file mode 100644
index 000000000000..f0c4a5fed2f9
--- /dev/null
+++ b/sys-libs/tdb/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 type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+<maintainer type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/tdb/tdb-1.3.13.ebuild b/sys-libs/tdb/tdb-1.3.13.ebuild
new file mode 100644
index 000000000000..d9c460341885
--- /dev/null
+++ b/sys-libs/tdb/tdb-1.3.13.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit waf-utils multilib-minimal python-single-r1
+
+DESCRIPTION="A simple database API"
+HOMEPAGE="http://tdb.samba.org/"
+SRC_URI="http://samba.org/ftp/tdb/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="
+ ${RDEPEND}
+ ${PYTHON_DEPS}
+ app-text/docbook-xml-dtd:4.2"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+src_prepare() {
+ default
+ python_fix_shebang .
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_test() {
+ # the default src_test runs 'make test' and 'make check', letting
+ # the tests fail occasionally (reason: unknown)
+ emake check
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+}
diff --git a/sys-libs/tdb/tdb-1.3.14.ebuild b/sys-libs/tdb/tdb-1.3.14.ebuild
new file mode 100644
index 000000000000..f8680ddfe64f
--- /dev/null
+++ b/sys-libs/tdb/tdb-1.3.14.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit waf-utils multilib-minimal python-single-r1
+
+DESCRIPTION="A simple database API"
+HOMEPAGE="http://tdb.samba.org/"
+SRC_URI="http://samba.org/ftp/tdb/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="
+ ${RDEPEND}
+ ${PYTHON_DEPS}
+ app-text/docbook-xml-dtd:4.2"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+src_prepare() {
+ default
+ python_fix_shebang .
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_test() {
+ # the default src_test runs 'make test' and 'make check', letting
+ # the tests fail occasionally (reason: unknown)
+ emake check
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+}
diff --git a/sys-libs/tdb/tdb-1.3.15.ebuild b/sys-libs/tdb/tdb-1.3.15.ebuild
new file mode 100644
index 000000000000..f8680ddfe64f
--- /dev/null
+++ b/sys-libs/tdb/tdb-1.3.15.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit waf-utils multilib-minimal python-single-r1
+
+DESCRIPTION="A simple database API"
+HOMEPAGE="http://tdb.samba.org/"
+SRC_URI="http://samba.org/ftp/tdb/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="
+ ${RDEPEND}
+ ${PYTHON_DEPS}
+ app-text/docbook-xml-dtd:4.2"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+src_prepare() {
+ default
+ python_fix_shebang .
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_test() {
+ # the default src_test runs 'make test' and 'make check', letting
+ # the tests fail occasionally (reason: unknown)
+ emake check
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+}
diff --git a/sys-libs/tdb/tdb-1.3.8.ebuild b/sys-libs/tdb/tdb-1.3.8.ebuild
new file mode 100644
index 000000000000..e8ae7dcd463c
--- /dev/null
+++ b/sys-libs/tdb/tdb-1.3.8.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit waf-utils multilib-minimal python-single-r1 eutils
+
+DESCRIPTION="A simple database API"
+HOMEPAGE="http://tdb.samba.org/"
+SRC_URI="http://samba.org/ftp/tdb/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="
+ ${RDEPEND}
+ ${PYTHON_DEPS}
+ app-text/docbook-xml-dtd:4.2"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+src_prepare() {
+ python_fix_shebang .
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local extra_opts=()
+ if ! multilib_is_native_abi || ! use python; then
+ extra_opts+=( --disable-python )
+ fi
+
+ waf-utils_src_configure \
+ "${extra_opts[@]}"
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_test() {
+ # the default src_test runs 'make test' and 'make check', letting
+ # the tests fail occasionally (reason: unknown)
+ emake check
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+}
diff --git a/sys-libs/tevent/Manifest b/sys-libs/tevent/Manifest
new file mode 100644
index 000000000000..dca560fd9cdf
--- /dev/null
+++ b/sys-libs/tevent/Manifest
@@ -0,0 +1,12 @@
+AUX talloc-disable-python.patch 1706 SHA256 005dabcd79697577ea3ad0c5e65c0c0511492ba925c2af87b655acb91fbdcb2d SHA512 ac0bf82e8ed8b918a5efbdeb0a6cbaaef22bb72231abb09026637d62b8ce35b25212960d26c07abe63661328ab7ea8a82590cd93f04de583e23239211daf6efa WHIRLPOOL 9b18876c86af3d9211c87137ba628b0bb4f0b69cd961eb75b9ed1de461d9a157c75fc7605cba63f5024544d3bbb7270027894074a3d8cec03d99456153d1e9fb
+DIST tevent-0.9.28.tar.gz 581522 SHA256 04d953379025b1560af5c4ffcce58a3ee84db7aaa09c9f1e3eff5b2945a13529 SHA512 328d586a5891796a731e6f0d02e1a731d3541a977c16abca355359cd7f60bbdbb0baaad49c05eb42c3a44f97e57a775605974d22d46ca6c26f283c8ca1b5a909 WHIRLPOOL 3a572a1c73d564b535b15fca06a1df1ba124cac031026a1cabcbc66e38cac374eb8dad05a25372ab66982ff3c772ed63e890b62545dcce926fa782fe5fc21147
+DIST tevent-0.9.31.tar.gz 587784 SHA256 4a13f2256ad804c860e84068258bd0f8be31cf0c79aa8f3019fa32f6928c2bfc SHA512 048e37a7f5d3b8e948215fdb909c9b6e94b915c9d4978a8e18c73c9d27d5b1f179c10d19ec90325f8250e7c177c28231ad116a2975caaa43312c383e75517258 WHIRLPOOL 44061dd68b284bcaef625a70769f472ff1f2bd509843f8da9aca3c7b5affa12a825d3df49f126edc2d883bc0b1ad10eb59fba75ad80b1db12c92aeb100701fcd
+DIST tevent-0.9.32.tar.gz 590314 SHA256 d316e1438ffbb588a0afc90b748499dead25884ef275664fdca0df2793b62f8b SHA512 9bd256c245d9f82dcd5b31787c8b11780b958bef96426de231f54eaea6df680a5cf3eb8c8d066d05f271e81f303404fc4191a23a6bc2533b7d1b732b2c206fbd WHIRLPOOL 9fc88d9e946eaa3c3bd50c538b48e1f4a29e1cab8d81f7ddc81aec43b088cb931592cbf0d3cdd44c4bb0b787a7d144cf518a9b3f5e67208627aac3b7f19258e0
+DIST tevent-0.9.33.tar.gz 590611 SHA256 22712ee981fd4298fcd5f3afb27d87a72257cebad37812cfbd3da5d968ed1bdc SHA512 3a437957859a556e06f24334301c41a3db1433c1e90d651fa74585a638a36d71369f235a8ab51aa0dd8f9d9bb88ad42f2c3ddeba0b99c4234c63866a8c922b91 WHIRLPOOL a9c667998e40fe58349c31e543f8b665fda8b78972a8c7ba7e7b77557a597498146288a26f0cb5d1590c5706b2f957d028624c7639c0e8c8063e7a17595f3924
+EBUILD tevent-0.9.28.ebuild 1302 SHA256 ff37d39eaa022b984f0ca969fc10eec3b1881fa9efc91ff43cf8312478eb4897 SHA512 315dc482949811050fd8560bd235964fd6193307e682d18bfad190bb912a2197f922ef710d52846e723c3fc374c84655ede7674d3b11431fc563f452be0fdbed WHIRLPOOL 30deb768179c382c5ce4634451432e57ea1b0d1a1d37eb155ab0af2a1c533a21c7ef7e0bdc40a1ae4d35b33f538c3aee56632db39e674ddbcf4e1e8847852084
+EBUILD tevent-0.9.31-r1.ebuild 1383 SHA256 fd76bf06542f556a4194db9a6566a5bc90a5dfc0300e3241fcb33b28f890d89f SHA512 c812a9c263b81f202b04b737c479c5d7017688bdc1a4607cdac4c7e97af09cf7d637675ebe80867c9a1e2f109f1d749792a2c2cdbf1a50469a7340f5b28a3ba4 WHIRLPOOL 52a7b4c889a08fb171461631d03b5d3642c2cc06d69b701ce46dbff30a954c2cc691b5ede8d79ea22d5afee64b652192538c1777e98eb31d1b9993696297489c
+EBUILD tevent-0.9.32.ebuild 1390 SHA256 4365cc37a7aeb6071e82c1307b584694f70cbf7fe732d3fdc6a06615b54bb3a5 SHA512 68c9cd7dbf61473392ef842401d1b37ea27b084a62f5b253f1306d437baa3e5670374f501279abcc30897f8f4ba595df0c9951b33b37112572904b6a8c40d7f0 WHIRLPOOL b5fed4b3c776ff556fd67c5b8372eb6c2e3221106e7756010180fd8e8c0cbca35822ff96c05e5a31bd3bb2a696bb621ca1bdbee8ded40fa1aee1907bd110f82e
+EBUILD tevent-0.9.33.ebuild 1505 SHA256 850caa039c04a4461681a584d81c93dae0e876eef9a0860dab9f3b94d6360d78 SHA512 49965b65db3a525cb499da84d50eb4ff829093dad1c091f10963c9fb9a9a526865178b523074bb8e6b1482093eb1fa4a80b7d04ba47c456dc48f811254c9c5e6 WHIRLPOOL cf0a055d8db8dd6bef9b02d77dcebc8cc3b4883f311342ec521e7001592c94107b47e003fed02e2fb52299e1d2d8b91ca97432343c72b5ae1949d754c91eeeaa
+MISC ChangeLog 8683 SHA256 39fc7823f0d47480f3ca9d9e98d00e35ac151974c0c1e2a039e4a43746f0bf0a SHA512 586fae5bc9ef6374f4f30e5928fcf811f9c89df34821d2fad7c9079826e73e3db58cb3fbe884b7a304c7b2f8200900d6249b11cb4e66696ad0bf60ab70cca6f6 WHIRLPOOL 0bfea78894dd081025f6860bd596337801c10c6559c6daee1459ec8040af8f8c10ef46c0d10a358fbe412c877c2b7d88076b308e77ef4898f750559911c837ef
+MISC ChangeLog-2015 10241 SHA256 6f65e7a41ae0bf207c61dbee4eedd31191630d70d0b2beb45defa40ba4055ef6 SHA512 0be650b5a21ca7e3499698fc2224119de5808ad39da142b46edc353c5646fe8c122d21daf6042e2c7d82a8c530c5d0270157f6df3029af1feef8871849910542 WHIRLPOOL 5adab9b456fc51b45b5ae8e8f28800dafee1b11f869a751148345915533edd91a7268e5405cc2312c5f04d96ce3db39613932aff5c4d747d61f01d6ea12fb663
+MISC metadata.xml 345 SHA256 c71a19f7b21e012e46ed9e3c5f48a7f8345678680907434bd2e708ff48d69401 SHA512 35515a1369eeb1e4949415f8571fc54e7546ac83a59b506e04dc795f0a9b4cb06d7c8e1785577c20ca398fd87543f1742d9d4267fc09320503835bad1fc36cf5 WHIRLPOOL 0dc86f0d823c4f4b58ea7d623c27cd1f1985acb35ab891f32e3a7cf0bc307f029e6e94ab4f7385e44d13664b49bf4f0876b2447b45e8132a881dcaf45d4c063f
diff --git a/sys-libs/tevent/files/talloc-disable-python.patch b/sys-libs/tevent/files/talloc-disable-python.patch
new file mode 100644
index 000000000000..6ef45eb37fb8
--- /dev/null
+++ b/sys-libs/tevent/files/talloc-disable-python.patch
@@ -0,0 +1,34 @@
+--- a/lib/talloc/wscript 2017-04-28 04:57:26.000000000 -0400
++++ b/lib/talloc/wscript 2017-07-05 14:30:42.700580464 -0400
+@@ -74,19 +74,22 @@
+ implied_deps='replace'):
+ conf.define('USING_SYSTEM_TALLOC', 1)
+
+- using_system_pytalloc_util = True
+- if not conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+- implied_deps='talloc replace'):
++ if conf.env.disable_python:
+ using_system_pytalloc_util = False
+-
+- # We need to get a pytalloc-util for all the python versions
+- # we are building for
+- if conf.env['EXTRA_PYTHON']:
+- name = 'pytalloc-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
+- if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
++ else:
++ using_system_pytalloc_util = True
++ if not conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+ implied_deps='talloc replace'):
+ using_system_pytalloc_util = False
+
++ # We need to get a pytalloc-util for all the python versions
++ # we are building for
++ if conf.env['EXTRA_PYTHON']:
++ name = 'pytalloc-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
++ if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
++ implied_deps='talloc replace'):
++ using_system_pytalloc_util = False
++
+ if using_system_pytalloc_util:
+ conf.define('USING_SYSTEM_PYTALLOC_UTIL', 1)
+
diff --git a/sys-libs/tevent/metadata.xml b/sys-libs/tevent/metadata.xml
new file mode 100644
index 000000000000..00dd5f380b4d
--- /dev/null
+++ b/sys-libs/tevent/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 type="person">
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+<maintainer type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/tevent/tevent-0.9.28.ebuild b/sys-libs/tevent/tevent-0.9.28.ebuild
new file mode 100644
index 000000000000..6c44b788dd57
--- /dev/null
+++ b/sys-libs/tevent/tevent-0.9.28.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit waf-utils multilib-minimal python-single-r1
+
+DESCRIPTION="Samba tevent library"
+HOMEPAGE="http://tevent.samba.org/"
+SRC_URI="http://samba.org/ftp/tevent/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="python"
+
+RDEPEND=">=sys-libs/talloc-2.1.5[${MULTILIB_USEDEP}]
+ python? ( ${PYTHON_DEPS} )"
+
+DEPEND="${RDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+ ${PYTHON_DEPS}
+"
+# build system does not work with python3
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ waf-utils_src_configure \
+ $(multilib_native_usex python '' '--disable-python')
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ multilib_is_native_abi && use python && python_domodule tevent.py
+}
diff --git a/sys-libs/tevent/tevent-0.9.31-r1.ebuild b/sys-libs/tevent/tevent-0.9.31-r1.ebuild
new file mode 100644
index 000000000000..ed6a8c067eb2
--- /dev/null
+++ b/sys-libs/tevent/tevent-0.9.31-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit waf-utils multilib-minimal python-single-r1
+
+DESCRIPTION="Samba tevent library"
+HOMEPAGE="http://tevent.samba.org/"
+SRC_URI="http://samba.org/ftp/tevent/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="python"
+
+RDEPEND=">=sys-libs/talloc-2.1.8[${MULTILIB_USEDEP}]
+ python? ( ${PYTHON_DEPS} )"
+
+DEPEND="${RDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+ ${PYTHON_DEPS}
+"
+# build system does not work with python3
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ waf-utils_src_configure \
+ $(multilib_native_usex python '' '--disable-python')
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ multilib_is_native_abi && use python && python_domodule tevent.py
+}
+
+multilib_src_install_all() {
+ insinto /usr/include
+ doins tevent_internal.h
+}
diff --git a/sys-libs/tevent/tevent-0.9.32.ebuild b/sys-libs/tevent/tevent-0.9.32.ebuild
new file mode 100644
index 000000000000..6a12144b62e5
--- /dev/null
+++ b/sys-libs/tevent/tevent-0.9.32.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit waf-utils multilib-minimal python-single-r1
+
+DESCRIPTION="Samba tevent library"
+HOMEPAGE="http://tevent.samba.org/"
+SRC_URI="http://samba.org/ftp/tevent/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="python"
+
+RDEPEND=">=sys-libs/talloc-2.1.9[${MULTILIB_USEDEP}]
+ python? ( ${PYTHON_DEPS} )"
+
+DEPEND="${RDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+ ${PYTHON_DEPS}
+"
+# build system does not work with python3
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ waf-utils_src_configure \
+ $(multilib_native_usex python '' '--disable-python')
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ multilib_is_native_abi && use python && python_domodule tevent.py
+}
+
+multilib_src_install_all() {
+ insinto /usr/include
+ doins tevent_internal.h
+}
diff --git a/sys-libs/tevent/tevent-0.9.33.ebuild b/sys-libs/tevent/tevent-0.9.33.ebuild
new file mode 100644
index 000000000000..fc46807e4d12
--- /dev/null
+++ b/sys-libs/tevent/tevent-0.9.33.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit waf-utils multilib-minimal python-single-r1
+
+DESCRIPTION="Samba tevent library"
+HOMEPAGE="http://tevent.samba.org/"
+SRC_URI="http://samba.org/ftp/tevent/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="python"
+
+RDEPEND=">=sys-libs/talloc-2.1.10[${MULTILIB_USEDEP}]
+ python? ( ${PYTHON_DEPS} )"
+
+DEPEND="${RDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+ ${PYTHON_DEPS}
+"
+# build system does not work with python3
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+PATCHES=(
+ "${FILESDIR}"/talloc-disable-python.patch
+)
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ waf-utils_src_configure \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(multilib_native_usex python '' '--disable-python')
+}
+
+multilib_src_compile() {
+ # need to avoid parallel building, this looks like the sanest way with waf-utils/multiprocessing eclasses
+ unset MAKEOPTS
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ multilib_is_native_abi && use python && python_domodule tevent.py
+}
+
+multilib_src_install_all() {
+ insinto /usr/include
+ doins tevent_internal.h
+}
diff --git a/sys-libs/timezone-data/Manifest b/sys-libs/timezone-data/Manifest
new file mode 100644
index 000000000000..72cd6e04ceb7
--- /dev/null
+++ b/sys-libs/timezone-data/Manifest
@@ -0,0 +1,10 @@
+AUX timezone-data-2016g-makefile.patch 2402 SHA256 d8e6c7feab3e8dc1e50f5fb4feac91bb53d2489d1045ea18816fcb7e3a1ca114 SHA512 e81fa4e5e8fe9a0a8169a93f197203695d8ada908b53c003e8393dcf22de1be0577608c0e79948c1e9c1ba6abe2875fb7f0f4f80a369e7a2c387b4a52863bb8d WHIRLPOOL 9f1500b6e76c2bef20a2c010a324cab74981b0b029121f053989b92496de41a0a9d538e2fd701d69d27e22a9d5bdccee982248d00b426e13fafd4ea973ce23ff
+DIST tzcode2017a.tar.gz 210671 SHA256 02f2c6b58b99edd0d47f0cad34075b359fd1a4dab71850f493b0404ded3b38ac SHA512 36d744debd5263b6be39b3a9a146b7db1876f216a4bfc62b46631745861a9c03eda3220f213def86c724d3a11c41398c65c2e5d013ff2c1900e7bfc5e7844025 WHIRLPOOL ff618c6bfbd35c8d02a3c2c50e61aa872ce13be87e3b5de8e58e7110b174249530bcd63bd83ccf1f70834bfbf8b2cb5e96176554601611f0e10e54fe8c023b20
+DIST tzcode2017b.tar.gz 210780 SHA256 4d1735bb54e22b8d7443d4d1f1a13d007ae11be79a35e51f8e8322fb8e292d40 SHA512 9a73af4b868506d1f6287a8285dea489e68f6828da19509114f9144e2a2019c7fd28f4fb98ea907030d11d011ce3a87d99dbe43bca218beddafff151f0d61df1 WHIRLPOOL f98be38b269494722859113de561fffd35aeda75a73c57429403606de5c6522f826c818142083d866ec0cf21cfa8427c021ccca45a4447864513af0cfec92c99
+DIST tzdata2017a.tar.gz 323983 SHA256 df3a5c4d0a2cf0cde0b3f35796ccf6c9acfd598b8e70f8dece5404cd7626bbd6 SHA512 fe57930711998a0755749a2bf1b32fdbc9e6ee249762017beea52eae7e521236396300fe2d79298fd81eb6d73fb7567884c35995ed248be06188329d937e3873 WHIRLPOOL 88cf93fcea09edfc568c00df4cc20e97f9327ab9ad07125475c2f9b81b6d95f8da8a7922305880466d61b1eb897f85bba82ac7e7ee1268cfb96d4ccbcab62a3a
+DIST tzdata2017b.tar.gz 324317 SHA256 f8242a522ea3496b0ce4ff4f2e75a049178da21001a08b8e666d8cbe07d18086 SHA512 3e090dba1f52e4c63b4930b28f4bf38b56aabd6728f23094cb5801d10f4e464f17231f17b75b8866714bf98199c166ea840de0787b75b2274aa419a4e14bbc4d WHIRLPOOL 3347ad15ceb763f7679ba3c5bf6bce055ed8d250f24e78b49cce665aa18919d27340716d3d952820c6287194be4014e8094fb615e9c08e73e1859fec080f831f
+EBUILD timezone-data-2017a.ebuild 4599 SHA256 0c8d7016b799276cf163199297dbc4c05e52cdf6f766e4d0637c794013fee1a1 SHA512 0fc13e2b412819126186dc725210069c89864efb01cafbe521a8345788be8ee3d3b1d59a4e0a624fe6919f6b0418947a64ca038cc26a50bd6f12624489ecdd65 WHIRLPOOL cc7457d324412ac3be553f3338b9fb89b1a3895260ef992ff87891917babf446b9b33f2944c96eb4ccf0ec7a7907a1dd2de16b626a0df9f8b692a7bcb32adaac
+EBUILD timezone-data-2017b.ebuild 4676 SHA256 1490a74a19519cd03c95b74a1c70563119163ef82eb41d1b264658e63980312b SHA512 f68387320004598e1b55612b6228e21f708581878485f08547ce58d3fbbff456b2d6af3fd3810398308784724430fd64202781d0df88d4a5acc676e56e82c2a9 WHIRLPOOL 87ed6243bf18356a189e61b6246d677ab33b3b7926319eea371a8ef8a0aed509d3dd63a14c9ee2df16cfc3c78706bf001955ac72b8f032410ddf992e0bedb1f0
+MISC ChangeLog 9681 SHA256 5cdcfa99cff019b8fcc640665c9b2cd8f2a9f2c881c8b645f0d791e87009adba SHA512 e963131ce23c48724a12c2b8e7059d2ae64dc1470894aad957f662bcf04a33b4e7bcd4bc6ee6de99cba67daf5d50ed56251f4deb285d0556fa0ef11e7be1a814 WHIRLPOOL 66934c54c461207602abd6efd82d68d0dbcf6fe48f0216cf6799fd57a06098c22ede409ee4d0b385aeb802cecde86efd6a8b55973747b8d91633edb6625ac811
+MISC ChangeLog-2015 44955 SHA256 f3918b48d5f2b1eca6e052068b18c135a71c67c1e5fa832b5ca156ebff3baf60 SHA512 67ad046d741ce07ba6ccc30282a7911b885c70bd7034963499e383d59e706e0c5ea04f01db7582017a14847ddcc93a646f55a8756517d6ee570d038e487e101e WHIRLPOOL 29a11cbbf810a82e7a4c066e182298182ec1920f79cfeb5aa0f7cd7c1462456107fef3bee69b6fa5835911b37b25125bacc06b8eeabc3f06902f658104fd2b2b
+MISC metadata.xml 658 SHA256 d3f817a651a92247eb1afd502efa3b3599d5fe9d489ab85c7377159cc1cffd71 SHA512 94b68a5195b17cd1a7283a90a42ba9e1dfb0e7dde7c16f48202233cc2fc20ea718a1588b57b2af372e3c35ed403276cdd59456165a225f149a813abff2144c73 WHIRLPOOL 258a4410d209114e45238c37d7ca19932720e4ce0866ca88b3746223e32b2e479df4b0a8b8660b286e0a432fbb1fc345fada268d93922eebded222167b5824b2
diff --git a/sys-libs/timezone-data/files/timezone-data-2016g-makefile.patch b/sys-libs/timezone-data/files/timezone-data-2016g-makefile.patch
new file mode 100644
index 000000000000..83cae6d59a80
--- /dev/null
+++ b/sys-libs/timezone-data/files/timezone-data-2016g-makefile.patch
@@ -0,0 +1,81 @@
+ - Fix up default paths
+ - Support env CC
+ - Don't build/install libtz.a
+ - Don't install man-pages provided by sys-apps/man-pages
+ - Move tzselect, zic, and zdump to bin
+ - Do not run network based unittests
+
+--- a/Makefile
++++ b/Makefile
+@@ -45,21 +45,21 @@ POSIXRULES= America/New_York
+
+ # Everything gets put in subdirectories of. . .
+
+-TOPDIR= /usr/local
++TOPDIR= /usr
+
+ # "Compiled" time zone information is placed in the "TZDIR" directory
+ # (and subdirectories).
+ # Use an absolute path name for TZDIR unless you're just testing the software.
+
+ TZDIR_BASENAME= zoneinfo
+-TZDIR= $(TOPDIR)/etc/$(TZDIR_BASENAME)
++TZDIR= $(TOPDIR)/share/$(TZDIR_BASENAME)
+
+ # Types to try, as an alternative to time_t. int64_t should be first.
+ TIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t
+
+ # The "tzselect", "zic", and "zdump" commands get installed in. . .
+
+-ETCDIR= $(TOPDIR)/etc
++SBINDIR= $(TOPDIR)/sbin
+
+ # If you "make INSTALL", the "date" command gets installed in. . .
+
+@@ -67,7 +67,7 @@ BINDIR= $(TOPDIR)/bin
+
+ # Manual pages go in subdirectories of. . .
+
+-MANDIR= $(TOPDIR)/man
++MANDIR= $(TOPDIR)/share/man
+
+ # Library functions are put in an archive in LIBDIR.
+
+@@ -298,8 +298,7 @@ GZIPFLAGS= -9n
+
+ #MAKE= make
+
+-cc= cc
+-CC= $(cc) -DTZDIR=\"$(TZDIR)\"
++CPPFLAGS+= -DTZDIR=\"$(TZDIR)\"
+
+ AR= ar
+
+@@ -352,16 +354,12 @@ ALL: all date
+ install: all $(DATA) $(REDO) $(MANS)
+ mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
+- $(DESTDIR)$(LIBDIR) \
++ $(DESTDIR)$(BINDIR) \
+ $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
+ $(DESTDIR)$(MANDIR)/man8
+ $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES)
+ cp -f iso3166.tab $(ZONETABLES) $(DESTDIR)$(TZDIR)/.
+- cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
++ cp tzselect zic zdump $(DESTDIR)$(BINDIR)/.
+- cp libtz.a $(DESTDIR)$(LIBDIR)/.
+- $(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
+ cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
+- cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
+- cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
+
+ INSTALL: ALL install date.1
+ mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
+@@ -440,7 +438,7 @@ tzselect: tzselect.ksh
+ chmod +x $@
+
+ check: check_character_set check_white_space check_links check_sorted \
+- check_tables check_tzs check_web
++ check_tables
+
+ check_character_set: $(ENCHILADA)
+ LC_ALL=en_US.utf8 && export LC_ALL && \
diff --git a/sys-libs/timezone-data/metadata.xml b/sys-libs/timezone-data/metadata.xml
new file mode 100644
index 000000000000..df3ef61050c8
--- /dev/null
+++ b/sys-libs/timezone-data/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 type="person">
+ <email>djc@gentoo.org</email>
+ <name>Dirkjan Ochtman</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <use>
+ <flag name="leaps_timezone">
+ Install the set of "right" timezones; these timezones include leap seconds
+ when counting seconds since the epoch (while POSIX does not) as they are
+ based on the TAI (International Atomic Time) clock
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/timezone-data/timezone-data-2017a.ebuild b/sys-libs/timezone-data/timezone-data-2017a.ebuild
new file mode 100644
index 000000000000..df145b8363d2
--- /dev/null
+++ b/sys-libs/timezone-data/timezone-data-2017a.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+code_ver=${PV}
+data_ver=${PV}
+DESCRIPTION="Timezone data (/usr/share/zoneinfo) and utilities (tzselect/zic/zdump)"
+HOMEPAGE="http://www.iana.org/time-zones http://www.twinsun.com/tz/tz-link.htm"
+SRC_URI="http://www.iana.org/time-zones/repository/releases/tzdata${data_ver}.tar.gz
+ http://www.iana.org/time-zones/repository/releases/tzcode${code_ver}.tar.gz"
+
+LICENSE="BSD public-domain"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="nls leaps_timezone elibc_FreeBSD"
+
+DEPEND="nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+ !sys-libs/glibc[vanilla(+)]"
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2016g-makefile.patch
+ tc-is-cross-compiler && cp -pR "${S}" "${S}"-native
+}
+
+src_configure() {
+ tc-export CC
+
+ append-lfs-flags #471102
+
+ if use elibc_FreeBSD || use elibc_Darwin ; then
+ append-cppflags -DSTD_INSPIRED #138251
+ fi
+
+ append-cppflags -DHAVE_GETTEXT=$(usex nls 1 0) -DTZ_DOMAIN='\"libc\"'
+ LDLIBS=""
+ if use nls ; then
+ # See if an external libintl is available. #154181 #578424
+ local c="${T}/test"
+ echo 'main(){}' > "${c}.c"
+ if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} "${c}.c" -o "${c}" -lintl 2>/dev/null ; then
+ LDLIBS+=" -lintl"
+ fi
+ fi
+}
+
+_emake() {
+ emake \
+ TOPDIR="${EPREFIX}/usr" \
+ REDO=$(usex leaps_timezone posix_right posix_only) \
+ "$@"
+}
+
+src_compile() {
+ # TOPDIR is used in some utils when compiling.
+ _emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ RANLIB="$(tc-getRANLIB)" \
+ CFLAGS="${CFLAGS} -std=gnu99" \
+ LDFLAGS="${LDFLAGS}" \
+ LDLIBS="${LDLIBS}"
+ if tc-is-cross-compiler ; then
+ _emake -C "${S}"-native \
+ CC="$(tc-getBUILD_CC)" \
+ CFLAGS="${BUILD_CFLAGS}" \
+ CPPFLAGS="${BUILD_CPPFLAGS}" \
+ LDFLAGS="${BUILD_LDFLAGS}" \
+ LDLIBS="${LDLIBS}" \
+ zic
+ fi
+}
+
+src_install() {
+ local zic=""
+ tc-is-cross-compiler && zic="zic=${S}-native/zic"
+ _emake install ${zic} DESTDIR="${D}"
+ dodoc CONTRIBUTING README NEWS Theory
+ dohtml *.htm
+}
+
+get_TIMEZONE() {
+ local tz src="${EROOT}etc/timezone"
+ if [[ -e ${src} ]] ; then
+ tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
+ else
+ tz="FOOKABLOIE"
+ fi
+ [[ -z ${tz} ]] && return 1 || echo "${tz}"
+}
+
+pkg_preinst() {
+ local tz=$(get_TIMEZONE)
+ if [[ ${tz} == right/* || ${tz} == posix/* ]] ; then
+ eerror "The right & posix subdirs are no longer installed as subdirs -- they have been"
+ eerror "relocated to match upstream paths as sibling paths. Further, posix/xxx is the"
+ eerror "same as xxx, so you should simply drop the posix/ prefix. You also should not"
+ eerror "be using right/xxx for the system timezone as it breaks programs."
+ die "Please fix your timezone setting"
+ fi
+
+ # Trim the symlink by hand to avoid portage's automatic protection checks.
+ rm -f "${EROOT}"/usr/share/zoneinfo/posix
+
+ if has_version "<=${CATEGORY}/${PN}-2015c" ; then
+ elog "Support for accessing posix/ and right/ directly has been dropped to match"
+ elog "upstream. There is no need to set TZ=posix/xxx as it is the same as TZ=xxx."
+ elog "For TZ=right/, you can use TZ=../zoneinfo-leaps/xxx instead. See this post"
+ elog "for details: https://mm.icann.org/pipermail/tz/2015-February/022024.html"
+ fi
+}
+
+pkg_config() {
+ # make sure the /etc/localtime file does not get stale #127899
+ local tz src="${EROOT}etc/timezone" etc_lt="${EROOT}etc/localtime"
+
+ # If it's a symlink, assume the user knows what they're doing and
+ # they're managing it themselves. #511474
+ if [[ -L ${etc_lt} ]] ; then
+ einfo "Assuming your ${etc_lt} symlink is what you want; skipping update."
+ return 0
+ fi
+
+ if ! tz=$(get_TIMEZONE) ; then
+ einfo "Assuming your empty ${etc_lt} file is what you want; skipping update."
+ return 0
+ fi
+ if [[ ${tz} == "FOOKABLOIE" ]] ; then
+ elog "You do not have TIMEZONE set in ${src}."
+
+ if [[ ! -e ${etc_lt} ]] ; then
+ cp -f "${EROOT}"/usr/share/zoneinfo/Factory "${etc_lt}"
+ elog "Setting ${etc_lt} to Factory."
+ else
+ elog "Skipping auto-update of ${etc_lt}."
+ fi
+ return 0
+ fi
+
+ if [[ ! -e ${EROOT}/usr/share/zoneinfo/${tz} ]] ; then
+ elog "You have an invalid TIMEZONE setting in ${src}"
+ elog "Your ${etc_lt} has been reset to Factory; enjoy!"
+ tz="Factory"
+ fi
+ einfo "Updating ${etc_lt} with ${EROOT}usr/share/zoneinfo/${tz}"
+ cp -f "${EROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}"
+}
+
+pkg_postinst() {
+ pkg_config
+}
diff --git a/sys-libs/timezone-data/timezone-data-2017b.ebuild b/sys-libs/timezone-data/timezone-data-2017b.ebuild
new file mode 100644
index 000000000000..5ecd0a12ca0e
--- /dev/null
+++ b/sys-libs/timezone-data/timezone-data-2017b.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+code_ver=${PV}
+data_ver=${PV}
+DESCRIPTION="Timezone data (/usr/share/zoneinfo) and utilities (tzselect/zic/zdump)"
+HOMEPAGE="http://www.iana.org/time-zones http://www.twinsun.com/tz/tz-link.htm"
+SRC_URI="http://www.iana.org/time-zones/repository/releases/tzdata${data_ver}.tar.gz
+ http://www.iana.org/time-zones/repository/releases/tzcode${code_ver}.tar.gz"
+
+LICENSE="BSD public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
+IUSE="nls leaps_timezone elibc_FreeBSD"
+
+DEPEND="nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+ !sys-libs/glibc[vanilla(+)]"
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2016g-makefile.patch
+ tc-is-cross-compiler && cp -pR "${S}" "${S}"-native
+}
+
+src_configure() {
+ tc-export CC
+
+ append-lfs-flags #471102
+
+ if use elibc_FreeBSD || use elibc_Darwin ; then
+ append-cppflags -DSTD_INSPIRED #138251
+ fi
+
+ append-cppflags -DHAVE_GETTEXT=$(usex nls 1 0) -DTZ_DOMAIN='\"libc\"'
+ LDLIBS=""
+ if use nls ; then
+ # See if an external libintl is available. #154181 #578424
+ local c="${T}/test"
+ echo 'main(){}' > "${c}.c"
+ if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} "${c}.c" -o "${c}" -lintl 2>/dev/null ; then
+ LDLIBS+=" -lintl"
+ fi
+ fi
+}
+
+_emake() {
+ emake \
+ TOPDIR="${EPREFIX}/usr" \
+ REDO=$(usex leaps_timezone posix_right posix_only) \
+ "$@"
+}
+
+src_compile() {
+ # TOPDIR is used in some utils when compiling.
+ _emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ RANLIB="$(tc-getRANLIB)" \
+ CFLAGS="${CFLAGS} -std=gnu99" \
+ LDFLAGS="${LDFLAGS}" \
+ LDLIBS="${LDLIBS}"
+ if tc-is-cross-compiler ; then
+ _emake -C "${S}"-native \
+ CC="$(tc-getBUILD_CC)" \
+ CFLAGS="${BUILD_CFLAGS}" \
+ CPPFLAGS="${BUILD_CPPFLAGS}" \
+ LDFLAGS="${BUILD_LDFLAGS}" \
+ LDLIBS="${LDLIBS}" \
+ zic
+ fi
+}
+
+src_install() {
+ local zic=""
+ tc-is-cross-compiler && zic="zic=${S}-native/zic"
+ _emake install ${zic} DESTDIR="${D}"
+ dodoc CONTRIBUTING README NEWS Theory
+ dohtml *.htm
+}
+
+get_TIMEZONE() {
+ local tz src="${EROOT}etc/timezone"
+ if [[ -e ${src} ]] ; then
+ tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
+ else
+ tz="FOOKABLOIE"
+ fi
+ [[ -z ${tz} ]] && return 1 || echo "${tz}"
+}
+
+pkg_preinst() {
+ local tz=$(get_TIMEZONE)
+ if [[ ${tz} == right/* || ${tz} == posix/* ]] ; then
+ eerror "The right & posix subdirs are no longer installed as subdirs -- they have been"
+ eerror "relocated to match upstream paths as sibling paths. Further, posix/xxx is the"
+ eerror "same as xxx, so you should simply drop the posix/ prefix. You also should not"
+ eerror "be using right/xxx for the system timezone as it breaks programs."
+ die "Please fix your timezone setting"
+ fi
+
+ # Trim the symlink by hand to avoid portage's automatic protection checks.
+ rm -f "${EROOT}"/usr/share/zoneinfo/posix
+
+ if has_version "<=${CATEGORY}/${PN}-2015c" ; then
+ elog "Support for accessing posix/ and right/ directly has been dropped to match"
+ elog "upstream. There is no need to set TZ=posix/xxx as it is the same as TZ=xxx."
+ elog "For TZ=right/, you can use TZ=../zoneinfo-leaps/xxx instead. See this post"
+ elog "for details: https://mm.icann.org/pipermail/tz/2015-February/022024.html"
+ fi
+}
+
+configure_tz_data() {
+ # make sure the /etc/localtime file does not get stale #127899
+ local tz src="${EROOT}etc/timezone" etc_lt="${EROOT}etc/localtime"
+
+ # If it's a symlink, assume the user knows what they're doing and
+ # they're managing it themselves. #511474
+ if [[ -L ${etc_lt} ]] ; then
+ einfo "Assuming your ${etc_lt} symlink is what you want; skipping update."
+ return 0
+ fi
+
+ if ! tz=$(get_TIMEZONE) ; then
+ einfo "Assuming your empty ${etc_lt} file is what you want; skipping update."
+ return 0
+ fi
+ if [[ ${tz} == "FOOKABLOIE" ]] ; then
+ elog "You do not have TIMEZONE set in ${src}."
+
+ if [[ ! -e ${etc_lt} ]] ; then
+ cp -f "${EROOT}"/usr/share/zoneinfo/Factory "${etc_lt}"
+ elog "Setting ${etc_lt} to Factory."
+ else
+ elog "Skipping auto-update of ${etc_lt}."
+ fi
+ return 0
+ fi
+
+ if [[ ! -e ${EROOT}/usr/share/zoneinfo/${tz} ]] ; then
+ elog "You have an invalid TIMEZONE setting in ${src}"
+ elog "Your ${etc_lt} has been reset to Factory; enjoy!"
+ tz="Factory"
+ fi
+ einfo "Updating ${etc_lt} with ${EROOT}usr/share/zoneinfo/${tz}"
+ cp -f "${EROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}"
+}
+
+pkg_config() {
+ configure_tz_data
+}
+
+pkg_postinst() {
+ configure_tz_data
+}
diff --git a/sys-libs/uclibc-ng/Manifest b/sys-libs/uclibc-ng/Manifest
new file mode 100644
index 000000000000..4fbef4642ebc
--- /dev/null
+++ b/sys-libs/uclibc-ng/Manifest
@@ -0,0 +1,20 @@
+AUX uclibc-compat-r1.patch 814 SHA256 e0c9ed0a806b8611721669fd7b60d16c734268d494e95bc5f3a25f75888fe3be SHA512 35eedbf33282285ae362a6e1b71f91a19ded8b18792f706b3d7e9c68221a61db238d84772a793cf086001272eda1b227043b90e8ef31c27796ffe837ccad11d0 WHIRLPOOL 18bded320b0779753042739e13b4b230ad27e012ac5f800d0636b00aa5e735ff62b76737536a1731d65f532a044deec4b82111b94469d78007317bba21026017
+AUX uclibc-ng-update-reboot_h.patch 1254 SHA256 39218a498e2bb52ae365e331ffdb26f5ea05782f320751aecbdfd13dc07b959a SHA512 605cabbbe19c3b2c442d7629c5adc340dd8899ca484b3d495d719a2fab68ef881973043c663211a61fba167ff0bdaa12f8534545da8e3049ab27ab1439477964 WHIRLPOOL 60421ff04770b43b26f0021a663f06f235598cfdea3729ce02cbc8651a17f5bcf46ba49f27e39bceba12b2db5cea068985c6b523f78f44ca898fc7377e4afcb8
+DIST uClibc-ng-1.0.19.tar.bz2 2748768 SHA256 139c495d8f71ec31da97e0330b056302ff40f0acba66988fcd737cfb4eb445ed SHA512 d385eca25c4a356b01b6d7acaef63daeeb172769d6306525fb95f62e818aca354cf04fae15af65bc346f19dcfdc601f87e52a8dc95f528d7392648d1b056fe63 WHIRLPOOL 1cc6b64df85df5f9e8c15c9cad3ed5641add20f402657a7d9c6283527ba7feac3c90ce293f2b15578c6d816c19018467336e50cd469a46482c2e4168f2addaf5
+DIST uClibc-ng-1.0.20.tar.bz2 2414313 SHA256 0d0ee9d4df82958f65088f446ffd7548d88deb1f1b949f9ec3e673decb910597 SHA512 c0d4fc442f087d9bf994a7b84fa12cfae96f2980061cbb39b1c2cf243692d44fcab79d4a686ac5a7889b9081682aa13d013da0ad99cb30ad2b7150bdb19de0de WHIRLPOOL 16035dd540629aa453e023b6ea96eab5e577579e7bb940ed3411107ffd12bc78148e7a14222184207ae40633d30871d9e583c3456a04cc28b96dfd40b287e713
+DIST uClibc-ng-1.0.22.tar.bz2 2435181 SHA256 430bebc26545022c5c3e9cebd4ee682db0053b94235e0be5df7eeab7ff19a9e0 SHA512 d29a14813f6b795fbd380a9593742f696cd32ec8fd22001ce092382ca0059357bc921b8eac7d0a6ae2a9cab724b0ddd15f9959ec789b4824a5db820cbd00b6e7 WHIRLPOOL 14336e9e159585472a9a01cb69acc0cb59d8df89769e532c4deec4c1a6a0056d8ff091904163ad9ab29c2c5107fe57f3241c8d4e898fe831f21b1a8e685aaec1
+DIST uClibc-ng-1.0.23.tar.bz2 2350186 SHA256 3eeb53a2aa5a32f455fb9d197f7b598f2ff46bbf35d72073f5e554e70c17c782 SHA512 eca892a0773cfbabaf5037347b1969706c040c903c93c612d2e0aca8d66b51d6d1cb7f3811a688898bc7e25ca235cc14b6bbd741c51dc135300a0e1408c6d1c3 WHIRLPOOL 1fb96469fb7860c05660fae7e58e9c60704cd76ad163a4c46e402e98ada35041a2069f6573498cf596a754044c08f30b4e3fd8fcba2d92c48ee7a7af9376af79
+DIST uClibc-ng-1.0.24.tar.bz2 2299126 SHA256 d7a3ddc0af8f750abd74e2f677664faafd491f40b62ae0676957e411ca203782 SHA512 4d25035f2355a2b5549fa89cdd7754fc20c6a5a1001a06a81ee47de18855db368e412eb10e38dcbe2e364d3108cefe50029379a3e222972ceced3b693f4ffcc4 WHIRLPOOL 05932258636f041ee12ca2aeec332098e4f61fff92f055a30d024fe7cc953014b93b0ba231cdca2bc0a600e526155734266a71f2f95135dfa305b984f2f2bcd5
+DIST uClibc-ng-1.0.25.tar.bz2 2234505 SHA256 e20d4a2c78cd76554747e58f35220301afb0fb600ed18f8c9096c98179120a8b SHA512 3bc5e3f0626a529a688e56649b34c48d0ddf733c09279c84fad0954880aa7c0ec3440664811196d11bbc3f05cbea99f3ba47efaad7f315a55ba3d8d587d3b313 WHIRLPOOL f422d05e1d9aa6ae0ecfc0b7808dd115614877d5a602effdc815123e61808b43558c9a9a530ef4ef918bbd5793bb77eb690660f563bc1f97120cc2a3c0b3650b
+DIST uClibc-ng-1.0.26.tar.bz2 2285709 SHA256 899e2ae37ba9266d20fc2bf290cece484455555b284140b6442c24a24cddb909 SHA512 48c37ab2000af13848ef007ce89f226bded5188f37839c11371bab48497670d30d39fda2a031c6aff95f429a4abadc431ddd77c0e023810a341e2c2d2645f71b WHIRLPOOL 32527dde77f30d1394271978e311fdc6ed69ef47b65d00f19efdf37b700a2dca4e6fc5b126c4cfa05321baf2a47fa1335d8d1843991e78eb1d44f4bfe032f818
+EBUILD uclibc-ng-1.0.19.ebuild 10508 SHA256 15cc08786ec3b43210a13fd42fe4336b3b6b62d158cf94bfedd6ead80de545e8 SHA512 5fd93b8bb7eb4ccab058b67934481a2a7de2b8cec4a46f404b50bd572f4a5318a85cbd1799f662a27528c2131db7207d6268c3fc4bda6a58e34822ab43966b8c WHIRLPOOL d2c7e2df90c84b7db229c2449e08f191cb92f4f759e20ab0c8b2ee37db3d18e90381aba9e508d868eafd3fe7d04ae6c394b328c08fb01368d49b5f93c8e8f073
+EBUILD uclibc-ng-1.0.20.ebuild 10564 SHA256 b829c30a628e71c283e31ec672f49139f79fed3e3b2360191afaf7a6d13f132b SHA512 ec54d3cf80a5a8ed9349ce7a180e64bd78fe52d76fa86d77652080f784fab8507904a2f7a05e8d5139aa003f2f5dfadca9400e2f79ec1957fadc67acf1446016 WHIRLPOOL dd5e07edce2a988219987fcd46203283b6dee45d4094b59a32af2a580f30090a4671f666a3a9a1085e7bf6983b0e2530079ba5dd9c74f7737786472e89b38ba7
+EBUILD uclibc-ng-1.0.22.ebuild 10606 SHA256 32bc44a1fefab87744e76d0b44ea7d0217c0bc4986a23bcb058902ea3e791715 SHA512 cd2a8b16097a17769eedccb64c093837b24949c22bbe946f16b981ab1ff83ac99c20cf783840f67526aa63252cc52f4ec8b2a4819df0e876d1c047bdccd36c9e WHIRLPOOL 4778722a4e040dfe6c3d81163736600c6cff78cc1f68aaf7e70e3dee6b1535674f9ca71c63c6667ae62664096dfc7f9caf2f6c81ee33fb4e1d77ca63f776658e
+EBUILD uclibc-ng-1.0.23.ebuild 10608 SHA256 29f030c27fac97d2ececd03f4cb8c5ec9402be7a5d127e0a5ce152f71ff59ab7 SHA512 f4f6590534f3a66efe3b57ea0e7d9fb9c89caea5bef51d69597094059f66467b7d70d1aed0829a7d948e8d4dce1895d25efa33c8495a93619fbb637ba2ee800e WHIRLPOOL 206a8ad4f57f777caa2a3f9d927c86dc044f067f08b7470bf69cea99d017e4af8bacbf3e6550282240b08b808818dbd01d54209560af3167ef2537ddf06bdd7f
+EBUILD uclibc-ng-1.0.24-r1.ebuild 10656 SHA256 58fd79dae262b978b34b172a35457079bb32a70d46037b92cea0b23eb4863ade SHA512 a12884773b033251dcc8b77606aa7579a649152a94e48e246cce4480a5d7d2a1f48e28cd0cff3b43661b1226b252964233dc41b6d771ac6c346eb61f44f01645 WHIRLPOOL aa78ce0d1228287a55ce25fd72a48f942dedefeba8fc600996aaac269870e1005ace5775afa6ed0949f9d4024c1c84b0ea39ff8215a9fab82a168b0217a3fbb3
+EBUILD uclibc-ng-1.0.24.ebuild 10606 SHA256 32bc44a1fefab87744e76d0b44ea7d0217c0bc4986a23bcb058902ea3e791715 SHA512 cd2a8b16097a17769eedccb64c093837b24949c22bbe946f16b981ab1ff83ac99c20cf783840f67526aa63252cc52f4ec8b2a4819df0e876d1c047bdccd36c9e WHIRLPOOL 4778722a4e040dfe6c3d81163736600c6cff78cc1f68aaf7e70e3dee6b1535674f9ca71c63c6667ae62664096dfc7f9caf2f6c81ee33fb4e1d77ca63f776658e
+EBUILD uclibc-ng-1.0.25.ebuild 10564 SHA256 b829c30a628e71c283e31ec672f49139f79fed3e3b2360191afaf7a6d13f132b SHA512 ec54d3cf80a5a8ed9349ce7a180e64bd78fe52d76fa86d77652080f784fab8507904a2f7a05e8d5139aa003f2f5dfadca9400e2f79ec1957fadc67acf1446016 WHIRLPOOL dd5e07edce2a988219987fcd46203283b6dee45d4094b59a32af2a580f30090a4671f666a3a9a1085e7bf6983b0e2530079ba5dd9c74f7737786472e89b38ba7
+EBUILD uclibc-ng-1.0.26.ebuild 10604 SHA256 b0a425fb23714c6340e1763364bc0ffb18154de205f6f106ba214eaa1549caa9 SHA512 769dc912114cd618cf936c7f49323999a1c504429956b3f31cb2e6da74e95f2fa533b69ddaaafee9b71f8973dada12c3778379e89c7108f3f24994218739aeb4 WHIRLPOOL e2d740f14909eaee094d3c784a0bca7a4ad6b1dcf69072ef4656e7459aaa40b35a6a50b8db144494229ef4e5e09fe66df77e850841fd4fb386edf0f53c4b6f45
+EBUILD uclibc-ng-9999.ebuild 10568 SHA256 9920b5bb59de46908cbdc273ac7d6dc2a258bad1d3cc7b22e258554e95399741 SHA512 a37488a645cd5f69f4dff6cf98533775bedf81cac1630eb4c0818ff2065a2286182a55e2473defff0c6b65d23038ede8914bd2ce62431644bda6c60d955b8eab WHIRLPOOL dd3ed340443296c8e6b01e9c3d1f60fab602e50c777078b1f18aabe48e0d412215405bc7020eb991c68c5914dea9961acf2f7393af15ce52758595984545c971
+MISC ChangeLog 3668 SHA256 46d4477ade27bba3a3eccecb90c90b623542c31174e9928dec4b28006b753fae SHA512 b8f80f6b95b3186747629b8b96daca80ed1db4e783f8dacb1247edbd26a7a41521e05c613c74542467f432b6e18e90cfed07a91477419b1cfdacc17a2004b3d0 WHIRLPOOL 28cfd122a92d958d277bee820ed4ac9463c1b207175e1cb9d0f75c7885c3f1e1ea7827a5a83a6d410499cbef5ce37fe2f9c3037bfe95d5629b9e783bd82ee149
+MISC metadata.xml 877 SHA256 c7ff8d2a5338653d6d819e5f158b9862c44292c866547406173f849b0a151f4a SHA512 3988e346916b283836e5c3d094eec4f25c66763e4e10a6413fe97f98629e1f14b67d6013f13f9ca2e2712dd638567973c02e6ebcce3554c55caf5483c3c9dfd4 WHIRLPOOL 5ee10f6effb5b9587bd47721b13b7054e5f3a5ddda90df3d330abd80b1e09bca2ffe70467374cf7122371a2c8bd2c2a0a87a9249203cf8a3daf2bda37e9f336e
diff --git a/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch b/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch
new file mode 100644
index 000000000000..f47e0f9a0152
--- /dev/null
+++ b/sys-libs/uclibc-ng/files/uclibc-compat-r1.patch
@@ -0,0 +1,15 @@
+diff -Naur uClibc-ng-1.0.18.orig/ldso/ldso/Makefile.in uClibc-ng-1.0.18/ldso/ldso/Makefile.in
+--- uClibc-ng-1.0.18.orig/ldso/ldso/Makefile.in 2016-09-27 15:26:37.000000000 -0400
++++ uClibc-ng-1.0.18/ldso/ldso/Makefile.in 2016-10-01 06:31:44.106589780 -0400
+@@ -80,11 +80,6 @@
+ $(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
+ $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
+ $(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
+- # link for backward compatibility
+- (cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME).so.0 )
+-ifeq ($(CONFIG_MIPS_NAN_2008),y)
+- (cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME)-mipsn8.so.0)
+-endif
+
+ $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
+ $(Q)$(RM) $@
diff --git a/sys-libs/uclibc-ng/files/uclibc-ng-update-reboot_h.patch b/sys-libs/uclibc-ng/files/uclibc-ng-update-reboot_h.patch
new file mode 100644
index 000000000000..70d7d709b624
--- /dev/null
+++ b/sys-libs/uclibc-ng/files/uclibc-ng-update-reboot_h.patch
@@ -0,0 +1,41 @@
+From 5a305695ad09696bc27c1928deedabbc9e93da55 Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Mon, 22 May 2017 09:57:27 -0400
+Subject: [PATCH] include/sys/reboot.h: add constants RB_SW_SUSPEND and
+ RB_KEXEC
+
+This syncs up <sys/reboot.h> with the GNU C library, see their
+commit 1a09dc56. These constants are needed by init systems like
+openrc.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+---
+ include/sys/reboot.h | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/include/sys/reboot.h b/include/sys/reboot.h
+index bc685aebb..fafd2fb0c 100644
+--- a/include/sys/reboot.h
++++ b/include/sys/reboot.h
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
++/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+@@ -38,6 +38,12 @@
+ /* Stop system and switch power off if possible. */
+ #define RB_POWER_OFF 0x4321fedc
+
++/* Suspend system using software suspend. */
++#define RB_SW_SUSPEND 0xd000fce2
++
++/* Reboot system into new kernel. */
++#define RB_KEXEC 0x45584543
++
+ __BEGIN_DECLS
+
+ /* Reboot or halt the system. */
+--
+2.13.0
+
diff --git a/sys-libs/uclibc-ng/metadata.xml b/sys-libs/uclibc-ng/metadata.xml
new file mode 100644
index 000000000000..c54e93bc9e0a
--- /dev/null
+++ b/sys-libs/uclibc-ng/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 type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>embedded@gentoo.org</email>
+ <name>Embedded Gentoo</name>
+ </maintainer>
+ <longdescription>
+ uClibc-ng is a small C library for developing embedded Linux systems. It is much
+ smaller than the GNU C Library, but nearly all applications supported by glibc
+ also work perfectly with uClibc-ng.
+ </longdescription>
+ <use>
+ <flag name="rpc">Enable sun nis/rpc support (you should use libtirpc though)</flag>
+ <flag name="symlink-compat">Explicitly add sym links for libdl.so.0, libm.so.0, and
+ friends for backward compatibility with sys-libs/uclibc-ng-1.0.17 and earlier</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.19.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.19.ebuild
new file mode 100644
index 000000000000..9069233fee33
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.19.ebuild
@@ -0,0 +1,408 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ KEYWORDS="-* amd64 arm ~mips ppc x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.20.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.20.ebuild
new file mode 100644
index 000000000000..89d2e3727161
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.20.ebuild
@@ -0,0 +1,410 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ KEYWORDS="-* amd64 arm ~mips ppc x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc symlink-compat crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ if use symlink-compat; then
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+ fi
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.22.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.22.ebuild
new file mode 100644
index 000000000000..c0d6e8d09535
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.22.ebuild
@@ -0,0 +1,411 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ #KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+ KEYWORDS="-* ~amd64 ~arm ~ppc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc symlink-compat crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ if use symlink-compat; then
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+ fi
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.23.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.23.ebuild
new file mode 100644
index 000000000000..d10bebbe0baf
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.23.ebuild
@@ -0,0 +1,411 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ #KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+ KEYWORDS="-* amd64 arm ~mips ppc x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc symlink-compat crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ if use symlink-compat; then
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+ fi
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.24-r1.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.24-r1.ebuild
new file mode 100644
index 000000000000..de763355387d
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.24-r1.ebuild
@@ -0,0 +1,412 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ #KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+ KEYWORDS="-* ~amd64 ~arm ~ppc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc symlink-compat crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+ eapply "${FILESDIR}"/${PN}-update-reboot_h.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ if use symlink-compat; then
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+ fi
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.24.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.24.ebuild
new file mode 100644
index 000000000000..c0d6e8d09535
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.24.ebuild
@@ -0,0 +1,411 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ #KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+ KEYWORDS="-* ~amd64 ~arm ~ppc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc symlink-compat crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ if use symlink-compat; then
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+ fi
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.25.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.25.ebuild
new file mode 100644
index 000000000000..89d2e3727161
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.25.ebuild
@@ -0,0 +1,410 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ KEYWORDS="-* amd64 arm ~mips ppc x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc symlink-compat crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ if use symlink-compat; then
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+ fi
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc-ng/uclibc-ng-1.0.26.ebuild b/sys-libs/uclibc-ng/uclibc-ng-1.0.26.ebuild
new file mode 100644
index 000000000000..2492d87f8151
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-1.0.26.ebuild
@@ -0,0 +1,411 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ #KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+ KEYWORDS="-* amd64 ~arm ~ppc x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc symlink-compat crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ if use symlink-compat; then
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+ fi
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild b/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
new file mode 100644
index 000000000000..f6ad51297978
--- /dev/null
+++ b/sys-libs/uclibc-ng/uclibc-ng-9999.ebuild
@@ -0,0 +1,410 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic multilib savedconfig toolchain-funcs versionator
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://uclibc-ng.org/git/uclibc-ng"
+ inherit git-r3
+ MY_P=uclibc-ng-${PV}
+else
+ MY_P=uClibc-ng-${PV}
+fi
+
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="http://www.uclibc-ng.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="http://downloads.uclibc-ng.org/releases/${PV}/${MY_P}.tar.bz2"
+ KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 rpc symlink-compat crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# 1) We can't upgrade from uclibc to uclibc-ng via a soft blocker since portage
+# will delete the ld.so sym link prematurely and break the system. So we
+# will hard block and give manual migration instructions.
+# 2) Currently uclibc and uclibc-ng's iconv are in bad shape. We've been using
+# the breakout library. The disadvantage here is that we have to sprinkle
+# LDFAGS=-liconv on build systems that need to link against libiconv.
+RDEPEND="
+ !!sys-libs/uclibc
+ iconv? ( dev-libs/libiconv )"
+
+S=${WORKDIR}/${MY_P}
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CHOST} == ${CTARGET} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+make_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+
+make_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ make_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=$1 defconfig >/dev/null
+
+ local defs_{y,n}
+
+ # These are forced off
+ defs_n=(
+ DOASSERTS
+ DODEBUG_PT
+ HAS_NO_THREADS
+ PROPOLICE_BLOCK_ABRT
+ SSP_QUICK_CANARY
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_CTYPE_UNSAFE
+ UCLIBC_HAS_LOCALE
+ UCLIBC_HAS_SSP_COMPAT
+ )
+
+ # These are forced on
+ defs_y=(
+ COMPAT_ATEXIT
+ DO_C99_MATH
+ DO_XSI_MATH
+ FORCE_SHAREABLE_TEXT_SEGMENTS
+ LDSO_GNU_HASH_SUPPORT
+ LDSO_PRELINK_SUPPORT
+ LDSO_PRELOAD_FILE_SUPPORT
+ LDSO_RUNPATH_OF_EXECUTABLE
+ LDSO_STANDALONE_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ PROPOLICE_BLOCK_SEGV
+ PTHREADS_DEBUG_SUPPORT
+ UCLIBC_HAS_ARC4RANDOM
+ UCLIBC_HAS_BACKTRACE
+ UCLIBC_HAS_BSD_RES_CLOSE
+ UCLIBC_HAS_CONTEXT_FUNCS
+ UCLIBC_HAS_CTYPE_CHECKED
+ UCLIBC_HAS_EXTRA_COMPAT_RES_STATE
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE
+ UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE
+ UCLIBC_HAS_FOPEN_LARGEFILE_MODE
+ UCLIBC_HAS_FTS
+ UCLIBC_HAS_FTW
+ UCLIBC_HAS_GETPT
+ UCLIBC_HAS_GLIBC_CUSTOM_PRINTF
+ UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_HEXADECIMAL_FLOATS
+ UCLIBC_HAS_LIBNSL_STUB
+ UCLIBC_HAS_LIBRESOLV_STUB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_NFTW
+ UCLIBC_HAS_OBSOLETE_BSD_SIGNAL
+ UCLIBC_HAS_OBSTACK
+ UCLIBC_HAS_PRINTF_M_SPEC
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_SSP
+ UCLIBC_HAS_STUBS
+ UCLIBC_HAS_SYS_ERRLIST
+ UCLIBC_HAS_SYS_SIGLIST
+ UCLIBC_HAS_THREADS_NATIVE
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMP
+ UCLIBC_HAS_UTMPX
+ UCLIBC_HAS_WCHAR
+ UCLIBC_HAS_WORDEXP
+ UCLIBC_NTP_LEGACY
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV2_LEGACY
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ )
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ kconfig_q_opt debug DODEBUG
+ kconfig_q_opt debug SUPPORT_LD_DEBUG
+ kconfig_q_opt debug UCLIBC_HAS_PROFILING
+
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+
+ kconfig_q_opt rpc UCLIBC_HAS_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_FULL_RPC
+ kconfig_q_opt rpc UCLIBC_HAS_REENTRANT_RPC
+
+ kconfig_q_opt hardened UCLIBC_BUILD_NOEXECSTACK
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_SSP
+
+ local count def
+ for count in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s|.*\<${def}\>.*set|${def}=y|g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s|${def}=y|# ${def} is not set|g" .config
+ done
+ make_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s|=.*|=\"${CTARGET}-\"|" \
+ -e "/^KERNEL_HEADERS/s|=.*|=\"$(alt_build_kprefix)\"|" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s|=.*|=\"/$(get_libdir)\"|" \
+ -e "/^DEVEL_PREFIX/s|=.*|=\"/usr\"|" \
+ -e "/^RUNTIME_PREFIX/s|=.*|=\"/\"|" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s|=.*|=\"${UCLIBC_EXTRA_CFLAGS}\"|" \
+ .config || die
+
+ make_oldconfig
+}
+
+pkg_setup() {
+ # Make sure our CHOST is a uclibc toolchain for native compiling
+ if [[ ${CHOST} == ${CTARGET} ]]; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+
+ # uClibc-ng doesn't carry old Linux threads, and since we force
+ # threading our only choice is NPTL which requires i486 and later.
+ [[ ${CTARGET} == i386* ]] && die "i386 can't support Native Posix Threads (NPTL)."
+}
+
+src_prepare() {
+ local version subversion extraversion
+
+ # uclibc-ng tries to create a two sym link with ld.so,
+ # ld-uClibc.so.{0,MAJOR_VERSION} -> ld-uClibc-<version>.so
+ # where MAJOR_VERSION != 0 indicates the ABI verison.
+ # We want to get rid of this and just have ABI = 0.
+ eapply "${FILESDIR}"/uclibc-compat-r1.patch
+
+ # We need to change the major.minor.sublevel of uclibc-ng.
+ # Upstream sets MAJOR_VERSION = 1 which breaks runtime linking.
+ # If we really want the ABI bump, we'll have to hack the gcc
+ # spec file and change the '*link:' rule.
+ version=( $(get_version_components) )
+ if [[ -z ${version[1]} ]]; then
+ subversion=0
+ extraversion=0
+ else
+ subversion=${version[1]}
+ if [[ -z ${version[2]} ]]; then
+ extraversion=0
+ else
+ extraversion=.${version[2]}
+ fi
+ fi
+
+ sed -i \
+ -e "/^MAJOR_VERSION/s|:=.*|:= 0|" \
+ -e "/^MINOR_VERSION/s|:=.*|:= ${version[0]}|" \
+ -e "/^SUBLEVEL/s|:=.*|:= ${subversion}|" \
+ -e "/^EXTRAVERSION/s|:=.*|:= ${extraversion}|" \
+ Rules.mak || die
+
+ eapply_user
+}
+
+src_configure() {
+ # Map our toolchain arch name to the name expected by uClibc-ng.
+ local target=$(tc-arch)
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm";;
+ mips) target="mips";;
+ ppc) target="powerpc";;
+ x86) target="i386";;
+ esac
+
+ # Do arch specific configuration by changing the defaults in
+ # extra/Configs/Config.<arch>. If these are not overridden
+ # by an save .config, they will be selected by default.
+
+ # For i386, i486, i586 and i686
+ local cpu
+ if [[ ${target} == "i386" ]]; then
+ [[ ${CTARGET} == i[456]86* ]] && cpu="${CTARGET:1:1}86"
+ sed -i -e "s|default CONFIG_686|default CONFIG_${cpu:-486}|" \
+ extra/Configs/Config.i386 || die
+ fi
+
+ # For arm
+ if [[ ${target} == "arm" ]]; then
+ sed -i -e '/Build for EABI/a \\tdefault y' extra/Configs/Config.arm
+ fi
+
+ # We set HOSTCC to the proper tuple rather than just 'gcc'
+ sed -i -e "s|^HOSTCC.*=.*|HOSTCC=$(tc-getBUILD_CC)|" Rules.mak
+
+ make_config ${target}
+
+ einfo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "ABI: ${ABI}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ einfo
+}
+
+src_compile() {
+ emake headers
+ just_headers && return 0
+
+ emake
+ if is_crosscompile ; then
+ emake -C utils hostutils
+ else
+ emake utils
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels
+ # normal vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target}
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig
+ newbin utils/ldd.host ${CTARGET}-ldd
+ fi
+ return 0
+ fi
+
+ if use symlink-compat; then
+ dosym libc.so.0 "${DESTDIR}"/lib/libcrypt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libdl.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libm.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libpthread.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/librt.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libresolv.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libubacktrace.so.0
+ dosym libc.so.0 "${DESTDIR}"/lib/libutil.so.0
+ fi
+
+ emake DESTDIR="${D}" install_utils
+ dobin extra/scripts/getent
+ dodoc README docs/*.txt
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest
new file mode 100644
index 000000000000..3e1ca7253552
--- /dev/null
+++ b/sys-libs/uclibc/Manifest
@@ -0,0 +1,8 @@
+DIST uClibc-0.9.33.2-patches-17.tar.bz2 32437 SHA256 4e846e5fa71815e37971d6bfc1ed1381a97189b38575a64ff9396f6a561d48e0 SHA512 6a6ad8aef862f742e60965c447e5abee2349886f01bf5e44111b2a6c21e59e4644195cf36e85b8ce0dabbf7b92dc2c36ae27f0b7a02b0f9f4278e46ec5fb5a76 WHIRLPOOL 02e1c35b57403dcf2beed599c37c8cb52dab36a8e4c87fb8e8cac9cc536640cb0bf47a3df2a939bae6a6d728035362ad0427f830ffd35c9db174a42e342a03d9
+DIST uClibc-0.9.33.2.tar.bz2 2834029 SHA256 988d2c777e0605fe253d12157f71ec68f25d1bb8428725d2b7460bf9977e1662 SHA512 1cf18fe5418e12ae12ce995d7455d465bc4737f225afc49512ec69858771e099bead7b18408b01c7e6f845dcc80c3b4f875332eeffdcc04ae4b48474fb29a8dd WHIRLPOOL e2ca16c179893a58228e701ddf8b5614cb6b3fe2eaa6e2a9b909a27f78a348723fa7ec99f7b437ce35d9ac0870e3e2ec4e4d46834ca6b3cbc3d8fa5306b57fb4
+EBUILD uclibc-0.9.33.2-r15.ebuild 9422 SHA256 e16a14371fbed51bd64d0e2008d2a72adc43fc153a2184498f7294edd8d4196d SHA512 a5bab81d76c55cd4b5a1dfbc5d2d89b19ffa5d4e800947952a64adfba9045bd1f9979e178549f54f1acc2cacf52f8e15571bb633ca8476c6798fb990e78285bb WHIRLPOOL 2a19f4a45644f86ee585a92506631d59b9824b2cdd9e257e5ba85ecbb12173201e42f634bd094836a8041b31f9034891a8eb741daab235e4a37fefac02a2fc55
+EBUILD uclibc-0.9.33.9999.ebuild 9384 SHA256 6a7de65583643e4ff2f6346b49fa9873a9dc476f999c0734587833e983a3590d SHA512 88fda23fad51de81f9e7b392a0879711c0df0a1df632e68805e3a4669da8284b3c4374886371c1d445533ab7487636d974a33c1d2bbceb7c442727ca6cb2114c WHIRLPOOL 7617ca559756f046963158a51ca4feb21f76e6d62cc3ec2881988a6bd5f91958bf8297dff285731334b91f2851cd34a46ceaff036a56f2bf01594e8a4b8edd65
+EBUILD uclibc-9999.ebuild 9365 SHA256 45da9e9d722d5054ecadf07a6b34e1393fccfb4d846809727004e7c9e264e0e6 SHA512 be886e84791f55231b9a97c5c04f5bd7fd7a025895a8e9ab8ee8127e9b866b0f3c1a9e3ae58bad56805aa835c0f790ef843e1138a8af493c2e9d63fde1e65a14 WHIRLPOOL afaf43be6a2d8cf4337fb2d03cbaec61567c9c9c0f7164337a9228f899949189156aa9df734d844287a72039af6769d19df59b1708133da58e2672586f21333f
+MISC ChangeLog 3776 SHA256 b261877c05e03f16476fdd663fad366805b77e7e8511c3e2d06e25ac97d6d281 SHA512 6e9e61ecdcd0faa8de692a7ad2780490528030482747d6633de2bf4dfd9f9b81af773e56369c9a8e695bcebcbec32b1435024dafdc5cf4ed94e512727b78be12 WHIRLPOOL 9e95bf4593c5f675ea876039064edd988d762f27619eb285ecd52fdbe0dbcc781289fa39d936da13d8836ffba9a3279faf6f456436b4c9ce83e16d5eaf63ed62
+MISC ChangeLog-2015 26683 SHA256 6b656269e94f48642cec9f9cbab26b0a166d56582209d069432da6ed371547d7 SHA512 349e93c6d23a86070b5fceda6c236d96ab0d25e94a167e9c86a343177914310078633612479946b307e8046f8e96d305dfa92f4537a5ee1a90ef9dfbfffd3d60 WHIRLPOOL 884bd471874c41751c0444192596a060b06c59a218ffc481e3ee2e925d42dd6a120d02a8861e593ab63c3605340513492dbab4efaec388d65e8c8736c0c513df
+MISC metadata.xml 1519 SHA256 a27febdfa5e93a11df21f003469e1c5fd7e570322eea4f432b5dfbdf7a855fb0 SHA512 cd2a95b09f2128cab2a991c9da0e6d49b862799b772c4f28cfe13745f06870eb623eedd2ca50d28bceeb1be7464aff7e3ecc37044f634b5a876b5f6405fb854b WHIRLPOOL b1ad712a907dba8e971fbaac0d434a376e8368885b2a704a98c376cf68c4bd1e56c9725e45bb493dd2ab7fbdf3359d685e5e5efb15e4b6ef38b5867f69b91a6d
diff --git a/sys-libs/uclibc/metadata.xml b/sys-libs/uclibc/metadata.xml
new file mode 100644
index 000000000000..cd311b1b4b49
--- /dev/null
+++ b/sys-libs/uclibc/metadata.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>vapier@gentoo.org</email>
+ <description>Primary Maintainer</description>
+ </maintainer>
+ <maintainer type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>embedded@gentoo.org</email>
+ <name>Embedded Gentoo</name>
+ </maintainer>
+ <longdescription>
+uClibc pronounced yew-see-lib-see is a C library for developing embedded Linux
+systems. It is much smaller than the GNU C Library, but nearly all applications supported
+by glibc also work perfectly with uClibc. Porting applications from glibc to uClibc
+typically involves just recompiling the source code. uClibc even supports shared libraries
+and threading. It currently runs on standard Linux and MMU-less (also known as uClinux)
+systems with support for alpha, ARM, cris, i386, i960, h8300, m68k, mips/mipsel, PowerPC,
+SH, SPARC, and v850 processors.
+</longdescription>
+<use>
+ <flag name="rpc">Enable sun nis/rpc support (you should use libtirpc though)</flag>
+ <flag name="ssp">Force the use of ssp to be built into a hardened uclibc setup</flag>
+ <flag name="savedconfig">Adds support for user defined configs</flag>
+ <flag name="uclibc-compat">Build uclibc with backwards compatible
+ options</flag>
+ <flag name="wordexp">Add support for word expansion (wordexp.h)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-libs/uclibc/uclibc-0.9.33.2-r15.ebuild b/sys-libs/uclibc/uclibc-0.9.33.2-r15.ebuild
new file mode 100644
index 000000000000..2702793af658
--- /dev/null
+++ b/sys-libs/uclibc/uclibc-0.9.33.2-r15.ebuild
@@ -0,0 +1,355 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils flag-o-matic multilib toolchain-funcs savedconfig
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.busybox.net/uClibc"
+ inherit git-2
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+MY_P=uClibc-${PV}
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="https://www.uclibc.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER="17"
+ SRC_URI="https://uclibc.org/downloads/${MY_P}.tar.bz2
+ ${PATCH_VER:+mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2}"
+ KEYWORDS="-* amd64 arm m68k ~mips ppc sh sparc x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 nptl rpc ssp uclibc-compat wordexp crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# We cannot migrate between uclibc and uclibc-ng because as soon as portage
+# updates the ld.so sym link, the system breaks. Ideally this should be a
+# hard blocker, but EAPI=0 doesn't allow hard blockers.
+RDEPEND="!sys-libs/uclibc-ng"
+
+S=${WORKDIR}/${MY_P}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+pkg_setup() {
+ if [ ${CTARGET} = ${CHOST} ] ; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+}
+
+check_cpu_opts() {
+ case ${CTARGET} in
+ # Need to handle $ABI here w/mips.
+ mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
+ sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
+ i[3456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
+ # XXX: Should figure out how to handle sparc.
+ esac
+
+ if use nptl ; then
+ case ${CTARGET} in
+ i386*)
+ die "Your target has no support for NPTL"
+ ;;
+ esac
+ fi
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+src_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+src_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ src_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=${target} defconfig >/dev/null || die
+
+ local defs_{y,n} defs
+
+ defs=(
+ DO{DEBUG_PT,ASSERTS}
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_PROFILING
+ )
+ kconfig_q_opt n "${defs[@]}"
+ kconfig_q_opt debug DODEBUG SUPPORT_LD_DEBUG
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ if [[ ${CTARGET} == arm* ]] ; then
+ kconfig_q_opt n CONFIG_ARM_OABI
+ kconfig_q_opt y CONFIG_ARM_EABI
+ fi
+
+ defs=(
+ LDSO_GNU_HASH_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ DO_C99_MATH
+ UCLIBC_HAS_{CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC}
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_{N,}FTW
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_SHA256_CRYPT_IMPL
+ UCLIBC_HAS_SHA512_CRYPT_IMPL
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMPX
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ PTHREADS_DEBUG_SUPPORT
+ )
+ kconfig_q_opt y "${defs[@]}"
+ kconfig_q_opt n UCLIBC_HAS_CTYPE_UNSAFE
+ kconfig_q_opt n UCLIBC_HAS_LOCALE
+ kconfig_q_opt n HAS_NO_THREADS
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+ kconfig_q_opt nptl UCLIBC_HAS_THREADS_NATIVE
+ kconfig_q_opt !nptl LINUXTHREADS_OLD
+ kconfig_q_opt rpc UCLIBC_HAS_{,{FULL,REENTRANT}_}RPC
+ kconfig_q_opt wordexp UCLIBC_HAS_WORDEXP
+ kconfig_q_opt uclibc-compat UCLIBC_HAS_LIB{NSL,RESOLV}_STUB COMPAT_ATEXIT
+
+ # we need to do it independently of hardened to get ssp.c built into libc
+ kconfig_q_opt y UCLIBC_HAS_SSP
+ kconfig_q_opt n UCLIBC_HAS_SSP_COMPAT
+ kconfig_q_opt y UCLIBC_HAS_ARC4RANDOM
+ kconfig_q_opt n PROPOLICE_BLOCK_ABRT
+ kconfig_q_opt y PROPOLICE_BLOCK_SEGV
+
+ # arm/mips do not emit PT_GNU_STACK, but if we enable this here
+ # it will be emitted as RWE, ppc has to be checked, x86 needs it
+ # this option should be used independently of hardened
+ if has $(tc-arch) x86 || has $(tc-arch) ppc ; then
+ kconfig_q_opt y UCLIBC_BUILD_NOEXECSTACK
+ else
+ kconfig_q_opt n UCLIBC_BUILD_NOEXECSTACK
+ fi
+ kconfig_q_opt y UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt !ssp SSP_QUICK_CANARY
+ kconfig_q_opt ssp UCLIBC_BUILD_SSP
+
+ local def
+ for def in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s:.*\<${def}\>.*set:${def}=y:g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s:${def}=y:# ${def} is not set:g" .config
+ done
+ src_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CTARGET}-\":" \
+ -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
+ -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
+ -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \
+ .config || die
+
+ src_oldconfig
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ else
+ unpack ${A}
+ fi
+ cd "${S}"
+ if [[ -n ${PATCH_VER} ]] ; then
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ fi
+
+ epatch_user
+
+ check_cpu_opts
+
+ echo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "CPU: ${UCLIBC_CPU:-default}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ echo
+
+ ########## CPU SELECTION ##########
+
+ local target=$(tc-arch) config_target
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm"; config_target="GENERIC_ARM";;
+ avr) target="avr32";;
+ mips) target="mips"; config_target="MIPS_ISA_1";;
+ ppc) target="powerpc";;
+ sh) target="sh"; config_target="SH4";;
+ x86) target="i386"; config_target="486";;
+ esac
+ if [[ -n ${config_target} ]] ; then
+ sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
+ extra/Configs/Config.${target} || die
+ fi
+ sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak
+
+ src_config
+
+ if use iconv ; then
+ # Run after make clean, otherwise files removed
+ find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt
+ if [[ ! -f /etc/locale.gen ]] ; then
+ # See ./extra/locale/LOCALES for examples
+ die "Please create an appropriate /etc/locale.gen for locale support"
+ fi
+ echo -e "@euro e\n@cyrillic c\n#---\nUTF-8 yes\n8-BIT yes\n#---\n\n" > ./extra/locale/locales.txt
+ cat /etc/locale.gen >> ./extra/locale/locales.txt
+ fi
+}
+
+src_compile() {
+ emake headers || die
+ just_headers && return 0
+
+ emake || die
+ if is_crosscompile ; then
+ emake -C utils hostutils || die
+ else
+ emake utils || die
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels - normal
+ # vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check || die
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target} || die
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig || die
+ newbin utils/ldd.host ${CTARGET}-ldd || die
+ fi
+ return 0
+ fi
+
+ emake DESTDIR="${D}" install_utils || die
+ dobin extra/scripts/getent
+ dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc/uclibc-0.9.33.9999.ebuild b/sys-libs/uclibc/uclibc-0.9.33.9999.ebuild
new file mode 100644
index 000000000000..82d3a46528c1
--- /dev/null
+++ b/sys-libs/uclibc/uclibc-0.9.33.9999.ebuild
@@ -0,0 +1,354 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils flag-o-matic multilib toolchain-funcs savedconfig
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_BRANCH="0.9.33"
+ EGIT_REPO_URI="git://git.busybox.net/uClibc"
+ inherit git-2
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+MY_P=uClibc-${PV}
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="https://www.uclibc.org/"
+if [[ ${PV} != *9999 ]] ; then
+ PATCH_VER=""
+ SRC_URI="https://uclibc.org/downloads/${MY_P}.tar.bz2
+ ${PATCH_VER:+mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2}"
+ KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 nptl rpc ssp uclibc-compat wordexp crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# We cannot migrate between uclibc and uclibc-ng because as soon as portage
+# updates the ld.so sym link, the system breaks. Ideally this should be a
+# hard blocker, but EAPI=0 doesn't allow hard blockers.
+RDEPEND="!sys-libs/uclibc-ng"
+
+S=${WORKDIR}/${MY_P}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+pkg_setup() {
+ if [ ${CTARGET} = ${CHOST} ] ; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+}
+
+check_cpu_opts() {
+ case ${CTARGET} in
+ # Need to handle $ABI here w/mips.
+ mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
+ sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
+ i[3456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
+ # XXX: Should figure out how to handle sparc.
+ esac
+
+ if use nptl ; then
+ case ${CTARGET} in
+ i386*)
+ die "Your target has no support for NPTL"
+ ;;
+ esac
+ fi
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+src_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+src_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ src_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=${target} defconfig >/dev/null || die
+
+ local defs_{y,n} defs
+
+ defs=(
+ DO{DEBUG_PT,ASSERTS}
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_PROFILING
+ )
+ kconfig_q_opt n "${defs[@]}"
+ kconfig_q_opt debug DODEBUG SUPPORT_LD_DEBUG
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ if [[ ${CTARGET} == arm* ]] ; then
+ kconfig_q_opt n CONFIG_ARM_OABI
+ kconfig_q_opt y CONFIG_ARM_EABI
+ fi
+
+ defs=(
+ LDSO_GNU_HASH_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ DO_C99_MATH
+ UCLIBC_HAS_{CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC}
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_{N,}FTW
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMPX
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ PTHREADS_DEBUG_SUPPORT
+ )
+ kconfig_q_opt y "${defs[@]}"
+ kconfig_q_opt n UCLIBC_HAS_CTYPE_UNSAFE
+ kconfig_q_opt n UCLIBC_HAS_LOCALE
+ kconfig_q_opt n HAS_NO_THREADS
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+ kconfig_q_opt nptl UCLIBC_HAS_THREADS_NATIVE
+ kconfig_q_opt !nptl LINUXTHREADS_OLD
+ kconfig_q_opt rpc UCLIBC_HAS_{,{FULL,REENTRANT}_}RPC
+ kconfig_q_opt wordexp UCLIBC_HAS_WORDEXP
+ kconfig_q_opt uclibc-compat UCLIBC_HAS_LIB{NSL,RESOLV}_STUB COMPAT_ATEXIT
+
+ # we need to do it independently of hardened to get ssp.c built into libc
+ kconfig_q_opt y UCLIBC_HAS_SSP
+ kconfig_q_opt n UCLIBC_HAS_SSP_COMPAT
+ kconfig_q_opt y UCLIBC_HAS_ARC4RANDOM
+ kconfig_q_opt n PROPOLICE_BLOCK_ABRT
+ kconfig_q_opt y PROPOLICE_BLOCK_SEGV
+
+ # arm/mips do not emit PT_GNU_STACK, but if we enable this here
+ # it will be emitted as RWE, ppc has to be checked, x86 needs it
+ # this option should be used independently of hardened
+ if has $(tc-arch) x86 || has $(tc-arch) ppc ; then
+ kconfig_q_opt y UCLIBC_BUILD_NOEXECSTACK
+ else
+ kconfig_q_opt n UCLIBC_BUILD_NOEXECSTACK
+ fi
+ kconfig_q_opt y UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt !ssp SSP_QUICK_CANARY
+ kconfig_q_opt ssp UCLIBC_BUILD_SSP
+
+ local def
+ for def in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s:.*\<${def}\>.*set:${def}=y:g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s:${def}=y:# ${def} is not set:g" .config
+ done
+ src_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CTARGET}-\":" \
+ -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
+ -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
+ -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \
+ .config || die
+
+ src_oldconfig
+}
+
+src_unpack() {
+ if [[ ${PV} == *9999 ]] ; then
+ git-2_src_unpack
+ else
+ unpack ${A}
+ fi
+ cd "${S}"
+ if [[ -n ${PATCH_VER} ]] ; then
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ fi
+
+ epatch_user
+
+ check_cpu_opts
+
+ echo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "CPU: ${UCLIBC_CPU:-default}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ echo
+
+ ########## CPU SELECTION ##########
+
+ local target=$(tc-arch) config_target
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm"; config_target="GENERIC_ARM";;
+ avr) target="avr32";;
+ mips) target="mips"; config_target="MIPS_ISA_1";;
+ ppc) target="powerpc";;
+ sh) target="sh"; config_target="SH4";;
+ x86) target="i386"; config_target="486";;
+ esac
+ if [[ -n ${config_target} ]] ; then
+ sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
+ extra/Configs/Config.${target} || die
+ fi
+ sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak
+
+ src_config
+
+ if use iconv ; then
+ # Run after make clean, otherwise files removed
+ find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt
+ if [[ ! -f /etc/locale.gen ]] ; then
+ # See ./extra/locale/LOCALES for examples
+ die "Please create an appropriate /etc/locale.gen for locale support"
+ fi
+ echo -e "@euro e\n@cyrillic c\n#---\nUTF-8 yes\n8-BIT yes\n#---\n\n" > ./extra/locale/locales.txt
+ cat /etc/locale.gen >> ./extra/locale/locales.txt
+ fi
+}
+
+src_compile() {
+ emake headers || die
+ just_headers && return 0
+
+ emake || die
+ if is_crosscompile ; then
+ emake -C utils hostutils || die
+ else
+ emake utils || die
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels - normal
+ # vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check || die
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target} || die
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig || die
+ newbin utils/ldd.host ${CTARGET}-ldd || die
+ fi
+ return 0
+ fi
+
+ emake DESTDIR="${D}" install_utils || die
+ dobin extra/scripts/getent
+ dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uclibc/uclibc-9999.ebuild b/sys-libs/uclibc/uclibc-9999.ebuild
new file mode 100644
index 000000000000..fb29176b32f1
--- /dev/null
+++ b/sys-libs/uclibc/uclibc-9999.ebuild
@@ -0,0 +1,353 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils flag-o-matic multilib toolchain-funcs savedconfig
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.busybox.net/uClibc"
+ inherit git-2
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+MY_P=uClibc-${PV}
+DESCRIPTION="C library for developing embedded Linux systems"
+HOMEPAGE="https://www.uclibc.org/"
+if [[ ${PV} != "9999" ]] ; then
+ PATCH_VER=""
+ SRC_URI="https://uclibc.org/downloads/${MY_P}.tar.bz2
+ ${PATCH_VER:+mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2}"
+ KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug hardened iconv ipv6 nptl rpc ssp uclibc-compat wordexp crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# We cannot migrate between uclibc and uclibc-ng because as soon as portage
+# updates the ld.so sym link, the system breaks. Ideally this should be a
+# hard blocker, but EAPI=0 doesn't allow hard blockers.
+RDEPEND="!sys-libs/uclibc-ng"
+
+S=${WORKDIR}/${MY_P}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+alt_build_kprefix() {
+ if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] ; then
+ echo /usr/include
+ else
+ echo /usr/${CTARGET}/usr/include
+ fi
+}
+
+just_headers() {
+ use crosscompile_opts_headers-only && is_crosscompile
+}
+
+uclibc_endian() {
+ # XXX: this wont work for a toolchain which is bi-endian, but we
+ # dont have any such thing at the moment, so not a big deal
+ touch "${T}"/endian.s
+ $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+ case $(file "${T}"/endian.o) in
+ *" MSB "*) echo "BIG";;
+ *" LSB "*) echo "LITTLE";;
+ *) echo "NFC";;
+ esac
+ rm -f "${T}"/endian.{s,o}
+}
+
+pkg_setup() {
+ if [ ${CTARGET} = ${CHOST} ] ; then
+ case ${CHOST} in
+ *-uclinux*|*-uclibc*) ;;
+ *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;;
+ esac
+ fi
+}
+
+check_cpu_opts() {
+ case ${CTARGET} in
+ # Need to handle $ABI here w/mips.
+ mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";;
+ sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";;
+ i[3456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";;
+ # XXX: Should figure out how to handle sparc.
+ esac
+
+ if use nptl ; then
+ case ${CTARGET} in
+ i386*)
+ die "Your target has no support for NPTL"
+ ;;
+ esac
+ fi
+}
+
+kconfig_q_opt() {
+ local flag=$1; shift
+ case ${flag} in
+ y|n) ;;
+ *) flag=$(usex ${flag} y n) ;;
+ esac
+
+ local var="defs_${flag}"
+ eval "${var}+=( $* )"
+}
+
+get_opt() {
+ (
+ unset ${1}
+ . ${2:-"${S}"/.config}
+ echo ${!1}
+ )
+}
+
+src_oldconfig() {
+ yes "" 2>/dev/null | emake -s oldconfig >/dev/null
+}
+src_config() {
+ restore_config .config
+ if [ -f .config ]; then
+ src_oldconfig
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ emake ARCH=${target} defconfig >/dev/null || die
+
+ local defs_{y,n} defs
+
+ defs=(
+ DO{DEBUG_PT,ASSERTS}
+ SUPPORT_LD_DEBUG_EARLY
+ UCLIBC_HAS_PROFILING
+ )
+ kconfig_q_opt n "${defs[@]}"
+ kconfig_q_opt debug DODEBUG SUPPORT_LD_DEBUG
+
+ sed -i -e '/ARCH_.*_ENDIAN/d' .config
+ kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN"
+
+ if [[ ${CTARGET} == arm* ]] ; then
+ kconfig_q_opt n CONFIG_ARM_OABI
+ kconfig_q_opt y CONFIG_ARM_EABI
+ fi
+
+ defs=(
+ LDSO_GNU_HASH_SUPPORT
+ MALLOC_GLIBC_COMPAT
+ DO_C99_MATH
+ UCLIBC_HAS_{CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC}
+ UCLIBC_HAS_FENV
+ UCLIBC_HAS_{N,}FTW
+ UCLIBC_HAS_GNU_GLOB
+ UCLIBC_HAS_LIBUTIL
+ UCLIBC_HAS_PROGRAM_INVOCATION_NAME
+ UCLIBC_HAS_RESOLVER_SUPPORT
+ UCLIBC_HAS_TZ_FILE_READ_MANY
+ UCLIBC_HAS_UTMPX
+ UCLIBC_SUPPORT_AI_ADDRCONFIG
+ UCLIBC_SUSV3_LEGACY
+ UCLIBC_SUSV3_LEGACY_MACROS
+ UCLIBC_SUSV4_LEGACY
+ UCLIBC_USE_NETLINK
+ PTHREADS_DEBUG_SUPPORT
+ )
+ kconfig_q_opt y "${defs[@]}"
+ kconfig_q_opt n UCLIBC_HAS_CTYPE_UNSAFE
+ kconfig_q_opt n UCLIBC_HAS_LOCALE
+ kconfig_q_opt n HAS_NO_THREADS
+ kconfig_q_opt ipv6 UCLIBC_HAS_IPV6
+ kconfig_q_opt nptl UCLIBC_HAS_THREADS_NATIVE
+ kconfig_q_opt !nptl LINUXTHREADS_OLD
+ kconfig_q_opt rpc UCLIBC_HAS_{,{FULL,REENTRANT}_}RPC
+ kconfig_q_opt wordexp UCLIBC_HAS_WORDEXP
+ kconfig_q_opt uclibc-compat UCLIBC_HAS_LIB{NSL,RESOLV}_STUB COMPAT_ATEXIT
+
+ # we need to do it independently of hardened to get ssp.c built into libc
+ kconfig_q_opt y UCLIBC_HAS_SSP
+ kconfig_q_opt n UCLIBC_HAS_SSP_COMPAT
+ kconfig_q_opt y UCLIBC_HAS_ARC4RANDOM
+ kconfig_q_opt n PROPOLICE_BLOCK_ABRT
+ kconfig_q_opt y PROPOLICE_BLOCK_SEGV
+
+ # arm/mips do not emit PT_GNU_STACK, but if we enable this here
+ # it will be emitted as RWE, ppc has to be checked, x86 needs it
+ # this option should be used independently of hardened
+ if has $(tc-arch) x86 || has $(tc-arch) ppc ; then
+ kconfig_q_opt y UCLIBC_BUILD_NOEXECSTACK
+ else
+ kconfig_q_opt n UCLIBC_BUILD_NOEXECSTACK
+ fi
+ kconfig_q_opt y UCLIBC_BUILD_RELRO
+ kconfig_q_opt hardened UCLIBC_BUILD_PIE
+ kconfig_q_opt hardened UCLIBC_BUILD_NOW
+ kconfig_q_opt !ssp SSP_QUICK_CANARY
+ kconfig_q_opt ssp UCLIBC_BUILD_SSP
+
+ local def
+ for def in 1 2 ; do
+ # Run twice as some config opts depend on others being enabled first.
+ for def in ${defs_y[@]} ; do
+ sed -i -e "s:.*\<${def}\>.*set:${def}=y:g" .config
+ done
+ for def in ${defs_n[@]} ; do
+ sed -i -e "s:${def}=y:# ${def} is not set:g" .config
+ done
+ src_oldconfig
+ done
+
+ einfo "Enabled options:"
+ for def in ${defs_y[@]} ; do
+ einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}")
+ done
+ einfo "Disabled options:"
+ for def in ${defs_n[@]} ; do
+ einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}")
+ done
+
+ # setup build and run paths
+ sed -i \
+ -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CTARGET}-\":" \
+ -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \
+ -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \
+ -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \
+ -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \
+ -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \
+ .config || die
+
+ src_oldconfig
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ else
+ unpack ${A}
+ fi
+ cd "${S}"
+ if [[ -n ${PATCH_VER} ]] ; then
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ fi
+
+ epatch_user
+
+ check_cpu_opts
+
+ echo
+ einfo "Runtime Prefix: /"
+ einfo "Devel Prefix: /usr"
+ einfo "Kernel Prefix: $(alt_build_kprefix)"
+ einfo "CBUILD: ${CBUILD}"
+ einfo "CHOST: ${CHOST}"
+ einfo "CTARGET: ${CTARGET}"
+ einfo "CPU: ${UCLIBC_CPU:-default}"
+ einfo "ENDIAN: $(uclibc_endian)"
+ echo
+
+ ########## CPU SELECTION ##########
+
+ local target=$(tc-arch) config_target
+ case ${target} in
+ amd64) target="x86_64";;
+ arm) target="arm"; config_target="GENERIC_ARM";;
+ avr) target="avr32";;
+ mips) target="mips"; config_target="MIPS_ISA_1";;
+ ppc) target="powerpc";;
+ sh) target="sh"; config_target="SH4";;
+ x86) target="i386"; config_target="486";;
+ esac
+ if [[ -n ${config_target} ]] ; then
+ sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \
+ extra/Configs/Config.${target} || die
+ fi
+ sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak
+
+ src_config
+
+ if use iconv ; then
+ # Run after make clean, otherwise files removed
+ find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt
+ if [[ ! -f /etc/locale.gen ]] ; then
+ # See ./extra/locale/LOCALES for examples
+ die "Please create an appropriate /etc/locale.gen for locale support"
+ fi
+ echo -e "@euro e\n@cyrillic c\n#---\nUTF-8 yes\n8-BIT yes\n#---\n\n" > ./extra/locale/locales.txt
+ cat /etc/locale.gen >> ./extra/locale/locales.txt
+ fi
+}
+
+src_compile() {
+ emake headers || die
+ just_headers && return 0
+
+ emake || die
+ if is_crosscompile ; then
+ emake -C utils hostutils || die
+ else
+ emake utils || die
+ fi
+}
+
+src_test() {
+ is_crosscompile && return 0
+
+ # assert test fails on pax/grsec enabled kernels - normal
+ # vfork test fails in sandbox (both glibc/uclibc)
+ emake UCLIBC_ONLY=1 check || die
+}
+
+src_install() {
+ local sysroot=${D}
+ is_crosscompile && sysroot+="/usr/${CTARGET}"
+
+ local target="install"
+ just_headers && target="install_headers"
+ emake DESTDIR="${sysroot}" ${target} || die
+
+ save_config .config
+
+ # remove files coming from kernel-headers
+ rm -rf "${sysroot}"/usr/include/{linux,asm*}
+
+ # Make sure we install the sys-include symlink so that when
+ # we build a 2nd stage cross-compiler, gcc finds the target
+ # system headers correctly. See gcc/doc/gccinstall.info
+ if is_crosscompile ; then
+ dosym usr/include /usr/${CTARGET}/sys-include
+ if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then
+ newbin utils/ldconfig.host ${CTARGET}-ldconfig || die
+ newbin utils/ldd.host ${CTARGET}-ldd || die
+ fi
+ return 0
+ fi
+
+ emake DESTDIR="${D}" install_utils || die
+ dobin extra/scripts/getent
+ dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ if [ ! -e "${ROOT}"/etc/TZ ] ; then
+ ewarn "Please remember to set your timezone in /etc/TZ"
+ mkdir -p "${ROOT}"/etc
+ echo "UTC" > "${ROOT}"/etc/TZ
+ fi
+ [ "${ROOT}" != "/" ] && return 0
+ # update cache before reloading init
+ ldconfig
+ # reload init ...
+ /sbin/telinit U 2>/dev/null
+}
diff --git a/sys-libs/uid_wrapper/Manifest b/sys-libs/uid_wrapper/Manifest
new file mode 100644
index 000000000000..07637d4d6fe3
--- /dev/null
+++ b/sys-libs/uid_wrapper/Manifest
@@ -0,0 +1,8 @@
+DIST uid_wrapper-1.2.1-alpha_fix.patch 932 SHA256 68361230e84222a4e6a22c79065f81a5fc2b1e25041b96bf645209d578c43027 SHA512 0daaadf84a48f5e450fac833e5b0e76860b82706a343224d10a8ff24d0607d9d81f628f09619aaae8ea918ac48a8c621e457863f9d52b46a1950493869468854 WHIRLPOOL fd118b8b4f47eeaf0339f09234364cb0f3bf52bfcc54fdf17e5e477d873d17a0348e671e038c4970d1a18cf488f7b43316aa8159914c3ada6312c397806d933f
+DIST uid_wrapper-1.2.1.tar.gz 311002 SHA256 827c8290d9982385f18d5e0e5908a790ce1cb45d93e49727651abe9928c2df7a SHA512 563577bf3f4ca2989040635301faccc198da34a30b6998370d376f8df8c689953d2f10474efc926cb06d23e565cee32b4f59fce87546c3620d55cd9f7e0cf543 WHIRLPOOL ad3135c8a927fcad0916f50a24bad22c45e973650c367b91b5893c5ab04796c43c5d542bf89aba1800b4c79c84ea19457ced9ef62ba49f0ea2916751758c9556
+DIST uid_wrapper-1.2.4.tar.gz 311811 SHA256 3c60f65371420074ef437796a36beef2d713c28bd5c5fbf29c3e7a9647cd50fa SHA512 212b35f7d0655611c5bb7927e4e29049ce79a4e677805fa7154142dff559ddc6dd7117a4c94314b69e27c954ff03ef49470ed69e2405cf46b5958643c6021d3b WHIRLPOOL ceb077042135e10d6de6f5d5a4614a3c83692455952de0950f521c5f07d1b514464da8b9c571bc4ef002b520bfb1aedd9c40c3fdf866a30ae2dab81d3d5834a4
+EBUILD uid_wrapper-1.2.1.ebuild 1101 SHA256 c4252f5776c5db8cf38d7dbaf842c181378a67a6be54c6f0241875c6babb828d SHA512 c769d78d6e8ca71dd02f75a6e70e82b74826d87abd18e6bd46c232d306c23ee6b436b820759fdd7c2ae22152325b5ed3c45dd2ab1cab98f693f74bf3d1569095 WHIRLPOOL 05b075413167757ba34e8b23f00b2d8c461f096673618c277d10984074755e1942380430a314b27dc13e7063be11f3df071cceff220f887d0ed7b51055f996f6
+EBUILD uid_wrapper-1.2.4.ebuild 477 SHA256 883d3e3e48857265a23f477e7480f6e97b7d81a07305229d14460bf4e6c1fbd1 SHA512 1969fd81cb2693b8976791ebd49d1cc22eaa787cf69ee4c9eac0cd7f96bb3a63560bab498ad74e45aa7ffdb683e6223c812a821185d646e0b14d4ab2af846e4b WHIRLPOOL 4a235482ff6c7cd43d28bb14ee027b852488900b29923b83e5c2deb14a498e0b963e239a86221b14a0c7fb0536f8f9de7be22b74f5023b78addd40d2f23f05cf
+MISC ChangeLog 6514 SHA256 6e10a54d37ad7d8881f4b02dea9b1ac3e58d7a76c9afcd0d88ae86acb47b25cc SHA512 0b00c7813eb7343bbe767b9fa24c9caf6a2b19490250ee24c61a0a6332185086ddafc66ef8ed057caca8d36e8fd322ecadff5f998fc3c1f168dd5e5c2597dd8f WHIRLPOOL cd1b55aa7887db70340f6b5aa1c7dfe2fa46859431ef2924f734cc9f554452b287a15fd5255f00b14531e9188db219a3a0d304101375b000ef0e7f88cb437216
+MISC ChangeLog-2015 493 SHA256 404f5bd57558f7a607970dbc313a963d1db32522c19982b617f17e0f846c793b SHA512 412badd96ac1ff3ed88beb043e101ec4e8b8af79ea830a114b0122ffe20863b48a8898a0090368a4e035df2768481a08d566225b87a4d6f82577e2d5a34ab001 WHIRLPOOL 9441ffbc6c8eea2adf3408c684dde1a6394b0e6e547b468a4f0dc08c23ce51c1e0bc2e10441598823d5fae43cff6812cdd48ca021bc33a03044e628b30224f92
+MISC metadata.xml 360 SHA256 debc337b7549e12f55cf6ebdf900a95eb3b2370aa60daa49fd7ae97659ca5a85 SHA512 6cfeb9ed18b5c3b6c6e6875311bad627e9baffdf7b0846d70c8e0e36ce053ce849f867e963f7504292bbeb4b133c828e75a2d877c34fe7858ab3b9403ce533d2 WHIRLPOOL 1e6aa7563470c001516ce0b5f398d4fb5d854bb8a3a47a6631bd53f9b377950644ccb487a651f9648ead2815b815e8fd16d3cf7b6cd5c2d18958472b2a25c421
diff --git a/sys-libs/uid_wrapper/metadata.xml b/sys-libs/uid_wrapper/metadata.xml
new file mode 100644
index 000000000000..f05d1f266834
--- /dev/null
+++ b/sys-libs/uid_wrapper/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 type="person">
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+<maintainer type="project">
+ <email>samba@gentoo.org</email>
+ <name>Samba</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/uid_wrapper/uid_wrapper-1.2.1.ebuild b/sys-libs/uid_wrapper/uid_wrapper-1.2.1.ebuild
new file mode 100644
index 000000000000..6fc4d904cfc3
--- /dev/null
+++ b/sys-libs/uid_wrapper/uid_wrapper-1.2.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+DESCRIPTION="A wrapper to fake privilege separation"
+HOMEPAGE="https://cwrap.org/uid_wrapper.html"
+SRC_URI="ftp://ftp.samba.org/pub/cwrap/${P}.tar.gz
+ https://ftp.samba.org/pub/cwrap/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 sparc x86"
+IUSE="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+# https://bugs.gentoo.org/578668
+SRC_URI+=" https://git.samba.org/?p=uid_wrapper.git;a=blobdiff_plain;f=src/uid_wrapper.c;h=ded857a1b18f4744bac324b0ccaee3b2d2d146fa;hp=34889e0c3f955ad04bda3859b734a86763dee529;hb=cf2b35344d4de927f158a1e6d5b6bbc1be2ffd96;hpb=a00a6b8b300b7baa867191e2bc016b835cf8d1b3 -> ${PN}-1.2.1-alpha_fix.patch"
+PATCHES=(
+ "${DISTDIR}/${P}-alpha_fix.patch"
+)
+
+# Work around a problem with >=dev-util/cmake-3.3.0 (bug #558340)
+# Because of this we cannot use cmake-multilib_src_configure() here.
+multilib_src_configure() {
+ local mycmakeargs=( -DCMAKE_LIBRARY_PATH=/usr/$(get_libdir) )
+ cmake-utils_src_configure
+}
diff --git a/sys-libs/uid_wrapper/uid_wrapper-1.2.4.ebuild b/sys-libs/uid_wrapper/uid_wrapper-1.2.4.ebuild
new file mode 100644
index 000000000000..2eb9a6056482
--- /dev/null
+++ b/sys-libs/uid_wrapper/uid_wrapper-1.2.4.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+DESCRIPTION="A wrapper to fake privilege separation"
+HOMEPAGE="https://cwrap.org/uid_wrapper.html"
+SRC_URI="ftp://ftp.samba.org/pub/cwrap/${P}.tar.gz
+ https://ftp.samba.org/pub/cwrap/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
diff --git a/sys-libs/zlib/Manifest b/sys-libs/zlib/Manifest
new file mode 100644
index 000000000000..cdb36a2f44c6
--- /dev/null
+++ b/sys-libs/zlib/Manifest
@@ -0,0 +1,7 @@
+AUX zlib-1.2.11-fix-deflateParams-usage.patch 2937 SHA256 0b8c6cbbb179fdb55fb492657a6c4514b4035ff126c353ef9fae2e5a0837c1c6 SHA512 9b949d894be2bbb60d687820e79d7a02e733e8426e6602482f3a3902fca3571bbfba38ddd84a88f5a093fdb25ac90e4076905d19b86ab70ebce6e250fd118286 WHIRLPOOL fbb8143e35a9eace23c4a3cdf80cfb66c9f09ed499abeab130445d89e61949b67bf0f1b70c11f9a65c99a722ac83a53897b5cd2b291563cc0ea32154559547ac
+DIST zlib-1.2.11.tar.gz 607698 SHA256 c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae WHIRLPOOL 4263b67dd133e9eb6a837f270a53e6083af871993c52f89a21135f188f83c58646e7aa5882d62f35370032afe7a9964dd2796c25d104b8a2a70b293a5e31f72a
+EBUILD zlib-1.2.11-r1.ebuild 3176 SHA256 c5b42704b850e4f45ffc8cc1fc15aa6a121a72e895793611f87faf1abc1af17c SHA512 4df2ffc5c7358543797fbd187c3a5107d32967577b0822daa032cf44c31beeb448db9def6324b56a6f3f66745effa58643dec36d1c90c0241d78e52de45936a1 WHIRLPOOL 6809a3f7745a9e3dedf1b385f6df5541766d6ed1566766372b2aa2e9c455eab7d18e427c2cbb495d6708b14f2ea27d3af33d5bebbde243a86ac312a3f1751343
+EBUILD zlib-1.2.11.ebuild 3102 SHA256 a150eed4cbe2c3f3c756dd0fcf25c1f06f0b8121d75ae0181dd3da47e631146c SHA512 d423c1019803166a5f4b14a4e6bbf2119d698eaa9977c259140e2e378e692721235e6b6a45279fca1f7928e4c3d18c3e430f73ad994e69f4b4b3213b14668ee2 WHIRLPOOL e2c601a0f5749c42dbd947108a618b59b5fcce7d9cb2615df8f1b8ff37af6ed7e435a2e088f32632c3a4c4182fc6d155540b2b3bc3aebbed70989f308e41851d
+MISC ChangeLog 4685 SHA256 3f2edb1c1b304356ed97ad121cd544c76a41d2c28eaba05a920dd501ba50b83e SHA512 5db4b21be1cc55c9735480a409273caa84f9ce8837a390499835f5899d720a4dfad99b933004ad3c0f1fe3565175462f66e6d757b1fdf1909c9f43c09c3e944a WHIRLPOOL 96346a194bca8decd2468bb54fb9883c38ae1b0ee3a9d5ba429a080bdeeaf4295df2d76693e07f17f8b6cae7090ba8cfffa12dcbaffa1f4d3e2ac21453a76f57
+MISC ChangeLog-2015 18533 SHA256 4d97faf5b6f64cd59bdf027d8150044cb9e37e48c14a2aa3d1ffadd8f6b2ba9e SHA512 8274af7f6e2931f659e8cf895b423233f8be84d18b769573374b400cffdbaf95b3ff2393e062dfbe5824b28bea687d70d0710a4a295c9f1f4da189d044526f8c WHIRLPOOL e5fc8260f89cd61ff45e45bac801e53972155c84a9f0ef3fde517d69f0aadcc3f779efa34e758123f3632f90425ab0749dbb110cd91f7af258beb81d8213cc4c
+MISC metadata.xml 432 SHA256 b7ffe87c593d62ee6c38be6ecf0829fa9ac85e3002d6a8d031b3ad3cdbc56652 SHA512 947d4b2035ab49c42f6141f14553f1e8f4796b4ddc24c6a4f071ac2300eb120648dd03eef49773295d3e3f30cd9d3cbb391bde798dacf1187b46ff75abd59420 WHIRLPOOL c64a493a3b0f91be8588a7524de172c3db792a638d3d89b6473f8131d1e3cae280378c1f4b0edfbc132e51b285c24687fbd8cace280b723c134ba1ef28c9b0c9
diff --git a/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch b/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch
new file mode 100644
index 000000000000..18764849b945
--- /dev/null
+++ b/sys-libs/zlib/files/zlib-1.2.11-fix-deflateParams-usage.patch
@@ -0,0 +1,67 @@
+From f9694097dd69354b03cb8af959094c7f260db0a1 Mon Sep 17 00:00:00 2001
+From: Mark Adler <madler@alumni.caltech.edu>
+Date: Mon, 16 Jan 2017 09:49:35 -0800
+Subject: [PATCH] Permit a deflateParams() parameter change as soon as
+ possible.
+
+This commit allows a parameter change even if the input data has
+not all been compressed and copied to the application output
+buffer, so long as all of the input data has been compressed to
+the internal pending output buffer. This also allows an immediate
+deflateParams change so long as there have been no deflate calls
+since initialization or reset.
+---
+ deflate.c | 6 +++---
+ zlib.h | 11 ++++++-----
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/deflate.c b/deflate.c
+index b63311a5..20bda4f6 100644
+--- a/deflate.c
++++ b/deflate.c
+@@ -494,7 +494,7 @@ int ZEXPORT deflateResetKeep (strm)
+ s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
+ #endif
+ adler32(0L, Z_NULL, 0);
+- s->last_flush = Z_NO_FLUSH;
++ s->last_flush = -2;
+
+ _tr_init(s);
+
+@@ -587,12 +587,12 @@ int ZEXPORT deflateParams(strm, level, strategy)
+ func = configuration_table[s->level].func;
+
+ if ((strategy != s->strategy || func != configuration_table[level].func) &&
+- s->high_water) {
++ s->last_flush != -2) {
+ /* Flush the last buffer: */
+ int err = deflate(strm, Z_BLOCK);
+ if (err == Z_STREAM_ERROR)
+ return err;
+- if (strm->avail_out == 0)
++ if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead)
+ return Z_BUF_ERROR;
+ }
+ if (s->level != level) {
+diff --git a/zlib.h b/zlib.h
+index 5daf4f28..577d81e3 100644
+--- a/zlib.h
++++ b/zlib.h
+@@ -712,11 +712,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different strategy.
+ If the compression approach (which is a function of the level) or the
+- strategy is changed, and if any input has been consumed in a previous
+- deflate() call, then the input available so far is compressed with the old
+- level and strategy using deflate(strm, Z_BLOCK). There are three approaches
+- for the compression levels 0, 1..3, and 4..9 respectively. The new level
+- and strategy will take effect at the next call of deflate().
++ strategy is changed, and if there have been any deflate() calls since the
++ state was initialized or reset, then the input available so far is
++ compressed with the old level and strategy using deflate(strm, Z_BLOCK).
++ There are three approaches for the compression levels 0, 1..3, and 4..9
++ respectively. The new level and strategy will take effect at the next call
++ of deflate().
+
+ If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
+ not have enough output space to complete, then the parameter change will not
diff --git a/sys-libs/zlib/metadata.xml b/sys-libs/zlib/metadata.xml
new file mode 100644
index 000000000000..105b205e9e4e
--- /dev/null
+++ b/sys-libs/zlib/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 type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="minizip">include the minizip library for quick and dirty zip extraction</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:gnu:zlib</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/zlib/zlib-1.2.11-r1.ebuild b/sys-libs/zlib/zlib-1.2.11-r1.ebuild
new file mode 100644
index 000000000000..065bb3497be1
--- /dev/null
+++ b/sys-libs/zlib/zlib-1.2.11-r1.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+AUTOTOOLS_AUTO_DEPEND="no"
+
+inherit autotools toolchain-funcs multilib multilib-minimal
+
+DESCRIPTION="Standard (de)compression library"
+HOMEPAGE="https://zlib.net/"
+SRC_URI="https://zlib.net/${P}.tar.gz
+ http://www.gzip.org/zlib/${P}.tar.gz
+ http://www.zlib.net/current/beta/${P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0/1" # subslot = SONAME
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="minizip static-libs"
+
+DEPEND="minizip? ( ${AUTOTOOLS_DEPEND} )"
+RDEPEND="abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+ !<dev-libs/libxml2-2.7.7" #309623
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.2.11-fix-deflateParams-usage.patch
+
+ if use minizip ; then
+ cd contrib/minizip || die
+ eautoreconf
+ fi
+
+ case ${CHOST} in
+ *-mingw*|mingw*)
+ # uses preconfigured Makefile rather than configure script
+ multilib_copy_sources
+ ;;
+ esac
+}
+
+echoit() { echo "$@"; "$@"; }
+
+multilib_src_configure() {
+ case ${CHOST} in
+ *-mingw*|mingw*)
+ ;;
+ *) # not an autoconf script, so can't use econf
+ local uname=$("${EPREFIX}"/usr/share/gnuconfig/config.sub "${CHOST}" | cut -d- -f3) #347167
+ echoit "${S}"/configure \
+ --shared \
+ --prefix="${EPREFIX}/usr" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ ${uname:+--uname=${uname}} \
+ || die
+ ;;
+ esac
+
+ if use minizip ; then
+ local minizipdir="contrib/minizip"
+ mkdir -p "${BUILD_DIR}/${minizipdir}" || die
+ cd ${minizipdir} || die
+ ECONF_SOURCE="${S}/${minizipdir}" \
+ econf $(use_enable static-libs static)
+ fi
+}
+
+multilib_src_compile() {
+ case ${CHOST} in
+ *-mingw*|mingw*)
+ emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}-
+ sed \
+ -e 's|@prefix@|/usr|g' \
+ -e 's|@exec_prefix@|${prefix}|g' \
+ -e 's|@libdir@|${exec_prefix}/'$(get_libdir)'|g' \
+ -e 's|@sharedlibdir@|${exec_prefix}/'$(get_libdir)'|g' \
+ -e 's|@includedir@|${prefix}/include|g' \
+ -e 's|@VERSION@|'${PV}'|g' \
+ zlib.pc.in > zlib.pc || die
+ ;;
+ *)
+ emake
+ ;;
+ esac
+ use minizip && emake -C contrib/minizip
+}
+
+sed_macros() {
+ # clean up namespace a little #383179
+ # we do it here so we only have to tweak 2 files
+ sed -i -r 's:\<(O[FN])\>:_Z_\1:g' "$@" || die
+}
+
+multilib_src_install() {
+ case ${CHOST} in
+ *-mingw*|mingw*)
+ emake -f win32/Makefile.gcc install \
+ BINARY_PATH="${ED}/usr/bin" \
+ LIBRARY_PATH="${ED}/usr/$(get_libdir)" \
+ INCLUDE_PATH="${ED}/usr/include" \
+ SHARED_MODE=1
+ # overwrites zlib.pc created from win32/Makefile.gcc #620136
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins zlib.pc
+ ;;
+
+ *)
+ emake install DESTDIR="${D}" LDCONFIG=:
+ gen_usr_ldscript -a z
+ ;;
+ esac
+ sed_macros "${ED}"/usr/include/*.h
+
+ if use minizip ; then
+ emake -C contrib/minizip install DESTDIR="${D}"
+ sed_macros "${ED}"/usr/include/minizip/*.h
+ fi
+
+ use static-libs || rm -f "${ED}"/usr/$(get_libdir)/lib{z,minizip}.{a,la} #419645
+}
+
+multilib_src_install_all() {
+ dodoc FAQ README ChangeLog doc/*.txt
+ use minizip && dodoc contrib/minizip/*.txt
+}
diff --git a/sys-libs/zlib/zlib-1.2.11.ebuild b/sys-libs/zlib/zlib-1.2.11.ebuild
new file mode 100644
index 000000000000..8880513349a7
--- /dev/null
+++ b/sys-libs/zlib/zlib-1.2.11.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+AUTOTOOLS_AUTO_DEPEND="no"
+
+inherit autotools toolchain-funcs multilib multilib-minimal
+
+DESCRIPTION="Standard (de)compression library"
+HOMEPAGE="https://zlib.net/"
+SRC_URI="https://zlib.net/${P}.tar.gz
+ http://www.gzip.org/zlib/${P}.tar.gz
+ http://www.zlib.net/current/beta/${P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0/1" # subslot = SONAME
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="minizip static-libs"
+
+DEPEND="minizip? ( ${AUTOTOOLS_DEPEND} )"
+RDEPEND="abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+ !<dev-libs/libxml2-2.7.7" #309623
+
+src_prepare() {
+ if use minizip ; then
+ cd contrib/minizip || die
+ eautoreconf
+ fi
+
+ case ${CHOST} in
+ *-mingw*|mingw*)
+ # uses preconfigured Makefile rather than configure script
+ multilib_copy_sources
+ ;;
+ esac
+}
+
+echoit() { echo "$@"; "$@"; }
+
+multilib_src_configure() {
+ case ${CHOST} in
+ *-mingw*|mingw*)
+ ;;
+ *) # not an autoconf script, so can't use econf
+ local uname=$("${EPREFIX}"/usr/share/gnuconfig/config.sub "${CHOST}" | cut -d- -f3) #347167
+ echoit "${S}"/configure \
+ --shared \
+ --prefix="${EPREFIX}/usr" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ ${uname:+--uname=${uname}} \
+ || die
+ ;;
+ esac
+
+ if use minizip ; then
+ local minizipdir="contrib/minizip"
+ mkdir -p "${BUILD_DIR}/${minizipdir}" || die
+ cd ${minizipdir} || die
+ ECONF_SOURCE="${S}/${minizipdir}" \
+ econf $(use_enable static-libs static)
+ fi
+}
+
+multilib_src_compile() {
+ case ${CHOST} in
+ *-mingw*|mingw*)
+ emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}-
+ sed \
+ -e 's|@prefix@|/usr|g' \
+ -e 's|@exec_prefix@|${prefix}|g' \
+ -e 's|@libdir@|${exec_prefix}/'$(get_libdir)'|g' \
+ -e 's|@sharedlibdir@|${exec_prefix}/'$(get_libdir)'|g' \
+ -e 's|@includedir@|${prefix}/include|g' \
+ -e 's|@VERSION@|'${PV}'|g' \
+ zlib.pc.in > zlib.pc || die
+ ;;
+ *)
+ emake
+ ;;
+ esac
+ use minizip && emake -C contrib/minizip
+}
+
+sed_macros() {
+ # clean up namespace a little #383179
+ # we do it here so we only have to tweak 2 files
+ sed -i -r 's:\<(O[FN])\>:_Z_\1:g' "$@" || die
+}
+
+multilib_src_install() {
+ case ${CHOST} in
+ *-mingw*|mingw*)
+ emake -f win32/Makefile.gcc install \
+ BINARY_PATH="${ED}/usr/bin" \
+ LIBRARY_PATH="${ED}/usr/$(get_libdir)" \
+ INCLUDE_PATH="${ED}/usr/include" \
+ SHARED_MODE=1
+ # overwrites zlib.pc created from win32/Makefile.gcc #620136
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins zlib.pc
+ ;;
+
+ *)
+ emake install DESTDIR="${D}" LDCONFIG=:
+ gen_usr_ldscript -a z
+ ;;
+ esac
+ sed_macros "${ED}"/usr/include/*.h
+
+ if use minizip ; then
+ emake -C contrib/minizip install DESTDIR="${D}"
+ sed_macros "${ED}"/usr/include/minizip/*.h
+ fi
+
+ use static-libs || rm -f "${ED}"/usr/$(get_libdir)/lib{z,minizip}.{a,la} #419645
+}
+
+multilib_src_install_all() {
+ dodoc FAQ README ChangeLog doc/*.txt
+ use minizip && dodoc contrib/minizip/*.txt
+}