summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3cf854b4fc59c65e7bfc09d80676277bb95ec695 (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
# Maintainer: HurricanePootis <hurricanepootis@protonmail.com>
pkgname=steamdepotdownloadergui
_pkgname=SteamDepotDownloaderGUI
pkgver=3.0.0
pkgrel=2
pkgdesc="Downgrade Steam games to older versions with ease using DepotDownloader"
arch=('x86_64')
url="https://github.com/mmvanheusden/SteamDepotDownloaderGUI"
license=('GPL-3.0-only')
depends=('glibc' 'webkit2gtk-4.1' 'gcc-libs' 'gtk3' 'cairo' 'libsoup3' 'bzip2' 'openssl' 'gdk-pixbuf2' 'hicolor-icon-theme' 'glib2' 'pango'
	 'bash')
makedepends=('cargo' 'pnpm')
source=("$url/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('040887acffa6d8f5524b5f26ae9c77dd7d49c2c110054f4994afcc4af7e85f60')

prepare() {
	cd "$srcdir/$_pkgname-$pkgver"
	pnpm i
	export RUSTUP_TOOLCHAIN=stable
	cd "$srcdir/$_pkgname-$pkgver/src-tauri"
	cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
	cd "$srcdir/$_pkgname-$pkgver"
	export RUSTUP_TOOLCHAIN=stable
	export CFLAGS="$CFLAGS -ffat-lto-objects"
	pnpm tauri build -b deb -t "$(rustc -vV | sed -n 's/host: //p')"
}

package() {
	cd "$srcdir/$_pkgname-$pkgver/src-tauri/target/$(rustc -vV | sed -n 's/host: //p')/release/bundle/deb/${_pkgname}_${pkgver}_amd64/data/"

	install -Dm755 usr/bin/vectum "$pkgdir/usr/lib/${pkgname}/${pkgname}"
	install -Dm644 usr/share/applications/${_pkgname}.desktop "$pkgdir/usr/share/applications/${pkgname}.desktop"
	for size in {32,128,256@2};
	do
		install -Dm644 usr/share/icons/hicolor/${size%@2}x${size}/apps/vectum.png "$pkgdir/usr/share/icons/hicolor/${size%@2}x${size%@2}/apps/${pkgname}.png"
	done

	sed -i 's/Categories=/Categories=Development/g' "$pkgdir/usr/share/applications/${pkgname}.desktop"
	sed -i 's/vectum/steamdepotdownloadergui/g' "$pkgdir/usr/share/applications/${pkgname}.desktop"

	install -dm755 "$pkgdir/usr/bin"
	cat >> "$pkgdir/usr/bin/${pkgname}" <<EOF
#!/usr/bin/env bash
[[ ! -d \$HOME/.config/${pkgname} ]] && mkdir \$HOME/.config/${pkgname}
cd \$HOME/.config/${pkgname} || exit
/usr/lib/${pkgname}/${pkgname} "\$@"
wait
exit
EOF
	chmod 755 "$pkgdir/usr/bin/${pkgname}"
}