aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 25bfdda3092150b287b7e9d1de532e75f14f7100 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Maintainer: Noah Witt <noah@noah-witt.com>
# Contributor: agentcobra <agentcobra@free.fr>
# Contributor: Nover <novares.x@gmail.com>

# Creator Blade <contact@blade-group.com>

# Made with https://github.com/NicolasGuilloux/blade-shadow-beta

# Import parse_yaml script
. parse_yaml.sh

# Get the info from the yaml
info() {
	if [ ! -f info.yml ]; then
		curl -s "https://storage.googleapis.com/shadow-update/launcher/${basename}/linux/ubuntu_18.04/latest-linux.yml" -o info.yml
	fi

	eval $(parse_yaml info.yml "shadow_")
}

# Get the package version
pkgver() {
	info

    echo "$shadow_version"
}

# Get the SHA512 checksum
sha512sum() {
	info

	echo "$shadow_sha512"
}

file() {
	echo "$pkgname-$pkgver-$pkgrel.AppImage"
}

# Extract the zip file and prepare for the build
prepare() {
	# Give execution rights
	chmod +x $(file)

	# Extract AppImage
	./$(file) --appimage-extract
}

# Build the package
package() {
	# Make the directories
	mkdir -p "${pkgdir}/opt"

	# Move directories
	mv "${srcdir}/squashfs-root/usr" "${pkgdir}"
	mv "${srcdir}/squashfs-root" "${pkgdir}/opt/${pkgname}"

	# Move de icons
	mv "${pkgdir}/usr/share/icons/hicolor/0x0/" "${pkgdir}/usr/share/icons/hicolor/1024x1024/"

	# Make a copy of the icons
	cp "${pkgdir}/usr/share/icons/hicolor/1024x1024/apps/shadow-${basename}.png" "${pkgdir}/usr/share/icons/"

	# Fix rights
	chmod -R g-w "${pkgdir}/usr"
	chmod -R g-w "${pkgdir}/opt"

	# Create shortcut folder
	mkdir "${pkgdir}/usr/share/applications"

	# Move to shortcut directory
	cd "${pkgdir}/usr/share/applications"

	mv "${pkgdir}/opt/${pkgname}/shadow-${basename}.desktop" "${pkgname}.desktop"
	sed -i -e 's/^Categories=.*$/Categories=Games;Game;Utility;Virtualization/g' ${pkgname}.desktop
	sed -i -e "s/^Exec=.*$/Exec=\/opt\/${pkgname}\/shadow-${basename} --no-sandbox/g" ${pkgname}.desktop

	chmod g-w ${pkgname}.desktop

	# Create shortcut
	mkdir -p "${pkgdir}/usr/bin"
	ln -sf "/opt/${pkgname}/shadow-${basename}" "${pkgdir}/usr/bin/{$pkgname}"

	# Remove AppImage related files
	rm "${pkgdir}/opt/${pkgname}/AppRun"

	# Remove embedded libraries to avoid conflicts
	rm -R "${pkgdir}/usr/lib"

	# Fix rights
	chmod 755 -R "${pkgdir}"
}

_commit=3ab413613a6c3c4b78d3f3eb030068c0ea497a4e
pkgname=shadow-alpha
basename=testing
pkgver=5.0.890
pkgrel=1
pkgdesc="Shadow Alpha application"
arch=('x86_64')
url="http://shadow.tech"
license=('unknown')
depends=('desktop-file-utils' 'freetype2' 'libuv' 'gconf' 'hicolor-icon-theme' 'json-c' 'libappindicator-gtk2' 'libbsd' 'libcurl-gnutls' 'libdrm' 'libnotify' 'libva' 'libxtst' 'nss' 'opus' 'qt5-base' 'qt5-svg' 'sdl2' 'libcurl-compat' 'sdl' 'gcc7-libs' 'ttf-dejavu' 'libxss' 'libsndio-61-compat' 'gnome-keyring')
optdepends=('libva-vdpau-driver-shadow-nvidia: Patch for recent Nvidia GPU' 'nouveau-fw: Driver for old Nvidia GPU' 'libva-intel-driver: Driver for Intel GPU')
provides=(shadow-alpha)
source=("$(file)::https://update.shadow.tech/launcher/${basename}/linux/ubuntu_18.04/ShadowAlpha.AppImage")
# sha512sums=("$(sha512sum))
sha512sums=('SKIP')
install=$pkgname.install