aports/community/crypto++/APKBUILD
Biswapriyo Nath 8b965747cd community/crypto++: Fix prefix in pkgconfig file
Add -fPIC in CXXFLAGS to fix the following linker error.

ld: /tmp/ccchDjpG.ltrans30.ltrans.o: warning: relocation against
  `_ZTVN8CryptoPP10RedirectorE' in read-only section `.text'
ld: /tmp/ccchDjpG.ltrans0.ltrans.o: relocation R_X86_64_PC32 against
  symbol `_ZTVN8CryptoPP19AlgorithmParametersE' can not be used when
  making a shared object; recompile with -fPIC
ld: final link failed: bad value
2025-06-05 14:42:14 +00:00

35 lines
962 B
Text

# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: August Klein <amatcoder@gmail.com>
pkgname=crypto++
_pkgname=cryptopp
pkgver=8.9.0
_pkgver=${pkgver//./}
pkgrel=1
pkgdesc="Free C++ class library of cryptographic schemes"
url="https://github.com/weidai11/cryptopp"
# x86: fails to build
arch="all !x86"
license="BSL-1.0"
subpackages="$pkgname-dev"
source="https://github.com/weidai11/cryptopp/releases/download/CRYPTOPP_${pkgver//./_}/cryptopp$_pkgver.zip"
builddir="$srcdir"
build() {
make dynamic libcryptopp.pc CXXFLAGS="$CXXFLAGS -flto=auto -fPIC" PREFIX="/usr"
}
check() {
make check
}
package() {
make DESTDIR="$pkgdir" PREFIX="/usr" install-lib
# This lib is huge (48 MiB) and since we built it with LTO,
# it's unusable anyway.
rm -f "$pkgdir"/usr/lib/libcryptopp.a
}
sha512sums="
903970c4c0312272e93bae0cc3477be66b273dd38c9329fda9f7157ec44e247a3bc16b9d2b4ad625f258af0eaf2dc2c4210d4d14829b455f180983859a5c4b41 cryptopp890.zip
"