[libxslt] add optional feature support (#24240)

Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
This commit is contained in:
Gordon Smith 2022-04-22 17:51:17 +01:00 committed by GitHub
parent 79afdf87b3
commit 2ac61f87f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 108 additions and 6 deletions

View File

@ -20,6 +20,7 @@ vcpkg_from_github(
0002-Fix-lzma.patch
0003-Fix-configure.patch
only_build_one_lib_type.patch
require-dependencies.patch
)
if (VCPKG_TARGET_IS_WINDOWS)
@ -125,13 +126,31 @@ if (VCPKG_TARGET_IS_WINDOWS)
file(COPY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()
else()
if("python" IN_LIST FEATURES)
vcpkg_find_acquire_program(PYTHON3)
set(OPTION_PYTHON "--with-python=${PYTHON3}")
else()
set(OPTION_PYTHON "--without-python")
endif()
if ("plugins" IN_LIST FEATURES)
set(OPTION_PLUGINS "--with-plugins")
else()
set(OPTION_PLUGINS "--without-plugins")
endif()
if("crypto" IN_LIST FEATURES)
vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/tools/libgcrypt/bin")
set(OPTION_CRYPTO "--with-crypto")
else()
set(OPTION_CRYPTO "--without-crypto")
endif()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
OPTIONS
--without-python
--without-plugins
--with-crypto
${OPTION_PYTHON}
${OPTION_PLUGINS}
${OPTION_CRYPTO}
OPTIONS_DEBUG
--with-mem-debug
--with-debug

View File

@ -0,0 +1,44 @@
--- a/configure.ac
+++ b/configure.ac
@@ -240,12 +240,13 @@
else
if test -x "$with_python"
then
echo Found python in $with_python
PYTHON="$with_python"
else
+ AC_MSG_ERROR([Python not found; --with-python should be set to the python path])
if test -x "$PYTHON"
then
echo Found python in environment PYTHON=$PYTHON
with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
else
AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
@@ -333,25 +334,25 @@
if test "$LIBGCRYPT_CONFIG" != "no" ; then
LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
then
LIBGCRYPT_CFLAGS=""
LIBGCRYPT_LIBS=""
- echo 'gcrypt library version < 1.1.42 - Crypto extensions will not be available.'
+ AC_MSG_ERROR([gcrypt library version < 1.1.42 - this is an error])
else
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
echo 'Crypto extensions will be available.'
WITH_CRYPTO=1
CRYPTO_TESTDIR=crypto
fi
else
LIBGCRYPT_CFLAGS=""
LIBGCRYPT_LIBS=""
- echo 'Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.'
+ AC_MSG_ERROR([libgcrypt not found - this is a bug in the vcpkg port])
fi
esac
fi
AC_SUBST(WITH_CRYPTO)
AC_SUBST(CRYPTO_TESTDIR)
AC_SUBST(LIBGCRYPT_CFLAGS)

View File

@ -1,7 +1,7 @@
{
"name": "libxslt",
"version": "1.1.34",
"port-version": 4,
"port-version": 5,
"description": "Libxslt is a XSLT library implemented in C for XSLT 1.0 and most of EXSLT",
"homepage": "https://github.com/GNOME/libxslt",
"license": null,
@ -9,5 +9,39 @@
"dependencies": [
"liblzma",
"libxml2"
]
],
"default-features": [
"default-features"
],
"features": {
"crypto": {
"description": "Build with crypto support (--with-crypto)",
"supports": "mingw | !windows",
"dependencies": [
{
"name": "libgcrypt",
"platform": "!mingw"
}
]
},
"default-features": {
"description": "default features for the current platform",
"dependencies": [
{
"name": "libxslt",
"default-features": false,
"features": [
"crypto"
],
"platform": "mingw | !windows"
}
]
},
"plugins": {
"description": "Build with plugins (--with-plugins)"
},
"python": {
"description": "Builds with python support (--with-python)"
}
}
}

View File

@ -4198,7 +4198,7 @@
},
"libxslt": {
"baseline": "1.1.34",
"port-version": 4
"port-version": 5
},
"libyaml": {
"baseline": "0.2.5",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "063e2e6a6b9ef700f0c2587d2def57eb0e2285e6",
"version": "1.1.34",
"port-version": 5
},
{
"git-tree": "034ea26a2cde47c4d19df6eb35bc124a79ad37a3",
"version": "1.1.34",