summaryrefslogtreecommitdiff
path: root/games-fps/duke3d
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-fps/duke3d
reinit the tree, so we can have metadata
Diffstat (limited to 'games-fps/duke3d')
-rw-r--r--games-fps/duke3d/Manifest16
-rw-r--r--games-fps/duke3d/duke3d-20040817-r2.ebuild114
-rw-r--r--games-fps/duke3d/files/20040817-credits.patch38
-rw-r--r--games-fps/duke3d/files/20040817-duke3d-makefile-opts.patch33
-rw-r--r--games-fps/duke3d/files/20040817-endian.patch26
-rw-r--r--games-fps/duke3d/files/20040817-gcc34.patch82
-rw-r--r--games-fps/duke3d/files/duke3d-20040817-as-needed.patch74
-rw-r--r--games-fps/duke3d/files/duke3d-20040817-gcc4.patch180
-rw-r--r--games-fps/duke3d/files/duke3d-20040817-ldflags.patch66
-rw-r--r--games-fps/duke3d/files/duke3d-20040817-noinline.patch18
-rw-r--r--games-fps/duke3d/files/duke3d.cfg194
-rw-r--r--games-fps/duke3d/files/network.cfg15
-rw-r--r--games-fps/duke3d/metadata.xml61
13 files changed, 917 insertions, 0 deletions
diff --git a/games-fps/duke3d/Manifest b/games-fps/duke3d/Manifest
new file mode 100644
index 000000000000..2ca2f91911de
--- /dev/null
+++ b/games-fps/duke3d/Manifest
@@ -0,0 +1,16 @@
+AUX 20040817-credits.patch 1267 SHA256 ea4d7540790ea937d97d5e87abdfa893e58b699fcb16abb30e84529edce061a9 SHA512 a337f40df1bc300110b507f7fd8cb090cef8c3e49d40379c6899a4a0520b80c26c85fca677cfa2a041a3afad84250480bb4611cb59ea0b5072f8074afaa84e3c WHIRLPOOL e6ec21c755818258834e50cbca815854295b5a9c49bd47fc1c9e2a7980cdcd36894824cf4dbda3dd0fd780d68d208c056355c9f7273e604afb690dbea9c72009
+AUX 20040817-duke3d-makefile-opts.patch 863 SHA256 afcc1bfc4e3977dbe02b1f390d184b00d8773b1690dce10f4728c535b9c69d56 SHA512 6475219290d41cc9b9974c47269237099d08d695f940ecc6bc3c21504a85635a3b934f0755e20b13fb6e3c9444e5dccafbe70474ec5d27fabfdb3ae35ec5d75b WHIRLPOOL 3c11bbb05801ae8ffbf2dff959e0b8e2a42a91bd1a1c3bdcd6d98e7a89a1c8c0aa2063b2b62b18266ebde84694fd0ac674e36b9008d315181187d43b128b2622
+AUX 20040817-endian.patch 772 SHA256 e0bd07c16123593627e888c102a84af033e906ace3aa3a1559828d83626ec16e SHA512 4f052ab4328c2d421487479c1cd3a81e108381ad1b7c63a2d8a6366826f72ce631b455558d410fd129fa3584d2a623a8329bc83719726ccc76e7e513f4d16c68 WHIRLPOOL c8cb31e1920c533d615b8ca39db77eb73b83f5da7547f85115d344df686a336381645dcf196090e49dc7118e1c93c3f3c8d6b2e71b72995511cdcccb45f41943
+AUX 20040817-gcc34.patch 1886 SHA256 f6f8271c95d898317b17eb22986a90294db4297482b011b01bf659c22686a3d8 SHA512 96e6ccffaa0334b1acfeb6542cf729eab22be5ea04c8985f5133c3a73d3ba26a568de7de00ff9bfbdc822edfb1b1438740f742d92b5fb3da62887e2aaf3f1076 WHIRLPOOL 5fb4b33c3ea62e92e0e2df1d447c193a5a441b414720dc87d801e023efa5b7b651429c9704c804b2fa146f62029ae918bb970e2a348eaa84fe55b7d81e34ef90
+AUX duke3d-20040817-as-needed.patch 2774 SHA256 b9e9e5040c845974a633987d8248bde62d9c04579d0b3e8e6eab18b8027b6701 SHA512 b2ae1da82658f0602b0270fd9095f5c848faf974170a3a9b761dae8160b60c7874a4587f10a70e657c9d1f1c5dc782cc4ce71a8d6bec84f2a7bc11cdbb91c327 WHIRLPOOL 0ddedf88ecf9b58c9618227c5a78f057b76c4a6c383e8bd01559636c36a37893f009988ab2926d0dd840303167bd4f94287e36f94dd7a34cb4e006d5775e1619
+AUX duke3d-20040817-gcc4.patch 10474 SHA256 010ceb7ff130da74d0f6349a9d12ddc206940d8545499cccb319220ba7d9d585 SHA512 9b368725ae518c01ea449568e700f1e515098608daae0055a66012a6ee4cb1583dd5a252e9782de6db6520820517dc126ae8b51280261f42b14b38ff0e0db4f3 WHIRLPOOL 81331cde93333b7867c08913cacf650b950e75fa61c88a906d679b6918fbaa77b513f3526dd3ec947db75ca7180d59eec60415cdd3d6c87697baae7760cc4734
+AUX duke3d-20040817-ldflags.patch 2132 SHA256 4044e2877f5b5c81c41cd8e868c5a9e3895f3e32ee2e03b55a2c2b1c3ca69555 SHA512 afdcbc422b98c3c07bc4aea54865f2c7a167838eaa2270109e0066fb2e1db069bf5034bb78c0dd428baa0372465be4614125243a33aedfba19938b8e8f905b27 WHIRLPOOL c616a84b2cce027fa4f4ef0ebcbac94b64ca44fe7d4fdb3cd1eb05b249138b07b945ba1f5ef92eb4d3b6599acb23ca2d4da06488257e15965dd5725ec120f822
+AUX duke3d-20040817-noinline.patch 545 SHA256 9d0783517eefc0a1d28189260e91af8318ab1d0395f336ab5f5c72e86504e0fa SHA512 aad5543419c762083a908b3905c22efa102cc6d9724a7fb5ee5eab96fd490c1afce632395a53049ec1b6d2123aed1c2440e583994773916eb1268bc75471ea79 WHIRLPOOL 12d45e4de548b9c97e4d19d5b41ee6c1624fb0a2610c517a34300c9ca1aed65def477c8ec6f32afec5c3f4f1f02eb2816506490c013b78c2664db31b183dc45d
+AUX duke3d.cfg 4314 SHA256 0ad9477e6185f0d812d726943beacdc7f7581f66c86640f44ee8e5621fe40556 SHA512 5b4d020d6ea9b5bfdc4333c2a0b90667577662ed32a826263560e74bd436372d689d179290a87c86d921c4accbaa75da013a3426d98f49cc7ffb6a1be5fb25a7 WHIRLPOOL e10f70b04d3e82c1a687104082076e41057322dc7eaaf885cfcc81bbdd56c9ab51efc17559f115b5f0453b390aa3ea183dd007feeec241ad1f9568ef3d70f22c
+AUX network.cfg 398 SHA256 fe5806712207d39812906034b76191effc96d7c6efa9c8bd9081e18fab76d7b5 SHA512 89a5261453c5ad14caed7e768ef6a337f601afd2e02809987708cfad9f356847a3249ab7b1fb6f0e084874100afc1494d62e4d898f4433c1f4f763a1e822f26b WHIRLPOOL aad04fdd9e18f7f93a06a377b034ac07ea3df04a8269e50cd99e74fdefab4c24e6a866d4c77e8946903e90d2bd10edb8c868e135cd80e9c73e317667298a8703
+DIST 3dduke13.zip 5924374 SHA256 c67efd179022bc6d9bde54f404c707cbcbdc15423c20be72e277bc2bdddf3d0e SHA512 eb92daa88b4e7cfeebe1fb3d2c021e0a4a66262d0d6e76b5e27fe3cedd382e381d23b392a6d9adb42a418b9318e011c2d8adfbdc77d7c5371e61d8c091c7eb65 WHIRLPOOL 9f3b9620d042a0209c707e83822fa1acff370504c76a558a6c36452b7f7c701e8289f8b389146cdd6899f47783c318a81792a7702f68d1ca62b31fc2c6844921
+DIST duke3d-20040817.tar.bz2 1509273 SHA256 c0dd72030f9c5b84aea3e4989831311c94ef21641d6a1fdb0f557d04076f641f SHA512 a08aa07153458501fb01878769af9797460525015b34d743250e3f04f15ee2dcfbb4110c94c83912ba2435e6d6c48127e2d36c0dc29833e0f6f95e3b925b571c WHIRLPOOL b0e27cae348601980e18f95a6507bc3080a51fe4f70919127eefd9cc90185dcd4cb287e970c2fa1ecc4a6b04422804748a071006e1b4551cde73e4cd18abe40a
+EBUILD duke3d-20040817-r2.ebuild 2808 SHA256 bd4082df1c89b29386cdc4e38e83c9b2de545c8d96eecb859e8722f4d2735c51 SHA512 65be36db5d302c0cbc1289080a3e681d337e250a5fb3ad09b94680baed6ecd305b54a54dd5fba51dc3a50db4b001f74c952c7d985389ffb52d2eb0c762710f4d WHIRLPOOL 912dd841920fa4561949d7ffd66acf27dbd187d4d850883be8661eebc60540d48815b6a6c8c5edc4b4ad6b595866584c9982f2e6468fd51db6f0111c0e756e26
+MISC ChangeLog 3474 SHA256 ba713a18a5b4e59b7e3d09269ead951074b7a1eaf577047be1c9de7141f87182 SHA512 9dffd886b948e2332da6d9aa4dde238c7100e4b3996807cb27115480d3ed683d895867d43014e3ae3ebe729dda5a90cf3c5e40dd11e6649cf86c69ca98f4fb56 WHIRLPOOL c2e4dfff6f41ff875bbed0f9070d80e9c28e3e3aa869a8dbf8f5b04e12b4cf266ff994a503af9e716ec89408553ba39869e02c0c09e0efda9fc6d1e5c6b949f8
+MISC ChangeLog-2015 5805 SHA256 01a5375f1a44877093dda0a43789bb1b8e53b64f442a30d90b981bf34f04606c SHA512 4d66f0eae271f72773b81b71711b8f7ada33e7ef2b4160757d29cf66503e1e06132b9603ca9dc88fa61323d97ad4ebdf494b62a1ec2e775d9aead3d74e458d0f WHIRLPOOL 3f8fcc6f6e231f60528e9f07cb7afeac5260950a124ad58008aaa1d85dc80c2a87b2c4b94db628cdfb3a56d24f9ab9e347860e6feef2a61b8c47a56cf27f3914
+MISC metadata.xml 2851 SHA256 2ab2e90d4887e107ee7b3d34356d6e5c5b11cf3fc4cff78348cec4083706f477 SHA512 ae872ac33570fc2f067e50a29e4a9c8d51477d64cbf2596889421a09a07b78e9041d8c60abf33cdaa4f16a6079fc49bd4307493620ea8d47c74b37b4cc697d04 WHIRLPOOL 9a357e3ad3b4dd1ea5600b3e72967896f81e50bdf0ea1b33fd22a75038104fde024d9af7156bca5893bd647dc9835583fe673a455283168cdded811f4b4f460e
diff --git a/games-fps/duke3d/duke3d-20040817-r2.ebuild b/games-fps/duke3d/duke3d-20040817-r2.ebuild
new file mode 100644
index 000000000000..01ee62481cdd
--- /dev/null
+++ b/games-fps/duke3d/duke3d-20040817-r2.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+fromcvs=0
+inherit unpacker eutils flag-o-matic games
+
+DEMO="3dduke13.zip"
+
+DESCRIPTION="Port of the original Duke Nukem 3D"
+HOMEPAGE="http://icculus.org/projects/duke3d/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ demo? (
+ ftp://ftp.3drealms.com/share/${DEMO}
+ ftp://ftp.planetmirror.com/pub/gameworld/downloads/${DEMO}
+ )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="hppa x86"
+IUSE="demo pic perl opengl"
+
+RDEPEND="media-libs/libsdl
+ media-libs/sdl-mixer
+ media-sound/timidity++
+ media-sound/timidity-eawpatches
+ perl? ( dev-lang/perl[-ithreads] )
+ opengl? ( virtual/opengl )"
+DEPEND="${RDEPEND}
+ demo? ( app-arch/unzip )
+ !pic? ( x86? ( dev-lang/nasm ) )"
+
+S=${WORKDIR}/${PN}
+
+use_tf() { use ${1} && echo "true" || echo "false"; }
+
+src_unpack() {
+ unpack ${A}
+ if use demo ; then
+ unpack_zip DN3DSW13.SHR
+ fi
+}
+
+src_prepare() {
+ # configure buildengine
+ cd "${S}/source/buildengine"
+ sed -i \
+ -e "/^useperl := / s:=.*:= $(use_tf perl):" \
+ -e "/^useopengl := / s:=.*:= $(use_tf opengl):" \
+ -e "/^usephysfs := / s:=.*:= false:" \
+ -e 's:-O3::' -e 's: -g : :' \
+ -e 's:/usr/lib/perl5/i386-linux/CORE/libperl.a::' \
+ Makefile || die
+ epatch "${FILESDIR}/${PV}-endian.patch"
+
+ # configure duke3d
+ cd "${S}/source"
+ # need to sync features with build engine
+ epatch \
+ "${FILESDIR}/${PV}-credits.patch" \
+ "${FILESDIR}/${PV}-duke3d-makefile-opts.patch" \
+ "${FILESDIR}/${PV}-gcc34.patch" \
+ "${FILESDIR}"/${P}-gcc4.patch \
+ "${FILESDIR}"/${P}-noinline.patch \
+ "${FILESDIR}"/${P}-as-needed.patch \
+ "${FILESDIR}"/${P}-ldflags.patch
+ sed -i \
+ -e "/^use_opengl := / s:=.*:= $(use_tf opengl):" \
+ -e "/^use_physfs := / s:=.*:= false:" \
+ Makefile || die
+ if ! use pic && use x86 ; then
+ sed -i \
+ -e 's:^#USE_ASM:USE_ASM:' buildengine/Makefile || die
+ sed -i \
+ -e '/^#use_asm := /s:#::' Makefile || die
+ fi
+
+ # causes crazy redefine errors with gcc-3.[2-4].x
+ replace-flags -O3 -O2
+ strip-flags #203969
+}
+
+src_compile() {
+ emake -C source/buildengine OPTFLAGS="${CFLAGS}"
+ emake -C source OPTIMIZE="${CFLAGS}"
+}
+
+src_install() {
+ games_make_wrapper duke3d "${GAMES_BINDIR}/duke3d.bin" "${GAMES_DATADIR}/${PN}"
+ newgamesbin source/duke3d duke3d.bin
+
+ dodoc readme.txt
+
+ cd testdata
+ insinto "${GAMES_DATADIR}/${PN}"
+ newins defs.con DEFS.CON
+ newins game.con GAME.CON
+ newins user.con USER.CON
+ newins "${FILESDIR}/network.cfg" network.cfg.template
+ if use demo ; then
+ doins "${WORKDIR}/DUKE3D.GRP"
+ fi
+
+ insinto "${GAMES_SYSCONFDIR}"
+ doins "${FILESDIR}/duke3d.cfg"
+ dosym "${GAMES_SYSCONFDIR}/duke3d.cfg" "${GAMES_DATADIR}/${PN}/DUKE3D.CFG"
+
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ use demo || elog "Put the data files in ${GAMES_DATADIR}/${PN} before playing"
+}
diff --git a/games-fps/duke3d/files/20040817-credits.patch b/games-fps/duke3d/files/20040817-credits.patch
new file mode 100644
index 000000000000..176fcd74752b
--- /dev/null
+++ b/games-fps/duke3d/files/20040817-credits.patch
@@ -0,0 +1,38 @@
+--- menues.c 2003-08-17 22:16:10.000000000 +0200
++++ menues.c 2004-03-29 01:59:28.000000000 +0200
+@@ -1747,9 +1747,10 @@
+ case 996:
+ case 997:
+
+-// rotatesprite(c<<16,200<<15,65536L,0,MENUSCREEN,16,0,10+64,0,0,xdim-1,ydim-1);
+-// rotatesprite(c<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1);
+-// menutext(c,24,0,0,"CREDITS");
++ c = (320>>1);
++ rotatesprite(c<<16,200<<15,65536L,0,MENUSCREEN,16,0,10+64,0,0,xdim-1,ydim-1);
++ rotatesprite(c<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1);
++ menutext(c,24,0,0,"CREDITS");
+
+ if(KB_KeyPressed(sc_Escape)) { cmenu(0); break; }
+
+@@ -1926,6 +1927,21 @@
+
+ menutext(c,67+16+16+16+16+16,SHX(-7),PHX(-7),"QUIT");
+
++ gametext(c,67+16+16+16+16+16+16+16,"Duke Nukem 3D for "
++#if defined PLATFORM_MACOSX
++ "MacOS"
++#elif defined PLATFORM_DOS
++ "MS-Dos"
++#elif defined PLATFORM_WIN32
++ "Win32"
++#elif defined PLATFORM_UNIX
++ "Gentoo"
++#else
++ "unknown"
++#endif
++ ,16,2+8+16);
++ gametext(c,67+16+16+16+16+16+16+16+9,"build " __DATE__ " " __TIME__,16,2+8+16);
++
+ break;
+ // CTW END - MODIFICATION
+
diff --git a/games-fps/duke3d/files/20040817-duke3d-makefile-opts.patch b/games-fps/duke3d/files/20040817-duke3d-makefile-opts.patch
new file mode 100644
index 000000000000..d23f7a118f77
--- /dev/null
+++ b/games-fps/duke3d/files/20040817-duke3d-makefile-opts.patch
@@ -0,0 +1,33 @@
+--- Makefile.orig 2003-08-17 17:45:35.948650760 -0400
++++ Makefile 2003-08-17 17:46:36.894385600 -0400
+@@ -4,6 +4,8 @@
+ beos := false
+ macosx := false
+ #use_asm := true
++use_opengl := true
++use_physfs := false
+
+ #-----------------------------------------------------------------------------#
+ # If this makefile fails to detect Cygwin correctly, or you want to force
+@@ -80,6 +81,10 @@
+ buildengine/pragmas.o \
+ buildengine/unix_compat.o
+
++ifeq ($(strip $(use_opengl)),true)
++ BUILDOBJS += buildengine/buildgl.o
++endif
++
+ ifeq ($(strip $(use_asm)),true)
+ BUILDOBJS += buildengine/a_gnu.o buildengine/a_nasm.o
+ else
+@@ -106,6 +106,10 @@
+
+ LDLIBS = $(SDL_LDFLAGS) -lSDL -lSDL_mixer $(EXTRALDFLAGS)
+
++ifeq ($(strip $(use_physfs)),true)
++ LDLIBS += -lphysfs
++endif
++
+ # !!! FIXME: Do we even need this? It doesn't fly on MacOS X. --ryan.
+ #LDLIBS += -Wl,-E
+
diff --git a/games-fps/duke3d/files/20040817-endian.patch b/games-fps/duke3d/files/20040817-endian.patch
new file mode 100644
index 000000000000..a22d07fb09f1
--- /dev/null
+++ b/games-fps/duke3d/files/20040817-endian.patch
@@ -0,0 +1,26 @@
+--- duke3d/source/buildengine/platform.h 2003-08-07 12:06:17.000000000 +0200
++++ duke3d.new/source/buildengine/platform.h 2004-08-24 18:35:05.292291088 +0200
+@@ -5,6 +5,7 @@
+ #include "win32_compat.h"
+ #elif (defined PLATFORM_UNIX)
+ #include "unix_compat.h"
++#include <endian.h>
+ #elif (defined PLATFORM_DOS)
+ #include "doscmpat.h"
+ #else
+@@ -60,9 +61,15 @@
+ #define BUILDSWAP_INTEL16(x) _swap16(x)
+ #define BUILDSWAP_INTEL32(x) _swap32(x)
+ #else
++#if __BYTE_ORDER == __LITTLE_ENDIAN
+ #define PLATFORM_LITTLEENDIAN 1
+ #define BUILDSWAP_INTEL16(x) (x)
+ #define BUILDSWAP_INTEL32(x) (x)
++#else
++#define PLATFORM_BIGENDIAN 1
++#define BUILDSWAP_INTEL16(x) _swap16(x)
++#define BUILDSWAP_INTEL32(x) _swap32(x)
++#endif
+ #endif
+
+ extern int has_altivec; /* PowerPC-specific. */
diff --git a/games-fps/duke3d/files/20040817-gcc34.patch b/games-fps/duke3d/files/20040817-gcc34.patch
new file mode 100644
index 000000000000..a7de9c116383
--- /dev/null
+++ b/games-fps/duke3d/files/20040817-gcc34.patch
@@ -0,0 +1,82 @@
+--- source/astub.c.orig 2004-08-22 14:44:50.691126872 +0100
++++ source/astub.c 2004-08-22 14:47:15.532107696 +0100
+@@ -540,6 +540,11 @@
+ return(tempbuf);
+ } //end
+
++void SpriteName(short spritenum, char *lo2)
++{
++ sprintf(lo2,names[sprite[spritenum].picnum]);
++}// end SpriteName
++
+ const char *ExtGetSpriteCaption(short spritenum)
+ {
+
+@@ -608,7 +613,11 @@
+ // y1, y2 0-143 (status bar is 144 high, origin is top-left of STATUS BAR)
+ // col 0-15
+
+-
++void PrintStatus(char *string,int num,char x,char y,char color)
++{
++ sprintf(tempbuf,"%s %d",string,num);
++ printext16(x*8,y*8,color,-1,tempbuf,0);
++}
+
+ void TotalMem()
+ {
+@@ -1276,18 +1285,6 @@
+
+ }
+
+-
+-void PrintStatus(char *string,int num,char x,char y,char color)
+-{
+- sprintf(tempbuf,"%s %d",string,num);
+- printext16(x*8,y*8,color,-1,tempbuf,0);
+-}
+-
+-void SpriteName(short spritenum, char *lo2)
+-{
+- sprintf(lo2,names[sprite[spritenum].picnum]);
+-}// end SpriteName
+-
+ char GAMEpalette[768];
+ char WATERpalette[768];
+ char SLIMEpalette[768];
+@@ -1326,6 +1323,17 @@
+ ReadGamePalette();
+ }// end ReadPaletteTable
+
++void Ver()
++{
++ sprintf(tempbuf,"DUKE NUKEM BUILD: V032696");
++ if (qsetmode == 200) //In 3D mode
++ { printext256(60*8,24*8,11,-1,tempbuf,1);
++ rotatesprite((320-8)<<16,(200-8)<<16,64<<9,0,SPINNINGNUKEICON+(((4-totalclock>>3))&7),0,0,0,0,0,xdim-1,ydim-1);
++ }else
++ { printext16(0,0,15,-1,tempbuf,0);
++ }
++}
++
+ void Keys3d(void)
+ {
+ long i,count,rate,nexti;
+@@ -2206,17 +2214,6 @@
+ }
+ }
+
+-void Ver()
+-{
+- sprintf(tempbuf,"DUKE NUKEM BUILD: V032696");
+- if (qsetmode == 200) //In 3D mode
+- { printext256(60*8,24*8,11,-1,tempbuf,1);
+- rotatesprite((320-8)<<16,(200-8)<<16,64<<9,0,SPINNINGNUKEICON+(((4-totalclock>>3))&7),0,0,0,0,0,xdim-1,ydim-1);
+- }else
+- { printext16(0,0,15,-1,tempbuf,0);
+- }
+-}
+-
+ ActorMem(int i)
+ {int total=0,j;
+ switch(i)
diff --git a/games-fps/duke3d/files/duke3d-20040817-as-needed.patch b/games-fps/duke3d/files/duke3d-20040817-as-needed.patch
new file mode 100644
index 000000000000..5eb90fea3e14
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d-20040817-as-needed.patch
@@ -0,0 +1,74 @@
+diff -ur duke3d/source/buildengine/Makefile duke3d-patched/source/buildengine/Makefile
+--- duke3d/source/buildengine/Makefile 2004-05-15 05:15:05.000000000 +0200
++++ duke3d-patched/source/buildengine/Makefile 2008-02-27 23:10:46.000000000 +0100
+@@ -99,11 +99,11 @@
+ ifeq ($(strip $(SDL_LIB_DIR)),please_set_me_cygwin_users)
+ $(error Cygwin users need to set the SDL_LIB_DIR envr var.)
+ else
+- SDL_LDFLAGS := -L$(SDL_LIB_DIR) -lSDL
++ SDL_LIBS := -L$(SDL_LIB_DIR) -lSDL
+ endif
+ else
+ SDL_CFLAGS := $(shell sdl-config --cflags)
+- SDL_LDFLAGS := $(shell sdl-config --libs)
++ SDL_LIBS := $(shell sdl-config --libs)
+ endif
+
+ CC = gcc
+@@ -202,7 +202,7 @@
+ ASMFLAGS = -f $(ASMOBJFMT) $(ASMDEFS)
+ LINKER = gcc
+ CFLAGS += $(USE_ASM) -funsigned-char -DPLATFORM_UNIX -Wall $(SDL_CFLAGS) -fno-omit-frame-pointer
+-LDFLAGS += $(SDL_LDFLAGS)
++LDLIBS += $(SDL_LIBS)
+
+ # Rules for turning source files into .o files
+ %.o: %.c
+@@ -236,17 +236,17 @@
+
+ ifeq ($(strip $(usedlls)),true)
+ $(ENGINEDLL) : $(ENGINEOBJS)
+- $(LINKER) -shared -o $(ENGINEDLL) $(LDFLAGS) $(ENGINEOBJS)
++ $(LINKER) -shared -o $(ENGINEDLL) $(LDFLAGS) $(ENGINEOBJS) $(LDLIBS)
+
+ $(NETDLL) : $(NETOBJS)
+- $(LINKER) -shared -o $(NETDLL) $(LDFLAGS) $(NETOBJS)
++ $(LINKER) -shared -o $(NETDLL) $(LDFLAGS) $(NETOBJS) $(LDLIBS)
+ endif
+
+ $(GAMEEXE) : $(ENGINEDLL) $(NETDLL) $(GAMEOBJS) $(PERLOBJS)
+- $(LINKER) -o $(GAMEEXE) $(LDFLAGS) $(LDPERL) $(PERLOBJS) $(GAMEOBJS) $(ENGINEDLL) $(NETDLL)
++ $(LINKER) -o $(GAMEEXE) $(LDFLAGS) $(PERLOBJS) $(GAMEOBJS) $(LDPERL) $(LDLIBS) $(ENGINEDLL) $(NETDLL)
+
+ $(BUILDEXE) : $(ENGINEDLL) $(BUILDOBJS)
+- $(LINKER) -o $(BUILDEXE) $(LDFLAGS) $(BUILDOBJS) $(ENGINEDLL)
++ $(LINKER) -o $(BUILDEXE) $(LDFLAGS) $(BUILDOBJS) $(LDLIBS) $(ENGINEDLL)
+
+ listclean:
+ @echo "A 'make clean' would remove" $(CLEANUP)
+diff -ur duke3d/source/Makefile duke3d-patched/source/Makefile
+--- duke3d/source/Makefile 2004-05-15 05:14:16.000000000 +0200
++++ duke3d-patched/source/Makefile 2008-02-27 23:09:57.000000000 +0100
+@@ -45,11 +45,11 @@
+ ifeq ($(strip $(SDL_LIB_DIR)),please_set_me_cygwin_users)
+ $(error Cygwin users need to set the SDL_LIB_DIR envr var.)
+ else
+- SDL_LDFLAGS := -L$(SDL_LIB_DIR) -lSDL
++ SDL_LIBS := -L$(SDL_LIB_DIR) -lSDL
+ endif
+ else
+ SDL_CFLAGS := $(shell sdl-config --cflags)
+- SDL_LDFLAGS := $(shell sdl-config --libs) -L.
++ SDL_LIBS := $(shell sdl-config --libs) -L.
+ endif
+
+ ifeq ($(strip $(macosx)),true)
+@@ -104,7 +104,7 @@
+ #CC = icc
+ #CFLAGS = -g $(SDL_CFLAGS) -DUSE_SDL=1 -DPLATFORM_UNIX=1 -DUSE_I386_ASM=1 $(EXTRACFLAGS) -O2
+
+-LDLIBS = $(SDL_LDFLAGS) -lSDL -lSDL_mixer $(EXTRALDFLAGS)
++LDLIBS = $(SDL_LIBS) -lSDL -lSDL_mixer $(EXTRALDFLAGS)
+
+ # !!! FIXME: Do we even need this? It doesn't fly on MacOS X. --ryan.
+ #LDLIBS += -Wl,-E
diff --git a/games-fps/duke3d/files/duke3d-20040817-gcc4.patch b/games-fps/duke3d/files/duke3d-20040817-gcc4.patch
new file mode 100644
index 000000000000..2a37148d799c
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d-20040817-gcc4.patch
@@ -0,0 +1,180 @@
+iff -ur duke3d/source/buildengine/a.c duke3d-gcc4/source/buildengine/a.c
+--- duke3d/source/buildengine/a.c 2004-11-25 13:55:21.000000000 -0500
++++ duke3d-gcc4/source/buildengine/a.c 2005-06-18 18:14:24.000000000 -0400
+@@ -186,7 +186,9 @@
+ if (i3 == 0)
+ {
+ i1 += i4;
+- ((unsigned long)i4) >>= mach3_al;
++ unsigned long temp = i4;
++ temp >>= mach3_al;
++ i4 = temp;
+ i4 = (i4&0xffffff00) | (source[i4]&0xff);
+ *dest = ((unsigned char*)i2)[i4];
+ return i1;
+diff -ur duke3d/source/buildengine/pragmas.c duke3d-gcc4/source/buildengine/pragmas.c
+--- duke3d/source/buildengine/pragmas.c 2003-07-25 20:11:32.000000000 -0400
++++ duke3d-gcc4/source/buildengine/pragmas.c 2005-06-18 18:25:37.000000000 -0400
+@@ -56,28 +56,39 @@
+
+ void clearbufbyte(void *buffer, int size, long fill_value) {
+ int lsize;
++ unsigned char *p=buffer;
++ unsigned short *s=buffer;
+ switch(size){
+ case 0: return;
+- case 1: *((unsigned char*)buffer)++ = fill_value; return;
+- case 2: *((unsigned short*)buffer)++ = fill_value; return;
+- case 3: { unsigned char *p=buffer; p[2]=p[1]=p[0] = fill_value;} return;
++ case 1: *p = fill_value; return;
++ case 2: *s = fill_value; return;
++ case 3: { p[2]=p[1]=p[0] = fill_value;} return;
+ default:
+ if ((int)buffer&1) {
+- *((unsigned char*)buffer)++ = fill_value; size--;
++ *p = fill_value; ++p; size--;
++ buffer = p;
+ }
+ if ((int)buffer&2) {
+- *((unsigned short*)buffer)++ = fill_value; size-=2;
++ *s = fill_value; ++s; size-=2;
++ buffer = s;
+ }
+ lsize = size>>2;
++ unsigned int *up = buffer;
+ while(lsize) {
+- *((unsigned int*)buffer)++ = fill_value;
++ *up = fill_value;
++ ++up;
+ lsize--;
+ }
++ buffer = up;
+ if (size&2) {
+- *((unsigned short*)buffer)++ = fill_value;
++ s = buffer;
++ *s = fill_value;
++ ++s;
+ }
+ if (size&1) {
+- *((unsigned char*)buffer)++ = fill_value;
++ p = buffer;
++ *p = fill_value;
++ ++p;
+ }
+ }
+ }
+@@ -122,7 +133,7 @@
+ {
+ *((unsigned short *)source) = ((linum>>16)&0xffff);
+ linum += linum_inc;
+- ((unsigned char*)source) = ((unsigned char*)source) + 2;
++ source = ((unsigned char*)source) + 2;
+ size--;
+ if (size == 0) return;
+ }
+
+diff -u -r duke3d/source/buildengine/a.h duke3d.gcc4.1.1/source/buildengine/a.h
+--- duke3d/source/buildengine/a.h 2003-04-11 08:54:06.000000000 +0200
++++ duke3d.gcc4.1.1/source/buildengine/a.h 2006-06-22 12:14:40.366393568 +0200
+@@ -116,56 +116,56 @@
+
+ #if ((defined __GNUC__) && (!defined C_IDENTIFIERS_UNDERSCORED))
+
+- long asm_mmxoverlay(void) __attribute__ ((alias ("_asm_mmxoverlay")));
+- long asm_sethlinesizes(long,long,long) __attribute__ ((alias ("_asm_sethlinesizes")));
+- long asm_setpalookupaddress(char *) __attribute__ ((alias ("_asm_setpalookupaddress")));
+- long asm_setuphlineasm4(long,long) __attribute__ ((alias ("_asm_setuphlineasm4")));
+- long asm_hlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_hlineasm4")));
+- long asm_setuprhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_setuprhlineasm4")));
+- long asm_rhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_rhlineasm4")));
+- long asm_setuprmhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_setuprmhlineasm4")));
+- long asm_rmhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_rmhlineasm4")));
+- long asm_setupqrhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_setupqrhlineasm4")));
+- long asm_qrhlineasm4(long,long,long,long,long,long) __attribute__ ((alias ("_asm_qrhlineasm4")));
+- long asm_setvlinebpl(long) __attribute__ ((alias ("_asm_setvlinebpl")));
+- long asm_fixtransluscence(long) __attribute__ ((alias ("_asm_fixtransluscence")));
+- long asm_prevlineasm1(long,long,long,long,long,long) __attribute__ ((alias ("_asm_prevlineasm1")));
+- long asm_vlineasm1(long,long,long,long,long,long) __attribute__ ((alias ("_asm_vlineasm1")));
+- long asm_setuptvlineasm(long) __attribute__ ((alias ("_asm_setuptvlineasm")));
+- long asm_tvlineasm1(long,long,long,long,long,long) __attribute__ ((alias ("_asm_tvlineasm1")));
+- long asm_setuptvlineasm2(long,long,long) __attribute__ ((alias ("_asm_setuptvlineasm2")));
+- long asm_tvlineasm2(long,long,long,long,long,long) __attribute__ ((alias ("_asm_tvlineasm2")));
+- long asm_mvlineasm1(long,long,long,long,long,long) __attribute__ ((alias ("_asm_mvlineasm1")));
+- long asm_setupvlineasm(long) __attribute__ ((alias ("_asm_setupvlineasm")));
+- long asm_vlineasm4(long,long) __attribute__ ((alias ("_asm_vlineasm4")));
+- long asm_setupmvlineasm(long) __attribute__ ((alias ("_asm_setupmvlineasm")));
+- long asm_mvlineasm4(long,long) __attribute__ ((alias ("_asm_mvlineasm4")));
+- void asm_setupspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_setupspritevline")));
+- void asm_spritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_spritevline")));
+- void asm_msetupspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_msetupspritevline")));
+- void asm_mspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_mspritevline")));
+- void asm_tsetupspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_tsetupspritevline")));
+- void asm_tspritevline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_tspritevline")));
+- long asm_mhline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_mhline")));
+- long asm_mhlineskipmodify(long,long,long,long,long,long) __attribute__ ((alias ("_asm_mhlineskipmodify")));
+- long asm_msethlineshift(long,long) __attribute__ ((alias ("_asm_msethlineshift")));
+- long asm_thline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_thline")));
+- long asm_thlineskipmodify(long,long,long,long,long,long) __attribute__ ((alias ("_asm_thlineskipmodify")));
+- long asm_tsethlineshift(long,long) __attribute__ ((alias ("_asm_tsethlineshift")));
+- long asm_setupslopevlin(long,long,long) __attribute__ ((alias ("_asm_setupslopevlin")));
+- long asm_slopevlin(long,long,long,long,long,long) __attribute__ ((alias ("_asm_slopevlin")));
+- long asm_settransnormal(void) __attribute__ ((alias ("_asm_settransnormal")));
+- long asm_settransreverse(void) __attribute__ ((alias ("_asm_settransreverse")));
+- long asm_setupdrawslab(long,long) __attribute__ ((alias ("_asm_setupdrawslab")));
+- long asm_drawslab(long,long,long,long,long,long) __attribute__ ((alias ("_asm_drawslab")));
+- long asm_stretchhline(long,long,long,long,long,long) __attribute__ ((alias ("_asm_stretchhline")));
+- long asm_isvmwarerunning(void) __attribute__ ((alias ("_asm_isvmwarerunning")));
++ long asm_mmxoverlay(void) asm ("_asm_mmxoverlay");
++ long asm_sethlinesizes(long,long,long) asm ("_asm_sethlinesizes");
++ long asm_setpalookupaddress(char *) asm ("_asm_setpalookupaddress");
++ long asm_setuphlineasm4(long,long) asm ("_asm_setuphlineasm4");
++ long asm_hlineasm4(long,long,long,long,long,long) asm ("_asm_hlineasm4");
++ long asm_setuprhlineasm4(long,long,long,long,long,long) asm ("_asm_setuprhlineasm4");
++ long asm_rhlineasm4(long,long,long,long,long,long) asm ("_asm_rhlineasm4");
++ long asm_setuprmhlineasm4(long,long,long,long,long,long) asm ("_asm_setuprmhlineasm4");
++ long asm_rmhlineasm4(long,long,long,long,long,long) asm ("_asm_rmhlineasm4");
++ long asm_setupqrhlineasm4(long,long,long,long,long,long) asm ("_asm_setupqrhlineasm4");
++ long asm_qrhlineasm4(long,long,long,long,long,long) asm ("_asm_qrhlineasm4");
++ long asm_setvlinebpl(long) asm ("_asm_setvlinebpl");
++ long asm_fixtransluscence(long) asm ("_asm_fixtransluscence");
++ long asm_prevlineasm1(long,long,long,long,long,long) asm ("_asm_prevlineasm1");
++ long asm_vlineasm1(long,long,long,long,long,long) asm ("_asm_vlineasm1");
++ long asm_setuptvlineasm(long) asm ("_asm_setuptvlineasm");
++ long asm_tvlineasm1(long,long,long,long,long,long) asm ("_asm_tvlineasm1");
++ long asm_setuptvlineasm2(long,long,long) asm ("_asm_setuptvlineasm2");
++ long asm_tvlineasm2(long,long,long,long,long,long) asm ("_asm_tvlineasm2");
++ long asm_mvlineasm1(long,long,long,long,long,long) asm ("_asm_mvlineasm1");
++ long asm_setupvlineasm(long) asm ("_asm_setupvlineasm");
++ long asm_vlineasm4(long,long) asm ("_asm_vlineasm4");
++ long asm_setupmvlineasm(long) asm ("_asm_setupmvlineasm");
++ long asm_mvlineasm4(long,long) asm ("_asm_mvlineasm4");
++ void asm_setupspritevline(long,long,long,long,long,long) asm ("_asm_setupspritevline");
++ void asm_spritevline(long,long,long,long,long,long) asm ("_asm_spritevline");
++ void asm_msetupspritevline(long,long,long,long,long,long) asm ("_asm_msetupspritevline");
++ void asm_mspritevline(long,long,long,long,long,long) asm ("_asm_mspritevline");
++ void asm_tsetupspritevline(long,long,long,long,long,long) asm ("_asm_tsetupspritevline");
++ void asm_tspritevline(long,long,long,long,long,long) asm ("_asm_tspritevline");
++ long asm_mhline(long,long,long,long,long,long) asm ("_asm_mhline");
++ long asm_mhlineskipmodify(long,long,long,long,long,long) asm("_asm_mhlineskipmodify");
++ long asm_msethlineshift(long,long) asm("_asm_msethlineshift");
++ long asm_thline(long,long,long,long,long,long) asm("_asm_thline");
++ long asm_thlineskipmodify(long,long,long,long,long,long) asm("_asm_thlineskipmodify");
++ long asm_tsethlineshift(long,long) asm("_asm_tsethlineshift");
++ long asm_setupslopevlin(long,long,long) asm("_asm_setupslopevlin");
++ long asm_slopevlin(long,long,long,long,long,long) asm("_asm_slopevlin");
++ long asm_settransnormal(void) asm("_asm_settransnormal");
++ long asm_settransreverse(void) asm("_asm_settransreverse");
++ long asm_setupdrawslab(long,long) asm("_asm_setupdrawslab");
++ long asm_drawslab(long,long,long,long,long,long) asm("_asm_drawslab");
++ long asm_stretchhline(long,long,long,long,long,long) asm("_asm_stretchhline");
++ long asm_isvmwarerunning(void) asm("_asm_isvmwarerunning");
+
+ /*
+ * !!! I need a reference to this, for mprotect(), but the actual function
+ * !!! is never called in BUILD...just from other ASM routines. --ryan.
+ */
+- long asm_prohlineasm4(void) __attribute__ ((alias ("_asm_prohlineasm4")));
++ long asm_prohlineasm4(void) asm("_asm_prohlineasm4");
+
+ #endif /* ELF/GCC */
+ #endif /* defined USE_I386_ASM */
diff --git a/games-fps/duke3d/files/duke3d-20040817-ldflags.patch b/games-fps/duke3d/files/duke3d-20040817-ldflags.patch
new file mode 100644
index 000000000000..79179e663805
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d-20040817-ldflags.patch
@@ -0,0 +1,66 @@
+--- source/buildengine/Makefile.old 2010-10-08 14:32:05.000000000 +0200
++++ source/buildengine/Makefile 2010-10-08 14:35:10.000000000 +0200
+@@ -73,7 +73,7 @@
+ endif
+
+ ifeq ($(strip $(solaris)),true)
+- LDFLAGS += -lsocket -lnsl
++ LIBS += -lsocket -lnsl
+ CFLAGS += -DPLATFORM_SOLARIS
+ endif
+
+@@ -129,7 +129,7 @@
+
+ ifeq ($(strip $(macosx)),true)
+ CFLAGS += -DPLATFORM_MACOSX=1 -faltivec -falign-loops=32 -falign-functions=32
+- LDFLAGS += -framework AppKit -lSDL -lSDLmain
++ LIBS += -framework AppKit -lSDL -lSDLmain
+ endif
+
+ ifeq ($(strip $(useopengl)),true)
+@@ -146,7 +146,7 @@
+
+ ifeq ($(strip $(usephysfs)),true)
+ CFLAGS += -DUSE_PHYSICSFS
+- LDFLAGS += -lphysfs
++ LIBS += -lphysfs
+ endif
+
+ ifeq ($(strip $(usedlls)),true)
+@@ -236,17 +236,17 @@
+
+ ifeq ($(strip $(usedlls)),true)
+ $(ENGINEDLL) : $(ENGINEOBJS)
+- $(LINKER) -shared -o $(ENGINEDLL) $(LDFLAGS) $(ENGINEOBJS) $(LDLIBS)
++ $(LINKER) -shared -o $(ENGINEDLL) $(LIBS) $(ENGINEOBJS) $(LDLIBS)
+
+ $(NETDLL) : $(NETOBJS)
+- $(LINKER) -shared -o $(NETDLL) $(LDFLAGS) $(NETOBJS) $(LDLIBS)
++ $(LINKER) -shared -o $(NETDLL) $(LIBS) $(NETOBJS) $(LDLIBS)
+ endif
+
+ $(GAMEEXE) : $(ENGINEDLL) $(NETDLL) $(GAMEOBJS) $(PERLOBJS)
+- $(LINKER) -o $(GAMEEXE) $(LDFLAGS) $(PERLOBJS) $(GAMEOBJS) $(LDPERL) $(LDLIBS) $(ENGINEDLL) $(NETDLL)
++ $(LINKER) $(LDFLAGS) -o $(GAMEEXE) $(LIBS) $(PERLOBJS) $(GAMEOBJS) $(LDPERL) $(LDLIBS) $(ENGINEDLL) $(NETDLL)
+
+ $(BUILDEXE) : $(ENGINEDLL) $(BUILDOBJS)
+- $(LINKER) -o $(BUILDEXE) $(LDFLAGS) $(BUILDOBJS) $(LDLIBS) $(ENGINEDLL)
++ $(LINKER) $(LDFLAGS) -o $(BUILDEXE) $(LIBS) $(BUILDOBJS) $(LDLIBS) $(ENGINEDLL)
+
+ listclean:
+ @echo "A 'make clean' would remove" $(CLEANUP)
+--- source/Makefile.old 2010-10-08 14:35:54.000000000 +0200
++++ source/Makefile 2010-10-08 14:37:34.000000000 +0200
+@@ -152,10 +152,10 @@
+ sounds.o \
+ dukemusc.o \
+ audiolib/audiolib.a
+- $(CC) $^ $(BUILDOBJS) $(LDLIBS) -o $@
++ $(CC) $(LDFLAGS) $^ $(BUILDOBJS) $(LDLIBS) -o $@
+
+ build: astub.o
+- $(CC) $^ $(BUILDOBJS) buildengine/build.o $(LDLIBS) -o $@
++ $(CC) $(LDFLAGS) $^ $(BUILDOBJS) buildengine/build.o $(LDLIBS) -o $@
+
+ clean:
+ $(MAKE) -C audiolib clean
diff --git a/games-fps/duke3d/files/duke3d-20040817-noinline.patch b/games-fps/duke3d/files/duke3d-20040817-noinline.patch
new file mode 100644
index 000000000000..a41c5c01d063
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d-20040817-noinline.patch
@@ -0,0 +1,18 @@
+--- source/buildengine/engine.c.old 2009-02-06 09:11:54.000000000 +0100
++++ source/buildengine/engine.c 2009-02-06 09:19:12.000000000 +0100
+@@ -391,6 +391,7 @@
+ modify exact [eax ebx ecx]\
+
+ #elif (defined __GNUC__) || (defined __ICC)
++ __attribute__ ((noinline))
+ static long nsqrtasm(int i1)
+ {
+ long retval;
+@@ -601,6 +602,7 @@
+
+ #elif (defined __GNUC__) || (defined __ICC)
+
++ __attribute__ ((noinline))
+ int setgotpic(long i1)
+ {
+ int retval = 0;
diff --git a/games-fps/duke3d/files/duke3d.cfg b/games-fps/duke3d/files/duke3d.cfg
new file mode 100644
index 000000000000..2e8c4a0671b7
--- /dev/null
+++ b/games-fps/duke3d/files/duke3d.cfg
@@ -0,0 +1,194 @@
+[Setup]
+SetupVersion = "1.3D"
+
+[Screen Setup]
+ScreenMode = 2
+ScreenWidth = 1024
+ScreenHeight = 768
+Shadows = 1
+Password = ""
+Detail = 1
+Tilt = 1
+Messages = 1
+Out = 0
+ScreenSize = 8
+ScreenGamma = 0
+
+[Sound Setup]
+FXDevice = 0
+MusicDevice = 0
+FXVolume = 220
+MusicVolume = 200
+NumVoices = 8
+NumChannels = 2
+NumBits = 16
+MixRate = 44100
+MidiPort = 0x330
+BlasterAddress = 0x220
+BlasterType = 1
+BlasterInterrupt = 5
+BlasterDma8 = 1
+BlasterDma16 = 5
+BlasterEmu = 0x620
+ReverseStereo = 0
+SoundToggle = 1
+VoiceToggle = 1
+AmbienceToggle = 1
+MusicToggle = 1
+
+[KeyDefinitions]
+Move_Forward = "Up" "Kpad8"
+Move_Backward = "Down" "Kpad2"
+Turn_Left = "Left" "Kpad4"
+Turn_Right = "Right" "KPad6"
+Strafe = "LAlt" "RAlt"
+Fire = "LCtrl" "RCtrl"
+Open = "Space" ""
+Run = "LShift" "RShift"
+AutoRun = "CapLck" ""
+Jump = "A" "/"
+Crouch = "Z" ""
+Look_Up = "PgUp" "Kpad9"
+Look_Down = "PgDn" "Kpad3"
+Look_Left = "Insert" "Kpad0"
+Look_Right = "Delete" "Kpad."
+Strafe_Left = "," ""
+Strafe_Right = "." ""
+Aim_Up = "Home" "KPad7"
+Aim_Down = "End" "Kpad1"
+Weapon_1 = "1" ""
+Weapon_2 = "2" ""
+Weapon_3 = "3" ""
+Weapon_4 = "4" ""
+Weapon_5 = "5" ""
+Weapon_6 = "6" ""
+Weapon_7 = "7" ""
+Weapon_8 = "8" ""
+Weapon_9 = "9" ""
+Weapon_10 = "0" ""
+Inventory = "Enter" "KpdEnt"
+Inventory_Left = "[" ""
+Inventory_Right = "]" ""
+Holo_Duke = "H" ""
+Jetpack = "J" ""
+NightVision = "N" ""
+MedKit = "M" ""
+TurnAround = "BakSpc" ""
+SendMessage = "T" ""
+Map = "Tab" ""
+Shrink_Screen = "-" "Kpad-"
+Enlarge_Screen = "=" "Kpad+"
+Center_View = "KPad5" ""
+Holster_Weapon = "ScrLck" ""
+Show_Opponents_Weapon = "W" ""
+Map_Follow_Mode = "F" ""
+See_Coop_View = "K" ""
+Mouse_Aiming = "U" ""
+Toggle_Crosshair = "I" ""
+Steroids = "R" ""
+Quick_Kick = "`" ""
+Next_Weapon = "'" ""
+Previous_Weapon = ";" ""
+
+[Controls]
+ControllerType = 1
+JoystickPort = 0
+MouseSensitivity = 32768
+ExternalFilename = "EXTERNAL.EXE"
+EnableRudder = 0
+MouseAiming = 0
+MouseButton0 = "Fire"
+MouseButtonClicked0 = ""
+MouseButton1 = "Strafe"
+MouseButtonClicked1 = "Open"
+MouseButton2 = "Move_Forward"
+MouseButtonClicked2 = ""
+JoystickButton0 = "Fire"
+JoystickButtonClicked0 = ""
+JoystickButton1 = "Strafe"
+JoystickButtonClicked1 = "Inventory"
+JoystickButton2 = "Run"
+JoystickButtonClicked2 = "Jump"
+JoystickButton3 = "Open"
+JoystickButtonClicked3 = "Crouch"
+JoystickButton4 = "Aim_Down"
+JoystickButtonClicked4 = ""
+JoystickButton5 = "Look_Right"
+JoystickButtonClicked5 = ""
+JoystickButton6 = "Aim_Up"
+JoystickButtonClicked6 = ""
+JoystickButton7 = "Look_Left"
+JoystickButtonClicked7 = ""
+MouseAnalogAxes0 = "analog_turning"
+MouseDigitalAxes0_0 = ""
+MouseDigitalAxes0_1 = ""
+MouseAnalogScale0 = 0
+MouseAnalogAxes1 = "analog_moving"
+MouseDigitalAxes1_0 = ""
+MouseDigitalAxes1_1 = ""
+MouseAnalogScale1 = 0
+JoystickAnalogAxes0 = "analog_turning"
+JoystickDigitalAxes0_0 = ""
+JoystickDigitalAxes0_1 = ""
+JoystickAnalogScale0 = 0
+JoystickAnalogAxes1 = "analog_moving"
+JoystickDigitalAxes1_0 = ""
+JoystickDigitalAxes1_1 = ""
+JoystickAnalogScale1 = 0
+JoystickAnalogAxes2 = "analog_strafing"
+JoystickDigitalAxes2_0 = ""
+JoystickDigitalAxes2_1 = ""
+JoystickAnalogScale2 = 0
+JoystickAnalogAxes3 = ""
+JoystickDigitalAxes3_0 = "Run"
+JoystickDigitalAxes3_1 = ""
+JoystickAnalogScale3 = 0
+GamePadDigitalAxes0_0 = "Turn_Left"
+GamePadDigitalAxes0_1 = "Turn_Right"
+GamePadDigitalAxes1_0 = "Move_Forward"
+GamePadDigitalAxes1_1 = "Move_Backward"
+MouseAimingFlipped = 0
+GameMouseAiming = 0
+AimingFlag = 0
+
+[Comm Setup]
+ComPort = 2
+IrqNumber = 65535
+UartAddress = 65535
+PortSpeed = 9600
+ToneDial = 1
+SocketNumber = 65535
+NumberPlayers = 2
+ModemName = ""
+InitString = "ATZ"
+HangupString = "ATH0=0"
+DialoutString = ""
+PlayerName = "DUKE"
+RTSName = "DUKE.RTS"
+PhoneNumber = ""
+ConnectType = 0
+CommbatMacro#0 = "An inspiration for birth control."
+CommbatMacro#1 = "You're gonna die for that!"
+CommbatMacro#2 = "It hurts to be you."
+CommbatMacro#3 = "Lucky Son of a Bitch."
+CommbatMacro#4 = "Hmmm....Payback time."
+CommbatMacro#5 = "You bottom dwelling scum sucker."
+CommbatMacro#6 = "Damn, you're ugly."
+CommbatMacro#7 = "Ha ha ha...Wasted!"
+CommbatMacro#8 = "You suck!"
+CommbatMacro#9 = "AARRRGHHHHH!!!"
+
+[Misc]
+Executions = 5
+RunMode = 0
+Crosshairs = 1
+WeaponChoice0 = 3
+WeaponChoice1 = 4
+WeaponChoice2 = 5
+WeaponChoice3 = 7
+WeaponChoice4 = 8
+WeaponChoice5 = 6
+WeaponChoice6 = 0
+WeaponChoice7 = 2
+WeaponChoice8 = 9
+WeaponChoice9 = 1
diff --git a/games-fps/duke3d/files/network.cfg b/games-fps/duke3d/files/network.cfg
new file mode 100644
index 000000000000..46db8b3119fb
--- /dev/null
+++ b/games-fps/duke3d/files/network.cfg
@@ -0,0 +1,15 @@
+# lifted from happypenguin.org
+
+INTERFACE [your ip address]
+
+# only peer appears to work [SERVER or CLIENT or PEER]
+MODE peer
+
+# create an allow line for everyone who will connect
+ALLOW [another player's ip address]
+ALLOW [another player's ip address]
+ALLOW [another player's ip address]
+ALLOW [another player's ip address]
+
+# try to find [number] of players and start the game
+BROADCAST [number]
diff --git a/games-fps/duke3d/metadata.xml b/games-fps/duke3d/metadata.xml
new file mode 100644
index 000000000000..1f342d0fbdcc
--- /dev/null
+++ b/games-fps/duke3d/metadata.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <longdescription>
+The third chapter in the series, and the first with a 3D perspective
+(the original Duke Nukem and the sequel, Duke Nukem II, are side
+scrolling platform games). This game, set sometime in the early 21st
+century, begins in a ravaged LA, which was overtaken by aliens while you
+were abducted during Duke Nukem II. Duke, upon returning to Earth, finds
+himself with another mess to clean up, and another alien race that needs
+exterminating. Duke is a can-do hero who realizes that sometimes
+innocent people have to die in order to save Earth, so accuracy of gun
+fire is not a real concern to him. :)
+
+This game has a long list of cool things that haven't been attempted in
+3D action games, yet. The weapons, for example, kick-butt:
+
+ * There's a mine that can be placed on any wall and sends out a
+laser trip beam-- perfect for multiplayer games.
+ * There's also a shrinker ray that reduces an opponent to the size
+of a G.I. Joe, at which point they are foot fodder--watch them splat!
+ * As in Shadow Warrior, you can swim under water, and even shoot
+players who are standing outside the water, or vice versa.
+
+ What works:
+ * Basic gameplay seems fine.
+ * Sound and music.
+ * keyboard input.
+ * mouse input.
+ * Hi-res (what would be "VESA modes" in DOS).
+ * Windowed/fullscreen support.
+ * Save games.
+ * Record and playback demos compatible with the Atomic Edition (1.5).
+ * Shareware and retail versions should all work.
+ * BUILD editor works to a large degree.
+ * DukeBots for multiplayer AI.
+ * Assembly code all has portable C fallbacks, now.
+ * TCP/IP Networking!
+ * Linux/x86 port.
+ * Windows/x86 port.
+ * BeOS/x86 port.
+ * (incomplete) MacOS X port.
+
+What doesn't work/known bugs:
+ * Joystick input isn't working yet.
+ * File cases need to be exact in some places, not others.
+ * Engine (game?) relies on compiler treating "char" as "unsigned" by default...this needs to be flushed out, for sanity's sake. But I'm anal. :)
+ * Netcode handles packet loss _VERY_ poorly...it's fine for stable connections and LANs, though.
+ * Configuring a multiplayer game involves editing text files and filling in IP addresses. Not very user-friendly.
+ * Some text prompts try to read the SDL input queue instead of stdin like they should.
+ * Probably other stuff. Do NOT consider this stable and complete yet!
+</longdescription>
+ <use>
+ <flag name="demo">Install the demo files</flag>
+ <flag name="pic">disable optimized assembly code that is not PIC friendly</flag>
+ </use>
+</pkgmetadata>