sourcemod-dev

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

Scan history

Scanned at (UTC)SeverityRules
2026-11-03 14:04:44 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion