summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6978501e4011f5e0bcc4c40e8d2295cb14fc79d7 (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
# Maintainer: Nover <novares.x@gmail.com>
# Contributor: agentcobra <agentcobra@free.fr>

# 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.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.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 --no-sandbox/g" ${pkgname}.desktop

	chmod g-w ${pkgname}.desktop

	# Create shortcut
	mkdir -p "${pkgdir}/usr/bin"
	ln -srf "../..//opt/${pkgname}/shadow" "${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=9add3366d25530d51d168608c54b5339b64d2a4e
pkgname=shadow-tech
basename=prod
pkgver="$(pkgver)"
pkgrel=1
pkgdesc="Shadow application"
arch=('x86_64')
url="https://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' 'libappindicator' '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-tech)
source=("$(file)::https://update.shadow.tech/launcher/${basename}/linux/ubuntu_18.04/Shadow.AppImage")
# sha512sums=("$(sha512sum))
sha512sums=('SKIP')
install=$pkgname.install