[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] lbuilds: sdldoom 1.10



+ Das altbekannte heitere Familienspiel für Jung und Alt, jetzt endlich
  auch für týndur. Netzwerk funktioniert hoffentlich automatisch, sobald
  UDP implementiert wurde.

Signed-off-by: Max Reitz <max@xxxxxxxxxx>
---
 lbuilds/sdldoom/1.10/files/bool.patch    |   19 +++++++++++
 lbuilds/sdldoom/1.10/files/network.patch |   42 ++++++++++++++++++++++++
 lbuilds/sdldoom/1.10/files/series        |    4 ++
 lbuilds/sdldoom/1.10/files/sprintf.patch |   13 +++++++
 lbuilds/sdldoom/1.10/files/strupr.patch  |   17 ++++++++++
 lbuilds/sdldoom/1.10/sdldoom-1.10.lbuild |   51 ++++++++++++++++++++++++++++++
 6 files changed, 146 insertions(+), 0 deletions(-)
 create mode 100644 lbuilds/sdldoom/1.10/files/bool.patch
 create mode 100644 lbuilds/sdldoom/1.10/files/network.patch
 create mode 100644 lbuilds/sdldoom/1.10/files/series
 create mode 100644 lbuilds/sdldoom/1.10/files/sprintf.patch
 create mode 100644 lbuilds/sdldoom/1.10/files/strupr.patch
 create mode 100644 lbuilds/sdldoom/1.10/sdldoom-1.10.lbuild

