aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/openldap
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/openldap')
-rw-r--r--vcpkg/ports/openldap/android.diff13
-rw-r--r--vcpkg/ports/openldap/cyrus-sasl.diff22
-rw-r--r--vcpkg/ports/openldap/openssl.patch42
-rw-r--r--vcpkg/ports/openldap/portfile.cmake61
-rw-r--r--vcpkg/ports/openldap/subdirs.patch34
-rw-r--r--vcpkg/ports/openldap/vcpkg.json26
6 files changed, 198 insertions, 0 deletions
diff --git a/vcpkg/ports/openldap/android.diff b/vcpkg/ports/openldap/android.diff
new file mode 100644
index 0000000..294c16f
--- /dev/null
+++ b/vcpkg/ports/openldap/android.diff
@@ -0,0 +1,13 @@
+diff --git a/libraries/libldap/utf-8-conv.c b/libraries/libldap/utf-8-conv.c
+index 98ed58d..4bd5459 100644
+--- a/libraries/libldap/utf-8-conv.c
++++ b/libraries/libldap/utf-8-conv.c
+@@ -328,7 +328,7 @@ ldap_x_wcs_to_utf8s ( char *utf8str, const wchar_t *wcstr, size_t count )
+ return (p - utf8str);
+ }
+
+-#ifdef ANDROID
++#if 0
+ int wctomb(char *s, wchar_t wc) { return wcrtomb(s,wc,NULL); }
+ int mbtowc(wchar_t *pwc, const char *s, size_t n) { return mbrtowc(pwc, s, n, NULL); }
+ #endif
diff --git a/vcpkg/ports/openldap/cyrus-sasl.diff b/vcpkg/ports/openldap/cyrus-sasl.diff
new file mode 100644
index 0000000..5b622bb
--- /dev/null
+++ b/vcpkg/ports/openldap/cyrus-sasl.diff
@@ -0,0 +1,22 @@
+diff --git a/configure.ac b/configure.ac
+index f01b7e6..c4a6faa 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2008,14 +2008,13 @@ WITH_SASL=no
+ ol_link_sasl=no
+ ol_link_spasswd=no
+ if test $ol_with_cyrus_sasl != no ; then
++ PKG_CHECK_MODULES(SASL, libsasl2, [have_openssl=yes], [AC_MSG_FAILURE([OpenSSL is required])])
++ CFLAGS="$CFLAGS $SASL_CFLAGS"
+ AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
+
+ if test $ac_cv_header_sasl_sasl_h = yes ||
+ test $ac_cv_header_sasl_h = yes; then
+- AC_CHECK_LIB(sasl2, sasl_client_init,
+- [ol_link_sasl="-lsasl2"],
+- [AC_CHECK_LIB(sasl, sasl_client_init,
+- [ol_link_sasl="-lsasl"])])
++ ol_link_sasl="$SASL_LIBS"
+ fi
+
+ if test $ol_link_sasl = no ; then
diff --git a/vcpkg/ports/openldap/openssl.patch b/vcpkg/ports/openldap/openssl.patch
new file mode 100644
index 0000000..88c11f3
--- /dev/null
+++ b/vcpkg/ports/openldap/openssl.patch
@@ -0,0 +1,42 @@
+diff --git a/configure.ac b/configure.ac
+index d231e0e..c994103 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1239,6 +1239,8 @@ fi
+
+ ol_link_tls=no
+ if test $ol_with_tls = openssl || test $ol_with_tls = auto ; then
++ PKG_CHECK_MODULES(OPENSSL, openssl >= 1.1.1, [have_openssl=yes], [AC_MSG_FAILURE([OpenSSL is required])])
++ CFLAGS="${OPENSSL_CFLAGS} ${CFLAGS}"
+ AC_CHECK_HEADERS(openssl/ssl.h)
+
+ if test $ac_cv_header_openssl_ssl_h = yes ; then
+@@ -1249,6 +1251,7 @@ if test $ol_with_tls = openssl || test $ol_with_tls = auto ; then
+ [#endif]])],
+ , [AC_MSG_FAILURE([OpenSSL 1.1.1 or newer required])])
+
++ ac_cv_lib_ssl_SSL_CTX_set_ciphersuites=yes
+ AC_CHECK_LIB(ssl, SSL_CTX_set_ciphersuites,
+ [have_openssl=yes], [have_openssl=no],
+ [-lcrypto])
+@@ -1261,7 +1264,8 @@ if test $ol_with_tls = openssl || test $ol_with_tls = auto ; then
+ AC_DEFINE(HAVE_OPENSSL, 1,
+ [define if you have OpenSSL])
+
+- TLS_LIBS="-lssl -lcrypto"
++ TLS_LIBS="${OPENSSL_LIBS}"
++ AC_SUBST(TLS_MODULE, openssl, [TLS pkg-config module])
+ fi
+ fi
+ fi
+diff --git a/libraries/libldap/ldap.pc.in b/libraries/libldap/ldap.pc.in
+index 3f7dd46..43b2e52 100644
+--- a/libraries/libldap/ldap.pc.in
++++ b/libraries/libldap/ldap.pc.in
+@@ -10,4 +10,5 @@ Version: @VERSION@
+ Requires: lber
+ Cflags: -I${includedir}
+ Libs: -L${libdir} -lldap
+-Libs.private: @LIBS@ @SASL_LIBS@ @TLS_LIBS@ @AUTH_LIBS@
++Libs.private: @LIBS@ @SASL_LIBS@ @AUTH_LIBS@
++Requires.private: @TLS_MODULE@
diff --git a/vcpkg/ports/openldap/portfile.cmake b/vcpkg/ports/openldap/portfile.cmake
new file mode 100644
index 0000000..b0869bf
--- /dev/null
+++ b/vcpkg/ports/openldap/portfile.cmake
@@ -0,0 +1,61 @@
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-${VERSION}.tgz"
+ "https://mirror.eu.oneandone.net/software/openldap/openldap-release/openldap-${VERSION}.tgz"
+ FILENAME "openldap-${VERSION}.tgz"
+ SHA512 18129ad9a385457941e3203de5f130fe2571701abf24592c5beffb01361aae3182c196b2cd48ffeecb792b9b0e5f82c8d92445a7ec63819084757bdedba63b20
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ PATCHES
+ android.diff
+ cyrus-sasl.diff
+ openssl.patch
+ subdirs.patch
+)
+
+vcpkg_list(SET FEATURE_OPTIONS)
+if("tools" IN_LIST FEATURES)
+ vcpkg_list(APPEND FEATURE_OPTIONS --enable-tools)
+endif()
+
+if("cyrus-sasl" IN_LIST FEATURES)
+ vcpkg_list(APPEND FEATURE_OPTIONS --with-cyrus-sasl)
+else()
+ vcpkg_list(APPEND FEATURE_OPTIONS --without-cyrus-sasl)
+endif()
+
+if(VCPKG_TARGET_IS_ANDROID)
+ vcpkg_list(APPEND FEATURE_OPTIONS -with-yielding_select=yes)
+endif()
+
+# Disable build environment details in binaries
+set(ENV{SOURCE_DATE_EPOCH} "1659614616")
+
+vcpkg_make_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTORECONF
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ --disable-cleartext
+ --disable-mdb
+ --disable-relay
+ --disable-slapd
+ --disable-syncprov
+ --with-tls=openssl
+ --without-systemd
+ --without-fetch
+ --without-argon2
+ ac_cv_lib_iodbc_SQLDriverConnect=no
+ ac_cv_lib_odbc_SQLDriverConnect=no
+ ac_cv_lib_odbc32_SQLDriverConnect=no
+)
+
+vcpkg_make_install(TARGETS depend install)
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/openldap/subdirs.patch b/vcpkg/ports/openldap/subdirs.patch
new file mode 100644
index 0000000..633a254
--- /dev/null
+++ b/vcpkg/ports/openldap/subdirs.patch
@@ -0,0 +1,34 @@
+diff --git a/Makefile.in b/Makefile.in
+index 5c6bec0..c654210 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -13,7 +13,11 @@
+ ## top-level directory of the distribution or, alternatively, at
+ ## <http://www.OpenLDAP.org/license.html>.
+
+-SUBDIRS= include libraries clients servers tests doc
++ifeq ($(patsubst %/debug,DEBUG,$(prefix)),DEBUG)
++SUBDIRS= include libraries
++else
++SUBDIRS= include libraries @TOOLS_SUBDIRS@
++endif
+ CLEANDIRS=
+ INSTALLDIRS=
+
+diff --git a/configure.ac b/configure.ac
+index e97f548..71dd7a6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -235,6 +235,12 @@ dnl OL_ARG_ENABLE(referrals,[AS_HELP_STRING([--enable-referrals], [enable LDAPv2
+ ol_enable_referrals=${ol_enable_referrals-no}
+ OL_ARG_ENABLE(ipv6, [AS_HELP_STRING([--enable-ipv6], [enable IPv6 support])], auto)dnl
+ OL_ARG_ENABLE(local, [AS_HELP_STRING([--enable-local], [enable AF_LOCAL (AF_UNIX) socket support])], auto)dnl
++OL_ARG_ENABLE(tools, [AS_HELP_STRING([--enable-tools], [Build client tools])],no,[no yes])
++TOOLS_SUBDIRS=""
++if test "$ol_enable_tools" = "yes" ; then
++ TOOLS_SUBDIRS="clients"
++fi
++AC_SUBST(TOOLS_SUBDIRS)
+
+ dnl ----------------------------------------------------------------
+ dnl General "with" options
diff --git a/vcpkg/ports/openldap/vcpkg.json b/vcpkg/ports/openldap/vcpkg.json
new file mode 100644
index 0000000..eabf48a
--- /dev/null
+++ b/vcpkg/ports/openldap/vcpkg.json
@@ -0,0 +1,26 @@
+{
+ "name": "openldap",
+ "version": "2.6.10",
+ "description": "OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol.",
+ "homepage": "https://www.openldap.org/software/",
+ "license": "OLDAP-2.8",
+ "supports": "!windows, (mingw & !x86)",
+ "dependencies": [
+ "openssl",
+ {
+ "name": "vcpkg-make",
+ "host": true
+ }
+ ],
+ "features": {
+ "cyrus-sasl": {
+ "description": "Enable Cyrus SASL support",
+ "dependencies": [
+ "cyrus-sasl"
+ ]
+ },
+ "tools": {
+ "description": "Enable client tools"
+ }
+ }
+}