diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-01-09 00:17:07 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-01-09 00:17:07 +0000 |
commit | 4fc232f0223106ced390fbe949c095cb39143f23 (patch) | |
tree | cbe7ad1f19d2a427ec23a82842e743a1aa49cd49 /dev-libs | |
parent | 2237cda0c6b012952e02ec1314e1f48eddf4dab7 (diff) |
gentoo auto-resync : 09:01:2023 - 00:17:07
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/Manifest.gz | bin | 96405 -> 96414 bytes | |||
-rw-r--r-- | dev-libs/libwbxml/Manifest | 4 | ||||
-rw-r--r-- | dev-libs/libwbxml/files/libwbxml-0.11.7-expat-compat-fixes.patch | 116 | ||||
-rw-r--r-- | dev-libs/libwbxml/libwbxml-0.11.7-r1.ebuild | 37 | ||||
-rw-r--r-- | dev-libs/libwbxml/libwbxml-0.11.7.ebuild | 33 | ||||
-rw-r--r-- | dev-libs/openssl/Manifest | 1 | ||||
-rw-r--r-- | dev-libs/openssl/openssl-1.1.1s-r1.ebuild | 343 |
7 files changed, 344 insertions, 190 deletions
diff --git a/dev-libs/Manifest.gz b/dev-libs/Manifest.gz Binary files differindex bc1e341dd709..211789b7ff8f 100644 --- a/dev-libs/Manifest.gz +++ b/dev-libs/Manifest.gz diff --git a/dev-libs/libwbxml/Manifest b/dev-libs/libwbxml/Manifest index 5116c5b94b95..5c4eb8405422 100644 --- a/dev-libs/libwbxml/Manifest +++ b/dev-libs/libwbxml/Manifest @@ -1,7 +1,3 @@ -AUX libwbxml-0.11.7-expat-compat-fixes.patch 5005 BLAKE2B 705cd2068fc95536a8ed329de2e77cacb044b01273689c110d78f9a6500914961e4f7f23da05a18fb3743c89ad78f7f2ab618c8b187e4280d18dd10c0d71f102 SHA512 e2ca3c5134bfe4800489ba215c443f85ff85612db45da6896c3d6bed6b493eefc4b904b3b9a3b8fa8a6b2ab8f5c294866512dd064ac315ebc689756882a4395f -DIST libwbxml-0.11.7.tar.gz 427429 BLAKE2B 1ec456032d4d343f5b11c60dfe5fa5dfb8750c87f1e05c48b1671257822ce7ec121a7006ed9749aacd84d4ce9f5dfa0c358cf3f3581a4a24a34db1c91338f74a SHA512 fc855650661593596a158527682d2c40d800c1fa44169d79e9ca9c6d64d67b6c660807ed89b1bddd644f114c27711356627ac919af91fd7f19d409879505512f DIST libwbxml-0.11.8.tar.gz 362833 BLAKE2B 8501a578c1937097a7f0993baf0bed1d645d14441fca149142a8d338f9b6aece7f726576d9170dfc298388c66937d8a6549d52ed75305cab2c427c82b1331dfd SHA512 14b74e3d25f21ce4bf05f4ed546087817c698b5a44190c569b7691e26510b117118bf828e15beccaa4bdd2e744c45f9b5695b38eb7994f3af0f4f81f90ecff69 -EBUILD libwbxml-0.11.7-r1.ebuild 761 BLAKE2B 7622ce155b8348dea4c9a6d607637476ffe54dbfcab1b9888714b2941e4ebc2ef7cf496c5da9c84657bf1b5b7e03ea8aa8f56d810ca396ea352575015409e919 SHA512 d8f03a241a8c461a1babe616c4c405c3be14015cf82ec9b0ec16d74451477f5f6bdee2b2e8afd2f6f2da75268859d13a749c3599e1db4c7eaa2f0715304d7190 -EBUILD libwbxml-0.11.7.ebuild 700 BLAKE2B 9798f8f3aa8461d32f86089d9ef4cc059ce393b65afd31d77bc984d0538d960c35a8f9c42fe5418850d35ffff0782fcc20b1e2a905d92cc307f8936cd789d2aa SHA512 dfa8c1f81e264b465015631865bd23b38237dcbbfae252d21fc776b6826770dd841af503717d0a8f559099e42bcb5ef861010ac09f04be855639204d21f12e41 EBUILD libwbxml-0.11.8.ebuild 700 BLAKE2B 79a99e8d21944de04d76e25a6482c71112a0d517ced12ce0875e043950c234ed32f11d1727cd6814103844d81b3aaf12b33b5dc51f360efe986b18bad7f2fd4e SHA512 cc9c7f14e4ec060f75d16e0f999958543ebad1f87cf40e8e8edddb2c1a57ce1309abab7a9a9f398ab6b207ffe259b03bbc1d6b974f69783ba3596d5a4c4e6517 MISC metadata.xml 393 BLAKE2B 270d88949c326fa1d283b9e7e9a168dc5fce083a2545c6933efc9792e407ecc1742dc73a06ae8d071c14b9816487f6d7690e4c5ffde6fc0e00042d1442d8dd89 SHA512 6a5daed5693df3ac31def8d5e1f909bcdd65b8aa459c9cb3dab6659f652ed510fed64fc815a048447a5bbeeaedcda5942a44d74b3232e01344f80ec50d53285f diff --git a/dev-libs/libwbxml/files/libwbxml-0.11.7-expat-compat-fixes.patch b/dev-libs/libwbxml/files/libwbxml-0.11.7-expat-compat-fixes.patch deleted file mode 100644 index 00479c7f6437..000000000000 --- a/dev-libs/libwbxml/files/libwbxml-0.11.7-expat-compat-fixes.patch +++ /dev/null @@ -1,116 +0,0 @@ -https://github.com/libwbxml/libwbxml/commit/4664d476fb5029073012b91880ce2a9bbc0b4725 -https://github.com/libwbxml/libwbxml/commit/4425e80f74b93a590b2c99638b9c5095e6a66244 - -From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <slavek.banko@axis.cz> -Date: Thu, 24 Feb 2022 20:30:18 +0100 -Subject: [PATCH] Allow the use of a namespace separator specified by the - constant instead of hardcoded colon in the SyncML related code. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Slávek Banko <slavek.banko@axis.cz> ---- a/src/wbxml_internals.h -+++ b/src/wbxml_internals.h -@@ -156,7 +156,9 @@ typedef enum WBXMLWVDataType_e { - #pragma warning(error: 4761) /**< integral size mismatch in argument : conversion supplied */ - #endif /* WIN32 */ - --#define WBXML_NAMESPACE_SEPARATOR ':' -+/* Separator must be the same in both cases - once as a char, once as a string */ -+#define WBXML_NAMESPACE_SEPARATOR ':' -+#define WBXML_NAMESPACE_SEPARATOR_STR ":" - - /** @} */ - ---- a/src/wbxml_tree_clb_xml.c -+++ b/src/wbxml_tree_clb_xml.c -@@ -33,6 +33,7 @@ - * @brief WBXML Tree Callbacks for XML Parser (Expat) - */ - -+#include "wbxml_internals.h" - #include "wbxml_config_internals.h" - - #if defined( HAVE_EXPAT ) -@@ -160,8 +161,8 @@ void wbxml_tree_clb_xml_start_element(void *ctx, - * potentially embedded documents. - */ - if (( -- (WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0) || -- (WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0) -+ (WBXML_STRCMP(localName, "syncml:devinf" WBXML_NAMESPACE_SEPARATOR_STR "DevInf") == 0) || -+ (WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0) - )&& - (tree_ctx->current != NULL)) - { -@@ -255,8 +256,8 @@ void wbxml_tree_clb_xml_end_element(void *ctx, - /* End of skipped node */ - - #if defined( WBXML_SUPPORT_SYNCML ) -- if (WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0 || -- WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0) { -+ if (WBXML_STRCMP(localName, "syncml:devinf" WBXML_NAMESPACE_SEPARATOR_STR "DevInf") == 0 || -+ WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0) { - /* definitions first ... or some compilers don't like it */ - WBXMLBuffer *embed_doc = NULL; - WBXMLTree *tree = NULL; -@@ -277,10 +278,10 @@ void wbxml_tree_clb_xml_end_element(void *ctx, - } - - /* Check Buffer Creation and add the closing tag */ -- if ((WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0 && -+ if ((WBXML_STRCMP(localName, "syncml:devinf" WBXML_NAMESPACE_SEPARATOR_STR "DevInf") == 0 && - (!wbxml_buffer_append_cstr(embed_doc, "</DevInf>"))) - || -- (WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0 && -+ (WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0 && - (!wbxml_buffer_append_cstr(embed_doc, "</MgmtTree>")))) - { - tree_ctx->error = WBXML_ERROR_NOT_ENOUGH_MEMORY; -@@ -289,7 +290,7 @@ void wbxml_tree_clb_xml_end_element(void *ctx, - } - - /* Add doctype to give the XML parser a chance */ -- if (WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0 && -+ if (WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0 && - tree_ctx->tree->lang->langID != WBXML_LANG_SYNCML_SYNCML12) - { - tree_ctx->error = WBXML_ERROR_UNKNOWN_XML_LANGUAGE; -@@ -305,7 +306,7 @@ void wbxml_tree_clb_xml_end_element(void *ctx, - lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DEVINF11); - break; - case WBXML_LANG_SYNCML_SYNCML12: -- if (WBXML_STRCMP(localName, "syncml:dmddf1.2:MgmtTree") == 0) { -+ if (WBXML_STRCMP(localName, "syncml:dmddf1.2" WBXML_NAMESPACE_SEPARATOR_STR "MgmtTree") == 0) { - lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DMDDF12); - } else { - lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DEVINF12); - -From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <slavek.banko@axis.cz> -Date: Thu, 24 Feb 2022 20:31:15 +0100 -Subject: [PATCH] Change the default internal namespace separator from the - colon to the pipe. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This solves compatibility with libexpat >= 2.4.5 -after fix the security problem CVE-2022-25236. - -This resolves issue #76. - -Signed-off-by: Slávek Banko <slavek.banko@axis.cz> ---- a/src/wbxml_internals.h -+++ b/src/wbxml_internals.h -@@ -157,8 +157,8 @@ typedef enum WBXMLWVDataType_e { - #endif /* WIN32 */ - - /* Separator must be the same in both cases - once as a char, once as a string */ --#define WBXML_NAMESPACE_SEPARATOR ':' --#define WBXML_NAMESPACE_SEPARATOR_STR ":" -+#define WBXML_NAMESPACE_SEPARATOR '|' -+#define WBXML_NAMESPACE_SEPARATOR_STR "|" - - /** @} */ - diff --git a/dev-libs/libwbxml/libwbxml-0.11.7-r1.ebuild b/dev-libs/libwbxml/libwbxml-0.11.7-r1.ebuild deleted file mode 100644 index d351e183714d..000000000000 --- a/dev-libs/libwbxml/libwbxml-0.11.7-r1.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake - -DESCRIPTION="Library and tools to parse, encode and handle WBXML documents" -HOMEPAGE="https://github.com/libwbxml/libwbxml" -SRC_URI="https://github.com/${PN}/${PN}/archive/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" -IUSE="test" -RESTRICT="!test? ( test )" - -RDEPEND="dev-libs/expat - virtual/libiconv" -DEPEND="${RDEPEND} - test? ( dev-libs/check )" - -DOCS=( BUGS ChangeLog README References THANKS TODO ) -S=${WORKDIR}/${PN}-${P} - -PATCHES=( - "${FILESDIR}"/${P}-expat-compat-fixes.patch -) - -src_configure() { - local mycmakeargs=( - -DENABLE_INSTALL_DOC=OFF - -DENABLE_UNIT_TEST=$(usex test) - ) - - cmake_src_configure -} diff --git a/dev-libs/libwbxml/libwbxml-0.11.7.ebuild b/dev-libs/libwbxml/libwbxml-0.11.7.ebuild deleted file mode 100644 index a36bf18136e4..000000000000 --- a/dev-libs/libwbxml/libwbxml-0.11.7.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake - -DESCRIPTION="Library and tools to parse, encode and handle WBXML documents" -HOMEPAGE="https://github.com/libwbxml/libwbxml" -SRC_URI="https://github.com/${PN}/${PN}/archive/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ppc x86" -IUSE="test" -RESTRICT="!test? ( test )" - -RDEPEND="dev-libs/expat - virtual/libiconv" -DEPEND="${RDEPEND} - test? ( dev-libs/check )" - -DOCS=( BUGS ChangeLog README References THANKS TODO ) -S=${WORKDIR}/${PN}-${P} - -src_configure() { - local mycmakeargs=( - -DENABLE_INSTALL_DOC=OFF - -DENABLE_UNIT_TEST=$(usex test) - ) - - cmake_src_configure -} diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest index bcdef0c27735..0c0062a9ae9d 100644 --- a/dev-libs/openssl/Manifest +++ b/dev-libs/openssl/Manifest @@ -16,6 +16,7 @@ DIST openssl-3.0.7.tar.gz 15107575 BLAKE2B 141881071fa62f056c514e7c653a61c59cc45 DIST openssl-3.0.7.tar.gz.asc 858 BLAKE2B bd07a6f656cce817038743caf1131ef8d7a21bf587e706e32771ad9e09cb4821d21b71171a7fe7bb6bece95e9b06cea6d723aae9de8b62049b5a8316578500be SHA512 9093a8a5a990f5f37bd95e7ca55f2371e59242be408ea7d9403bcfc9c8873c022237e13c0ec81881a20607ea46927887a895a82b6f50c6f423b4c54f9ef0cde1 EBUILD openssl-1.0.2u-r1.ebuild 9980 BLAKE2B 0017b72acb2eb86f2927845903c93aacfc9c2812ecc5dd5daa23ffc6dd961a4258181ac2c085798b228df5aa23fff2faf476f880406a7c0eeecde3a8391d6a11 SHA512 7aadb788732ee4dbf32ba34567c8ffc897354ac4028f26ec60fab8f099a445c494825bcaad7a5bc053a1ca3f70bfc0f9e944cce5a4051708555cae24c6c5b9a9 EBUILD openssl-1.1.1q.ebuild 10190 BLAKE2B d43cbde3d6b34a33f7937b59d0a2770290cc342ff664796bca1c546d2a70ba609d0d8f035c1cf2d8f339bcd82ab651e970a5d9ee55a2a6734a2e17b7187aff59 SHA512 47e480e4344753939cd8f64c1e7dd36eed12b8568cc18dd9691bb4d231088d2f77d1ba5fb79f2f9f3ec18b3bb8fb9c118bbb716af91d0023fe920fc968f081ee +EBUILD openssl-1.1.1s-r1.ebuild 10276 BLAKE2B b58f4d5a0600bec2811aee85d4ca67faee05a44648d2371c0031767078503f8b0734124f1737cd522be007613397c931f61b2b8c64db4eb88c61b4298d43bf6c SHA512 871d7c4e1c89a060c4792b52bc5cda30537bd3e7c1f163c81297de1cab883dc961d1bd116c45be059297fbf9a171033d9c8f3d1c086dc292505e3e0f59bbe48f EBUILD openssl-1.1.1s.ebuild 10244 BLAKE2B 8718b01b9426b4ca51d5e4afbe531755ba1542ede77d5038f6cc9a5f42abd27c0fccb5d713afb408d6092caf8c0b774a96dadda918f07900be0c7f4f76fbd47a SHA512 72fe25bc58d23ba2a31cbf137a179ae8477a084fbf1ada28cd878fd1958dce891ee3b8fba7d31ab10e623f202b49d96779d6e03f9761c73c77c6d5d8a25dafd3 EBUILD openssl-3.0.7-r1.ebuild 9867 BLAKE2B cf5c11fb8f3629e708fe973ce4a8347ab8d04901e625e34ff55be93307ce3f5c3214a2efaaf7d475638007ab6bc21ea7b895d701a8574f877e285cc87fe020a4 SHA512 df9cc24b08cab21f607eed16aed95a82ba491d5368f29fa74296082955a612900fd3284a7bece408a95a3346a5aeb0bbb162a6d64bbd01abc8ebde75395b4f47 EBUILD openssl-3.0.7-r2.ebuild 10121 BLAKE2B 2f3129b1f077c15a2108c9316a702786cdd0d73eff57e53963d506d846bb509b0a76f419164bec65038c5db2dd9dc22890a24890e43926c391cac4053245d029 SHA512 b76e62dd36d16566c80ad02ed65ab5022ab7f2be7b618a163aff6fb9060064af503b8dc5c863148070c08f9ac6e62ee3f884169ae68de1d5b8640e13e17d2a0e diff --git a/dev-libs/openssl/openssl-1.1.1s-r1.ebuild b/dev-libs/openssl/openssl-1.1.1s-r1.ebuild new file mode 100644 index 000000000000..cadb162ac5ec --- /dev/null +++ b/dev-libs/openssl/openssl-1.1.1s-r1.ebuild @@ -0,0 +1,343 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/openssl.org.asc +inherit edo flag-o-matic toolchain-funcs multilib-minimal verify-sig + +MY_P=${P/_/-} +DESCRIPTION="Full-strength general purpose cryptography library (including SSL and TLS)" +HOMEPAGE="https://www.openssl.org/" +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz + verify-sig? ( mirror://openssl/source/${MY_P}.tar.gz.asc )" +S="${WORKDIR}/${MY_P}" + +LICENSE="openssl" +SLOT="0/1.1" # .so version of libssl/libcrypto +if [[ ${PV} != *_pre* ]] ; then + #KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" + KEYWORDS="" +fi +IUSE="+asm rfc3779 sctp cpu_flags_x86_sse2 sslv3 static-libs test tls-compression tls-heartbeat vanilla verify-sig weak-ssl-ciphers" +RESTRICT="!test? ( test )" + +RDEPEND=">=app-misc/c_rehash-1.7-r1 + tls-compression? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND}" +BDEPEND=" + >=dev-lang/perl-5 + sctp? ( >=net-misc/lksctp-tools-1.0.12 ) + test? ( + sys-apps/diffutils + sys-devel/bc + kernel_linux? ( sys-process/procps ) + ) + verify-sig? ( >=sec-keys/openpgp-keys-openssl-20221101 )" +PDEPEND="app-misc/ca-certificates" + +# force upgrade to prevent broken login, bug #696950 +RDEPEND+=" !<net-misc/openssh-8.0_p1-r3" + +MULTILIB_WRAPPED_HEADERS=( + usr/include/openssl/opensslconf.h +) + +PATCHES=( + # General patches which are suitable to always apply + # If they're Gentoo specific, add to USE=-vanilla logic in src_prepare! + "${FILESDIR}"/${PN}-1.1.0j-parallel_install_fix.patch # bug #671602 + "${FILESDIR}"/${PN}-1.1.1i-riscv32.patch +) + +pkg_setup() { + [[ ${MERGE_TYPE} == binary ]] && return + + # must check in pkg_setup; sysctl doesn't work with userpriv! + if use test && use sctp; then + # test_ssl_new will fail with "Ensure SCTP AUTH chunks are enabled in kernel" + # if sctp.auth_enable is not enabled. + local sctp_auth_status=$(sysctl -n net.sctp.auth_enable 2>/dev/null) + if [[ -z "${sctp_auth_status}" ]] || [[ ${sctp_auth_status} != 1 ]]; then + die "FEATURES=test with USE=sctp requires net.sctp.auth_enable=1!" + fi + fi +} + +src_unpack() { + # Can delete this once test fix patch is dropped + if use verify-sig ; then + # Needed for downloaded patch (which is unsigned, which is fine) + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc} + fi + + default +} + +src_prepare() { + # Allow openssl to be cross-compiled + cp "${FILESDIR}"/gentoo.config-1.0.4 gentoo.config || die + chmod a+rx gentoo.config || die + + # Keep this in sync with app-misc/c_rehash + SSL_CNF_DIR="/etc/ssl" + + # Make sure we only ever touch Makefile.org and avoid patching a file + # that gets blown away anyways by the Configure script in src_configure + rm -f Makefile + + if ! use vanilla ; then + PATCHES+=( + # Add patches which are Gentoo-specific customisations here + ) + fi + + default + + if use test && use sctp && has network-sandbox ${FEATURES}; then + einfo "Disabling test '80-test_ssl_new.t' which is known to fail with FEATURES=network-sandbox ..." + rm test/recipes/80-test_ssl_new.t || die + fi + + # - Make sure the man pages are suffixed (bug #302165) + # - Don't bother building man pages if they're disabled + # - Make DOCDIR Gentoo compliant + sed -i \ + -e '/^MANSUFFIX/s:=.*:=ssl:' \ + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ + -e $(has noman FEATURES \ + && echo '/^install:/s:install_docs::' \ + || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ + -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \ + Configurations/unix-Makefile.tmpl \ + || die + + # Quiet out unknown driver argument warnings since openssl + # doesn't have well-split CFLAGS and we're making it even worse + # and 'make depend' uses -Werror for added fun (bug #417795 again) + tc-is-clang && append-flags -Qunused-arguments + + # We really, really need to build OpenSSL w/ strict aliasing disabled. + # It's filled with violations and it *will* result in miscompiled + # code. This has been in the ebuild for > 10 years but even in 2022, + # it's still relevant: + # - https://github.com/llvm/llvm-project/issues/55255 + # - https://github.com/openssl/openssl/issues/18225 + # - https://github.com/openssl/openssl/issues/18663#issuecomment-1181478057 + # Don't remove the no strict aliasing bits below! + filter-flags -fstrict-aliasing + append-flags -fno-strict-aliasing + + append-cppflags -DOPENSSL_NO_BUF_FREELISTS + + append-flags $(test-flags-CC -Wa,--noexecstack) + + # Prefixify Configure shebang (bug #141906) + sed \ + -e "1s,/usr/bin/env,${BROOT}&," \ + -i Configure || die + + # Remove test target when FEATURES=test isn't set + if ! use test ; then + sed \ + -e '/^$config{dirs}/s@ "test",@@' \ + -i Configure || die + fi + + if use prefix && [[ ${CHOST} == *-solaris* ]] ; then + # use GNU ld full option, not to confuse it on Solaris + sed -i \ + -e 's/-Wl,-M,/-Wl,--version-script=/' \ + -e 's/-Wl,-h,/-Wl,--soname=/' \ + Configurations/10-main.conf || die + + # fix building on Solaris 10 + # https://github.com/openssl/openssl/issues/6333 + sed -i \ + -e 's/-lsocket -lnsl -ldl/-lsocket -lnsl -ldl -lrt/' \ + Configurations/10-main.conf || die + fi + + local sslout=$(./gentoo.config) + einfo "Using configuration: ${sslout:-(openssl knows best)}" + + # The config script does stupid stuff to prompt the user. Kill it. + sed -i '/stty -icanon min 0 time 50; read waste/d' config || die + ./config ${sslout} --test-sanity || die "I AM NOT SANE" + + multilib_copy_sources +} + +multilib_src_configure() { + # bug #197996 + unset APPS + # bug #312551 + unset SCRIPTS + # bug #311473 + unset CROSS_COMPILE + + tc-export AR CC CXX RANLIB RC + + use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; } + + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal") + + # See if our toolchain supports __uint128_t. If so, it's 64bit + # friendly and can use the nicely optimized code paths, bug #460790. + #local ec_nistp_64_gcc_128 + # + # Disable it for now though (bug #469976) + # Do NOT re-enable without substantial discussion first! + # + #echo "__uint128_t i;" > "${T}"/128.c + #if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then + # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128" + #fi + + local sslout=$(./gentoo.config) + einfo "Use configuration ${sslout:-(openssl knows best)}" + local config="Configure" + [[ -z ${sslout} ]] && config="config" + + # "disable-deprecated" option breaks too many consumers. + # Don't set it without thorough revdeps testing. + # Make sure user flags don't get added *yet* to avoid duplicated + # flags. + local myeconfargs=( + ${sslout} + + $(use cpu_flags_x86_sse2 || echo "no-sse2") + enable-camellia + enable-ec + enable-ec2m + enable-sm2 + enable-srp + $(use elibc_musl && echo "no-async") + ${ec_nistp_64_gcc_128} + enable-idea + enable-mdc2 + enable-rc5 + $(use_ssl sslv3 ssl3) + $(use_ssl sslv3 ssl3-method) + $(use_ssl asm) + $(use_ssl rfc3779) + $(use_ssl sctp) + $(use test || echo "no-tests") + $(use_ssl tls-compression zlib) + $(use_ssl tls-heartbeat heartbeats) + $(use_ssl weak-ssl-ciphers) + + --prefix="${EPREFIX}"/usr + --openssldir="${EPREFIX}"${SSL_CNF_DIR} + --libdir=$(get_libdir) + + shared + threads + ) + + CFLAGS= LDFLAGS= edo ./${config} "${myeconfargs[@]}" + + # Clean out hardcoded flags that openssl uses + local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \ + -e 's:^CFLAGS=::' \ + -e 's:\(^\| \)-fomit-frame-pointer::g' \ + -e 's:\(^\| \)-O[^ ]*::g' \ + -e 's:\(^\| \)-march=[^ ]*::g' \ + -e 's:\(^\| \)-mcpu=[^ ]*::g' \ + -e 's:\(^\| \)-m[^ ]*::g' \ + -e 's:^ *::' \ + -e 's: *$::' \ + -e 's: \+: :g' \ + -e 's:\\:\\\\:g' + ) + + # Now insert clean default flags with user flags + sed -i \ + -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \ + -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \ + Makefile || die +} + +multilib_src_compile() { + # depend is needed to use $confopts; it also doesn't matter + # that it's -j1 as the code itself serializes subdirs + emake -j1 depend + + emake all +} + +multilib_src_test() { + emake -j1 test +} + +multilib_src_install() { + # We need to create ${ED}/usr on our own to avoid a race condition (bug #665130) + dodir /usr + + emake DESTDIR="${D}" install + + # This is crappy in that the static archives are still built even + # when USE=static-libs. But this is due to a failing in the openssl + # build system: the static archives are built as PIC all the time. + # Only way around this would be to manually configure+compile openssl + # twice; once with shared lib support enabled and once without. + if ! use static-libs; then + rm "${ED}"/usr/$(get_libdir)/lib{crypto,ssl}.a || die + fi +} + +multilib_src_install_all() { + # openssl installs perl version of c_rehash by default, but + # we provide a shell version via app-misc/c_rehash + rm "${ED}"/usr/bin/c_rehash || die + + dodoc CHANGES* FAQ NEWS README doc/*.txt doc/${PN}-c-indent.el + + # Create the certs directory + keepdir ${SSL_CNF_DIR}/certs + + # Namespace openssl programs to prevent conflicts with other man pages + cd "${ED}"/usr/share/man || die + local m d s + for m in $(find . -type f | xargs grep -L '#include') ; do + d=${m%/*} + d=${d#./} + m=${m##*/} + + [[ ${m} == openssl.1* ]] && continue + + [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!" + + mv ${d}/{,ssl-}${m} || die + + # Fix up references to renamed man pages + sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} || die + ln -s ssl-${m} ${d}/openssl-${m} + + # Locate any symlinks that point to this man page + # We assume that any broken links are due to the above renaming + for s in $(find -L ${d} -type l) ; do + s=${s##*/} + + rm -f ${d}/${s} + + # We don't want to "|| die" here + ln -s ssl-${m} ${d}/ssl-${s} + ln -s ssl-${s} ${d}/openssl-${s} + done + done + [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :(" + + # bug #254521 + dodir /etc/sandbox.d + echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl + + diropts -m0700 + keepdir ${SSL_CNF_DIR}/private +} + +pkg_postinst() { + ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes (bug #333069)" + c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null + eend $? +} |