blob: 3680d1c3d771122d14c78e2b500db3b5f1fa2fd9 (
plain)
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
|
# Maintainer: HurricanePootis <hurricanepootis@protonmail.com>
pkgname=source2viewer-bin
pkgver=10.2
pkgrel=4
pkgdesc="Valve's Source 2 resource file format parser, decompiler, and exporter."
arch=('x86_64')
url="https://github.com/ValveResourceFormat/ValveResourceFormat"
license=('MIT' 'CC-BY-2.5')
depends=('glibc' 'gcc-libs' 'zlib' 'wine' 'bash' 'hicolor-icon-theme')
makedepends=('gendesk')
conflicts=(valveresourceformat source2viewer)
provides=(source2viewer)
replaces=(valveresourceformat)
options=(!strip !debug)
install=$pkgname.install
source=(Decompiler-linux-x64-${pkgver}.zip::"$url/releases/download/$pkgver/Decompiler-linux-x64.zip"
"Source2Viewer-${pkgver}.exe::$url/releases/download/$pkgver/Source2Viewer.exe"
"$url/archive/refs/tags/$pkgver.tar.gz")
sha256sums=('f6782347c994783f7f8608cdf5db7d18f75c46adae0cf102bfdace58b1831186'
'2df456c6e370bcc92d88e9e95c5ff31a1c49048c7abcff81e6638997107d99ff'
'61fa22f19141f15ac3fb533b75db10bb93b55622af038d82cd7e8949b28e2ee0')
package() {
cd "$srcdir"
gendesk -f --pkgname=source2viewer \
--pkgdesc="$pkgdesc" \
--exec="${pkgname::-4}" \
--name="Source 2 Viewer" \
--icon="${pkgname::-4}" \
--terminal=false \
--categories="Development;Utility;Wine" \
--custom="PrefersNonDefaultGPU=true"
install -Dm755 Decompiler "$pkgdir/usr/bin/${pkgname::-3}cli"
install -Dm644 "$srcdir/Source2Viewer-${pkgver}.exe" "$pkgdir/usr/lib/$pkgname/${pkgname::-4}.exe"
cat >> "$pkgdir/usr/bin/${pkgname::-4}" <<-EOF
#!/usr/bin/env bash
export WINEPREFIX="\$HOME/.${pkgname::-4}/wine"
if [ ! -d "\$HOME"/.${pkgname::-4} ];
then
mkdir -p "\$HOME/.${pkgname::-4}/wine"
wineboot -u
fi
cd "\$HOME/.${pkgname::-4}"
DOTNET_BUNDLE_EXTRACT_BASE_DIR=./ wine /usr/lib/$pkgname/${pkgname::-4}.exe "\$@"
EOF
cat >> "$pkgdir/usr/bin/${pkgname::-3}wine" <<-EOF
#!/usr/bin/env bash
export WINEPREFIX="\$HOME/.${pkgname::-4}/wine"
if [ ! -d "\$HOME"/.${pkgname::-4} ];
then
mkdir -p "\$HOME/.${pkgname::-4}/wine"
wineboot -u
fi
wine "\$@"
EOF
chmod 755 "$pkgdir/usr/bin/${pkgname::-4}" "$pkgdir/usr/bin/${pkgname::-3}wine"
mkdir -p "$pkgdir/usr/share/applications"
install -Dm644 "$srcdir/ValveResourceFormat-$pkgver/Misc/Icons/source2viewer.png" "$pkgdir/usr/share/icons/hicolor/512x512/apps/${pkgname::-4}.png"
install -Dm644 "$srcdir/${pkgname::-4}.desktop" "$pkgdir/usr/share/applications/${pkgname::-4}.desktop"
}
|