python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / compression / xar / 0002-Use-pkg-config-for-libxml2.patch
blobd71ad4b753c17e44dfb2cb9f6d36d585493e2ce5
1 From 276833851657c85651c053ee16b8e1a8dc768a50 Mon Sep 17 00:00:00 2001
2 From: Andrew Childs <andrew.childs@bibo.com.ph>
3 Date: Sun, 15 Nov 2020 19:12:56 +0900
4 Subject: [PATCH 2/2] Use pkg-config for libxml2
6 ---
7 configure.ac | 66 +++++++++-------------------------------------------
8 1 file changed, 11 insertions(+), 55 deletions(-)
10 diff --git a/configure.ac b/configure.ac
11 index 358ab89..984a694 100644
12 --- a/configure.ac
13 +++ b/configure.ac
14 @@ -268,61 +268,17 @@ dnl Configure libxml2.
15 dnl
16 LIBXML2_VERSION_MIN=2.6.11
18 -have_libxml2="1"
20 -AC_ARG_WITH([xml2-config], [ --with-xml2-config libxml2 config program],
21 -if test "x${with_xml2_config}" = "xno" ; then
22 - XML2_CONFIG=
23 -else
24 - XML2_CONFIG="${with_xml2_config}"
25 -fi
27 - XML2_CONFIG=
29 -if test "x${XML2_CONFIG}" != "x" ; then
30 - if test ! -x "${XML2_CONFIG}" ; then
31 - AC_MSG_ERROR([Unusable or missing xml2-config: ${XML2_CONFIG}])
32 - fi
33 -else
34 - AC_PATH_PROG([XML2_CONFIG], [xml2-config], , [${PATH}])
35 - if test "x${XML2_CONFIG}" = "x" ; then
36 - AC_MSG_ERROR([Cannot configure without xml2-config])
37 - fi
38 -fi
40 -dnl Make sure the version of libxml2 found is sufficient.
41 -AC_MSG_CHECKING([for libxml >= ${LIBXML2_VERSION_MIN}])
42 -LIBXML2_FOUND=`2>&1 ${XML2_CONFIG} --version`
43 -LIBXML2_MAJOR=`echo ${LIBXML2_FOUND} | tr . " " | awk '{print $1}'`
44 -LIBXML2_MINOR=`echo ${LIBXML2_FOUND} | tr . " " | awk '{print $2}' | tr a-z " " |awk '{print $1}'`
45 -LIBXML2_BRANCH=`echo ${LIBXML2_FOUND} | tr . " " | awk '{print $3}' | tr a-z " " |awk '{print $1}'`
46 -if test "x${LIBXML2_BRANCH}" = "x" ; then
47 - LIBXML2_BRANCH=0
48 -fi
49 -LIBXML2_MAJOR_MIN=`echo ${LIBXML2_VERSION_MIN} | tr . " " | awk '{print $1}'`
50 -LIBXML2_MINOR_MIN=`echo ${LIBXML2_VERSION_MIN} | tr . " " | awk '{print $2}'`
51 -LIBXML2_BRANCH_MIN=`echo ${LIBXML2_VERSION_MIN} | tr . " " | awk '{print $3}'`
52 -if test ${LIBXML2_MAJOR} -gt ${LIBXML2_MAJOR_MIN} \
53 - -o ${LIBXML2_MAJOR} -eq ${LIBXML2_MAJOR_MIN} \
54 - -a ${LIBXML2_MINOR} -gt ${LIBXML2_MINOR_MIN} \
55 - -o ${LIBXML2_MAJOR} -eq ${LIBXML2_MAJOR_MIN} \
56 - -a ${LIBXML2_MINOR} -eq ${LIBXML2_MINOR_MIN} \
57 - -a ${LIBXML2_BRANCH} -ge $LIBXML2_BRANCH_MIN ; then
58 - AC_MSG_RESULT([${LIBXML2_MAJOR}.${LIBXML2_MINOR}.${LIBXML2_BRANCH}])
59 - have_libxml2="1"
60 - CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} --cflags`"
61 - LIBS="${LIBS} `${XML2_CONFIG} --libs`"
62 -else
63 - AC_MSG_RESULT([no])
64 - have_libxml2="0"
65 -fi
66 -if test "x${have_libxml2}" = "x1" ; then
67 - dnl Final sanity check, to make sure that xmlwriter is present.
68 - AC_CHECK_HEADER([libxml/xmlwriter.h], , [have_libxml2="0"])
69 -fi
70 -if test "x${have_libxml2}" = "x0" ; then
71 - AC_MSG_ERROR([Cannot build without libxml2])
72 -fi
73 +PKG_PROG_PKG_CONFIG
75 +PKG_CHECK_MODULES(LIBXML2_PKGCONFIG, [libxml-2.0 >= ${LIBXML2_VERSION_MIN}],
76 + [
77 + have_libxml2=1
78 + CPPFLAGS="${CPPFLAGS} ${LIBXML2_PKGCONFIG_CFLAGS}"
79 + LIBS="${LIBS} ${LIBXML2_PKGCONFIG_LIBS}"
80 + ],
81 + [
82 + have_libxml2=0
83 + ])
85 dnl
86 dnl Configure libcrypto (part of OpenSSL).
87 --
88 2.28.0