diff options
author | Sam James <sam@gentoo.org> | 2024-01-10 11:21:09 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-01-10 11:21:57 +0000 |
commit | 231fb829f816206e368c83c44e3f3a175b217918 (patch) | |
tree | 1fefe76c5402680f7b006b70e62153d6cb65de8e /dev-libs/xerces-c | |
parent | sci-mathematics/form: remove old version (diff) | |
download | gentoo-231fb829f816206e368c83c44e3f3a175b217918.tar.gz gentoo-231fb829f816206e368c83c44e3f3a175b217918.tar.bz2 gentoo-231fb829f816206e368c83c44e3f3a175b217918.zip |
dev-libs/xerces-c: disable strict aliasing, filter LTO
It's only in the tests but it implies they're not testing it at all.
Closes: https://bugs.gentoo.org/856100
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/xerces-c')
-rw-r--r-- | dev-libs/xerces-c/files/xerces-c-3.2.4-strict-aliasing.patch | 13 | ||||
-rw-r--r-- | dev-libs/xerces-c/xerces-c-3.2.4-r3.ebuild | 123 | ||||
-rw-r--r-- | dev-libs/xerces-c/xerces-c-9999.ebuild | 15 |
3 files changed, 147 insertions, 4 deletions
diff --git a/dev-libs/xerces-c/files/xerces-c-3.2.4-strict-aliasing.patch b/dev-libs/xerces-c/files/xerces-c-3.2.4-strict-aliasing.patch new file mode 100644 index 000000000000..18483070e736 --- /dev/null +++ b/dev-libs/xerces-c/files/xerces-c-3.2.4-strict-aliasing.patch @@ -0,0 +1,13 @@ +https://bugs.gentoo.org/856100 +--- a/cmake/XercesWarnings.cmake ++++ b/cmake/XercesWarnings.cmake +@@ -50,8 +50,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR + -Wswitch-default + -Wunused-variable + -Wwrite-strings +- -Wno-variadic-macros +- -fstrict-aliasing) ++ -Wno-variadic-macros) + if(extra-warnings) + list(APPEND test_flags + -Wfloat-equal diff --git a/dev-libs/xerces-c/xerces-c-3.2.4-r3.ebuild b/dev-libs/xerces-c/xerces-c-3.2.4-r3.ebuild new file mode 100644 index 000000000000..fea427072055 --- /dev/null +++ b/dev-libs/xerces-c/xerces-c-3.2.4-r3.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake flag-o-matic prefix + +DESCRIPTION="Validating XML parser written in a portable subset of C++" +HOMEPAGE="https://xerces.apache.org/xerces-c/" + +if [[ ${PV} == *9999 ]] ; then + ESVN_REPO_URI="https://svn.apache.org/repos/asf/xerces/c/trunk" + inherit subversion +else + SRC_URI="mirror://apache/xerces/c/3/sources/${P}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos" +fi + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="cpu_flags_x86_sse2 curl doc examples iconv icu static-libs test threads" + +RESTRICT="!test? ( test )" + +RDEPEND=" + curl? ( net-misc/curl ) + icu? ( dev-libs/icu:0= ) + virtual/libiconv" +DEPEND="${RDEPEND}" +BDEPEND=" + doc? ( app-doc/doxygen ) + test? ( dev-lang/perl )" + +DOCS=( CREDITS KEYS NOTICE README ) + +PATCHES=( + "${FILESDIR}"/${PN}-3.2.2-fix-XERCESC-2163.patch + "${FILESDIR}"/${PN}-3.2.4-strict-aliasing.patch +) + +pkg_setup() { + export ICUROOT="${EPREFIX}/usr" + + if use iconv && use icu; then + ewarn "This package can use iconv or icu for loading messages" + ewarn "and transcoding, but not both. ICU takes precedence." + fi +} + +src_configure() { + # bug #856100 + filter-lto + append-flags -fno-strict-aliasing + + # 'cfurl' is only available on OSX and 'socket' isn't supposed to work. + # But the docs aren't clear about it, so we would need some testing... + local netaccessor + if use curl; then + netaccessor="curl" + elif use elibc_Darwin; then + netaccessor="cfurl" + else + netaccessor="socket" + fi + + local msgloader + if use icu; then + msgloader="icu" + elif use iconv; then + msgloader="iconv" + else + msgloader="inmemory" + fi + + local transcoder + if use icu; then + transcoder="icu" + elif use elibc_Darwin; then + transcoder="macosunicodeconverter" + else + transcoder="gnuiconv" + fi + + local mycmakeargs=( + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}" + -Dnetwork-accessor="${netaccessor}" + -Dmessage-loader="${msgloader}" + -Dtranscoder="${transcoder}" + -Dthreads:BOOL="$(usex threads)" + -Dsse2:BOOL="$(usex cpu_flags_x86_sse2)" + ) + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + + use doc && cmake_build doc-style createapidocs doc-xml +} + +src_install() { + cmake_src_install + + # package provides .pc files + find "${D}" -name '*.la' -delete || die + + if use examples; then + # clean out object files, executables, Makefiles + # and the like before installing examples + find samples/ \( -type f -executable -o -iname 'runConfigure' -o -iname '*.o' \ + -o -iname '.libs' -o -iname 'Makefile*' \) -exec rm -rf '{}' + || die + docinto examples + dodoc -r samples/. + docompress -x /usr/share/doc/${PF}/examples + fi + + # To make sure an appropriate NLS msg file is around when using + # the iconv msgloader ICU has the messages compiled in. + if use iconv && ! use icu; then + doenvd "$(prefixify_ro "${FILESDIR}/50xerces-c")" + fi +} diff --git a/dev-libs/xerces-c/xerces-c-9999.ebuild b/dev-libs/xerces-c/xerces-c-9999.ebuild index 4b24ee3df5d8..fea427072055 100644 --- a/dev-libs/xerces-c/xerces-c-9999.ebuild +++ b/dev-libs/xerces-c/xerces-c-9999.ebuild @@ -1,11 +1,11 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -inherit cmake prefix +inherit cmake flag-o-matic prefix -DESCRIPTION="A validating XML parser written in a portable subset of C++" +DESCRIPTION="Validating XML parser written in a portable subset of C++" HOMEPAGE="https://xerces.apache.org/xerces-c/" if [[ ${PV} == *9999 ]] ; then @@ -33,7 +33,10 @@ BDEPEND=" DOCS=( CREDITS KEYS NOTICE README ) -PATCHES=( "${FILESDIR}"/${PN}-3.2.2-fix-XERCESC-2163.patch ) +PATCHES=( + "${FILESDIR}"/${PN}-3.2.2-fix-XERCESC-2163.patch + "${FILESDIR}"/${PN}-3.2.4-strict-aliasing.patch +) pkg_setup() { export ICUROOT="${EPREFIX}/usr" @@ -45,6 +48,10 @@ pkg_setup() { } src_configure() { + # bug #856100 + filter-lto + append-flags -fno-strict-aliasing + # 'cfurl' is only available on OSX and 'socket' isn't supposed to work. # But the docs aren't clear about it, so we would need some testing... local netaccessor |