summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 313e516c5787bce3343d9701d69c2aa9438d4099 (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
# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>

pkgname=steam-screensaver-fix
pkgver=r5.c0f1b3e
pkgrel=1
epoch=1
pkgdesc='Fix for steam screensaving bug.'
arch=('i686' 'x86_64')
url='https://gitlab.com/patlefort/steam-screensaver-fix'
license=('GPL3')
depends=()
makedepends=('git')
depends_x86_64=('lib32-glibc')
source=("git+https://gitlab.com/patlefort/steam-screensaver-fix.git#commit=c0f1b3efe513e21762b263ac1ccf91afb302bb53")
sha256sums=('SKIP')

pkgver() {
	cd "${pkgname}"
	( set -o pipefail
		printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
	)
}

build() {
	CC="${CC:-gcc}"

	# Build 32 bit version.
	if [ "$CARCH" = 'x86_64' ]; then
		$CC $CFLAGS $LDFLAGS -m32 -shared -fPIC -ldl -o 'sdl_block_screensaver_inhibit_lib32.so' "$pkgname/sdl_fix_steam_screensaver.c"
	fi

	# Build native version.
	$CC $CFLAGS $LDFLAGS -shared -fPIC -ldl -o 'sdl_block_screensaver_inhibit.so' "$pkgname/sdl_fix_steam_screensaver.c"
}

package() {
	depends+=('steam' 'sdl2')
	optdepends=('steam-native-runtime')

	[ "$CARCH" = 'x86_64' ] && install -Dm755 'sdl_block_screensaver_inhibit_lib32.so' "${pkgdir}/usr/lib32/sdl_block_screensaver_inhibit.so"
	install -Dm755 'sdl_block_screensaver_inhibit.so' -t "${pkgdir}${_prefix}/usr/lib"

	cd "$pkgname"
	install -Dm755 'steam_sdl_injection.sh' 'steam-screensaver-fix-runtime' 'steam-screensaver-fix-native' -t "${pkgdir}/usr/bin/"
	install -Dm755 'steam-screensaver-fix-runtime.desktop' 'steam-screensaver-fix-native.desktop' -t "${pkgdir}/usr/share/applications/"
}