diff --git a/srcpkgs/ioquake3-rpi/files/ioquake3-build.sh.patch b/srcpkgs/ioquake3-rpi/files/ioquake3-build.sh.patch new file mode 100644 index 00000000000..b9f53649506 --- /dev/null +++ b/srcpkgs/ioquake3-rpi/files/ioquake3-build.sh.patch @@ -0,0 +1,25 @@ +--- build.sh.org 2013-01-11 16:52:50.064204113 +0000 ++++ build.sh 2013-01-11 18:14:24.595441089 +0000 +@@ -5,18 +5,18 @@ + + # directory containing the ARM shared libraries (rootfs, lib/ of SD card) + # specifically libEGL.so and libGLESv2.so +-ARM_LIBS=/opt/bcm-rootfs/opt/vc/lib ++ARM_LIBS=/opt/vc/lib + SDL_LIB=lib + + # directory containing baseq3/ containing .pk3 files - baseq3 on CD +-BASEQ3_DIR="/home/${USER}/" ++BASEQ3_DIR="/opt/ioquake3-rpi/" + + # directory to find khronos linux make files (with include/ containing + # headers! Make needs them.) +-INCLUDES="-I/opt/bcm-rootfs/opt/vc/include -I/opt/bcm-rootfs/opt/vc/include/interface/vcos/pthreads" ++INCLUDES="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads" + + # prefix of arm cross compiler installed +-CROSS_COMPILE=bcm2708- ++CROSS_COMPILE=arm-linux-gnueabihf- + + # clean + if [ $# -ge 1 ] && [ $1 = clean ]; then diff --git a/srcpkgs/ioquake3-rpi/files/quake3.desktop b/srcpkgs/ioquake3-rpi/files/quake3.desktop new file mode 100644 index 00000000000..def702039d3 --- /dev/null +++ b/srcpkgs/ioquake3-rpi/files/quake3.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Quake III Arena +GenericName=Quake III +Comment=ioQuake3 - Quake III Open Source Engine +Exec=/usr/bin/quake3 +Icon=/usr/share/pixmaps/quake3.png +StartupNotify=true +Terminal=false +Type=Application +Categories=Qt;KDE;GNOME;Application;Game; + diff --git a/srcpkgs/ioquake3-rpi/files/quake3.launcher b/srcpkgs/ioquake3-rpi/files/quake3.launcher new file mode 100644 index 00000000000..a859d25aeda --- /dev/null +++ b/srcpkgs/ioquake3-rpi/files/quake3.launcher @@ -0,0 +1,5 @@ +#!/bin/bash + +cd "/opt/IOQ3_PATH" +exec ./IOQ3_BINARY $* + diff --git a/srcpkgs/ioquake3-rpi/files/quake3ded.launcher b/srcpkgs/ioquake3-rpi/files/quake3ded.launcher new file mode 100644 index 00000000000..a859d25aeda --- /dev/null +++ b/srcpkgs/ioquake3-rpi/files/quake3ded.launcher @@ -0,0 +1,5 @@ +#!/bin/bash + +cd "/opt/IOQ3_PATH" +exec ./IOQ3_BINARY $* + diff --git a/srcpkgs/ioquake3-rpi/template b/srcpkgs/ioquake3-rpi/template new file mode 100644 index 00000000000..b9c3f68f96b --- /dev/null +++ b/srcpkgs/ioquake3-rpi/template @@ -0,0 +1,84 @@ +# Template file for 'ioquake3-rpi' +pkgname=ioquake3-rpi +version=20130506 +revision=1 +short_desc="ioquake3 for Raspberry Pi" +maintainer="Juan RP " +license="GPL-2" +homepage="http://ioquake3.org/" +distfiles="http://ftp.gwdg.de/pub/misc/ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-1.32b-3.x86.run" +checksum=c36132c5556b35e01950f1e9c646235033a5130f87ad776ba2bc7becf4f4f186 + +# XXX only for rpi +noextract=yes +only_for_archs="armv6l" +hostmakedepends="which pkg-config" +makedepends="SDL-devel rpi-firmware" + +do_configure() { + # Fetch ioquake3 for rpi + git clone git://github.com/raspberrypi/quake3.git $pkgname --depth=1 + + cd $pkgname + patch build.sh < ${FILESDIR}/ioquake3-build.sh.patch + sed -e "s,/opt/vc,$XBPS_CROSS_BASE/opt/vc,g" -i build.sh + + # Extract Patch Files + cp $XBPS_SRCDISTDIR/linuxq3apoint-1.32b-3.x86.run . + chmod +x linuxq3apoint-1.32b-3.x86.run + + ./linuxq3apoint-1.32b-3.x86.run --tar xf +} + +do_build() { + cd $pkgname + ./build.sh +} + +do_install() { + vmkdir opt/${pkgname}/baseq3 + vmkdir opt/${pkgname}/missionpack + # Copy the executables + install -m755 ${pkgname}/build/release-linux-arm/*.arm \ + ${DESTDIR}/opt/${pkgname} + install -Dm755 ${pkgname}/build/release-linux-arm/baseq3/*.so \ + ${DESTDIR}/opt/${pkgname}/baseq3/ + + install -Dm755 ${pkgname}/build/release-linux-arm/missionpack/*.so \ + ${DESTDIR}/opt/${pkgname}/missionpack/ + + # modify launcher scripts + cp ${FILESDIR}/quake3.launcher . + cp ${FILESDIR}/quake3ded.launcher . + + sed -i "s:IOQ3_BINARY:ioquake3.arm:" quake3.launcher + sed -i "s:IOQ3_BINARY:ioq3ded.arm:" quake3ded.launcher + sed -i "s:IOQ3_PATH:ioquake3-rpi:" quake3.launcher + sed -i "s:IOQ3_PATH:ioquake3-rpi:" quake3ded.launcher + + # Install Quake 3 Patch Files + install -m644 ${pkgname}/baseq3/*.pk3 \ + ${DESTDIR}/opt/${pkgname}/baseq3/ + + # Install Quake 3 Expansion Pack Patch Files + install -m644 ${pkgname}/missionpack/*.pk3 \ + ${DESTDIR}/opt/${pkgname}/missionpack/ + + # Install Launcher (Client) + vinstall quake3.launcher 755 usr/bin quake3 + + # Install Launcher (Server) + vinstall quake3ded.launcher 755 usr/bin quake3ded + + # Install Desktop File + vinstall ${FILESDIR}/quake3.desktop 644 usr/share/applications + + # Install Icon File + vinstall ${pkgname}/misc/quake3.png 644 usr/share/pixmaps +} + +ioquake3-rpi_package() { + pkg_install() { + vmove all + } +}