summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cdb4dfb01965808a2ad2c1a7ae36246710d4ef66 (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
# Contributor: dobo <dobo90_at_gmail.com>

pkgname=sdlhack
pkgver=1.4
pkgrel=2
pkgdesc='A wrapper for SDL which lets you force fullscreen games to minimize.'
arch=(i686 x86_64)
url=http://jspenguin.org:81/software/sdlhack/
license=(LGPL)
depends=(glibc bash)
[ ${CARCH} = x86_64 ] && depends[0]=lib32-glibc
makedepends=(sdl)
[ ${CARCH} = x86_64 ] && makedepends+=(gcc-multilib)
source=(http://jspenguin.org:81/software/sdlhack/${pkgname}-${pkgver}.tar.gz)
md5sums=(b028e64931871e2eb76c9aeb74f6e86c)

build() {
	cd ${srcdir}/${pkgname}-${pkgver}

	CFLAGS="${CFLAGS} $(sdl-config --cflags) -shared -fPIC -O2 -ldl -Wall"

	gcc -m32 ${CFLAGS} libsdlhack.c -o libsdlhack-i386.so
	if [ ${CARCH} = x86_64 ]; then gcc -m64 ${CFLAGS} libsdlhack.c -o libsdlhack-x86_64.so; fi
}

package() {
	cd ${srcdir}/${pkgname}-${pkgver}

	if [ ${CARCH} = i686 ]; then
		install -D -m 755 libsdlhack-i386.so ${pkgdir}/usr/lib/libsdlhack.so
	else # x86_64
		install -D -m 755 libsdlhack-i386.so ${pkgdir}/usr/lib32/libsdlhack.so
		install -D -m 755 libsdlhack-x86_64.so ${pkgdir}/usr/lib/libsdlhack.so
	fi

	install -D -m 755 sdlhack ${pkgdir}/usr/bin/sdlhack
	install -D -m 644 README ${pkgdir}/usr/share/doc/${pkgname}/README
}