diff --git a/mingw-w64-openldap/002-mingw-build-fixes.patch b/mingw-w64-openldap/002-mingw-build-fixes.patch new file mode 100644 index 0000000000..17284bb2ce --- /dev/null +++ b/mingw-w64-openldap/002-mingw-build-fixes.patch @@ -0,0 +1,21 @@ +--- a/include/ac/time.h ++++ b/include/ac/time.h +@@ -29,7 +29,7 @@ + # include + #endif + +-#if defined(_WIN32) && !defined(HAVE_CLOCK_GETTIME) ++#if defined(_WIN32) && !defined(HAVE_CLOCK_GETTIME) && !defined(_TIMESPEC_DEFINED) + struct timespec { + time_t tv_sec; + int tv_nsec; +--- a/libraries/liblber/lber.map ++++ b/libraries/liblber/lber.map +@@ -102,6 +102,7 @@ + ber_pvt_sb_do_write; + ber_pvt_sb_grow_buffer; + ber_pvt_socket_set_nonblock; ++ ber_pvt_wsa_err2string; + ber_read; + ber_realloc; + ber_remaining; \ No newline at end of file diff --git a/mingw-w64-openldap/PKGBUILD b/mingw-w64-openldap/PKGBUILD index 90a654ebe0..9d7b1759ea 100644 --- a/mingw-w64-openldap/PKGBUILD +++ b/mingw-w64-openldap/PKGBUILD @@ -3,8 +3,8 @@ _realname=openldap pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=2.4.57 -pkgrel=3 +pkgver=2.6.3 +pkgrel=1 arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') pkgdesc="OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol (only client) (mingw-w64)" @@ -15,31 +15,50 @@ depends=("${MINGW_PACKAGE_PREFIX}-cyrus-sasl" ) makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-autotools" + "${MINGW_PACKAGE_PREFIX}-libsystre" "groff") options=('strip' 'staticlibs' '!makeflags') license=("The OpenLDAP Public License") url="https://www.openldap.org/" source=(https://www.openldap.org/software/download/OpenLDAP/openldap-release/${_realname}-${pkgver}.tgz 001-backmdb.patch + 002-mingw-build-fixes.patch 003-symdummy-error.patch) -sha256sums=('c7ba47e1e6ecb5b436f3d43281df57abeffa99262141aec822628bc220f6b45a' +noextract=(${_realname}-${pkgver}.tgz) +sha256sums=('d2a2a1d71df3d77396b1c16ad7502e674df446e06072b0e5a4e941c3d06c0d46' 'b462bfab9362cf5cab61d67cd24902a1800fb498a152b681ee182c713b79146c' + 'ee73beee10613f2d41a7be5e4f89dee625390e44843afe02b88e02e5188398fe' 'd697fe51361a5129a5af3ca317031ff6f4ca5ddd247ff53043880660154a4708') +apply_patch_with_msg() { + for _fname in "$@" + do + msg2 "Applying ${_fname}" + patch -Nbp1 -i "${srcdir}"/${_fname} + done +} + prepare() { + plain "Extract ${_realname}-${pkgver}.tgz" + tar -xzf ${_realname}-${pkgver}.tgz || true + cd ${_realname}-${pkgver} - patch -p1 -i ${srcdir}/001-backmdb.patch - patch -p1 -i ${srcdir}/003-symdummy-error.patch + # imported from https://github.com/cfengine/buildscripts/blob/master/deps-packaging/openldap/mingw_build_fixes.patch + apply_patch_with_msg \ + 002-mingw-build-fixes.patch + + apply_patch_with_msg \ + 001-backmdb.patch \ + 003-symdummy-error.patch #libtoolize --force --copy #AUTOMAKE=/usr/bin/true autoreconf -fi } build() { - [[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}" - mkdir -p build-${MINGW_CHOST} - cd build-${MINGW_CHOST} + [[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}" + mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM} unset CPPFLAGS export lt_cv_deplibs_check_method='pass_all' @@ -55,9 +74,7 @@ build() { --enable-modules=yes \ --enable-hdb=no \ --enable-bdb=no \ - $( [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] && \ - echo "--disable-slapd" || true ) \ - CC=${MINGW_PREFIX}/bin/gcc + --disable-slapd sed -i "s/#define socklen_t int/\/*#define socklen_t int*\//" include/portable.h sed -i "s/#define snprintf _snprintf/\/*#define snprintf _snprintf*\//" include/portable.h @@ -66,7 +83,7 @@ build() { } package() { - cd "${srcdir}/build-${MINGW_CHOST}" + cd "${srcdir}/build-${MSYSTEM}" make DESTDIR=${pkgdir} install install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"