# Maintainer: Biswapriyo Nath _realname=libp11 pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=0.4.18 pkgrel=1 pkgdesc="A library implementing a small layer on top of the PKCS11 API (mingw-w64)" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') url="https://github.com/OpenSC/libp11" msys2_repository_url='https://github.com/OpenSC/libp11' msys2_references=( 'archlinux: libp11' 'anitya: 1699' ) license=('spdx:LGPL-2.1-or-later') makedepends=("${MINGW_PACKAGE_PREFIX}-openssl" "${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc") depends=("${MINGW_PACKAGE_PREFIX}-openssl") optdepends=("${MINGW_PACKAGE_PREFIX}-p11-kit: seamless PKCS#11 modules integration") source=("https://github.com/OpenSC/libp11/releases/download/libp11-${pkgver}/libp11-${pkgver}.tar.gz"{,.asc} 0001-relocate-pkgconfig-install-paths.patch 0002-provider_c-win32-config.patch 0003-automake-no-lib-prefix.patch "engine_h_win32.patch" "readme.msys2") sha256sums=('9292de67ca73aba1deacf577c9086b595765f36ef47712cfeb49fa31f6e772fb' 'SKIP' '2637e24bd085de10d1330a7df71ffa1d4d25265d55ce38f03788a8b641c614cc' '3592316f9384c02364a0f2afc67a0ff651728e666b566e526dca4e04de66b7c5' 'a494c75cb168bb84b80c5d771fcb7137694362f9b7522ec5aa51e3079e3be668' '199b35e7e6dac997c7cc08096e9d7bc3ba8ab1c222b5d63b4eeaadaafa5ceeca' '4bf65aea50c96933049b260d0bd83665f09b142e57b8d587ba32c5c24b2fe65a') validpgpkeys=('AC915EA30645D9D3D4DAE4FEB1048932DD3AAAA3') # MichaƂ Trojnara prepare() { cd "${_realname}-${pkgver}" patch -p1 -i "${srcdir}"/engine_h_win32.patch patch -p1 -i "${srcdir}"/0001-relocate-pkgconfig-install-paths.patch patch -p0 -i "${srcdir}"/0002-provider_c-win32-config.patch patch -p0 -i "${srcdir}"/0003-automake-no-lib-prefix.patch autoreconf -fi } build() { mkdir -p "build-${MSYSTEM}" && cd "build-${MSYSTEM}" MSYS2_ARG_CONV_EXCL="--prefix=;--with-enginesdir=;--with-modulesdir=" \ ../"${_realname}-${pkgver}"/configure \ --prefix="${MINGW_PREFIX}" \ --build="${MINGW_CHOST}" \ --host="${MINGW_CHOST}" \ --target="${MINGW_CHOST}" \ --with-enginesdir="${MINGW_PREFIX}/lib/engines-3" \ --with-modulesdir="${MINGW_PREFIX}/lib/ossl-modules" \ --with-pkcs11-module=libp11-kit-0.dll # p11-kit lib/proxy module # re with-pkcs11-module: pkg-config returns an absolute path, but we want # things to be relocatable so hardcode the .dll name here make } package() { cd "build-${MSYSTEM}" make install DESTDIR="${pkgdir}" install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" install -Dm644 "${srcdir}/readme.msys2" "${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/readme.msys2" }