diff --git a/mingw-w64-libtomcrypt/0001-makefile-enable-no-undefined.patch b/mingw-w64-libtomcrypt/0001-makefile-enable-no-undefined.patch new file mode 100644 index 0000000000..d32996396a --- /dev/null +++ b/mingw-w64-libtomcrypt/0001-makefile-enable-no-undefined.patch @@ -0,0 +1,11 @@ +--- a/makefile.shared ++++ b/makefile.shared +@@ -23,7 +23,7 @@ + LIBTOOL:=libtool + endif + endif +-ifeq ($(PLATFORM), CYGWIN) ++ifneq ($(findstring $(PLATFORM),CYGWIN MINGW32 MINGW64 MSYS),) + NO_UNDEFINED:=-no-undefined + endif + LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) diff --git a/mingw-w64-libtomcrypt/PKGBUILD b/mingw-w64-libtomcrypt/PKGBUILD new file mode 100644 index 0000000000..a5f3bfc287 --- /dev/null +++ b/mingw-w64-libtomcrypt/PKGBUILD @@ -0,0 +1,60 @@ +# Maintainer: Biswapriyo Nath + +_realname=libtomcrypt +pkgbase=mingw-w64-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" +pkgver=1.18.2 +pkgrel=1 +pkgdesc="A fairly comprehensive, modular and portable cryptographic toolkit (mingw-w64)." +arch=('any') +url="https://www.libtom.net/LibTomCrypt/" +license=('custom') +depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" + "${MINGW_PACKAGE_PREFIX}-gmp" + "${MINGW_PACKAGE_PREFIX}-libtommath") +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-libtool") +options=('staticlibs' 'strip') +source=("https://github.com/libtom/libtomcrypt/releases/download/v${pkgver}/crypt-${pkgver}.tar.xz"{,.asc} + "0001-makefile-enable-no-undefined.patch") +sha256sums=('96ad4c3b8336050993c5bc2cf6c057484f2b0f9f763448151567fbab5e767b84' + 'SKIP' + 'c53ab3ef2fa301f09fcfdc8754745b2dff62ed09ea5671e19cc42d778a5e537e') +validpgpkeys=('C4386A237ED43A475541B9427B2CD0DD4BCFF59B') # Steffen Jaeckel + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + # Disable unnecessary warnings + sed -e "s/ -Wsystem-headers//g" -e "s/ -Wshadow//g" -i makefile_include.mk + + # https://github.com/libtom/libtomcrypt/pull/564 + patch -Np1 -i "${srcdir}/0001-makefile-enable-no-undefined.patch" +} + +build() { + cp -rf "${_realname}-${pkgver}" "build-${MINGW_CHOST}" + cd "${srcdir}/build-${MINGW_CHOST}" + + CPPFLAGS+=" -DLTM_DESC -DGMP_DESC -DUSE_LTM" \ + EXTRALIBS="-ltommath -lgmp" \ + PREFIX="${MINGW_PREFIX}" \ + make -f makefile.shared IGNORE_SPEED=1 all +} + +check() { + cd "${srcdir}/build-${MINGW_CHOST}" + #./test +} + +package() { + cd "${srcdir}/build-${MINGW_CHOST}" + + DESTDIR="${pkgdir}" \ + INSTALL_GROUP="root" \ + INSTALL_OPTS="" \ + PREFIX="${MINGW_PREFIX}" \ + make -f makefile.shared install + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +}