libtomcrypt: also port to libtool

This commit is contained in:
Christoph Reiter
2023-08-15 13:17:17 +02:00
parent 5c1fda7d3e
commit 95dc73bdf4
2 changed files with 23 additions and 18 deletions

View File

@@ -0,0 +1,11 @@
--- libtomcrypt-1.18.2/makefile.shared.orig 2023-08-15 13:09:25.578845500 +0200
+++ libtomcrypt-1.18.2/makefile.shared 2023-08-15 13:09:31.236345700 +0200
@@ -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)

View File

@@ -13,29 +13,27 @@ license=('custom')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-libtommath")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
options=('strip')
source=("https://github.com/libtom/libtomcrypt/releases/download/v${pkgver}/crypt-${pkgver}.tar.xz")
sha256sums=('96ad4c3b8336050993c5bc2cf6c057484f2b0f9f763448151567fbab5e767b84')
makedepends=(
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-libtool")
source=("https://github.com/libtom/libtomcrypt/releases/download/v${pkgver}/crypt-${pkgver}.tar.xz"
"0001-makefile-enable-no-undefined.patch")
sha256sums=('96ad4c3b8336050993c5bc2cf6c057484f2b0f9f763448151567fbab5e767b84'
'28487492464901ca4a5b0965e5cc0a8ae5f368b4cf12dd03fc9112c25b4d595e')
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
# Disable unnecessary warnings
sed -e "s/ -Wsystem-headers//g" -e "s/ -Wshadow//g" -i makefile_include.mk
# Fix linker flag
sed -e "s/--export-all/--export-all-symbols/g" -i makefile.mingw
patch -Np1 -i "${srcdir}/0001-makefile-enable-no-undefined.patch"
}
build() {
cp -rf "${_realname}-${pkgver}" "build-${MSYSTEM}"
cd "${srcdir}/build-${MSYSTEM}"
make -f makefile.mingw all \
CC=${CC} PREFIX=${MINGW_PREFIX} \
CFLAGS="-O2 -DLTM_DESC -DGMP_DESC -DUSE_LTM" \
LTC_LDFLAGS+=" -ltommath -lgmp"
export CPPFLAGS+=" -DLTM_DESC -DGMP_DESC -DUSE_LTM"
export EXTRALIBS="-ltommath -lgmp"
make -f makefile.shared IGNORE_SPEED=1 library test
}
check() {
@@ -47,11 +45,7 @@ check() {
package() {
cd ${srcdir}/build-${MSYSTEM}
mkdir -p ${pkgdir}${MINGW_PREFIX}/include
install -Dm755 libtomcrypt.dll "${pkgdir}${MINGW_PREFIX}/bin/libtomcrypt.dll"
install -Dm644 libtomcrypt.a "${pkgdir}${MINGW_PREFIX}/lib/libtomcrypt.a"
install -Dm644 libtomcrypt.dll.a "${pkgdir}${MINGW_PREFIX}/lib/libtomcrypt.dll.a"
install -Dm644 src/headers/tomcrypt*.h "${pkgdir}${MINGW_PREFIX}/include"
make -f makefile.shared PREFIX="${MINGW_PREFIX}" DESTDIR="$pkgdir" install
install -Dm644 doc/crypt.pdf "${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/crypt.pdf"
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"