metamod-source-src

LOW
maintainer ChrisTX 0 votes base metamod-source scanned 2026-11-03 12:04:35.126831
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=metamod-source
6pkgname=(metamod-source metamod-source-src)
7# Metamod:Source's version: the stable branch's tag, <version>.<build>, the build being the number of
8# commits, which its versioning counts with git
9pkgver=1.12.0.1229
10pkgrel=1
11pkgdesc="Metamod:Source, the plugin loader of SourceMod, for Source engine game servers, for the games of hl2sdk with Linux servers (the addons folder of a server)"
12arch=(x86_64)
13url="https://www.metamodsource.net"
14license=(Zlib)
15# The SDKs of the games, with their static libraries
16makedepends=(ambuild clang git hl2sdk python)
17# The full history of Metamod:Source, its versioning counts the commits. The submodules at the
18# commits the tag pins.
19source=("git+https://github.com/alliedmodders/metamod-source.git#tag=$pkgver"
20 "git+https://github.com/alliedmodders/amtl.git"
21 "git+https://github.com/alliedmodders/hl2sdk-manifests.git"
22 source-sdk.txt)
23sha512sums=('b0cd1b9fae5f7e6e463775748a5cf9b3c1ded6f9a5442e1d27af175cea664cc96fbff41ffab4782ce684528e7e4a26ae680cf896b3c3475b23485295cd2bb60c'
24 'SKIP'
25 'SKIP'
26 'f427709e7137dd0249070ffa3aedaf9c04b434172d56d8d453ada2d0c439c2b31a9c82551da5c993468fc286edba756d86073268894394ba5190fc1475ca09b3')
27b2sums=('e9bd2d1442d3cca1df7a42394d07d3117de790f1ce72651c579da12b9f6fbaaba12ece78b13a069ecc168436edaf9b00adb5e2acb86da63e4c2457c11115d5bf'
28 'SKIP'
29 'SKIP'
30 'b856088fc19f7c921a5e2b3320a776e27b10a8d3d77c21041cb59348b2efde62491163c57227080c0091eb77e74c0d1fc2c0b72a01e0770df27777dc077ad600')
31
32# Clang, like upstream's builds: the code builds with -Werror
33_compilers() {
34 export CC=clang CXX=clang++
35}
36
37prepare() {
38 cd "$pkgbase" || exit
39 local _submodule
40 for _submodule in third_party/amtl hl2sdk-manifests; do
41 git submodule init "$_submodule"
42 git config "submodule.$_submodule.url" "$srcdir/${_submodule##*/}"
43 done
44 git -c protocol.file.allow=always submodule update third_party/amtl hl2sdk-manifests
45}
46
47build() {
48 _compilers
49 mkdir -p "$pkgbase/build"
50 cd "$pkgbase/build" || exit
51 # Position-independent code for the SDKs' tier1 and mathlib, which the build compiles into the
52 # plugins: l4d2's manifest doesn't add -fPIC like the others, which leaves text relocations
53 CXXFLAGS+=" -fPIC"
54 # Every game of hl2sdk, for its servers' architectures. The SDKs' shared libraries (tier0,
55 # vstdlib) are only linked against, the games bring their own.
56 python ../configure.py --enable-optimize --enable-tests --sdks=present --targets=x86,x86_64 \
57 --hl2sdk-root=/usr/lib/hl2sdk
58 ambuild
59}
60
61check() {
62 cd "$pkgbase/build" || exit
63 # SourceHook's tests, the hooking library of Metamod:Source. 32-bit only: upstream doesn't build
64 # them for 64-bit Linux ("for now", alliedmodders/metamod-source@5d48696), and its next version
65 # replaces SourceHook with KHook.
66 ./core/sourcehook/test/test_sourcehook/linux-x86/test_sourcehook -v
67}
68
69_package_amtl_license() {
70 # AMTL has no licence file, its licence is in each of its files
71 sed -n 3,28p "$srcdir/$pkgbase/third_party/amtl/amtl/am-string.h" | sed 's|^// \?||' |
72 install -Dm644 /dev/stdin "$pkgdir/usr/share/licenses/${FUNCNAME[1]#package_}/AMTL.txt"
73}
74
75package_metamod-source() {
76 pkgdesc="Metamod:Source, the plugin loader of SourceMod, for Source engine game servers, for the games of hl2sdk with Linux servers (the addons folder of a server)"
77 # Metamod:Source (zlib licence), the Source SDK's libraries it links (source-sdk.txt)
78 license=(Zlib LicenseRef-Source-SDK)
79 # The games' 32-bit and 64-bit servers
80 depends=(gcc-libs glibc lib32-gcc-libs lib32-glibc)
81
82 cd "$pkgbase/build/package" || exit
83
84 # The addons folder of a game (e.g. doi/addons), with metamod.vdf, which loads Metamod:Source, to
85 # copy into a server: the same for each game, with the binaries of every game (metamod.2.<game>.so,
86 # bin/linux64 for the 64-bit servers). In /usr/lib, as it's mostly libraries.
87 install -d "$pkgdir/usr/lib/metamod"
88 cp -r --no-preserve=ownership addons "$pkgdir/usr/lib/metamod/"
89
90 local _licenses="$pkgdir/usr/share/licenses/${FUNCNAME[0]#package_}"
91 install -Dm644 "$srcdir/$pkgbase/LICENSE.txt" -t "$_licenses"
92 install -Dm644 "$srcdir/source-sdk.txt" -t "$_licenses"
93}
94
95package_metamod-source-src() {
96 pkgdesc="Metamod:Source's sources the metamod-source package is built from, for building SourceMod and plugins or extensions against it (--mms-path=/usr/src/metamod-source)"
97 arch=(any)
98 # Metamod:Source (zlib licence), AMTL (BSD 3-clause)
99 license=(Zlib BSD-3-Clause)
100
101 # The tree of the build with its submodules (AMTL, the SDK manifests), without the build and git's
102 # files, read-only: builds against it write into their own build folders. Without what's prebuilt:
103 # SourceHook's generator worker (shworker.bin and .exe, from shworker/), the Windows installer of
104 # cruft/, and AMTL's googletest, an empty submodule.
105 install -d "$pkgdir/usr/src/metamod-source"
106 tar -C "$srcdir/$pkgbase" --exclude=.git --exclude=./build --exclude=__pycache__ \
107 --exclude=./core/sourcehook/generate/shworker.bin --exclude=./core/sourcehook/generate/shworker.exe \
108 --exclude=./cruft --exclude=./third_party/amtl/third_party -c . |
109 tar -C "$pkgdir/usr/src/metamod-source" -x --no-same-owner
110
111 install -Dm644 "$srcdir/$pkgbase/LICENSE.txt" -t "$pkgdir/usr/share/licenses/${FUNCNAME[0]#package_}"
112 _package_amtl_license
113}
114

Scan history

Scanned at (UTC)SeverityRules
2026-11-03 12:04:35 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