-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
PKGBUILD
121 lines (104 loc) · 3.6 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Maintainer: Alexey Pavlov <[email protected]>
_realname=openssl
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=3.4.0
pkgrel=1
pkgdesc="The Open Source toolkit for Secure Sockets Layer and Transport Layer Security (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url='https://openssl-library.org'
msys2_repository_url="https://github.com/openssl/openssl"
msys2_references=(
'archlinux: openssl'
"cpe: cpe:/a:openssl:openssl"
)
license=("spdx:Apache-2.0")
optdepends=("${MINGW_PACKAGE_PREFIX}-ca-certificates")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-autotools")
options=('!buildflags')
source=("https://github.com/openssl/openssl/releases/download/openssl-${pkgver}/openssl-${pkgver}.tar.gz"{,.asc}
'001-support-aarch64.patch'
'002-relocation.patch'
'pathtools.c'
'pathtools.h')
sha256sums=('e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf'
'SKIP'
'21b96771b401442570e885c2d5689a359a91e86dcbf5511db3667202b6c1fa8a'
'163f01573b83a12df4bec2022339d0517cbb779538e7d2d0c0bb25da50614f5a'
'ebf471173f5ee9c4416c10a78760cea8afaf1a4a6e653977321e8547ce7bf3c0'
'1585ef1b61cf53a2ca27049c11d49e0834683dfda798f03547761375df482a90')
# https://openssl-library.org/source/index.html
validpgpkeys=(
'BA5473A2B0587B07FB27CF2D216094DFD0CB81EF' # [email protected]
)
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
# =========================================== #
prepare() {
cd ${srcdir}/${_realname}-${pkgver}
apply_patch_with_msg \
001-support-aarch64.patch \
002-relocation.patch
test ! -d "${startdir}/../mingw-w64-pathtools" || {
cmp "${startdir}/../mingw-w64-pathtools/pathtools.c" "${srcdir}/pathtools.c" &&
cmp "${startdir}/../mingw-w64-pathtools/pathtools.h" "${srcdir}/pathtools.h"
} || exit 1
cp -fHv "${srcdir}"/pathtools.c crypto/
cp -fHv "${srcdir}"/pathtools.h ./
}
build() {
mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"
# Use mingw cflags instead of hardcoded ones
sed -i -e '/^"mingw"/ s/-fomit-frame-pointer -O3 -Wall/-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4/' \
${srcdir}/${_realname}-${pkgver}/Configurations/10-main.conf
case "${CARCH}" in
i?86)
_mingw=mingw
;;
x86_64)
_mingw=mingw64
;;
aarch64)
_mingw=mingwarm64
;;
esac
MSYS2_ARG_CONV_EXCL="--prefix=" \
/usr/bin/perl ../"${_realname}-${pkgver}"/Configure \
--prefix="${MINGW_PREFIX}" \
--libdir=lib \
--openssldir=etc/ssl \
${_mingw} \
shared \
zlib-dynamic \
enable-camellia \
enable-capieng \
enable-idea \
enable-mdc2 \
enable-rc5 \
enable-rfc3779 \
-DOPENSSLBIN=\"\\\"${MINGW_PREFIX}/bin\\\"\"
MSYS2_ARG_CONV_EXCL="-DENGINESDIR=;-DMODULESDIR=;-DOPENSSLDIR=;-DINSTALLTOP=;-DOPENSSLBIN=" \
make
}
check() {
cd "${srcdir}/build-${MSYSTEM}"
make VERBOSE=1 test
}
package() {
cd "${srcdir}/build-${MSYSTEM}"
make -j1 install DESTDIR="${pkgdir}"
# https://github.com/openssl/openssl/issues/24298
for pcfile in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do
sed -s "s|${MINGW_PREFIX}|\${prefix}|g" -i "${pcfile}"
sed -i "1s|^|prefix=${MINGW_PREFIX}\\n|" "${pcfile}"
done
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE.txt" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}