From 9cabbd68b27dc0814226f09900f1fcf54baae37d Mon Sep 17 00:00:00 2001 From: Laszlo Valko Date: Fri, 4 Aug 2023 02:45:44 +0200 Subject: [PATCH] Moved old packages from myoverlay repo. --- dev-java/oracle-jdk-bin/Manifest | 11 + .../files/fontconfig.Gentoo.properties | 161 + .../files/fontconfig.properties | 161 + .../files/oracle-jdk-bin-1.7.env | 17 + .../files/oracle-jdk-bin.env.sh | 16 + .../oracle-jdk-bin-1.7.0.80.ebuild | 243 ++ .../oracle-jdk-bin-1.8.0.241.ebuild | 291 ++ dev-lang/php/Manifest | 9 + dev-lang/php/files/20php5-envd | 2 + dev-lang/php/files/php-fpm_at-simple.service | 13 + dev-lang/php/files/php-fpm_at.service | 14 + dev-lang/php/files/php-icu-70.patch | 42 + dev-lang/php/files/php-icu-fix.patch | 12 + dev-lang/php/metadata.xml | 70 + dev-lang/php/php-5.6.40-r7.ebuild | 795 +++++ dev-scheme/guile/Manifest | 8 + dev-scheme/guile/files/50guile-gentoo.el | 1 + dev-scheme/guile/files/guile-2-snarf.patch | 47 + .../guile-2.0.14-configure-clang16.patch | 71 + .../guile/files/guile-2.0.14-darwin.patch | 38 + ...ia64-fix-crash-thread-context-switch.patch | 63 + dev-scheme/guile/guile-2.0.14-r5.ebuild | 92 + dev-scheme/guile/metadata.xml | 22 + eclass/cmake-utils.eclass | 851 ++++++ eclass/flag-o-matic.eclass | 773 +++++ eclass/toolchain.eclass | 2640 +++++++++++++++++ mail-mta/exim/Manifest | 23 + mail-mta/exim/exim-4.93.0.4-r2.ebuild | 590 ++++ mail-mta/exim/files/auth_conf.sub | 25 + mail-mta/exim/files/exim-4.14-tail.patch | 11 + mail-mta/exim/files/exim-4.20-maildir.patch | 14 + mail-mta/exim/files/exim-4.69-r1.27021.patch | 48 + .../files/exim-4.74-radius-db-ENV-clash.patch | 22 + .../exim/files/exim-4.76-crosscompile.patch | 15 + .../exim/files/exim-4.93-CVE-2020-12783.patch | 83 + .../files/exim-4.93-as-needed-ldflags.patch | 145 + .../exim/files/exim-4.93-fno-common.patch | 16 + .../files/exim-4.93-localscan_dlopen.patch | 269 ++ mail-mta/exim/files/exim-4.93-radius.patch | 66 + mail-mta/exim/files/exim-submission.socket | 10 + .../exim/files/exim-submission_at.service | 11 + mail-mta/exim/files/exim.confd | 5 + mail-mta/exim/files/exim.logrotate | 9 + mail-mta/exim/files/exim.rc10 | 47 + mail-mta/exim/files/exim.service | 12 + mail-mta/exim/files/exim.socket | 10 + mail-mta/exim/files/exim_at.service | 7 + mail-mta/exim/metadata.xml | 52 + metadata/layout.conf | 2 + profiles/repo_name | 1 + sys-apps/openwsman/Manifest | 5 + ...man-2.6.5-libcurl-error-codes-update.patch | 27 + sys-apps/openwsman/files/openwsmand.confd | 1 + sys-apps/openwsman/files/openwsmand.initd | 12 + sys-apps/openwsman/openwsman-2.7.0.ebuild | 105 + sys-apps/wsmancli/Manifest | 3 + sys-apps/wsmancli/files/autotools.patch | 49 + sys-apps/wsmancli/wsmancli-2.6.0.ebuild | 35 + updmanifests | 12 + virtual/imap-c-client/Manifest | 2 + virtual/imap-c-client/imap-c-client-2.ebuild | 11 + virtual/imap-c-client/metadata.xml | 6 + 62 files changed, 8224 insertions(+) create mode 100644 dev-java/oracle-jdk-bin/Manifest create mode 100644 dev-java/oracle-jdk-bin/files/fontconfig.Gentoo.properties create mode 100644 dev-java/oracle-jdk-bin/files/fontconfig.properties create mode 100644 dev-java/oracle-jdk-bin/files/oracle-jdk-bin-1.7.env create mode 100644 dev-java/oracle-jdk-bin/files/oracle-jdk-bin.env.sh create mode 100644 dev-java/oracle-jdk-bin/oracle-jdk-bin-1.7.0.80.ebuild create mode 100644 dev-java/oracle-jdk-bin/oracle-jdk-bin-1.8.0.241.ebuild create mode 100644 dev-lang/php/Manifest create mode 100644 dev-lang/php/files/20php5-envd create mode 100644 dev-lang/php/files/php-fpm_at-simple.service create mode 100644 dev-lang/php/files/php-fpm_at.service create mode 100644 dev-lang/php/files/php-icu-70.patch create mode 100644 dev-lang/php/files/php-icu-fix.patch create mode 100644 dev-lang/php/metadata.xml create mode 100644 dev-lang/php/php-5.6.40-r7.ebuild create mode 100644 dev-scheme/guile/Manifest create mode 100644 dev-scheme/guile/files/50guile-gentoo.el create mode 100644 dev-scheme/guile/files/guile-2-snarf.patch create mode 100644 dev-scheme/guile/files/guile-2.0.14-configure-clang16.patch create mode 100644 dev-scheme/guile/files/guile-2.0.14-darwin.patch create mode 100644 dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch create mode 100644 dev-scheme/guile/guile-2.0.14-r5.ebuild create mode 100644 dev-scheme/guile/metadata.xml create mode 100644 eclass/cmake-utils.eclass create mode 100644 eclass/flag-o-matic.eclass create mode 100644 eclass/toolchain.eclass create mode 100644 mail-mta/exim/Manifest create mode 100644 mail-mta/exim/exim-4.93.0.4-r2.ebuild create mode 100644 mail-mta/exim/files/auth_conf.sub create mode 100644 mail-mta/exim/files/exim-4.14-tail.patch create mode 100644 mail-mta/exim/files/exim-4.20-maildir.patch create mode 100644 mail-mta/exim/files/exim-4.69-r1.27021.patch create mode 100644 mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch create mode 100644 mail-mta/exim/files/exim-4.76-crosscompile.patch create mode 100644 mail-mta/exim/files/exim-4.93-CVE-2020-12783.patch create mode 100644 mail-mta/exim/files/exim-4.93-as-needed-ldflags.patch create mode 100644 mail-mta/exim/files/exim-4.93-fno-common.patch create mode 100644 mail-mta/exim/files/exim-4.93-localscan_dlopen.patch create mode 100644 mail-mta/exim/files/exim-4.93-radius.patch create mode 100644 mail-mta/exim/files/exim-submission.socket create mode 100644 mail-mta/exim/files/exim-submission_at.service create mode 100644 mail-mta/exim/files/exim.confd create mode 100644 mail-mta/exim/files/exim.logrotate create mode 100644 mail-mta/exim/files/exim.rc10 create mode 100644 mail-mta/exim/files/exim.service create mode 100644 mail-mta/exim/files/exim.socket create mode 100644 mail-mta/exim/files/exim_at.service create mode 100644 mail-mta/exim/metadata.xml create mode 100644 metadata/layout.conf create mode 100644 profiles/repo_name create mode 100644 sys-apps/openwsman/Manifest create mode 100644 sys-apps/openwsman/files/openwsman-2.6.5-libcurl-error-codes-update.patch create mode 100644 sys-apps/openwsman/files/openwsmand.confd create mode 100644 sys-apps/openwsman/files/openwsmand.initd create mode 100644 sys-apps/openwsman/openwsman-2.7.0.ebuild create mode 100644 sys-apps/wsmancli/Manifest create mode 100644 sys-apps/wsmancli/files/autotools.patch create mode 100644 sys-apps/wsmancli/wsmancli-2.6.0.ebuild create mode 100755 updmanifests create mode 100644 virtual/imap-c-client/Manifest create mode 100644 virtual/imap-c-client/imap-c-client-2.ebuild create mode 100644 virtual/imap-c-client/metadata.xml diff --git a/dev-java/oracle-jdk-bin/Manifest b/dev-java/oracle-jdk-bin/Manifest new file mode 100644 index 0000000..904c0d6 --- /dev/null +++ b/dev-java/oracle-jdk-bin/Manifest @@ -0,0 +1,11 @@ +AUX fontconfig.Gentoo.properties 11196 BLAKE2B 31abb25a488c4680ee6a276d4c4fd0f0c8da5572a923cc1f755a6baf6ef007453c1cda4fb280fa108ae124c888a5b36b05658a9695dc5311f859742fbf9e7a79 SHA512 1802e52383a04efd0d7fb4d6a3903f99128dce90afcb10b9dd0d3515e5feafb807449024dbe5742c7dfa9d43736e474412e1a289e06b29cf3a58e59deedd56f9 +AUX fontconfig.properties 11196 BLAKE2B 31abb25a488c4680ee6a276d4c4fd0f0c8da5572a923cc1f755a6baf6ef007453c1cda4fb280fa108ae124c888a5b36b05658a9695dc5311f859742fbf9e7a79 SHA512 1802e52383a04efd0d7fb4d6a3903f99128dce90afcb10b9dd0d3515e5feafb807449024dbe5742c7dfa9d43736e474412e1a289e06b29cf3a58e59deedd56f9 +AUX oracle-jdk-bin-1.7.env 880 BLAKE2B c5cc5d09534e9ada0c05f9eda0a0609ae81d39d985ba21610955af8b532381030ed6231e0f129fe1648fe4a711c49896afc6797ba31f540bb6db38d269b6f117 SHA512 f230fd95f07638690b1ce64bf25b366b6fb11828735e7bb75fa30152435485e4f529f73e88a50f623db348c0ed68ea5617b7691f4c1c3be56b37216d0a7fa59a +AUX oracle-jdk-bin.env.sh 833 BLAKE2B 2e8254aff8d35795f073fb599c1c51dcd2ecb0356b4e90977577b9cd41376c3517a72e634bfb1420c37c8149af89044f48aa374480b26a19c875d4c1b78390eb SHA512 8d41679b4631016dbe98b15368ed027df9e6f4d96db17133c56bbf16b9a81be908d139617bc5350aa6b0e51bddc56bb1ce1abc5a8a4fad74868172cfdde6ffd8 +DIST UnlimitedJCEPolicyJDK7.zip 7426 BLAKE2B 1cd63919e35248e25e4e104c8f87deed84db70280c7a4262c999d02edc8f9757c8ac6a369ac326686f61da7391f1788ec1da65d253e0bc6ff674c4e0c7dc3fb7 SHA512 02eca7da8f3fffea388431d5352290535a63d53a1f5c795d6511ccba62445787a0ee6ad4bc1852e5262860b6d607ba2a8c6a3dbb0c3e1d7c3a67ac7bbc783204 +DIST jdk-7u80-linux-i586.tar.gz 154850445 BLAKE2B a94426088fa12456b74b24938279e9415d73cdb45857fa9b6234a9b5de24962690a28cf00097103f1cd94b3b9a7fd3eabb137edcca9572e035d6f27dca8a7608 SHA512 69e2ee7964b18e9e8b57db917b303eb9ea629c432300fe4749177118d2f5c365e72b976649e21354643fe4957120a2b23de025bab4dc45977837d4847a61ffb6 +DIST jdk-7u80-linux-x64.tar.gz 153530841 BLAKE2B 9ff05c97b65b3b49f4d5088fa4b021aaa58806a1d9937b3c65db8e25bd44465880e66f60b75483bed12b9f562d3bf6430480516a86724a16262776231044a95e SHA512 a772878f740e87835bafc82841e8f4c1dfbe8bc79e072d3f6c5c74d3a206eb9001a53b474d91a22819c7c0d6407ed88993635c39738779c2b08c22c7a1c2e9e9 +DIST jdk-8u241-linux-i586.tar.gz 195143852 BLAKE2B 595e614fb34122a72fca5ce70a4ed4702e725a2f3a3084c7f6a86be8901799f9b4eb11b04b9b054d59d011a285276922532dbc52a04e33a5c49b9a22fe9bdcb4 SHA512 66edeb10d4ab38e05f74a17f8bdfe681069e2ca14a42b2c0f6159cefed6ccba69581086d0d6209476cb731913451b58a3a503bc28456ac6c5ef68722d124a04d +DIST jdk-8u241-linux-x64.tar.gz 194545143 BLAKE2B 13369d68bc0c328c4efbba90697080fe4d65fb8167bc9b20b92b6d4d6845c48486c53f2371e362fdb6195e8ffdb3ad8f4b486115ffbcf3e2f8e2966b6ad46d4c SHA512 1123fb82926ac207fdbfc1dd3efd588832feed15cac755d1ca604e321816c2fb3c695b9ce3f99b5a14f6c45973cc8dadae87d5c79c49d67336f8a5cb50c56050 +EBUILD oracle-jdk-bin-1.7.0.80.ebuild 7525 BLAKE2B cf5997f8872494b1334653c7637a72472326f04be56460c5cdce7b318b96867fbd921c2d1a124f29e78d1e0a0c1e5bf9c1841af8e22a8daac22ba55ccb41975b SHA512 5526de842d446d6e78ab783cb905c11733b951e61f2f4b6d0bd2a0bdc5776e6c83b10612d1889dcef139e352fa6f187facb60633ab80496da30bcd8cd70f3508 +EBUILD oracle-jdk-bin-1.8.0.241.ebuild 8238 BLAKE2B 39a8ef091be7f6195367ae50fb18d7d12f0e9255ce9d04012eb2da8f6be067c096f8f3d17b266c16409391ff6b64236434b273a2c4b36b8aad640af86100aca1 SHA512 e5877fc6bcf3498300e516384434ff423fb7920de365278a1aa104c1147398af1e7b263d2dff94e0321d84d0dfacc0b04b0e337cbcb32339e504a9d44f4fe563 diff --git a/dev-java/oracle-jdk-bin/files/fontconfig.Gentoo.properties b/dev-java/oracle-jdk-bin/files/fontconfig.Gentoo.properties new file mode 100644 index 0000000..43cb5ee --- /dev/null +++ b/dev-java/oracle-jdk-bin/files/fontconfig.Gentoo.properties @@ -0,0 +1,161 @@ +# Version + +version=1 + +# Component Font Mappings + +allfonts.chinese-gb18030=-misc-ming for iso10646 -medium-r-normal--*-%d-*-*-c-*-iso10646-1 +allfonts.chinese-gb18030.motif=-isas-song ti-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0 +allfonts.chinese-big5=-arphic technology co.-ar pl mingti2l big5-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +allfonts.chinese-big5.motif=-taipei-fixed-medium-r-normal--*-%d-*-*-c-*-big5-0 +allfonts.lucida=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 + +serif.plain.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +serif.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +serif.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +serif.plain.latin-1=-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1 +serif.plain.latin-1.motif=-b&h-luxi serif-medium-r-normal--*-%d-*-*-p-*-iso8859-1 + +serif.bold.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +serif.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +serif.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +serif.bold.latin-1=-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1 +serif.bold.latin-1.motif=-b&h-luxi serif-bold-r-normal--*-%d-*-*-p-*-iso8859-1 + +serif.italic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +serif.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +serif.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +serif.italic.latin-1=-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1 +serif.italic.latin-1.motif=-b&h-luxi serif-medium-i-normal--*-%d-*-*-p-*-iso8859-1 + +serif.bolditalic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +serif.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +serif.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +serif.bolditalic.latin-1=-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1 +serif.bolditalic.latin-1.motif=-b&h-luxi serif-bold-i-normal--*-%d-*-*-p-*-iso8859-1 + +sansserif.plain.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +sansserif.plain.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +sansserif.plain.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +sansserif.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +sansserif.plain.latin-1.motif=-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1 + +sansserif.bold.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +sansserif.bold.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +sansserif.bold.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +sansserif.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +sansserif.bold.latin-1.motif=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1 + +sansserif.italic.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +sansserif.italic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +sansserif.italic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +sansserif.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +sansserif.italic.latin-1.motif=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1 + +sansserif.bolditalic.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +sansserif.bolditalic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +sansserif.bolditalic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +sansserif.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +sansserif.bolditalic.latin-1.motif=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1 + +monospaced.plain.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +monospaced.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +monospaced.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +monospaced.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +monospaced.plain.latin-1.motif=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1 + +monospaced.bold.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +monospaced.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +monospaced.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +monospaced.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +monospaced.bold.latin-1.motif=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1 + +monospaced.italic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +monospaced.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +monospaced.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +monospaced.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1 +monospaced.italic.latin-1.motif=-b&h-luxi mono-medium-i-normal--*-%d-*-*-m-*-iso8859-1 + +monospaced.bolditalic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +monospaced.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +monospaced.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +monospaced.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1 +monospaced.bolditalic.latin-1.motif=-b&h-luxi mono-bold-i-normal--*-%d-*-*-m-*-iso8859-1 + +dialog.plain.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialog.plain.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialog.plain.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialog.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +dialog.plain.latin-1.motif=-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1 + +dialog.bold.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialog.bold.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialog.bold.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialog.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +dialog.bold.latin-1.motif=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1 + +dialog.italic.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialog.italic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialog.italic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialog.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +dialog.italic.latin-1.motif=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1 + +dialog.bolditalic.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialog.bolditalic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialog.bolditalic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialog.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +dialog.bolditalic.latin-1.motif=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1 + +dialoginput.plain.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialoginput.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialoginput.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialoginput.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +dialoginput.plain.latin-1.motif=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1 + +dialoginput.bold.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialoginput.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialoginput.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialoginput.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +dialoginput.bold.latin-1.motif=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1 + +dialoginput.italic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialoginput.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialoginput.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialoginput.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1 +dialoginput.italic.latin-1.motif=-b&h-luxi mono-medium-i-normal--*-%d-*-*-m-*-iso8859-1 + +dialoginput.bolditalic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialoginput.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialoginput.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialoginput.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1 +dialoginput.bolditalic.latin-1.motif=-b&h-luxi mono-bold-i-normal--*-%d-*-*-m-*-iso8859-1 + +# Search Sequences + +sequence.allfonts=latin-1 +sequence.allfonts.Big5=latin-1,chinese-big5 +sequence.allfonts.GB2312=latin-1,chinese-gb18030 +sequence.allfonts.x-euc-jp-linux=latin-1,japanese-x0208 +sequence.allfonts.EUC-KR=latin-1,korean +sequence.allfonts.GB18030=latin-1,chinese-gb18030 +sequence.fallback=lucida,chinese-big5,chinese-gb18030,japanese-x0208,korean + +# Exclusion Ranges + +exclusion.japanese-x0208=0390-03d6,2200-22ef,2701-27be + +# Font File Names + +filename.-arphic_technology_co.-ar_pl_mingti2l_big5-medium-r-normal--*-%d-*-*-c-*-iso10646-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/arphicfonts/bsmi00lp.ttf +filename.-misc-baekmuk_batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/baekmuk-fonts/batang.ttf +filename.-misc-baekmuk_gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/baekmuk-fonts/gulim.ttf +filename.-misc-kochi_gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/kochi-substitute/kochi-gothic-subst.ttf +filename.-misc-kochi_mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/kochi-substitute/kochi-mincho-subst.ttf +filename.-misc-ming for iso10646 -medium-r-normal--*-%d-*-*-c-*-iso10646-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/hkscs-ming/min_uni.ttf + +# AWT X11 font paths +awtfontpath.latin-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/Type1 +awtfontpath.chinese-big5=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/arphicfonts +awtfontpath.chinese-gb18030=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/arphicfonts +awtfontpath.japanese-x0208=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/kochi-substitute +awtfontpath.korean=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/baekmuk-fonts diff --git a/dev-java/oracle-jdk-bin/files/fontconfig.properties b/dev-java/oracle-jdk-bin/files/fontconfig.properties new file mode 100644 index 0000000..43cb5ee --- /dev/null +++ b/dev-java/oracle-jdk-bin/files/fontconfig.properties @@ -0,0 +1,161 @@ +# Version + +version=1 + +# Component Font Mappings + +allfonts.chinese-gb18030=-misc-ming for iso10646 -medium-r-normal--*-%d-*-*-c-*-iso10646-1 +allfonts.chinese-gb18030.motif=-isas-song ti-medium-r-normal--*-%d-*-*-c-*-gb2312.1980-0 +allfonts.chinese-big5=-arphic technology co.-ar pl mingti2l big5-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +allfonts.chinese-big5.motif=-taipei-fixed-medium-r-normal--*-%d-*-*-c-*-big5-0 +allfonts.lucida=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 + +serif.plain.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +serif.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +serif.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +serif.plain.latin-1=-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1 +serif.plain.latin-1.motif=-b&h-luxi serif-medium-r-normal--*-%d-*-*-p-*-iso8859-1 + +serif.bold.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +serif.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +serif.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +serif.bold.latin-1=-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1 +serif.bold.latin-1.motif=-b&h-luxi serif-bold-r-normal--*-%d-*-*-p-*-iso8859-1 + +serif.italic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +serif.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +serif.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +serif.italic.latin-1=-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1 +serif.italic.latin-1.motif=-b&h-luxi serif-medium-i-normal--*-%d-*-*-p-*-iso8859-1 + +serif.bolditalic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +serif.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +serif.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +serif.bolditalic.latin-1=-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1 +serif.bolditalic.latin-1.motif=-b&h-luxi serif-bold-i-normal--*-%d-*-*-p-*-iso8859-1 + +sansserif.plain.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +sansserif.plain.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +sansserif.plain.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +sansserif.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +sansserif.plain.latin-1.motif=-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1 + +sansserif.bold.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +sansserif.bold.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +sansserif.bold.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +sansserif.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +sansserif.bold.latin-1.motif=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1 + +sansserif.italic.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +sansserif.italic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +sansserif.italic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +sansserif.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +sansserif.italic.latin-1.motif=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1 + +sansserif.bolditalic.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +sansserif.bolditalic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +sansserif.bolditalic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +sansserif.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +sansserif.bolditalic.latin-1.motif=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1 + +monospaced.plain.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +monospaced.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +monospaced.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +monospaced.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +monospaced.plain.latin-1.motif=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1 + +monospaced.bold.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +monospaced.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +monospaced.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +monospaced.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +monospaced.bold.latin-1.motif=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1 + +monospaced.italic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +monospaced.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +monospaced.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +monospaced.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1 +monospaced.italic.latin-1.motif=-b&h-luxi mono-medium-i-normal--*-%d-*-*-m-*-iso8859-1 + +monospaced.bolditalic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +monospaced.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +monospaced.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +monospaced.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1 +monospaced.bolditalic.latin-1.motif=-b&h-luxi mono-bold-i-normal--*-%d-*-*-m-*-iso8859-1 + +dialog.plain.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialog.plain.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialog.plain.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialog.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +dialog.plain.latin-1.motif=-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1 + +dialog.bold.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialog.bold.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialog.bold.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialog.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1 +dialog.bold.latin-1.motif=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1 + +dialog.italic.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialog.italic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialog.italic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialog.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +dialog.italic.latin-1.motif=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1 + +dialog.bolditalic.japanese-x0208=-misc-kochi gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialog.bolditalic.korean=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialog.bolditalic.korean.motif=-misc-baekmuk gulim-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialog.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1 +dialog.bolditalic.latin-1.motif=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1 + +dialoginput.plain.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialoginput.plain.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialoginput.plain.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialoginput.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +dialoginput.plain.latin-1.motif=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1 + +dialoginput.bold.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialoginput.bold.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialoginput.bold.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialoginput.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1 +dialoginput.bold.latin-1.motif=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1 + +dialoginput.italic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialoginput.italic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialoginput.italic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialoginput.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1 +dialoginput.italic.latin-1.motif=-b&h-luxi mono-medium-i-normal--*-%d-*-*-m-*-iso8859-1 + +dialoginput.bolditalic.japanese-x0208=-misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0 +dialoginput.bolditalic.korean=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1 +dialoginput.bolditalic.korean.motif=-misc-baekmuk batang-medium-r-normal--*-%d-*-*-c-*-ksc5601.1987-0 +dialoginput.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1 +dialoginput.bolditalic.latin-1.motif=-b&h-luxi mono-bold-i-normal--*-%d-*-*-m-*-iso8859-1 + +# Search Sequences + +sequence.allfonts=latin-1 +sequence.allfonts.Big5=latin-1,chinese-big5 +sequence.allfonts.GB2312=latin-1,chinese-gb18030 +sequence.allfonts.x-euc-jp-linux=latin-1,japanese-x0208 +sequence.allfonts.EUC-KR=latin-1,korean +sequence.allfonts.GB18030=latin-1,chinese-gb18030 +sequence.fallback=lucida,chinese-big5,chinese-gb18030,japanese-x0208,korean + +# Exclusion Ranges + +exclusion.japanese-x0208=0390-03d6,2200-22ef,2701-27be + +# Font File Names + +filename.-arphic_technology_co.-ar_pl_mingti2l_big5-medium-r-normal--*-%d-*-*-c-*-iso10646-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/arphicfonts/bsmi00lp.ttf +filename.-misc-baekmuk_batang-medium-r-normal--*-%d-*-*-c-*-iso10646-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/baekmuk-fonts/batang.ttf +filename.-misc-baekmuk_gulim-medium-r-normal--*-%d-*-*-c-*-iso10646-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/baekmuk-fonts/gulim.ttf +filename.-misc-kochi_gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/kochi-substitute/kochi-gothic-subst.ttf +filename.-misc-kochi_mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/kochi-substitute/kochi-mincho-subst.ttf +filename.-misc-ming for iso10646 -medium-r-normal--*-%d-*-*-c-*-iso10646-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/hkscs-ming/min_uni.ttf + +# AWT X11 font paths +awtfontpath.latin-1=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/Type1 +awtfontpath.chinese-big5=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/arphicfonts +awtfontpath.chinese-gb18030=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/arphicfonts +awtfontpath.japanese-x0208=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/kochi-substitute +awtfontpath.korean=@GENTOO_PORTAGE_EPREFIX@/usr/share/fonts/baekmuk-fonts diff --git a/dev-java/oracle-jdk-bin/files/oracle-jdk-bin-1.7.env b/dev-java/oracle-jdk-bin/files/oracle-jdk-bin-1.7.env new file mode 100644 index 0000000..cc6305d --- /dev/null +++ b/dev-java/oracle-jdk-bin/files/oracle-jdk-bin-1.7.env @@ -0,0 +1,17 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +VERSION="Oracle JDK @PV@" +JAVA_HOME="@GENTOO_PORTAGE_EPREFIX@/opt/@P@" +JDK_HOME="@GENTOO_PORTAGE_EPREFIX@/opt/@P@" +JAVAC=${JAVA_HOME}/bin/javac +PATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin" +ROOTPATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin" +LDPATH="${JAVA_HOME}/jre/lib/@PLATFORM@/:${JAVA_HOME}/jre/lib/@PLATFORM@/xawt/:${JAVA_HOME}/jre/lib/@PLATFORM@/server/" +MANPATH="@GENTOO_PORTAGE_EPREFIX@/opt/@P@/man" +PROVIDES_TYPE="JDK JRE" +PROVIDES_VERSION="1.7" +BOOTCLASSPATH="${JAVA_HOME}/jre/lib/resources.jar:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/sunrsasign.jar:${JAVA_HOME}/jre/lib/jsse.jar:${JAVA_HOME}/jre/lib/jce.jar:${JAVA_HOME}/jre/lib/charsets.jar:${JAVA_HOME}/jre/classes" +GENERATION="2" +ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH" diff --git a/dev-java/oracle-jdk-bin/files/oracle-jdk-bin.env.sh b/dev-java/oracle-jdk-bin/files/oracle-jdk-bin.env.sh new file mode 100644 index 0000000..508a5c6 --- /dev/null +++ b/dev-java/oracle-jdk-bin/files/oracle-jdk-bin.env.sh @@ -0,0 +1,16 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +VERSION="Oracle JDK ${PV}" +JAVA_HOME="${EPREFIX}/opt/${P}" +JDK_HOME="${EPREFIX}/opt/${P}" +JAVAC="\${JAVA_HOME}/bin/javac" +PATH="\${JAVA_HOME}/bin:\${JAVA_HOME}/jre/bin" +ROOTPATH="\${JAVA_HOME}/bin:\${JAVA_HOME}/jre/bin" +LDPATH="\${JAVA_HOME}/jre/lib/$(get_system_arch)/:\${JAVA_HOME}/jre/lib/$(get_system_arch)/server/" +MANPATH="${EPREFIX}/opt/${P}/man" +PROVIDES_TYPE="JDK JRE" +PROVIDES_VERSION="${SLOT}" +BOOTCLASSPATH="\${JAVA_HOME}/jre/lib/resources.jar:\${JAVA_HOME}/jre/lib/rt.jar:\${JAVA_HOME}/jre/lib/sunrsasign.jar:\${JAVA_HOME}/jre/lib/jsse.jar:\${JAVA_HOME}/jre/lib/jce.jar:\${JAVA_HOME}/jre/lib/charsets.jar:\${JAVA_HOME}/jre/classes" +GENERATION="2" +ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH" diff --git a/dev-java/oracle-jdk-bin/oracle-jdk-bin-1.7.0.80.ebuild b/dev-java/oracle-jdk-bin/oracle-jdk-bin-1.7.0.80.ebuild new file mode 100644 index 0000000..602fac8 --- /dev/null +++ b/dev-java/oracle-jdk-bin/oracle-jdk-bin-1.7.0.80.ebuild @@ -0,0 +1,243 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="6" + +inherit eutils java-vm-2 prefix versionator + +MY_PV="$(get_version_component_range 2)u$(get_version_component_range 4)" +S_PV="$(replace_version_separator 3 '_')" + +# This URIs need to be updated when bumping! +JDK_URI="http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html#jdk-${MY_PV}-oth-JPR" +JCE_URI="http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html" +# This is a list of archs supported by this update. +# Currently arm comes and goes. +AT_AVAILABLE=( amd64 x86 ) +# Sometimes some or all of the demos are missing, this is to not have to rewrite half +# the ebuild when it happens. +DEMOS_AVAILABLE=( ) +#amd64 x86 x64-solaris x86-solaris sparc-solaris sparc64-solaris x86-macos x64-macos ) +FX_VERSION="2_2_$(get_version_component_range 4)" + +AT_x86="jdk-${MY_PV}-linux-i586.tar.gz" +AT_amd64="jdk-${MY_PV}-linux-x64.tar.gz" + +FXDEMOS_linux="javafx_samples-${FX_VERSION}-linux.zip" + +DEMOS_x86="${FXDEMOS_linux} jdk-${MY_PV}-linux-i586-demos.tar.gz" +DEMOS_amd64="${FXDEMOS_linux} jdk-${MY_PV}-linux-x64-demos.tar.gz" + +JCE_DIR="UnlimitedJCEPolicy" +JCE_FILE="${JCE_DIR}JDK7.zip" + +DESCRIPTION="Oracle's Java SE Development Kit" +HOMEPAGE="http://www.oracle.com/technetwork/java/javase/" +for d in "${AT_AVAILABLE[@]}"; do + SRC_URI+=" ${d}? (" + SRC_URI+=" $(eval "echo \${$(echo AT_${d/-/_})}")" + if has ${d} "${DEMOS_AVAILABLE[@]}"; then + SRC_URI+=" examples? ( $(eval "echo \${$(echo DEMOS_${d/-/_})}") )" + fi + SRC_URI+=" )" +done +unset d +SRC_URI+=" jce? ( ${JCE_FILE} )" + +LICENSE="Oracle-BCLA-JavaSE examples? ( BSD )" +SLOT="1.7" +KEYWORDS="amd64 x86" +IUSE="+X alsa aqua derby doc examples +fontconfig jce nsplugin pax_kernel selinux source" + +RESTRICT="fetch strip" +QA_PREBUILT="*" + +COMMON_DEP="" +RDEPEND="${COMMON_DEP} + X? ( !aqua? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrender + x11-libs/libXtst + ) ) + alsa? ( media-libs/alsa-lib ) + doc? ( dev-java/java-sdk-docs:1.7 ) + fontconfig? ( media-libs/fontconfig ) + !prefix? ( sys-libs/glibc ) + selinux? ( sec-policy/selinux-java )" +# scanelf won't create a PaX header, so depend on paxctl to avoid fallback +# marking. #427642 +DEPEND="${COMMON_DEP} + jce? ( app-arch/unzip ) + examples? ( kernel_linux? ( app-arch/unzip ) ) + pax_kernel? ( sys-apps/paxctl )" + +S="${WORKDIR}"/jdk${S_PV} + +check_tarballs_available() { + local uri=$1; shift + local dl= unavailable= + for dl in "${@}"; do + [[ ! -f "${DISTDIR}/${dl}" ]] && unavailable+=" ${dl}" + done + + if [[ -n "${unavailable}" ]]; then + if [[ -z ${_check_tarballs_available_once} ]]; then + einfo + einfo "Oracle requires you to download the needed files manually after" + einfo "accepting their license through a javascript capable web browser." + einfo + _check_tarballs_available_once=1 + fi + einfo "Download the following files:" + for dl in ${unavailable}; do + einfo " ${dl}" + done + einfo "at '${uri}'" + einfo "and move them to '${DISTDIR}'" + einfo + einfo "If the above mentioned urls do not point to the correct version anymore," + einfo "please download the files from Oracle's java download archive:" + einfo + einfo " http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-${MY_PV}-oth-JPR" + einfo + fi +} + +pkg_nofetch() { + local distfiles=( $(eval "echo \${$(echo AT_${ARCH/-/_})}") ) + if use examples && has ${ARCH} "${DEMOS_AVAILABLE[@]}"; then + distfiles+=( $(eval "echo \${$(echo DEMOS_${ARCH/-/_})}") ) + fi + check_tarballs_available "${JDK_URI}" "${distfiles[@]}" + + use jce && check_tarballs_available "${JCE_URI}" "${JCE_FILE}" +} + +src_prepare() { + if use jce; then + mv "${WORKDIR}"/${JCE_DIR} "${S}"/jre/lib/security/ || die + fi + eapply_user +} + +src_install() { + local dest="/opt/${P}" + local ddest="${ED}${dest}" + + # Create files used as storage for system preferences. + mkdir jre/.systemPrefs || die + touch jre/.systemPrefs/.system.lock || die + touch jre/.systemPrefs/.systemRootModFile || die + + # We should not need the ancient plugin for Firefox 2 anymore, plus it has + # writable executable segments + if use x86; then + rm -vf {,jre/}lib/i386/libjavaplugin_oji.so \ + {,jre/}lib/i386/libjavaplugin_nscp*.so + rm -vrf jre/plugin/i386 + fi + # Without nsplugin flag, also remove the new plugin + local arch=${ARCH}; + use x86 && arch=i386; + if ! use nsplugin; then + rm -vf {,jre/}lib/${arch}/libnpjp2.so \ + {,jre/}lib/${arch}/libjavaplugin_jni.so + fi + + dodoc COPYRIGHT + docinto html + dodoc README.html + + dodir "${dest}" + cp -pPR bin include jre lib man "${ddest}" || die + + if use derby; then + cp -pPR db "${ddest}" || die + fi + + if use examples && has ${ARCH} "${DEMOS_AVAILABLE[@]}"; then + cp -pPR demo sample "${ddest}" || die + if use kernel_linux; then + cp -pPR "${WORKDIR}"/javafx-samples-${FX_VERSION//_/.} \ + "${ddest}"/javafx-samples || die + fi + fi + + if use jce; then + dodir "${dest}"/jre/lib/security/strong-jce + mv "${ddest}"/jre/lib/security/US_export_policy.jar \ + "${ddest}"/jre/lib/security/strong-jce || die + mv "${ddest}"/jre/lib/security/local_policy.jar \ + "${ddest}"/jre/lib/security/strong-jce || die + dosym "${dest}"/jre/lib/security/${JCE_DIR}/US_export_policy.jar \ + "${dest}"/jre/lib/security/US_export_policy.jar + dosym "${dest}"/jre/lib/security/${JCE_DIR}/local_policy.jar \ + "${dest}"/jre/lib/security/local_policy.jar + fi + +# if use nsplugin; then +# install_mozilla_plugin "${dest}"/jre/lib/${arch}/libnpjp2.so +# fi + + if use source; then + cp -p src.zip "${ddest}" || die + fi + + if use !arm ; then + # Install desktop file for the Java Control Panel. + # Using ${PN}-${SLOT} to prevent file collision with jre and or + # other slots. make_desktop_entry can't be used as ${P} would + # end up in filename. + newicon jre/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png \ + sun-jcontrol-${PN}-${SLOT}.png || die + sed -e "s#Name=.*#Name=Java Control Panel for Oracle JDK ${SLOT}#" \ + -e "s#Exec=.*#Exec=/opt/${P}/jre/bin/jcontrol#" \ + -e "s#Icon=.*#Icon=sun-jcontrol-${PN}-${SLOT}#" \ + -e "s#Application;##" \ + -e "/Encoding/d" \ + jre/lib/desktop/applications/sun_java.desktop \ + > "${T}"/jcontrol-${PN}-${SLOT}.desktop || die + domenu "${T}"/jcontrol-${PN}-${SLOT}.desktop + fi + + # Prune all fontconfig files so libfontconfig will be used and only install + # a Gentoo specific one if fontconfig is disabled. + # http://docs.oracle.com/javase/7/docs/technotes/guides/intl/fontconfig.html + rm "${ddest}"/jre/lib/fontconfig.* + if ! use fontconfig; then + cp "${FILESDIR}"/fontconfig.Gentoo.properties "${T}"/fontconfig.properties || die + eprefixify "${T}"/fontconfig.properties + insinto "${dest}"/jre/lib/ + doins "${T}"/fontconfig.properties + fi + + # This needs to be done before CDS - #215225 + java-vm_set-pax-markings "${ddest}" + + # see bug #207282 + einfo "Creating the Class Data Sharing archives" + case ${ARCH} in + arm|ia64) + ${ddest}/bin/java -client -Xshare:dump || die + ;; + x86) + ${ddest}/bin/java -client -Xshare:dump || die + # limit heap size for large memory on x86 #467518 + # this is a workaround and shouldn't be needed. + ${ddest}/bin/java -server -Xms64m -Xmx64m -Xshare:dump || die + ;; + *) + ${ddest}/bin/java -server -Xshare:dump || die + ;; + esac + + # Remove empty dirs we might have copied + find "${D}" -type d -empty -exec rmdir -v {} + || die + + set_java_env + java-vm_revdep-mask + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter +} diff --git a/dev-java/oracle-jdk-bin/oracle-jdk-bin-1.8.0.241.ebuild b/dev-java/oracle-jdk-bin/oracle-jdk-bin-1.8.0.241.ebuild new file mode 100644 index 0000000..de06dc7 --- /dev/null +++ b/dev-java/oracle-jdk-bin/oracle-jdk-bin-1.8.0.241.ebuild @@ -0,0 +1,291 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit desktop gnome2-utils java-vm-2 prefix versionator + +KEYWORDS="-* amd64 x86" + +if [[ "$(get_version_component_range 4)" == 0 ]] ; then + S_PV="$(get_version_component_range 1-3)" +else + MY_PV_EXT="u$(get_version_component_range 4)" + S_PV="$(get_version_component_range 1-4)" +fi + +MY_PV="$(get_version_component_range 2)${MY_PV_EXT}" + +declare -A ARCH_FILES +ARCH_FILES[amd64]="jdk-${MY_PV}-linux-x64.tar.gz" +ARCH_FILES[arm]="jdk-${MY_PV}-linux-arm32-vfp-hflt.tar.gz" +ARCH_FILES[arm64]="jdk-${MY_PV}-linux-arm64-vfp-hflt.tar.gz" +ARCH_FILES[x86]="jdk-${MY_PV}-linux-i586.tar.gz" +ARCH_FILES[x64-macos]="jdk-${MY_PV}-macosx-x64.dmg" +ARCH_FILES[sparc64-solaris]="jdk-${MY_PV}-solaris-sparcv9.tar.gz" +ARCH_FILES[x64-solaris]="jdk-${MY_PV}-solaris-x64.tar.gz" + +for keyword in ${KEYWORDS//-\*} ; do + case "${keyword#\~}" in + *-linux) continue ;; + x64-macos) demo="jdk-${MY_PV}-macosx-x86_64-demos.zip" ;; + *) demo=${ARCH_FILES[${keyword#\~}]/./-demos.} ;; + esac + + SRC_URI+=" + ${keyword#\~}? ( + ${ARCH_FILES[${keyword#\~}]} + )" +done + +DESCRIPTION="Oracle's Java SE Development Kit" +HOMEPAGE="http://www.oracle.com/technetwork/java/javase/" +LICENSE="Oracle-BCLA-JavaSE" +SLOT="1.8" +IUSE="alsa commercial cups doc +fontconfig headless-awt javafx jce nsplugin selinux source visualvm" +REQUIRED_USE="javafx? ( alsa fontconfig )" +RESTRICT="bindist fetch preserve-libs strip" +QA_PREBUILT="*" + +# NOTES: +# +# * cups is dlopened. +# +# * libpng is also dlopened but only by libsplashscreen, which isn't +# important, so we can exclude that. +# +# * We still need to work out the exact AWT and JavaFX dependencies +# under MacOS. It doesn't appear to use many, if any, of the +# dependencies below. +# +RDEPEND="!x64-macos? ( + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrender + x11-libs/libXtst + ) + javafx? ( + dev-libs/glib:2 + dev-libs/libxml2:2 + dev-libs/libxslt + media-libs/freetype:2 + x11-libs/cairo + x11-libs/gtk+:2 + x11-libs/libX11 + x11-libs/libXtst + x11-libs/libXxf86vm + x11-libs/pango + virtual/opengl + ) + ) + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + doc? ( dev-java/java-sdk-docs:${SLOT} ) + fontconfig? ( media-libs/fontconfig:1.0 ) + !prefix? ( sys-libs/glibc:* ) + selinux? ( sec-policy/selinux-java )" + +DEPEND="app-arch/zip" + +S="${WORKDIR}/jdk$(replace_version_separator 3 _ ${S_PV})" + +pkg_nofetch() { + local a + einfo "Please download these files and move them to your distfiles directory:" + einfo + for a in ${A} ; do + [[ ! -f ${DISTDIR}/${a} ]] && einfo " ${a}" + done + einfo + einfo " http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" + einfo + einfo "If the above mentioned URL does not point to the correct version anymore," + einfo "please download the file from Oracle's Java download archive:" + einfo + einfo " http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html" + einfo +} + +src_unpack() { + if use x64-macos ; then + mkdir -p "${T}"/dmgmount || die + hdiutil attach "${DISTDIR}"/jdk-${MY_PV}-macosx-x64.dmg \ + -mountpoint "${T}"/dmgmount || die + local jdkgen=$(get_version_component_range 2) + local uver=$(get_version_component_range 4) + ( cd "${T}" && + xar -xf "${T}/dmgmount/JDK ${jdkgen} Update ${uver}.pkg" \ + jdk${PV//.}.pkg/Payload ) || die + zcat "${T}"/jdk${PV//.}.pkg/Payload | cpio -idv || die + hdiutil detach "${T}"/dmgmount || die + mv Contents/Home "${S}" || die + fi + + default +} + +src_prepare() { + default + + if [[ -n ${JAVA_PKG_STRICT} ]] ; then + # Mark this binary early to run it now. + pax-mark m ./bin/javap + + eqawarn "Ensure that this only calls trackJavaUsage(). If not, see bug #559936." + eqawarn + eqawarn "$(./bin/javap -J-Duser.home=${T} -c sun.misc.PostVMInitHook || die)" + fi + + # Remove the hook that calls Oracle's evil usage tracker. Not just + # because it's evil but because it breaks the sandbox during builds + # and we can't find any other feasible way to disable it or make it + # write somewhere else. See bug #559936 for details. + zip -d jre/lib/rt.jar sun/misc/PostVMInitHook.class || die +} + +src_install() { + local dest="/opt/${P}" + local ddest="${ED}${dest#/}" + + # Create files used as storage for system preferences. + mkdir jre/.systemPrefs || die + touch jre/.systemPrefs/.system.lock || die + touch jre/.systemPrefs/.systemRootModFile || die + + if ! use alsa ; then + rm -vf jre/lib/*/libjsoundalsa.* || die + fi + + if ! use commercial ; then + rm -vfr lib/missioncontrol jre/lib/jfr* || die + fi + + if use headless-awt ; then + rm -vf {,jre/}lib/*/lib*{[jx]awt,splashscreen}* \ + {,jre/}bin/{javaws,policytool} \ + bin/appletviewer || die + fi + + if ! use javafx ; then + rm -vf jre/lib/*/lib*{decora,fx,glass,prism}* \ + jre/lib/*/libgstreamer-lite.* {,jre/}lib/{,ext/}*fx* \ + bin/*javafx* bin/javapackager || die + fi + + if ! use nsplugin ; then + rm -vf jre/lib/*/libnpjp2.* || die + else + local nsplugin=$(echo jre/lib/*/libnpjp2.*) + local nsplugin_link=${nsplugin##*/} + nsplugin_link=${nsplugin_link/./-${PN}-${SLOT}.} + dosym "${dest}/${nsplugin}" "/usr/$(get_libdir)/nsbrowser/plugins/${nsplugin_link}" + fi + + # Even though plugins linked against multiple ffmpeg versions are + # provided, they generally lag behind what Gentoo has available. + rm -vf jre/lib/*/libavplugin* || die + + # Prune all fontconfig files so that libfontconfig will be used. + rm -v jre/lib/fontconfig.* || die + + # Packaged as dev-util/visualvm but some users prefer this version. + use visualvm || find -name "*visualvm*" -exec rm -vfr {} + || die + + # Install desktop file for the Java Control Panel. Using + # ${PN}-${SLOT} to prevent file collision with JRE and other slots. + if [[ -d jre/lib/desktop/icons ]] ; then + local icon + pushd jre/lib/desktop/icons >/dev/null || die + for icon in */*/apps/sun-jcontrol.png ; do + insinto /usr/share/icons/"${icon%/*}" + newins "${icon}" sun-jcontrol-${PN}-${SLOT}.png + done + popd >/dev/null || die + make_desktop_entry \ + "${dest}"/bin/jcontrol \ + "Java Control Panel for Oracle JDK ${SLOT}" \ + sun-jcontrol-${PN}-${SLOT} \ + "Settings;Java;" + fi + + dodoc COPYRIGHT + dodir "${dest}" + cp -pPR bin include jre lib man "${ddest}" || die + + ln -s policy/$(usex jce unlimited limited)/{US_export,local}_policy.jar \ + "${ddest}"/jre/lib/security/ || die + + if use source ; then + cp -v src.zip "${ddest}" || die + + if use javafx ; then + cp -v javafx-src.zip "${ddest}" || die + fi + fi + + # Only install Gentoo-specific fontconfig if flag is disabled. + # https://docs.oracle.com/javase/8/docs/technotes/guides/intl/fontconfig.html + if ! use fontconfig ; then + insinto "${dest}"/jre/lib/ + doins "$(prefixify_ro "${FILESDIR}"/fontconfig.properties)" + fi + + # Needs to be done before CDS, bug #215225. + java-vm_set-pax-markings "${ddest}" + + # See bug #207282. + einfo "Creating the Class Data Sharing archives" + case ${ARCH} in + arm|ia64) + ${ddest}/bin/java -client -Xshare:dump || die + ;; + x86) + ${ddest}/bin/java -client -Xshare:dump || die + # limit heap size for large memory on x86 #467518 + # this is a workaround and shouldn't be needed. + ${ddest}/bin/java -server -Xms64m -Xmx64m -Xshare:dump || die + ;; + *) + ${ddest}/bin/java -server -Xshare:dump || die + ;; + esac + + # Remove empty dirs we might have copied. + find "${D}" -type d -empty -exec rmdir -v {} + || die + + if use x64-macos ; then + local lib + for lib in lib{decora_sse,glass,prism_{common,es2,sw}}.dylib ; do + ebegin "Fixing self-reference of ${lib}" + install_name_tool \ + -id "${EPREFIX}${dest}"/jre/lib/${lib} \ + "${ddest}"/jre/lib/${lib} || die + eend $? + done + fi + + java-vm_install-env "${FILESDIR}"/${PN}.env.sh + java-vm_revdep-mask + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter +} + +pkg_preinst() { + gnome2_icon_savelist +} + +pkg_postinst() { + gnome2_icon_cache_update + java-vm-2_pkg_postinst + + if ! use headless-awt && ! use javafx ; then + ewarn "You have disabled the javafx flag. Some modern desktop Java applications" + ewarn "require this and they may fail with a confusing error message." + fi +} + +pkg_postrm() { + gnome2_icon_cache_update + java-vm-2_pkg_postrm +} diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest new file mode 100644 index 0000000..67381bb --- /dev/null +++ b/dev-lang/php/Manifest @@ -0,0 +1,9 @@ +AUX 20php5-envd 145 BLAKE2B 06476b8fc04d1e835496b417ac752f0834ddbe8584e4fddc6db0aa5e6845b82cdea0a1355c77125375dcdd0f0a3c19de5f3a8a64ee93950f96c437a16f971567 SHA512 581aa86479e3cd584ee1bc6dc6d4a135fe8ec343fe5519566d728d81f7018cfb23658bd0c0368951d380982c75adbb4f45acf3c146868aaf4e4ec8e9f2fad1ce +AUX php-fpm_at-simple.service 316 BLAKE2B 0ba10f3e3b004fbf14956e1e4f04f59b8a127e6717fe6b92c09b9f931033a11551c75fbbee9010f6b694c5a8758ca0eec9eed457ae304ba0dea8f2c256c3b8d4 SHA512 7367a3f8d3874f8e0c76f331ba613a0250db02f60ad9f87affaf448dcb5bc34bcecb91d88f415764a12b24b46ae3d1b738a002af9f77a4b707e916e83a0021fd +AUX php-fpm_at.service 317 BLAKE2B f13fc38fcc0575a8517ee8d07b120efda37eabd2355061d0fdc303604c6b02ad42d7301180d86c977d5e585f5dd685343c592e37a6e0f44933707be79e0b77e0 SHA512 27982f9e2d958bfa75c89c7d3531e48d17fc388b1cdcbc8e09051b236b1184ee2baabdfcc567c19d9fcd067d4b3b86f171015616d8da42fccdabd89432d865e8 +AUX php-icu-70.patch 1833 BLAKE2B f184d3ae52c6fc25329cbcd01abda2680739ebe29d1b4a97a3aaf6697b4dff385bdf423a4e41571ca534a57e35797a017c4bb507ce74db7f0a26455f90869e40 SHA512 f820320784ab7c99c23ac563b4908f33b6407204ad0486611e3471d7576477c016928534bb396587558061bc5d98e2deab4ad99e49b6c2746bfd06de729c7ae7 +AUX php-icu-fix.patch 404 BLAKE2B 9ddd108f1817f54eb1c3d20dfe7eda1f3a618f56bb44d89a174fec36c576363bc3e80b9b348fae67dbbd897ba18ce2f97b8b70b46a7b80382f8a68f5be40d84d SHA512 57aa49c580c489497bc54f2824c1f99fd104e7b1b7c524b7a0626ddcd28ed1c1867d1ada171ae381905c872b1ae564c0515e574c05e6d468f263b038b2f4597a +DIST php-5.6.40.tar.xz 12472236 BLAKE2B f41147eaec9b15e965540f9e871691cc88848dd619bae6af85e7bba0130b71ce91bad5cdbbadbb537c42df83369f5c731007339a9d9e21e689e913c135201afc SHA512 997b5a952a60cf9166671cc91fcc34c674dd62bfd5cb0a9cdf3fdf2d088b5d19943d94c1cf193f8ab71fc4957d9a9a4c7c2fb8826f937501c1c0a0858f10e329 +DIST php-patches-7.1.33bp.tar.bz2 39945 BLAKE2B 9f7137f61b7ea07cc263b054401a319042f5a40d6cdaf3561a45778ae009e3279c72f2a6a0f9c97805bc39acef1c8c9d72d290c2ce873f44209fb2d65d620810 SHA512 8e36fb57bdadfcc4e976ecb7dc8f44290dc3b507eb27f4445aa2c8eba528e7cb53286e7fd9b1b9141f12fd6e29278282e4f0eb6445ed06046dd48a1d5d1bc789 +EBUILD php-5.6.40-r7.ebuild 23052 BLAKE2B 799886bc2362de5e0914c5f7426101b303ebdaf242ef4c01a3561d3b3ac328a5b5253c96cb742e09adb0896ebd61a6063a81f8bc6333987c674273c24b99beeb SHA512 6050f731fb361e926248d10df4702a167513231fdf3081a08b93410c8bab37fab57e2df11900d08263fab6ee5321f5828d41234e79799ed8ce0c5d80a99e4abd +MISC metadata.xml 3352 BLAKE2B 155c08bb52b049c3f79557d27ab6be9402cd35797cd385d53fc8c239c0eca089f65e106d54beca0642b8d182bfd0e172886b863a692575e9002140af7a62fa08 SHA512 f37c4c7b709bf91da6db41b0468c36cebffc630dabdcf4d43259017be5cf0577bb329ed0e206ff14d68bacc33425fba4789fc13fa34aa61acccce9fda11eee86 diff --git a/dev-lang/php/files/20php5-envd b/dev-lang/php/files/20php5-envd new file mode 100644 index 0000000..f6033ae --- /dev/null +++ b/dev-lang/php/files/20php5-envd @@ -0,0 +1,2 @@ +MANPATH="/usr/lib/php5/man/" +CONFIG_PROTECT_MASK="/etc/php/cli-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/apache2-php5/ext-active/" diff --git a/dev-lang/php/files/php-fpm_at-simple.service b/dev-lang/php/files/php-fpm_at-simple.service new file mode 100644 index 0000000..5f0482e --- /dev/null +++ b/dev-lang/php/files/php-fpm_at-simple.service @@ -0,0 +1,13 @@ +[Unit] +Description=The PHP FastCGI Process Manager +After=network.target + +[Service] +Type=simple +PIDFile=/run/php-fpm/php-fpm-%I.pid +ExecStart=/usr/libexec/php-fpm-launcher php%I -y /etc/php/fpm-php%I/php-fpm.conf --nodaemonize +ExecReload=/bin/kill -USR2 $MAINPID +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/dev-lang/php/files/php-fpm_at.service b/dev-lang/php/files/php-fpm_at.service new file mode 100644 index 0000000..152c1ab --- /dev/null +++ b/dev-lang/php/files/php-fpm_at.service @@ -0,0 +1,14 @@ +[Unit] +Description=The PHP FastCGI Process Manager +After=network.target + +[Service] +Type=notify +PIDFile=/run/php-fpm/php-fpm-%I.pid +ExecStart=/usr/libexec/php-fpm-launcher php%I -y /etc/php/fpm-php%I/php-fpm.conf --nodaemonize +ExecReload=/bin/kill -USR2 $MAINPID +PrivateTmp=true + +[Install] +WantedBy=multi-user.target + diff --git a/dev-lang/php/files/php-icu-70.patch b/dev-lang/php/files/php-icu-70.patch new file mode 100644 index 0000000..288aa5f --- /dev/null +++ b/dev-lang/php/files/php-icu-70.patch @@ -0,0 +1,42 @@ +diff -Naur a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp +--- a/ext/intl/breakiterator/codepointiterator_internal.cpp 2022-02-12 10:06:56.410352885 +0100 ++++ b/ext/intl/breakiterator/codepointiterator_internal.cpp 2022-02-12 10:07:41.236949927 +0100 +@@ -74,7 +74,11 @@ + clearCurrentCharIter(); + } + ++#if U_ICU_VERSION_MAJOR_NUM >= 70 ++bool CodePointBreakIterator::operator==(const BreakIterator& that) const ++#else + UBool CodePointBreakIterator::operator==(const BreakIterator& that) const ++#endif + { + if (typeid(*this) != typeid(that)) { + return FALSE; +diff -Naur a/ext/intl/breakiterator/codepointiterator_internal.h b/ext/intl/breakiterator/codepointiterator_internal.h +--- a/ext/intl/breakiterator/codepointiterator_internal.h 2022-02-12 10:06:56.410352885 +0100 ++++ b/ext/intl/breakiterator/codepointiterator_internal.h 2022-02-12 10:07:41.236949927 +0100 +@@ -39,7 +39,11 @@ + + virtual ~CodePointBreakIterator(); + ++#if U_ICU_VERSION_MAJOR_NUM >= 70 ++ virtual bool operator==(const BreakIterator& that) const; ++#else + virtual UBool operator==(const BreakIterator& that) const; ++#endif + + virtual CodePointBreakIterator* clone(void) const; + +diff -Naur a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c +--- a/ext/intl/locale/locale_methods.c 2019-01-09 10:54:13.000000000 +0100 ++++ b/ext/intl/locale/locale_methods.c 2022-02-12 10:08:21.679684186 +0100 +@@ -1324,7 +1324,7 @@ + if( token && (token==cur_lang_tag) ){ + /* check if the char. after match is SEPARATOR */ + chrcheck = token + (strlen(cur_loc_range)); +- if( isIDSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){ ++ if( isIDSeparator(*chrcheck) || isKeywordSeparator(*chrcheck) || isEndOfTag(*chrcheck) ){ + if( cur_lang_tag){ + efree( cur_lang_tag ); + } diff --git a/dev-lang/php/files/php-icu-fix.patch b/dev-lang/php/files/php-icu-fix.patch new file mode 100644 index 0000000..1566fdf --- /dev/null +++ b/dev-lang/php/files/php-icu-fix.patch @@ -0,0 +1,12 @@ +--- php-5.6.40/acinclude.m4 2021-01-31 11:00:18.549678215 +0100 ++++ php-5.6.40/acinclude.m4 2021-01-31 11:01:50.030900044 +0100 +@@ -2212,6 +2212,9 @@ + if test "$PKG_CONFIG icu-io --atleast-version=60"; then + ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1" + fi ++ ++ ICU_CFLAGS="$ICU_CFLAGS -DU_DEFINE_FALSE_AND_TRUE=1" ++ ICU_CXXFLAGS="$ICU_CXXFLAGS -DU_DEFINE_FALSE_AND_TRUE=1" + ]) + + dnl diff --git a/dev-lang/php/metadata.xml b/dev-lang/php/metadata.xml new file mode 100644 index 0000000..47de79c --- /dev/null +++ b/dev-lang/php/metadata.xml @@ -0,0 +1,70 @@ + + + + + php-bugs@gentoo.org + PHP + + + Enable password hashing algorithm from app-crypt/argon2 + Add support for libbcmath + Enable CLI SAPI + + Include gcov symbols for test coverage and lcov reports. Only + useful for extension developers, and requires GCC. + + Enable ctype functions + Enable embed SAPI + Add supports Enchant spelling library. + Add foreign function interface (ffi extension) support + Add fileinfo extension support + Add filter extension support + Add dbm support for flat files + Enable the FastCGI Process Manager SAPI + Adds support for gd (bundled with PHP) + Enable the hash extension + Add dbm support for .ini files + Enable JSON support + Add SASL support for the PHP LDAP extension + + Use libmyslclient driver for mysql, mysqli, PDO_Mysql (not recommended) + + Enable support for dev-db/lmdb db backend + + Enables the intl extension for extended internalization support + + + Enables built-in opcode cache, replacing pecl-apc et al. + + Add support for process creation functions + Enable the bundled PDO extensions + + Enables the phar extension to provide phar archive support + + + Enable the PHP Debug Command Line SAPI (like gdb for php) + + + Include dev-libs/mm support for session storage + + Add support for shared memory use + Support for SimpleXML + + Enable support for crypto through dev-libs/libsodium + + Add support for Sybase-CT + + Support for System V-compatible inter-process communication + + Add support for the PHP file parser + + Enable support for dev-db/tokyocabinet db backend + Enable XMLReader support + Enable XMLWriter support + Enable the XSL extension + Enable webp support for GD in php-5.x + Add support for Web Distributed Data eXchange + Enable webp support for GD in php-7.x + Enable ZIP file encryption from dev-libs/libzip + + diff --git a/dev-lang/php/php-5.6.40-r7.ebuild b/dev-lang/php/php-5.6.40-r7.ebuild new file mode 100644 index 0000000..1e137a2 --- /dev/null +++ b/dev-lang/php/php-5.6.40-r7.ebuild @@ -0,0 +1,795 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +inherit autotools flag-o-matic systemd + +PATCH_V="7.1.33bp" + +DESCRIPTION="The PHP language runtime engine" +HOMEPAGE="https://secure.php.net/" +SRC_URI="https://php.net/distributions/${P}.tar.xz + https://gitweb.gentoo.org/proj/php-patches.git/snapshot/php-patches-${PATCH_V}.tar.bz2" + +LICENSE="PHP-3.01 + BSD + Zend-2.0 + bcmath? ( LGPL-2.1+ ) + fpm? ( BSD-2 ) + gd? ( gd ) + unicode? ( BSD-2 LGPL-2.1 )" + +SLOT="$(ver_cut 1-2)" +KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" + +# We can build the following SAPIs in the given order +SAPIS="embed cli cgi fpm apache2" + +# SAPIs and SAPI-specific USE flags (cli SAPI is default on): +IUSE="${IUSE} + ${SAPIS/cli/+cli} + threads" + +IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk + coverage crypt +ctype curl debug + enchant exif +fileinfo +filter firebird + +flatfile ftp gd gdbm gmp +hash +iconv imap inifile + intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl + mhash mssql mysql libmysqlclient mysqli nls + oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm + readline recode selinux +session sharedmem + +simplexml snmp soap sockets spell sqlite ssl + sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx + +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" + +# The supported (that is, autodetected) versions of BDB are listed in +# the ./configure script. Other versions *work*, but we need to stick to +# the ones that can be detected to avoid a repeat of bug #564824. +COMMON_DEPEND=" + >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] + >=dev-libs/libpcre-8.32[unicode] + fpm? ( acl? ( sys-apps/acl ) ) + apache2? ( www-servers/apache[apache2_modules_unixd(+),threads=] ) + berkdb? ( || ( sys-libs/db:5.3 + sys-libs/db:5.1 + sys-libs/db:4.8 + sys-libs/db:4.7 + sys-libs/db:4.6 + sys-libs/db:4.5 ) ) + bzip2? ( app-arch/bzip2:0= ) + cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) + cjk? ( !gd? ( + virtual/jpeg:0 + media-libs/libpng:0= + sys-libs/zlib:0= + ) ) + coverage? ( dev-util/lcov ) + crypt? ( >=dev-libs/libmcrypt-2.4 ) + curl? ( >=net-misc/curl-7.10.5 ) + enchant? ( app-text/enchant ) + exif? ( !gd? ( + virtual/jpeg:0 + media-libs/libpng:0= + sys-libs/zlib:0= + ) ) + firebird? ( dev-db/firebird ) + gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) + gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) + gmp? ( dev-libs/gmp:0= ) + iconv? ( virtual/libiconv ) + imap? ( >=virtual/imap-c-client-2[kerberos=,ssl=] ) + intl? ( dev-libs/icu:= ) + iodbc? ( dev-db/libiodbc ) + kerberos? ( virtual/krb5 ) + ldap? ( >=net-nds/openldap-1.2.11 ) + ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) + libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) + mssql? ( dev-db/freetds[mssql] ) + libmysqlclient? ( + mysql? ( =dev-db/unixODBC-1.8.13 ) + postgres? ( dev-db/postgresql:* ) + qdbm? ( dev-db/qdbm ) + readline? ( sys-libs/readline:0= ) + recode? ( app-text/recode ) + sharedmem? ( dev-libs/mm ) + simplexml? ( >=dev-libs/libxml2-2.6.8 ) + snmp? ( >=net-analyzer/net-snmp-5.2 ) + soap? ( >=dev-libs/libxml2-2.6.8 ) + spell? ( >=app-text/aspell-0.50 ) + sqlite? ( >=dev-db/sqlite-3.7.6.3 ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + sybase-ct? ( dev-db/freetds ) + tidy? ( app-text/htmltidy ) + truetype? ( + =media-libs/freetype-2* + >=media-libs/t1lib-5.0.0 + !gd? ( + virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) + ) + unicode? ( dev-libs/oniguruma:= ) + vpx? ( media-libs/libvpx:0= ) + wddx? ( >=dev-libs/libxml2-2.6.8 ) + xml? ( >=dev-libs/libxml2-2.6.8 ) + xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) + xmlreader? ( >=dev-libs/libxml2-2.6.8 ) + xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) + xpm? ( + x11-libs/libXpm + virtual/jpeg:0 + media-libs/libpng:0= sys-libs/zlib:0= + ) + xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) + zip? ( sys-libs/zlib:0= ) + zlib? ( sys-libs/zlib:0= ) +" + +RDEPEND="${COMMON_DEPEND} + virtual/mta + fpm? ( + selinux? ( sec-policy/selinux-phpfpm ) + systemd? ( sys-apps/systemd ) )" + +DEPEND="${COMMON_DEPEND} + app-arch/xz-utils + >=sys-devel/bison-3.0.1 + sys-devel/flex + >=sys-devel/m4-1.4.3 + >=sys-devel/libtool-1.5.18" + +# Without USE=readline or libedit, the interactive "php -a" CLI will hang. +REQUIRED_USE=" + || ( cli cgi fpm apache2 embed ) + cli? ( ^^ ( readline libedit ) ) + truetype? ( gd zlib ) + vpx? ( gd zlib ) + cjk? ( gd zlib ) + exif? ( gd zlib ) + xpm? ( gd zlib ) + gd? ( zlib ) + simplexml? ( xml ) + soap? ( xml ) + wddx? ( xml ) + xmlrpc? ( || ( xml iconv ) ) + xmlreader? ( xml ) + xslt? ( xml ) + ldap-sasl? ( ldap ) + mhash? ( hash ) + phar? ( hash ) + recode? ( !imap !mysql !mysqli !libmysqlclient ) + libmysqlclient? ( || ( + mysql + mysqli + pdo + ) ) + + qdbm? ( !gdbm ) + readline? ( !libedit ) + sharedmem? ( !threads ) +" + +PHP_MV="$(ver_cut 1)" + +PATCHES=( + "${FILESDIR}"/php-icu-fix.patch + "${FILESDIR}"/php-icu-70.patch +) + +php_install_ini() { + local phpsapi="${1}" + + # work out where we are installing the ini file + php_set_ini_dir "${phpsapi}" + + # Always install the production INI file, bug 611214. + local phpinisrc="php.ini-production-${phpsapi}" + cp php.ini-production "${phpinisrc}" || die + + # default to /tmp for save_path, bug #282768 + sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die + + # Set the extension dir + sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ + -i "${phpinisrc}" || die + + # Set the include path to point to where we want to find PEAR packages + sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die + + dodir "${PHP_INI_DIR#${EPREFIX}}" + insinto "${PHP_INI_DIR#${EPREFIX}}" + newins "${phpinisrc}" php.ini + + elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" + elog + + dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" + dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" + + if use opcache; then + elog "Adding opcache to $PHP_EXT_INI_DIR" + echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ + "${D}/${PHP_EXT_INI_DIR}"/opcache.ini + dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ + "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" + fi + + # SAPI-specific handling + if [[ "${sapi}" == "fpm" ]] ; then + einfo "Installing FPM config file php-fpm.conf" + insinto "${PHP_INI_DIR#${EPREFIX}}" + doins sapi/fpm/php-fpm.conf + fi + + dodoc php.ini-{development,production} +} + +php_set_ini_dir() { + PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" + PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" + PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" +} + +src_prepare() { + local patchdir="${WORKDIR}/php-patches-${PATCH_V}" + + eapply "${patchdir}/" + + eapply "${PATCHES[@]}" + + # Copy test binaries from patches + local ext_src + for ext_src in exif iconv ; do + cp "${patchdir}/${ext_src}/"* "ext/${ext_src}/tests/" || die + done + + # Change PHP branding + # Get the alpha/beta/rc version + sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ + -i configure.in || die "Unable to change PHP branding" + + # Patch PHP to show Gentoo as the server platform + sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ + -i configure.in || die "Failed to fix server platform name" + + # Prevent PHP from activating the Apache config, + # as we will do that ourselves + sed -i \ + -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ + -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ + configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ + || die + + # Patch PHP to support heimdal instead of mit-krb5 + if has_version "app-crypt/heimdal" ; then + sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ + || die "Failed to fix heimdal libname" + sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ + || die "Failed to fix heimdal crypt library reference" + fi + + eapply_user + + # Force rebuilding aclocal.m4 + rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare" + + mv configure.in configure.ac || die + + eautoreconf + + if [[ ${CHOST} == *-darwin* ]] ; then + # http://bugs.php.net/bug.php?id=48795, bug #343481 + sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die + fi +} + +src_configure() { + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" + + # The php-fpm config file wants localstatedir to be ${EPREFIX}/var + # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. + local our_conf=( + --prefix="${PHP_DESTDIR}" + --mandir="${PHP_DESTDIR}/man" + --infodir="${PHP_DESTDIR}/info" + --libdir="${PHP_DESTDIR}/lib" + --with-libdir="$(get_libdir)" + --localstatedir="${EPREFIX}/var" + --without-pear + $(use_enable threads maintainer-zts) + ) + + our_conf+=( + $(use_enable bcmath bcmath) + $(use_with bzip2 bz2 "${EPREFIX}/usr") + $(use_enable calendar calendar) + $(use_enable coverage gcov) + $(use_enable ctype ctype) + $(use_with curl curl "${EPREFIX}/usr") + $(use_enable xml dom) + $(use_with enchant enchant "${EPREFIX}/usr") + $(use_enable exif exif) + $(use_enable fileinfo fileinfo) + $(use_enable filter filter) + $(use_enable ftp ftp) + $(use_with nls gettext "${EPREFIX}/usr") + $(use_with gmp gmp "${EPREFIX}/usr") + $(use_enable hash hash) + $(use_with mhash mhash "${EPREFIX}/usr") + $(use_with iconv iconv \ + $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) + $(use_enable intl intl) + $(use_enable ipv6 ipv6) + $(use_enable json json) + $(use_with kerberos kerberos "${EPREFIX}/usr") + $(use_enable xml libxml) + $(use_with xml libxml-dir "${EPREFIX}/usr") + $(use_enable unicode mbstring) + $(use_with crypt mcrypt "${EPREFIX}/usr") + $(use_with mssql mssql "${EPREFIX}/usr") + $(use_with unicode onig "${EPREFIX}/usr") + $(use_with ssl openssl "${EPREFIX}/usr") + $(use_with ssl openssl-dir "${EPREFIX}/usr") + $(use_enable pcntl pcntl) + $(use_enable phar phar) + $(use_enable pdo pdo) + $(use_enable opcache opcache) + $(use_with postgres pgsql "${EPREFIX}/usr") + $(use_enable posix posix) + $(use_with spell pspell "${EPREFIX}/usr") + $(use_with recode recode "${EPREFIX}/usr") + $(use_enable simplexml simplexml) + $(use_enable sharedmem shmop) + $(use_with snmp snmp "${EPREFIX}/usr") + $(use_enable soap soap) + $(use_enable sockets sockets) + $(use_with sqlite sqlite3 "${EPREFIX}/usr") + $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") + $(use_enable sysvipc sysvmsg) + $(use_enable sysvipc sysvsem) + $(use_enable sysvipc sysvshm) + $(use_with tidy tidy "${EPREFIX}/usr") + $(use_enable tokenizer tokenizer) + $(use_enable wddx wddx) + $(use_enable xml xml) + $(use_enable xmlreader xmlreader) + $(use_enable xmlwriter xmlwriter) + $(use_with xmlrpc xmlrpc) + $(use_with xslt xsl "${EPREFIX}/usr") + $(use_enable zip zip) + $(use_with zlib zlib "${EPREFIX}/usr") + $(use_enable debug debug) + ) + + # DBA support + if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ + || use qdbm ; then + our_conf+=( "--enable-dba${shared}" ) + fi + + # DBA drivers support + our_conf+=( + $(use_with cdb cdb) + $(use_with berkdb db4 "${EPREFIX}/usr") + $(use_enable flatfile flatfile) + $(use_with gdbm gdbm "${EPREFIX}/usr") + $(use_enable inifile inifile) + $(use_with qdbm qdbm "${EPREFIX}/usr") + ) + + # Support for the GD graphics library + our_conf+=( + $(use_with truetype freetype-dir "${EPREFIX}/usr") + $(use_with truetype t1lib "${EPREFIX}/usr") + $(use_enable cjk gd-jis-conv) + $(use_with gd jpeg-dir "${EPREFIX}/usr") + $(use_with gd png-dir "${EPREFIX}/usr") + $(use_with xpm xpm-dir "${EPREFIX}/usr") + $(use_with vpx vpx-dir "${EPREFIX}/usr") + ) + # enable gd last, so configure can pick up the previous settings + our_conf+=( $(use_with gd gd) ) + + # IMAP support + if use imap ; then + our_conf+=( + $(use_with imap imap "${EPREFIX}/usr") + $(use_with ssl imap-ssl "${EPREFIX}/usr") + ) + fi + + # Interbase/firebird support + our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) + + # LDAP support + if use ldap ; then + our_conf+=( + $(use_with ldap ldap "${EPREFIX}/usr") + $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") + ) + fi + + # MySQL support + local mysqllib="mysqlnd" + local mysqlilib="mysqlnd" + use libmysqlclient && mysqllib="${EPREFIX}/usr" + use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" + + our_conf+=( $(use_with mysql mysql "${mysqllib}") ) + our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) + + local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" + if use mysql || use mysqli ; then + our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) + fi + + # ODBC support + our_conf+=( + $(use_with odbc unixODBC "${EPREFIX}/usr") + $(use_with iodbc iodbc "${EPREFIX}/usr") + ) + + # Oracle support + our_conf+=( $(use_with oci8-instant-client oci8) ) + + # PDO support + if use pdo ; then + our_conf+=( + $(use_with mssql pdo-dblib) + $(use_with mysql pdo-mysql "${mysqllib}") + $(use_with postgres pdo-pgsql) + $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") + $(use_with firebird pdo-firebird "${EPREFIX}/usr") + $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") + $(use_with oci8-instant-client pdo-oci) + ) + fi + + # readline/libedit support + our_conf+=( + $(use_with readline readline "${EPREFIX}/usr") + $(use_with libedit libedit "${EPREFIX}/usr") + ) + + # Session support + if use session ; then + our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) + else + our_conf+=( $(use_enable session session) ) + fi + + # Use pic for shared modules such as apache2's mod_php + our_conf+=( --with-pic ) + + # we use the system copy of pcre + # --with-pcre-regex affects ext/pcre + # --with-pcre-dir affects ext/filter and ext/zip + our_conf+=( + --with-pcre-regex="${EPREFIX}/usr" + --with-pcre-dir="${EPREFIX}/usr" + ) + + # Catch CFLAGS problems + # Fixes bug #14067. + # Changed order to run it in reverse for bug #32022 and #12021. + replace-cpu-flags "k6*" "i586" + + # Cache the ./configure test results between SAPIs. + our_conf+=( --cache-file="${T}/config.cache" ) + + # Support user-passed configuration parameters + our_conf+=( ${EXTRA_ECONF:-} ) + + # Support the Apache2 extras, they must be set globally for all + # SAPIs to work correctly, especially for external PHP extensions + + mkdir -p "${WORKDIR}/sapis-build" || die + for one_sapi in $SAPIS ; do + use "${one_sapi}" || continue + php_set_ini_dir "${one_sapi}" + + # The BUILD_DIR variable is used to determine where to output + # the files that autotools creates. This was all originally + # based on the autotools-utils eclass. + BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" + cp -a "${S}" "${BUILD_DIR}" || die + cd "${BUILD_DIR}" || die + + local sapi_conf=( + --with-config-file-path="${PHP_INI_DIR}" + --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" + ) + + for sapi in $SAPIS ; do + case "$sapi" in + cli|cgi|embed|fpm) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( "--enable-${sapi}" ) + if [[ "fpm" == "${sapi}" ]] ; then + sapi_conf+=( + $(use_with acl fpm-acl) + $(use_with systemd fpm-systemd) + ) + fi + else + sapi_conf+=( "--disable-${sapi}" ) + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) + else + sapi_conf+=( --without-apxs2 ) + fi + ;; + esac + done + + # Construct the $myeconfargs array by concatenating $our_conf + # (the common args) and $sapi_conf (the SAPI-specific args). + local myeconfargs=( "${our_conf[@]}" ) + myeconfargs+=( "${sapi_conf[@]}" ) + + pushd "${BUILD_DIR}" > /dev/null || die + econf "${myeconfargs[@]}" + popd > /dev/null || die + done +} + +src_compile() { + # snmp seems to run during src_compile, too (bug #324739) + addpredict /usr/share/snmp/mibs/.index #nowarn + addpredict /var/lib/net-snmp/mib_indexes #nowarn + + for sapi in ${SAPIS} ; do + if use "${sapi}"; then + cd "${WORKDIR}/sapis-build/$sapi" || \ + die "Failed to change dir to ${WORKDIR}/sapis-build/$1" + emake + fi + done +} + +src_install() { + # see bug #324739 for what happens when we don't have that + addpredict /usr/share/snmp/mibs/.index #nowarn + + # grab the first SAPI that got built and install common files from there + local first_sapi="" + for sapi in $SAPIS ; do + if use $sapi ; then + first_sapi=$sapi + break + fi + done + + # Makefile forgets to create this before trying to write to it... + dodir "${PHP_DESTDIR#${EPREFIX}}/bin" + + # Install php environment (without any sapis) + cd "${WORKDIR}/sapis-build/$first_sapi" || die + emake INSTALL_ROOT="${D}" \ + install-build install-headers install-programs + + local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" + + # Create the directory where we'll put version-specific php scripts + keepdir "/usr/share/php${PHP_MV}" + + local sapi="", file="" + local sapi_list="" + + for sapi in ${SAPIS}; do + if use "${sapi}" ; then + einfo "Installing SAPI: ${sapi}" + cd "${WORKDIR}/sapis-build/${sapi}" || die + + if [[ "${sapi}" == "apache2" ]] ; then + # We're specifically not using emake install-sapi as libtool + # may cause unnecessary relink failures (see bug #351266) + insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" + newins ".libs/libphp5$(get_libname)" \ + "libphp${PHP_MV}$(get_libname)" + keepdir "/usr/$(get_libdir)/apache2/modules" + else + # needed each time, php_install_ini would reset it + local dest="${PHP_DESTDIR#${EPREFIX}}" + into "${dest}" + case "$sapi" in + cli) + source="sapi/cli/php" + ;; + cgi) + source="sapi/cgi/php-cgi" + ;; + fpm) + source="sapi/fpm/php-fpm" + ;; + embed) + source="libs/libphp${PHP_MV}$(get_libname)" + ;; + *) + die "unhandled sapi in src_install" + ;; + esac + + if [[ "${source}" == *"$(get_libname)" ]]; then + dolib.so "${source}" + else + dobin "${source}" + local name="$(basename ${source})" + dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" + fi + fi + + php_install_ini "${sapi}" + + # construct correct SAPI string for php-config + # thanks to ferringb for the bash voodoo + if [[ "${sapi}" == "apache2" ]]; then + sapi_list="${sapi_list:+${sapi_list} }apache2handler" + else + sapi_list="${sapi_list:+${sapi_list} }${sapi}" + fi + fi + done + + # Installing opcache module + if use opcache ; then + into "${PHP_DESTDIR#${EPREFIX}}" + dolib.so "modules/opcache$(get_libname)" + fi + + # Install env.d files + newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" + sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die + + # set php-config variable correctly (bug #278439) + sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ + "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die + + if use fpm ; then + if use systemd; then + systemd_newunit "${FILESDIR}/php-fpm_at.service" \ + "php-fpm@${SLOT}.service" + else + systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ + "php-fpm@${SLOT}.service" + fi + fi +} + +src_test() { + echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" + if [[ ! -x "${PHP_BIN}" ]] ; then + ewarn "Test phase requires USE=cli, skipping" + return + else + export TEST_PHP_EXECUTABLE="${PHP_BIN}" + fi + + if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then + export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" + fi + + REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ + "session.save_path=${T}" \ + "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ + "session.save_path=${T}" + + for name in ${EXPECTED_TEST_FAILURES}; do + mv "${name}.out" "${name}.out.orig" 2>/dev/null || die + done + + local failed="$(find -name '*.out')" + if [[ ${failed} != "" ]] ; then + ewarn "The following test cases failed unexpectedly:" + for name in ${failed}; do + ewarn " ${name/.out/}" + done + else + einfo "No unexpected test failures, all fine" + fi + + if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then + local passed="" + for name in ${EXPECTED_TEST_FAILURES}; do + [[ -f "${name}.diff" ]] && continue + passed="${passed} ${name}" + done + if [[ ${passed} != "" ]] ; then + einfo "The following test cases passed unexpectedly:" + for name in ${passed}; do + ewarn " ${passed}" + done + else + einfo "None of the known-to-fail tests passed, all fine" + fi + fi +} + +pkg_postinst() { + # Output some general info to the user + if use apache2 ; then + elog + elog "To enable PHP in apache, you will need to add \"-D PHP\" to" + elog "your apache2 command. OpenRC users can append that string to" + elog "APACHE2_OPTS in /etc/conf.d/apache2." + elog + elog "The apache module configuration file 70_mod_php.conf is" + elog "provided (and maintained) by eselect-php." + elog + fi + + # Create the symlinks for php + for m in ${SAPIS}; do + [[ ${m} == 'embed' ]] && continue; + if use $m ; then + local ci=$(eselect php show $m) + if [[ -z $ci ]]; then + eselect php set $m php${SLOT} || die + einfo "Switched ${m} to use php:${SLOT}" + einfo + elif [[ $ci != "php${SLOT}" ]] ; then + elog "To switch $m to use php:${SLOT}, run" + elog " eselect php set $m php${SLOT}" + elog + fi + fi + done + + # Remove dead symlinks for SAPIs that were just disabled. For + # example, if the user has the cgi SAPI enabled, then he has an + # eselect-php symlink for it. If he later reinstalls PHP with + # USE="-cgi", that symlink will break. This call to eselect is + # supposed to remove that dead link per bug 572436. + eselect php cleanup || die + + if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then + elog "To build extensions for this version of PHP, you will need to" + elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." + elog + fi + + # Warn about the removal of PHP_INI_VERSION if the user has it set. + if [[ -n "${PHP_INI_VERSION}" ]]; then + ewarn 'The PHP_INI_VERSION variable has been phased out. You may' + ewarn 'remove it from your configuration at your convenience. See' + ewarn + ewarn ' https://bugs.gentoo.org/611214' + ewarn + ewarn 'for more information.' + fi + + elog "For details on how version slotting works, please see" + elog "the wiki:" + elog + elog " https://wiki.gentoo.org/wiki/PHP" + elog +} + +pkg_postrm() { + # This serves two purposes. First, if we have just removed the last + # installed version of PHP, then this will remove any dead symlinks + # belonging to eselect-php. Second, if a user upgrades slots from + # (say) 5.6 to 7.0 and depcleans the old slot, then this will update + # his existing symlinks to point to the new 7.0 installation. The + # latter is bug 432962. + # + # Note: the eselect-php package may not be installed at this point, + # so we can't die() if this command fails. + eselect php cleanup +} diff --git a/dev-scheme/guile/Manifest b/dev-scheme/guile/Manifest new file mode 100644 index 0000000..b202d5d --- /dev/null +++ b/dev-scheme/guile/Manifest @@ -0,0 +1,8 @@ +AUX 50guile-gentoo.el 38 BLAKE2B e96c6cf48d1522d89450e11d339c76210c672377208b56951791b83c6ef22b2c872d313084e199dd5d7b533a99106a87dbc7f15b5ee6126f71bf5f2e84165ffa SHA512 5c00bcabe2d7cc03013dc7a54b2c653940c08098ca5646d7c73624cb1ca04376ae9dcf88a7166b1925c69f0c5d192d90f6bd790fdef8ed8c3b0f9d163c987da5 +AUX guile-2-snarf.patch 1274 BLAKE2B e9efdd1e14560579131ecff748add4f97de730678e6f766681be72f95bf99ab36edd8bc7279701084d13f3fa762968af814760bcf9b8778c73c956c282bb3c93 SHA512 49d015b08d0bcf5d27aa43d4a595b2ccb4366dffe0f5d159162c8c7747fb9fdbe84056a737f3c81a6e39281d91109bfa4aa98c85dd0e757c17ab668a1dd46f24 +AUX guile-2.0.14-configure-clang16.patch 2083 BLAKE2B db51de35520459eef3b66102a77afbcc492f2762e5629c5c63239dff9169f51104dbbadbedccfbdb3c83b051bd80ec82807f7a4e0ba1d43cc4c292b6a5d3ecc6 SHA512 40b1f6c4f2a04da26ceb0ffb6d016476b673d142ce465895c4fc241b24cb4dc0f3b0e759d51817f9cad27cea7c9cb56dc38507312f28af27daed6f362c70bb4c +AUX guile-2.0.14-darwin.patch 1026 BLAKE2B 9193732cfb74931f7bf8e9b55c5c9dd2621ef6271c8d18190e0ed94d90decde85272f271bbbe7d3c4dd0dd509e51fae3f7f0af42872a0b9ebb87396c9e69a9d2 SHA512 151d19f171656105d87336f81dd8c34273d07a3e88aa03ac5ca8d640c79ab317a90ef06097858bf627e4666fba747faea45237c73e7bc6462d19d8f0d1904d53 +AUX guile-2.0.14-ia64-fix-crash-thread-context-switch.patch 2426 BLAKE2B 5b2073a3780794e9466d8e5434ab98a91a821408ab792abbfaf61d09c95e113b99746b0da850115b4534bda00b1313cef5bb9b08c90c8bf9a04c81b1eb78faa3 SHA512 082f98ac4ee2f40dd3762006bf5c43022088b2286c9a8d63ae9e234d3c8527f3afcfba8076e0c8578e7fbed257294db6ce1a4513661b89f821579dc121d449ae +DIST guile-2.0.14.tar.xz 4615196 BLAKE2B 97e26635c941309b713b632371bc9df7361d3d7d524af3d2c67275f3151dc9c51bd774155bd3c1caf6950d4e839afe8b019f553b5a7223c447bb19c8a97d608c SHA512 2cad60ab8aa77be44bc4988eaa3a2f0652637f315322abd6011c18f1800c3a461eefa15a14fd54d0d48031b093bc56dfc6cd15dc0a8260b97b40521bff793db6 +EBUILD guile-2.0.14-r5.ebuild 2403 BLAKE2B 2c6cd345ea0f7402724ddcd4b74df9ea26d3ccde3e01eb9d2f56ae314fdf2bd7fff9551aab9b00cd9ec2b19c99356d556476782c3c1e60f0fd448e88d93737fe SHA512 b4e3337089b4096480733fab0e877ff5a77a8d1c13bcf20c3321d1925b2701e18cc07d0fdd45407361b0cc3c16a4e7b5d27d220577c36330a329d77bae0a2921 +MISC metadata.xml 1137 BLAKE2B a7804962f0827541dd7e1d10d962700f32734d5dd4f04688c1f07838109ecf68f68d3601f86786a893c6c68c1f8d5144e254d4c82fcad53f6edc12bba9f6cc51 SHA512 5bb0ed15c972f967899c24e290550fb10bb830222dce3890413d9978870d0f00942ebfec738372418958ee99048017ebd25e8fc4c6d175027eef1448bc12384a diff --git a/dev-scheme/guile/files/50guile-gentoo.el b/dev-scheme/guile/files/50guile-gentoo.el new file mode 100644 index 0000000..431f7e9 --- /dev/null +++ b/dev-scheme/guile/files/50guile-gentoo.el @@ -0,0 +1 @@ +(add-to-list 'load-path "@SITELISP@") diff --git a/dev-scheme/guile/files/guile-2-snarf.patch b/dev-scheme/guile/files/guile-2-snarf.patch new file mode 100644 index 0000000..c6ab5cd --- /dev/null +++ b/dev-scheme/guile/files/guile-2-snarf.patch @@ -0,0 +1,47 @@ +From f775ab3654357fcaad294b95efb0b1c16de1eda8 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Sun, 19 Feb 2017 22:58:40 +0000 +Subject: guile-snarf: skip -g* arguments to avoid build failure + +* libguile/guile-snarf.in: skip -g* arguments to avoid failure on + -ggdb3. + +Bug: https://bugs.gentoo.org/608190 +Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25803 +Signed-off-by: Sergei Trofimovich +--- + libguile/guile-snarf.in | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in +index 47bbc04..22dc1d3 100644 +--- a/libguile/guile-snarf.in ++++ b/libguile/guile-snarf.in +@@ -95,10 +95,22 @@ if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ; fi + + trap "rm -rf $tempdir" 0 1 2 15 + ++# filter out -g* flags from commandline ++# as some flags like -ggdb3 cause CPP ++ ++cpp_args="" ++for arg in "$@" ++do ++ case "$arg" in ++ -g*) ;; # skip debug flag ++ *) cpp_args="$cpp_args $arg" ;; ++ esac ++done ++ + if [ ! "$outfile" = "-" ] ; then +- modern_snarf "$@" > $outfile ++ modern_snarf $cpp_args > $outfile + else +- modern_snarf "$@" ++ modern_snarf $cpp_args + fi + + # zonk outfile if errors occurred +-- +cgit v1.0-41-gc330 + diff --git a/dev-scheme/guile/files/guile-2.0.14-configure-clang16.patch b/dev-scheme/guile/files/guile-2.0.14-configure-clang16.patch new file mode 100644 index 0000000..361cc01 --- /dev/null +++ b/dev-scheme/guile/files/guile-2.0.14-configure-clang16.patch @@ -0,0 +1,71 @@ +https://src.fedoraproject.org/rpms/guile/c/7fcab121be7d2bc8e3e48d0da476127b86cec90c?branch=rawhide + +These issues have already been fixed upstream via gnulib imports: + +commit 7e641595cd9b45ce7339e21c20a8ab81af9278f6 +Author: Andy Wingo +Date: Wed Feb 15 21:41:24 2017 +0100 + + Update Gnulib to v0.1-1157-gb03f418. + +commit a91b95cca2d397c84f8b9bbd602d40209a7092ce +Author: Andy Wingo +Date: Wed Jan 20 21:52:54 2021 +0100 + + Update Gnulib to v0.1-4379-g2ef5a9b4b + + Also bump required autoconf version to 2.64, as required by Gnulib. + +--- a/m4/link.m4 ++++ b/m4/link.m4 +@@ -22,6 +22,7 @@ AC_DEFUN([gl_FUNC_LINK], + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include ++ #include + ]], + [[int result = 0; + if (!link ("conftest.a", "conftest.b/")) +--- a/m4/round.m4 ++++ b/m4/round.m4 +@@ -57,7 +57,7 @@ int main() + * (double) (1U << ((DBL_MANT_DIG + 3) / 5)) + * (double) (1U << ((DBL_MANT_DIG + 4) / 5)); + volatile double x = 0.5 - 0.5 / TWO_MANT_DIG; +- exit (x < 0.5 && round (x) != 0.0); ++ return x < 0.5 && round (x) != 0.0; + }]])], [gl_cv_func_round_works=yes], [gl_cv_func_round_works=no], + [case "$host_os" in + netbsd* | aix*) gl_cv_func_round_works="guessing no";; + + +Avoid implicit ints in the guile_cv_localtime_cache check. It cause +the check to always fail with strict(er) C99 compilers that do not +support implicit int. + +Submitted upstream: + + + + +--- a/configure.ac ++++ b/configure.ac +@@ -1086,7 +1086,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include + # include + #endif + extern char **environ; +-unset_TZ () ++int unset_TZ () + { + char **from, **to; + for (to = from = environ; (*to = *from); from++) +@@ -1095,7 +1095,7 @@ unset_TZ () + } + char TZ_GMT0[] = "TZ=GMT0"; + char TZ_PST8[] = "TZ=PST8"; +-main() ++int main() + { + time_t now = time ((time_t *) 0); + int hour_GMT0, hour_unset; + diff --git a/dev-scheme/guile/files/guile-2.0.14-darwin.patch b/dev-scheme/guile/files/guile-2.0.14-darwin.patch new file mode 100644 index 0000000..17741ae --- /dev/null +++ b/dev-scheme/guile/files/guile-2.0.14-darwin.patch @@ -0,0 +1,38 @@ +fix compilation on Darwin + +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23 +https://bugs.gentoo.org/show_bug.cgi?id=612338 + +--- guile-2.0.14/libguile/filesys.c ++++ guile-2.0.14/libguile/filesys.c +@@ -1486,6 +1486,9 @@ + mode_bits = scm_i_mode_bits (mode); + } + ++#ifdef __APPLE__ ++ open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC; ++#endif + SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags)); + if (rv == -1) + SCM_SYSERROR; +--- guile-2.0.14/libguile/stime.c ++++ guile-2.0.14/libguile/stime.c +@@ -830,6 +830,10 @@ + + #ifdef HAVE_POSIX_CPUTIME + { ++#ifdef __APPLE__ ++ if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0) ++ get_internal_run_time = get_internal_run_time_posix_timer; ++#else + clockid_t dummy; + + /* Only use the _POSIX_CPUTIME clock if it's going to work across +@@ -839,6 +843,7 @@ + get_internal_run_time = get_internal_run_time_posix_timer; + else + errno = 0; ++#endif + } + #endif /* HAVE_POSIX_CPUTIME */ + #endif /* HAVE_CLOCKTIME */ diff --git a/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch new file mode 100644 index 0000000..c2f136d --- /dev/null +++ b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch @@ -0,0 +1,63 @@ +From f92888853439a8ded221f3423865c78de2a96a14 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Sun, 5 Nov 2017 09:30:45 +0000 +Subject: ia64: Fix crash in thread context switch. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes and . + +Backtrace looks like that: + + Program terminated with signal SIGSEGV, Segmentation fault. + #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372 + 372 t->pending_rbs_continuation->backing_store, + [Current thread is 1 (Thread 0x2000000000049340 (LWP 8190))] + (gdb) bt + #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372 + #1 0x2000000000148e00 in scm_c_abort (vm=0x60000000000edea0, tag=0x6000000000795ba0, n=0, argv=0x60000fffff7f0ce0, cookie=-1) at control.c:239 + #2 0x2000000000149070 in scm_at_abort (tag=0x6000000000795ba0, args=0x304) at control.c:258 + (gdb) print t + $2 = (scm_i_thread *) 0x6000000000068000 + (gdb) print t->pending_rbs_continuation + $3 = (scm_t_contregs *) 0xffeb + +The problem here is the value of 't->pending_rbs_continuation' pointer. +It's supposed to poin to a register stack pointer or be NULL if not yet +backed up. + +The problem is it is never initialized to NULL at creation time and +contained garbage on stack. Sometimes people are lucky and have zeros +on stack and guile works. But sometimes there is something and guile +crashes. + +The fix is trivial: initialize 'pending_rbs_continuation = NULL' +at thread registration time (the same way other threads are registered). + +Reported-by: Matt Turner + +* libguile/threads.c (guilify_self_1): Initialize pending_rbs_continuation +to avoid crash on ia64. + +Signed-off-by: Sergei Trofimovich +Signed-off-by: Ludovic Courtès +--- + libguile/threads.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libguile/threads.c b/libguile/threads.c +index 9ceb5b8..770f62c 100644 +--- a/libguile/threads.c ++++ b/libguile/threads.c +@@ -395,6 +395,7 @@ guilify_self_1 (struct GC_stack_base *base, int needs_unregister) + t.base = base->mem_base; + #ifdef __ia64__ + t.register_backing_store_base = base->reg_base; ++ t.pending_rbs_continuation = 0; + #endif + t.continuation_root = SCM_EOL; + t.continuation_base = t.base; +-- +cgit v1.0-41-gc330 + diff --git a/dev-scheme/guile/guile-2.0.14-r5.ebuild b/dev-scheme/guile/guile-2.0.14-r5.ebuild new file mode 100644 index 0000000..2ea5568 --- /dev/null +++ b/dev-scheme/guile/guile-2.0.14-r5.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit flag-o-matic autotools + +DESCRIPTION="GNU Ubiquitous Intelligent Language for Extensions" +HOMEPAGE="https://www.gnu.org/software/guile/" +SRC_URI="mirror://gnu/guile/${P}.tar.xz" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +LICENSE="LGPL-3+" +IUSE="debug debug-malloc +deprecated +networking +nls +regex +threads" # upstream recommended +networking +nls +# emacs useflag removal not working + +REQUIRED_USE="regex" # workaround for bug 596322 +RESTRICT="strip" + +RDEPEND=" + >=dev-libs/boehm-gc-7.0:=[threads?] + dev-libs/gmp:= + dev-libs/libffi:= + dev-libs/libltdl:= + dev-libs/libunistring:0= + sys-devel/libtool + sys-libs/ncurses:0= + sys-libs/readline:0= + virtual/libcrypt:=" +DEPEND="${RDEPEND} + virtual/pkgconfig + sys-apps/texinfo + sys-devel/gettext" + +SLOT="12/22" # subslot is soname version +MAJOR="2.0" + +# guile generates ELF files without use of C or machine code +# It's a false positive. bug #677600 +QA_PREBUILT='*[.]go' + +DOCS=( GUILE-VERSION HACKING README ) + +PATCHES=( + "${FILESDIR}/${PN}-2-snarf.patch" + "${FILESDIR}/${P}-darwin.patch" + "${FILESDIR}/${P}-ia64-fix-crash-thread-context-switch.patch" + "${FILESDIR}/${P}-configure-clang16.patch" +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + # see bug #178499 + filter-flags -ftree-vectorize + + econf \ + --disable-error-on-warning \ + --disable-rpath \ + --disable-static \ + --enable-posix \ + --without-libgmp-prefix \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-libltdl-prefix \ + --without-libreadline-prefix \ + --without-libunistring-prefix \ + $(use_enable debug guile-debug) \ + $(use_enable debug-malloc) \ + $(use_enable deprecated) \ + $(use_enable networking) \ + $(use_enable nls) \ + $(use_enable regex) \ + $(use_with threads) +} + +src_install() { + default + find "${ED}" -name '*.la' -delete || die + + # From Novell + # https://bugzilla.novell.com/show_bug.cgi?id=874028#c0 + dodir /usr/share/gdb/auto-load/$(get_libdir) + mv "${ED}"/usr/$(get_libdir)/libguile-*-gdb.scm "${ED}"/usr/share/gdb/auto-load/$(get_libdir) || die + + # necessary for registering slib, see bug 206896 + keepdir /usr/share/guile/site + + # Dark magic necessary for some deps + dosym libguile-2.0.so /usr/$(get_libdir)/libguile.so +} diff --git a/dev-scheme/guile/metadata.xml b/dev-scheme/guile/metadata.xml new file mode 100644 index 0000000..eb3a100 --- /dev/null +++ b/dev-scheme/guile/metadata.xml @@ -0,0 +1,22 @@ + + + + + scheme@gentoo.org + Gentoo Scheme Project + + +Guile is a library designed to help programmers create flexible applications. Using Guile in an application allows programmers to write plug-ins, or modules (there are many names, but the concept is essentially the same) and users to use them to have an application fit their needs. + + + Include garbage collector freelist debugging code + Include malloc debugging code + Enable deprecated features + (implied by deprecated) enable merely discouraged features + Include networking interfaces + Include regular expression interfaces + + + guile + + diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass new file mode 100644 index 0000000..a6dd902 --- /dev/null +++ b/eclass/cmake-utils.eclass @@ -0,0 +1,851 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @DEAD +# @ECLASS: cmake-utils.eclass +# @MAINTAINER: +# kde@gentoo.org +# @AUTHOR: +# Tomáš Chvátal +# Maciej Mrozowski +# (undisclosed contributors) +# Original author: Zephyrus (zephyrus@mirach.it) +# @SUPPORTED_EAPIS: 5 6 7 +# @PROVIDES: ninja-utils +# @BLURB: common ebuild functions for cmake-based packages +# @DEPRECATED: cmake.eclass +# @DESCRIPTION: +# DEPRECATED: This no longer receives any changes. Everyone must port to cmake.eclass. +# The cmake-utils eclass makes creating ebuilds for cmake-based packages much easier. +# It provides all inherited features (DOCS, HTML_DOCS, PATCHES) along with out-of-source +# builds (default), in-source builds and an implementation of the well-known use_enable +# and use_with functions for CMake. + +if [[ -z ${_CMAKE_UTILS_ECLASS} ]]; then +_CMAKE_UTILS_ECLASS=1 + +# @ECLASS_VARIABLE: BUILD_DIR +# @DESCRIPTION: +# Build directory where all cmake processed files should be generated. +# For in-source build it's fixed to ${CMAKE_USE_DIR}. +# For out-of-source build it can be overridden, by default it uses +# ${WORKDIR}/${P}_build. +# +# This variable has been called CMAKE_BUILD_DIR formerly. +# It is set under that name for compatibility. + +# @ECLASS_VARIABLE: CMAKE_BINARY +# @DESCRIPTION: +# Eclass can use different cmake binary than the one provided in by system. +: ${CMAKE_BINARY:=cmake} + +# @ECLASS_VARIABLE: CMAKE_BUILD_TYPE +# @DESCRIPTION: +# Set to override default CMAKE_BUILD_TYPE. Only useful for packages +# known to make use of "if (CMAKE_BUILD_TYPE MATCHES xxx)". +# If about to be set - needs to be set before invoking cmake-utils_src_configure. +# You usualy do *NOT* want nor need to set it as it pulls CMake default build-type +# specific compiler flags overriding make.conf. +: ${CMAKE_BUILD_TYPE:=Gentoo} + +# @ECLASS_VARIABLE: CMAKE_IN_SOURCE_BUILD +# @DEFAULT_UNSET +# @DESCRIPTION: +# Set to enable in-source build. + +# @ECLASS_VARIABLE: CMAKE_MAKEFILE_GENERATOR +# @DEFAULT_UNSET +# @DESCRIPTION: +# Specify a makefile generator to be used by cmake. +# At this point only "emake" and "ninja" are supported. +# In EAPI 7 and above, the default is set to "ninja", +# whereas in EAPIs below 7, it is set to "emake". + +# @ECLASS_VARIABLE: CMAKE_MIN_VERSION +# @DESCRIPTION: +# Specify the minimum required CMake version. +: ${CMAKE_MIN_VERSION:=3.9.6} + +# @ECLASS_VARIABLE: CMAKE_REMOVE_MODULES +# @DESCRIPTION: +# Do we want to remove anything? yes or whatever else for no +: ${CMAKE_REMOVE_MODULES:=yes} + +# @ECLASS_VARIABLE: CMAKE_REMOVE_MODULES_LIST +# @DESCRIPTION: +# Space-separated list of CMake modules that will be removed in $S during src_prepare, +# in order to force packages to use the system version. +: ${CMAKE_REMOVE_MODULES_LIST:=FindBLAS FindLAPACK} + +# @ECLASS_VARIABLE: CMAKE_USE_DIR +# @DESCRIPTION: +# Sets the directory where we are working with cmake. +# For example when application uses autotools and only one +# plugin needs to be done by cmake. +# By default it uses ${S}. + +# @ECLASS_VARIABLE: CMAKE_VERBOSE +# @DESCRIPTION: +# Set to OFF to disable verbose messages during compilation +: ${CMAKE_VERBOSE:=ON} + +# @ECLASS_VARIABLE: CMAKE_WARN_UNUSED_CLI +# @DESCRIPTION: +# Warn about variables that are declared on the command line +# but not used. Might give false-positives. +# "no" to disable (default) or anything else to enable. + +# @ECLASS_VARIABLE: CMAKE_EXTRA_CACHE_FILE +# @USER_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# Specifies an extra cache file to pass to cmake. This is the analog of EXTRA_ECONF +# for econf and is needed to pass TRY_RUN results when cross-compiling. +# Should be set by user in a per-package basis in /etc/portage/package.env. + +# @ECLASS_VARIABLE: CMAKE_UTILS_QA_SRC_DIR_READONLY +# @USER_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# After running cmake-utils_src_prepare, sets ${S} to read-only. This is +# a user flag and should under _no circumstances_ be set in the ebuild. +# Helps in improving QA of build systems that write to source tree. + +case ${EAPI} in + 5) : ${CMAKE_WARN_UNUSED_CLI:=no} ;; + 6|7) : ${CMAKE_WARN_UNUSED_CLI:=yes} ;; + *) die "EAPI=${EAPI:-0} is not supported" ;; +esac + +inherit toolchain-funcs ninja-utils flag-o-matic multiprocessing xdg-utils + +case ${EAPI} in + [56]) + : ${CMAKE_MAKEFILE_GENERATOR:=emake} + inherit eutils multilib + ;; + *) + : ${CMAKE_MAKEFILE_GENERATOR:=ninja} + ;; +esac + +EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install + +if [[ ${WANT_CMAKE} ]]; then + if [[ ${EAPI} != [56] ]]; then + die "\${WANT_CMAKE} has been removed and is a no-op now" + else + eqawarn "\${WANT_CMAKE} has been removed and is a no-op now" + fi +fi +[[ ${PREFIX} ]] && die "\${PREFIX} has been removed and is a no-op now" + +case ${CMAKE_MAKEFILE_GENERATOR} in + emake) + BDEPEND="sys-devel/make" + ;; + ninja) + BDEPEND="dev-util/ninja" + ;; + *) + eerror "Unknown value for \${CMAKE_MAKEFILE_GENERATOR}" + die "Value ${CMAKE_MAKEFILE_GENERATOR} is not supported" + ;; +esac + +if [[ ${PN} != cmake ]]; then + BDEPEND+=" >=dev-util/cmake-${CMAKE_MIN_VERSION}" +fi + +case ${EAPI} in + 7) ;; + *) DEPEND=" ${BDEPEND}" ;; +esac + +# Internal functions used by cmake-utils_use_* +_cmake_use_me_now() { + debug-print-function ${FUNCNAME} "$@" + + local arg=$2 + [[ ! -z $3 ]] && arg=$3 + + [[ ${EAPI} == 5 ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1=\"\$(usex $2)\" instead" + + local uper capitalised x + [[ -z $2 ]] && die "cmake-utils_use-$1 []" + if [[ ! -z $3 ]]; then + # user specified the use name so use it + echo "-D$1$3=$(use $2 && echo ON || echo OFF)" + else + # use all various most used combinations + uper=$(echo ${2} | tr '[:lower:]' '[:upper:]') + capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g') + for x in $2 $uper $capitalised; do + echo "-D$1$x=$(use $2 && echo ON || echo OFF) " + done + fi +} +_cmake_use_me_now_inverted() { + debug-print-function ${FUNCNAME} "$@" + + local arg=$2 + [[ ! -z $3 ]] && arg=$3 + + if [[ ${EAPI} != 5 && "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then + die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1=\"\$(usex $2)\" instead" + fi + + local uper capitalised x + [[ -z $2 ]] && die "cmake-utils_use-$1 []" + if [[ ! -z $3 ]]; then + # user specified the use name so use it + echo "-D$1$3=$(use $2 && echo OFF || echo ON)" + else + # use all various most used combinations + uper=$(echo ${2} | tr '[:lower:]' '[:upper:]') + capitalised=$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g') + for x in $2 $uper $capitalised; do + echo "-D$1$x=$(use $2 && echo OFF || echo ON) " + done + fi +} + +# Determine using IN or OUT source build +_cmake_check_build_dir() { + : ${CMAKE_USE_DIR:=${S}} + if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then + # we build in source dir + BUILD_DIR="${CMAKE_USE_DIR}" + else + # Respect both the old variable and the new one, depending + # on which one was set by the ebuild. + if [[ ! ${BUILD_DIR} && ${CMAKE_BUILD_DIR} ]]; then + if [[ ${EAPI} != [56] ]]; then + eerror "The CMAKE_BUILD_DIR variable has been renamed to BUILD_DIR." + die "The ebuild must be migrated to BUILD_DIR." + else + eqawarn "The CMAKE_BUILD_DIR variable has been renamed to BUILD_DIR." + eqawarn "Please migrate the ebuild to use the new one." + fi + + # In the next call, both variables will be set already + # and we'd have to know which one takes precedence. + _RESPECT_CMAKE_BUILD_DIR=1 + fi + + if [[ ${_RESPECT_CMAKE_BUILD_DIR} ]]; then + BUILD_DIR=${CMAKE_BUILD_DIR:-${WORKDIR}/${P}_build} + else + : ${BUILD_DIR:=${WORKDIR}/${P}_build} + fi + fi + + # Backwards compatibility for getting the value. + [[ ${EAPI} == [56] ]] && CMAKE_BUILD_DIR=${BUILD_DIR} + + mkdir -p "${BUILD_DIR}" || die + echo ">>> Working in BUILD_DIR: \"$BUILD_DIR\"" +} + +# Determine which generator to use +_cmake_generator_to_use() { + local generator_name + + case ${CMAKE_MAKEFILE_GENERATOR} in + ninja) + # if ninja is enabled but not installed, the build could fail + # this could happen if ninja is manually enabled (eg. make.conf) but not installed + case ${EAPI} in + 5|6) + if ! ROOT=/ has_version dev-util/ninja; then + die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." + fi + ;; + *) + if ! has_version -b dev-util/ninja; then + die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." + fi + ;; + esac + generator_name="Ninja" + ;; + emake) + generator_name="Unix Makefiles" + ;; + *) + eerror "Unknown value for \${CMAKE_MAKEFILE_GENERATOR}" + die "Value ${CMAKE_MAKEFILE_GENERATOR} is not supported" + ;; + esac + + echo ${generator_name} +} + +# @FUNCTION: cmake_comment_add_subdirectory +# @USAGE: +# @DESCRIPTION: +# Comment out one or more add_subdirectory calls in CMakeLists.txt in the current directory +cmake_comment_add_subdirectory() { + if [[ -z ${1} ]]; then + die "comment_add_subdirectory must be passed at least one directory name to comment" + fi + + if [[ -e "CMakeLists.txt" ]]; then + local d + for d in $@; do + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \ + -i CMakeLists.txt || die "failed to comment add_subdirectory(${d})" + done + fi +} + +# @FUNCTION: comment_add_subdirectory +# @USAGE: +# @DESCRIPTION: +# Comment out an add_subdirectory call in CMakeLists.txt in the current directory +# Banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead. +comment_add_subdirectory() { + [[ ${EAPI} == 5 ]] || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead" + + cmake_comment_add_subdirectory "$@" +} + +# @FUNCTION: cmake-utils_use_with +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_with. See ebuild(5). +# +# `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled +# and -DWITH_FOO=OFF if it is disabled. +cmake-utils_use_with() { _cmake_use_me_now WITH_ "$@" ; } + +# @FUNCTION: cmake-utils_use_enable +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_enable. See ebuild(5). +# +# `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled +# and -DENABLE_FOO=OFF if it is disabled. +cmake-utils_use_enable() { _cmake_use_me_now ENABLE_ "$@" ; } + +# @FUNCTION: cmake-utils_use_find_package +# @USAGE: +# @DESCRIPTION: +# Based on use_enable. See ebuild(5). +# +# `cmake-utils_use_find_package foo LibFoo` echoes -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=OFF +# if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=ON if it is disabled. +# This can be used to make find_package optional. +cmake-utils_use_find_package() { + if [[ ${EAPI} != 5 && "$#" != 2 ]] ; then + die "Usage: cmake-utils_use_find_package " + fi + + _cmake_use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ; +} + +# @FUNCTION: cmake_use_find_package +# @USAGE: +# @DESCRIPTION: +# Alias for cmake-utils_use_find_package. +cmake_use_find_package() { + if [[ "$#" != 2 ]] ; then + die "Usage: cmake_use_find_package " + fi + + cmake-utils_use_find_package "$@" ; +} + +# @FUNCTION: cmake-utils_use_disable +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on inversion of use_enable. See ebuild(5). +# +# `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled +# and -DDISABLE_FOO=ON if it is disabled. +cmake-utils_use_disable() { _cmake_use_me_now_inverted DISABLE_ "$@" ; } + +# @FUNCTION: cmake-utils_use_no +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_disable. See ebuild(5). +# +# `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled +# and -DNO_FOO=ON if it is disabled. +cmake-utils_use_no() { _cmake_use_me_now_inverted NO_ "$@" ; } + +# @FUNCTION: cmake-utils_use_want +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_enable. See ebuild(5). +# +# `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled +# and -DWANT_FOO=OFF if it is disabled. +cmake-utils_use_want() { _cmake_use_me_now WANT_ "$@" ; } + +# @FUNCTION: cmake-utils_use_build +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_enable. See ebuild(5). +# +# `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled +# and -DBUILD_FOO=OFF if it is disabled. +cmake-utils_use_build() { _cmake_use_me_now BUILD_ "$@" ; } + +# @FUNCTION: cmake-utils_use_has +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_enable. See ebuild(5). +# +# `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled +# and -DHAVE_FOO=OFF if it is disabled. +cmake-utils_use_has() { _cmake_use_me_now HAVE_ "$@" ; } + +# @FUNCTION: cmake-utils_use_use +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_enable. See ebuild(5). +# +# `cmake-utils_use_use foo FOO` echoes -DUSE_FOO=ON if foo is enabled +# and -DUSE_FOO=OFF if it is disabled. +cmake-utils_use_use() { _cmake_use_me_now USE_ "$@" ; } + +# @FUNCTION: cmake-utils_use +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_enable. See ebuild(5). +# +# `cmake-utils_use foo FOO` echoes -DFOO=ON if foo is enabled +# and -DFOO=OFF if it is disabled. +cmake-utils_use() { _cmake_use_me_now "" "$@" ; } + +# @FUNCTION: cmake-utils_useno +# @USAGE: [flag name] +# @DESCRIPTION: +# Based on use_enable. See ebuild(5). +# +# `cmake-utils_useno foo NOFOO` echoes -DNOFOO=OFF if foo is enabled +# and -DNOFOO=ON if it is disabled. +cmake-utils_useno() { _cmake_use_me_now_inverted "" "$@" ; } + +# Internal function for modifying hardcoded definitions. +# Removes dangerous definitions that override Gentoo settings. +_cmake_modify-cmakelists() { + debug-print-function ${FUNCNAME} "$@" + + # Only edit the files once + grep -qs "<<< Gentoo configuration >>>" "${CMAKE_USE_DIR}"/CMakeLists.txt && return 0 + + # Comment out all set ( value) + find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec sed \ + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE\([[:space:]].*)\|)\)/I{s/^/#_cmake_modify_IGNORE /g}' \ + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \ + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \ + -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \ + -i {} + || die "${LINENO}: failed to disable hardcoded settings" + local x + for x in $(find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec grep -l "^#_cmake_modify_IGNORE" {} +;); do + einfo "Hardcoded definition(s) removed in $(echo "${x}" | cut -c $((${#CMAKE_USE_DIR}+2))-):" + einfo "$(grep -se '^#_cmake_modify_IGNORE' ${x} | cut -c 22-99)" + done + + # NOTE Append some useful summary here + cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_ || die + + MESSAGE(STATUS "<<< Gentoo configuration >>> + Build type \${CMAKE_BUILD_TYPE} + Install path \${CMAKE_INSTALL_PREFIX} + Compiler flags: + C \${CMAKE_C_FLAGS} + C++ \${CMAKE_CXX_FLAGS} + Linker flags: + Executable \${CMAKE_EXE_LINKER_FLAGS} + Module \${CMAKE_MODULE_LINKER_FLAGS} + Shared \${CMAKE_SHARED_LINKER_FLAGS}\n") + _EOF_ +} + +# temporary function for moving cmake cleanups from from src_configure -> src_prepare. +# bug #378850 +_cmake_cleanup_cmake() { + : ${CMAKE_USE_DIR:=${S}} + + if [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] ; then + local name + for name in ${CMAKE_REMOVE_MODULES_LIST} ; do + find "${S}" -name ${name}.cmake -exec rm -v {} + || die + done + fi + + # check if CMakeLists.txt exist and if no then die + if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then + eerror "Unable to locate CMakeLists.txt under:" + eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\"" + eerror "Consider not inheriting the cmake eclass." + die "FATAL: Unable to find CMakeLists.txt" + fi + + # Remove dangerous things. + _cmake_modify-cmakelists +} + +# @FUNCTION: cmake-utils_src_prepare +# @DESCRIPTION: +# Apply ebuild and user patches. +cmake-utils_src_prepare() { + debug-print-function ${FUNCNAME} "$@" + + pushd "${S}" > /dev/null || die + + if [[ ${EAPI} != 5 ]]; then + default_src_prepare + _cmake_cleanup_cmake + else + debug-print "$FUNCNAME: PATCHES=$PATCHES" + [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" + + debug-print "$FUNCNAME: applying user patches" + epatch_user + fi + + popd > /dev/null || die + + # make ${S} read-only in order to detect broken build-systems + if [[ ${CMAKE_UTILS_QA_SRC_DIR_READONLY} && ! ${CMAKE_IN_SOURCE_BUILD} ]]; then + chmod -R a-w "${S}" + fi + + _CMAKE_UTILS_SRC_PREPARE_HAS_RUN=1 +} + +# @VARIABLE: mycmakeargs +# @DEFAULT_UNSET +# @DESCRIPTION: +# Optional cmake defines as a bash array. Should be defined before calling +# src_configure. +# @CODE +# src_configure() { +# local mycmakeargs=( +# $(cmake-utils_use_with openconnect) +# ) +# +# cmake-utils_src_configure +# } +# @CODE + +# @FUNCTION: cmake-utils_src_configure +# @DESCRIPTION: +# General function for configuring with cmake. Default behaviour is to start an +# out-of-source build. +cmake-utils_src_configure() { + debug-print-function ${FUNCNAME} "$@" + + if [[ ! ${_CMAKE_UTILS_SRC_PREPARE_HAS_RUN} ]]; then + if [[ ${EAPI} != [56] ]]; then + die "FATAL: cmake-utils_src_prepare has not been run" + else + eqawarn "cmake-utils_src_prepare has not been run, please open a bug on https://bugs.gentoo.org/" + fi + fi + + [[ ${EAPI} == 5 ]] && _cmake_cleanup_cmake + + _cmake_check_build_dir + + # Fix xdg collision with sandbox + xdg_environment_reset + + # @SEE CMAKE_BUILD_TYPE + if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then + # Handle release builds + if ! has debug ${IUSE//+} || ! use debug; then + local CPPFLAGS=${CPPFLAGS} + append-cppflags -DNDEBUG + fi + fi + + # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.) + local build_rules=${BUILD_DIR}/gentoo_rules.cmake + + cat > "${build_rules}" <<- _EOF_ || die + SET (CMAKE_ASM_COMPILE_OBJECT " ${CPPFLAGS} -o -c " CACHE STRING "ASM compile command" FORCE) + SET (CMAKE_ASM-ATT_COMPILE_OBJECT " ${CPPFLAGS} -o -c -x assembler " CACHE STRING "ASM-ATT compile command" FORCE) + SET (CMAKE_ASM-ATT_LINK_FLAGS "-nostdlib" CACHE STRING "ASM-ATT link flags" FORCE) + SET (CMAKE_C_COMPILE_OBJECT " ${CPPFLAGS} -o -c " CACHE STRING "C compile command" FORCE) + SET (CMAKE_CXX_COMPILE_OBJECT " ${CPPFLAGS} -o -c " CACHE STRING "C++ compile command" FORCE) + SET (CMAKE_Fortran_COMPILE_OBJECT " ${FCFLAGS} -o -c " CACHE STRING "Fortran compile command" FORCE) + _EOF_ + + local myCC=$(tc-getCC) myCXX=$(tc-getCXX) myFC=$(tc-getFC) + + # !!! IMPORTANT NOTE !!! + # Single slash below is intentional. CMake is weird and wants the + # CMAKE_*_VARIABLES split into two elements: the first one with + # compiler path, and the second one with all command-line options, + # space separated. + local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake + cat > ${toolchain_file} <<- _EOF_ || die + SET (CMAKE_ASM_COMPILER "${myCC/ /;}") + SET (CMAKE_ASM-ATT_COMPILER "${myCC/ /;}") + SET (CMAKE_C_COMPILER "${myCC/ /;}") + SET (CMAKE_CXX_COMPILER "${myCXX/ /;}") + SET (CMAKE_Fortran_COMPILER "${myFC/ /;}") + SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE) + SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE) + SET (CMAKE_SYSTEM_PROCESSOR "${CHOST%%-*}") + _EOF_ + + # We are using the C compiler for assembly by default. + local -x ASMFLAGS=${CFLAGS} + local -x PKG_CONFIG=$(tc-getPKG_CONFIG) + + if tc-is-cross-compiler; then + local sysname + case "${KERNEL:-linux}" in + Cygwin) sysname="CYGWIN_NT-5.1" ;; + HPUX) sysname="HP-UX" ;; + linux) sysname="Linux" ;; + Winnt) + sysname="Windows" + cat >> "${toolchain_file}" <<- _EOF_ || die + SET (CMAKE_RC_COMPILER $(tc-getRC)) + _EOF_ + ;; + *) sysname="${KERNEL}" ;; + esac + + cat >> "${toolchain_file}" <<- _EOF_ || die + SET (CMAKE_SYSTEM_NAME "${sysname}") + _EOF_ + + if [ "${SYSROOT:-/}" != "/" ] ; then + # When cross-compiling with a sysroot (e.g. with crossdev's emerge wrappers) + # we need to tell cmake to use libs/headers from the sysroot but programs from / only. + cat >> "${toolchain_file}" <<- _EOF_ || die + SET (CMAKE_FIND_ROOT_PATH "${SYSROOT}") + SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + _EOF_ + fi + fi + + if use prefix-guest; then + cat >> "${build_rules}" <<- _EOF_ || die + # in Prefix we need rpath and must ensure cmake gets our default linker path + # right ... except for Darwin hosts + IF (NOT APPLE) + SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE) + SET (CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_libdir)" + CACHE STRING "" FORCE) + + ELSE () + + SET (CMAKE_PREFIX_PATH "${EPREFIX}/usr" CACHE STRING "" FORCE) + SET (CMAKE_MACOSX_RPATH ON CACHE BOOL "" FORCE) + SET (CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE) + SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE) + SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE) + + ENDIF (NOT APPLE) + _EOF_ + fi + + # Common configure parameters (invariants) + local common_config=${BUILD_DIR}/gentoo_common_config.cmake + local libdir=$(get_libdir) + cat > "${common_config}" <<- _EOF_ || die + SET (CMAKE_GENTOO_BUILD ON CACHE BOOL "Indicate Gentoo package build") + SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE) + SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries") + SET (CMAKE_INSTALL_INFODIR "${EPREFIX}/usr/share/info" CACHE PATH "") + SET (CMAKE_INSTALL_MANDIR "${EPREFIX}/usr/share/man" CACHE PATH "") + SET (CMAKE_USER_MAKE_RULES_OVERRIDE "${build_rules}" CACHE FILEPATH "Gentoo override rules") + _EOF_ + + # See bug 689410 + if [[ "${ARCH}" == riscv ]]; then + echo 'SET (CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX '"${libdir#lib}"' CACHE STRING "library search suffix" FORCE)' >> "${common_config}" || die + fi + + [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}" + + if [[ ${EAPI} != [56] ]]; then + cat >> "${common_config}" <<- _EOF_ || die + SET (CMAKE_INSTALL_DOCDIR "${EPREFIX}/usr/share/doc/${PF}" CACHE PATH "") + SET (BUILD_SHARED_LIBS ON CACHE BOOL "") + _EOF_ + fi + + # Wipe the default optimization flags out of CMake + if [[ ${CMAKE_BUILD_TYPE} != Gentoo && ${EAPI} != 5 ]]; then + cat >> ${common_config} <<- _EOF_ || die + SET (CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + SET (CMAKE_ASM-ATT_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + SET (CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + SET (CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + SET (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + SET (CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + SET (CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + SET (CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + SET (CMAKE_STATIC_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "") + _EOF_ + fi + + # Convert mycmakeargs to an array, for backwards compatibility + # Make the array a local variable since <=portage-2.1.6.x does not + # support global arrays (see bug #297255). + local mycmakeargstype=$(declare -p mycmakeargs 2>&-) + if [[ "${mycmakeargstype}" != "declare -a mycmakeargs="* ]]; then + if [[ -n "${mycmakeargstype}" ]] ; then + if [[ ${EAPI} == 5 ]]; then + eqawarn "Declaring mycmakeargs as a variable is deprecated. Please use an array instead." + else + die "Declaring mycmakeargs as a variable is banned in EAPI=${EAPI}. Please use an array instead." + fi + fi + local mycmakeargs_local=(${mycmakeargs}) + else + local mycmakeargs_local=("${mycmakeargs[@]}") + fi + + if [[ ${CMAKE_WARN_UNUSED_CLI} == no ]] ; then + local warn_unused_cli="--no-warn-unused-cli" + else + local warn_unused_cli="" + fi + + # Common configure parameters (overridable) + # NOTE CMAKE_BUILD_TYPE can be only overridden via CMAKE_BUILD_TYPE eclass variable + # No -DCMAKE_BUILD_TYPE=xxx definitions will be in effect. + local cmakeargs=( + ${warn_unused_cli} + -C "${common_config}" + -G "$(_cmake_generator_to_use)" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + "${mycmakeargs_local[@]}" + -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" + $([[ ${EAPI} == 5 ]] && echo -DCMAKE_INSTALL_DO_STRIP=OFF) + -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" + "${MYCMAKEARGS}" + ) + + if [[ -n "${CMAKE_EXTRA_CACHE_FILE}" ]] ; then + cmakeargs+=( -C "${CMAKE_EXTRA_CACHE_FILE}" ) + fi + + pushd "${BUILD_DIR}" > /dev/null || die + debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" + echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" + "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed" + popd > /dev/null || die +} + +# @FUNCTION: cmake-utils_src_compile +# @DESCRIPTION: +# General function for compiling with cmake. +# Automatically detects the build type. All arguments are passed to emake. +cmake-utils_src_compile() { + debug-print-function ${FUNCNAME} "$@" + + cmake-utils_src_make "$@" +} + +# @FUNCTION: _cmake_ninja_src_make +# @INTERNAL +# @DESCRIPTION: +# Build the package using ninja generator +_cmake_ninja_src_make() { + debug-print-function ${FUNCNAME} "$@" + + [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage." + + eninja "$@" +} + +# @FUNCTION: _cmake_emake_src_make +# @INTERNAL +# @DESCRIPTION: +# Build the package using make generator +_cmake_emake_src_make() { + debug-print-function ${FUNCNAME} "$@" + + [[ -e Makefile ]] || die "Makefile not found. Error during configure stage." + + if [[ "${CMAKE_VERBOSE}" != "OFF" ]]; then + emake VERBOSE=1 "$@" || die + else + emake "$@" || die + fi + +} + +# @FUNCTION: cmake-utils_src_make +# @DESCRIPTION: +# Function for building the package. Automatically detects the build type. +# All arguments are passed to emake. +cmake-utils_src_make() { + debug-print-function ${FUNCNAME} "$@" + + _cmake_check_build_dir + pushd "${BUILD_DIR}" > /dev/null || die + + _cmake_${CMAKE_MAKEFILE_GENERATOR}_src_make "$@" + + popd > /dev/null || die +} + +# @FUNCTION: cmake-utils_src_test +# @DESCRIPTION: +# Function for testing the package. Automatically detects the build type. +cmake-utils_src_test() { + debug-print-function ${FUNCNAME} "$@" + + _cmake_check_build_dir + pushd "${BUILD_DIR}" > /dev/null || die + [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; } + + [[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure ) + + set -- ctest -j "$(makeopts_jobs "${MAKEOPTS}" 999)" \ + --test-load "$(makeopts_loadavg)" "${myctestargs[@]}" "$@" + echo "$@" >&2 + if "$@" ; then + einfo "Tests succeeded." + popd > /dev/null || die + return 0 + else + if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then + # on request from Diego + eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:" + eerror "--START TEST LOG--------------------------------------------------------------" + cat "${BUILD_DIR}/Testing/Temporary/LastTest.log" + eerror "--END TEST LOG----------------------------------------------------------------" + die "Tests failed." + else + die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log" + fi + + # die might not die due to nonfatal + popd > /dev/null || die + return 1 + fi +} + +# @FUNCTION: cmake-utils_src_install +# @DESCRIPTION: +# Function for installing the package. Automatically detects the build type. +cmake-utils_src_install() { + debug-print-function ${FUNCNAME} "$@" + + _cmake_check_build_dir + pushd "${BUILD_DIR}" > /dev/null || die + DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" || die "died running ${CMAKE_MAKEFILE_GENERATOR} install" + popd > /dev/null || die + + pushd "${S}" > /dev/null || die + einstalldocs + popd > /dev/null || die +} + +fi diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass new file mode 100644 index 0000000..20b85dd --- /dev/null +++ b/eclass/flag-o-matic.eclass @@ -0,0 +1,773 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /home/sysadmin/cvsroot/portoverlay/myhardened/eclass/flag-o-matic.eclass,v 1.1 2011/01/03 11:47:17 valko Exp $ + +# @ECLASS: flag-o-matic.eclass +# @MAINTAINER: +# toolchain@gentoo.org +# @BLURB: common functions to manipulate and query toolchain flags +# @DESCRIPTION: +# This eclass contains a suite of functions to help developers sanely +# and safely manage toolchain flags in their builds. + +inherit eutils toolchain-funcs multilib + +################ DEPRECATED functions ################ +# The following are still present to avoid breaking existing +# code more than necessary; however they are deprecated. Please +# use gcc-specs-* from toolchain-funcs.eclass instead, if you +# need to know which hardened techs are active in the compiler. +# See bug #100974 +# +# has_hardened +# has_pie +# has_pic +# has_ssp_all +# has_ssp + + +# {C,CXX,F,FC}FLAGS that we allow in strip-flags +# Note: shell globs and character lists are allowed +setup-allowed-flags() { + if [[ -z ${ALLOWED_FLAGS} ]] ; then + export ALLOWED_FLAGS="-pipe" + export ALLOWED_FLAGS="${ALLOWED_FLAGS} -O -O0 -O1 -O2 -mcpu -march -mtune" + export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fstack-protector -fstack-protector-all" + export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fbounds-checking -fno-strict-overflow" + export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-PIE -fno-pie -fno-unit-at-a-time" + export ALLOWED_FLAGS="${ALLOWED_FLAGS} -g -g[0-9] -ggdb -ggdb[0-9] -gstabs -gstabs+" + export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-ident" + export ALLOWED_FLAGS="${ALLOWED_FLAGS} -W* -w" + fi + # allow a bunch of flags that negate features / control ABI + ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-protector-all \ + -fno-strict-aliasing -fno-bounds-checking -fstrict-overflow -fno-omit-frame-pointer" + ALLOWED_FLAGS="${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs \ + -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 \ + -mno-sse4.2 -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow \ + -mno-popcnt -mno-abm \ + -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt \ + -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu \ + -mieee -mieee-with-inexact -mschedule \ + -mtls-direct-seg-refs -mno-tls-direct-seg-refs \ + -mflat -mno-flat -mno-faster-structs -mfaster-structs \ + -m32 -m64 -mabi -mlittle-endian -mbig-endian -EL -EB -fPIC \ + -mlive-g0 -mcmodel -mstack-bias -mno-stack-bias \ + -msecure-plt -m*-toc -D* -U*" + + # {C,CXX,F,FC}FLAGS that we are think is ok, but needs testing + # NOTE: currently -Os have issues with gcc3 and K6* arch's + export UNSTABLE_FLAGS="-Os -O3 -freorder-blocks" + return 0 +} + +# Raw appending of the reverse flag. +# Only supports {-f,-fno-} flag types currently. +_reverse-append() { + [[ -z $1 ]] && return 0 + local f rf + + f=$1 + if [[ ${f} =~ ^-fno-.* ]]; then + rf=${f/-fno-/-f} + elif [[ ${f} =~ ^-f.* ]]; then + rf=${f/-f/-fno-} + else + return 0 + fi + + _is_flagq CFLAGS ${rf} || append-cflags $(test-flags-CC ${rf}) + _is_flagq CPPFLAGS ${rf} || append-cppflags $(test-flags-CXX ${rf}) + _is_flagq CXXFLAGS ${rf} || append-cxxflags $(test-flags-CXX ${rf}) + { _is_flagq FCFLAGS ${rf} && _is_flagq FFLAGS ${rf} ;} || \ + append-fflags $(test-flags-FC ${rf}) +} + +# Inverted filters for hardened compiler. +# This is trying to unpick the hardened compiler defaults. +_filter-hardened() { + local f + for f in "$@" ; do + case "${f}" in + # Ideally we should only concern ourselves with PIE flags, + # not -fPIC or -fpic, but too many places filter -fPIC without + # thinking about -fPIE. + -fPIC|-fpic|-fPIE|-fpie|-Wl,pie|-pie) + gcc-specs-pie && { is-flagq -nopie || append-flags -nopie ;};; + -fstack-protector) + gcc-specs-ssp && _reverse-append ${f};; + -fstack-protector-all) + gcc-specs-ssp-to-all && _reverse-append ${f};; + -fno-strict-overflow) + gcc-specs-nostrict && _reverse-append ${f};; + esac + done +} + +# Remove occurrences of strings from variable given in $1 +# Strings removed are matched as globs, so for example +# '-O*' would remove -O1, -O2 etc. +_filter-var() { + local f x VAR VAL + declare -a new + + VAR=$1 + shift + eval VAL=\${${VAR}} + for f in ${VAL}; do + for x in "$@"; do + # Note this should work with globs like -O* + [[ ${f} == ${x} ]] && continue 2 + done + eval new\[\${\#new\[@]}]=\${f} + done + eval export ${VAR}=\${new\[*]} +} + +# @FUNCTION: filter-flags +# @USAGE: +# @DESCRIPTION: +# Remove particular from {C,CPP,CXX,F,FC}FLAGS. Accepts shell globs. +filter-flags() { + _filter-hardened "$@" + _filter-var CFLAGS "$@" + _filter-var CPPFLAGS "$@" + _filter-var CXXFLAGS "$@" + _filter-var FFLAGS "$@" + _filter-var FCFLAGS "$@" + return 0 +} + +# @FUNCTION: filter-lfs-flags +# @DESCRIPTION: +# Remove flags that enable Large File Support. +filter-lfs-flags() { + [[ -n $@ ]] && die "filter-lfs-flags takes no arguments" + filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE +} + +# @FUNCTION: append-cppflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current CPPFLAGS. +append-cppflags() { + [[ -z $* ]] && return 0 + export CPPFLAGS="${CPPFLAGS} $*" + return 0 +} + +# @FUNCTION: append-cflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current CFLAGS. +append-cflags() { + [[ -z $* ]] && return 0 + export CFLAGS="${CFLAGS} $*" + return 0 +} + +# @FUNCTION: append-cxxflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current CXXFLAGS. +append-cxxflags() { + [[ -z $* ]] && return 0 + export CXXFLAGS="${CXXFLAGS} $*" + return 0 +} + +# @FUNCTION: append-fflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current {F,FC}FLAGS. +append-fflags() { + [[ -z $* ]] && return 0 + export FFLAGS="${FFLAGS} $*" + export FCFLAGS="${FCFLAGS} $*" + return 0 +} + +# @FUNCTION: append-lfs-flags +# @DESCRIPTION: +# Add flags that enable Large File Support. +append-lfs-flags() { + [[ -n $@ ]] && die "append-lfs-flags takes no arguments" + append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE +} + +# @FUNCTION: append-flags +# @USAGE: +# @DESCRIPTION: +# Add extra to your current {C,CXX,F,FC}FLAGS. +append-flags() { + [[ -z $* ]] && return 0 + append-cflags "$@" + append-cxxflags "$@" + append-fflags "$@" + return 0 +} + +# @FUNCTION: replace-flags +# @USAGE: +# @DESCRIPTION: +# Replace the flag with . Accepts shell globs for . +replace-flags() { + [[ $# != 2 ]] \ + && echo && eerror "Usage: replace-flags " \ + && die "replace-flags takes 2 arguments, not $#" + + local f fset + declare -a new_CFLAGS new_CXXFLAGS new_FFLAGS new_FCFLAGS + + for fset in CFLAGS CXXFLAGS FFLAGS FCFLAGS; do + # Looping over the flags instead of using a global + # substitution ensures that we're working with flag atoms. + # Otherwise globs like -O* have the potential to wipe out the + # list of flags. + for f in ${!fset}; do + # Note this should work with globs like -O* + [[ ${f} == ${1} ]] && f=${2} + eval new_${fset}\[\${\#new_${fset}\[@]}]=\${f} + done + eval export ${fset}=\${new_${fset}\[*]} + done + + return 0 +} + +# @FUNCTION: replace-cpu-flags +# @USAGE: +# @DESCRIPTION: +# Replace cpu flags (like -march/-mcpu/-mtune) that select the cpu +# with flags that select the cpu. Accepts shell globs for . +replace-cpu-flags() { + local newcpu="$#" ; newcpu="${!newcpu}" + while [ $# -gt 1 ] ; do + # quote to make sure that no globbing is done (particularly on + # ${oldcpu}) prior to calling replace-flags + replace-flags "-march=${1}" "-march=${newcpu}" + replace-flags "-mcpu=${1}" "-mcpu=${newcpu}" + replace-flags "-mtune=${1}" "-mtune=${newcpu}" + shift + done + return 0 +} + +_is_flagq() { + local x + for x in ${!1} ; do + [[ ${x} == $2 ]] && return 0 + done + return 1 +} + +# @FUNCTION: is-flagq +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is in {C,CXX,F,FC}FLAGS, else returns shell false. Accepts shell globs. +is-flagq() { + [[ -n $2 ]] && die "Usage: is-flag " + _is_flagq CFLAGS $1 || _is_flagq CXXFLAGS $1 || _is_flagq FFLAGS $1 || _is_flagq FCFLAGS $1 +} + +# @FUNCTION: is-flag +# @USAGE: +# @DESCRIPTION: +# Echo's "true" if flag is set in {C,CXX,F,FC}FLAGS. Accepts shell globs. +is-flag() { + is-flagq "$@" && echo true +} + +# @FUNCTION: is-ldflagq +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is in LDFLAGS, else returns shell false. Accepts shell globs. +is-ldflagq() { + [[ -n $2 ]] && die "Usage: is-ldflag " + _is_flagq LDFLAGS $1 +} + +# @FUNCTION: is-ldflag +# @USAGE: +# @DESCRIPTION: +# Echo's "true" if flag is set in LDFLAGS. Accepts shell globs. +is-ldflag() { + is-ldflagq "$@" && echo true +} + +# @FUNCTION: filter-mfpmath +# @USAGE: +# @DESCRIPTION: +# Remove specified math types from the fpmath flag. For example, if the user +# has -mfpmath=sse,386, running `filter-mfpmath sse` will leave the user with +# -mfpmath=386. +filter-mfpmath() { + local orig_mfpmath new_math prune_math + + # save the original -mfpmath flag + orig_mfpmath=$(get-flag -mfpmath) + # get the value of the current -mfpmath flag + new_math=$(get-flag mfpmath) + new_math=" ${new_math//,/ } " + # figure out which math values are to be removed + prune_math="" + for prune_math in "$@" ; do + new_math=${new_math/ ${prune_math} / } + done + new_math=$(echo ${new_math}) + new_math=${new_math// /,} + + if [[ -z ${new_math} ]] ; then + # if we're removing all user specified math values are + # slated for removal, then we just filter the flag + filter-flags ${orig_mfpmath} + else + # if we only want to filter some of the user specified + # math values, then we replace the current flag + replace-flags ${orig_mfpmath} -mfpmath=${new_math} + fi + return 0 +} + +# @FUNCTION: strip-flags +# @DESCRIPTION: +# Strip C[XX]FLAGS of everything except known good/safe flags. +strip-flags() { + local x y flag NEW_CFLAGS NEW_CXXFLAGS NEW_FFLAGS NEW_FCFLAGS + + setup-allowed-flags + + local NEW_CFLAGS="" + local NEW_CXXFLAGS="" + local NEW_FFLAGS="" + local NEW_FCFLAGS="" + + # Allow unstable C[XX]FLAGS if we are using unstable profile ... + if has "~$(tc-arch)" ${ACCEPT_KEYWORDS} ; then + ALLOWED_FLAGS="${ALLOWED_FLAGS} ${UNSTABLE_FLAGS}" + fi + + set -f # disable pathname expansion + + for x in ${CFLAGS}; do + for y in ${ALLOWED_FLAGS}; do + flag=${x%%=*} + if [ "${flag%%${y}}" = "" ] ; then + NEW_CFLAGS="${NEW_CFLAGS} ${x}" + break + fi + done + done + + for x in ${CXXFLAGS}; do + for y in ${ALLOWED_FLAGS}; do + flag=${x%%=*} + if [ "${flag%%${y}}" = "" ] ; then + NEW_CXXFLAGS="${NEW_CXXFLAGS} ${x}" + break + fi + done + done + + for x in ${FFLAGS}; do + for y in ${ALLOWED_FLAGS}; do + flag=${x%%=*} + if [ "${flag%%${y}}" = "" ] ; then + NEW_FFLAGS="${NEW_FFLAGS} ${x}" + break + fi + done + done + + for x in ${FCFLAGS}; do + for y in ${ALLOWED_FLAGS}; do + flag=${x%%=*} + if [ "${flag%%${y}}" = "" ] ; then + NEW_FCFLAGS="${NEW_FCFLAGS} ${x}" + break + fi + done + done + + # In case we filtered out all optimization flags fallback to -O2 + if [ "${CFLAGS/-O}" != "${CFLAGS}" -a "${NEW_CFLAGS/-O}" = "${NEW_CFLAGS}" ]; then + NEW_CFLAGS="${NEW_CFLAGS} -O2" + fi + if [ "${CXXFLAGS/-O}" != "${CXXFLAGS}" -a "${NEW_CXXFLAGS/-O}" = "${NEW_CXXFLAGS}" ]; then + NEW_CXXFLAGS="${NEW_CXXFLAGS} -O2" + fi + if [ "${FFLAGS/-O}" != "${FFLAGS}" -a "${NEW_FFLAGS/-O}" = "${NEW_FFLAGS}" ]; then + NEW_FFLAGS="${NEW_FFLAGS} -O2" + fi + if [ "${FCFLAGS/-O}" != "${FCFLAGS}" -a "${NEW_FCFLAGS/-O}" = "${NEW_FCFLAGS}" ]; then + NEW_FCFLAGS="${NEW_FCFLAGS} -O2" + fi + + set +f # re-enable pathname expansion + + export CFLAGS="${NEW_CFLAGS}" + export CXXFLAGS="${NEW_CXXFLAGS}" + export FFLAGS="${NEW_FFLAGS}" + export FCFLAGS="${NEW_FCFLAGS}" + return 0 +} + +test-flag-PROG() { + local comp=$1 + local flags="$2" + + [[ -z ${comp} || -z ${flags} ]] && \ + return 1 + + local PROG=$(tc-get${comp}) + ${PROG} ${flags} -S -o /dev/null -xc /dev/null \ + > /dev/null 2>&1 +} + +# @FUNCTION: test-flag-CC +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the C compiler, else returns shell false. +test-flag-CC() { test-flag-PROG "CC" "$1"; } + +# @FUNCTION: test-flag-CXX +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the C++ compiler, else returns shell false. +test-flag-CXX() { test-flag-PROG "CXX" "$1"; } + +# @FUNCTION: test-flag-F77 +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the Fortran 77 compiler, else returns shell false. +test-flag-F77() { test-flag-PROG "F77" "$1"; } + +# @FUNCTION: test-flag-FC +# @USAGE: +# @DESCRIPTION: +# Returns shell true if is supported by the Fortran 90 compiler, else returns shell false. +test-flag-FC() { test-flag-PROG "FC" "$1"; } + +test-flags-PROG() { + local comp=$1 + local flags + local x + + shift + + [[ -z ${comp} ]] && return 1 + + x="" + for x in "$@" ; do + test-flag-${comp} "${x}" && flags="${flags}${flags:+ }${x}" + done + + echo "${flags}" + + # Just bail if we dont have any flags + [[ -n ${flags} ]] +} + +# @FUNCTION: test-flags-CC +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the C compiler, else returns shell false. +test-flags-CC() { test-flags-PROG "CC" "$@"; } + +# @FUNCTION: test-flags-CXX +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the C++ compiler, else returns shell false. +test-flags-CXX() { test-flags-PROG "CXX" "$@"; } + +# @FUNCTION: test-flags-F77 +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the Fortran 77 compiler, else returns shell false. +test-flags-F77() { test-flags-PROG "F77" "$@"; } + +# @FUNCTION: test-flags-FC +# @USAGE: +# @DESCRIPTION: +# Returns shell true if are supported by the Fortran 90 compiler, else returns shell false. +test-flags-FC() { test-flags-PROG "FC" "$@"; } + +# @FUNCTION: test-flags +# @USAGE: +# @DESCRIPTION: +# Short-hand that should hopefully work for both C and C++ compiler, but +# its really only present due to the append-flags() abomination. +test-flags() { test-flags-CC "$@"; } + +# @FUNCTION: test_flag +# @DESCRIPTION: +# DEPRICIATED, use test-flags() +test_flag() { + ewarn "test_flag: deprecated, please use test-flags()!" >&2 + + test-flags-CC "$@" +} + +# @FUNCTION: test_version_info +# @USAGE: +# @DESCRIPTION: +# Returns shell true if the current C compiler version matches , else returns shell false. +# Accepts shell globs. +test_version_info() { + if [[ $($(tc-getCC) --version 2>&1) == *$1* ]]; then + return 0 + else + return 1 + fi +} + +# @FUNCTION: strip-unsupported-flags +# @DESCRIPTION: +# Strip {C,CXX,F,FC}FLAGS of any flags not supported by the active toolchain. +strip-unsupported-flags() { + export CFLAGS=$(test-flags-CC ${CFLAGS}) + export CXXFLAGS=$(test-flags-CXX ${CXXFLAGS}) + export FFLAGS=$(test-flags-F77 ${FFLAGS}) + export FCFLAGS=$(test-flags-FC ${FCFLAGS}) +} + +# @FUNCTION: get-flag +# @USAGE: +# @DESCRIPTION: +# Find and echo the value for a particular flag. Accepts shell globs. +get-flag() { + local f findflag="$1" + + # this code looks a little flaky but seems to work for + # everything we want ... + # for example, if CFLAGS="-march=i686": + # `get-flag -march` == "-march=i686" + # `get-flag march` == "i686" + for f in ${CFLAGS} ${CXXFLAGS} ${FFLAGS} ${FCFLAGS} ; do + if [ "${f/${findflag}}" != "${f}" ] ; then + printf "%s\n" "${f/-${findflag}=}" + return 0 + fi + done + return 1 +} + +# @FUNCTION: has_hardened +# @DESCRIPTION: +# DEPRECATED - use gcc-specs-relro or gcc-specs-now from toolchain-funcs +has_hardened() { + ewarn "has_hardened: deprecated, please use gcc-specs-{relro,now}()!" >&2 + + test_version_info Hardened && return 0 + # The specs file wont exist unless gcc has GCC_SPECS support + [[ -f ${GCC_SPECS} && ${GCC_SPECS} != ${GCC_SPECS/hardened/} ]] +} + +# @FUNCTION: has_pic +# @DESCRIPTION: +# DEPRECATED - use gcc-specs-pie from toolchain-funcs +# indicate whether PIC is set +has_pic() { + ewarn "has_pic: deprecated, please use gcc-specs-pie()!" >&2 + + [[ ${CFLAGS/-fPIC} != ${CFLAGS} || \ + ${CFLAGS/-fpic} != ${CFLAGS} ]] || \ + gcc-specs-pie +} + +# @FUNCTION: has_pie +# @DESCRIPTION: +# DEPRECATED - use gcc-specs-pie from toolchain-funcs +# indicate whether PIE is set +has_pie() { + ewarn "has_pie: deprecated, please use gcc-specs-pie()!" >&2 + + [[ ${CFLAGS/-fPIE} != ${CFLAGS} || \ + ${CFLAGS/-fpie} != ${CFLAGS} ]] || \ + gcc-specs-pie +} + +# @FUNCTION: has_ssp_all +# @DESCRIPTION: +# DEPRECATED - use gcc-specs-ssp from toolchain-funcs +# indicate whether code for SSP is being generated for all functions +has_ssp_all() { + ewarn "has_ssp_all: deprecated, please use gcc-specs-ssp()!" >&2 + + # note; this matches only -fstack-protector-all + [[ ${CFLAGS/-fstack-protector-all} != ${CFLAGS} || \ + -n $(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __SSP_ALL__) ]] || \ + gcc-specs-ssp-to-all +} + +# @FUNCTION: has_ssp +# @DESCRIPTION: +# DEPRECATED - use gcc-specs-ssp from toolchain-funcs +# indicate whether code for SSP is being generated +has_ssp() { + ewarn "has_ssp: deprecated, please use gcc-specs-ssp()!" >&2 + + # note; this matches both -fstack-protector and -fstack-protector-all + [[ ${CFLAGS/-fstack-protector} != ${CFLAGS} || \ + -n $(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __SSP__) ]] || \ + gcc-specs-ssp +} + +# @FUNCTION: has_m64 +# @DESCRIPTION: +# This doesn't test if the flag is accepted, it tests if the flag actually +# WORKS. Non-multilib gcc will take both -m32 and -m64. If the flag works +# return code is 0, else the return code is 1. +has_m64() { + # this doesnt test if the flag is accepted, it tests if the flag + # actually -WORKS-. non-multilib gcc will take both -m32 and -m64! + # please dont replace this function with test_flag in some future + # clean-up! + + local temp="$(emktemp)" + echo "int main() { return(0); }" > "${temp}".c + MY_CC=$(tc-getCC) + ${MY_CC/ .*/} -m64 -o "$(emktemp)" "${temp}".c > /dev/null 2>&1 + local ret=$? + rm -f "${temp}".c + [[ ${ret} != 1 ]] && return 0 + return 1 +} + +# @FUNCTION: has_m32 +# @DESCRIPTION: +# This doesn't test if the flag is accepted, it tests if the flag actually +# WORKS. Non-mulilib gcc will take both -m32 and -64. If the flag works return +# code is 0, else return code is 1. +has_m32() { + # this doesnt test if the flag is accepted, it tests if the flag + # actually -WORKS-. non-multilib gcc will take both -m32 and -m64! + # please dont replace this function with test_flag in some future + # clean-up! + + [ "$(tc-arch)" = "amd64" ] && has_multilib_profile && return 0 + + local temp=$(emktemp) + echo "int main() { return(0); }" > "${temp}".c + MY_CC=$(tc-getCC) + ${MY_CC/ .*/} -m32 -o "$(emktemp)" "${temp}".c > /dev/null 2>&1 + local ret=$? + rm -f "${temp}".c + [[ ${ret} != 1 ]] && return 0 + return 1 +} + +# @FUNCTION: replace-sparc64-flags +# @DESCRIPTION: +# Sets mcpu to v8 and uses the original value as mtune if none specified. +replace-sparc64-flags() { + local SPARC64_CPUS="ultrasparc3 ultrasparc v9" + + if [ "${CFLAGS/mtune}" != "${CFLAGS}" ]; then + for x in ${SPARC64_CPUS}; do + CFLAGS="${CFLAGS/-mcpu=${x}/-mcpu=v8}" + done + else + for x in ${SPARC64_CPUS}; do + CFLAGS="${CFLAGS/-mcpu=${x}/-mcpu=v8 -mtune=${x}}" + done + fi + + if [ "${CXXFLAGS/mtune}" != "${CXXFLAGS}" ]; then + for x in ${SPARC64_CPUS}; do + CXXFLAGS="${CXXFLAGS/-mcpu=${x}/-mcpu=v8}" + done + else + for x in ${SPARC64_CPUS}; do + CXXFLAGS="${CXXFLAGS/-mcpu=${x}/-mcpu=v8 -mtune=${x}}" + done + fi + + export CFLAGS CXXFLAGS +} + +# @FUNCTION: append-ldflags +# @USAGE: +# @DESCRIPTION: +# Add extra to the current LDFLAGS. +append-ldflags() { + [[ -z $* ]] && return 0 + local flag + for flag in "$@"; do + [[ ${flag} == -l* ]] && \ + ewarn "Appending a library link instruction (${flag}); libraries to link to should not be passed through LDFLAGS" + done + + export LDFLAGS="${LDFLAGS} $*" + return 0 +} + +# @FUNCTION: filter-ldflags +# @USAGE: +# @DESCRIPTION: +# Remove particular from LDFLAGS. Accepts shell globs. +filter-ldflags() { + _filter-var LDFLAGS "$@" + return 0 +} + +# @FUNCTION: raw-ldflags +# @USAGE: +# @DESCRIPTION: +# Turn C style ldflags (-Wl,-foo) into straight ldflags - the results +# are suitable for passing directly to 'ld'; note LDFLAGS is usually passed +# to gcc where it needs the '-Wl,'. +raw-ldflags() { + local x input="$@" + [[ -z ${input} ]] && input=${LDFLAGS} + set -- + for x in ${input} ; do + x=${x#-Wl,} + set -- "$@" ${x//,/ } + done + echo "$@" +} + +# @FUNCTION: bindnow-flags +# @RETURN: Returns the flags to enable "now" binding in the current selected linker. +# @DESCRIPTION: +# DEPRECATED - Gets the flags needed for "NOW" binding +bindnow-flags() { + eerror "QA: stop using the bindnow-flags function ... simply drop it from your ebuild" + die "Stop using bindnow-flags." +} + +# @FUNCTION: no-as-needed +# @RETURN: Flag to disable asneeded behavior for use with append-ldflags. +no-as-needed() { + case $($(tc-getLD) -v 2>&1 + +HOMEPAGE="http://gcc.gnu.org/" +LICENSE="GPL-2 LGPL-2.1" +RESTRICT="strip" # cross-compilers need controlled stripping + +#---->> eclass stuff <<---- +inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib fixheadtails + +EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test pkg_preinst src_install pkg_postinst pkg_prerm pkg_postrm +DESCRIPTION="Based on the ${ECLASS} eclass" + +FEATURES=${FEATURES/multilib-strict/} + +toolchain_pkg_setup() { + gcc_pkg_setup +} +toolchain_src_unpack() { + gcc_src_unpack +} +toolchain_src_compile() { + gcc_src_compile +} +toolchain_src_test() { + gcc_src_test +} +toolchain_pkg_preinst() { + ${ETYPE}_pkg_preinst +} +toolchain_src_install() { + ${ETYPE}_src_install +} +toolchain_pkg_postinst() { + ${ETYPE}_pkg_postinst +} +toolchain_pkg_prerm() { + ${ETYPE}_pkg_prerm +} +toolchain_pkg_postrm() { + ${ETYPE}_pkg_postrm +} +#----<< eclass stuff >>---- + + +#---->> globals <<---- +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} = ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi +is_crosscompile() { + [[ ${CHOST} != ${CTARGET} ]] +} + +tc_version_is_at_least() { version_is_at_least "$1" "${2:-${GCC_PV}}" ; } + + +GCC_PV=${TOOLCHAIN_GCC_PV:-${PV}} +GCC_PVR=${GCC_PV} +[[ ${PR} != "r0" ]] && GCC_PVR=${GCC_PVR}-${PR} +GCC_RELEASE_VER=$(get_version_component_range 1-3 ${GCC_PV}) +GCC_BRANCH_VER=$(get_version_component_range 1-2 ${GCC_PV}) +GCCMAJOR=$(get_version_component_range 1 ${GCC_PV}) +GCCMINOR=$(get_version_component_range 2 ${GCC_PV}) +GCCMICRO=$(get_version_component_range 3 ${GCC_PV}) +[[ ${BRANCH_UPDATE-notset} == "notset" ]] && BRANCH_UPDATE=$(get_version_component_range 4 ${GCC_PV}) + +# According to gcc/c-cppbuiltin.c, GCC_CONFIG_VER MUST match this regex. +# ([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? +GCC_CONFIG_VER=${GCC_CONFIG_VER:-$(replace_version_separator 3 '-' ${GCC_PV})} + +# Pre-release support +if [[ ${GCC_PV} != ${GCC_PV/_pre/-} ]] ; then + PRERELEASE=${GCC_PV/_pre/-} +fi +# make _alpha and _beta ebuilds automatically use a snapshot +if [[ ${GCC_PV} == *_alpha* ]] ; then + SNAPSHOT=${GCC_BRANCH_VER}-${GCC_PV##*_alpha} +elif [[ ${GCC_PV} == *_beta* ]] ; then + SNAPSHOT=${GCC_BRANCH_VER}-${GCC_PV##*_beta} +elif [[ ${GCC_PV} == *_rc* ]] ; then + SNAPSHOT=${GCC_PV%_rc*}-RC-${GCC_PV##*_rc} +fi +export GCC_FILESDIR=${GCC_FILESDIR:-${FILESDIR}} + +if [[ ${ETYPE} == "gcc-library" ]] ; then + GCC_VAR_TYPE=${GCC_VAR_TYPE:-non-versioned} + GCC_LIB_COMPAT_ONLY=${GCC_LIB_COMPAT_ONLY:-true} + GCC_TARGET_NO_MULTILIB=${GCC_TARGET_NO_MULTILIB:-true} +else + GCC_VAR_TYPE=${GCC_VAR_TYPE:-versioned} + GCC_LIB_COMPAT_ONLY="false" + GCC_TARGET_NO_MULTILIB=${GCC_TARGET_NO_MULTILIB:-false} +fi + +PREFIX=${TOOLCHAIN_PREFIX:-/usr} + +if [[ ${GCC_VAR_TYPE} == "versioned" ]] ; then + if tc_version_is_at_least 3.4.0 ; then + LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}} + else + LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc-lib/${CTARGET}/${GCC_CONFIG_VER}} + fi + INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${LIBPATH}/include} + if is_crosscompile ; then + BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CHOST}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}} + else + BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}} + fi + DATAPATH=${TOOLCHAIN_DATAPATH:-${PREFIX}/share/gcc-data/${CTARGET}/${GCC_CONFIG_VER}} + # Dont install in /usr/include/g++-v3/, but in gcc internal directory. + # We will handle /usr/include/g++-v3/ with gcc-config ... + STDCXX_INCDIR=${TOOLCHAIN_STDCXX_INCDIR:-${LIBPATH}/include/g++-v${GCC_BRANCH_VER/\.*/}} +elif [[ ${GCC_VAR_TYPE} == "non-versioned" ]] ; then + # using non-versioned directories to install gcc, like what is currently + # done for ppc64 and 3.3.3_pre, is a BAD IDEA. DO NOT do it!! However... + # setting up variables for non-versioned directories might be useful for + # specific gcc targets, like libffi. Note that we dont override the value + # returned by get_libdir here. + LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/$(get_libdir)} + INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${PREFIX}/include} + BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/bin} + DATAPATH=${TOOLCHAIN_DATAPATH:-${PREFIX}/share} + STDCXX_INCDIR=${TOOLCHAIN_STDCXX_INCDIR:-${PREFIX}/include/g++-v3} +fi + +#----<< globals >>---- + + +#---->> SLOT+IUSE logic <<---- +if [[ ${ETYPE} == "gcc-library" ]] ; then + IUSE="nls build test" + SLOT="${CTARGET}-${SO_VERSION_SLOT:-5}" +else + IUSE="multislot nptl test" + + if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then + IUSE="${IUSE} altivec build fortran nls nocxx" + [[ -n ${PIE_VER} ]] && IUSE="${IUSE} nopie" + [[ -n ${PP_VER} ]] && IUSE="${IUSE} nossp" + [[ -n ${HTB_VER} ]] && IUSE="${IUSE} boundschecking" + [[ -n ${D_VER} ]] && IUSE="${IUSE} d" + + if tc_version_is_at_least 3 ; then + IUSE="${IUSE} bootstrap doc gcj gtk hardened libffi multilib objc vanilla" + + # gcc-{nios2,bfin} don't accept these + if [[ ${PN} == "gcc" ]] ; then + IUSE="${IUSE} n32 n64" + fi + + tc_version_is_at_least "4.0" && IUSE="${IUSE} objc-gc mudflap" + tc_version_is_at_least "4.1" && IUSE="${IUSE} objc++" + tc_version_is_at_least "4.2" && IUSE="${IUSE} openmp" + tc_version_is_at_least "4.3" && IUSE="${IUSE} fixed-point" + tc_version_is_at_least "4.4" && IUSE="${IUSE} graphite" + fi + fi + + # Support upgrade paths here or people get pissed + if use multislot ; then + SLOT="${CTARGET}-${GCC_CONFIG_VER}" + elif is_crosscompile; then + SLOT="${CTARGET}-${GCC_BRANCH_VER}" + else + SLOT="${GCC_BRANCH_VER}" + fi +fi +#----<< SLOT+IUSE logic >>---- + + +#---->> S + SRC_URI essentials <<---- + +# This function sets the source directory depending on whether we're using +# a prerelease, snapshot, or release tarball. To use it, just set S with: +# +# S="$(gcc_get_s_dir)" +# +# Travis Tilley (03 Sep 2004) +# +gcc_get_s_dir() { + local GCC_S + if [[ -n ${PRERELEASE} ]] ; then + GCC_S=${WORKDIR}/gcc-${PRERELEASE} + elif [[ -n ${SNAPSHOT} ]] ; then + GCC_S=${WORKDIR}/gcc-${SNAPSHOT} + else + GCC_S=${WORKDIR}/gcc-${GCC_RELEASE_VER} + fi + echo "${GCC_S}" +} + +# This function handles the basics of setting the SRC_URI for a gcc ebuild. +# To use, set SRC_URI with: +# +# SRC_URI="$(get_gcc_src_uri)" +# +# Other than the variables normally set by portage, this function's behavior +# can be altered by setting the following: +# +# SNAPSHOT +# If set, this variable signals that we should be using a snapshot +# of gcc from ftp://sources.redhat.com/pub/gcc/snapshots/. It is +# expected to be in the format "YYYY-MM-DD". Note that if the ebuild +# has a _pre suffix, this variable is ignored and the prerelease +# tarball is used instead. +# +# BRANCH_UPDATE +# If set, this variable signals that we should be using the main +# release tarball (determined by ebuild version) and applying a +# CVS branch update patch against it. The location of this branch +# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}. +# Just like with SNAPSHOT, this variable is ignored if the ebuild +# has a _pre suffix. +# +# PATCH_VER +# PATCH_GCC_VER +# This should be set to the version of the gentoo patch tarball. +# The resulting filename of this tarball will be: +# gcc-${PATCH_GCC_VER:-${GCC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2 +# +# PIE_VER +# PIE_GCC_VER +# obsoleted: PIE_CORE +# These variables control patching in various updates for the logic +# controlling Position Independant Executables. PIE_VER is expected +# to be the version of this patch, PIE_GCC_VER the gcc version of +# the patch, and PIE_CORE (obsoleted) the actual filename of the patch. +# An example: +# PIE_VER="8.7.6.5" +# PIE_GCC_VER="3.4.0" +# The resulting filename of this tarball will be: +# gcc-${PIE_GCC_VER:-${GCC_RELEASE_VER}}-piepatches-v${PIE_VER}.tar.bz2 +# old syntax (do not define PIE_CORE anymore): +# PIE_CORE="gcc-3.4.0-piepatches-v${PIE_VER}.tar.bz2" +# +# SPECS_VER +# SPECS_GCC_VER +# This is for the minispecs files included in the hardened gcc-4.x +# +# PP_VER +# PP_GCC_VER +# obsoleted: PP_FVER +# These variables control patching in stack smashing protection +# support. They both control the version of ProPolice to download. +# +# PP_VER / PP_GCC_VER +# Used to roll our own custom tarballs of ssp. +# PP_FVER / PP_VER +# Used for mirroring ssp straight from IBM. +# PP_VER sets the version of the directory in which to find the +# patch, and PP_FVER sets the version of the patch itself. For +# example: +# PP_VER="3_4" +# PP_FVER="${PP_VER//_/.}-2" +# would download gcc3_4/protector-3.4-2.tar.gz +# +# HTB_VER +# HTB_GCC_VER +# These variables control whether or not an ebuild supports Herman +# ten Brugge's bounds-checking patches. If you want to use a patch +# for an older gcc version with a new gcc, make sure you set +# HTB_GCC_VER to that version of gcc. +# +# MAN_VER +# The version of gcc for which we will download manpages. This will +# default to ${GCC_RELEASE_VER}, but we may not want to pre-generate man pages +# for prerelease test ebuilds for example. This allows you to +# continue using pre-generated manpages from the last stable release. +# If set to "none", this will prevent the downloading of manpages, +# which is useful for individual library targets. +# +gentoo_urls() { + local devspace="HTTP~lv/GCC/URI HTTP~eradicator/gcc/URI HTTP~vapier/dist/URI + HTTP~halcy0n/patches/URI" + devspace=${devspace//HTTP/http:\/\/dev.gentoo.org\/} + echo mirror://gentoo/$1 ${devspace//URI/$1} +} +get_gcc_src_uri() { + export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}} + export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}} + export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}} + export PP_GCC_VER=${PP_GCC_VER:-${GCC_RELEASE_VER}} + export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}} + export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}} + + [[ -n ${PIE_VER} ]] && \ + PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2} + + # Set where to download gcc itself depending on whether we're using a + # prerelease, snapshot, or release tarball. + if [[ -n ${PRERELEASE} ]] ; then + GCC_SRC_URI="ftp://gcc.gnu.org/pub/gcc/prerelease-${PRERELEASE}/gcc-${PRERELEASE}.tar.bz2" + elif [[ -n ${SNAPSHOT} ]] ; then + GCC_SRC_URI="ftp://sources.redhat.com/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT}.tar.bz2" + else + GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2" + # we want all branch updates to be against the main release + [[ -n ${BRANCH_UPDATE} ]] && \ + GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2)" + fi + + # propolice aka stack smashing protection + if [[ -n ${PP_VER} ]] ; then + if [[ -n ${PP_FVER} ]] ; then + GCC_SRC_URI="${GCC_SRC_URI} + !nossp? ( + http://www.research.ibm.com/trl/projects/security/ssp/gcc${PP_VER}/protector-${PP_FVER}.tar.gz + $(gentoo_urls protector-${PP_FVER}.tar.gz) + )" + else + GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${PP_GCC_VER}-ssp-${PP_VER}.tar.bz2)" + fi + fi + + # uclibc lovin + [[ -n ${UCLIBC_VER} ]] && \ + GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2)" + + # PERL cannot be present at bootstrap, and is used to build the man pages. + # So... lets include some pre-generated ones, shall we? + [[ -n ${MAN_VER} ]] && \ + GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${MAN_VER}-manpages.tar.bz2)" + + # various gentoo patches + [[ -n ${PATCH_VER} ]] && \ + GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2)" + + # strawberry pie, Cappuccino and a Gauloises (it's a good thing) + [[ -n ${PIE_VER} ]] && \ + GCC_SRC_URI="${GCC_SRC_URI} !nopie? ( $(gentoo_urls ${PIE_CORE}) )" + + # espf patch for gcc >4.4.1 compiler. New hardened patchset + [[ -n ${ESPF_VER} ]] && \ + GCC_SRC_URI="${GCC_SRC_URI} ( $(gentoo_urls gcc-${GCC_RELEASE_VER}-espf-${ESPF_VER}.tar.bz2) + http://weaver.gentooenterprise.com/hardened/patches/gcc-${GCC_RELEASE_VER}-espf-${ESPF_VER}.tar.bz2 + )" + + # gcc minispec for the hardened gcc 4 compiler + [[ -n ${SPECS_VER} ]] && \ + GCC_SRC_URI="${GCC_SRC_URI} ( $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2) + http://weaver.gentooenterprise.com/hardened/patches/gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2 + )" + + # gcc bounds checking patch + if [[ -n ${HTB_VER} ]] ; then + local HTBFILE="bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2" + GCC_SRC_URI="${GCC_SRC_URI} + boundschecking? ( + mirror://sourceforge/boundschecking/${HTBFILE} + $(gentoo_urls ${HTBFILE}) + )" + fi + + # support for the D language + [[ -n ${D_VER} ]] && \ + GCC_SRC_URI="${GCC_SRC_URI} d? ( mirror://sourceforge/dgcc/gdc-${D_VER}-src.tar.bz2 )" + + # >= gcc-4.3 uses ecj.jar and we only add gcj as a use flag under certain + # conditions + if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then + tc_version_is_at_least "4.3" && \ + GCC_SRC_URI="${GCC_SRC_URI} + gcj? ( ftp://sourceware.org/pub/java/ecj-4.3.jar )" + fi + + echo "${GCC_SRC_URI}" +} +S=$(gcc_get_s_dir) +SRC_URI=$(get_gcc_src_uri) +#---->> S + SRC_URI essentials >>---- + + +#---->> support checks <<---- + +# Grab a variable from the build system (taken from linux-info.eclass) +get_make_var() { + local var=$1 makefile=${2:-${WORKDIR}/build/Makefile} + echo -e "e:\\n\\t@echo \$(${var})\\ninclude ${makefile}" | \ + r=${makefile%/*} emake --no-print-directory -s -f - 2>/dev/null +} +XGCC() { get_make_var GCC_FOR_TARGET ; } + +# The gentoo piessp patches allow for 3 configurations: +# 1) PIE+SSP by default +# 2) PIE by default +# 3) SSP by default +hardened_gcc_works() { + if [[ $1 == "pie" ]] ; then + # $gcc_cv_ld_pie is unreliable as it simply take the output of + # `ld --help | grep -- -pie`, that reports the option in all cases, also if + # the loader doesn't actually load the resulting executables. + # To avoid breakage, blacklist FreeBSD here at least + [[ ${CTARGET} == *-freebsd* ]] && return 1 + + want_pie || return 1 + hardened_gcc_is_stable pie && return 0 + if has "~$(tc-arch)" ${ACCEPT_KEYWORDS} ; then + hardened_gcc_check_unsupported pie && return 1 + ewarn "Allowing pie-by-default for an unstable arch ($(tc-arch))" + return 0 + fi + return 1 + elif [[ $1 == "ssp" ]] ; then + [[ -z ${PP_VER} ]] && return 1 + hardened_gcc_is_stable ssp && return 0 + if has "~$(tc-arch)" ${ACCEPT_KEYWORDS} ; then + hardened_gcc_check_unsupported ssp && return 1 + ewarn "Allowing ssp-by-default for an unstable arch ($(tc-arch))" + return 0 + fi + return 1 + else + # laziness ;) + hardened_gcc_works pie || return 1 + hardened_gcc_works ssp || return 1 + return 0 + fi +} + +hardened_gcc_is_stable() { + if [[ $1 == "pie" ]] ; then + # HARDENED_* variables are deprecated and here for compatibility + local tocheck="${HARDENED_PIE_WORKS} ${HARDENED_GCC_WORKS}" + if [[ ${CTARGET} == *-uclibc* ]] ; then + tocheck="${tocheck} ${PIE_UCLIBC_STABLE}" + else + tocheck="${tocheck} ${PIE_GLIBC_STABLE}" + fi + elif [[ $1 == "ssp" ]] ; then + # ditto + local tocheck="${HARDENED_SSP_WORKS} ${HARDENED_GCC_WORKS}" + if [[ ${CTARGET} == *-uclibc* ]] ; then + tocheck="${tocheck} ${SSP_UCLIBC_STABLE}" + else + tocheck="${tocheck} ${SSP_STABLE}" + fi + else + die "hardened_gcc_stable needs to be called with pie or ssp" + fi + + hasq $(tc-arch) ${tocheck} && return 0 + return 1 +} + +hardened_gcc_check_unsupported() { + local tocheck="" + # if a variable is unset, we assume that all archs are unsupported. since + # this function is never called if hardened_gcc_is_stable returns true, + # this shouldn't cause problems... however, allowing this logic to work + # even with the variables unset will break older ebuilds that dont use them. + if [[ $1 == "pie" ]] ; then + if [[ ${CTARGET} == *-uclibc* ]] ; then + [[ -z ${PIE_UCLIBC_UNSUPPORTED} ]] && return 0 + tocheck="${tocheck} ${PIE_UCLIBC_UNSUPPORTED}" + else + [[ -z ${PIE_GLIBC_UNSUPPORTED} ]] && return 0 + tocheck="${tocheck} ${PIE_GLIBC_UNSUPPORTED}" + fi + elif [[ $1 == "ssp" ]] ; then + if [[ ${CTARGET} == *-uclibc* ]] ; then + [[ -z ${SSP_UCLIBC_UNSUPPORTED} ]] && return 0 + tocheck="${tocheck} ${SSP_UCLIBC_UNSUPPORTED}" + else + [[ -z ${SSP_UNSUPPORTED} ]] && return 0 + tocheck="${tocheck} ${SSP_UNSUPPORTED}" + fi + else + die "hardened_gcc_check_unsupported needs to be called with pie or ssp" + fi + + hasq $(tc-arch) ${tocheck} && return 0 + return 1 +} + +espf_arch_support() { + if [[ ${CTARGET} == *-uclibc* ]] && has $(tc-arch) ${ESPF_UCLIBC_SUPPORT} || has $(tc-arch) ${ESPF_GLIBC_SUPPORT} ; then + return 0 + else + return 1 + fi +} + +has_libssp() { + [[ -e /$(get_libdir)/libssp.so ]] && return 0 + return 1 +} + +want_libssp() { + [[ ${GCC_LIBSSP_SUPPORT} == "true" ]] || return 1 + has_libssp || return 1 + [[ -n ${PP_VER} ]] || return 1 + return 0 +} + +_want_stuff() { + local var=$1 flag=$2 + [[ -z ${!var} ]] && return 1 + use ${flag} && return 0 + return 1 +} +want_boundschecking() { _want_stuff HTB_VER boundschecking ; } +want_pie() { _want_stuff PIE_VER !nopie ; } +want_ssp() { _want_stuff PP_VER !nossp ; } + +want_split_specs() { + [[ ${SPLIT_SPECS} == "true" ]] && want_pie +} +want_minispecs() { + if tc_version_is_at_least 4.3.2 && use hardened ; then + [[ -n ${SPECS_VER} ]] && want_pie && return 0 + [[ -n ${ESPF_VER} ]] && [[ -n ${SPECS_VER} ]] && return 1 + die "For Hardened to work you need the minispecs files and have the PIE patch" + fi + return 1 +} +want_espf() { + if tc_version_is_at_least 4.3.4 && use hardened ; then + [[ -n ${ESPF_VER} ]] && [[ -n ${SPECS_VER} ]] && return 0 + die "For Hardened to work you need the minispecs files and have the espf patch" + fi + return 1 +} +# This function checks whether or not glibc has the support required to build +# Position Independant Executables with gcc. +glibc_have_pie() { + if [[ ! -f ${ROOT}/usr/$(get_libdir)/Scrt1.o ]] ; then + echo + ewarn "Your glibc does not have support for pie, the file Scrt1.o is missing" + ewarn "Please update your glibc to a proper version or disable hardened" + echo + return 1 + fi +} + +# This function determines whether or not libc has been patched with stack +# smashing protection support. +libc_has_ssp() { + [[ ${ROOT} != "/" ]] && return 0 + + # lib hacks taken from sandbox configure + echo 'int main(){}' > "${T}"/libctest.c + LC_ALL=C gcc "${T}"/libctest.c -lc -o libctest -Wl,-verbose &> "${T}"/libctest.log || return 1 + local libc_file=$(awk '/attempt to open/ { if (($4 ~ /\/libc\.so/) && ($5 == "succeeded")) LIBC = $4; }; END {print LIBC}' "${T}"/libctest.log) + + [[ -z ${libc_file} ]] && die "Unable to find a libc !?" + + # Check for gcc-4.x style ssp support + if [[ -n $(readelf -s "${libc_file}" 2>/dev/null | \ + grep 'FUNC.*GLOBAL.*__stack_chk_fail') ]] + then + return 0 + else + # Check for gcc-3.x style ssp support + if [[ -n $(readelf -s "${libc_file}" 2>/dev/null | \ + grep 'OBJECT.*GLOBAL.*__guard') ]] && \ + [[ -n $(readelf -s "${libc_file}" 2>/dev/null | \ + grep 'FUNC.*GLOBAL.*__stack_smash_handler') ]] + then + return 0 + elif is_crosscompile ; then + die "'${libc_file}' was detected w/out ssp, that sucks (a lot)" + else + return 1 + fi + fi +} + +# This is to make sure we don't accidentally try to enable support for a +# language that doesnt exist. GCC 3.4 supports f77, while 4.0 supports f95, etc. +# +# Also add a hook so special ebuilds (kgcc64) can control which languages +# exactly get enabled +gcc-lang-supported() { + grep ^language=\"${1}\" "${S}"/gcc/*/config-lang.in > /dev/null || return 1 + [[ -z ${TOOLCHAIN_ALLOWED_LANGS} ]] && return 0 + has $1 ${TOOLCHAIN_ALLOWED_LANGS} +} + +#----<< support checks >>---- + +#---->> specs + env.d logic <<---- + +# defaults to enable for all hardened toolchains +gcc_common_hard="-DEFAULT_RELRO -DEFAULT_BIND_NOW" + +# configure to build with the hardened GCC specs as the default +make_gcc_hard() { + if hardened_gcc_works ; then + einfo "Updating gcc to use automatic PIE + SSP building ..." + sed -e "s|^HARD_CFLAGS = |HARD_CFLAGS = -DEFAULT_PIE_SSP ${gcc_common_hard} |" \ + -i "${S}"/gcc/Makefile.in || die "Failed to update gcc!" + elif hardened_gcc_works pie ; then + einfo "Updating gcc to use automatic PIE building ..." + ewarn "SSP has not been enabled by default" + sed -e "s|^HARD_CFLAGS = |HARD_CFLAGS = -DEFAULT_PIE ${gcc_common_hard} |" \ + -i "${S}"/gcc/Makefile.in || die "Failed to update gcc!" + elif hardened_gcc_works ssp ; then + einfo "Updating gcc to use automatic SSP building ..." + ewarn "PIE has not been enabled by default" + sed -e "s|^HARD_CFLAGS = |HARD_CFLAGS = -DEFAULT_SSP ${gcc_common_hard} |" \ + -i "${S}"/gcc/Makefile.in || die "Failed to update gcc!" + else + # do nothing if hardened isnt supported, but dont die either + ewarn "hardened is not supported for this arch in this gcc version" + ebeep + return 0 + fi + + # rebrand to make bug reports easier + BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened} +} + +# now we generate different spec files so that the user can select a compiler +# that enforces certain features in gcc itself and so we don't have to worry +# about a certain package ignoring CFLAGS/LDFLAGS +_create_specs_file() { + # Usage: _create_specs_file + local uflag=$1 name=$2 flags=${*:3} + ebegin "Creating a ${name} gcc specs file" + pushd "${WORKDIR}"/build/gcc > /dev/null + if [[ -z ${uflag} ]] || use ${uflag} ; then + # backup the compiler first + cp Makefile Makefile.orig + sed -i -e '/^HARD_CFLAGS/s:=.*:='"${flags}"':' Makefile + mv xgcc xgcc.foo + mv gcc.o gcc.o.foo + emake -s xgcc + $(XGCC) -dumpspecs > "${WORKDIR}"/build/${name}.specs + # restore everything to normal + mv gcc.o.foo gcc.o + mv xgcc.foo xgcc + mv Makefile.orig Makefile + else + $(XGCC) -dumpspecs > "${WORKDIR}"/build/${name}.specs + fi + popd > /dev/null + eend $([[ -s ${WORKDIR}/build/${name}.specs ]] ; echo $?) +} +create_vanilla_specs_file() { _create_specs_file hardened vanilla ; } +create_hardened_specs_file() { _create_specs_file !hardened hardened ${gcc_common_hard} -DEFAULT_PIE_SSP ; } +create_hardenednossp_specs_file() { _create_specs_file "" hardenednossp ${gcc_common_hard} -DEFAULT_PIE ; } +create_hardenednopie_specs_file() { _create_specs_file "" hardenednopie ${gcc_common_hard} -DEFAULT_SSP ; } +create_hardenednopiessp_specs_file() { _create_specs_file "" hardenednopiessp ${gcc_common_hard} ; } + +split_out_specs_files() { + local s spec_list="hardenednopiessp vanilla" + if hardened_gcc_works ; then + spec_list="${spec_list} hardened hardenednossp hardenednopie" + elif hardened_gcc_works pie ; then + spec_list="${spec_list} hardenednossp" + elif hardened_gcc_works ssp ; then + spec_list="${spec_list} hardenednopie" + fi + for s in ${spec_list} ; do + create_${s}_specs_file || return 1 + done +} + +create_gcc_env_entry() { + dodir /etc/env.d/gcc + local gcc_envd_base="/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}" + + if [[ -z $1 ]] ; then + gcc_envd_file="${D}${gcc_envd_base}" + # I'm leaving the following commented out to remind me that it + # was an insanely -bad- idea. Stuff broke. GCC_SPECS isnt unset + # on chroot or in non-toolchain.eclass gcc ebuilds! + #gcc_specs_file="${LIBPATH}/specs" + gcc_specs_file="" + else + gcc_envd_file="${D}${gcc_envd_base}-$1" + gcc_specs_file="${LIBPATH}/$1.specs" + fi + + # phase PATH/ROOTPATH out ... + echo "PATH=\"${BINPATH}\"" > ${gcc_envd_file} + echo "ROOTPATH=\"${BINPATH}\"" >> ${gcc_envd_file} + echo "GCC_PATH=\"${BINPATH}\"" >> ${gcc_envd_file} + + if use multilib && ! has_multilib_profile; then + LDPATH="${LIBPATH}" + for path in 32 64 ; do + [[ -d ${LIBPATH}/${path} ]] && LDPATH="${LDPATH}:${LIBPATH}/${path}" + done + else + local MULTIDIR + LDPATH="${LIBPATH}" + + # We want to list the default ABI's LIBPATH first so libtool + # searches that directory first. This is a temporary + # workaround for libtool being stupid and using .la's from + # conflicting ABIs by using the first one in the search path + + local abi=${DEFAULT_ABI} + local MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) + if [[ ${MULTIDIR} == "." ]] ; then + LDPATH=${LIBPATH} + else + LDPATH=${LIBPATH}/${MULTIDIR} + fi + + for abi in $(get_all_abis) ; do + [[ ${abi} == ${DEFAULT_ABI} ]] && continue + + MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) + if [[ ${MULTIDIR} == "." ]] ; then + LDPATH=${LDPATH}:${LIBPATH} + else + LDPATH=${LDPATH}:${LIBPATH}/${MULTIDIR} + fi + done + fi + + echo "LDPATH=\"${LDPATH}\"" >> ${gcc_envd_file} + echo "MANPATH=\"${DATAPATH}/man\"" >> ${gcc_envd_file} + echo "INFOPATH=\"${DATAPATH}/info\"" >> ${gcc_envd_file} + echo "STDCXX_INCDIR=\"${STDCXX_INCDIR##*/}\"" >> ${gcc_envd_file} + + is_crosscompile && echo "CTARGET=${CTARGET}" >> ${gcc_envd_file} + + # Set which specs file to use + [[ -n ${gcc_specs_file} ]] && echo "GCC_SPECS=\"${gcc_specs_file}\"" >> ${gcc_envd_file} +} +setup_minispecs_gcc_build_specs() { + # Setup the "build.specs" file for gcc to use when building. + if want_minispecs ; then + if hardened_gcc_works pie ; then + cat "${WORKDIR}"/specs/pie.specs >> "${WORKDIR}"/build.specs + fi + for s in nostrict znow; do + cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs + done + export GCC_SPECS="${WORKDIR}"/build.specs + fi +} +copy_minispecs_gcc_specs() { + # Build system specs file which, if it exists, must be a complete set of + # specs as it completely and unconditionally overrides the builtin specs. + # For gcc 4 + if want_minispecs ; then + $(XGCC) -dumpspecs > "${WORKDIR}"/specs/specs + cat "${WORKDIR}"/build.specs >> "${WORKDIR}"/specs/specs + insinto ${LIBPATH} + doins "${WORKDIR}"/specs/* || die "failed to install specs" + fi + if want_espf ; then + insinto ${LIBPATH} + doins "${WORKDIR}"/specs/*.specs || die "failed to install specs" + fi +} +add_profile_eselect_conf() { + local compiler_config_file=$1 + local abi=$2 + local specs=$3 + local gcc_specs_file + local var + + if [[ -z ${specs} ]] ; then + # I'm leaving the following commented out to remind me that it + # was an insanely -bad- idea. Stuff broke. GCC_SPECS isnt unset + # on chroot or in non-toolchain.eclass gcc ebuilds! + #gcc_specs_file="${LIBPATH}/specs" + gcc_specs_file="" + + if use hardened ; then + specs="hardened" + else + specs="vanilla" + fi + else + gcc_specs_file="${LIBPATH}/${specs}.specs" + fi + + echo >> ${compiler_config_file} + if ! is_multilib ; then + echo "[${specs}]" >> ${compiler_config_file} + echo " ctarget=${CTARGET}" >> ${compiler_config_file} + else + echo "[${abi}-${specs}]" >> ${compiler_config_file} + var="CTARGET_${abi}" + if [[ -n ${!var} ]] ; then + echo " ctarget=${!var}" >> ${compiler_config_file} + else + var="CHOST_${abi}" + if [[ -n ${!var} ]] ; then + echo " ctarget=${!var}" >> ${compiler_config_file} + else + echo " ctarget=${CTARGET}" >> ${compiler_config_file} + fi + fi + fi + + local MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) + local LDPATH=${LIBPATH} + if [[ ${MULTIDIR} != "." ]] ; then + LDPATH="${LIBPATH}/${MULTIDIR}" + fi + + echo " ldpath=${LDPATH}" >> ${compiler_config_file} + + if [[ -n ${gcc_specs_file} ]] ; then + echo " specs=${gcc_specs_file}" >> ${compiler_config_file} + fi + + var="CFLAGS_${abi}" + if [[ -n ${!var} ]] ; then + echo " cflags=${!var}" >> ${compiler_config_file} + fi +} + +create_eselect_conf() { + local config_dir="/etc/eselect/compiler" + local compiler_config_file="${D}/${config_dir}/${CTARGET}-${GCC_CONFIG_VER}.conf" + local abi + + dodir ${config_dir} + + echo "[global]" > ${compiler_config_file} + echo " version=${CTARGET}-${GCC_CONFIG_VER}" >> ${compiler_config_file} + echo " binpath=${BINPATH}" >> ${compiler_config_file} + echo " manpath=${DATAPATH}/man" >> ${compiler_config_file} + echo " infopath=${DATAPATH}/info" >> ${compiler_config_file} + echo " alias_cc=gcc" >> ${compiler_config_file} + echo " stdcxx_incdir=${STDCXX_INCDIR##*/}" >> ${compiler_config_file} + echo " bin_prefix=${CTARGET}" >> ${compiler_config_file} + + # Per spyderous, it is best not to alias the fortran compilers + #if [[ -x "${D}/${BINPATH}/${CTARGET}-g77" ]] ; then + # echo " alias_gfortran=g77" >> ${compiler_config_file} + #elif [[ -x "${D}/${BINPATH}/${CTARGET}-gfortran" ]] ; then + # echo " alias_g77=gfortran" >> ${compiler_config_file} + #fi + + for abi in $(get_all_abis) ; do + add_profile_eselect_conf "${compiler_config_file}" "${abi}" + + if want_split_specs ; then + if use hardened ; then + add_profile_eselect_conf "${compiler_config_file}" "${abi}" vanilla + elif hardened_gcc_works ; then + add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardened + fi + + if hardened_gcc_works || hardened_gcc_works pie ; then + add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednossp + fi + + if hardened_gcc_works || hardened_gcc_works ssp ; then + add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednopie + fi + + add_profile_eselect_conf "${compiler_config_file}" "${abi}" hardenednopiessp + fi + done +} + +#----<< specs + env.d logic >>---- + +#---->> pkg_* <<---- +gcc_pkg_setup() { + [[ -z ${ETYPE} ]] && die "Your ebuild needs to set the ETYPE variable" + + if [[ ( $(tc-arch) == "amd64" || $(tc-arch) == "ppc64" ) && ( ${LD_PRELOAD} == "/lib/libsandbox.so" || ${LD_PRELOAD} == "/usr/lib/libsandbox.so" ) ]] && is_multilib ; then + eerror "Sandbox in your installed portage does not support compilation." + eerror "of a multilib gcc. Please set FEATURES=-sandbox and try again." + eerror "After you have a multilib gcc, re-emerge portage to have a working sandbox." + die "No 32bit sandbox. Retry with FEATURES=-sandbox." + fi + + if [[ ${ETYPE} == "gcc-compiler" ]] ; then + case $(tc-arch) in + mips) + # Must compile for mips64-linux target if we want n32/n64 support + case "${CTARGET}" in + mips64*) ;; + *) + if use n32 || use n64; then + eerror "n32/n64 can only be used when target host is mips64*-*-linux-*"; + die "Invalid USE flags for CTARGET ($CTARGET)"; + fi + ;; + esac + + #cannot have both n32 & n64 without multilib + if use n32 && use n64 && ! is_multilib; then + eerror "Please enable multilib if you want to use both n32 & n64"; + die "Invalid USE flag combination"; + fi + ;; + esac + + # Setup variables which would normally be in the profile + if is_crosscompile ; then + multilib_env ${CTARGET} + if ! use multilib ; then + MULTILIB_ABIS=${DEFAULT_ABI} + fi + fi + + # we dont want to use the installed compiler's specs to build gcc! + unset GCC_SPECS + fi + + want_libssp && libc_has_ssp && \ + die "libssp cannot be used with a glibc that has been patched to provide ssp symbols" + + unset LANGUAGES #265283 +} + +gcc-compiler_pkg_preinst() { + : +} + +gcc-compiler_pkg_postinst() { + if has_version 'app-admin/eselect-compiler' ; then + do_eselect_compiler + else + do_gcc_config + fi + + if ! is_crosscompile ; then + echo + ewarn "If you have issues with packages unable to locate libstdc++.la," + ewarn "then try running 'fix_libtool_files.sh' on the old gcc versions." + echo + fi + + # If our gcc-config version doesn't like '-' in it's version string, + # tell our users that gcc-config will yell at them, but it's all good. + if ! has_version '>=sys-devel/gcc-config-1.3.10-r1' && [[ ${GCC_CONFIG_VER/-/} != ${GCC_CONFIG_VER} ]] ; then + ewarn "Your version of gcc-config will issue about having an invalid profile" + ewarn "when switching to this profile. It is safe to ignore this warning," + ewarn "and this problem has been corrected in >=sys-devel/gcc-config-1.3.10-r1." + fi + + if ! is_crosscompile && ! use multislot && [[ ${GCCMAJOR}.${GCCMINOR} == 3.4 ]] ; then + echo + ewarn "You should make sure to rebuild all your C++ packages when" + ewarn "upgrading between different versions of gcc. For example," + ewarn "when moving to gcc-3.4 from gcc-3.3, emerge gentoolkit and run:" + ewarn " # revdep-rebuild --library libstdc++.so.5" + echo + ewarn "For more information on the steps to take when upgrading " + ewarn "from gcc-3.3 please refer to: " + ewarn "http://www.gentoo.org/doc/en/gcc-upgrading.xml" + echo + fi + + if ! is_crosscompile ; then + # hack to prevent collisions between SLOT + [[ ! -d ${ROOT}/lib/rcscripts/awk ]] \ + && mkdir -p "${ROOT}"/lib/rcscripts/awk + [[ ! -d ${ROOT}/sbin ]] \ + && mkdir -p "${ROOT}"/sbin + cp "${ROOT}/${DATAPATH}"/fixlafiles.awk "${ROOT}"/lib/rcscripts/awk/ || die "installing fixlafiles.awk" + cp "${ROOT}/${DATAPATH}"/fix_libtool_files.sh "${ROOT}"/sbin/ || die "installing fix_libtool_files.sh" + + [[ ! -d ${ROOT}/usr/bin ]] \ + && mkdir -p "${ROOT}"/usr/bin + # Since these aren't critical files and portage sucks with + # handling of binpkgs, don't require these to be found + for x in "${ROOT}/${DATAPATH}"/c{89,99} ; do + if [[ -e ${x} ]]; then + cp ${x} "${ROOT}"/usr/bin/ || die "installing c89/c99" + fi + done + fi +} + +gcc-compiler_pkg_prerm() { + # Don't let these files be uninstalled #87647 + touch -c "${ROOT}"/sbin/fix_libtool_files.sh \ + "${ROOT}"/lib/rcscripts/awk/fixlafiles.awk +} + +gcc-compiler_pkg_postrm() { + # to make our lives easier (and saner), we do the fix_libtool stuff here. + # rather than checking SLOT's and trying in upgrade paths, we just see if + # the common libstdc++.la exists in the ${LIBPATH} of the gcc that we are + # unmerging. if it does, that means this was a simple re-emerge. + + # clean up the cruft left behind by cross-compilers + if is_crosscompile ; then + if [[ -z $(ls "${ROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then + rm -f "${ROOT}"/etc/env.d/gcc/config-${CTARGET} + rm -f "${ROOT}"/etc/env.d/??gcc-${CTARGET} + rm -f "${ROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64} + fi + return 0 + fi + + # ROOT isnt handled by the script + [[ ${ROOT} != "/" ]] && return 0 + + if [[ ! -e ${LIBPATH}/libstdc++.so ]] ; then + # make sure the profile is sane during same-slot upgrade #289403 + do_gcc_config + + einfo "Running 'fix_libtool_files.sh ${GCC_RELEASE_VER}'" + /sbin/fix_libtool_files.sh ${GCC_RELEASE_VER} + if [[ -n ${BRANCH_UPDATE} ]] ; then + einfo "Running 'fix_libtool_files.sh ${GCC_RELEASE_VER}-${BRANCH_UPDATE}'" + /sbin/fix_libtool_files.sh ${GCC_RELEASE_VER}-${BRANCH_UPDATE} + fi + fi + + return 0 +} + +#---->> pkg_* <<---- + +#---->> src_* <<---- + +# generic GCC src_unpack, to be called from the ebuild's src_unpack. +# BIG NOTE regarding hardened support: ebuilds with support for hardened are +# expected to export the following variable: +# +# HARDENED_GCC_WORKS +# This variable should be set to the archs on which hardened should +# be allowed. For example: HARDENED_GCC_WORKS="x86 sparc amd64" +# This allows for additional archs to be supported by hardened when +# ready. +# +# Travis Tilley (03 Sep 2004) +# +gcc-compiler_src_unpack() { + # For the old gcc < 3.4 + if ! tc_version_is_at_least 4.3 ; then + # Fail if using pie patches, building hardened, and glibc doesn't have + # the necessary support + want_pie && use hardened && glibc_have_pie + einfo "updating configuration to build hardened GCC-3 style" + make_gcc_hard || die "failed to make gcc hard" + fi + + # For the newer gcc > 3.4 + if tc_version_is_at_least 4.3.2 && use hardened ; then + if [[ ${PIE_VER} ]] ; then + glibc_have_pie || die "failed to make gcc hardened" + fi + if [[ ${ESPF_VER} ]] ; then + espf_arch_support || die "ESPF is not supported on this $(tc-arch) arch." + fi + # Rebrand to make bug reports easier + use hardened && BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened} + fi + + if is_libffi ; then + # move the libffi target out of gcj and into all + sed -i \ + -e '/^libgcj=/s:target-libffi::' \ + -e '/^target_lib/s:=":="target-libffi :' \ + "${S}"/configure || die + fi +} +gcc-library_src_unpack() { + : +} +guess_patch_type_in_dir() { + [[ -n $(ls "$1"/*.bz2 2>/dev/null) ]] \ + && EPATCH_SUFFIX="patch.bz2" \ + || EPATCH_SUFFIX="patch" +} +do_gcc_rename_java_bins() { + # bug #139918 - conflict between gcc and java-config-2 for ownership of + # /usr/bin/rmi{c,registry}. Done with mv & sed rather than a patch + # because patches would be large (thanks to the rename of man files), + # and it's clear from the sed invocations that all that changes is the + # rmi{c,registry} names to grmi{c,registry} names. + # Kevin F. Quinn 2006-07-12 + einfo "Renaming jdk executables rmic and rmiregistry to grmic and grmiregistry." + # 1) Move the man files if present (missing prior to gcc-3.4) + for manfile in rmic rmiregistry; do + [[ -f ${S}/gcc/doc/${manfile}.1 ]] || continue + mv "${S}"/gcc/doc/${manfile}.1 "${S}"/gcc/doc/g${manfile}.1 + done + # 2) Fixup references in the docs if present (mission prior to gcc-3.4) + for jfile in gcc/doc/gcj.info gcc/doc/grmic.1 gcc/doc/grmiregistry.1 gcc/java/gcj.texi; do + [[ -f ${S}/${jfile} ]] || continue + sed -i -e 's:rmiregistry:grmiregistry:g' "${S}"/${jfile} || + die "Failed to fixup file ${jfile} for rename to grmiregistry" + sed -i -e 's:rmic:grmic:g' "${S}"/${jfile} || + die "Failed to fixup file ${jfile} for rename to grmic" + done + # 3) Fixup Makefiles to build the changed executable names + # These are present in all 3.x versions, and are the important bit + # to get gcc to build with the new names. + for jfile in libjava/Makefile.am libjava/Makefile.in gcc/java/Make-lang.in; do + sed -i -e 's:rmiregistry:grmiregistry:g' "${S}"/${jfile} || + die "Failed to fixup file ${jfile} for rename to grmiregistry" + # Careful with rmic on these files; it's also the name of a directory + # which should be left unchanged. Replace occurrences of 'rmic$', + # 'rmic_' and 'rmic '. + sed -i -e 's:rmic\([$_ ]\):grmic\1:g' "${S}"/${jfile} || + die "Failed to fixup file ${jfile} for rename to grmic" + done +} +gcc_src_unpack() { + export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}" + + [[ -z ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] && die "Sorry, this version does not support uClibc" + + gcc_quick_unpack + exclude_gcc_patches + + cd "${S}" + + if ! use vanilla ; then + if [[ -n ${PATCH_VER} ]] ; then + guess_patch_type_in_dir "${WORKDIR}"/patch + EPATCH_MULTI_MSG="Applying Gentoo patches ..." \ + epatch "${WORKDIR}"/patch + BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION} p${PATCH_VER}" + fi + if [[ -n ${UCLIBC_VER} ]] ; then + guess_patch_type_in_dir "${WORKDIR}"/uclibc + EPATCH_MULTI_MSG="Applying uClibc patches ..." \ + epatch "${WORKDIR}"/uclibc + fi + fi + do_gcc_HTB_patches + do_gcc_SSP_patches + do_gcc_PIE_patches + epatch_user + do_gcc_ESPF_patches + + ${ETYPE}_src_unpack || die "failed to ${ETYPE}_src_unpack" + + # protoize don't build on FreeBSD, skip it + ## removed in 4.5, bug #270558 --de. + if [[ ${GCCMAJOR}.${GCCMINOR} < 4.5 ]]; then + if ! is_crosscompile && ! use elibc_FreeBSD ; then + # enable protoize / unprotoize + sed -i -e '/^LANGUAGES =/s:$: proto:' "${S}"/gcc/Makefile.in + fi + fi + + fix_files="" + for x in contrib/test_summary libstdc++-v3/scripts/check_survey.in ; do + [[ -e ${x} ]] && fix_files="${fix_files} ${x}" + done + ht_fix_file ${fix_files} */configure *.sh */Makefile.in + + if ! is_crosscompile && is_multilib && \ + [[ ( $(tc-arch) == "amd64" || $(tc-arch) == "ppc64" ) && -z ${SKIP_MULTILIB_HACK} ]] ; then + disgusting_gcc_multilib_HACK || die "multilib hack failed" + fi + + gcc_version_patch + if [[ ${GCCMAJOR}.${GCCMINOR} > 4.0 ]] ; then + if [[ -n ${SNAPSHOT} || -n ${PRERELEASE} ]] ; then + echo ${PV/_/-} > "${S}"/gcc/BASE-VER + fi + fi + + # >= gcc-4.3 doesn't bundle ecj.jar, so copy it + if [[ ${GCCMAJOR}.${GCCMINOR} > 4.2 ]] && + use gcj ; then + cp -pPR "${DISTDIR}/ecj-4.3.jar" "${S}/ecj.jar" || die + fi + + # disable --as-needed from being compiled into gcc specs + # natively when using a gcc version < 3.4.4 + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14992 + if ! tc_version_is_at_least 3.4.4 ; then + sed -i -e s/HAVE_LD_AS_NEEDED/USE_LD_AS_NEEDED/g "${S}"/gcc/config.in + fi + + # In gcc 3.3.x and 3.4.x, rename the java bins to gcc-specific names + # in line with gcc-4. + if [[ ${GCCMAJOR} == 3 ]] && + [[ ${GCCMINOR} -ge 3 ]] + then + do_gcc_rename_java_bins + fi + + # Fixup libtool to correctly generate .la files with portage + cd "${S}" + elibtoolize --portage --shallow --no-uclibc + + gnuconfig_update + + # update configure files + local f + einfo "Fixing misc issues in configure files" + tc_version_is_at_least 4.1 && epatch "${GCC_FILESDIR}"/gcc-configure-texinfo.patch + for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name configure)) ; do + ebegin " Updating ${f/${S}\/} [LANG]" + patch "${f}" "${GCC_FILESDIR}"/gcc-configure-LANG.patch >& "${T}"/configure-patch.log \ + || eerror "Please file a bug about this" + eend $? + done + sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828 + + if [[ -x contrib/gcc_update ]] ; then + einfo "Touching generated files" + ./contrib/gcc_update --touch | \ + while read f ; do + einfo " ${f%%...}" + done + fi + + disable_multilib_libjava || die "failed to disable multilib java" +} + +gcc-library-configure() { + # multilib support + [[ ${GCC_TARGET_NO_MULTILIB} == "true" ]] \ + && confgcc="${confgcc} --disable-multilib" \ + || confgcc="${confgcc} --enable-multilib" +} + +gcc-compiler-configure() { + # multilib support + if is_multilib ; then + confgcc="${confgcc} --enable-multilib" + elif [[ ${CTARGET} == *-linux* ]] ; then + confgcc="${confgcc} --disable-multilib" + fi + + if tc_version_is_at_least "4.0" ; then + if has mudflap ${IUSE} ; then + confgcc="${confgcc} $(use_enable mudflap libmudflap)" + else + confgcc="${confgcc} --disable-libmudflap" + fi + + if want_libssp ; then + confgcc="${confgcc} --enable-libssp" + else + export gcc_cv_libc_provides_ssp=yes + confgcc="${confgcc} --disable-libssp" + fi + + # If we want hardened support on newer espf-patchset + if want_espf ; then + confgcc="${confgcc} --enable-espf" + else + [[ ${ESPF_VER} ]] && confgcc="${confgcc} --disable-espf" + fi + + if tc_version_is_at_least "4.2" ; then + confgcc="${confgcc} $(use_enable openmp libgomp)" + fi + + # enable the cld workaround until we move things to stable. + # by that point, the rest of the software out there should + # have caught up. + if tc_version_is_at_least "4.3" ; then + if ! has ${ARCH} ${KEYWORDS} ; then + confgcc="${confgcc} --enable-cld" + fi + fi + + # Stick the python scripts in their own slotted directory + # bug #279252 + if tc_version_is_at_least "4.4" ; then + confgcc="${confgcc} --with-python-dir=${DATAPATH/$PREFIX/}/python" + fi + fi + + # GTK+ is preferred over xlib in 3.4.x (xlib is unmaintained + # right now). Much thanks to for the heads up. + # Travis Tilley (11 Jul 2004) + if ! is_gcj ; then + confgcc="${confgcc} --disable-libgcj" + elif use gtk ; then + confgcc="${confgcc} --enable-java-awt=gtk" + fi + + case $(tc-arch) in + # Add --with-abi flags to set default MIPS ABI + mips) + local mips_abi="" + use n64 && mips_abi="--with-abi=64" + use n32 && mips_abi="--with-abi=n32" + [[ -n ${mips_abi} ]] && confgcc="${confgcc} ${mips_abi}" + ;; + # Default arch for x86 is normally i386, lets give it a bump + # since glibc will do so based on CTARGET anyways + x86) + confgcc="${confgcc} --with-arch=${CTARGET%%-*}" + ;; + # Enable sjlj exceptions for backward compatibility on hppa + hppa) + [[ ${GCCMAJOR} == "3" ]] && confgcc="${confgcc} --enable-sjlj-exceptions" + ;; + esac + + GCC_LANG="c" + is_cxx && GCC_LANG="${GCC_LANG},c++" + is_d && GCC_LANG="${GCC_LANG},d" + is_gcj && GCC_LANG="${GCC_LANG},java" + if is_objc || is_objcxx ; then + GCC_LANG="${GCC_LANG},objc" + if tc_version_is_at_least "4.0" ; then + use objc-gc && confgcc="${confgcc} --enable-objc-gc" + fi + is_objcxx && GCC_LANG="${GCC_LANG},obj-c++" + fi + is_treelang && GCC_LANG="${GCC_LANG},treelang" + + # fortran support just got sillier! the lang value can be f77 for + # fortran77, f95 for fortran95, or just plain old fortran for the + # currently supported standard depending on gcc version. + is_fortran && GCC_LANG="${GCC_LANG},fortran" + is_f77 && GCC_LANG="${GCC_LANG},f77" + is_f95 && GCC_LANG="${GCC_LANG},f95" + + # We do NOT want 'ADA support' in here! + # is_ada && GCC_LANG="${GCC_LANG},ada" + + einfo "configuring for GCC_LANG: ${GCC_LANG}" +} + +# Other than the variables described for gcc_setup_variables, the following +# will alter tha behavior of gcc_do_configure: +# +# CTARGET +# CBUILD +# Enable building for a target that differs from CHOST +# +# GCC_TARGET_NO_MULTILIB +# Disable multilib. Useful when building single library targets. +# +# GCC_LANG +# Enable support for ${GCC_LANG} languages. defaults to just "c" +# +# Travis Tilley (04 Sep 2004) +# +gcc_do_configure() { + local confgcc + + # Set configuration based on path variables + confgcc="${confgcc} \ + --prefix=${PREFIX} \ + --bindir=${BINPATH} \ + --includedir=${INCLUDEPATH} \ + --datadir=${DATAPATH} \ + --mandir=${DATAPATH}/man \ + --infodir=${DATAPATH}/info \ + --with-gxx-include-dir=${STDCXX_INCDIR}" + # On Darwin we need libdir to be set in order to get correct install names + # for things like libobjc-gnu, libgcj and libfortran. If we enable it on + # non-Darwin we screw up the behaviour this eclass relies on. We in + # particular need this over --libdir for bug #255315. + [[ ${CHOST} == *-darwin* ]] && \ + confgcc="${confgcc} --enable-version-specific-runtime-libs" + + # All our cross-compile logic goes here ! woo ! + confgcc="${confgcc} --host=${CHOST}" + if is_crosscompile || tc-is-cross-compiler ; then + # Straight from the GCC install doc: + # "GCC has code to correctly determine the correct value for target + # for nearly all native systems. Therefore, we highly recommend you + # not provide a configure target when configuring a native compiler." + confgcc="${confgcc} --target=${CTARGET}" + fi + [[ -n ${CBUILD} ]] && confgcc="${confgcc} --build=${CBUILD}" + + # ppc altivec support + confgcc="${confgcc} $(use_enable altivec)" + + # gcc has fixed-point arithmetic support in 4.3 for mips targets that can + # significantly increase compile time by several hours. This will allow + # users to control this feature in the event they need the support. + tc_version_is_at_least "4.3" && confgcc="${confgcc} $(use_enable fixed-point)" + + # graphite support was added in 4.4, which depends upon external libraries + # for optimizations. This option allows users to determine if they want + # these optimizations and libraries pulled in + tc_version_is_at_least "4.4" && \ + confgcc="${confgcc} $(use_with graphite ppl) $(use_with graphite cloog)" + + + [[ $(tc-is-softfloat) == "yes" ]] && confgcc="${confgcc} --with-float=soft" + + # Native Language Support + if use nls ; then + confgcc="${confgcc} --enable-nls --without-included-gettext" + else + confgcc="${confgcc} --disable-nls" + fi + + # reasonably sane globals (hopefully) + confgcc="${confgcc} \ + --with-system-zlib \ + --disable-checking \ + --disable-werror \ + --enable-secureplt" + + # etype specific configuration + einfo "running ${ETYPE}-configure" + ${ETYPE}-configure || die + + # if not specified, assume we are building for a target that only + # requires C support + GCC_LANG=${GCC_LANG:-c} + confgcc="${confgcc} --enable-languages=${GCC_LANG}" + + if is_crosscompile ; then + # When building a stage1 cross-compiler (just C compiler), we have to + # disable a bunch of features or gcc goes boom + local needed_libc="" + case ${CTARGET} in + *-linux) needed_libc=no-fucking-clue;; + *-dietlibc) needed_libc=dietlibc;; + *-elf) needed_libc=newlib;; + *-freebsd*) needed_libc=freebsd-lib;; + *-gnu*) needed_libc=glibc;; + *-klibc) needed_libc=klibc;; + *-uclibc*) needed_libc=uclibc;; + *-cygwin) needed_libc=cygwin;; + mingw*|*-mingw*) needed_libc=mingw-runtime;; + avr) confgcc="${confgcc} --enable-shared --disable-threads";; + esac + if [[ -n ${needed_libc} ]] ; then + if ! has_version ${CATEGORY}/${needed_libc} ; then + confgcc="${confgcc} --disable-shared --disable-threads --without-headers" + elif built_with_use --hidden --missing false ${CATEGORY}/${needed_libc} crosscompile_opts_headers-only ; then + confgcc="${confgcc} --disable-shared --with-sysroot=${PREFIX}/${CTARGET}" + else + confgcc="${confgcc} --with-sysroot=${PREFIX}/${CTARGET}" + fi + fi + + if [[ ${GCCMAJOR}.${GCCMINOR} > 4.1 ]] ; then + confgcc="${confgcc} --disable-bootstrap --disable-libgomp" + fi + elif [[ ${CHOST} == mingw* ]] || [[ ${CHOST} == *-mingw* ]] || [[ ${CHOST} == *-cygwin ]] ; then + confgcc="${confgcc} --enable-shared --enable-threads=win32" + else + confgcc="${confgcc} --enable-shared --enable-threads=posix" + fi + [[ ${CTARGET} == *-elf ]] && confgcc="${confgcc} --with-newlib" + # __cxa_atexit is "essential for fully standards-compliant handling of + # destructors", but apparently requires glibc. + if [[ ${CTARGET} == *-uclibc* ]] ; then + confgcc="${confgcc} --disable-__cxa_atexit --enable-target-optspace $(use_enable nptl tls)" + [[ ${GCCMAJOR}.${GCCMINOR} == 3.3 ]] && confgcc="${confgcc} --enable-sjlj-exceptions" + if tc_version_is_at_least 3.4 && [[ ${GCCMAJOR}.${GCCMINOR} < 4.3 ]] ; then + confgcc="${confgcc} --enable-clocale=uclibc" + fi + elif [[ ${CTARGET} == *-gnu* ]] ; then + confgcc="${confgcc} --enable-__cxa_atexit" + confgcc="${confgcc} --enable-clocale=gnu" + elif [[ ${CTARGET} == *-freebsd* ]]; then + confgcc="${confgcc} --enable-__cxa_atexit" + elif [[ ${CTARGET} == *-solaris* ]]; then + confgcc="${confgcc} --enable-__cxa_atexit" + fi + [[ ${GCCMAJOR}.${GCCMINOR} < 3.4 ]] && confgcc="${confgcc} --disable-libunwind-exceptions" + + # create a sparc*linux*-{gcc,g++} that can handle -m32 and -m64 (biarch) + if [[ ${CTARGET} == sparc*linux* ]] \ + && is_multilib \ + && ! is_crosscompile \ + && [[ ${GCCMAJOR}.${GCCMINOR} > 4.2 ]] + then + confgcc="${confgcc} --enable-targets=all" + fi + + tc_version_is_at_least 4.3 && set -- "$@" \ + --with-bugurl=http://bugs.gentoo.org/ \ + --with-pkgversion="${BRANDING_GCC_PKGVERSION}" + set -- ${confgcc} "$@" ${EXTRA_ECONF} + + # Nothing wrong with a good dose of verbosity + echo + einfo "PREFIX: ${PREFIX}" + einfo "BINPATH: ${BINPATH}" + einfo "LIBPATH: ${LIBPATH}" + einfo "DATAPATH: ${DATAPATH}" + einfo "STDCXX_INCDIR: ${STDCXX_INCDIR}" + echo + einfo "Configuring GCC with: ${@//--/\n\t--}" + echo + + # Build in a separate build tree + mkdir -p "${WORKDIR}"/build + pushd "${WORKDIR}"/build > /dev/null + + # and now to do the actual configuration + addwrite /dev/zero + echo "${S}"/configure "$@" + "${S}"/configure "$@" || die "failed to run configure" + + # return to whatever directory we were in before + popd > /dev/null +} + +# This function accepts one optional argument, the make target to be used. +# If ommitted, gcc_do_make will try to guess whether it should use all, +# profiledbootstrap, or bootstrap-lean depending on CTARGET and arch. An +# example of how to use this function: +# +# gcc_do_make all-target-libstdc++-v3 +# +# In addition to the target to be used, the following variables alter the +# behavior of this function: +# +# LDFLAGS +# Flags to pass to ld +# +# STAGE1_CFLAGS +# CFLAGS to use during stage1 of a gcc bootstrap +# +# BOOT_CFLAGS +# CFLAGS to use during stages 2+3 of a gcc bootstrap. +# +# Travis Tilley (04 Sep 2004) +# +gcc_do_make() { + # Fix for libtool-portage.patch + local OLDS=${S} + S=${WORKDIR}/build + + # Set make target to $1 if passed + [[ -n $1 ]] && GCC_MAKE_TARGET=$1 + # default target + if is_crosscompile || tc-is-cross-compiler ; then + # 3 stage bootstrapping doesnt quite work when you cant run the + # resulting binaries natively ^^; + GCC_MAKE_TARGET=${GCC_MAKE_TARGET-all} + else + GCC_MAKE_TARGET=${GCC_MAKE_TARGET-bootstrap-lean} + fi + + # the gcc docs state that parallel make isnt supported for the + # profiledbootstrap target, as collisions in profile collecting may occur. + [[ ${GCC_MAKE_TARGET} == "profiledbootstrap" ]] && export MAKEOPTS="${MAKEOPTS} -j1" + + # boundschecking seems to introduce parallel build issues + want_boundschecking && export MAKEOPTS="${MAKEOPTS} -j1" + + if [[ ${GCC_MAKE_TARGET} == "all" ]] ; then + STAGE1_CFLAGS=${STAGE1_CFLAGS-"${CFLAGS}"} + elif [[ $(gcc-version) == "3.4" && ${GCC_BRANCH_VER} == "3.4" ]] && gcc-specs-ssp ; then + # See bug #79852 + STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O2"} + else + STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O"} + fi + + if is_crosscompile; then + # In 3.4, BOOT_CFLAGS is never used on a crosscompile... + # but I'll leave this in anyways as someone might have had + # some reason for putting it in here... --eradicator + BOOT_CFLAGS=${BOOT_CFLAGS-"-O2"} + else + # we only want to use the system's CFLAGS if not building a + # cross-compiler. + BOOT_CFLAGS=${BOOT_CFLAGS-"$(get_abi_CFLAGS) ${CFLAGS}"} + fi + + pushd "${WORKDIR}"/build + + emake \ + LDFLAGS="${LDFLAGS}" \ + STAGE1_CFLAGS="${STAGE1_CFLAGS}" \ + LIBPATH="${LIBPATH}" \ + BOOT_CFLAGS="${BOOT_CFLAGS}" \ + ${GCC_MAKE_TARGET} \ + || die "emake failed with ${GCC_MAKE_TARGET}" + + if ! is_crosscompile && ! use nocxx && use doc ; then + if type -p doxygen > /dev/null ; then + if tc_version_is_at_least 4.3 ; then + cd "${CTARGET}"/libstdc++-v3/doc + emake doc-man-doxygen || ewarn "failed to make docs" + elif tc_version_is_at_least 3.0 ; then + cd "${CTARGET}"/libstdc++-v3 + emake doxygen-man || ewarn "failed to make docs" + fi + else + ewarn "Skipping libstdc++ manpage generation since you don't have doxygen installed" + fi + fi + + popd +} + +# This function will add ${GCC_CONFIG_VER} to the names of all shared libraries in the +# directory specified to avoid filename collisions between multiple slotted +# non-versioned gcc targets. If no directory is specified, it is assumed that +# you want -all- shared objects to have ${GCC_CONFIG_VER} added. Example +# +# add_version_to_shared ${D}/usr/$(get_libdir) +# +# Travis Tilley (05 Sep 2004) +# +add_version_to_shared() { + local sharedlib sharedlibdir + [[ -z $1 ]] \ + && sharedlibdir=${D} \ + || sharedlibdir=$1 + + for sharedlib in $(find ${sharedlibdir} -name *.so.*) ; do + if [[ ! -L ${sharedlib} ]] ; then + einfo "Renaming `basename "${sharedlib}"` to `basename "${sharedlib/.so*/}-${GCC_CONFIG_VER}.so.${sharedlib/*.so./}"`" + mv "${sharedlib}" "${sharedlib/.so*/}-${GCC_CONFIG_VER}.so.${sharedlib/*.so./}" \ + || die + pushd `dirname "${sharedlib}"` > /dev/null || die + ln -sf "`basename "${sharedlib/.so*/}-${GCC_CONFIG_VER}.so.${sharedlib/*.so./}"`" \ + "`basename "${sharedlib}"`" || die + popd > /dev/null || die + fi + done +} + +# This is mostly a stub function to be overwritten in an ebuild +gcc_do_filter_flags() { + strip-flags + + # 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 + + # ... sure, why not? + strip-unsupported-flags + + # dont want to funk ourselves + filter-flags '-mabi*' -m31 -m32 -m64 + + case ${GCC_BRANCH_VER} in + 3.2|3.3) + replace-cpu-flags k8 athlon64 opteron i686 x86-64 + replace-cpu-flags pentium-m pentium3m pentium3 + case $(tc-arch) in + amd64|x86) filter-flags '-mtune=*' ;; + # in gcc 3.3 there is a bug on ppc64 where if -mcpu is used, + # the compiler wrongly assumes a 32bit target + ppc64) filter-flags "-mcpu=*";; + esac + case $(tc-arch) in + amd64) replace-cpu-flags core2 nocona;; + x86) replace-cpu-flags core2 prescott;; + esac + + replace-cpu-flags G3 750 + replace-cpu-flags G4 7400 + replace-cpu-flags G5 7400 + + # XXX: should add a sed or something to query all supported flags + # from the gcc source and trim everything else ... + filter-flags -f{no-,}unit-at-a-time -f{no-,}web -mno-tls-direct-seg-refs + filter-flags -f{no-,}stack-protector{,-all} + filter-flags -fvisibility-inlines-hidden -fvisibility=hidden + ;; + 3.4|4.*) + case $(tc-arch) in + x86|amd64) filter-flags '-mcpu=*';; + *-macos) + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25127 + [[ ${GCC_BRANCH_VER} == 4.0 || ${GCC_BRANCH_VER} == 4.1 ]] && \ + filter-flags '-mcpu=*' '-march=*' '-mtune=*' + ;; + esac + ;; + esac + + # Compile problems with these (bug #6641 among others)... + #filter-flags "-fno-exceptions -fomit-frame-pointer -fforce-addr" + + # CFLAGS logic (verified with 3.4.3): + # CFLAGS: + # This conflicts when creating a crosscompiler, so set to a sane + # default in this case: + # used in ./configure and elsewhere for the native compiler + # used by gcc when creating libiberty.a + # used by xgcc when creating libstdc++ (and probably others)! + # this behavior should be removed... + # + # CXXFLAGS: + # used by xgcc when creating libstdc++ + # + # STAGE1_CFLAGS (not used in creating a crosscompile gcc): + # used by ${CHOST}-gcc for building stage1 compiler + # + # BOOT_CFLAGS (not used in creating a crosscompile gcc): + # used by xgcc for building stage2/3 compiler + + if is_crosscompile ; then + # Set this to something sane for both native and target + CFLAGS="-O2 -pipe" + + local VAR="CFLAGS_"${CTARGET//-/_} + CXXFLAGS=${!VAR} + fi + + export GCJFLAGS=${GCJFLAGS:-${CFLAGS}} +} + +gcc_src_compile() { + gcc_do_filter_flags + einfo "CFLAGS=\"${CFLAGS}\"" + einfo "CXXFLAGS=\"${CXXFLAGS}\"" + + # For hardened gcc 4 for build the hardened specs file to use when building gcc + setup_minispecs_gcc_build_specs + + # Build in a separate build tree + mkdir -p "${WORKDIR}"/build + pushd "${WORKDIR}"/build > /dev/null + + # Install our pre generated manpages if we do not have perl ... + [[ ! -x /usr/bin/perl ]] && [[ -n ${MAN_VER} ]] && \ + unpack gcc-${MAN_VER}-manpages.tar.bz2 + + einfo "Configuring ${PN} ..." + gcc_do_configure + + touch "${S}"/gcc/c-gperf.h + + # Do not make manpages if we do not have perl ... + [[ ! -x /usr/bin/perl ]] \ + && find "${WORKDIR}"/build -name '*.[17]' | xargs touch + + einfo "Compiling ${PN} ..." + gcc_do_make ${GCC_MAKE_TARGET} + + # Do not create multiple specs files for PIE+SSP if boundschecking is in + # USE, as we disable PIE+SSP when it is. + # minispecs and espf will not need to split out specs. + if [[ ${ETYPE} == "gcc-compiler" ]] && want_split_specs && ! want_minispecs && ! want_espf ; then + split_out_specs_files || die "failed to split out specs" + fi + + popd > /dev/null +} + +gcc_src_test() { + cd "${WORKDIR}"/build + emake -j1 -k check || ewarn "check failed and that sucks :(" +} + +gcc-library_src_install() { + # Do the 'make install' from the build directory + cd "${WORKDIR}"/build + S=${WORKDIR}/build \ + emake -j1 \ + DESTDIR="${D}" \ + prefix=${PREFIX} \ + bindir=${BINPATH} \ + includedir=${LIBPATH}/include \ + datadir=${DATAPATH} \ + mandir=${DATAPATH}/man \ + infodir=${DATAPATH}/info \ + LIBPATH="${LIBPATH}" \ + ${GCC_INSTALL_TARGET} || die + + if [[ ${GCC_LIB_COMPAT_ONLY} == "true" ]] ; then + rm -rf "${D}"${INCLUDEPATH} + rm -rf "${D}"${DATAPATH} + pushd "${D}"${LIBPATH}/ + rm *.a *.la *.so + popd + fi + + if [[ -n ${GCC_LIB_USE_SUBDIR} ]] ; then + mkdir -p "${WORKDIR}"/${GCC_LIB_USE_SUBDIR}/ + mv "${D}"${LIBPATH}/* "${WORKDIR}"/${GCC_LIB_USE_SUBDIR}/ + mv "${WORKDIR}"/${GCC_LIB_USE_SUBDIR}/ "${D}"${LIBPATH} + + dodir /etc/env.d + echo "LDPATH=\"${LIBPATH}/${GCC_LIB_USE_SUBDIR}/\"" >> "${D}"/etc/env.d/99${PN} + fi + + if [[ ${GCC_VAR_TYPE} == "non-versioned" ]] ; then + # if we're not using versioned directories, we need to use versioned + # filenames. + add_version_to_shared + fi +} + +gcc-compiler_src_install() { + local x= + + cd "${WORKDIR}"/build + # Do allow symlinks in private gcc include dir as this can break the build + find gcc/include*/ -type l -print0 | xargs rm -f + # Remove generated headers, as they can cause things to break + # (ncurses, openssl, etc). + for x in $(find gcc/include*/ -name '*.h') ; do + grep -q 'It has been auto-edited by fixincludes from' "${x}" \ + && rm -f "${x}" + done + # Do the 'make install' from the build directory + S=${WORKDIR}/build \ + emake -j1 DESTDIR="${D}" install || die + # Punt some tools which are really only useful while building gcc + find "${D}" -name install-tools -prune -type d -exec rm -rf "{}" \; + # This one comes with binutils + find "${D}" -name libiberty.a -exec rm -f "{}" \; + + # Move the libraries to the proper location + gcc_movelibs + + # Basic sanity check + if ! is_crosscompile ; then + local EXEEXT + eval $(grep ^EXEEXT= "${WORKDIR}"/build/gcc/config.log) + [[ -r ${D}${BINPATH}/gcc${EXEEXT} ]] || die "gcc not found in ${D}" + fi + + dodir /etc/env.d/gcc + create_gcc_env_entry + + if want_split_specs ; then + if use hardened ; then + create_gcc_env_entry vanilla + fi + ! use hardened && hardened_gcc_works && create_gcc_env_entry hardened + if hardened_gcc_works || hardened_gcc_works pie ; then + create_gcc_env_entry hardenednossp + fi + if hardened_gcc_works || hardened_gcc_works ssp ; then + create_gcc_env_entry hardenednopie + fi + create_gcc_env_entry hardenednopiessp + + insinto ${LIBPATH} + doins "${WORKDIR}"/build/*.specs || die "failed to install specs" + fi + # Setup the gcc_env_entry for hardened gcc 4 with minispecs or espf + if want_minispecs ; then + if hardened_gcc_works pie ; then + create_gcc_env_entry hardenednopie + fi + create_gcc_env_entry vanilla + fi + + if want_espf ; then + create_gcc_env_entry hardenednopie + create_gcc_env_entry hardenednossp + create_gcc_env_entry vanilla + fi + + # Make sure we dont have stuff lying around that + # can nuke multiple versions of gcc + + gcc_slot_java + + # Move to compiler-specific directories + [[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ]] && \ + mv -f "${D}"${STDCXX_INCDIR}/cxxabi.h "${D}"${LIBPATH}/include/ + + # These should be symlinks + dodir /usr/bin + cd "${D}"${BINPATH} + for x in cpp gcc g++ c++ g77 gcj gcjh gfortran ; do + # For some reason, g77 gets made instead of ${CTARGET}-g77... + # this should take care of that + [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x} + + if [[ -f ${CTARGET}-${x} ]] && ! is_crosscompile ; then + ln -sf ${CTARGET}-${x} ${x} + + # Create version-ed symlinks + dosym ${BINPATH}/${CTARGET}-${x} \ + /usr/bin/${CTARGET}-${x}-${GCC_CONFIG_VER} + dosym ${BINPATH}/${CTARGET}-${x} \ + /usr/bin/${x}-${GCC_CONFIG_VER} + fi + + if [[ -f ${CTARGET}-${x}-${GCC_CONFIG_VER} ]] ; then + rm -f ${CTARGET}-${x}-${GCC_CONFIG_VER} + ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER} + fi + done + + # I do not know if this will break gcj stuff, so I'll only do it for + # objc for now; basically "ffi.h" is the correct file to include, + # but it gets installed in .../GCCVER/include and yet it does + # "#include " which (correctly, as it's an "extra" file) + # is installed in .../GCCVER/include/libffi; the following fixes + # ffi.'s include of ffitarget.h - Armando Di Cianno + if [[ -d ${D}${LIBPATH}/include/libffi ]] ; then + mv -i "${D}"${LIBPATH}/include/libffi/* "${D}"${LIBPATH}/include || die + rm -r "${D}"${LIBPATH}/include/libffi || die + fi + + # Now do the fun stripping stuff + env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${BINPATH}" + env RESTRICT="" CHOST=${CTARGET} prepstrip "${D}${LIBPATH}" + # gcc used to install helper binaries in lib/ but then moved to libexec/ + [[ -d ${D}${PREFIX}/libexec/gcc ]] && \ + env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}" + + cd "${S}" + if is_crosscompile; then + rm -rf "${D}"/usr/share/{man,info} + rm -rf "${D}"${DATAPATH}/{man,info} + else + local cxx_mandir=${WORKDIR}/build/${CTARGET}/libstdc++-v3/docs/doxygen/man + if [[ -d ${cxx_mandir} ]] ; then + # clean bogus manpages #113902 + find "${cxx_mandir}" -name '*_build_*' -exec rm {} \; + cp -r "${cxx_mandir}"/man? "${D}/${DATAPATH}"/man/ + fi + has noinfo ${FEATURES} \ + && rm -r "${D}/${DATAPATH}"/info \ + || prepinfo "${DATAPATH}" + has noman ${FEATURES} \ + && rm -r "${D}/${DATAPATH}"/man \ + || prepman "${DATAPATH}" + fi + # prune empty dirs left behind + for x in 1 2 3 4 ; do + find "${D}" -type d -exec rmdir "{}" \; >& /dev/null + done + + # install testsuite results + if use test; then + docinto testsuite + find "${WORKDIR}"/build -type f -name "*.sum" -print0 | xargs -0 dodoc + find "${WORKDIR}"/build -type f -path "*/testsuite/*.log" -print0 \ + | xargs -0 dodoc + fi + + # Rather install the script, else portage with changing $FILESDIR + # between binary and source package borks things .... + if ! is_crosscompile ; then + insinto "${DATAPATH}" + if tc_version_is_at_least 4.0 ; then + newins "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la fixlafiles.awk || die + find "${D}/${LIBPATH}" -name libstdc++.la -type f -exec rm "{}" \; + else + doins "${GCC_FILESDIR}"/awk/fixlafiles.awk || die + fi + exeinto "${DATAPATH}" + doexe "${GCC_FILESDIR}"/fix_libtool_files.sh || die + doexe "${GCC_FILESDIR}"/c{89,99} || die + fi + + # use gid of 0 because some stupid ports don't have + # the group 'root' set to gid 0 + chown -R root:0 "${D}"${LIBPATH} + + # Create config files for eselect-compiler + create_eselect_conf + + # Copy the needed minispec for hardened gcc 4 + copy_minispecs_gcc_specs +} + +gcc_slot_java() { + local x + + # Move Java headers to compiler-specific dir + for x in "${D}"${PREFIX}/include/gc*.h "${D}"${PREFIX}/include/j*.h ; do + [[ -f ${x} ]] && mv -f "${x}" "${D}"${LIBPATH}/include/ + done + for x in gcj gnu java javax org ; do + if [[ -d ${D}${PREFIX}/include/${x} ]] ; then + dodir /${LIBPATH}/include/${x} + mv -f "${D}"${PREFIX}/include/${x}/* "${D}"${LIBPATH}/include/${x}/ + rm -rf "${D}"${PREFIX}/include/${x} + fi + done + + if [[ -d ${D}${PREFIX}/lib/security ]] || [[ -d ${D}${PREFIX}/$(get_libdir)/security ]] ; then + dodir /${LIBPATH}/security + mv -f "${D}"${PREFIX}/lib*/security/* "${D}"${LIBPATH}/security + rm -rf "${D}"${PREFIX}/lib*/security + fi + + # Move libgcj.spec to compiler-specific directories + [[ -f ${D}${PREFIX}/lib/libgcj.spec ]] && \ + mv -f "${D}"${PREFIX}/lib/libgcj.spec "${D}"${LIBPATH}/libgcj.spec + + # SLOT up libgcj.pc (and let gcc-config worry about links) + local libgcj=$(find "${D}"${PREFIX}/lib/pkgconfig/ -name 'libgcj*.pc') + if [[ -n ${libgcj} ]] ; then + sed -i "/^libdir=/s:=.*:=${LIBPATH}:" "${libgcj}" + mv "${libgcj}" "${D}"/usr/lib/pkgconfig/libgcj-${GCC_PV}.pc || die + fi + + # Rename jar because it could clash with Kaffe's jar if this gcc is + # primary compiler (aka don't have the - extension) + cd "${D}"${BINPATH} + [[ -f jar ]] && mv -f jar gcj-jar +} + +# Move around the libs to the right location. For some reason, +# when installing gcc, it dumps internal libraries into /usr/lib +# instead of the private gcc lib path +gcc_movelibs() { + # older versions of gcc did not support --print-multi-os-directory + tc_version_is_at_least 3.0 || return 0 + + local multiarg removedirs="" + for multiarg in $($(XGCC) -print-multi-lib) ; do + multiarg=${multiarg#*;} + multiarg=${multiarg//@/ -} + + local OS_MULTIDIR=$($(XGCC) ${multiarg} --print-multi-os-directory) + local MULTIDIR=$($(XGCC) ${multiarg} --print-multi-directory) + local TODIR=${D}${LIBPATH}/${MULTIDIR} + local FROMDIR= + + [[ -d ${TODIR} ]] || mkdir -p ${TODIR} + + for FROMDIR in \ + ${LIBPATH}/${OS_MULTIDIR} \ + ${LIBPATH}/../${MULTIDIR} \ + ${PREFIX}/lib/${OS_MULTIDIR} \ + ${PREFIX}/${CTARGET}/lib/${OS_MULTIDIR} \ + ${PREFIX}/lib/${MULTIDIR} + do + removedirs="${removedirs} ${FROMDIR}" + FROMDIR=${D}${FROMDIR} + if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then + local files=$(find "${FROMDIR}" -maxdepth 1 ! -type d 2>/dev/null) + if [[ -n ${files} ]] ; then + mv ${files} "${TODIR}" + fi + fi + done + fix_libtool_libdir_paths "${LIBPATH}/${MULTIDIR}" + done + + # We remove directories separately to avoid this case: + # mv SRC/lib/../lib/*.o DEST + # rmdir SRC/lib/../lib/ + # mv SRC/lib/../lib32/*.o DEST # Bork + for FROMDIR in ${removedirs} ; do + rmdir "${D}"${FROMDIR} >& /dev/null + done + find "${D}" -type d | xargs rmdir >& /dev/null +} + +#----<< src_* >>---- + +#---->> unorganized crap in need of refactoring follows + +# gcc_quick_unpack will unpack the gcc tarball and patches in a way that is +# consistant with the behavior of get_gcc_src_uri. The only patch it applies +# itself is the branch update if present. +# +# Travis Tilley (03 Sep 2004) +# +gcc_quick_unpack() { + pushd "${WORKDIR}" > /dev/null + export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}} + export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}} + export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}} + export PP_GCC_VER=${PP_GCC_VER:-${GCC_RELEASE_VER}} + export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}} + export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}} + + if [[ -n ${GCC_A_FAKEIT} ]] ; then + unpack ${GCC_A_FAKEIT} + elif [[ -n ${PRERELEASE} ]] ; then + unpack gcc-${PRERELEASE}.tar.bz2 + elif [[ -n ${SNAPSHOT} ]] ; then + unpack gcc-${SNAPSHOT}.tar.bz2 + else + unpack gcc-${GCC_RELEASE_VER}.tar.bz2 + # We want branch updates to be against a release tarball + if [[ -n ${BRANCH_UPDATE} ]] ; then + pushd "${S}" > /dev/null + epatch "${DISTDIR}"/gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2 + popd > /dev/null + fi + fi + + if [[ -n ${D_VER} ]] && use d ; then + pushd "${S}"/gcc > /dev/null + unpack gdc-${D_VER}-src.tar.bz2 + cd .. + ebegin "Adding support for the D language" + ./gcc/d/setup-gcc.sh >& "${T}"/dgcc.log + if ! eend $? ; then + eerror "The D gcc package failed to apply" + eerror "Please include this log file when posting a bug report:" + eerror " ${T}/dgcc.log" + die "failed to include the D language" + fi + popd > /dev/null + fi + + [[ -n ${PATCH_VER} ]] && \ + unpack gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2 + + [[ -n ${UCLIBC_VER} ]] && \ + unpack gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2 + + if want_ssp ; then + if [[ -n ${PP_FVER} ]] ; then + # The gcc 3.4 propolice versions are meant to be unpacked to ${S} + pushd "${S}" > /dev/null + unpack protector-${PP_FVER}.tar.gz + popd > /dev/null + else + unpack gcc-${PP_GCC_VER}-ssp-${PP_VER}.tar.bz2 + fi + fi + + if want_pie ; then + if [[ -n ${PIE_CORE} ]] ; then + unpack ${PIE_CORE} + else + unpack gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2 + fi + fi + + if [[ -n ${ESPF_VER} ]] ; then + unpack gcc-${GCC_RELEASE_VER}-espf-${ESPF_VER}.tar.bz2 + fi + + [[ -n ${SPECS_VER} ]] && \ + unpack gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2 + + want_boundschecking && \ + unpack "bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2" + + popd > /dev/null +} + +# Exclude any unwanted patches, as specified by the following variables: +# +# GENTOO_PATCH_EXCLUDE +# List of filenames, relative to ${WORKDIR}/patch/ +# +# PIEPATCH_EXCLUDE +# List of filenames, relative to ${WORKDIR}/piepatch/ +# +# Travis Tilley (03 Sep 2004) +# +exclude_gcc_patches() { + local i + for i in ${GENTOO_PATCH_EXCLUDE} ; do + if [[ -f ${WORKDIR}/patch/${i} ]] ; then + einfo "Excluding patch ${i}" + rm -f "${WORKDIR}"/patch/${i} || die "failed to delete ${i}" + fi + done + for i in ${PIEPATCH_EXCLUDE} ; do + if [[ -f ${WORKDIR}/piepatch/${i} ]] ; then + einfo "Excluding piepatch ${i}" + rm -f "${WORKDIR}"/piepatch/${i} || die "failed to delete ${i}" + fi + done +} + +# Try to apply some stub patches so that gcc won't error out when +# passed parameters like -fstack-protector but no ssp is found +do_gcc_stub() { + local v stub_patch="" + for v in ${GCC_RELEASE_VER} ${GCC_BRANCH_VER} ; do + stub_patch=${GCC_FILESDIR}/stubs/gcc-${v}-$1-stub.patch + if [[ -e ${stub_patch} ]] && ! use vanilla ; then + EPATCH_SINGLE_MSG="Applying stub patch for $1 ..." \ + epatch "${stub_patch}" + return 0 + fi + done +} + +do_gcc_HTB_patches() { + if ! want_boundschecking || \ + (want_ssp && [[ ${HTB_EXCLUSIVE} == "true" ]]) + then + do_gcc_stub htb + return 0 + fi + + # modify the bounds checking patch with a regression patch + epatch "${WORKDIR}/bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch" + BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, HTB-${HTB_GCC_VER}-${HTB_VER}" +} + +# patch in ProPolice Stack Smashing protection +do_gcc_SSP_patches() { + # PARISC has no love ... it's our stack :( + if [[ $(tc-arch) == "hppa" ]] || \ + ! want_ssp || \ + (want_boundschecking && [[ ${HTB_EXCLUSIVE} == "true" ]]) + then + do_gcc_stub ssp + return 0 + fi + + local ssppatch + local sspdocs + + if [[ -n ${PP_FVER} ]] ; then + # Etoh keeps changing where files are and what the patch is named + if tc_version_is_at_least 3.4.1 ; then + # >3.4.1 uses version in patch name, and also includes docs + ssppatch="${S}/gcc_${PP_VER}.dif" + sspdocs="yes" + elif tc_version_is_at_least 3.4.0 ; then + # >3.4 put files where they belong and 3_4 uses old patch name + ssppatch="${S}/protector.dif" + sspdocs="no" + elif tc_version_is_at_least 3.2.3 ; then + # earlier versions have no directory structure or docs + mv "${S}"/protector.{c,h} "${S}"/gcc + ssppatch="${S}/protector.dif" + sspdocs="no" + fi + else + # Just start packaging the damn thing ourselves + mv "${WORKDIR}"/ssp/protector.{c,h} "${S}"/gcc/ + ssppatch=${WORKDIR}/ssp/gcc-${PP_GCC_VER}-ssp.patch + # allow boundschecking and ssp to get along + (want_boundschecking && [[ -e ${WORKDIR}/ssp/htb-ssp.patch ]]) \ + && patch -s "${ssppatch}" "${WORKDIR}"/ssp/htb-ssp.patch + fi + + [[ -z ${ssppatch} ]] && die "Sorry, SSP is not supported in this version" + epatch ${ssppatch} + + if [[ ${PN} == "gcc" && ${sspdocs} == "no" ]] ; then + epatch "${GCC_FILESDIR}"/pro-police-docs.patch + fi + + # Don't build crtbegin/end with ssp + sed -e 's|^CRTSTUFF_CFLAGS = |CRTSTUFF_CFLAGS = -fno-stack-protector |'\ + -i gcc/Makefile.in || die "Failed to update crtstuff!" + + # if gcc in a stage3 defaults to ssp, is version 3.4.0 and a stage1 is built + # the build fails building timevar.o w/: + # cc1: stack smashing attack in function ix86_split_to_parts() + if use build && tc_version_is_at_least 3.4.0 ; then + if gcc -dumpspecs | grep -q "fno-stack-protector:" ; then + epatch "${GCC_FILESDIR}"/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch + fi + fi + + BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, ssp-${PP_FVER:-${PP_GCC_VER}-${PP_VER}}" + if want_libssp ; then + update_gcc_for_libssp + else + update_gcc_for_libc_ssp + fi + + # Don't build libgcc with ssp + sed -e 's|^\(LIBGCC2_CFLAGS.*\)$|\1 -fno-stack-protector|' \ + -i gcc/Makefile.in || die "Failed to update gcc!" +} + +# If glibc or uclibc has been patched to provide the necessary symbols itself, +# then lets use those for SSP instead of libgcc. +update_gcc_for_libc_ssp() { + if libc_has_ssp ; then + einfo "Updating gcc to use SSP from libc ..." + sed -e 's|^\(LIBGCC2_CFLAGS.*\)$|\1 -D_LIBC_PROVIDES_SSP_|' \ + -i "${S}"/gcc/Makefile.in || die "Failed to update gcc!" + fi +} + +# a split out non-libc non-libgcc ssp requires additional spec logic changes +update_gcc_for_libssp() { + einfo "Updating gcc to use SSP from libssp..." + sed -e 's|^\(INTERNAL_CFLAGS.*\)$|\1 -D_LIBSSP_PROVIDES_SSP_|' \ + -i "${S}"/gcc/Makefile.in || die "Failed to update gcc!" +} + +# do various updates to PIE logic +do_gcc_PIE_patches() { + if ! want_pie || \ + (want_boundschecking && [[ ${HTB_EXCLUSIVE} == "true" ]]) + then + return 0 + fi + + want_boundschecking \ + && rm -f "${WORKDIR}"/piepatch/*/*-boundschecking-no.patch* \ + || rm -f "${WORKDIR}"/piepatch/*/*-boundschecking-yes.patch* + + use vanilla && return 0 + + if tc_version_is_at_least 4.3.2; then + guess_patch_type_in_dir "${WORKDIR}"/piepatch/ + EPATCH_MULTI_MSG="Applying pie patches ..." \ + epatch "${WORKDIR}"/piepatch/ + else + guess_patch_type_in_dir "${WORKDIR}"/piepatch/upstream + + # corrects startfile/endfile selection and shared/static/pie flag usage + EPATCH_MULTI_MSG="Applying upstream pie patches ..." \ + epatch "${WORKDIR}"/piepatch/upstream + # adds non-default pie support (rs6000) + EPATCH_MULTI_MSG="Applying non-default pie patches ..." \ + epatch "${WORKDIR}"/piepatch/nondef + # adds default pie support (rs6000 too) if DEFAULT_PIE[_SSP] is defined + EPATCH_MULTI_MSG="Applying default pie patches ..." \ + epatch "${WORKDIR}"/piepatch/def + + # we want to be able to control the pie patch logic via something other + # than ALL_CFLAGS... + sed -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \ + -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \ + -i "${S}"/gcc/Makefile.in + fi + + BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, pie-${PIE_VER}" +} + +# do various updates to ESPF +do_gcc_ESPF_patches() { + if [[ -n ${ESPF_VER} ]] && ! use vanilla; then + guess_patch_type_in_dir "${WORKDIR}"/espf-gcc-"${GCC_RELEASE_VER}" + EPATCH_MULTI_MSG="Applying espf patches ..." \ + epatch "${WORKDIR}"/espf-gcc-"${GCC_RELEASE_VER}" + BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, espf-${ESPF_VER}" + fi +} + +should_we_gcc_config() { + # we always want to run gcc-config if we're bootstrapping, otherwise + # we might get stuck with the c-only stage1 compiler + use bootstrap && return 0 + use build && return 0 + + # if the current config is invalid, we definitely want a new one + # Note: due to bash quirkiness, the following must not be 1 line + local curr_config + curr_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>&1) || return 0 + + # if the previously selected config has the same major.minor (branch) as + # the version we are installing, then it will probably be uninstalled + # for being in the same SLOT, make sure we run gcc-config. + local curr_config_ver=$(env -i ROOT="${ROOT}" gcc-config -S ${curr_config} | awk '{print $2}') + + local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver}) + + # If we're using multislot, just run gcc-config if we're installing + # to the same profile as the current one. + use multislot && return $([[ ${curr_config_ver} == ${GCC_CONFIG_VER} ]]) + + if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then + return 0 + else + # if we're installing a genuinely different compiler version, + # we should probably tell the user -how- to switch to the new + # gcc version, since we're not going to do it for him/her. + # We don't want to switch from say gcc-3.3 to gcc-3.4 right in + # the middle of an emerge operation (like an 'emerge -e world' + # which could install multiple gcc versions). + einfo "The current gcc config appears valid, so it will not be" + einfo "automatically switched for you. If you would like to" + einfo "switch to the newly installed gcc version, do the" + einfo "following:" + echo + einfo "gcc-config ${CTARGET}-${GCC_CONFIG_VER}" + einfo "source /etc/profile" + echo + ebeep + return 1 + fi +} + +do_gcc_config() { + if ! should_we_gcc_config ; then + env -i ROOT="${ROOT}" gcc-config --use-old --force + return 0 + fi + + local current_gcc_config="" current_specs="" use_specs="" + + current_gcc_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>/dev/null) + if [[ -n ${current_gcc_config} ]] ; then + # figure out which specs-specific config is active + current_specs=$(gcc-config -S ${current_gcc_config} | awk '{print $3}') + [[ -n ${current_specs} ]] && use_specs=-${current_specs} + fi + if [[ -n ${use_specs} ]] && \ + [[ ! -e ${ROOT}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]] + then + ewarn "The currently selected specs-specific gcc config," + ewarn "${current_specs}, doesn't exist anymore. This is usually" + ewarn "due to enabling/disabling hardened or switching to a version" + ewarn "of gcc that doesnt create multiple specs files. The default" + ewarn "config will be used, and the previous preference forgotten." + ebeep + epause + use_specs="" + fi + + gcc-config ${CTARGET}-${GCC_CONFIG_VER}${use_specs} +} + +should_we_eselect_compiler() { + # we always want to run gcc-config if we're bootstrapping, otherwise + # we might get stuck with the c-only stage1 compiler + use bootstrap && return 0 + use build && return 0 + + # if the current config is invalid, we definitely want a new one + # Note: due to bash quirkiness, the following must not be 1 line + local curr_config + curr_config=$(env -i eselect compiler show ${CTARGET} 2>&1) || return 0 + [[ -z ${curr_config} || ${curr_config} == "(none)" ]] && return 0 + + # if the previously selected config has the same major.minor (branch) as + # the version we are installing, then it will probably be uninstalled + # for being in the same SLOT, make sure we run gcc-config. + local curr_config_ver=$(echo ${curr_config} | cut -f1 -d/ | awk -F - '{ print $5 }') + local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver}) + + # If we're using multislot, just run gcc-config if we're installing + # to the same profile as the current one. + use multislot && return $([[ ${curr_config_ver} == ${GCC_CONFIG_VER} ]]) + + if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then + return 0 + else + # if we're installing a genuinely different compiler version, + # we should probably tell the user -how- to switch to the new + # gcc version, since we're not going to do it for him/her. + # We don't want to switch from say gcc-3.3 to gcc-3.4 right in + # the middle of an emerge operation (like an 'emerge -e world' + # which could install multiple gcc versions). + einfo "The current gcc config appears valid, so it will not be" + einfo "automatically switched for you. If you would like to" + einfo "switch to the newly installed gcc version, do the" + einfo "following:" + echo + einfo "eselect compiler set " + echo + ebeep + return 1 + fi +} + +do_eselect_compiler() { + if ! should_we_eselect_compiler; then + eselect compiler update + return 0 + fi + + for abi in $(get_all_abis) ; do + local ctarget=$(get_abi_CHOST ${abi}) + local current_specs=$(env -i eselect compiler show ${ctarget} | cut -f2 -d/) + + if [[ -n ${current_specs} && ${current_specs} != "(none)" ]] && eselect compiler set ${CTARGET}-${GCC_CONFIG_VER}/${current_specs} &> /dev/null; then + einfo "The following compiler profile has been activated based on your previous profile:" + einfo "${CTARGET}-${GCC_CONFIG_VER}/${current_specs}" + else + # We couldn't choose based on the old specs, so fall back on vanilla/hardened based on USE + + local spec + if use hardened ; then + spec="hardened" + else + spec="vanilla" + fi + + local profile + local isset=0 + for profile in "${current_specs%-*}-${spec}" "${abi}-${spec}" "${spec}" ; do + if eselect compiler set ${CTARGET}-${GCC_CONFIG_VER}/${profile} &> /dev/null ; then + ewarn "The newly installed version of gcc does not have a profile that matches the name of your" + ewarn "currently selected profile for ${ctarget}, so we have enabled the following instead:" + ewarn "${CTARGET}-${GCC_CONFIG_VER}/${profile}" + ewarn "If this is incorrect, please use 'eselect compiler set' to" + ewarn "select another profile." + + isset=1 + break + fi + done + + if [[ ${isset} == 0 ]] ; then + eerror "We were not able to automatically set the current compiler for ${ctarget}" + eerror "to your newly emerged gcc. Please use 'eselect compiler set'" + eerror "to select your compiler." + fi + fi + done +} + +# This function allows us to gentoo-ize gcc's version number and bugzilla +# URL without needing to use patches. +gcc_version_patch() { + # gcc-4.3+ has configure flags (whoo!) + tc_version_is_at_least 4.3 && return 0 + + local version_string=${GCC_CONFIG_VER} + [[ -n ${BRANCH_UPDATE} ]] && version_string="${version_string} ${BRANCH_UPDATE}" + + einfo "patching gcc version: ${version_string} (${BRANDING_GCC_PKGVERSION})" + + if grep -qs VERSUFFIX "${S}"/gcc/version.c ; then + sed -i -e "s~VERSUFFIX \"\"~VERSUFFIX \" (${BRANDING_GCC_PKGVERSION})\"~" \ + "${S}"/gcc/version.c || die "failed to update VERSUFFIX with Gentoo branding" + else + version_string="${version_string} (${BRANDING_GCC_PKGVERSION})" + sed -i -e "s~\(const char version_string\[\] = \"\).*\(\".*\)~\1$version_string\2~" \ + "${S}"/gcc/version.c || die "failed to update version.c with Gentoo branding." + fi + sed -i -e 's~gcc\.gnu\.org\/bugs\.html~bugs\.gentoo\.org\/~' \ + "${S}"/gcc/version.c || die "Failed to change the bug URL" +} + +# The purpose of this DISGUSTING gcc multilib hack is to allow 64bit libs +# to live in lib instead of lib64 where they belong, with 32bit libraries +# in lib32. This hack has been around since the beginning of the amd64 port, +# and we're only now starting to fix everything that's broken. Eventually +# this should go away. +# +# Travis Tilley (03 Sep 2004) +# +disgusting_gcc_multilib_HACK() { + local config + local libdirs + if has_multilib_profile ; then + case $(tc-arch) in + amd64) + config="i386/t-linux64" + libdirs="../$(get_abi_LIBDIR amd64) ../$(get_abi_LIBDIR x86)" \ + ;; + ppc64) + config="rs6000/t-linux64" + libdirs="../$(get_abi_LIBDIR ppc64) ../$(get_abi_LIBDIR ppc)" \ + ;; + esac + else + die "Your profile is no longer supported by portage." + fi + + einfo "updating multilib directories to be: ${libdirs}" + sed -i -e "s:^MULTILIB_OSDIRNAMES.*:MULTILIB_OSDIRNAMES = ${libdirs}:" "${S}"/gcc/config/${config} +} + +disable_multilib_libjava() { + if is_gcj ; then + # We dont want a multilib libjava, so lets use this hack taken from fedora + pushd "${S}" > /dev/null + sed -i -e 's/^all: all-redirect/ifeq (\$(MULTISUBDIR),)\nall: all-redirect\nelse\nall:\n\techo Multilib libjava build disabled\nendif/' libjava/Makefile.in + sed -i -e 's/^install: install-redirect/ifeq (\$(MULTISUBDIR),)\ninstall: install-redirect\nelse\ninstall:\n\techo Multilib libjava install disabled\nendif/' libjava/Makefile.in + sed -i -e 's/^check: check-redirect/ifeq (\$(MULTISUBDIR),)\ncheck: check-redirect\nelse\ncheck:\n\techo Multilib libjava check disabled\nendif/' libjava/Makefile.in + sed -i -e 's/^all: all-recursive/ifeq (\$(MULTISUBDIR),)\nall: all-recursive\nelse\nall:\n\techo Multilib libjava build disabled\nendif/' libjava/Makefile.in + sed -i -e 's/^install: install-recursive/ifeq (\$(MULTISUBDIR),)\ninstall: install-recursive\nelse\ninstall:\n\techo Multilib libjava install disabled\nendif/' libjava/Makefile.in + sed -i -e 's/^check: check-recursive/ifeq (\$(MULTISUBDIR),)\ncheck: check-recursive\nelse\ncheck:\n\techo Multilib libjava check disabled\nendif/' libjava/Makefile.in + popd > /dev/null + fi +} + +# make sure the libtool archives have libdir set to where they actually +# -are-, and not where they -used- to be. also, any dependencies we have +# on our own .la files need to be updated. +fix_libtool_libdir_paths() { + pushd "${D}" >/dev/null + + pushd "./${1}" >/dev/null + local dir="${PWD#${D%/}}" + local allarchives=$(echo *.la) + allarchives="\(${allarchives// /\\|}\)" + popd >/dev/null + + sed -i \ + -e "/^libdir=/s:=.*:='${dir}':" \ + ./${dir}/*.la + sed -i \ + -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" \ + $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') \ + ./${dir}/*.la + + popd >/dev/null +} + +is_multilib() { + [[ ${GCCMAJOR} < 3 ]] && return 1 + case ${CTARGET} in + mips64*|powerpc64*|s390x*|sparc*|x86_64*) + has_multilib_profile || use multilib ;; + *-*-solaris*) use multilib ;; + *-apple-darwin*) use multilib ;; + *) false ;; + esac +} + +is_cxx() { + gcc-lang-supported 'c++' || return 1 + ! use nocxx +} + +is_d() { + gcc-lang-supported d || return 1 + use d +} + +is_f77() { + gcc-lang-supported f77 || return 1 + use fortran +} + +is_f95() { + gcc-lang-supported f95 || return 1 + use fortran +} + +is_fortran() { + gcc-lang-supported fortran || return 1 + use fortran +} + +is_gcj() { + gcc-lang-supported java || return 1 + use gcj +} + +is_libffi() { + has libffi ${IUSE} || return 1 + use libffi +} + +is_objc() { + gcc-lang-supported objc || return 1 + use objc +} + +is_objcxx() { + gcc-lang-supported 'obj-c++' || return 1 + use objc++ +} + +is_ada() { + gcc-lang-supported ada || return 1 + use ada +} + +is_treelang() { + has boundschecking ${IUSE} && use boundschecking && return 1 #260532 + is_crosscompile && return 1 #199924 + gcc-lang-supported treelang || return 1 + #use treelang + return 0 +} diff --git a/mail-mta/exim/Manifest b/mail-mta/exim/Manifest new file mode 100644 index 0000000..15be843 --- /dev/null +++ b/mail-mta/exim/Manifest @@ -0,0 +1,23 @@ +AUX auth_conf.sub 790 BLAKE2B 28ad6e3b494396c0bd42e7ac13de9e8e3cbd553f3e78e787925e0c08b6896e479da495b94b511e739cbe31fc3ab3e6948373b566db5c9aeb3cd46cb52109ba31 SHA512 c0799a44e0fabdd4eb33c9c4a009c7abed80d5b2ab773206b11d644e54bb79004c5741fc510df77fe9856bdff979a14f1cf9a58da19fb00aaae05c623da287b3 +AUX exim-4.14-tail.patch 446 BLAKE2B 62e46f052c6d958246570c40ed67819f67c4a4ee74fbfe3c82c6f8494ef98ab65089845dd89ffc01516a0c861d9003ade5e4d67476cb34185d27b99cf233dd86 SHA512 a0365b15f0a48076f9660ebc424d48f68995ac21bbf77f407bdca5103ca65758d7f2241d0151eb5c78476557e240b24a95c23d3b12cfffc1b34ab6f89f2c2110 +AUX exim-4.20-maildir.patch 478 BLAKE2B 60feb354143a35631c3a71e46410e069d67cb7eab6643e6b2d4f4cfc15b497b96bb8f69a02ec67c3a6294f4d3c1da9e0787ca996f140713a19ecbcacc8ce0d4d SHA512 2c6f68e3c162a51e62ce6e391db8e79733f11bba20cc8778737650158203b88f9a77b7bbbd2a32b2cf8ae50f039b794fb0996f198acec6a50b94cad6a111f432 +AUX exim-4.69-r1.27021.patch 1447 BLAKE2B d1f40f68b056ae49cd78408d3dc54a1f4fb1584fec003c68645c8a7245499ef96c1bc3af8aac57d31ee10cb0d4ff2808a50bf35bb36f17df929b2c24abed90e2 SHA512 45a5b833c698da4690485716c7c45d762a9194d5ae41514028bbad548bbd44373cf7a3a3c6a1c4f635f3f50d1695ac7ead098bf8be15cd1f691c7cc6c7f8d715 +AUX exim-4.74-radius-db-ENV-clash.patch 667 BLAKE2B 3cc03dd925333774c08484efbb5daadcebc819cc49283205960146f176d225c8952dacb891e1a1be13046bb68e6d6571a732dbbb7d78c6b1758d93f256e41509 SHA512 040bbdb2259df882569a428b7fef03f89c3685428654ac29e93360a4791bdabe66e52d33d14f0822461fac119295bd31aad5998f63d59d4af057bd26b310a568 +AUX exim-4.76-crosscompile.patch 462 BLAKE2B de78322f93760cef0d5a768b8be6c723f00d5c7557da6189ffa6ee34215c41ebe8896a2457b2e6a704d05a1730eab09c8cc73e3ba3140954f9ac32423210b612 SHA512 d4fd4417c1ce727f139999c399795312cdbbb9735d0793d68f8e3150240bc53b31277cb26f9946ba549b34c661fc0a61147d376bda09aa6763cab55d80d62343 +AUX exim-4.93-CVE-2020-12783.patch 2469 BLAKE2B b4a98d5d5c45756ea8da01cb18bae40b6d242076557e80cc79dfd2d3d21b96f9860c2a6b17433a849e631504b8669a281b1ae3d0a67f6d599b631df03e54a630 SHA512 5efc5fb8375cdd560d8efe414094751c875a3dd363c93d8228248440e3c269348d54e039c52d311113d2a62a8d0016d1ad0e44314350ea6a5e3c59a9d66af58a +AUX exim-4.93-as-needed-ldflags.patch 6013 BLAKE2B 2de473f089a36cabd5481020524dcb2efb7a5681b224608a8454aebc70e07f7776fe812f02fa5d81fb80b25bc2cc154924953d173d65664b1e576176a01191b9 SHA512 df6c18a7d092d9069dd6d4177154681197de86ab41dbd399055ad663cbd0c7da149f8bbcb7c888965851475ee2cf891dc934f1d5ad7a4ea3dc46a54ece582418 +AUX exim-4.93-fno-common.patch 767 BLAKE2B cd66b56d88badd97c1d081c3458adf294352b9f34dc0faee820d75ed4b97be8a5f313c4ba46ea08d4c3ba4744badf3759393bea1455a3e7fc04d80939d5ec49e SHA512 5fc5cab9091296e0bc7665e9e08f5232decef4585c7504abab104a8a7cf1c69aee4f535f1e1214b94aeb856b8f5620c42608f35e7c7ff26667de88a8719bd301 +AUX exim-4.93-localscan_dlopen.patch 9585 BLAKE2B 02b11e75c94d70a787973e89dc329fc006b263d4411ccfb177acf596fd3832cc471004394cf126a9299b62113dc25fcf61bff9bb63d39c19f60ca7203c732be3 SHA512 5de142c1da26cd60e9e05de25e7c7de1f338591b3d73ea9ff151dc446ca45a2361841a28776e9680e77183f2071a7cac68063d5f83e79257b7b4a4884e1e9110 +AUX exim-4.93-radius.patch 2791 BLAKE2B 94edcc141e9ed4b8f669298fc9af5e2fdc2835488567917721c7061835e7d7980c3944cb21b2cdb46041be7e8f93d57fc4d26cda0aa9583b98a594ee6c11260a SHA512 8393bddb5f85879e6fb3e4a8272df8583d99600f5ef25abbcea429743e9e396248e47c2dabeba7c6178d2a4d21f82ae68cde92a50bcb9598370bd0b3d8bc220f +AUX exim-submission.socket 161 BLAKE2B 409a5a687897af369a6a2ff0c30564096cc6b308dbc5d0afb6742df44d2aa972e45bad9681d2cb72be9731b260d23fdadb80bae644e7b875af5e34e9c8b8b40f SHA512 4a233761793e3510e9efa5aad3a6098c41b757f13133a7ea825680f2b393aba8d7935f16bf1dd065dde884fe7ba45639a8d398333a7d9bf0a6b72f88c8f2a09d +AUX exim-submission_at.service 360 BLAKE2B 9ebcac1ab0f01a8264141843a4e711d77f634bdd910406bd466a0c197fdad8a9ff4bc31b9b28ef73c810aaff3e549eb60c0a2546507910dfc800da154eb1da00 SHA512 dc28698f15e8eaa4614ae81fc8cb76d92fed1110ce02f7a6ee8feace418dbb194711eb2d4dd444cf818628c11721e21d80b7b974879ab6ddd78cc717cce17c2f +AUX exim.confd 141 BLAKE2B bc200e6121544d17e7feb0e162b5f6a5157647c3323492218da1556a19f3a2febf89a698e157a6dc657540d2f46088a9b1e34700655c715fbeaf0c201bc4aa9f SHA512 cb5e4aa71d3f0b7945e9806064f6a3ab64cb894381654ead40c73a49ae2d1bbb3dc587919952a09b2c81b9fcf8784f73d59c12081cda96a5b7210442f5088998 +AUX exim.logrotate 116 BLAKE2B c3689e95e31ccaaaca70e43ff8dbe3e69105da2266e701b57673fa90ee1cdf8c55be0fa2010ad9c10b2fba5443d6303584411bfe56198695995b5491efcfd8de SHA512 24bb8dcfadb1204c2ab0316d57de287b5092754731949390cfb3c88fa6827d45acfe1048cf9e26f615ca0449e8d780d0c98ea55ed61be9d1558755d3e53b9ec8 +AUX exim.rc10 1135 BLAKE2B abc7247ee8171069f30f954d9e4275fa85f09f5488a372f9c4f7fd6cf16247dce6bd306d0a8631185cd1afb92ca8919301bf5f21aa3fcac5929a715b9abec510 SHA512 5c7cee6139145983c62df8f5ef6c401d34d2eb7eae3146c28045129ba40868ca4d3d10d4b7056887cf4d4d8a83271592f7fa0a527663f727fa8694b621eb5624 +AUX exim.service 229 BLAKE2B 6d6396ef98b8e7c4fcfa28e24223bd58393387abedfb960284dfd1a297d1612deea6b77e2affeca8c5ff6f7db3eb32717893ed0dc1eaf3525e6969520e8589a3 SHA512 a071e9fb74b5fc2fdf0c73ad64ddfbc3954d8f7095d6a363dacf8c75d72a479fbf6821822ec5c8f3846d7687342e1bd447b97f91ca7b0582e5c98008aac30cca +AUX exim.socket 139 BLAKE2B bb8281a98fdac1b52031d5250fd1e658bf5a2c32e24b49ed0daa857d0d32285abf6db23c3d717992c43443ab4bcd97a19ec3811f182200a2d99a48ced6cfb6bc SHA512 db621116907ceb573e6f34581f47c91f751bff593054d7ddc32397b34c7f2405bec184bdb0589d2ac457fa3a61bcba072761e3a6293a99c9c764d2d9fd6069ae +AUX exim_at.service 140 BLAKE2B 8624f4a555e2acdc7aaf917952c4152ad00dc063a51076aefa1d023d47d5f7fe8b268f3308734f363ed9628cd8551ccac7fc369657e0fdf65507d2e6419f704c SHA512 11c8133ee15b3e5193c9b1c59aed66c81b6e045dd23310bede9fcde6c88905db5ef08afdb798b53b75a7465915ea1247e980edf95db07a7f9b7bb58ce95fbb5a +DIST exim-4.93.0.4.tar.xz 1804696 BLAKE2B 721336101104d9c71b3bb6f432e382c28ad17d80cdb50d04213989e65a719d906caf8eb95639bfaf7a1bfdd62c7000d9df14484953446ecfca901fd7c708514e SHA512 84951849b69399d6f187d2801760dc0cb9e61c88c7c88aaca4e07e48120199a6be94b2236d058ffeacb8d611dd84056b610d480353c301a3ad5799768dd39d96 +DIST system_filter.exim.gz 3075 BLAKE2B d05e872b5cef377d29126cda03fc0a74c8777b2119b76ff43da6e8de808035eb9bfcb034a85d81824f135d484e864bfc0629fc1af2c228a7277d5ee7cf9cde79 SHA512 cb358d3ce2499a0bb5920d962a06f2af8486e55ec90c8c928bd8e3aefb279aa57f5f960d5adfcef68bd94110b405eaa144e9629cfe6014a529c79c544600bbf3 +EBUILD exim-4.93.0.4-r2.ebuild 13860 BLAKE2B 2c9c6e46b73cad9842e489883aec9b7b920e327931de85731c72d2943e84e44819b15f55a34cbbe596364b32118f03bedbcce05b516aff99d448697f63386408 SHA512 4a56d5b762de7d2f0fe09fd60a99f88851225012c05340ba6ade1228e63c2ef95043db1ec71bf2d588812b91f6ae1eeb39accb25dc9f5b179c5a88dddcfdfdc2 +MISC metadata.xml 2457 BLAKE2B c1dcbaedd069b41c4cfb190806b44014229d53cf6d6f72e04b99dc91f223567cb4f30100792aae72658780da0579fa26e6fb8a0266565bcc0c307996d59ac3ed SHA512 9044abccd15525c7676fc218b62d9b663bd155482894eced9c0cfc8a22e8cd7353009adc75a9f3de15b14f267e6ee6b4f4c91d8bd9260931c0b9de6bf48c762f diff --git a/mail-mta/exim/exim-4.93.0.4-r2.ebuild b/mail-mta/exim/exim-4.93.0.4-r2.ebuild new file mode 100644 index 0000000..9b3a991 --- /dev/null +++ b/mail-mta/exim/exim-4.93.0.4-r2.ebuild @@ -0,0 +1,590 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +inherit db-use toolchain-funcs multilib pam systemd + +IUSE="arc +dane dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn elibc_glibc exiscan-acl gnutls idn ipv6 ldap lmtp maildir mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl selinux spf sqlite srs +ssl syslog tcpd +tpda X" +REQUIRED_USE=" + arc? ( dkim spf ) + dane? ( ssl !gnutls ) + dmarc? ( dkim spf ) + dkim? ( ssl !gnutls ) + gnutls? ( ssl ) + pkcs11? ( ssl ) + spf? ( exiscan-acl ) + srs? ( exiscan-acl ) +" +# NOTE on USE="gnutls dane", gnutls[dane] is masked in base, unmasked +# for x86 and amd64 only, due to this, repoman won't allow depending on +# gnutls[dane] for all else. Because we cannot express USE=dane when +# USE=gnutls is in effect only in package.use.mask, the only option we +# have left is to a) ignore the dependency (but that results in bug +# #661164) or b) mask the usage of USE=dane with USE=gnutls. Both are +# incorrect, but b) is the only "correct" view from repoman. + +SDIR=$([[ ${PV} == *_rc* ]] && echo /test + [[ ${PV} == *.*.*.* ]] && echo /fixes) +COMM_URI="https://downloads.exim.org/exim4${SDIR}" + +DESCRIPTION="A highly configurable, drop-in replacement for sendmail" +SRC_URI="${COMM_URI}/${P//rc/RC}.tar.xz + mirror://gentoo/system_filter.exim.gz" +HOMEPAGE="https://www.exim.org/" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ppc ppc64 sparc x86 ~x86-solaris" + +COMMON_DEPEND=">=sys-apps/sed-4.0.5 + ( >=sys-libs/db-3.2:= =net-nds/openldap-2.0.7 ) + nis? ( + elibc_glibc? ( + net-libs/libtirpc + >=net-libs/libnsl-1:= + ) + ) + mysql? ( dev-db/mysql-connector-c:= ) + postgres? ( dev-db/postgresql:= ) + sasl? ( >=dev-libs/cyrus-sasl-2.1.26-r2 ) + redis? ( dev-libs/hiredis ) + spf? ( >=mail-filter/libspf2-1.2.5-r1 ) + dmarc? ( mail-filter/opendmarc ) + srs? ( mail-filter/libsrs_alt ) + X? ( + x11-libs/libX11 + x11-libs/libXmu + x11-libs/libXt + x11-libs/libXaw + ) + sqlite? ( dev-db/sqlite ) + radius? ( net-dialup/freeradius-client ) + virtual/libiconv + elibc_glibc? ( net-libs/libnsl ) + " + # added X check for #57206 +BDEPEND="virtual/pkgconfig" +DEPEND="${COMMON_DEPEND}" +RDEPEND="${COMMON_DEPEND} + !mail-mta/courier + !mail-mta/esmtp + !mail-mta/mini-qmail + !=mail-mta/msmtp-1.4.19-r1[mta] + !mail-mta/netqmail + !mail-mta/nullmailer + !mail-mta/postfix + !mail-mta/qmail-ldap + !mail-mta/sendmail + !mail-mta/opensmtpd + !=mail-mta/ssmtp-2.64-r2[mta] + !net-mail/mailwrapper + >=net-mail/mailbase-0.00-r5 + virtual/logger + dcc? ( mail-filter/dcc ) + selinux? ( sec-policy/selinux-exim ) + " + +S=${WORKDIR}/${P//rc/RC} + +src_prepare() { + # Legacy patches which need a respin for -p1 + eapply -p0 "${FILESDIR}"/exim-4.14-tail.patch + eapply -p0 "${FILESDIR}"/exim-4.74-radius-db-ENV-clash.patch # 287426 + eapply "${FILESDIR}"/exim-4.93-as-needed-ldflags.patch # 352265, 391279 + eapply -p0 "${FILESDIR}"/exim-4.76-crosscompile.patch # 266591 + eapply "${FILESDIR}"/exim-4.69-r1.27021.patch + eapply "${FILESDIR}"/exim-4.93-localscan_dlopen.patch + eapply -p2 "${FILESDIR}"/exim-4.93-radius.patch # 720364 + eapply "${FILESDIR}"/exim-4.93-CVE-2020-12783.patch # 722484 + eapply "${FILESDIR}"/exim-4.93-fno-common.patch # 723430 + + if use maildir ; then + eapply "${FILESDIR}"/exim-4.20-maildir.patch + else + eapply -p0 "${FILESDIR}"/exim-4.80-spool-mail-group.patch # 438606 + fi + + eapply_user + + # user Exim believes it should be + MAILUSER=mail + MAILGROUP=mail + if use prefix && [[ ${EUID} != 0 ]] ; then + MAILUSER=$(id -un) + MAILGROUP=$(id -gn) + fi +} + +src_configure() { + # general config and paths + + local aliases="${EPREFIX}/etc/mail/aliases" + sed -i \ + -e "/SYSTEM_ALIASES_FILE/s'SYSTEM_ALIASES_FILE'${aliases}'" \ + src/configure.default || die + + sed -i -e 's/^buildname=.*/buildname=exim-gentoo/' Makefile || die + + if use elibc_musl; then + sed -i -e 's/^LIBS = -lnsl/LIBS =/g' OS/Makefile-Linux || die + fi + + local conffile="${EPREFIX}/etc/exim/exim.conf" + sed -e "48i\CFLAGS=${CFLAGS}" \ + -e "s:BIN_DIRECTORY=/usr/exim/bin:BIN_DIRECTORY=${EPREFIX}/usr/sbin:" \ + -e "s;EXIM_USER=;EXIM_USER=ref:${MAILUSER};" \ + -e "s:CONFIGURE_FILE=.*$:CONFIGURE_FILE=${conffile}:" \ + -e "s:ZCAT_COMMAND=.*$:ZCAT_COMMAND=${EPREFIX}/bin/zcat:" \ + -e "s:COMPRESS_COMMAND=.*$:COMPRESS_COMMAND=${EPREFIX}/bin/gzip:" \ + src/EDITME > Local/Makefile || die + + # work on Local/Makefile from now on + cd Local + + cat >> Makefile <<- EOC + INFO_DIRECTORY=${EPREFIX}/usr/share/info + PID_FILE_PATH=${EPREFIX}/run/exim.pid + SPOOL_DIRECTORY=${EPREFIX}/var/spool/exim + HAVE_ICONV=yes + EOC + + # if we use libiconv, now is the time to tell so + if use !elibc_glibc && use !elibc_musl ; then + cat >> Makefile <<- EOC + EXTRALIBS_EXIM=-liconv + EOC + fi + + # support for IPv6 + if use ipv6; then + cat >> Makefile <<- EOC + HAVE_IPV6=YES + EOC + fi + + # support i18n/IDNA + if use idn; then + cat >> Makefile <<- EOC + SUPPORT_I18N=yes + SUPPORT_I18N_2008=yes + EXTRALIBS_EXIM += -lidn -lidn2 + EOC + fi + + # + # mail storage formats + # + + # mailstore is Exim's traditional storage format + cat >> Makefile <<- EOC + SUPPORT_MAILSTORE=yes + EOC + + # mbox + if use mbx; then + cat >> Makefile <<- EOC + SUPPORT_MBX=yes + EOC + fi + + # maildir + if use maildir; then + cat >> Makefile <<- EOC + SUPPORT_MAILDIR=yes + EOC + fi + + # + # lookup methods + + # use the "native" interfaces to the DBM and CDB libraries, support + # passwd and directory lookups by default + local DB_VERS="5.3 5.1 4.8 4.7 4.6 4.5 4.4 4.3 4.2 3.2" + cat >> Makefile <<- EOC + USE_DB=yes + LOOKUP_CDB=yes + LOOKUP_PASSWD=yes + LOOKUP_DSEARCH=yes + # keep include in CFLAGS because exim.h -> dbstuff.h -> db.h + CFLAGS += -I$(db_includedir ${DB_VERS}) + DBMLIB = -l$(db_libname ${DB_VERS}) + EOC + + if ! use dnsdb; then + # DNSDB lookup is enabled by default + sed -i -e 's:^LOOKUP_DNSDB=yes:# LOOKUP_DNSDB=yes:' Makefile || die + fi + + if use ldap; then + cat >> Makefile <<- EOC + LOOKUP_LDAP=yes + LDAP_LIB_TYPE=OPENLDAP2 + LOOKUP_INCLUDE += -I"${EPREFIX}"/usr/include/ldap + LOOKUP_LIBS += -lldap -llber + EOC + fi + + if use mysql; then + cat >> Makefile <<- EOC + LOOKUP_MYSQL=yes + LOOKUP_INCLUDE += $(mysql_config --include) + LOOKUP_LIBS += $(mysql_config --libs) + EOC + fi + + if use nis; then + cat >> Makefile <<- EOC + LOOKUP_NIS=yes + LOOKUP_NISPLUS=yes + EOC + if use elibc_glibc ; then + cat >> Makefile <<- EOC + LOOKUP_INCLUDE += -I"${EPREFIX}"/usr/include/tirpc + LOOKUP_LIBS += -lnsl + EOC + fi + fi + + if use postgres; then + cat >> Makefile <<- EOC + LOOKUP_PGSQL=yes + LOOKUP_INCLUDE += -I$(pg_config --includedir) + LOOKUP_LIBS += -L$(pg_config --libdir) -lpq + EOC + fi + + if use sqlite; then + cat >> Makefile <<- EOC + LOOKUP_SQLITE=yes + LOOKUP_SQLITE_PC=sqlite3 + EOC + fi + + if use redis; then + cat >> Makefile <<- EOC + LOOKUP_REDIS=yes + LOOKUP_LIBS += -lhiredis + EOC + fi + + # Exim monitor, enabled by default, controlled via X USE-flag, + # disable if not requested, bug #46778 + if use X; then + cp ../exim_monitor/EDITME eximon.conf || die + cat >> Makefile <<- EOC + EXIM_MONITOR=eximon.bin + EOC + fi + + # + # features + # + + # content scanning support + if use exiscan-acl; then + cat >> Makefile <<- EOC + WITH_CONTENT_SCAN=yes + EOC + fi + + # DomainKeys Identified Mail, RFC4871 + if ! use dkim; then + # DKIM is enabled by default + cat >> Makefile <<- EOC + DISABLE_DKIM=yes + EOC + fi + + # Per-Recipient-Data-Response + if ! use prdr; then + # PRDR is enabled by default + cat >> Makefile <<- EOC + DISABLE_PRDR=yes + EOC + fi + + # Transport post-delivery actions + if use !tpda && use !dane; then + # EVENT is enabled by default + cat >> Makefile <<- EOC + DISABLE_EVENT=yes + EOC + fi + + # log to syslog + if use syslog; then + local eximlog="${EPREFIX}/var/log/exim/exim_%s.log" + sed -i \ + -e "s:LOG_FILE_PATH=${eximlog}:LOG_FILE_PATH=syslog:" \ + Makefile || die + cat >> Makefile <<- EOC + LOG_FILE_PATH=syslog + EOC + else + cat >> Makefile <<- EOC + LOG_FILE_PATH=${EPREFIX}/var/log/exim/exim_%s.log + EOC + fi + + # starttls support (ssl) + if use ssl; then + if use gnutls; then + echo "USE_GNUTLS=yes" >> Makefile + echo "USE_GNUTLS_PC=gnutls $(use dane && echo gnutls-dane)" \ + >> Makefile + use pkcs11 || echo "AVOID_GNUTLS_PKCS11=yes" >> Makefile + else + echo "USE_OPENSSL=yes" >> Makefile + echo "USE_OPENSSL_PC=openssl" >> Makefile + fi + else + echo "DISABLE_TLS=yes" >> Makefile + fi + + # TCP wrappers + if use tcpd; then + cat >> Makefile <<- EOC + USE_TCP_WRAPPERS=yes + EXTRALIBS_EXIM += -lwrap + EOC + fi + + # Light Mail Transport Protocol + if use lmtp; then + cat >> Makefile <<- EOC + TRANSPORT_LMTP=yes + EOC + fi + + # embedded Perl + if use perl; then + cat >> Makefile <<- EOC + EXIM_PERL=perl.o + EOC + fi + + # dlfunc + if use dlfunc; then + cat >> Makefile <<- EOC + EXPAND_DLFUNC=yes + HAVE_LOCAL_SCAN=yes + DLOPEN_LOCAL_SCAN=yes + EOC + fi + + # Proxy Protocol + if use proxy; then + cat >> Makefile <<- EOC + SUPPORT_PROXY=yes + EOC + fi + + # DANE + if use !dane; then + # DANE is enabled by default + sed -i -e 's:^SUPPORT_DANE=yes:# SUPPORT_DANE=yes:' Makefile || die + fi + + # DMARC + if use dmarc; then + cat >> Makefile <<- EOC + SUPPORT_DMARC=yes + EXTRALIBS_EXIM += -lopendmarc + EOC + fi + + # Sender Policy Framework + if use spf; then + cat >> Makefile <<- EOC + SUPPORT_SPF=yes + EXTRALIBS_EXIM += -lspf2 + EOC + fi + + # + # experimental features + # + + # Authenticated Receive Chain + if use arc; then + echo "EXPERIMENTAL_ARC=yes">> Makefile + fi + + # Distributed Checksum Clearinghouse + if use dcc; then + echo "EXPERIMENTAL_DCC=yes">> Makefile + fi + + # Sender Rewriting Scheme + if use srs; then + cat >> Makefile <<- EOC + EXPERIMENTAL_SRS=yes + EXTRALIBS_EXIM += -lsrs_alt + EOC + fi + + # Delivery Sender Notifications extra information in fail message + if use dsn; then + cat >> Makefile <<- EOC + EXPERIMENTAL_DSN_INFO=yes + EOC + fi + + # + # authentication (SMTP AUTH) + # + + # standard bits + cat >> Makefile <<- EOC + AUTH_SPA=yes + AUTH_CRAM_MD5=yes + AUTH_PLAINTEXT=yes + EOC + + # Cyrus SASL + if use sasl; then + cat >> Makefile <<- EOC + CYRUS_SASLAUTHD_SOCKET=${EPREFIX}/run/saslauthd/mux + AUTH_CYRUS_SASL=yes + AUTH_LIBS += -lsasl2 + EOC + fi + + # Dovecot + if use dovecot-sasl; then + cat >> Makefile <<- EOC + AUTH_DOVECOT=yes + EOC + fi + + # Pluggable Authentication Modules + if use pam; then + cat >> Makefile <<- EOC + SUPPORT_PAM=yes + AUTH_LIBS += -lpam + EOC + fi + + # Radius + if use radius; then + cat >> Makefile <<- EOC + RADIUS_CONFIG_FILE=${EPREFIX}/etc/radiusclient/radiusclient.conf + RADIUS_LIB_TYPE=RADIUSCLIENTNEW + AUTH_LIBS += -lfreeradius-client + EOC + fi +} + +src_compile() { + emake CC="$(tc-getCC)" HOSTCC="$(tc-getBUILD_CC)" \ + AR="$(tc-getAR) cq" RANLIB="$(tc-getRANLIB)" FULLECHO='' +} + +src_install() { + cd "${S}"/build-exim-gentoo || die + dosbin exim + if use X; then + dosbin eximon.bin + dosbin eximon + fi + fperms 4755 /usr/sbin/exim + + dosym exim /usr/sbin/sendmail + dosym exim /usr/sbin/rsmtp + dosym exim /usr/sbin/rmail + dosym ../sbin/exim /usr/bin/mailq + dosym ../sbin/exim /usr/bin/newaliases + dosym ../sbin/sendmail /usr/lib/sendmail + + for i in exicyclog exim_dbmbuild exim_dumpdb exim_fixdb exim_lock \ + exim_tidydb exinext exiwhat exigrep eximstats exiqsumm exiqgrep \ + convert4r3 convert4r4 exipick + do + dosbin $i + done + + dodoc -r "${S}"/doc/. + doman "${S}"/doc/exim.8 + use dsn && dodoc "${S}"/README.DSN + + # conf files + insinto /etc/exim + newins "${S}"/src/configure.default exim.conf.dist + if use exiscan-acl; then + newins "${S}"/src/configure.default exim.conf.exiscan-acl + fi + doins "${WORKDIR}"/system_filter.exim + doins "${FILESDIR}"/auth_conf.sub + + if use pam; then + pamd_mimic system-auth exim auth account + fi + + # headers, #436406 + if use dlfunc ; then + # fixup includes so they actually can be found when including + sed -i \ + -e '/#include "\(config\|store\|mytypes\).h"/s:"\(.\+\)"::' \ + local_scan.h || die + insinto /usr/include/exim + doins {config,local_scan}.h ../src/{mytypes,store}.h + fi + + insinto /etc/logrotate.d + newins "${FILESDIR}/exim.logrotate" exim + + newinitd "${FILESDIR}"/exim.rc10 exim + newconfd "${FILESDIR}"/exim.confd exim + + systemd_dounit \ + "${FILESDIR}"/{exim.service,exim.socket,exim-submission.socket} + systemd_newunit \ + "${FILESDIR}"/exim_at.service 'exim@.service' + systemd_newunit \ + "${FILESDIR}"/exim-submission_at.service 'exim-submission@.service' + + diropts -m 0750 -o ${MAILUSER} -g ${MAILGROUP} + keepdir /var/log/${PN} +} + +pkg_postinst() { + if [[ ! -f ${EROOT}/etc/exim/exim.conf ]] ; then + einfo "${EROOT}/etc/exim/system_filter.exim is a sample system_filter." + einfo "${EROOT}/etc/exim/auth_conf.sub contains the configuration sub" + einfo "for using smtp auth." + einfo "Please create ${EROOT}/etc/exim/exim.conf from" + einfo " ${EROOT}/etc/exim/exim.conf.dist." + fi + if use dmarc ; then + einfo "DMARC support requires ${EROOT}/etc/exim/opendmarc.tlds" + einfo "you can populate this file with the contents downloaded from" + einfo " https://publicsuffix.org/list/public_suffix_list.dat" + fi + if use dcc ; then + einfo "DCC support is experimental, you can find some limited" + einfo "documentation at the bottom of this prerelease message:" + einfo " http://article.gmane.org/gmane.mail.exim.devel/3579" + fi + use srs && einfo "SRS support is experimental" + use dsn && einfo "extra information in fail DSN message is experimental" + elog "The obsolete acl condition 'demime' is removed, the replacements" + elog "are the ACLs acl_smtp_mime and acl_not_smtp_mime" +} diff --git a/mail-mta/exim/files/auth_conf.sub b/mail-mta/exim/files/auth_conf.sub new file mode 100644 index 0000000..24434a7 --- /dev/null +++ b/mail-mta/exim/files/auth_conf.sub @@ -0,0 +1,25 @@ +###################################################################### +# AUTHENTICATION CONFIGURATION # +###################################################################### +# If you're using PAM to authenticate, lifes real simple. +# This plain directive works for nearly everything except windows MUA's the +# login directive will allow you to authenticate your Outlook 2000 and +# outlook express clients. + + + +plain: + driver = plaintext + public_name = PLAIN + server_condition = "${if pam{$2:$3}{1}{0}}" + server_set_id = $2 + +login: + driver = plaintext + public_name = LOGIN + server_prompts = "Username:: : Password::" + server_condition = "${if pam{$1:${sg{$2}{:}{::}}}{1}{0}}" + server_set_id = $1 +# +# FIXME +# Need to add authenticator for SPA!! diff --git a/mail-mta/exim/files/exim-4.14-tail.patch b/mail-mta/exim/files/exim-4.14-tail.patch new file mode 100644 index 0000000..481dca9 --- /dev/null +++ b/mail-mta/exim/files/exim-4.14-tail.patch @@ -0,0 +1,11 @@ +--- scripts/Configure-config.h.orig 2003-07-17 18:01:19.000000000 -0400 ++++ scripts/Configure-config.h 2003-07-17 18:01:25.000000000 -0400 +@@ -41,7 +41,7 @@ + + # Double-check that config.h is complete. + +-if [ "`tail -1 config.h`" != "/* End of config.h */" ] ; then ++if [ "`tail -n 1 config.h`" != "/* End of config.h */" ] ; then + echo "*** config.h appears to be incomplete" + echo "*** unexpected failure in buildconfig program" + exit 1 diff --git a/mail-mta/exim/files/exim-4.20-maildir.patch b/mail-mta/exim/files/exim-4.20-maildir.patch new file mode 100644 index 0000000..3cb198d --- /dev/null +++ b/mail-mta/exim/files/exim-4.20-maildir.patch @@ -0,0 +1,14 @@ +diff -urN ./exim-4.20.orig/src/configure.default exim-4.20/src/configure.default +--- ./exim-4.20.orig/src/configure.default 2003-06-27 16:48:22.000000000 -0700 ++++ exim-4.20/src/configure.default 2003-06-27 16:52:20.000000000 -0700 +@@ -451,7 +451,9 @@ + + local_delivery: + driver = appendfile +- file = /var/mail/$local_part ++# file = /var/mail/$local_part ++ directory = /home/$local_part/.maildir ++ maildir_format + delivery_date_add + envelope_to_add + return_path_add diff --git a/mail-mta/exim/files/exim-4.69-r1.27021.patch b/mail-mta/exim/files/exim-4.69-r1.27021.patch new file mode 100644 index 0000000..804e16d --- /dev/null +++ b/mail-mta/exim/files/exim-4.69-r1.27021.patch @@ -0,0 +1,48 @@ +diff -urN exim-4.69.orig/src/configure.default exim-4.69/src/configure.default +--- exim-4.69.orig/src/configure.default 2008-05-05 10:17:44.000000000 +0100 ++++ exim-4.69/src/configure.default 2008-05-05 10:18:26.000000000 +0100 +@@ -592,6 +592,22 @@ + pipe_transport = address_pipe + reply_transport = address_reply + ++# This router runs procmail if users have a .procmailrc file ++procmail: ++ check_local_user ++ driver = accept ++ transport = procmail_pipe ++ require_files = ${local_part}:+${home}:+${home}/.procmailrc:+/usr/bin/procmail ++ no_verify ++ ++# This router runs maildrop if users have a .mailfilter file ++maildrop: ++ check_local_user ++ driver = accept ++ transport = maildrop_pipe ++ require_files = ${local_part}:+${home}:+${home}/.mailfilter:+/usr/bin/maildrop ++ no_verify ++ + + # This router matches local user mailboxes. If the router fails, the error + # message is "Unknown user". +@@ -676,6 +692,21 @@ + address_reply: + driver = autoreply + ++# This transport is used for procmail ++procmail_pipe: ++ driver = pipe ++ command = "/usr/bin/procmail -d ${local_part}" ++ return_path_add ++ delivery_date_add ++ envelope_to_add ++ ++# This transport is used for courier-maildrop filtering (Maildir filter system) ++maildrop_pipe: ++ driver = pipe ++ command = "/usr/bin/maildrop -d ${local_part}" ++ return_path_add ++ delivery_date_add ++ envelope_to_add + + + ###################################################################### diff --git a/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch b/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch new file mode 100644 index 0000000..247668e --- /dev/null +++ b/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch @@ -0,0 +1,22 @@ +Nasty workaround for +http://bugs.gentoo.org/show_bug.cgi?id=287426 + +--- src/auths/call_radius.c ++++ src/auths/call_radius.c +@@ -10,6 +10,16 @@ + /* This file was originally supplied by Ian Kirk. The libradius support came + from Alex Kiernan. */ + ++/* ugly hack to work around redefinition of ENV by radiusclient.h and ++ * db.h: define _DB_H_ so the db.h include thinks it's already included, ++ * we can get away with it like this, since this file doesn't use any db ++ * functions. */ ++#ifndef _DB_H_ ++#define _DB_H_ 1 ++#define _DB_EXT_PROT_IN_ 1 ++#define DB void ++#endif ++ + #include "../exim.h" + + /* This module contains functions that call the Radius authentication diff --git a/mail-mta/exim/files/exim-4.76-crosscompile.patch b/mail-mta/exim/files/exim-4.76-crosscompile.patch new file mode 100644 index 0000000..cf47ade --- /dev/null +++ b/mail-mta/exim/files/exim-4.76-crosscompile.patch @@ -0,0 +1,15 @@ +https://bugs.gentoo.org/show_bug.cgi?id=266591 + +--- OS/Makefile-Base ++++ OS/Makefile-Base +@@ -114,8 +114,8 @@ + + # Targets for special-purpose configuration header builders + buildconfig: buildconfig.c +- @echo "$(CC) buildconfig.c" +- $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS) ++ @echo "$(HOSTCC) buildconfig.c" ++ $(FE)$(HOSTCC) $(HOSTCFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS) + + + # Target for the exicyclog utility script diff --git a/mail-mta/exim/files/exim-4.93-CVE-2020-12783.patch b/mail-mta/exim/files/exim-4.93-CVE-2020-12783.patch new file mode 100644 index 0000000..c957d55 --- /dev/null +++ b/mail-mta/exim/files/exim-4.93-CVE-2020-12783.patch @@ -0,0 +1,83 @@ +auths/spa: fix for CVE-2020-12783 + +This is a combined patch of git commits: + +57aa14b216432be381b6295c312065b2fd034f86 +a04174dc2a84ae1008c23b6a7109e7fa3fb7b8b0 + +leaving out whitespace noise for a smaller patch +and made it apply to the 4.93 release + +modified paths because Exim dists differ in layout from the git repo + +Fix SPA authenticator, checking client-supplied data before using it. Bug 2571 +Rework SPA fix to avoid overflows. Bug 2571 + + +--- a/src/auths/auth-spa.c ++++ b/src/auths/auth-spa.c +@@ -405,7 +405,7 @@ int + /* base 64 to raw bytes in quasi-big-endian order, returning count of bytes */ + { + int len = 0; +- register uschar digit1, digit2, digit3, digit4; ++ uschar digit1, digit2, digit3, digit4; + + if (in[0] == '+' && in[1] == ' ') + in += 2; +--- a/src/auths/spa.c ++++ b/src/auths/spa.c +@@ -139,7 +139,8 @@ SPAAuthChallenge challenge; + SPAAuthResponse response; + SPAAuthResponse *responseptr = &response; + uschar msgbuf[2048]; +-uschar *clearpass; ++uschar *clearpass, *s; ++unsigned off; + + /* send a 334, MS Exchange style, and grab the client's request, + unless we already have it via an initial response. */ +@@ -194,9 +195,19 @@ that causes failure if the size of msgbuf is exceeded. ****/ + + { + int i; +- char *p = ((char*)responseptr) + IVAL(&responseptr->uUser.offset,0); ++ char * p; + int len = SVAL(&responseptr->uUser.len,0)/2; + ++ if ( (off = IVAL(&responseptr->uUser.offset,0)) >= sizeof(SPAAuthResponse) ++ || len >= sizeof(responseptr->buffer)/2 ++ || (p = (CS responseptr) + off) + len*2 >= CS (responseptr+1) ++ ) ++ { ++ DEBUG(D_auth) ++ debug_printf("auth_spa_server(): bad uUser spec in response\n"); ++ return FAIL; ++ } ++ + if (len + 1 >= sizeof(msgbuf)) return FAIL; + for (i = 0; i < len; ++i) + { +@@ -245,12 +256,16 @@ spa_smb_nt_encrypt(clearpass, challenge.challengeData, ntRespData); + + /* compare NT hash (LM may not be available) */ + +-if (memcmp(ntRespData, +- ((unsigned char*)responseptr)+IVAL(&responseptr->ntResponse.offset,0), +- 24) == 0) +- /* success. we have a winner. */ +- { ++off = IVAL(&responseptr->ntResponse.offset,0); ++if (off >= sizeof(SPAAuthResponse) - 24) ++ { ++ DEBUG(D_auth) ++ debug_printf("auth_spa_server(): bad ntRespData spec in response\n"); ++ return FAIL; ++ } ++s = (US responseptr) + off; ++ ++if (memcmp(ntRespData, s, 24) == 0) + return auth_check_serv_cond(ablock); +- } + + /* Expand server_condition as an authorization check (PH) */ diff --git a/mail-mta/exim/files/exim-4.93-as-needed-ldflags.patch b/mail-mta/exim/files/exim-4.93-as-needed-ldflags.patch new file mode 100644 index 0000000..3b3ea46 --- /dev/null +++ b/mail-mta/exim/files/exim-4.93-as-needed-ldflags.patch @@ -0,0 +1,145 @@ +https://bugs.gentoo.org/show_bug.cgi?id=352265 + +Make sure LDFLAGS comes first, such that all libraries are considered, +and not discarded when --as-needed is in effect. + +https://bugs.gentoo.org/show_bug.cgi?id=391279 + +Use LDFLAGS for all targets, not just the exim binary, such that +--as-needed works as well. + + +--- a/OS/Makefile-Base ++++ b/OS/Makefile-Base +@@ -496,12 +496,12 @@ + buildrouters buildtransports \ + $(OBJ_EXIM) version.o + @echo "$(LNCC) -o exim" +- $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \ ++ $(FE)$(PURIFY) $(LNCC) -o exim $(LDFLAGS) $(OBJ_EXIM) version.o \ + routers/routers.a transports/transports.a lookups/lookups.a \ + auths/auths.a pdkim/pdkim.a \ + $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \ + $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \ +- $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS) ++ $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LFLAGS) + @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ + echo $(STRIP_COMMAND) exim; \ + $(STRIP_COMMAND) exim; \ +@@ -517,8 +517,8 @@ + + exim_dumpdb: $(OBJ_DUMPDB) + @echo "$(LNCC) -o exim_dumpdb" +- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \ +- $(LIBS) $(EXTRALIBS) $(DBMLIB) ++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LDFLAGS) $(OBJ_DUMPDB) \ ++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS) + @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ + echo $(STRIP_COMMAND) exim_dumpdb; \ + $(STRIP_COMMAND) exim_dumpdb; \ +@@ -532,8 +532,8 @@ + + exim_fixdb: $(OBJ_FIXDB) + @echo "$(LNCC) -o exim_fixdb" +- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \ +- $(LIBS) $(EXTRALIBS) $(DBMLIB) ++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LDFLAGS) $(OBJ_FIXDB) \ ++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS) + @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ + echo $(STRIP_COMMAND) exim_fixdb; \ + $(STRIP_COMMAND) exim_fixdb; \ +@@ -547,8 +547,8 @@ + + exim_tidydb: $(OBJ_TIDYDB) + @echo "$(LNCC) -o exim_tidydb" +- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \ +- $(LIBS) $(EXTRALIBS) $(DBMLIB) ++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LDFLAGS) $(OBJ_TIDYDB) \ ++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS) + @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ + echo $(STRIP_COMMAND) exim_tidydb; \ + $(STRIP_COMMAND) exim_tidydb; \ +@@ -560,8 +560,8 @@ + + exim_dbmbuild: exim_dbmbuild.o + @echo "$(LNCC) -o exim_dbmbuild" +- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \ +- $(LIBS) $(EXTRALIBS) $(DBMLIB) ++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LDFLAGS) exim_dbmbuild.o \ ++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS) + @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ + echo $(STRIP_COMMAND) exim_dbmbuild; \ + $(STRIP_COMMAND) exim_dbmbuild; \ +@@ -575,8 +575,8 @@ + @echo "$(CC) exim_lock.c" + $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c + @echo "$(LNCC) -o exim_lock" +- $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \ +- $(LIBS) $(EXTRALIBS) ++ $(FE)$(LNCC) -o exim_lock $(LDFLAGS) exim_lock.o \ ++ $(LIBS) $(EXTRALIBS) $(LFLAGS) + @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ + echo $(STRIP_COMMAND) exim_lock; \ + $(STRIP_COMMAND) exim_lock; \ +@@ -612,9 +612,9 @@ + $(FE)$(CC) -o em_version.o -c \ + $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c + @echo "$(LNCC) -o eximon.bin" +- $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \ ++ $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LDFLAGS) $(XLFLAGS) \ + $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \ +- $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc ++ $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc $(LFLAGS) + @if [ x"$(STRIP_COMMAND)" != x"" ]; then \ + echo $(STRIP_COMMAND) eximon.bin; \ + $(STRIP_COMMAND) eximon.bin; \ +@@ -947,9 +947,9 @@ + string.o tod.o version.o utf8.o + $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c + $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c +- $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \ ++ $(LNCC) -o test_dbfn $(LDFLAGS) dbfn.o \ + dummies.o sa-globals.o sa-os.o store.o string.o \ +- tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS) ++ tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LFLAGS) + rm -f dbfn.o store.o + + test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \ +@@ -958,29 +958,29 @@ + $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c + $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c + $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c +- $(LNCC) -o test_host $(LFLAGS) \ ++ $(LNCC) -o test_host $(LDFLAGS) \ + host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \ +- tod.o tree.o $(LIBS) $(LIBRESOLV) ++ tod.o tree.o $(LIBS) $(LIBRESOLV) $(LFLAGS) + rm -f child.o dummies.o host.o dns.o + + test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o + $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c +- $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \ +- sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS) ++ $(LNCC) -o test_os $(LDFLAGS) os.o dummies.o \ ++ sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LFLAGS) + rm -f os.o + + test_parse: config.h parse.c dummies.o sa-globals.o \ + store.o string.o tod.o version.o utf8.o + $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c +- $(LNCC) -o test_parse $(LFLAGS) parse.o \ ++ $(LNCC) -o test_parse $(LDFLAGS) parse.o \ + dummies.o sa-globals.o store.o string.o tod.o version.o \ +- utf8.o $(LDFLAGS) ++ utf8.o $(LFLAGS) + rm -f parse.o + + test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o + $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c +- $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \ +- dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS) ++ $(LNCC) -o test_string $(LDFLAGS) -DSTAND_ALONE string.o \ ++ dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LFLAGS) + rm -f string.o + + # End diff --git a/mail-mta/exim/files/exim-4.93-fno-common.patch b/mail-mta/exim/files/exim-4.93-fno-common.patch new file mode 100644 index 0000000..c5fff1c --- /dev/null +++ b/mail-mta/exim/files/exim-4.93-fno-common.patch @@ -0,0 +1,16 @@ +Fix -fno-common linking + +Bug: https://bugs.gentoo.org/723430 +Bug: https://bugs.exim.org/show_bug.cgi?id=2577 + +--- exim-4.93.0.4/src/globals.h ++++ exim-4.93.0.4/src/globals.h +@@ -342,7 +342,7 @@ + extern BOOL allow_domain_literals; /* As it says */ + extern BOOL allow_mx_to_ip; /* Allow MX records to -> ip address */ + #ifdef EXPERIMENTAL_ARC +-struct arc_set *arc_received; /* highest ARC instance evaluation struct */ ++extern struct arc_set *arc_received; /* highest ARC instance evaluation struct */ + extern int arc_received_instance; /* highest ARC instance number in headers */ + extern int arc_oldest_pass; /* lowest passing instance number in headers */ + extern const uschar *arc_state; /* verification state */ diff --git a/mail-mta/exim/files/exim-4.93-localscan_dlopen.patch b/mail-mta/exim/files/exim-4.93-localscan_dlopen.patch new file mode 100644 index 0000000..0d016db --- /dev/null +++ b/mail-mta/exim/files/exim-4.93-localscan_dlopen.patch @@ -0,0 +1,269 @@ +diff -ur exim-4.92.orig/src/config.h.defaults exim-4.92/src/config.h.defaults +--- exim-4.92.orig/src/config.h.defaults 2019-01-30 14:59:52.000000000 +0100 ++++ exim-4.92/src/config.h.defaults 2019-02-16 18:17:24.547216157 +0100 +@@ -32,6 +32,8 @@ + + #define AUTH_VARS 3 + ++#define DLOPEN_LOCAL_SCAN ++ + #define BIN_DIRECTORY + + #define CONFIGURE_FILE +Only in exim-4.92/src: config.h.defaults.orig +diff -ur exim-4.92.orig/src/EDITME exim-4.92/src/EDITME +--- exim-4.92.orig/src/EDITME 2019-01-30 14:59:52.000000000 +0100 ++++ exim-4.92/src/EDITME 2019-02-16 18:17:24.547216157 +0100 +@@ -824,6 +824,24 @@ + + + #------------------------------------------------------------------------------ ++# On systems which support dynamic loading of shared libraries, Exim can ++# load a local_scan function specified in its config file instead of having ++# to be recompiled with the desired local_scan function. For a full ++# description of the API to this function, see the Exim specification. ++ ++#DLOPEN_LOCAL_SCAN=yes ++ ++# If you set DLOPEN_LOCAL_SCAN, then you need to include -rdynamic in the ++# linker flags. Without it, the loaded .so won't be able to access any ++# functions from exim. ++ ++LFLAGS = -rdynamic ++ifeq ($(OSTYPE),Linux) ++LFLAGS += -ldl ++endif ++ ++ ++#------------------------------------------------------------------------------ + # The default distribution of Exim contains only the plain text form of the + # documentation. Other forms are available separately. If you want to install + # the documentation in "info" format, first fetch the Texinfo documentation +Only in exim-4.92/src: EDITME.orig +diff -ur exim-4.92.orig/src/globals.c exim-4.92/src/globals.c +--- exim-4.92.orig/src/globals.c 2019-01-30 14:59:52.000000000 +0100 ++++ exim-4.92/src/globals.c 2019-02-16 18:17:24.549216150 +0100 +@@ -41,6 +41,10 @@ + + uschar *no_aliases = NULL; + ++#ifdef DLOPEN_LOCAL_SCAN ++uschar *local_scan_path = NULL; ++#endif ++ + + /* For comments on these variables, see globals.h. I'm too idle to + duplicate them here... */ +Only in exim-4.92/src: globals.c.orig +diff -ur exim-4.92.orig/src/globals.h exim-4.92/src/globals.h +--- exim-4.92.orig/src/globals.h 2019-01-30 14:59:52.000000000 +0100 ++++ exim-4.92/src/globals.h 2019-02-16 18:17:24.549216150 +0100 +@@ -152,6 +152,9 @@ + extern int (*receive_ferror)(void); + extern BOOL (*receive_smtp_buffered)(void); + ++#ifdef DLOPEN_LOCAL_SCAN ++extern uschar *local_scan_path; /* Path to local_scan() library */ ++#endif + + /* For clearing, saving, restoring address expansion variables. We have to have + the size of this vector set explicitly, because it is referenced from more than +Only in exim-4.92/src: globals.h.orig +diff -ur exim-4.92.orig/src/local_scan.c exim-4.92/src/local_scan.c +--- exim-4.92.orig/src/local_scan.c 2019-01-30 14:59:52.000000000 +0100 ++++ exim-4.92/src/local_scan.c 2019-02-16 18:29:56.832732592 +0100 +@@ -5,61 +5,133 @@ + /* Copyright (c) University of Cambridge 1995 - 2009 */ + /* See the file NOTICE for conditions of use and distribution. */ + ++#include "local_scan.h" + +-/****************************************************************************** +-This file contains a template local_scan() function that just returns ACCEPT. +-If you want to implement your own version, you should copy this file to, say +-Local/local_scan.c, and edit the copy. To use your version instead of the +-default, you must set +- +-HAVE_LOCAL_SCAN=yes +-LOCAL_SCAN_SOURCE=Local/local_scan.c +- +-in your Local/Makefile. This makes it easy to copy your version for use with +-subsequent Exim releases. +- +-For a full description of the API to this function, see the Exim specification. +-******************************************************************************/ +- +- +-/* This is the only Exim header that you should include. The effect of +-including any other Exim header is not defined, and may change from release to +-release. Use only the documented interface! */ +- +-#include "local_scan.h" +- +- +-/* This is a "do-nothing" version of a local_scan() function. The arguments +-are: +- +- fd The file descriptor of the open -D file, which contains the +- body of the message. The file is open for reading and +- writing, but modifying it is dangerous and not recommended. +- +- return_text A pointer to an unsigned char* variable which you can set in +- order to return a text string. It is initialized to NULL. +- +-The return values of this function are: +- +- LOCAL_SCAN_ACCEPT +- The message is to be accepted. The return_text argument is +- saved in $local_scan_data. +- +- LOCAL_SCAN_REJECT +- The message is to be rejected. The returned text is used +- in the rejection message. +- +- LOCAL_SCAN_TEMPREJECT +- This specifies a temporary rejection. The returned text +- is used in the rejection message. +-*/ ++#ifdef DLOPEN_LOCAL_SCAN ++#include ++#include ++static int (*local_scan_fn)(int fd, uschar **return_text) = NULL; ++static int load_local_scan_library(void); ++extern uschar *local_scan_path; /* Path to local_scan() library */ ++#endif + + int + local_scan(int fd, uschar **return_text) + { + fd = fd; /* Keep picky compilers happy */ + return_text = return_text; +-return LOCAL_SCAN_ACCEPT; ++#ifdef DLOPEN_LOCAL_SCAN ++/* local_scan_path is defined AND not the empty string */ ++if (local_scan_path && *local_scan_path) ++ { ++ if (!local_scan_fn) ++ { ++ if (!load_local_scan_library()) ++ { ++ char *base_msg , *error_msg , *final_msg ; ++ int final_length = -1 ; ++ ++ base_msg=US"Local configuration error - local_scan() library failure\n"; ++ error_msg = dlerror() ; ++ ++ final_length = strlen(base_msg) + strlen(error_msg) + 1 ; ++ final_msg = (char*)malloc( final_length*sizeof(char) ) ; ++ *final_msg = '\0' ; ++ ++ strcat( final_msg , base_msg ) ; ++ strcat( final_msg , error_msg ) ; ++ ++ *return_text = final_msg ; ++ return LOCAL_SCAN_TEMPREJECT; ++ } ++ } ++ return local_scan_fn(fd, return_text); ++ } ++else ++#endif ++ return LOCAL_SCAN_ACCEPT; ++} ++ ++#ifdef DLOPEN_LOCAL_SCAN ++ ++static int load_local_scan_library(void) ++{ ++/* No point in keeping local_scan_lib since we'll never dlclose() anyway */ ++void *local_scan_lib = NULL; ++int (*local_scan_version_fn)(void); ++int vers_maj; ++int vers_min; ++ ++local_scan_lib = dlopen(local_scan_path, RTLD_NOW); ++if (!local_scan_lib) ++ { ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library open failed - " ++ "message temporarily rejected"); ++ return FALSE; ++ } ++ ++local_scan_version_fn = dlsym(local_scan_lib, "local_scan_version_major"); ++if (!local_scan_version_fn) ++ { ++ dlclose(local_scan_lib); ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain " ++ "local_scan_version_major() function - message temporarily rejected"); ++ return FALSE; ++ } ++ ++/* The major number is increased when the ABI is changed in a non ++ backward compatible way. */ ++vers_maj = local_scan_version_fn(); ++ ++local_scan_version_fn = dlsym(local_scan_lib, "local_scan_version_minor"); ++if (!local_scan_version_fn) ++ { ++ dlclose(local_scan_lib); ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain " ++ "local_scan_version_minor() function - message temporarily rejected"); ++ return FALSE; ++ } ++ ++/* The minor number is increased each time a new feature is added (in a ++ way that doesn't break backward compatibility) -- Marc */ ++vers_min = local_scan_version_fn(); ++ ++ ++if (vers_maj != LOCAL_SCAN_ABI_VERSION_MAJOR) ++ { ++ dlclose(local_scan_lib); ++ local_scan_lib = NULL; ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() has an incompatible major" ++ "version number, you need to recompile your module for this version" ++ "of exim (The module was compiled for version %d.%d and this exim provides" ++ "ABI version %d.%d)", vers_maj, vers_min, LOCAL_SCAN_ABI_VERSION_MAJOR, ++ LOCAL_SCAN_ABI_VERSION_MINOR); ++ return FALSE; ++ } ++else if (vers_min > LOCAL_SCAN_ABI_VERSION_MINOR) ++ { ++ dlclose(local_scan_lib); ++ local_scan_lib = NULL; ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() has an incompatible minor" ++ "version number, you need to recompile your module for this version" ++ "of exim (The module was compiled for version %d.%d and this exim provides" ++ "ABI version %d.%d)", vers_maj, vers_min, LOCAL_SCAN_ABI_VERSION_MAJOR, ++ LOCAL_SCAN_ABI_VERSION_MINOR); ++ return FALSE; ++ } ++ ++local_scan_fn = dlsym(local_scan_lib, "local_scan"); ++if (!local_scan_fn) ++ { ++ dlclose(local_scan_lib); ++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain " ++ "local_scan() function - message temporarily rejected"); ++ return FALSE; ++ } ++ ++return TRUE; + } + ++#endif /* DLOPEN_LOCAL_SCAN */ ++ + /* End of local_scan.c */ +diff -ur exim-4.92.orig/src/readconf.c exim-4.92/src/readconf.c +--- exim-4.92.orig/src/readconf.c 2019-01-30 14:59:52.000000000 +0100 ++++ exim-4.92/src/readconf.c 2019-02-16 18:18:46.013947455 +0100 +@@ -199,6 +199,9 @@ + { "local_from_prefix", opt_stringptr, &local_from_prefix }, + { "local_from_suffix", opt_stringptr, &local_from_suffix }, + { "local_interfaces", opt_stringptr, &local_interfaces }, ++#ifdef DLOPEN_LOCAL_SCAN ++ { "local_scan_path", opt_stringptr, &local_scan_path }, ++#endif + #ifdef HAVE_LOCAL_SCAN + { "local_scan_timeout", opt_time, &local_scan_timeout }, + #endif diff --git a/mail-mta/exim/files/exim-4.93-radius.patch b/mail-mta/exim/files/exim-4.93-radius.patch new file mode 100644 index 0000000..55c52be --- /dev/null +++ b/mail-mta/exim/files/exim-4.93-radius.patch @@ -0,0 +1,66 @@ +From 70b28b113e21d21a528876c3abe88ccb5f7cc77d Mon Sep 17 00:00:00 2001 +From: Fabian Groffen +Date: Sat, 9 May 2020 11:35:12 +0200 +Subject: [PATCH] call_radius: fix compilation due to incorrect usage of + string_sprintf + +Since f3ebb786e451da973560f1c9d8cdb151d25108b5, string_sprintf cannot be +used without arguments any more, so use US directly. + +While at it, also make newline usage consistent to not return a newline +in errptr, when it is debug-printed, a newline is added. + +https://bugs.gentoo.org/720364 + +Signed-off-by: Fabian Groffen +--- + src/src/auths/call_radius.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/src/auths/call_radius.c b/src/src/auths/call_radius.c +index c3637436d..253fd75cd 100644 +--- a/src/src/auths/call_radius.c ++++ b/src/src/auths/call_radius.c +@@ -115,16 +115,16 @@ if (rc_read_config(RADIUS_CONFIG_FILE) != 0) + *errptr = string_sprintf("RADIUS: can't open %s", RADIUS_CONFIG_FILE); + + else if (rc_read_dictionary(rc_conf_str("dictionary")) != 0) +- *errptr = string_sprintf("RADIUS: can't read dictionary"); ++ *errptr = US("RADIUS: can't read dictionary"); + + else if (rc_avpair_add(&send, PW_USER_NAME, user, 0) == NULL) +- *errptr = string_sprintf("RADIUS: add user name failed\n"); ++ *errptr = US("RADIUS: add user name failed"); + + else if (rc_avpair_add(&send, PW_USER_PASSWORD, CS radius_args, 0) == NULL) +- *errptr = string_sprintf("RADIUS: add password failed\n"); ++ *errptr = US("RADIUS: add password failed"); + + else if (rc_avpair_add(&send, PW_SERVICE_TYPE, &service, 0) == NULL) +- *errptr = string_sprintf("RADIUS: add service type failed\n"); ++ *errptr = US("RADIUS: add service type failed"); + + #else /* RADIUS_LIB_RADIUSCLIENT unset => RADIUS_LIB_RADIUSCLIENT2 */ + +@@ -132,17 +132,17 @@ if ((h = rc_read_config(RADIUS_CONFIG_FILE)) == NULL) + *errptr = string_sprintf("RADIUS: can't open %s", RADIUS_CONFIG_FILE); + + else if (rc_read_dictionary(h, rc_conf_str(h, "dictionary")) != 0) +- *errptr = string_sprintf("RADIUS: can't read dictionary"); ++ *errptr = US("RADIUS: can't read dictionary"); + + else if (rc_avpair_add(h, &send, PW_USER_NAME, user, Ustrlen(user), 0) == NULL) +- *errptr = string_sprintf("RADIUS: add user name failed\n"); ++ *errptr = US("RADIUS: add user name failed"); + + else if (rc_avpair_add(h, &send, PW_USER_PASSWORD, CS radius_args, + Ustrlen(radius_args), 0) == NULL) +- *errptr = string_sprintf("RADIUS: add password failed\n"); ++ *errptr = US("RADIUS: add password failed"); + + else if (rc_avpair_add(h, &send, PW_SERVICE_TYPE, &service, 0, 0) == NULL) +- *errptr = string_sprintf("RADIUS: add service type failed\n"); ++ *errptr = US("RADIUS: add service type failed"); + + #endif /* RADIUS_LIB_RADIUSCLIENT */ + diff --git a/mail-mta/exim/files/exim-submission.socket b/mail-mta/exim/files/exim-submission.socket new file mode 100644 index 0000000..b9593e2 --- /dev/null +++ b/mail-mta/exim/files/exim-submission.socket @@ -0,0 +1,10 @@ +[Unit] +Description=Exim Mail Transfer Agent (message submission) +Conflicts=exim.service + +[Socket] +ListenStream=587 +Accept=yes + +[Install] +WantedBy=sockets.target diff --git a/mail-mta/exim/files/exim-submission_at.service b/mail-mta/exim/files/exim-submission_at.service new file mode 100644 index 0000000..4f90cd8 --- /dev/null +++ b/mail-mta/exim/files/exim-submission_at.service @@ -0,0 +1,11 @@ +# It doesn't make sense for this to be separate from exim@.service +# However, I couldn't think of a way to have two .socket files point +# to it ([Socket] Service= is rejected if Accept=yes is set). + +[Unit] +Description=Exim Mail Daemon per-connection server (message submission) + +[Service] +ExecStart=-/usr/bin/exim -bs +StandardInput=socket +StandardError=syslog diff --git a/mail-mta/exim/files/exim.confd b/mail-mta/exim/files/exim.confd new file mode 100644 index 0000000..1534d9d --- /dev/null +++ b/mail-mta/exim/files/exim.confd @@ -0,0 +1,5 @@ +# Command-line options for running exim +EXIM_OPTS="-bd -q15m" + +# Additional flags passed to exim_tidydb upon start (e.g. -t 7d) +TIDY_OPTS="" diff --git a/mail-mta/exim/files/exim.logrotate b/mail-mta/exim/files/exim.logrotate new file mode 100644 index 0000000..f54f8c4 --- /dev/null +++ b/mail-mta/exim/files/exim.logrotate @@ -0,0 +1,9 @@ +/var/log/exim/exim*.log { + daily + missingok + rotate 28 + compress + delaycompress + notifempty + create 640 mail mail +} diff --git a/mail-mta/exim/files/exim.rc10 b/mail-mta/exim/files/exim.rc10 new file mode 100644 index 0000000..c44dba1 --- /dev/null +++ b/mail-mta/exim/files/exim.rc10 @@ -0,0 +1,47 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +depend() { + need logger + use antivirus net + provide mta +} + +tidy_dbs() { + local spooldir=$(/usr/sbin/exim -C /etc/exim/${SVCNAME}.conf -bP -n spool_directory) + local db + local ret=0 + ebegin "Tidying hints databases in ${spooldir}/db" + for db in "${spooldir}"/db/* ; do + case "${db}" in + *".lockfile"|*"*") continue ;; + esac + /usr/sbin/exim_tidydb ${TIDY_OPTS} "${spooldir}" ${db##*/} > /dev/null + : $((ret += $?)) + done + eend ${ret} +} + +start() { + # if you use multiple instances, make sure you set spool_directory + # in the configfile + tidy_dbs + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec /usr/sbin/exim --pidfile /run/${SVCNAME}.pid -- -C /etc/exim/${SVCNAME}.conf ${EXIM_OPTS:--bd -q15m} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --pidfile /run/${SVCNAME}.pid --name exim + eend $? +} + +reload() { + ebegin "Reloading ${SVCNAME}" + start-stop-daemon --signal HUP --pidfile /run/${SVCNAME}.pid --name exim + eend $? +} diff --git a/mail-mta/exim/files/exim.service b/mail-mta/exim/files/exim.service new file mode 100644 index 0000000..c8a61cd --- /dev/null +++ b/mail-mta/exim/files/exim.service @@ -0,0 +1,12 @@ +[Unit] +Description=Exim Mail Transport Agent +After=network.target + +[Service] +Environment=QUEUE=15m +ExecStart=/usr/sbin/exim -bdf -q${QUEUE} +ExecReload=/bin/kill -HUP $MAINPID +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/mail-mta/exim/files/exim.socket b/mail-mta/exim/files/exim.socket new file mode 100644 index 0000000..36d2868 --- /dev/null +++ b/mail-mta/exim/files/exim.socket @@ -0,0 +1,10 @@ +[Unit] +Description=Exim Mail Transfer Agent +Conflicts=exim.service + +[Socket] +ListenStream=25 +Accept=yes + +[Install] +WantedBy=sockets.target diff --git a/mail-mta/exim/files/exim_at.service b/mail-mta/exim/files/exim_at.service new file mode 100644 index 0000000..19c07a5 --- /dev/null +++ b/mail-mta/exim/files/exim_at.service @@ -0,0 +1,7 @@ +[Unit] +Description=Exim Mail Daemon per-connection server + +[Service] +ExecStart=-/usr/bin/exim -bs +StandardInput=socket +StandardError=syslog diff --git a/mail-mta/exim/metadata.xml b/mail-mta/exim/metadata.xml new file mode 100644 index 0000000..6205114 --- /dev/null +++ b/mail-mta/exim/metadata.xml @@ -0,0 +1,52 @@ + + + + + grobian@gentoo.org + + + Exim is a message transfer agent (MTA) developed at the University of + Cambridge for use on Unix systems connected to the Internet. It is + freely available under the terms of the GNU General Public Licence. In + style it is similar to Smail 3, but its facilities are more general. + There is a great deal of flexibility in the way mail can be routed, and + there are extensive facilities for checking incoming mail. Exim can be + installed in place of sendmail, although the configuration of exim is + quite different to that of sendmail. + + + Adds support for Authenticated Receive Chain + (ARC) + Adds support for Distributed Checksum Clearinghouse + (DCC) + Adds support for DNS-based Authentication of Named Entities + Adds support for DomainKeys Identified Mail + (DKIM) + Adds support for a DNS search for a record whose + domain name is the supplied query + Adds support for Dovecot's + authentication + Install local_scan.h header to compile separate + dlfunc libraries + Adds support for DMARC + Adds support for Delivery Status Notifications + (DSN) + Patch providing support for content + scanning + Adds support for lmtp + Adds support for UW's mbx format + Adds support for Sender Policy Framework + Adds support for Sender Rewriting Scheme + Add support for being behind a proxy, such as HAProxy + Require pkcs11 support in net-libs/gnutls with USE=gnutls + Adds support for querying dev-db/redis + Adds support for Per-Recipient Data Response + Adds support for Transport Post-Delivery Actions + + + http://bugs.exim.org/ + + + diff --git a/metadata/layout.conf b/metadata/layout.conf new file mode 100644 index 0000000..4e924b5 --- /dev/null +++ b/metadata/layout.conf @@ -0,0 +1,2 @@ +masters = gentoo +repo-name = myold diff --git a/profiles/repo_name b/profiles/repo_name new file mode 100644 index 0000000..bcf0a17 --- /dev/null +++ b/profiles/repo_name @@ -0,0 +1 @@ +myold diff --git a/sys-apps/openwsman/Manifest b/sys-apps/openwsman/Manifest new file mode 100644 index 0000000..092a522 --- /dev/null +++ b/sys-apps/openwsman/Manifest @@ -0,0 +1,5 @@ +AUX openwsman-2.6.5-libcurl-error-codes-update.patch 1162 BLAKE2B 59802194fee1ecb8786569c85f57fc9255456b43895a781dcac6a3cd903f106eadbf53f1de39b203dd9d61d6a1bde4dc2bc48cea28d7c704c08d71562d8503c8 SHA512 f887f52412d8bf1565cd6576340d6f81acad65c9977d56a7a9a9af6ba9950a025db0dffda0b767d2aa351ea7990f12dfeaa7d5f7b3c618982a8a766633caed5a +AUX openwsmand.confd 2 BLAKE2B a5cdc0d97724f51411f2f5ba99734c297507df295742618499a23296c99bac5d6cef25d497fb3afb76a3e67e4ac53d4b5bccfa55309d7b02ff5793bcf53dfec2 SHA512 a80f7cc2606ef6e5474e96b1e520c17ecf432f0da9a566bd157044130cfb548f10d929ffb5783008df78b6d07d07d109bffbad1998cb8309eccec7e4d3fc813a +AUX openwsmand.initd 263 BLAKE2B 246449862d8bf51dae573ff8bb4e4715284ba37de65be9cf226d001a081f825506256c3b1c1322ffa59b7df99466ce1fe35f164c993566023be7a1c7eed08d21 SHA512 bd20fc3815d02b0dd5a2c2336b5204550ef941e362f686ddb00f7f96d93bd2222dd4cb076f39efe2e85d3262356c548d0c9d7c1d566a04bba2c4a942126851d2 +DIST openwsman-2.7.0.tar.gz 513225 BLAKE2B c6463358c8b665a1019b4a4be370ebd006fb31c3a17abf2bf5f699a33fa96795d272ac687bf69dafab769301c21fc10ddb4e71744f7456dc8d16dbcc81d65b75 SHA512 e61792eafd09e3608c736091d2742049086adaf5fffcda9391e4712ed1dedf3a533546a6af61ea6ce49d4cf4fb3649cb168f20260c4e975797395d6e565c6c37 +EBUILD openwsman-2.7.0.ebuild 2579 BLAKE2B d0f67ad1764d44f2829aea66aba2a21a6a331c00120c44893048aa082d9890f01def72be1274799468e03c01105b1557396f04cfd2f7e4d3dedbb54490f73599 SHA512 63612d3c3e141d6af697f1d9479042937873c415f05ea082f34aaf713a4c0b087563b95ff1d2ec1b9f60fec9a50d4c7b6dc511a76049b29609a664b8b22c3da3 diff --git a/sys-apps/openwsman/files/openwsman-2.6.5-libcurl-error-codes-update.patch b/sys-apps/openwsman/files/openwsman-2.6.5-libcurl-error-codes-update.patch new file mode 100644 index 0000000..82ee51f --- /dev/null +++ b/sys-apps/openwsman/files/openwsman-2.6.5-libcurl-error-codes-update.patch @@ -0,0 +1,27 @@ +diff -up openwsman-2.6.5/src/lib/wsman-curl-client-transport.c.orig openwsman-2.6.5/src/lib/wsman-curl-client-transport.c +--- openwsman-2.6.5/src/lib/wsman-curl-client-transport.c.orig 2018-11-14 13:53:27.442138557 +0100 ++++ openwsman-2.6.5/src/lib/wsman-curl-client-transport.c 2018-11-14 14:11:28.508714204 +0100 +@@ -186,16 +186,23 @@ convert_to_last_error(CURLcode r) + return WS_LASTERR_SSL_CONNECT_ERROR; + case CURLE_BAD_FUNCTION_ARGUMENT: + return WS_LASTERR_CURL_BAD_FUNCTION_ARG; ++#if LIBCURL_VERSION_NUM < 0x073E00 + case CURLE_SSL_PEER_CERTIFICATE: + return WS_LASTERR_SSL_PEER_CERTIFICATE; ++#endif + case CURLE_SSL_ENGINE_NOTFOUND: + return WS_LASTERR_SSL_ENGINE_NOTFOUND; + case CURLE_SSL_ENGINE_SETFAILED: + return WS_LASTERR_SSL_ENGINE_SETFAILED; + case CURLE_SSL_CERTPROBLEM: + return WS_LASTERR_SSL_CERTPROBLEM; ++#if LIBCURL_VERSION_NUM < 0x073E00 + case CURLE_SSL_CACERT: + return WS_LASTERR_SSL_CACERT; ++#else ++ case CURLE_PEER_FAILED_VERIFICATION: ++ return WS_LASTERR_SSL_PEER_CERTIFICATE; ++#endif + #if LIBCURL_VERSION_NUM > 0x70C01 + case CURLE_SSL_ENGINE_INITFAILED: + return WS_LASTERR_SSL_ENGINE_INITFAILED; diff --git a/sys-apps/openwsman/files/openwsmand.confd b/sys-apps/openwsman/files/openwsmand.confd new file mode 100644 index 0000000..792d600 --- /dev/null +++ b/sys-apps/openwsman/files/openwsmand.confd @@ -0,0 +1 @@ +# diff --git a/sys-apps/openwsman/files/openwsmand.initd b/sys-apps/openwsman/files/openwsmand.initd new file mode 100644 index 0000000..f7f0d57 --- /dev/null +++ b/sys-apps/openwsman/files/openwsmand.initd @@ -0,0 +1,12 @@ +#!/sbin/runscript +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +command=/usr/sbin/openwsmand +pidfile=/run/openwsmand.pid +command_args="${WSMAND_OPTS} -p ${pidfile}" + +depend() { + use net +} diff --git a/sys-apps/openwsman/openwsman-2.7.0.ebuild b/sys-apps/openwsman/openwsman-2.7.0.ebuild new file mode 100644 index 0000000..99cec5a --- /dev/null +++ b/sys-apps/openwsman/openwsman-2.7.0.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_8 python3_9 python3_10 python3_11 ) + +inherit python-single-r1 cmake-utils ssl-cert java-pkg-opt-2 + +DESCRIPTION="Opensource Implementation of WS-Management Client" +HOMEPAGE="https://github.com/Openwsman" +SRC_URI="https://github.com/Openwsman/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 x86" + +RESTRICT="mirror" +BINDINGS_USE="java perl python ruby" +IUSE="+cim debug examples +eventing ipv6 pam +plugins ssl +server test ${BINDINGS_USE}" +REQUIRED_USE=" + java? ( plugins ) + perl? ( plugins ) + python? ( plugins ) + ruby? ( plugins ) +" + +JAVA_PKG_NV_DEPEND="virtual/jdk:1.8" +RDEPEND=" + cim? ( dev-libs/sblim-sfcc ) + ssl? ( dev-libs/openssl:0 ) + pam? ( virtual/pam ) + ruby? ( dev-lang/ruby:= ) + perl? ( dev-lang/perl ) + java? ( ${JAVA_PKG_NV_DEPEND} ) + python? ( ${PYTHON_DEPS} ) + net-misc/curl[idn] + dev-libs/libxml2[icu] + virtual/libcrypt + " +DEPEND=" + ${RDEPEND} + test? ( dev-util/cunit ) + java? ( dev-lang/swig:0 ) + perl? ( dev-lang/swig:0 ) + python? ( dev-lang/swig:0 ) + ruby? ( dev-lang/swig:0 ) + " + +PATCHES=( +) + +CMAKE_MAKEFILE_GENERATOR=emake + +# LIBC != glibc build fail - add block +src_prepare(){ + #Ruby gem builder does not like Unicode + sed -e 's/Kämpf/Kaempf/' -i bindings/ruby/openwsman.gemspec.in + cmake-utils_src_prepare + default +} + +src_configure() { + local bindings=NO + for f in $BINDINGS_USE; do + use $f && bindings=YES + done + local mycmakeargs=( + -DPACKAGE_ARCHITECTURE=${ARCH} + -DBUILD_BINDINGS=${bindings} + -DBUILD_CUNIT_TESTS=$(usex test) + -DBUILD_EXAMPLES=$(usex examples) + -DBUILD_JAVA=$(usex java) + -DBUILD_LIBCIM=$(usex cim) + -DBUILD_PERL=$(usex perl) + -DBUILD_PYTHON=$(usex python) + -DBUILD_RUBY=$(usex ruby) + -DBUILD_SWIG_PLUGIN=${bindings} + -DBUILD_TESTS=$(usex test) + -DDISABLE_PLUGINS="$(usex plugins) + -DDISABLE_SERVER="$(usex server) + -DENABLE_EVENTING_SUPPORT="$(usex eventing) + -DWSMAN_DEBUG_VERBOSE="$(usex debug) + -DENABLE_IPV6="$(usex ipv6) + -DUSE_PAM="$(usex pam) + ) + use ruby && mycmakeargs+=( -DBUILD_RUBY_GEM=YES ) + cmake-utils_src_configure +} + +src_compile(){ + cmake-utils_src_compile -j1 #Upstream doesn't know about target dependencies, sigh +} + +src_install() { + cmake-utils_src_install +} + +pkg_postinst() { + if use ssl && [[ ! -f "${ROOT}"/etc/ssl/openwsman/servercert.pem \ + && ! -f "${ROOT}"/etc/ssl/postfix/serverkey.pem ]] ; then + SSL_ORGANIZATION="${SSL_ORGANIZATION:-Local OpenWSman Server}" + install_cert /etc/openwsman/servercert + fi +} diff --git a/sys-apps/wsmancli/Manifest b/sys-apps/wsmancli/Manifest new file mode 100644 index 0000000..274450b --- /dev/null +++ b/sys-apps/wsmancli/Manifest @@ -0,0 +1,3 @@ +AUX autotools.patch 1103 BLAKE2B 311c9dad47037741db1fb5b10646b4eb72fe46e417bd3f4cb3f66afefc543977859760df83a703c2f745dfa734c85ddc699181d584da3fae5e0aba3ec617feb9 SHA512 80f542650125aee7d374704ec7321ace1b3a29ef2d71751a6fa59b52b8e04e677fffeec35b4b461e4ef1b477bcb21a36339966ebbe692c07594c2d6e74795e9f +DIST wsmancli-2.6.0.tar.gz 42913 BLAKE2B 9482153e3e0efe0b31d88f58862e6f9b3a0162dcdaaf74500fb6663e1502485a0877808ba517d6660226bd68d2a9b8d68351544c74f3eaf9ebe3172ce8502543 SHA512 40f69dfefd5cfc9c1d137c5c58bd0e84e1bb460ecb6770e1c56b023477f7521769f04e041682686d267796477704c7465d437f6fdb4068268a51d1136d5c8a56 +EBUILD wsmancli-2.6.0.ebuild 633 BLAKE2B b78cd1e7bda4895e08aea6058e7f1bc302a2c061d8da3f8e8d75272adf2905263f42df0145cae31c336de7d417bc1cbcaf8382c44f3ba6f1b981a68afed57421 SHA512 4c5f1b021813e3744292eb90dd52fac7d311bd7fb03ef4f5d5112679afeca48aeb4b901c4cd9c6c3b7a9671d6e2f9f1aac7284bda1493b50b70c4ccb66e277ea diff --git a/sys-apps/wsmancli/files/autotools.patch b/sys-apps/wsmancli/files/autotools.patch new file mode 100644 index 0000000..f925907 --- /dev/null +++ b/sys-apps/wsmancli/files/autotools.patch @@ -0,0 +1,49 @@ +--- wsmancli-2.6.0/configure.in.orig 2022-07-21 12:57:35.481177325 +0200 ++++ wsmancli-2.6.0/configure.in 2022-07-21 13:03:17.834808466 +0200 +@@ -1,17 +1,14 @@ + dnl Process this file with autoconf to produce a configure script. + +-AC_INIT(wsmancli, 2.6.0) ++AC_INIT([wsmancli], [2.6.0]) + AC_CONFIG_SRCDIR(wsmancli.spec.in) +-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) +-AM_CONFIG_HEADER(config.h) ++AM_INIT_AUTOMAKE ++AC_CONFIG_HEADERS(config.h) + AM_MAINTAINER_MODE + +-AC_ISC_POSIX + AC_PROG_CC + AC_PROG_CXX +-AM_PROG_CC_STDC +-AC_HEADER_STDC +-AM_PROG_LIBTOOL ++LT_INIT + + WSMAN_PKG=$PACKAGE_NAME + AC_SUBST(WSMAN_PKG) +@@ -49,7 +46,7 @@ + -Wunused -Werror" + fi + +-AC_OUTPUT([ ++AC_CONFIG_FILES([ + wsmancli.spec + Makefile + src/Makefile +@@ -60,4 +57,4 @@ + tests/cunit/Makefile + man/Makefile + ]) +- ++AC_OUTPUT +--- wsmancli-2.6.0/tests/cunit/Makefile.am.orig 2015-06-11 10:50:04.000000000 +0200 ++++ wsmancli-2.6.0/tests/cunit/Makefile.am 2022-07-21 13:06:59.696086534 +0200 +@@ -1,6 +1,6 @@ + AM_CFLAGS = @CFLAGS@ + +-INCLUDES = \ ++AM_CPPFLAGS = \ + $(OPENWSMAN_CFLAGS) + + diff --git a/sys-apps/wsmancli/wsmancli-2.6.0.ebuild b/sys-apps/wsmancli/wsmancli-2.6.0.ebuild new file mode 100644 index 0000000..b47e338 --- /dev/null +++ b/sys-apps/wsmancli/wsmancli-2.6.0.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +WANT_AUTOCONF=2.5 + +inherit autotools + +DESCRIPTION="Opensource Implementation of WS-Management - Command line utility" +HOMEPAGE="https://github.com/Openwsman" +SRC_URI="https://github.com/Openwsman/wsmancli/archive/v2.6.0.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="x86 amd64" +IUSE="static-libs" + +CDEPEND=" + net-misc/curl[idn] + sys-apps/openwsman + " + +RDEPEND="${CDEPEND}" +DEPEND="${CDEPEND}" + +PATCHES=( + "${FILESDIR}"/autotools.patch +) + +src_prepare() { + default + + mv configure.{in,ac} || die + ./bootstrap +} diff --git a/updmanifests b/updmanifests new file mode 100755 index 0000000..b70ee18 --- /dev/null +++ b/updmanifests @@ -0,0 +1,12 @@ +#!/bin/bash + +TMPDIR=/tmp/$$ +mkdir -p $TMPDIR +chmod 777 $TMPDIR + +export PORTAGE_TMPDIR=$TMPDIR +export DISTDIR=/home/pkgs/distfiles + +for d in `find . -name '*.ebuild' | sed -e 's#/[^/]*$##' | sort | uniq`; do + (cd $d; ebuild `ls *.ebuild | head -1` manifest) +done diff --git a/virtual/imap-c-client/Manifest b/virtual/imap-c-client/Manifest new file mode 100644 index 0000000..54a59bd --- /dev/null +++ b/virtual/imap-c-client/Manifest @@ -0,0 +1,2 @@ +EBUILD imap-c-client-2.ebuild 319 BLAKE2B 1d3f4562c964bf869f9a0a5cb587a7a7814c05e7d15ba3aa3f362cd521734febc65a07e19d4bc4d86df81747a217dd7c4445f3c3d26cb6d2dd49cc4c70f68cde SHA512 247faa7eabb0f6fe3e8f499d3b0afa6fa64c89171f0ca8efbeb5461b31d368263afe66b1f6743ac2f25812ebcf732ef228642ffd9a787cfbbdefead9d66b9d8a +MISC metadata.xml 192 BLAKE2B fef49cb9e1dda8063c379e650d4897670410d2c0641f469b8a200d5e7ec8d3f505e692277d03b583790cb1340ece9c2e8f7e7c9ff5080d42a2e0ef3fc7138a44 SHA512 bece454b8da734c7a28ce25f8080b3fca56332e57cde854c50f0b884ba3836f1af7782a1ee9f63e6aeff4830e2bca71c5c466471fc82eee75339565aab6495d5 diff --git a/virtual/imap-c-client/imap-c-client-2.ebuild b/virtual/imap-c-client/imap-c-client-2.ebuild new file mode 100644 index 0000000..edb905c --- /dev/null +++ b/virtual/imap-c-client/imap-c-client-2.ebuild @@ -0,0 +1,11 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Virtual for IMAP c-client" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86" +IUSE="kerberos ssl" + +RDEPEND="net-libs/c-client[kerberos=,ssl=]" diff --git a/virtual/imap-c-client/metadata.xml b/virtual/imap-c-client/metadata.xml new file mode 100644 index 0000000..c3bda71 --- /dev/null +++ b/virtual/imap-c-client/metadata.xml @@ -0,0 +1,6 @@ + + + + + +