|
| 1 | +_realname=pkcs11-provider |
| 2 | +pkgbase=mingw-w64-${_realname} |
| 3 | +pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") |
| 4 | +pkgver=0.5.r92.gcff4036 |
| 5 | +pkgrel=1 |
| 6 | +pkgdesc="A pkcs#11 provider for OpenSSL 3.0+ (mingw-w64)" |
| 7 | +arch=('any') |
| 8 | +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') |
| 9 | +url='https://github.com/latchset/pkcs11-provider' |
| 10 | +msys2_references=('archlinux: pkcs11-provider') |
| 11 | +license=('COPYING') |
| 12 | +makedepends=("${MINGW_PACKAGE_PREFIX}-meson" |
| 13 | + "${MINGW_PACKAGE_PREFIX}-ninja" |
| 14 | + "${MINGW_PACKAGE_PREFIX}-pkg-config" |
| 15 | + "${MINGW_PACKAGE_PREFIX}-cc" |
| 16 | + "${MINGW_PACKAGE_PREFIX}-dlfcn" |
| 17 | + "git") |
| 18 | +depends=("${MINGW_PACKAGE_PREFIX}-openssl") |
| 19 | +# optdepends("${MINGW_PACKAGE_PREFIX}-p11-kit: seamless PKCS#11 modules integration") |
| 20 | +_commit='cff40360e4b47d38911999c625249683b7445170' |
| 21 | +source=("${_realname}"::"git+https://github.com/latchset/pkcs11-provider.git#commit=${_commit}" |
| 22 | + "patch.patch") |
| 23 | +sha256sums=('54e253b1f2363f4f5fa626394538da62734dd641a47c352b5b9b9970827d0b12' |
| 24 | + '91d16126be2d86136a79d285627d263957129b02046269a1c3dfeba38c5016a6') |
| 25 | + |
| 26 | +pkgver() { |
| 27 | + cd "${_realname}" |
| 28 | + |
| 29 | + git describe --long "${_commit}" | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g' |
| 30 | +} |
| 31 | + |
| 32 | +prepare() { |
| 33 | + cd "${_realname}" |
| 34 | + |
| 35 | + patch -p1 -i ${srcdir}/patch.patch |
| 36 | +} |
| 37 | + |
| 38 | +build() { |
| 39 | + MSYS2_ARG_CONV_EXCL="--prefix=" \ |
| 40 | + LDFLAGS="-ldl" CFLAGS="-pthread -Wno-incompatible-pointer-types -D_XOPEN_SOURCE=700" \ |
| 41 | + meson setup \ |
| 42 | + --prefix="${MINGW_PREFIX}" \ |
| 43 | + --wrap-mode=nodownload \ |
| 44 | + --auto-features=enabled \ |
| 45 | + --buildtype=release \ |
| 46 | + "build-${MSYSTEM}" \ |
| 47 | + "${_realname}" |
| 48 | + |
| 49 | + meson compile -C "build-${MSYSTEM}" |
| 50 | +} |
| 51 | + |
| 52 | +check() { |
| 53 | + meson test -C "build-${MSYSTEM}" |
| 54 | +} |
| 55 | + |
| 56 | +package() { |
| 57 | + # meson install -C "build-${MSYSTEM}" --destdir "${pkgdir}" |
| 58 | + install -Dm755 "${srcdir}/build-${MSYSTEM}/src/pkcs11.dll" "${pkgdir}${MINGW_PREFIX}/lib/ossl-modules/pkcs11.dll" |
| 59 | + # install -Dm644 "${srcdir}/build-${MSYSTEM}/src/pkcs11.dll.a" "${pkgdir}${MINGW_PREFIX}/lib/ossl-modules/pkcs11.dll.a" |
| 60 | + install -Dm644 "${srcdir}/${_realname}/docs/provider-pkcs11.7" "${pkgdir}${MINGW_PREFIX}/share/man/man7/provider-pkcs11.7" |
| 61 | + |
| 62 | + install -Dm644 "${srcdir}/${_realname}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" |
| 63 | +} |
0 commit comments