Modernize, cleanup quake3 PKGBUILD, attempt to fix compile errors. Still in a broken state

This commit is contained in:
Slashbunny 2013-12-25 21:53:15 -05:00
parent 4a3ffb0167
commit d0826be081
4 changed files with 87 additions and 41 deletions

View file

@ -22,12 +22,14 @@ pkgbase = ioquake3
source = http://www.ioquake3.org/files/1.36/ioquake3-1.36.tar.bz2
source = http://ftp.gwdg.de/pub/misc/ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-1.32b-3.x86.run
source = botlib.patch::http://bugzilla-attachments.icculus.org/attachment.cgi?id=2196
md5sums = 9eca51e2b3ee3e0100944cba436a2a4c
md5sums = ea5d99df80b41269523b34229fdf854d
md5sums = ea5d99df80b41269523b34229fdf854d
md5sums = f938379a4a519ae32f6ffaacaf866cde
md5sums = c71fdddccb20e8fc393d846e9c61d685
md5sums = 4485f84a4a9bc9a25f2737ee1744febd
source = warnings.patch
sha256sums = 12dbd31e9de1493642d120bfd1548dfc4935e47fec806003cfc04b9d84b85673
sha256sums = 7f0806379b10a6cff248b647aeb67d89a8e954e51e7a633cfadeca9865d125e7
sha256sums = 7f0806379b10a6cff248b647aeb67d89a8e954e51e7a633cfadeca9865d125e7
sha256sums = 79b10b92e9e586748a67089ac871646fe8144004d3ab4a55158348bc38d74821
sha256sums = c36132c5556b35e01950f1e9c646235033a5130f87ad776ba2bc7becf4f4f186
sha256sums = d4bef896dc9fc7e8b8c94dcb744f88c03f76f5025deacce50de2cf7945fa71d3
sha256sums = ecdac6d433d4a9400eb3c5549de10ec76e23b9d4a26e580524f5e3d6d1cc5181
pkgname = ioquake3

1
.gitignore vendored
View file

@ -1,4 +1,3 @@
botlib.patch
warnings.patch
linuxq3apoint-1.32b-3.x86.run
ioquake3-1.36.tar.bz2

View file