diff --git a/lbuilds/sdldoom/1.10/files/bool.patch b/lbuilds/sdldoom/1.10/files/bool.patch
new file mode 100644
index 0000000..d54038b
--- /dev/null
+++ b/lbuilds/sdldoom/1.10/files/bool.patch
@@ -0,0 +1,19 @@
+Index: sdldoom-1.10/doomtype.h
+===================================================================
+--- sdldoom-1.10.orig/doomtype.h	1999-12-21 06:16:09.000000000 +0100
++++ sdldoom-1.10/doomtype.h	2011-12-26 01:20:58.000000000 +0100
+@@ -31,13 +31,12 @@
+ #ifdef __cplusplus
+ typedef bool boolean;
+ #else
+-#ifdef __BEOS__	/* boolean is a builtin type for MWCC */
++#include <stdbool.h>
+ #define boolean D_BOOL
+ #undef false
+ #define false D_false
+ #undef true
+ #define true D_true
+-#endif
+ typedef enum {false, true} boolean;
+ #endif
+ typedef unsigned char byte;
diff --git a/lbuilds/sdldoom/1.10/files/network.patch b/lbuilds/sdldoom/1.10/files/network.patch
new file mode 100644
index 0000000..e1c7e34
--- /dev/null
+++ b/lbuilds/sdldoom/1.10/files/network.patch
@@ -0,0 +1,42 @@
+Index: sdldoom-1.10/i_net.c
+===================================================================
+--- sdldoom-1.10.orig/i_net.c	1999-12-21 06:16:16.000000000 +0100
++++ sdldoom-1.10/i_net.c	2011-12-26 00:36:33.000000000 +0100
+@@ -51,7 +51,11 @@
+ #define Win32_Winsock
+ #include <windows.h>
+ #else
+-#error You should hack this file for your BSD sockets layer
++#include <sys/socket.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <unistd.h>
++#include <netdb.h>
+ #endif
+ #endif
+ #endif
+@@ -107,6 +111,10 @@
+ // NETWORKING
+ //
+ 
++#ifndef IPPORT_USERRESERVED
++#define IPPORT_USERRESERVED 1024
++#endif
++
+ int	DOOMPORT =	(IPPORT_USERRESERVED +0x1d );
+ 
+ int			sendsocket;
+@@ -261,10 +269,13 @@
+     struct hostent*	hostentry;	// host information entry
+     int			v;
+ 
++    /*
+     // get local address
+     v = gethostname (hostname, sizeof(hostname));
+     if (v == -1)
+ 	I_Error ("GetLocalAddress : gethostname: errno %d",errno);
++        */
++    strcpy(hostname, "localhost");
+ 	
+     hostentry = gethostbyname (hostname);
+     if (!hostentry)
diff --git a/lbuilds/sdldoom/1.10/files/series b/lbuilds/sdldoom/1.10/files/series
new file mode 100644
index 0000000..d61f479
--- /dev/null
+++ b/lbuilds/sdldoom/1.10/files/series
@@ -0,0 +1,4 @@
+network.patch
+strupr.patch
+sprintf.patch
+bool.patch
diff --git a/lbuilds/sdldoom/1.10/files/sprintf.patch b/lbuilds/sdldoom/1.10/files/sprintf.patch
new file mode 100644
index 0000000..86377fb
--- /dev/null
+++ b/lbuilds/sdldoom/1.10/files/sprintf.patch
@@ -0,0 +1,13 @@
+Index: sdldoom-1.10/hu_stuff.c
+===================================================================
+--- sdldoom-1.10.orig/hu_stuff.c	2011-12-26 00:01:09.000000000 +0100
++++ sdldoom-1.10/hu_stuff.c	2011-12-26 00:01:27.000000000 +0100
+@@ -405,7 +405,7 @@
+     j = HU_FONTSTART;
+     for (i=0;i<HU_FONTSIZE;i++)
+     {
+-	sprintf(buffer, "STCFN%.3d", j++);
++	sprintf(buffer, "STCFN%03d", j++);
+ 	hu_font[i] = (patch_t *) W_CacheLumpName(buffer, PU_STATIC);
+     }
+ 
diff --git a/lbuilds/sdldoom/1.10/files/strupr.patch b/lbuilds/sdldoom/1.10/files/strupr.patch
new file mode 100644
index 0000000..6cb8907
--- /dev/null
+++ b/lbuilds/sdldoom/1.10/files/strupr.patch
@@ -0,0 +1,17 @@
+Index: sdldoom-1.10/w_wad.c
+===================================================================
+--- sdldoom-1.10.orig/w_wad.c	1999-12-21 06:16:22.000000000 +0100
++++ sdldoom-1.10/w_wad.c	2011-12-25 23:18:12.000000000 +0100
+@@ -57,12 +57,10 @@
+ void**			lumpcache;
+ 
+ 
+-#if defined(linux) || defined(__BEOS__) || defined(__SVR4)
+ void strupr (char* s)
+ {
+     while (*s) { *s = toupper(*s); s++; }
+ }
+-#endif
+ 
+ int filelength (FILE *handle) 
+ { 
diff --git a/lbuilds/sdldoom/1.10/sdldoom-1.10.lbuild b/lbuilds/sdldoom/1.10/sdldoom-1.10.lbuild
new file mode 100644
index 0000000..131e6cf
--- /dev/null
+++ b/lbuilds/sdldoom/1.10/sdldoom-1.10.lbuild
@@ -0,0 +1,51 @@
+include lutils
+include toolchain
+
+DESCRIPTION=""
+HOMEPAGE="http://www.idsoftware.com/";
+SRC_URI="http://www.libsdl.org/projects/doom/src/${P}.tar.gz http://www.libsdl.org/projects/doom/data/doom1.wad.gz";
+
+LICENSE="DOOM LICENSE"
+
+RUN_DEPEND=""
+BUILD_DEPEND="=sdl-1.2.14"
+
+MY_S="${S}/${P}"
+
+src_unpack() {
+    lunpack ${P}.tar.gz
+    mv doom1.wad ${MY_S}
+
+    cd ${MY_S}
+
+    ln -s ${F} patches
+    [ -f ${F}/series ] && ln -s ${F}/series series
+    for i in ${F}/*.patch; do
+        [ -L series ] || echo `basename $i` >> series
+        (which quilt > /dev/null 2>&1) || (patch -p1 < $i) || die "Fehler beim Anwenden von $i"
+    done
+    (which quilt > /dev/null 2>&1) && quilt push -a || die "Fehler beim Anwenden der Patches"
+}
+
+src_configure() {
+    cd ${MY_S}
+
+    CC=`tc-cc` CFLAGS="-nostdinc -I `tc-incdir` -I `tc-incdir`/SDL -L`tc-libdir`" ./configure --host=`tc-host` --prefix="${R}" || die "Fehler beim Configure"
+}
+
+src_compile() {
+    cd ${MY_S}
+
+    lmake || die "Fehler beim Bauen"
+}
+
+src_install() {
+    cd ${MY_S}
+
+    lmake DESTDIR="${D}" install || die "Fehler beim Installieren"
+
+    gunzip "${DISTDIR}/doom1.wad.gz"
+    rm -f "${DISTDIR}/doom1.wad.gz"
+    mkdir -p "${D}/${R}/share/doom"
+    mv "${DISTDIR}/doom1.wad" "${D}/${R}/share/doom"
+}
-- 
1.7.8.1