This suppsedly needs `-pthread` to avoid: ``` wasm-ld: error: --shared-memory is disallowed by libcrypto-lib-core_namemap.o because it was not compiled with 'atomics' or 'bulk-memory' features. ```
84 lines
2.2 KiB
Bash
84 lines
2.2 KiB
Bash
# $Id$
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
_pkgname=openssl
|
|
_pkgver=3.3.1
|
|
|
|
pkgname=wasm-$_pkgname
|
|
# use a pacman compatible version scheme
|
|
pkgver=${_pkgver/[a-z]/.${_pkgver//[0-9.]/}}
|
|
pkgrel=2
|
|
pkgdesc="The Open Source toolkit for Secure Sockets Layer and Transport Layer Security (wasm)"
|
|
arch=('any')
|
|
url='https://www.openssl.org'
|
|
license=('Apache-2.0')
|
|
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
|
|
depends=('emscripten')
|
|
makedepends=('perl')
|
|
source=("https://www.openssl.org/source/openssl-${_pkgver}.tar.gz"{,.asc})
|
|
sha256sums=('777cd596284c883375a2a7a11bf5d2786fc5413255efab20c50d6ffe6d020b7e'
|
|
'SKIP')
|
|
validpgpkeys=('8657ABB260F056B1E5190839D9C4D26D0E604491'
|
|
'7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C'
|
|
'A21FAB74B0088AA361152586B8EF1A6BA9DA2D5C'
|
|
'EFC0A467D613CB83C7ED6D30D894E2CE8B3D79F5')
|
|
|
|
_sdk=/usr/lib/emscripten
|
|
_prefix=$_sdk/system
|
|
|
|
prepare() {
|
|
cd "${srcdir}/${_pkgname}-${_pkgver}"
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/${_pkgname}-${_pkgver}"
|
|
|
|
"$_sdk"/emconfigure ./Configure \
|
|
CROSS_COMPILE= \
|
|
--prefix="$_prefix" \
|
|
--openssldir="$_prefix" \
|
|
-Wl,--no-allow-shlib-undefined \
|
|
-Wl,--no-undefined \
|
|
-pthread \
|
|
no-tests \
|
|
no-asm \
|
|
no-async \
|
|
no-egd \
|
|
no-ktls \
|
|
no-module \
|
|
no-posix-io \
|
|
no-secure-memory \
|
|
no-shared \
|
|
no-sock \
|
|
no-stdio \
|
|
no-thread-pool \
|
|
no-threads \
|
|
no-ui-console \
|
|
no-weak-ssl-ciphers \
|
|
cc
|
|
|
|
# get rid of debug printing so the library doesn't depend on stdio (no-stdio and no-ui are not entirely sufficient)
|
|
sed -i -e 's/\#define TEST_ENG_OPENSSL_RC4_P_INIT//' crypto/engine/eng_openssl.c
|
|
|
|
# build only libraries
|
|
"$_sdk"/emmake make depend
|
|
"$_sdk"/emmake make build_libs
|
|
}
|
|
|
|
package() {
|
|
cd "$srcdir/$_pkgname-$_pkgver"
|
|
|
|
# install header files, libraries and license
|
|
for lib in libcrypto.a libssl.a; do
|
|
install -D -m0644 $lib "$pkgdir/$_prefix/lib/$lib"
|
|
done
|
|
for pc in libcrypto.pc libssl.pc openssl.pc; do
|
|
install -D -m0644 $pc "$pkgdir/$_prefix/lib/pkgconfig/$pc"
|
|
done
|
|
mkdir -p "$pkgdir/$_prefix/include"
|
|
cp -r include/openssl "$pkgdir/$_prefix/include"
|
|
|
|
# strip binaries
|
|
find "$pkgdir/$_prefix" -name 'lib*.a' -type f -exec "$_sdk/emstrip" -g {} \;
|
|
}
|