sourcemod-scripting
LOW
maintainer ChrisTX
0 votes
base
sourcemod
scanned 2026-11-03 14:04:44.822193
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Christian Pfeiffer <cpfeiffer at rev-crew dot info>
2
# shellcheck disable=SC2034,SC2154
3
# shellcheck shell=bash
4
5
pkgbase=sourcemod
6
pkgname=(sourcemod-scripting sourcemod sourcemod-src)
7
# SourceMod's version: the stable branch's tag, <version>.<build>, the build being the number of
8
# commits, which SourceMod's versioning counts with git
9
pkgver=1.12.0.7260
10
pkgrel=1
11
pkgdesc="SourceMod, the scripting and administration platform for Source engine game servers"
12
arch=(x86_64 aarch64)
13
url="https://www.sourcemod.net"
14
license=(GPL-3.0-only LicenseRef-SourceMod-exception)
15
makedepends=(ambuild clang git python zlib)
16
# The games' addons: the SDKs (hl2sdk), Metamod:Source's sources, the 32-bit libraries of multilib
17
# for the 32-bit servers, the database clients, PCRE2, curl, SQLite, zlib and libmaxminddb for both
18
makedepends_x86_64=(
19
curl
20
hl2sdk
21
lib32-curl
22
lib32-glibc
23
lib32-gcc-libs
24
lib32-libmaxminddb
25
lib32-mariadb-connector-c
26
lib32-pcre2
27
lib32-postgresql-libs
28
lib32-sqlite
29
lib32-zlib
30
libmaxminddb
31
mariadb-libs
32
metamod-source-src
33
pcre2
34
postgresql-libs
35
sqlite
36
)
37
_tag="$pkgver"
38
# The Zydis release SafetyHook's amalgamated copy (4.0.0) is generated from again: the 4.1 decoder
39
# fixes, the API SafetyHook uses is the same (upstream SafetyHook uses 4.1 unchanged)
40
_zydisver=4.1.1
41
# The full history of SourceMod, its versioning counts the commits. The submodules at the commits
42
# the tag pins.
43
source=("git+https://github.com/alliedmodders/sourcemod.git#tag=$_tag"
44
"git+https://github.com/alliedmodders/amtl.git"
45
"git+https://github.com/alliedmodders/sourcepawn.git"
46
"git+https://github.com/alliedmodders/hl2sdk-manifests.git"
47
"git+https://github.com/alliedmodders/safetyhook.git"
48
"git+https://github.com/zyantific/zydis.git#tag=v$_zydisver"
49
"git+https://github.com/zyantific/zycore-c.git"
50
scripting-only.patch
51
mysql-mariadb.patch
52
pgsql-libpq.patch
53
regex-pcre2.patch
54
webternet-curl.patch
55
sqlite-system.patch
56
sourcepawn-zlib.patch
57
sourcepawn-source-date-epoch.patch
58
sourcepawn-shell-jit-define.patch
59
sourcemod-delete-noexcept.patch
60
geoip-libmaxminddb.patch
61
source-sdk.txt
62
spcomp.sh)
63
sha512sums=('783fe9bb0dd53f3f751871e89a03e52911afc4fbfaddd73c03c16291a9bdd6e9fe4194caf94617c7cb94caef6850d0cd077bc6bf478846c2383607a966fbba4e'
64
'SKIP'
65
'SKIP'
66
'SKIP'
67
'SKIP'
68
'7ca4fc08ad5074f7ae7115f8eb511ad53b84edcf6770395d43512bee73e38ffad0e1b59850e7732454abdf880266307cf5fd396ac516ef1f9489d4fb592a455b'
69
'SKIP'
70
'156d6c377315044ccb081cddd28d932927139674a67bd2e6ef47c3030dcf58ccf4168936b823a8efad63ffcedc57f700654ce38223f8dc5c25bfc39051fa1389'
71
'0a991fc5debf7a9f56223083f255094733feaec23166f621e2e77c4f9886e98be9ba4989a66c3889d0424e0d0d2df6f98c229e8ce00e3da2f20bea2c0b333e7b'
72
'9abe05c8a9b14575cbd04318c8a9aecb0cc3593470cd69ede089c103b6a507c383be72f12e2f8240fa0edfac4d543be58c3e5f3d9106ecc3857783af90e57096'
73
'eba2aead936cc6b544c341c1b83fc25af17e876f84ff57a998fc11eda4fa6f30a2bd3ef9db4a15b7d9bcd1d3ea847e0929dc23a078b884d0cf5d40fbd835f676'
74
'1efd42634d92859493cd30a36b6696cd5c748dcc533c09c88fe68a8f447f03708ffa11f93d2df5652e63e2c35cc4de7a59d71230c19eb9ff51b7c5dff1f383dd'
75
'e85a55faf907b826cb5fa80505fb84e73090d0a31025695ffd6fb3356cd778a77d7fdf30da6e036e44408edc63b63920340075dbeb969a99181440f0c391060d'
76
'd57a24d7cea93a0ef35ed452c865095ffce638fa9cf020592a18afe9f03d6d23b607aa16ed0a94d0d180380a2ec84d16cf43aed520c1f638785690215d4af423'
77
'aa65bb5d45798d4036a3b532093ab2f35a161a1d424d0430299f9c31c3552d7601a898c326eb8b5b08924ff7328e78aac183c10788b7e5dcc3d8f14d0ccff252'
78
'9e429ffbac68a20afaeb324e63b2e688fcbb063d7132b8cc1e16855861225f13298ec67e55fe74ec64290c2e2930e1e19d487ca653b0cb64bb42c607cf4c666c'
79
'5634114e3418e894506206b30030af9a4465fdb2d4c8f15e5e81eaadb086c7fdce8c54835309548d42b7776ee1803c638fc2e2aa23f3363cfc395ffffd741a3e'
80
'084afa36685393c0806165c8c897553c0df876e6aaa86d28020064f40f3cc25d0ad69163d3abe183c898df6fc92f5ff4685969bb7a9cdf477efbb4b8eb986cda'
81
'f427709e7137dd0249070ffa3aedaf9c04b434172d56d8d453ada2d0c439c2b31a9c82551da5c993468fc286edba756d86073268894394ba5190fc1475ca09b3'
82
'3a4c60a485304553ee1ca87ac0e96ba636cb8f0a311c71a0a73b3926964a3ff700c7cca6d24ddef04547dd90bd58f6dec26d137da6286d1c409ebcd6e6ed2bf2')
83
b2sums=('80681ad0378521bc27756add78ac4c66c81d53b28016efc37b4f1a7d82b598a370bd6a90a277dd66f08ed08bde169f142c51e2f424de3176c939dad21a131575'
84
'SKIP'
85
'SKIP'
86
'SKIP'
87
'SKIP'
88
'a596fe2649f4f9d5644b3abe7df3fa1d921ec378324691f04e17df60e3ebec39f3877ecb68519b71fde1a0a8144e48b35556febb241fa3cc631794c7e866f8d5'
89
'SKIP'
90
'c1d68f624e55bec3af3e4a3b1461bf420e6ce03ada499d0eff39a14e76494ef2502ee56a6f3da1e442209b4f10165d7b2b026b9efad982c6e40cfd0d5dd323d3'
91
'3f24351caa24fc969e2b85ea343df270e39b2679cef5ca5e5ce3c8a36735cf9b44ecc3d55bdb2343377ecc9efce386e308b4f45e1d6d48380d155b56c6611ba2'
92
'0001251324fb1c43da0676f7e7da4f01667273b8095afbbb539a760288aba6ad782ced95d7863ee671449f526009dd1141a65c217a502118ff35338d1ee4f32e'
93
'5d1fbca72e2da61aea85526e9d0c3661084833bbe79d4b807d04bf4e77ae8a83ee2edcef6376eae01e874d8dce271842e470424fc8704c90198387df4fae5d3f'
94
'd826c2dd98b0199c5a351c5ec340e27490108f667445b42b5884d1d2a5be23b0b8beec288266d4ead602569e363c81fed570eac2732cf0be6a05bd557b9cf0a4'
95
'634cebeb610aafd6ee1067d6d76afdbf93c7fd95227f2d47656a5d61395441471c4ec6d30995ff3c80f649c38c488ec272a95e8d0080288d5217fc8197ef8954'
96
'75ec7373286f5d7cd778e6738609679c95aff00ce13eb9b451a3156dcd1da3191862f587b8b01ff4f056c1348529267fe34246bf63574aeb7f10b13a7b6db612'
97
'edbc0ece20302ab90994b03e112542cb13410b42db62983204bbf888d3d4f7802633a91d2ba680f2a4473ae95b9d38f1f0eeaae08f82ee2499dc84cd627269f1'
98
'a2d51f38244b4ce2fbc05d4d8a15e724d2ce014ce47a3be63586fe21a07a8f24a9ba0cb41b55a9366b528c1e55b25c194a0c409e781eddc1fc477eb2ff9704e5'
99
'f86955655433526c10e56495e57ac546620a5fe7fe9e804669a80823bf7a782667907276ed06bd4905a05b640f947f6cad7a8b087acd26bbd7d191cb90ebe457'
100
'6a7a7c578f22af05c0a6617a621c36add3f6f287f73d64d127dc91952acf5a1c71c619b3513fdb8ab4bb5767c57dee81fbbcd616f4f6c9163189f9d6002f8fad'
101
'b856088fc19f7c921a5e2b3320a776e27b10a8d3d77c21041cb59348b2efde62491163c57227080c0091eb77e74c0d1fc2c0b72a01e0770df27777dc077ad600'
102
'670fb582edac8bdef05a3842edbef464c5238861df80fbf5e788fe2752275db395826c0b6eb90d5c9fd725b2a368b8d7884aea9de6d89adde6032c481a6311b8')
103
104
# Clang, like upstream's builds: the code builds with -Werror, and GCC 16 has warnings Clang
105
# doesn't (sign comparisons, attributes of fclose in a unique_ptr's deleter type, …)
106
_compilers() {
107
local _cc=clang
108
# A cross build ($CARCH differs from the build host) compiles with clang and lld against the C
109
# library and GCC of a root file system for $CARCH with base-devel in ROOTFS_DIR, like
110
# powershell-dsc, with a makepkg configuration for $CARCH (CFLAGS, LDFLAGS)
111
if [[ "$(uname -m)" != "$CARCH" ]]; then
112
if [[ ! -d "${ROOTFS_DIR:-}" ]]; then
113
echo "sourcemod: a cross build needs ROOTFS_DIR set to a $CARCH root file system" >&2
114
exit 1
115
fi
116
# lld in the compiler command, as AMBuild links its test programs without LDFLAGS; compiling
117
# doesn't use it, which the code's -Werror would turn into an error
118
_cc="clang --target=$CARCH-unknown-linux-gnu --sysroot=$ROOTFS_DIR -fuse-ld=lld"
119
_cc+=" -Wno-unused-command-line-argument"
120
fi
121
export CC="$_cc" CXX="${_cc/clang/clang++}"
122
}
123
124
prepare() {
125
cd sourcemod || exit
126
local _submodule
127
for _submodule in public/amtl sourcepawn hl2sdk-manifests public/safetyhook; do
128
git submodule init "$_submodule"
129
git config "submodule.$_submodule.url" "$srcdir/${_submodule##*/}"
130
done
131
git -c protocol.file.allow=always submodule update public/amtl sourcepawn hl2sdk-manifests \
132
public/safetyhook
133
134
# --scripting-only builds SafetyHook as well, which only the extensions use and which doesn't
135
# support aarch64, and doesn't allow aarch64 on Linux, only on macOS
136
patch -Np1 -i "$srcdir/scripting-only.patch"
137
# The MySQL extension with MariaDB Connector/C, linked dynamically, instead of a static MySQL 5.5
138
# (without the latter's internal headers)
139
patch -Np1 -i "$srcdir/mysql-mariadb.patch"
140
# The PostgreSQL extension with the system's libpq, linked dynamically, instead of a static 9.6
141
patch -Np1 -i "$srcdir/pgsql-libpq.patch"
142
# The regex extension with the system's PCRE2, linked dynamically, instead of a static PCRE 8.44
143
# (PCRE 1, end of life): translates regex.inc's PCRE flags and error codes
144
patch -Np1 -i "$srcdir/regex-pcre2.patch"
145
# The webternet extension, which the updater downloads with, with the system's libcurl, linked
146
# dynamically, instead of a static curl 7.19 without TLS; the update server over HTTPS
147
patch -Np1 -i "$srcdir/webternet-curl.patch"
148
# The SQLite extension with the system's SQLite 3, linked dynamically, instead of the bundled
149
# amalgamation (3.38); SourcePawn (the VM and the compiler) with the system's zlib
150
patch -Np1 -i "$srcdir/sqlite-system.patch"
151
patch -Np1 -i "$srcdir/sourcepawn-zlib.patch"
152
# spcomp's __DATE__ and __TIME__, which every plugin has in its version info (core.inc), from
153
# SOURCE_DATE_EPOCH in UTC if it's set, so that plugins build reproducibly
154
# (https://github.com/alliedmodders/sourcepawn/pull/1204)
155
patch -Np1 -i "$srcdir/sourcepawn-source-date-epoch.patch"
156
# spshell and the verifier, which include the VM's environment.h, with the VM's SP_HAS_JIT, so
157
# that its Environment class is the same in them as in the VM library they link (GCC's LTO
158
# reports the ODR violation). Upstream fixed it for 1.13 (alliedmodders/sourcepawn@bfdd959).
159
patch -Np1 -i "$srcdir/sourcepawn-shell-jit-define.patch"
160
# The replacement operator delete of extensions and logic.so declared noexcept, like the
161
# standard's (implicitly so already; GCC warns about the different exception specifier)
162
# (https://github.com/alliedmodders/sourcemod/pull/2607)
163
patch -Np1 -i "$srcdir/sourcemod-delete-noexcept.patch"
164
# The GeoIP extension with the system's libmaxminddb, linked dynamically, instead of the bundled
165
# 1.5.2
166
patch -Np1 -i "$srcdir/geoip-libmaxminddb.patch"
167
# Without the gamedata updates from SourceMod's update server (the updater extension isn't loaded):
168
# a newer SourceMod comes as a whole with this package
169
sed -i -e 's/^\(\t \* The default value is \)"no"\.\( A value of "yes" will block the Auto Updater\.\)/\1"yes" (the package updates SourceMod as a whole).\2/' \
170
-e 's/^\(\t"DisableAutoUpdate"\t*\)"no"/\1"yes"/' configs/core.cfg
171
grep -q '^.*"DisableAutoUpdate"[[:space:]]*"yes"' configs/core.cfg || exit
172
173
# Nothing prebuilt: the libraries of PCRE and libpq with their old headers, and tools the build
174
# doesn't use
175
rm -r extensions/regex/lib_* extensions/pgsql/lib_*
176
rm extensions/regex/pcre.h
177
rm -r extensions/curl/curl-src extensions/sqlite/sqlite-source sourcepawn/third_party/zlib
178
rm extensions/pgsql/{libpq-fe.h,postgres_ext.h}
179
rm extensions/geoip/{data-pool.{c,h},maxminddb{.c,.h,_config.h,-compat-util.h},osdefs.h}
180
rm tools/vtable_scanner/libiberty.a tools/batchtool/compile.exe
181
182
# SafetyHook's Zydis, amalgamated from Zydis and Zycore at the release's commits by Zydis's
183
# script, with the static build defines SafetyHook's copy starts with (without them, Zydis
184
# declares its functions as imported from a shared library)
185
cd "$srcdir/zydis" || exit
186
git submodule init dependencies/zycore
187
git config submodule.dependencies/zycore.url "$srcdir/zycore-c"
188
git -c protocol.file.allow=always submodule update dependencies/zycore
189
python assets/amalgamate.py >/dev/null
190
local _zydis="$srcdir/sourcemod/public/safetyhook/zydis"
191
grep -q '^#define ZYDIS_STATIC_BUILD$' "$_zydis/Zydis.h" || exit
192
printf '#define ZYCORE_STATIC_BUILD\n#define ZYDIS_STATIC_BUILD\n' |
193
cat - amalgamated-dist/Zydis.h >"$_zydis/Zydis.h"
194
cp amalgamated-dist/Zydis.c "$_zydis/Zydis.c"
195
}
196
197
build() {
198
_compilers
199
200
# The compiler and include files for this architecture
201
local _target
202
case "$CARCH" in
203
x86_64) _target=x86_64 ;;
204
aarch64) _target=arm64 ;;
205
esac
206
mkdir -p "$srcdir/sourcemod/build-scripting"
207
cd "$srcdir/sourcemod/build-scripting" || exit
208
python ../configure.py --enable-optimize --scripting-only --targets="$_target"
209
ambuild
210
211
# The game server's addons, 32-bit x86 only
212
[[ "$CARCH" == x86_64 ]] || return 0
213
214
# Position-independent code, which upstream only builds for x86_64: clang's default PIE code calls
215
# libstdc++'s functions (linked statically) directly, which needs text relocations in a library
216
CFLAGS+=" -fPIC"
217
# Every game of hl2sdk, for its servers' architectures. The SDKs' shared libraries (tier0,
218
# vstdlib) are only linked against, the games bring their own. Against the installed
219
# Metamod:Source's sources.
220
mkdir -p "$srcdir/sourcemod/build-games"
221
cd "$srcdir/sourcemod/build-games" || exit
222
python ../configure.py --enable-optimize --sdks=present --targets=x86,x86_64 \
223
--hl2sdk-root=/usr/lib/hl2sdk --mms-path=/usr/src/metamod-source --mysql-path=/usr \
224
--mysql64-path=/usr
225
ambuild
226
}
227
228
check() {
229
# The compiler of a cross build is for another architecture, run the test natively on the target
230
if [[ "$(uname -m)" != "$CARCH" ]]; then
231
echo 'sourcemod: skipping the test on a cross build; run it natively on the target' >&2
232
return 0
233
fi
234
cd sourcemod || exit
235
# spcomp64 for x86_64, like in SourceMod's packages, spcomp for other architectures
236
local _spcomp=(build-scripting/package/spcomp*)
237
238
# The compiler's version is SourceMod's, and the include files it builds with compile
239
[[ $("${_spcomp[0]}" 2>&1 | head -n1) == *"$pkgver"* ]]
240
"${_spcomp[0]}" -i build-scripting/package/include -E -o "$srcdir/test.smx" plugins/basecommands.sp
241
# Reproducibly, with makepkg's SOURCE_DATE_EPOCH: the same plugin a second later is the same
242
sleep 1
243
"${_spcomp[0]}" -i build-scripting/package/include -E -o "$srcdir/test-again.smx" plugins/basecommands.sp
244
cmp "$srcdir/test.smx" "$srcdir/test-again.smx"
245
246
# SourcePawn's tests: its compiler and VM, the scripting build's and the servers' 32 and 64-bit
247
# ones
248
python sourcepawn/tests/runtests.py build-scripting/sourcepawn
249
[[ "$CARCH" == x86_64 ]] || return 0
250
python sourcepawn/tests/runtests.py build-games/sourcepawn
251
252
# The compilers of the servers' build, the 32-bit spcomp and spcomp64, compile the plugin to the
253
# same file as the packaged one
254
local _compiler
255
for _compiler in build-games/package/addons/sourcemod/scripting/spcomp{,64}; do
256
"$_compiler" -i build-scripting/package/include -E -o "$srcdir/test-${_compiler##*/}.smx" \
257
plugins/basecommands.sp
258
cmp "$srcdir/test.smx" "$srcdir/test-${_compiler##*/}.smx"
259
done
260
}
261
262
_package_amtl_license() {
263
# AMTL has no licence file, its licence is in each of its files
264
sed -n 3,28p "$srcdir/sourcemod/public/amtl/amtl/am-string.h" | sed 's|^// \?||' |
265
install -Dm644 /dev/stdin "$pkgdir/usr/share/licenses/${FUNCNAME[1]#package_}/AMTL.txt"
266
}
267
268
_package_rsa_md_license() {
269
# The MD5 code of SourcePawn's VM and the updater extension, RSA's: its licence is in the files
270
sed -n '/Copyright (C) 1991-2, RSA Data Security/,/documentation and\/or software\./p' \
271
"$srcdir/sourcemod/sourcepawn/vm/md5/md5.cpp" |
272
install -Dm644 /dev/stdin "$pkgdir/usr/share/licenses/${FUNCNAME[1]#package_}/RSA-MD.txt"
273
}
274
275
package_sourcemod-scripting() {
276
pkgdesc="SourcePawn compiler (spcomp) and include files of SourceMod, for compiling SourceMod plugins"
277
# The include files: GPL 3.0 with SourceMod's exceptions (licenses/LICENSE.txt), which aren't on
278
# SPDX's list. spcomp: the Pawn compiler (zlib licence), SourcePawn (GPL 3.0 or later), AMTL (BSD
279
# 3-clause).
280
license=(
281
GPL-3.0-only
282
LicenseRef-SourceMod-exception
283
GPL-3.0-or-later
284
Zlib
285
BSD-3-Clause
286
)
287
depends=(bash glibc libgcc libstdc++ zlib)
288
provides=(spcomp)
289
conflicts=(spcomp)
290
291
local _package="$srcdir/sourcemod/build-scripting/package"
292
local _spcomp=("$_package"/spcomp*)
293
294
# The scripting folder of SourceMod's packages: the compiler, by the name of the 64-bit one, and
295
# the include files, which plugins and extensions add theirs to. In PATH as spcomp64 and spcomp,
296
# the 32-bit one's name, through spcomp.sh, which runs it by its path.
297
local _scripting="$pkgdir/usr/lib/sourcemod/addons/sourcemod/scripting"
298
install -Dm755 "${_spcomp[0]}" "$_scripting/spcomp64"
299
install -Dm644 "$_package"/include/*.inc -t "$_scripting/include"
300
install -Dm755 "$srcdir/spcomp.sh" "$pkgdir/usr/bin/spcomp64"
301
ln -s spcomp64 "$pkgdir/usr/bin/spcomp"
302
303
local _licenses="$pkgdir/usr/share/licenses/${FUNCNAME[0]#package_}"
304
install -Dm644 "$srcdir/sourcemod/licenses/LICENSE.txt" -t "$_licenses"
305
install -Dm644 "$srcdir/sourcemod/sourcepawn/LICENSE.txt" "$_licenses/SourcePawn.txt"
306
_package_amtl_license
307
}
308
309
package_sourcemod() {
310
pkgdesc="SourceMod, the scripting and administration platform for Source engine game servers, for the games of hl2sdk with Linux servers (the addons and cfg folders of a server)"
311
arch=(x86_64)
312
# SourceMod: GPL 3.0 with SourceMod's exceptions. SourcePawn (GPL 3.0 or later), AMTL and the
313
# regex extension's error table of PCRE2 (BSD 3-clause), SourceHook of Metamod:Source and DHooks'
314
# DynamicHooks (zlib licence), SafetyHook (Boost), Zydis, Zycore and core's alphanum comparison
315
# (MIT), the MD5 code of SourcePawn's VM and the updater (RSA), the Source SDK's libraries
316
# (source-sdk.txt).
317
license=(
318
GPL-3.0-only
319
LicenseRef-SourceMod-exception
320
GPL-3.0-or-later
321
BSD-3-Clause
322
Zlib
323
BSL-1.0
324
MIT
325
RSA-MD
326
LicenseRef-Source-SDK
327
)
328
# The games' 32-bit and 64-bit servers: SourcePawn's zlib, and SQLite of clientprefs' default
329
# storage; bash for compile.sh. Metamod:Source of the same build as metamod-source-src, whose interfaces are versioned
330
# and stay compatible, like SourceMod's for extensions.
331
depends=(
332
bash
333
gcc-libs
334
glibc
335
lib32-gcc-libs
336
lib32-glibc
337
lib32-sqlite
338
lib32-zlib
339
metamod-source
340
sqlite
341
zlib
342
)
343
# The database clients of the MySQL and PostgreSQL extensions, which SourceMod loads when a plugin
344
# connects through them, PCRE2 of the regex extension, which loads with a plugin that uses it (none
345
# of SourceMod's), and curl of the webternet extension, which loads with the updater (disabled in
346
# core.cfg), and libmaxminddb of the GeoIP extension, which loads with a plugin that uses it (none
347
# of SourceMod's): 32-bit for the 32-bit servers, 64-bit for the 64-bit ones
348
optdepends=(
349
'lib32-mariadb-connector-c: the MySQL extension, 32-bit servers'
350
'mariadb-libs: the MySQL extension, 64-bit servers'
351
'lib32-postgresql-libs: the PostgreSQL extension, 32-bit servers'
352
'postgresql-libs: the PostgreSQL extension, 64-bit servers'
353
'lib32-pcre2: the regex extension, 32-bit servers'
354
'pcre2: the regex extension, 64-bit servers'
355
'lib32-curl: the webternet extension of the updater, 32-bit servers'
356
'curl: the webternet extension of the updater, 64-bit servers'
357
'lib32-libmaxminddb: the GeoIP extension, 32-bit servers'
358
'libmaxminddb: the GeoIP extension, 64-bit servers'
359
'geoipupdate: the GeoLite2 City database of the GeoIP extension'
360
)
361
362
# The addons and cfg folders of a game (e.g. doi/addons, doi/cfg), to copy into a server: the same
363
# for each game, with the binaries of every game (*.2.<game>.so, x64/ for the 64-bit servers).
364
# With the 32-bit compiler and compile.sh, as in SourceMod's packages; without spcomp64 and the
365
# include files, which sourcemod-scripting has in the same folder. In /usr/lib, as it's mostly
366
# libraries.
367
install -d "$pkgdir/usr/lib/sourcemod"
368
cp -r --no-preserve=ownership "$srcdir"/sourcemod/build-games/package/{addons,cfg} "$pkgdir/usr/lib/sourcemod/"
369
rm -r "$pkgdir"/usr/lib/sourcemod/addons/sourcemod/scripting/{spcomp64,include}
370
# The GeoIP extension's database, which SourceMod's build doesn't have: geoipupdate's, kept up to
371
# date by its timer. The extension loads the first .mmdb file of configs/geoip, following
372
# symlinks, and skips this one while it doesn't exist.
373
ln -s /var/lib/GeoIP/GeoLite2-City.mmdb \
374
"$pkgdir/usr/lib/sourcemod/addons/sourcemod/configs/geoip/GeoLite2-City.mmdb"
375
376
local _licenses="$pkgdir/usr/share/licenses/${FUNCNAME[0]#package_}"
377
install -Dm644 "$srcdir/sourcemod/licenses/LICENSE.txt" -t "$_licenses"
378
install -Dm644 "$srcdir/sourcemod/sourcepawn/LICENSE.txt" "$_licenses/SourcePawn.txt"
379
_package_amtl_license
380
_package_rsa_md_license
381
install -Dm644 /usr/src/metamod-source/LICENSE.txt "$_licenses/Metamod-Source.txt"
382
install -Dm644 "$srcdir/sourcemod/public/safetyhook/LICENSE" "$_licenses/SafetyHook.txt"
383
install -Dm644 "$srcdir/zydis/LICENSE" "$_licenses/Zydis.txt"
384
install -Dm644 "$srcdir/zycore-c/LICENSE" "$_licenses/Zycore.txt"
385
install -Dm644 "$srcdir/source-sdk.txt" -t "$_licenses"
386
}
387
388
package_sourcemod-src() {
389
pkgdesc="SourceMod's sources the sourcemod packages are built from, with their patches, for building extensions against it (--sm-path=/usr/src/sourcemod)"
390
arch=(any)
391
# As sourcemod's, without the Source SDK's libraries
392
license=(
393
GPL-3.0-only
394
LicenseRef-SourceMod-exception
395
GPL-3.0-or-later
396
BSD-3-Clause
397
Zlib
398
BSL-1.0
399
MIT
400
RSA-MD
401
)
402
403
# The tree of the build after prepare(), with its submodules (AMTL, SourcePawn, the SDK
404
# manifests, SafetyHook with the regenerated Zydis), without the builds and git's files,
405
# read-only: builds against it write into their own build folders. Without tools/ (maintainer
406
# scripts and a PCRE 8 source for building the regex extension's old library), AMTL's googletest,
407
# which no build uses, and SourcePawn's AMTL, an empty submodule (SourceMod builds it with its
408
# own).
409
install -d "$pkgdir/usr/src/sourcemod"
410
tar -C "$srcdir/sourcemod" --exclude=.git --exclude=./build-scripting --exclude=./build-games \
411
--exclude=__pycache__ --exclude=./tools --exclude=./public/amtl/third_party \
412
--exclude=./sourcepawn/third_party -c . |
413
tar -C "$pkgdir/usr/src/sourcemod" -x --no-same-owner
414
415
local _licenses="$pkgdir/usr/share/licenses/${FUNCNAME[0]#package_}"
416
install -Dm644 "$srcdir/sourcemod/licenses/LICENSE.txt" -t "$_licenses"
417
install -Dm644 "$srcdir/sourcemod/sourcepawn/LICENSE.txt" "$_licenses/SourcePawn.txt"
418
_package_amtl_license
419
_package_rsa_md_license
420
install -Dm644 "$srcdir/sourcemod/public/safetyhook/LICENSE" "$_licenses/SafetyHook.txt"
421
install -Dm644 "$srcdir/zydis/LICENSE" "$_licenses/Zydis.txt"
422
install -Dm644 "$srcdir/zycore-c/LICENSE" "$_licenses/Zycore.txt"
423
}
424
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-11-03 14:04:44 | Low | 1 |
| 2026-11-03 12:04:35 | Low | 1 |