hl2sdk

MEDIUM
maintainer ChrisTX 0 votes scanned 2026-11-05 20:10:15.251681
View on AUR
Why flagged

One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).

Triggered rules

Medium source=() URL on a non-standard host source_untrusted_domain

One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).

  • PKGBUILD:68 https://www.ijg.org/files/jpegsrc.v6b.tar.gz
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 offending line(s) highlighted
1# Maintainer: Christian Pfeiffer <cpfeiffer at rev-crew dot info>
2# shellcheck disable=SC2034,SC2154
3# shellcheck shell=bash
4
5pkgname=hl2sdk
6# The date of the newest commit of the SDKs' branches
7pkgver=20261002
8pkgrel=1
9pkgdesc="Source SDKs of the games Metamod:Source and SourceMod support, with their static libraries built from source (a build dependency)"
10arch=(x86_64)
11url="https://github.com/alliedmodders/hl2sdk"
12# The SDKs (source-sdk.txt); the third-party code in them and in their libraries: Protocol Buffers
13# and snappy (BSD 3-clause), zlib's headers, libjpeg's headers (IJG) and XZip/XUnzip (Info-ZIP)
14license=(LicenseRef-Source-SDK BSD-3-Clause Zlib IJG Info-ZIP)
15# The 32-bit libraries of the games' 32-bit servers
16makedepends=(clang gcc lib32-gcc-libs lib32-glibc)
17# Static libraries, the SDKs' link libraries as they are (Valve's, the games bring their own)
18options=(staticlibs !strip !debug !lto)
19# The games with a Linux server of hl2sdk-manifests, Source 1 only (Metamod:Source and SourceMod
20# 1.12), each the latest commit of its branch
21_sdks=(blade bms csgo css dods doi episode1 hl2dm insurgency l4d l4d2 mcv nucleardawn orangebox pvkii
22 sdk2013 tf2)
23_commit_blade=a736c9a6c676136f575af5056384851a8e1e788a
24_commit_bms=69fe26fed5ad34cb6ef032c57a54f8efbcdd8849
25_commit_csgo=9cf2f325ea273559c7cae27b4f98518c18b8e322
26_commit_css=47f0ea659bc70718f9c41a7830b6ad943a68ba09
27_commit_dods=cbc97391097ed5c2790ab3fac6f9d05661d3a10f
28_commit_doi=ceefec48c282335da40a30f66bf498bd8e327d2f
29_commit_episode1=4b0cde271be6806b95842e78348009712a8b3fbe
30_commit_hl2dm=11dca0f12e53089b9dee6511f6b8ff4d02c9d51d
31_commit_insurgency=f66e087ee2993e8f09b27deed9f23c03321bd70d
32_commit_l4d=0a8e862697335b12976a124daf728c38e975e381
33_commit_l4d2=2a31cd007b2d7d2f964dc093eedcf7a812cf9dd6
34_commit_mcv=e83260bc8de65d07a5fb73b5c2686a98e9927b2e
35_commit_nucleardawn=38a4308cce4f0574d76ee36cedf20aa76054fbee
36_commit_orangebox=88bc34abdd51421afed7bd120d457cbdc372ccfa
37_commit_pvkii=f65b48326a73aafe9f15eb238c2fe3fe4c82d0d1
38_commit_sdk2013=4c56ee5bc8bfe00793abb7d40eb3f6fb040f10d2
39_commit_tf2=631a7b6c0cbbb6941cf22e434620911a0bdfd478
40# Where ./aur-packages commits reads the pins from: the head of each SDK's branch, and the version
41# from the newest commit's date (or the next pkgrel for older commits)
42_pins_lookup() {
43 local sdk head ref var date ver=$pkgver changed=false
44 local -A heads
45 while read -r head ref; do
46 heads[${ref#refs/heads/}]=$head
47 done < <(git ls-remote --heads https://github.com/alliedmodders/hl2sdk.git)
48 for sdk in "${_sdks[@]}"; do
49 var=_commit_$sdk
50 echo "$var ${heads[$sdk]-}"
51 [[ -n "${heads[$sdk]-}" && "${heads[$sdk]}" != "${!var}" ]] || continue
52 changed=true
53 date=$(curl -fsSL "https://api.github.com/repos/alliedmodders/hl2sdk/commits/${heads[$sdk]}" |
54 jq -r .commit.committer.date)
55 date=${date:0:10}
56 date=${date//-/}
57 if [[ "$date" =~ ^[0-9]{8}$ ]] && ((date > ver)); then ver=$date; fi
58 done
59 echo "pkgver $ver"
60 if [[ "$changed" == true && "$ver" == "$pkgver" ]]; then echo "pkgrel $((pkgrel + 1))"; fi
61}
62# Protocol Buffers of csgo and blade (2.5.0), and mcv (3.2.0), whose generated code their SDKs have
63_protobufvers=(2.5.0 3.2.0)
64source=("https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2"
65 "https://github.com/protocolbuffers/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz"
66 # The READMEs of libjpeg 6b and 8, whose headers the SDKs have: the IJG licence asks for them
67 # with the sources
68 https://www.ijg.org/files/jpegsrc.v6b.tar.gz
69 https://www.ijg.org/files/jpegsrc.v8.tar.gz
70 source-sdk.txt)
71for _sdk in "${_sdks[@]}"; do
72 _commit="_commit_$_sdk"
73 source+=("hl2sdk-$_sdk-${!_commit}.tar.gz::https://github.com/alliedmodders/hl2sdk/archive/${!_commit}.tar.gz")
74done
75sha512sums=('5994b3669808b82fef5c860ecad36358c0767f84acac877e7bfcf722e59d972835a955714149bdd4158fbd1328a51d01397a563991d26475351ee72be48142ee'
76 'dd005f5e862ff24bb233b9eaed1d7f44c42f1cc8c647c0839fe2ecc2d91178845195d79776cfa2e31d224c16eed11b05ad824b66b743e685334057d8180f17aa'
77 '5d37d3695105fc345ca269ab98cd991472e5de72f702c9a8a652a7d114a40eb99670c69a87ecb24bf64e96318fc0ee2bcb44c497d9d3d2a67378c99e4eb348fe'
78 '53ffa23f0f406ce35289b810cc4fa4459fdc9668aac32cd49699833f267dfe9673706cbaefadd9b66723fa0c76a0c05abd966ae8d6bb766abfc499f0e55489db'
79 '3201fbe03d93be488c2f6dd2359434a621701c83409c4876f8308a8724652bc973ef2e8b284b321d52df4ce2bfc9e52e13d56710b41dc68716e66ce21297f24d'
80 '2e359d0a62f68171399e191576548ab0dd1964878aeb1aafaf480190768e7a8876a876b612eb0699b720f7f58d85cba9285b94b5200f109f2c8d2a14060291c0'
81 'ca31dc1ad529f6bb62fd493b2973e3476875788eb584f497fe077691280b2b1faf5ccc28f283e39cc6b685d25da48ba0f76a2de860ef339a8e2d353956ab2aed'
82 '489a1c8e9f69c017862d771e60934e88077639cf0aa44a2ebf29158ac15747ae29e8d561b9ec169cb9b27de81fc7888357985b9d79fe429227a4b1542fbd8b7c'
83 'df05a984408b22dff3aa4fa2b1b26b6d69324bf673d1c4248e3ceb1c2557cc33f673c241fea96bf9c0318b126e591debac88e07de999c24a420d90fdb18e7eb8'
84 'a86ed437f77514980ef812b61678637af38bcb8976173e0c6f69100ab7c64a334454195b08e70f53e2f7cf5020d96c7697d8ec3ef3b2b1b6a11ce823bce9e910'
85 '871da7e6e02c27fd1d7a4ae1beaabf5346805814354321cc42903c137832f13eac574e44db5b5c8afc5f694ba95b0b8136d7b07e686740c620315bb2f2598f7b'
86 '1e9a321488e5e821e968879527b609a0aa5350713e35781b7352aa5de1d073f0d5040705ce5c03bd9f0f33bf53e1258f30bab53e0a4b9f1381b65aac31b58467'
87 '2015a14d8e4e1be9415170cbb35f4da384bfd4c1bc2c089cd206e8abb9bbe2aa843955adfb0b485963c019cb04cfb98d366942656c8dd6aa437338c842bc0c20'
88 '07cc9c5c8d034540871f75323836fa479e92a95c372ed77c2daf194bcb3a5406ac83266d5a894b859104b3d657b071deb967304cf1c8f7641c9885a50c5a0de5'
89 '68b6e1dc148fbb3e8f46f3393cd0757214581dee8f60fffb87e20e36748788720d6d0c30080987eaaff4b3711611240e2d88f5dee2b638b2cb125516b2d918fd'
90 '5587e98f9957255457014bae772958af12503db1a41745fbe495ef11918c8bfc056ed2a3fd84be63634211a9163680e78be441394d85929ac040d52f1e8c3944'
91 'c43da7adc1737551b209f2539c035f4d43cb96412173ce24845a13b4f581a76b65dc4c7b1391107daa75078238d2ed355e447fc413d8ad515b6a25e79a3a8a10'
92 '33950f6633802a9b9900b02a2c4eea76e7d18952a75eff32f751e2994988696ee03fee76cc4a578d3ee497582f88119883fc3a8bbdb5877805b4051379d3a38a'
93 '29e9ddab1aef503cf218c02d4089fcebd29b8c36a9f239e718bf2fcd614d8b878bd3ba30d349f240383a3790e9158593d1fea1ae1715f94fbf32754e71bc282f'
94 'd344ed67d83ecd01790dff01ffc4895d8d095a06dfbe7fed1e27ff0961c747f7c1609413395ec8411e0a83637d7d61a11d6aa45cad03e8e89986d78bba05ae48'
95 'b44b1436a11a7de377fb25f8b0719caa58d6b40cdabc7c408e8952622b3ccbb02128547201182dcce59051feb0a570caf6e808df2a367968595dc16e51ac60f6'
96 'c1687d75540083989d9b0d4b5ce92f41639c223eb455b5d7a5318c55ba5e9597e7fcc84df6f1cffaf46dbf9616db6a14081ca617c1a13d55abbbe098f2845e02')
97b2sums=('e4cece402bbeaff4400732ee2401f1a80bb0e70728eb41052da26b969b6fa6672b11ca80e28343d03a9df97c72bb8d8e2f890b9b730bad3c23c829aaf36ff701'
98 '5749625877434645a16967cd441c69877802185db1ad70f27017c3e0610eb1a2271ffddfa6e67d4aa078d407d7c7d8b97ce9b17520d927984b9d06e6cba7ed27'
99 'd08406bebcbec9aa0197ef7854f163dc12d916e7e7df466e5408e715aa20738c047f0f709699311186e17da443af9afc208765f74bcc51a7bab2284c54351868'
100 'd7c90df6a8bf430953853c3858180c349377d5ef38c2baf80f31c226fc0730a98423062fffb44749c4fa91461bf71d3e92a76d382901eae92c446fde6e6bce88'
101 'fa5618aacaf38ee80c21f91ede0aa2137307d8695ad4b4788b977ef2de9dde3764a29895fd7a2f0f4e70ba424e9417e680870dfd9f281768b19d993587436bc8'
102 '98ffa85993625d012ba18271522093d49163b3c3e17124736e4aff299b325c26ab2becf9287bd15ff7d19e6c6d7e941d6a7012f2391a786a2211844d314c5dc1'
103 '80050d16412535f4e79e3c6e8de1c57762491cda5315cd643be3e72813fd4cfc5b597bec8afae5a34dcdcf010ac65b9dfba746641bb0a8d04e84e62ef5ab8666'
104 '8fd706f9118d15d8680de3554bdc2f25062153ccc5c1e87be588c9aa8024484db9963ef2419cf3f15545b45f053f76237c7b7ec383553e92e5d1c0bfad0888e8'
105 'a01920a2232d5bf73e5466bb1aa9d98b232aca9d3a17ea3cf1b7ef56d99bfd74d50a37c5900f47258cf157f54da031de4360bfdbda8a21d5027edef60b8f1d91'
106 'b8e2a3c5662ad83e4d48bd4feaed8f2fedf7ef36cfaf2adc012b29d5b1fc28eb70bd756ebae3332332ec81bda00057285638c50d1bcd825153c169e2cb5525a2'
107 '9ba6aca4061cd1b67b281de669014372d2bced8f4a6142f93558dc8a3143fcbec469d46dd17fa07a0455b47909050f4fe06de09222e76f056034a4e07a4469ff'
108 '06a157e7008099581ada56cf6a79e8d0566f576c720013268d771167b6838f2349b25c6fc4142ee01c438d08b5b5596934f3e002ffbf371c3c842ca66625da03'
109 'e6bf87a112d9095aa026bf50fe52525974991a4f31aa066ec654bb9f1d4534c5fc8260df5c4c65e45481e3d5ff300e2c3ea6f505e531b3c7c5bb4691f965d269'
110 '23937c1fc69cfa9a19bb2aca434091c550ff8f42d9d5316a94111eebcbc33881ac3f86320dae7c763d4a063295d6a70815a7ded05cd85acb9fb58f770949f7ea'
111 'e61c2e8b5c200bbe80bd5c6684dd20c3a721f64c68bd9550c4c98d5d56522222588195e44f38456402b112ab69ea632d99e88c73213307d65a077fc85ec74e77'
112 'fbdee5ddbd0a6f6b6e2702b0ab78e5f585b291cf8c9ed4dd8f275115c790c462199d3a7300e634d01ec319fc9b49fe77a0e8713d977578e66ef842def393644f'
113 'a3153b4e51a46cd281880baeed7f35776d1524e331d6fe512e8fada1408990527f26d33199ff4c3e7f4211ac26619c57045022f63c511deb44cba808f8eff54d'
114 'bbfa10077e82d6a26d4ba5bf7464f0777b41d69ce407d21d2bec4f8b4424bb751cd7eb8c2bc1bc9a0da58d4f430708cf760a2a465fbe484356e2295c8cd11930'
115 '27815b8260f1b3337f6fc21c45c940cfc4cc4e76eca5f75d8f1bf69df822c5e74f3aa7a23b6aed4d75171c0e313449794162dced25a5d50ffe6f04da56ba40a1'
116 '5d4682e5ae3bf4f5dce5972d2be08f7896c5ac5aeee8ab0ae8270d6cce80f2329b4029492d883ee634d43e366127b6b5fb70648ca241a29792438b8e14d3c53d'
117 '97a35d28adb1f64eb2130bb3c5cc0d7943c3776fa388594d740c5be768b4753089f3d8a69f7cc4a820154113643cfe1859b29d0b5513cde625ea89523a273891'
118 'd57b9524e59f49e0555a33a923f0458c3933f894d6a28343c9864de3bc9a329df15974e6114068305585489b8aff91228d4fb5a201f08c6f41acc44af249b8e9')
119
120prepare() {
121 local _sdk _commit
122 for _sdk in "${_sdks[@]}"; do
123 _commit="_commit_$_sdk"
124 ln -sfn "hl2sdk-${!_commit}" "$srcdir/hl2sdk-$_sdk"
125 done
126
127 # clamp() of a float with int bounds, whose template arguments conflict where clamp() takes one
128 # type: the line of episode1, l4d, nucleardawn and orangebox (the others have float bounds already)
129 sed -i 's/clamp( t, 0, 1 )/clamp( t, 0.0f, 1.0f )/' "$srcdir"/hl2sdk-*/mathlib/mathlib_base.cpp
130 # MIN and MAX of basetypes.h, which orangebox's quantizers (CRLF line endings) don't include,
131 # unlike l4d's
132 sed -i 's|^#include <quantize.h>\r\?$|&\n#include <tier0/basetypes.h>|' \
133 "$srcdir"/hl2sdk-orangebox/mathlib/{imagequant,quantize}.cpp
134 # episode1's tier1, whose sources are newer than its Linux build (CRLF line endings): MAX of
135 # basetypes.h instead of Windows' minmax.h, IsPowerOfTwo of commonmacros.h for memalloc.h, and
136 # the const base of CUtlMemoryStack
137 local _ep1="$srcdir/hl2sdk-episode1"
138 sed -i 's|^#include "minmax.h".*|#include "tier0/basetypes.h"\r|' "$_ep1/tier1/mempool.cpp"
139 sed -i 's|^#include "tier0/mem.h"\r\?$|&\n#include "tier0/commonmacros.h"|' \
140 "$_ep1/public/tier0/memalloc.h"
141 sed -i 's|^\(\s*const T\* Base() const\s*{ return (T\*)\)m_MemoryStack\.GetBase()|\1const_cast<CMemoryStack \&>( m_MemoryStack ).GetBase()|' \
142 "$_ep1/public/tier1/memstack.h"
143 # min() and max() of bms, Windows macros (valve_minmax_on.h leaves them out on POSIX): V_min and
144 # V_max of minmax.h, like sdk2013's sources; snappy's are std::min
145 local _bms="$srcdir/hl2sdk-bms"
146 sed -i -E 's/(^|[^_A-Za-z0-9:.>])(min|max)\s*\(/\1V_\2(/g' \
147 "$_bms"/tier1/{diff,mempool,strtools,utlsymbol}.cpp \
148 "$_bms"/mathlib/{mathlib_base,sparse_convolution_noise,imagequant,quantize,simdvectormatrix}.cpp
149 # iconv_open()'s error of bms' strtools.cpp, (iconv_t)-1, which an ordered comparison of the
150 # pointer with 0 doesn't detect (sdk2013's casts it to int instead)
151 sed -i 's/if ( conv_t > 0 )/if ( conv_t != (iconv_t)-1 )/' "$_bms/tier1/strtools.cpp"
152}
153
154# Builds a static library of an SDK with its Makefile (linux_sdk), 32-bit or, overriding its
155# architecture, 64-bit, with clang or gcc: _make_lib <sdk> <library> [x86|x86_64] [clang|gcc]. The
156# SDKs' code is from 2008 to 2014 and builds with -Werror, for which current compilers have new
157# warnings.
158_make_lib() {
159 local _sdk=$1 _lib=$2 _arch=${3:-x86} _cc=${4:-clang}
160 local _flags="-std=gnu++14 -fPIC -Wno-error"
161 # Without CPP_LIB, the game's libstdc++ (unquoted in nucleardawn's Makefile), which only the
162 # game binaries link
163 local -a _args=(CPP_LIB=)
164 if [[ "$_cc" == gcc ]]; then
165 _args+=(CC=gcc CPLUS=g++ CLINK=gcc)
166 _flags+=" -Wno-narrowing"
167 else
168 _args+=(CC=clang CPLUS=clang++ CLINK=clang)
169 _flags+=" -Wno-c++11-narrowing"
170 fi
171 if [[ "$_arch" == x86_64 ]]; then
172 # The Makefiles only know 32-bit: the defines of 64-bit builds are SdkHelpers'
173 _args+=(ARCH=x86_64 "ARCH_CFLAGS=-m64 -march=x86-64 -mtune=generic" LIB_DIR=../lib/linux64)
174 _flags+=" -DX64BITS -DPLATFORM_64BITS"
175 elif [[ "$_sdk" == episode1 ]]; then
176 # episode1's Makefile has no -m32 and builds into linux_sdk
177 _flags+=" -m32"
178 fi
179 make -C "$srcdir/hl2sdk-$_sdk/linux_sdk" "$_lib" "${_args[@]}" USER_CFLAGS="$_flags"
180 if [[ "$_arch" == x86_64 ]]; then
181 mv "$srcdir/hl2sdk-$_sdk/lib/linux64/${_lib}_x86_64.a" "$srcdir/hl2sdk-$_sdk/lib/linux64/$_lib.a"
182 fi
183}
184
185# Builds a static library of an SDK without Makefiles (sdk2013, bms) from the files of its VPC
186# project that Linux builds, with the defines of its VPC scripts and V_min/V_max of minmax.h, which
187# sdk2013's vector.h includes, bms' not: _vpc_lib <sdk> <library> <define>
188_vpc_lib() {
189 local _sdk=$1 _lib=$2 _define=$3
190 local _dir="$srcdir/hl2sdk-$_sdk/$_lib" _obj="$srcdir/obj-$_sdk-$_lib" _file _src
191 local -a _objs=()
192 mkdir -p "$_obj"
193 # $File "name" without a condition, or one for POSIX or Linux
194 while read -r _file; do
195 _file=${_file//\\//}
196 # Paths relative to the project, or to the SDK ($SRCDIR)
197 if [[ "$_file" == [$]SRCDIR/* ]]; then
198 _src="$srcdir/hl2sdk-$_sdk/${_file#[$]SRCDIR/}"
199 else
200 _src="$_dir/$_file"
201 fi
202 local _cc=(clang++ -std=gnu++14 -Wno-c++11-narrowing)
203 [[ "$_src" == *.c ]] && _cc=(clang)
204 "${_cc[@]}" -m32 -march=pentium4 -msse2 -mfpmath=sse -O2 -fPIC -w \
205 -DVPC -DGNUC -DPOSIX -D_POSIX -DCOMPILER_GCC -D_DLL_EXT=.so -D_LINUX -DLINUX -DNDEBUG \
206 -DRAD_TELEMETRY_DISABLED -DVPROF_LEVEL=1 -DNO_HOOK_MALLOC -DNO_MALLOC_OVERRIDE \
207 "-DLIBNAME=$_lib" -D_LIB "-D$_define" -Usprintf -Ustrncpy -UPROTECTED_THINGS_ENABLE \
208 -include minmax.h \
209 -I"$srcdir/hl2sdk-$_sdk"/{common,public,public/tier0,public/tier1,public/mathlib} \
210 -c "$_src" -o "$_obj/$(basename "$_src").o"
211 _objs+=("$_obj/$(basename "$_src").o")
212 done < <(sed -nE 's/^\s*[$]File\s+"([^"]+\.(cpp|c))"\s*(\[[^]]*(POSIX|LINUX)[^]]*\])?\s*$/\1/p' "$_dir/$_lib.vpc")
213 ar rcs "$srcdir/hl2sdk-$_sdk/lib/public/linux32/$_lib.a" "${_objs[@]}"
214}
215
216# Builds Protocol Buffers' library, 32 or 64-bit: _protobuf <version> <x86|x86_64>
217_protobuf() {
218 local _ver=$1 _arch=$2 _dir="$srcdir/protobuf-$1-$2"
219 local -a _host=()
220 local _m=-m64
221 if [[ "$_arch" == x86 ]]; then
222 _host=(--host=i686-pc-linux-gnu)
223 _m=-m32
224 fi
225 rm -rf "$_dir"
226 cp -a "$srcdir/protobuf-$_ver" "$_dir"
227 cd "$_dir" || exit
228 CC="clang $_m" CXX="clang++ $_m" CFLAGS="-O2 -fPIC" CXXFLAGS="-O2 -fPIC -std=gnu++11" LDFLAGS="" \
229 ./configure "${_host[@]}" --disable-shared --with-pic --without-zlib
230 make -C src libprotobuf.la
231}
232
233build() {
234 local _sdk _lib
235
236 # The static libraries the manifests link, built instead of the prebuilt ones, which all go. The
237 # games of Valve's newer SDK (css, dods, hl2dm, pvkii, tf2) build tier1 and mathlib with their
238 # AMBuilders in Metamod:Source's and SourceMod's builds.
239 for _sdk in "${_sdks[@]}"; do
240 find "$srcdir/hl2sdk-$_sdk/" -name '*.a' -delete
241 done
242 for _sdk in doi insurgency csgo; do
243 for _lib in tier1 mathlib interfaces; do _make_lib "$_sdk" "$_lib"; done
244 done
245 for _sdk in l4d l4d2 nucleardawn; do
246 for _lib in tier1 mathlib; do _make_lib "$_sdk" "$_lib"; done
247 done
248 # The mathlibs of orangebox and episode1 with gcc, like Valve's: their 3DNow! code ties a float
249 # output to an int input in inline assembly, which clang doesn't support
250 _make_lib orangebox tier1
251 _make_lib orangebox mathlib x86 gcc
252 _make_lib episode1 tier1
253 _make_lib episode1 mathlib x86 gcc
254 for _sdk in csgo blade mcv; do
255 for _lib in tier1 mathlib interfaces; do _make_lib "$_sdk" "$_lib" x86_64; done
256 done
257 for _sdk in sdk2013 bms; do
258 _vpc_lib "$_sdk" tier1 TIER1_STATIC_LIB
259 _vpc_lib "$_sdk" mathlib MATHLIB_LIB
260 done
261
262 # Protocol Buffers for the usermessages of csgo, blade and mcv, where their builds look for them
263 _protobuf 2.5.0 x86
264 _protobuf 2.5.0 x86_64
265 _protobuf 3.2.0 x86_64
266 install -Dm644 "$srcdir/protobuf-2.5.0-x86/src/.libs/libprotobuf.a" -t "$srcdir/hl2sdk-csgo/lib/linux32/release"
267 for _sdk in csgo blade; do
268 install -Dm644 "$srcdir/protobuf-2.5.0-x86_64/src/.libs/libprotobuf.a" -t "$srcdir/hl2sdk-$_sdk/lib/linux64/release"
269 done
270 install -Dm644 "$srcdir/protobuf-3.2.0-x86_64/src/.libs/libprotobuf.a" -t "$srcdir/hl2sdk-mcv/lib/linux64/release"
271}
272
273# The static libraries the manifests link: ELF class and path
274_libs="\
275ELF32 hl2sdk-csgo/lib/linux/tier1_i486.a
276ELF32 hl2sdk-csgo/lib/linux/mathlib_i486.a
277ELF32 hl2sdk-csgo/lib/linux/interfaces_i486.a
278ELF64 hl2sdk-csgo/lib/linux64/tier1.a
279ELF64 hl2sdk-csgo/lib/linux64/mathlib.a
280ELF64 hl2sdk-csgo/lib/linux64/interfaces.a
281ELF32 hl2sdk-csgo/lib/linux32/release/libprotobuf.a
282ELF64 hl2sdk-csgo/lib/linux64/release/libprotobuf.a
283ELF64 hl2sdk-blade/lib/linux64/tier1.a
284ELF64 hl2sdk-blade/lib/linux64/mathlib.a
285ELF64 hl2sdk-blade/lib/linux64/interfaces.a
286ELF64 hl2sdk-blade/lib/linux64/release/libprotobuf.a
287ELF64 hl2sdk-mcv/lib/linux64/tier1.a
288ELF64 hl2sdk-mcv/lib/linux64/mathlib.a
289ELF64 hl2sdk-mcv/lib/linux64/interfaces.a
290ELF64 hl2sdk-mcv/lib/linux64/release/libprotobuf.a
291ELF32 hl2sdk-doi/lib/linux/tier1_i486.a
292ELF32 hl2sdk-doi/lib/linux/mathlib_i486.a
293ELF32 hl2sdk-doi/lib/linux/interfaces_i486.a
294ELF32 hl2sdk-insurgency/lib/linux/tier1_i486.a
295ELF32 hl2sdk-insurgency/lib/linux/mathlib_i486.a
296ELF32 hl2sdk-insurgency/lib/linux/interfaces_i486.a
297ELF32 hl2sdk-l4d/lib/linux/tier1_i486.a
298ELF32 hl2sdk-l4d/lib/linux/mathlib_i486.a
299ELF32 hl2sdk-l4d2/lib/linux/tier1_i486.a
300ELF32 hl2sdk-l4d2/lib/linux/mathlib_i486.a
301ELF32 hl2sdk-nucleardawn/lib/linux/tier1_i486.a
302ELF32 hl2sdk-nucleardawn/lib/linux/mathlib_i486.a
303ELF32 hl2sdk-orangebox/lib/linux/tier1_i486.a
304ELF32 hl2sdk-orangebox/lib/linux/mathlib_i486.a
305ELF32 hl2sdk-episode1/linux_sdk/tier1_i486.a
306ELF32 hl2sdk-episode1/linux_sdk/mathlib_i486.a
307ELF32 hl2sdk-sdk2013/lib/public/linux32/tier1.a
308ELF32 hl2sdk-sdk2013/lib/public/linux32/mathlib.a
309ELF32 hl2sdk-bms/lib/public/linux32/tier1.a
310ELF32 hl2sdk-bms/lib/public/linux32/mathlib.a"
311
312check() {
313 # Every static library a manifest links is built here, for its architecture, and there are no
314 # others
315 local _lib _class _sdk _built _expected
316 _built=$(cd "$srcdir" && for _sdk in "${_sdks[@]}"; do
317 find "hl2sdk-$_sdk/" -name '*.a' -printf "hl2sdk-$_sdk/%P\n"
318 done | sort)
319 _expected=$(while read -r _class _lib; do echo "$_lib"; done <<<"$_libs" | sort)
320 if [[ "$_built" != "$_expected" ]]; then
321 echo "hl2sdk: other static libraries than the expected ones:" >&2
322 diff <(echo "$_expected") <(echo "$_built") >&2
323 return 1
324 fi
325 while read -r _class _lib; do
326 [[ "$(readelf -h "$srcdir/$_lib" 2>/dev/null | sed -n 's/^ *Class: *//p' | sort -u)" == "$_class" ]] || {
327 echo "hl2sdk: $_lib is missing or not $_class" >&2
328 return 1
329 }
330 done <<<"$_libs"
331
332 # The licence notices package() takes from the sources
333 if ! grep -q 'madler@' "$srcdir/hl2sdk-tf2/public/zlib/zlib.h" ||
334 ! grep -q 'SUCH DAMAGE\.' "$srcdir/hl2sdk-sdk2013/tier1/snappy.cpp" ||
335 ! grep -q 'own source and binary releases\.' "$srcdir/hl2sdk-sdk2013/public/XUnzip.cpp"; then
336 echo "hl2sdk: a license notice of zlib, snappy or Info-ZIP isn't where package() takes it from" >&2
337 return 1
338 fi
339}
340
341package() {
342 local _sdk _dest _dir _lib
343 for _sdk in "${_sdks[@]}"; do
344 _dest="$pkgdir/usr/lib/hl2sdk/hl2sdk-$_sdk"
345 install -d "$_dest"
346 cd "$srcdir/hl2sdk-$_sdk" || exit
347 # What the builds use: the headers, the code they compile (game/shared and game/server, or
348 # episode1's game_shared and dlls, the libraries' sources and AMBuilders, the lzma headers of
349 # tier1's lzmaDecoder.cpp) and the Linux libraries, without the tools, the clients' code and
350 # other platforms' libraries
351 local _dirs=(public common game/shared game/server game_shared dlls tier1 mathlib interfaces
352 engine utils/lzma)
353 for _dir in "${_dirs[@]}"; do
354 [[ -d "$_dir" ]] && cp -r --no-preserve=ownership --parents "$_dir" "$_dest/"
355 done
356 find lib linux_sdk \( -name '*.so' -o -name '*.a' \) -path '*linux*' 2>/dev/null |
357 while read -r _lib; do install -Dm644 "$_lib" "$_dest/$_lib"; done
358 done
359 local _licenses="$pkgdir/usr/share/licenses/$pkgname"
360 install -Dm644 "$srcdir/source-sdk.txt" -t "$_licenses"
361 install -Dm644 "$srcdir/protobuf-2.5.0/COPYING.txt" "$_licenses/protobuf-2.5.0.txt"
362 install -Dm644 "$srcdir/protobuf-3.2.0/LICENSE" "$_licenses/protobuf-3.2.0.txt"
363 install -Dm644 "$srcdir/jpeg-6b/README" "$_licenses/libjpeg-6b.txt"
364 install -Dm644 "$srcdir/jpeg-8/README" "$_licenses/libjpeg-8.txt"
365 # The notices in the sources, the same in every SDK that has them: zlib's headers (zlib 1.2.5),
366 # snappy (in tier1 of sdk2013 and bms) and the Info-ZIP code of XZip and XUnzip
367 sed -n '1,/madler@/p' "$srcdir/hl2sdk-tf2/public/zlib/zlib.h" |
368 sed -E '1s#^/\* ##; s/\r$//' >"$_licenses/zlib.txt"
369 sed -n '1,/SUCH DAMAGE\./p' "$srcdir/hl2sdk-sdk2013/tier1/snappy.cpp" |
370 sed -E 's#^// ?##; s/\r$//' >"$_licenses/snappy.txt"
371 sed -n '/This is version 2002-Feb-16/,/own source and binary releases\./p' \
372 "$srcdir/hl2sdk-sdk2013/public/XUnzip.cpp" | sed -E 's#^// ?##; s/\r$//' >"$_licenses/info-zip.txt"
373}
374

Changes since previous scan

--- PKGBUILD @ 2026-11-03 12:09
+++ PKGBUILD @ 2026-11-05 20:10
@@ -124,8 +124,8 @@
ln -sfn "hl2sdk-${!_commit}" "$srcdir/hl2sdk-$_sdk"
done
- # clamp() of a float with int bounds, whose template arguments conflict (l4d, l4d2, nucleardawn,
- # orangebox)
+ # clamp() of a float with int bounds, whose template arguments conflict where clamp() takes one
+ # type: the line of episode1, l4d, nucleardawn and orangebox (the others have float bounds already)
sed -i 's/clamp( t, 0, 1 )/clamp( t, 0.0f, 1.0f )/' "$srcdir"/hl2sdk-*/mathlib/mathlib_base.cpp
# MIN and MAX of basetypes.h, which orangebox's quantizers (CRLF line endings) don't include,
# unlike l4d's

Scan history

Scanned at (UTC)SeverityRules
2026-11-05 20:10:15 Medium 2
2026-11-03 12:09:28 Clean 3
2026-11-03 12:04:35 Medium 2

Report a package

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

0 / 4000
Your suggestion