Fix broken xslt-config binary

References: https://bugzilla.redhat.com/show_bug.cgi?id=1498539
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2017-10-04 18:40:51 +02:00
parent 64bdce0820
commit 55b8bb048c
2 changed files with 126 additions and 2 deletions

View File

@ -0,0 +1,117 @@
From 76df4c960c7247d82bf1c26344e76236cb37a175 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Thu, 14 Sep 2017 16:24:16 +0200
Subject: [PATCH] Fix pkg-config related regressions in configure script
Fix bashism in configure.in. Resulted in pkg-config never getting used
for libxml if sh is not bash.
Move pkg-config block to correct location. Rework libxml2 detection
logic.
Fixes bugs 787602 and 787617.
---
configure.in | 54 ++++++++++++++++++++++--------------------------------
1 file changed, 22 insertions(+), 32 deletions(-)
diff --git a/configure.in b/configure.in
index d6aa3664..d39a916b 100644
--- a/configure.in
+++ b/configure.in
@@ -501,32 +501,11 @@ AC_ARG_WITH(libxml-src,
)
AC_SUBST(LIBXML_SRC)
-dnl
-dnl Try pkg-config first if nothing is set
-dnl
-
-if test "x$LIBXML_CONFIG_PREFIX" == "x" -a "x$LIBXML_SRC" == "x"
-then
- PKG_CHECK_MODULES([LIBXML], [libxml-2.0 >= $LIBXML_REQUIRED_VERSION], [
- LIBXML_MANUAL_SEARCH=no
- WITH_MODULES="`$PKG_CONFIG --variable=modules libxml-2.0`"
- ],
- [
- LIBXML_MANUAL_SEARCH=yes
- ])
-else
- LIBXML_MANUAL_SEARCH=yes
-fi
-
-if test "x$LIBXML_MANUAL_SEARCH" != "xno"
-then
-
dnl
dnl where is xml2-config
dnl
AC_SUBST(LIBXML_REQUIRED_VERSION)
-AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
if test "x$LIBXML_CONFIG_PREFIX" != "x"
then
AC_PATH_TOOL([XML_CONFIG], [xml2-config], [false], [${LIBXML_CONFIG_PREFIX}/bin])
@@ -570,20 +549,33 @@ then
LIBXML_SRC=`pwd`
XML_CONFIG="${LIBXML_SRC}/xml2-config"
LIBXML_CFLAGS="-I${LIBXML_SRC}/include"
- LIBXML_LIBS="-L${LIBXML_SRC}"
+ LIBXML_LIBS="-L${LIBXML_SRC} `$XML_CONFIG --libs`"
+ WITH_MODULES="`$XML_CONFIG --modules`"
cd $CWD
else
AC_MSG_ERROR([libxml source dir not found (${LIBXML_SRC}), typo?])
fi
fi
+dnl
+dnl Try pkg-config first if nothing is set
+dnl
+
+if test "x$LIBXML_CONFIG_PREFIX" = "x" -a "x$LIBXML_LIBS" = "x"
+then
+ PKG_CHECK_MODULES([LIBXML], [libxml-2.0 >= $LIBXML_REQUIRED_VERSION], [
+ WITH_MODULES="`$PKG_CONFIG --variable=modules libxml-2.0`"
+ ], [ ])
+fi
+
dnl
dnl make sure xml2-config is executable,
dnl test version and init our variables
dnl
-if ${XML_CONFIG} --libs print > /dev/null 2>&1
+if test "x$LIBXML_LIBS" = "x" && ${XML_CONFIG} --libs print > /dev/null 2>&1
then
+ AC_MSG_CHECKING(for libxml libraries >= $LIBXML_REQUIRED_VERSION)
XMLVERS=`$XML_CONFIG --version`
if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
then
@@ -591,17 +583,15 @@ then
else
AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
fi
- LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
- if test "x$LIBXML_SRC" = "x"; then
- LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
- fi
-else
- AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
+ LIBXML_LIBS="`$XML_CONFIG --libs`"
+ LIBXML_CFLAGS="`$XML_CONFIG --cflags`"
+ WITH_MODULES="`$XML_CONFIG --modules`"
fi
-WITH_MODULES="`$XML_CONFIG --modules`"
-
-fi # LIBXML_MANUAL_SEARCH
+if test "x$LIBXML_LIBS" = "x"
+then
+ AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
+fi
AC_SUBST(CFLAGS)
--
2.14.2

View File

@ -3,7 +3,7 @@
Summary: Library providing the Gnome XSLT engine
Name: libxslt
Version: 1.1.30
Release: 1%{?dist}%{?extra_release}
Release: 2%{?dist}%{?extra_release}
License: MIT
Group: Development/Libraries
Source: ftp://xmlsoft.org/XSLT/libxslt-%{version}.tar.gz
@ -18,6 +18,10 @@ BuildRequires: automake autoconf
Patch0: multilib.patch
Patch1: libxslt-1.1.26-utf8-docs.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1498539
# https://git.gnome.org/browse/libxslt/commit/?id=76df4c960c7247d82bf1c26344e76236cb37a175
Patch2: 0001-Fix-pkg-config-related-regressions-in-configure-scri.patch
%description
This C library allows to transform XML files into other XML files
(or HTML, text, ...) using the standard XSLT stylesheet transformation
@ -60,6 +64,7 @@ with XPath functions written in Python.
%setup -q
%patch0 -p1
%patch1 -p1 -b .utf8
%patch2 -p1 -b .xml_config
# Now fix up the timestamps of patched docs files
# ChangeLog needs to be retouched before gzip as well
# since timestamp affects output
@ -127,8 +132,10 @@ make tests
%doc python/tests/*.xsl
%changelog
* Mon Sep 4 2017 Daniel Veillard <veillard@redhat.com> 1.1.30-1
* Wed Oct 04 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.1.30-2
- Fix broken xslt-config binary
* Mon Sep 4 2017 Daniel Veillard <veillard@redhat.com> 1.1.30-1
- Update to 1.1.30
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.29-6