diff options
author | Sam James <sam@gentoo.org> | 2022-07-17 14:16:09 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-07-17 14:16:44 +0000 |
commit | d5a6ece3ba0373b986b1952b3297b897f9140055 (patch) | |
tree | fef0b5f9f5e068d9f32952ee1e5f5e20207f82f6 /media-libs/raptor | |
parent | sys-devel/gcc: add 12.1.1_p20220716 (diff) | |
download | gentoo-d5a6ece3ba0373b986b1952b3297b897f9140055.tar.gz gentoo-d5a6ece3ba0373b986b1952b3297b897f9140055.tar.bz2 gentoo-d5a6ece3ba0373b986b1952b3297b897f9140055.zip |
media-libs/raptor: use pkg-config for ICU/libxml2/libxslt (fix LLD)
Prompted by discussion with Jannik2099 and Naib in #gentoo-chat.
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/raptor')
4 files changed, 273 insertions, 0 deletions
diff --git a/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-icu.patch b/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-icu.patch new file mode 100644 index 000000000000..60fffcd804ee --- /dev/null +++ b/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-icu.patch @@ -0,0 +1,48 @@ +https://github.com/dajobe/raptor/commit/3af116d61babd7042b42018c67a63baebf486df7 + +Fixes build with e.g. lld. + +From 3af116d61babd7042b42018c67a63baebf486df7 Mon Sep 17 00:00:00 2001 +From: Hugh McMaster <hugh.mcmaster@outlook.com> +Date: Fri, 21 Aug 2020 20:48:17 +1000 +Subject: [PATCH] configure.ac: Use PKG_CHECK_MODULES to detect the ICU library + +--- a/configure.ac ++++ b/configure.ac +@@ -621,21 +621,10 @@ else + AC_MSG_RESULT(yes - $LIBCURL_VERSION) + fi + +- +-AC_ARG_WITH(icu-config, [ --with-icu-config=PATH Location of ICU icu-config []], icu_config="$withval", icu_config="") +- +-have_icu=no +-AC_MSG_CHECKING(for ICU) +-if test "X$icu_config" != "Xno" -a "X$icu_config" != "X" ; then +- ICU_CONFIG=$icu_config +- ICU_VERSION=`$ICU_CONFIG --version` ++PKG_CHECK_MODULES([ICU], [icu-uc], [ + have_icu=yes +- AC_MSG_RESULT(yes - version $ICU_VERSION) +-else +- AC_MSG_RESULT(no) +-fi +-dnl Note there is NO automated searching for icu-config +- ++ ICU_VERSION=`$PKG_CONFIG icu-uc --modversion` ++], [have_icu=no]) + + AC_ARG_WITH(www-config, [ --with-libwww-config=PATH Location of W3C libwww libwww-config []], libwww_config="$withval", libwww_config="") + +@@ -1183,8 +1172,8 @@ dnl ICU for NFC check + AC_MSG_CHECKING(NFC library to use) + nfc_library=none + if test $need_icu = yes; then +- CPPFLAGS="$CPPFLAGS `$ICU_CONFIG --cppflags-searchpath`" +- RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS `$ICU_CONFIG --ldflags-searchpath` -licuuc" ++ CPPFLAGS="$CPPFLAGS $ICU_CFLAGS" ++ RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $ICU_LIBS" + AC_LIBOBJ(raptor_nfc_icu) + nfc_library="ICU $ICU_VERSION" + fi + diff --git a/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-libxml2.patch b/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-libxml2.patch new file mode 100644 index 000000000000..e53111b857fa --- /dev/null +++ b/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-libxml2.patch @@ -0,0 +1,41 @@ +https://github.com/dajobe/raptor/commit/3f9335b3cfd945a8d5f6f75f87cab04c53cc2b6d + +From 3f9335b3cfd945a8d5f6f75f87cab04c53cc2b6d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> +Date: Tue, 27 Oct 2015 10:35:35 +0100 +Subject: [PATCH] configure.ac: do additional checks on libxml2 when library is + found +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In yocto cross environments we must use pkg-config. Configuring with + + --without-xml2-config + --without-curl-config + +causes + +| checking for LIBXML... yes +| checking for libxml via pkg-config... yes - 2.9.2 +| checking for LIBCURL... yes +| checking for libcurl via pkg-config... yes - 7.44.0 +| checking for ICU... no +| checking for yajl installation... not found. Get it from http://lloyd.github.com/yajl/ and use --with-yajl=DIR if necessary to configure the installation directory. +| checking GRDDL parser requirements... no - libxml2 and libxslt are both not available + +Applying this patch fixes configuration. + +Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> +--- a/configure.ac ++++ b/configure.ac +@@ -599,7 +599,7 @@ have_libxml=0 + need_libxml=0 + + oCPPFLAGS="$CPPFLAGS" +-if test "X$XML_CONFIG" != X; then ++if test "X$libxml_source" != X; then + CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" + LIBS="$LIBS $LIBXML_LIBS" + AC_CHECK_FUNC(xmlCreatePushParserCtxt, have_xmlCreatePushParserCtxt=yes, have_xmlCreatePushParserCtxt=no) + diff --git a/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-libxslt.patch b/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-libxslt.patch new file mode 100644 index 000000000000..5ef9ac1b6ffa --- /dev/null +++ b/media-libs/raptor/files/raptor-2.0.15-use-pkg-config-libxslt.patch @@ -0,0 +1,102 @@ +Rebased version of https://github.com/dajobe/raptor/commit/abfdfb44cc00dfafbad4e594618621fce21590e1 + +--- a/configure.ac ++++ b/configure.ac +@@ -524,6 +524,44 @@ if test "X$xslt_config" != "Xno" ; then + fi + fi + ++if test "X$XSLT_CONFIG" != "X"; then ++ XSLT_CFLAGS=`$XSLT_CONFIG --cflags` ++ XSLT_LIBS=`$XSLT_CONFIG --libs` ++ ++ CPPFLAGS="$XSLT_CFLAGS $CPPFLAGS" ++ LIBS="$LIBS $XSLT_LIBS" ++ ++ AC_CHECK_FUNC(xsltSaveResultToString, have_xsltSaveResultToString=yes, have_xsltSaveResultToString=no) ++ AC_MSG_CHECKING(for libxslt via xslt-config) ++ if test $have_xsltSaveResultToString = yes; then ++ have_libxslt=1 ++ LIBXSLT_VERSION=`$XSLT_CONFIG --version` ++ libxslt_version_dec=`echo $LIBXSLT_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` ++ libxslt_min_version_dec=`echo $libxslt_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + 3)};'` ++ AC_MSG_RESULT(yes - version $LIBXSLT_VERSION) ++ if test $libxslt_version_dec -lt $libxslt_min_version_dec; then ++ AC_MSG_WARN(Using libxslt $LIBXSLT_VERSION is unsupported - $libxslt_min_version or newer required.) ++ have_libxslt=0 ++ fi ++ fi ++ ++ AC_CHECK_FUNC(xsltInit) ++ ++ AC_CHECK_HEADERS(libxslt/xslt.h) ++ if test "$ac_cv_header_libxslt_xslt_h" = no ; then ++ AC_MSG_WARN(libxslt library found but not headers - disabling) ++ have_libxslt_lib=0 ++ have_libxslt=0 ++ fi ++ CPPFLAGS="$oCPPFLAGS" ++ LIBS="$oLIBS" ++else ++ PKG_CHECK_MODULES([XSLT], [libxslt > $libxslt_min_version], [ ++ LIBXSLT_VERSION=`$PKG_CONFIG libxslt --modversion` ++ have_libxslt=1 ++ ], [have_libxslt=0]) ++fi ++ + libcurl_source=no + PKG_CHECK_MODULES([LIBCURL],[libcurl],[ + LIBCURL_VERSION=`$PKG_CONFIG libcurl --modversion` +@@ -650,41 +688,6 @@ fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" + +- +-have_libxslt=0 +- +-if test "X$XSLT_CONFIG" != X; then +- CPPFLAGS="`$XSLT_CONFIG --cflags` $CPPFLAGS" +- LIBS="$LIBS `$XSLT_CONFIG --libs`" +- AC_CHECK_FUNC(xsltSaveResultToString, have_xsltSaveResultToString=yes, have_xsltSaveResultToString=no) +- AC_MSG_CHECKING(for system libxslt library) +- if test $have_xsltSaveResultToString = yes; then +- have_libxslt=1 +- LIBXSLT_VERSION=`$XSLT_CONFIG --version` +- libxslt_version_dec=`echo $LIBXSLT_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +- libxslt_min_version_dec=`echo $libxslt_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +- AC_MSG_RESULT(yes - version $LIBXSLT_VERSION) +- if test $libxslt_version_dec -lt $libxslt_min_version_dec; then +- AC_MSG_WARN(Using libxslt $LIBXSLT_VERSION is unsupported - $libxslt_min_version or newer required.) +- have_libxslt=0 +- fi +- else +- AC_MSG_RESULT(no) +- fi +- +- AC_CHECK_FUNC(xsltInit) +- +- AC_CHECK_HEADERS(libxslt/xslt.h) +- if test "$ac_cv_header_libxslt_xslt_h" = no ; then +- AC_MSG_WARN(libxslt library found but not headers - disabling) +- have_libxslt_lib=0 +- have_libxslt=0 +- fi +-fi +-CPPFLAGS="$oCPPFLAGS" +-LIBS="$oLIBS" +- +- + dnl Check for JSON library + + AC_ARG_WITH(yajl, [ --with-yajl=DIR YAJL installation directory or 'no' to disable (default=auto)], yajl_prefix="$withval", yajl_prefix="none") +@@ -1184,8 +1187,8 @@ AM_CONDITIONAL(RAPTOR_XML_LIBXML, test $need_libxml = 1) + + + if test $need_libxslt = 1; then +- RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS `$XSLT_CONFIG --libs`" +- CPPFLAGS="`$XSLT_CONFIG --cflags` $CPPFLAGS" ++ RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $XSLT_LIBS" ++ CPPFLAGS="$CPPFLAGS $XSLT_CFLAGS" + fi + + if test $need_libyajl = 1; then diff --git a/media-libs/raptor/raptor-2.0.15-r5.ebuild b/media-libs/raptor/raptor-2.0.15-r5.ebuild new file mode 100644 index 000000000000..bc6bb24ae8c0 --- /dev/null +++ b/media-libs/raptor/raptor-2.0.15-r5.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools multilib-minimal + +MY_PN=${PN}2 +MY_P=${MY_PN}-${PV} + +DESCRIPTION="The RDF Parser Toolkit" +HOMEPAGE="http://librdf.org/raptor/" +SRC_URI="http://download.librdf.org/source/${MY_P}.tar.gz" + +LICENSE="Apache-2.0 GPL-2 LGPL-2.1" +SLOT="2" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="+curl debug json static-libs" + +DEPEND=" + dev-libs/libxml2[${MULTILIB_USEDEP}] + dev-libs/libxslt[${MULTILIB_USEDEP}] + dev-libs/icu:=[${MULTILIB_USEDEP}] + sys-libs/zlib[${MULTILIB_USEDEP}] + curl? ( net-misc/curl[${MULTILIB_USEDEP}] ) + json? ( dev-libs/yajl[${MULTILIB_USEDEP}] ) +" +RDEPEND="${DEPEND} + !media-libs/raptor:0 +" +BDEPEND=" + >=sys-devel/bison-3 + >=sys-devel/flex-2.5.36 + virtual/pkgconfig +" + +S="${WORKDIR}/${MY_P}" + +DOCS=( AUTHORS ChangeLog NEWS NOTICE README ) +HTML_DOCS=( {NEWS,README,RELEASE,UPGRADING}.html ) + +PATCHES=( + "${FILESDIR}/${P}-heap-overflow.patch" + "${FILESDIR}/${P}-dont_use_curl-config.patch" #552474 + "${FILESDIR}/0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch" + "${FILESDIR}/${P}-use-pkg-config-libxml2.patch" + "${FILESDIR}/${P}-use-pkg-config-icu.patch" + "${FILESDIR}/${P}-use-pkg-config-libxslt.patch" +) + +src_prepare() { + default + + # bug #552474 + eautoreconf + + multilib_copy_sources +} + +multilib_src_configure() { + # FIXME: It should be possible to use net-nntp/inn for libinn.h and -linn! + + local myeconfargs=( + --with-html-dir="${EPREFIX}"/usr/share/gtk-doc/html + $(usex curl --with-www=curl --with-www=xml) + $(use_enable debug) + $(use_with json yajl) + $(use_enable static-libs static) + ) + + econf "${myeconfargs[@]}" +} + +multilib_src_test() { + emake -j1 test +} + +multilib_src_install() { + default + + find "${ED}" -name '*.la' -delete || die +} |