@ -5,7 +5,7 @@ pkgver=1.36
pkgrel=2
pkgdesc="The de-facto OSS Quake 3 distribution. You need the retail/demo .pk3 files to play."
url="http://ioquake3.org/"
license='GPL'
license=('GPL')
arch=('i686' 'x86_64')
depends=('sdl' 'openal')
makedepends=('nasm')
@ -16,33 +16,46 @@ install=quake3.install
source=('quake3.desktop' 'quake3.launcher' 'quake3ded.launcher' \
"http://www.ioquake3.org/files/${pkgver}/${pkgname}-${pkgver}.tar.bz2" \
'http://ftp.gwdg.de/pub/misc/ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-1.32b-3.x86.run' \
'botlib.patch::http://bugzilla-attachments.icculus.org/attachment.cgi?id=2196')
md5sums=('9eca51e2b3ee3e0100944cba436a2a4c'
'ea5d99df80b41269523b34229fdf854d'
'ea5d99df80b41269523b34229fdf854d'
'f938379a4a519ae32f6ffaacaf866cde'
'c71fdddccb20e8fc393d846e9c61d685'
'4485f84a4a9bc9a25f2737ee1744febd')
'botlib.patch::http://bugzilla-attachments.icculus.org/attachment.cgi?id=2196'
'warnings.patch')
sha256sums=('12dbd31e9de1493642d120bfd1548dfc4935e47fec806003cfc04b9d84b85673'
'7f0806379b10a6cff248b647aeb67d89a8e954e51e7a633cfadeca9865d125e7'
'7f0806379b10a6cff248b647aeb67d89a8e954e51e7a633cfadeca9865d125e7'
'79b10b92e9e586748a67089ac871646fe8144004d3ab4a55158348bc38d74821'
'c36132c5556b35e01950f1e9c646235033a5130f87ad776ba2bc7becf4f4f186'
'd4bef896dc9fc7e8b8c94dcb744f88c03f76f5025deacce50de2cf7945fa71d3'
'ecdac6d433d4a9400eb3c5549de10ec76e23b9d4a26e580524f5e3d6d1cc5181')
build() {
cd $srcdir/$pkgname-$pkgver/
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
# Modify Makefile to correct install path
/bin/sed -i "s:/usr/local/games/quake3:$pkgdir/opt/quake3:" Makefile
# Patch Makefile to correct install path
/bin/sed -i "s:/usr/local/games/quake3:${pkgdir}/opt/quake3:" Makefile
# Patch botlib so bots work on 64bit
patch -p1 < $srcdir/botlib.patch || return 1
patch -p1 < "${srcdir}/botlib.patch"
# Patch to fix GCC warnings
patch -p1 < "${srcdir}/warnings.patch"
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
# Compile ioQuake3
make || return 1
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
# Install Files
make copyfiles || return 1
make copyfiles
# Extract Patch Files
cd $srcdir
chmod +x $srcdir/linuxq3apoint-1.32b-3.x86.run
$srcdir/linuxq3apoint-1.32b-3.x86.run --tar xf
cd "${srcdir}"
chmod +x "${srcdir}/linuxq3apoint-1.32b-3.x86.run"
"${srcdir}/linuxq3apoint-1.32b-3.x86.run" --tar xf
# Modify Launcher Scripts
if [ "$CARCH" = "x86_64" ]; then
@ -50,40 +63,41 @@ build() {
# x86_64 Systems
#
/bin/sed -i "s:IOQ3_BINARY:ioquake3.x86_64:" \
$srcdir/quake3.launcher
"${srcdir}/quake3.launcher"
/bin/sed -i "s:IOQ3_BINARY:ioq3ded.x86_64:" \
$srcdir/quake3ded.launcher
"${srcdir}/quake3ded.launcher"
else
#
# i686 Systems
#
/bin/sed -i "s:IOQ3_BINARY:ioquake3.i386:" \
$srcdir/quake3.launcher
"${srcdir}/quake3.launcher"
/bin/sed -i "s:IOQ3_BINARY:ioq3ded.i386:" \
$srcdir/quake3ded.launcher
"${srcdir}/quake3ded.launcher"
fi
# Install Quake 3 Patch Files
install -m 644 $srcdir/baseq3/*.pk3 \
$pkgdir/opt/quake3/baseq3/
install -m 644 "${srcdir}"/baseq3/*.pk3 \
"${pkgdir}/opt/quake3/baseq3/"
# Install Quake 3 Expansion Pack Patch Files
install -m 644 $srcdir/missionpack/*.pk3 \
$pkgdir/opt/quake3/missionpack/
install -m 644 "${srcdir}"/missionpack/*.pk3 \
"${pkgdir}/opt/quake3/missionpack/"
# Install Launcher (Client)
install -D -m 755 $srcdir/quake3.launcher \
$pkgdir/usr/bin/quake3
install -D -m 755 "${srcdir}/quake3.launcher" \
"${pkgdir}/usr/bin/quake3"
# Install Launcher (Server)
install -D -m 755 $srcdir/quake3ded.launcher \
$pkgdir/usr/bin/quake3ded
install -D -m 755 "${srcdir}/quake3ded.launcher" \
"${pkgdir}/usr/bin/quake3ded"
# Install Desktop File
install -D -m 644 $srcdir/quake3.desktop \
$pkgdir/usr/share/applications/quake3.desktop
install -D -m 644 "${srcdir}/quake3.desktop" \
"${pkgdir}/usr/share/applications/quake3.desktop"
# Install Icon File
install -D -m 644 $srcdir/$pkgname-$pkgver/misc/quake3.png \
$pkgdir/usr/share/pixmaps/quake3.png
install -D -m 644 "${srcdir}/$pkgname-$pkgver/misc/quake3.png" \
"${pkgdir}/usr/share/pixmaps/quake3.png"
}

31
warnings.patch Normal file
View file

@ -0,0 +1,31 @@
diff -uNr ioquake3-1.36/code/botlib/l_precomp.c ioquake3-1.36fix/code/botlib/l_precomp.c
--- ioquake3-1.36/code/botlib/l_precomp.c 2013-12-25 21:36:27.064643691 -0500
+++ ioquake3-1.36fix/code/botlib/l_precomp.c 2013-12-25 21:39:34.303087830 -0500
@@ -1698,7 +1698,6 @@
int questmarkintvalue = 0;
float questmarkfloatvalue = 0;
int gotquestmarkvalue = qfalse;
- int lastoperatortype = 0;
//
operator_t operator_heap[MAX_OPERATORS];
int numoperators = 0;
@@ -2087,7 +2086,6 @@
else Log_Write("result value = %f", v1->floatvalue);
#endif //DEBUG_EVAL
if (error) break;
- lastoperatortype = o->operator;
//if not an operator with arity 1
if (o->operator != P_LOGIC_NOT
&& o->operator != P_BIN_NOT)
diff -uNr ioquake3-1.36/code/tools/lcc/cpp/tokens.c ioquake3-1.36fix/code/tools/lcc/cpp/tokens.c
--- ioquake3-1.36/code/tools/lcc/cpp/tokens.c 2005-10-03 21:21:34.000000000 -0400
+++ ioquake3-1.36fix/code/tools/lcc/cpp/tokens.c 2013-12-25 21:38:45.329290465 -0500
@@ -267,7 +267,7 @@
if (str)
fprintf(stderr, "%s ", str);
if (tp<trp->bp || tp>trp->lp)
- fprintf(stderr, "(tp offset %d) ", tp-trp->bp);
+ fprintf(stderr, "(tp offset %ld) ", (long int) (tp - trp->bp));
for (tp=trp->bp; tp<trp->lp && tp<trp->bp+32; tp++) {
if (tp->type!=NL) {
int c = tp->t[tp->len];