summaryrefslogtreecommitdiff
path: root/games-rpg/xu4
diff options
context:
space:
mode:
Diffstat (limited to 'games-rpg/xu4')
-rw-r--r--games-rpg/xu4/Manifest12
-rw-r--r--games-rpg/xu4/files/0.9-savegame.patch76
-rw-r--r--games-rpg/xu4/files/xu4-0.9-ldflags.patch35
-rw-r--r--games-rpg/xu4/files/xu4-0.9-warnings.patch26
-rw-r--r--games-rpg/xu4/files/xu4-0.9-zip.patch144
-rw-r--r--games-rpg/xu4/metadata.xml11
-rw-r--r--games-rpg/xu4/xu4-0.9-r1.ebuild75
-rw-r--r--games-rpg/xu4/xu4-0.9.ebuild72
8 files changed, 451 insertions, 0 deletions
diff --git a/games-rpg/xu4/Manifest b/games-rpg/xu4/Manifest
new file mode 100644
index 000000000000..ec8f2a18d991
--- /dev/null
+++ b/games-rpg/xu4/Manifest
@@ -0,0 +1,12 @@
+AUX 0.9-savegame.patch 1716 SHA256 037c9b842a54dab15b55a020aa62e993749cfa09a7530ce4f0b3b5916de3ee05 SHA512 b6484a2abc6b32933157cf3e7875d2863473bc863076efa3c4398dbd28cc037cbac2e376c5ce4bbd6c7fabdb2c0bc907be872e2167f6a00f4ca311ea8301ad77 WHIRLPOOL d4b88f394f8e6714b794006966c17c9f013d244afe5e2092039f3908177b4067c330c82757d4a0fc9b3d66470207f46bebea010fd88d1b10a8bb22cb9afd3211
+AUX xu4-0.9-ldflags.patch 1721 SHA256 47e68b383a1f965aa05f8dfcd015c064f7b0c289928d4e2f4ac8d35789096bf2 SHA512 1e0c3b8f6595f9b9f7fecda9264460cd67e289a7a0ba19fc181473546e3db4b2cadde825be46f27fdfec9b872fb6cb6ea8e474a890f25677b49b85093ffa957c WHIRLPOOL db78bf4b327522d28a6a2c34f373311f7b8e47a990cbe554c7242edd3b8c0b44f83eb4e0f6f4863bdde9328fbe166c1cec24e5fd079da10e99458e661212939d
+AUX xu4-0.9-warnings.patch 454 SHA256 b578ccf7d860281d7bcae48b816b4116ffdc55d4051377841ff00ab6c5176270 SHA512 0a92b7510789a55c712f8d9a2130ac4d9cdf6e2403201c258d24c121fdae6e0d932504677715bea062652ee6aff7b27ec6419c578cb5fe56406b1965c387b361 WHIRLPOOL ca80134861d5a08d820daa54bd6446a54b4ca942a314791fcc5c13774ac18b5cb106451dce3fdaa2cdc0a70a7e6373af413c3fa0c1039a5bb7c85c6e7b7ea08d
+AUX xu4-0.9-zip.patch 4980 SHA256 ac35017606c7812ea6851441be41ace71c2c1ba7ba287f029032a0fcb87850aa SHA512 b531fd545f1827cff61eec4f5b60bb9b98e4b907c02a9477c269f75e3cccaf1741189abe47a1dcac6205c3fffadff7b13e57bfd80e2ac771f38546ef7c21a85c WHIRLPOOL 30e7cb2f0e855e79621f135a644b713b57c72c52b88da90d7bb3a596610a62b2aab48676b6f1b3f56013782294735d5ad1d31f49d561d47d80620277b1b8ebe3
+DIST u4upgrad.zip 632072 SHA256 400ac37311f3be74c1b2d7836561b2ead2b146f5162586865b0f4881225cca58 SHA512 4832d8cfd266d3ccc5eab5184bd2b6b9acd4c0203478873fb5e11704d95104dd9285a7752bad77f873d4f8603673184ae9421964509b948ec69944a4ceadd083 WHIRLPOOL 3d9c320efe24b29edca1f0d917dcaad1da7c1c6246c753b2366ada81552f43113bd57f335ca79adf2283cdab6ba24bf0c09aeb7802a33d3fdec5e0bbe1782d01
+DIST ultima4-1.01.zip 537487 SHA256 ec84ef08e9e38156622300065aa62260276fc8f1c1ff2774f7916e7c10db40dc SHA512 c86c29d51e21b93992316552fbaaec948e7e8048fea484f003f43ac82211f82fa587fb15db991cddf744f2c3ff0fc4d411cd51cc7650e13a5b520c4dc620518c WHIRLPOOL f3acdc021449e3b55adc7d0ea967c8f77cdd813a0f9316042ae8e906eb105b6297f19efc90fffbd9be747bca7d6b0ea4b0bbdc1729c906076e89498558250155
+DIST xu4-0.9.tar.gz 320090 SHA256 26d7a957411e98474d3a06a0bf63a683208d3c35c0cf7afe90db992a934b0bf3 SHA512 6c0b27472074d96a5f76e024c800bed89c57c29dbd760278c819ad8b024362480bda5f1584eb9fe64fd6f6cae0b3b8d8571c8cf533f25b842471803acd7cea8d WHIRLPOOL 428ee87920850e16ce411e0a2bd1656a68a61644d96349bf727cbedd041e6fe3c8c134e960eaf5205d0d3f9deeccd9de23cab2186567fbd8c80b382ac5c9f812
+EBUILD xu4-0.9-r1.ebuild 1664 SHA256 40620aed727e2786d33ec86cbb395c3a96af816f5720316d6ee6dd7898a1680a SHA512 558b73be5403e28590790461f416cd7179dd57ea6303a5cc55de678eaefb9bb40f394a04bc1e836219f165eb172f6fddff15213fb17b344ff52032c635bb12c1 WHIRLPOOL 954226846ec2973f3e55d01bb1c34a96a3060897273e809f804d248486e423bf9d62c104a12e8cf0a8b091a66587ef9ec02043aa4f3e622bda84c4eea50b651d
+EBUILD xu4-0.9.ebuild 1668 SHA256 e2c5fa56701994882e81f793c274ceaea7fb0b07b467f4f8bf6a02f15480710f SHA512 ebb44b47fd229dd51d16eaa3ab781643342623d3f83b08871908f4be6b664ade40310ff7bde171c6e810cdded41d4df5d21ed355df71028f409b7ad4adfe5fa7 WHIRLPOOL 324a24052a0f8b0a84e710c1be8dacb4139aa6c68afef50c8cff2a611ed7158477406be79e55e6fbf51b45c3d93888ce363d400101b079f0c47e603eb7639f4c
+MISC ChangeLog 2884 SHA256 ee7ea9f7d60e9429799b9d72ee14514859ee3db20896bd985f51853b17cd6185 SHA512 c9f7ba0254c2d59f56b7af249891bad058053813b2b1ce3a971a4c30650a187c151ce94e84262c1ce832e3fb5f146743f543d8b1153374b6f3731dad2b94124c WHIRLPOOL c7059ded904016ddc6797a085162703f6285e240f4ccb8438dc694c9ba26ac0d7bffe2f5087e34b3a07f1b3b478ace86b0cc2fcbcf83728c878968b81df0a842
+MISC ChangeLog-2015 1524 SHA256 58fbaf770cd8d0d6cd59b6fa53a4dca14d71c42e8a3d0ffcf21e300b2cd26d1d SHA512 8284077b0e96e75fe46cde4f82fa85502c7a2614f81145be0c7f61d1e48441e1a17501df6d78a2ed126a04a3352773c7341d83a529bd468892f18065f5d7b81e WHIRLPOOL 7773d81936b0933646f419697d3ef1bd33ab6ae169f6a5ffe5888d8f461bd0aaa06967e93299d407c5658c9003c06bd1ebf2732ba3d4cd3c7254c99211b47dbc
+MISC metadata.xml 326 SHA256 af1ff43b8bb2f449ce3b742b226c002fc867c9c1170aaba5497ee8a658e44df8 SHA512 cdeb23df21e2a0ad4994adffe0ecf7fdca9fb886b6afc13483a80ffd481c9a031c2039894c86693b1ecf9652f882c2816e7091a3d6dd9ad76013b563e8780ec3 WHIRLPOOL c75c07e9c0f801ad68bf5d0b35c972f9d297dc95511c92b0d28966fbd338eece3f3e02366cda4810a0f6aa4ca3bb3de67ad9c9aa1a0cfe500100aae4f65f7007
diff --git a/games-rpg/xu4/files/0.9-savegame.patch b/games-rpg/xu4/files/0.9-savegame.patch
new file mode 100644
index 000000000000..96d16360f37c
--- /dev/null
+++ b/games-rpg/xu4/files/0.9-savegame.patch
@@ -0,0 +1,76 @@
+--- a/src/savegame.c.
++++ b/src/savegame.c
+@@ -21,23 +21,24 @@
+ char *partySavFilename() {
+ char *fname;
+
+-#if defined(MACOSX)
+ char *home;
+
+ home = getenv("HOME");
+ if (home && home[0]) {
+ fname = (char *) malloc(strlen(home) +
++#if defined(MACOSX)
+ strlen(MACOSX_USER_FILES_PATH) +
++#endif
++strlen("/.u4/") +
+ strlen(PARTY_SAV_BASE_FILENAME) + 2);
+ strcpy(fname, home);
++#if defined(MACOSX)
+ strcat(fname, MACOSX_USER_FILES_PATH);
+- strcat(fname, "/");
++#endif
++ strcat(fname, "/.u4/");
+ strcat(fname, PARTY_SAV_BASE_FILENAME);
+ } else
+ fname = strdup(PARTY_SAV_BASE_FILENAME);
+-#else
+- fname = strdup(PARTY_SAV_BASE_FILENAME);
+-#endif
+
+ return fname;
+ }
+@@ -45,24 +45,24 @@
+ char *monstersSavFilename() {
+ char *fname;
+
+-#if defined(MACOSX)
+ char *home;
+
+ home = getenv("HOME");
+ if (home && home[0]) {
+ fname = (char *) malloc(strlen(home) +
++#if defined(MACOSX)
+ strlen(MACOSX_USER_FILES_PATH) +
++#endif
++strlen("/.u4/") +
+ strlen(MONSTERS_SAV_BASE_FILENAME) + 2);
+ strcpy(fname, home);
++#if defined(MACOSX)
+ strcat(fname, MACOSX_USER_FILES_PATH);
+- strcat(fname, "/");
++#endif
++ strcat(fname, "/.u4/");
+ strcat(fname, MONSTERS_SAV_BASE_FILENAME);
+ } else
+ fname = strdup(MONSTERS_SAV_BASE_FILENAME);
+-#else
+- fname = strdup(MONSTERS_SAV_BASE_FILENAME);
+-#endif
+-
+ return fname;
+ }
+
+--- a/src/u4.c
++++ b/src/u4.c
+@@ -38,6 +38,10 @@
+ osxInit(argv[0]);
+ #endif
+
++ if (getenv("HOME")) {
++ chdir(getenv("HOME"));
++ mkdir(".u4", 0777);
++ }
+ settingsRead();
+
+ for (i = 1; i < (unsigned int)argc; i++) {
diff --git a/games-rpg/xu4/files/xu4-0.9-ldflags.patch b/games-rpg/xu4/files/xu4-0.9-ldflags.patch
new file mode 100644
index 000000000000..7f1e5cd922d7
--- /dev/null
+++ b/games-rpg/xu4/files/xu4-0.9-ldflags.patch
@@ -0,0 +1,35 @@
+--- a/src/Makefile.common
++++ b/src/Makefile.common
+@@ -68,25 +68,25 @@
+ mkutils:: dumpsavegame$(EXEEXT) lzwenc$(EXEEXT) lzwdec$(EXEEXT) rleenc$(EXEEXT) rledec$(EXEEXT) tlkconv$(EXEEXT)
+
+ $(MAIN): $(OBJS)
+- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
+
+ dumpsavegame$(EXEEXT) : util/dumpsavegame.o savegame.o io.o names.o
+- $(CC) $(CFLAGS) -o dumpsavegame util/dumpsavegame.o savegame.o io.o names.o
++ $(CC) $(LDFLAGS) $(CFLAGS) -o dumpsavegame util/dumpsavegame.o savegame.o io.o names.o
+
+ lzwenc$(EXEEXT) : util/lzwenc.o lzw/hash.o util/pngconv.o
+- $(CC) $(CFLAGS) -o lzwenc util/lzwenc.o lzw/hash.o util/pngconv.o -lpng -lz
++ $(CC) $(LDFLAGS) $(CFLAGS) -o lzwenc util/lzwenc.o lzw/hash.o util/pngconv.o -lpng -lz
+
+ lzwdec$(EXEEXT) : util/lzwdec.o lzw/lzw.o lzw/u4decode.o lzw/hash.o util/pngconv.o
+- $(CC) $(CFLAGS) -o lzwdec util/lzwdec.o lzw/lzw.o lzw/u4decode.o lzw/hash.o util/pngconv.o -lpng -lz
++ $(CC) $(LDFLAGS) $(CFLAGS) -o lzwdec util/lzwdec.o lzw/lzw.o lzw/u4decode.o lzw/hash.o util/pngconv.o -lpng -lz
+
+ rleenc$(EXEEXT) : util/rleenc.o util/pngconv.o
+- $(CC) $(CFLAGS) -o rleenc util/rleenc.o util/pngconv.o -lpng -lz
++ $(CC) $(LDFLAGS) $(CFLAGS) -o rleenc util/rleenc.o util/pngconv.o -lpng -lz
+
+ rledec$(EXEEXT) : util/rledec.o rle.o util/pngconv.o
+- $(CC) $(CFLAGS) -o rledec util/rledec.o rle.o util/pngconv.o -lpng -lz
++ $(CC) $(LDFLAGS) $(CFLAGS) -o rledec util/rledec.o rle.o util/pngconv.o -lpng -lz
+
+ tlkconv$(EXEEXT) : util/tlkconv.o
+- $(CC) $(CFLAGS) -o tlkconv util/tlkconv.o $(shell xml2-config --libs)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o tlkconv util/tlkconv.o $(shell xml2-config --libs)
+
+ clean:: cleanutil
+ rm -rf *~ */*~ $(OBJS) $(MAIN)
diff --git a/games-rpg/xu4/files/xu4-0.9-warnings.patch b/games-rpg/xu4/files/xu4-0.9-warnings.patch
new file mode 100644
index 000000000000..e52b610e61d4
--- /dev/null
+++ b/games-rpg/xu4/files/xu4-0.9-warnings.patch
@@ -0,0 +1,26 @@
+--- a/src/u4.c
++++ b/src/u4.c
+@@ -3,6 +3,8 @@
+ */
+
+ #include <stdio.h>
++#include <sys/stat.h>
++#include <sys/types.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <string.h>
+--- a/u4.desktop
++++ b/u4.desktop
+@@ -1,9 +1,8 @@
+ [Desktop Entry]
+-Encoding=UTF-8
+ Name=Ultima 4
+ Comment=Ultima 4 (xu4)
+ Exec=u4
+-Icon=u4.png
+-Terminal=0
++Icon=u4
++Terminal=false
+ Type=Application
+-Categories=Application;Game;RolePlaying;
++Categories=Game;RolePlaying;
diff --git a/games-rpg/xu4/files/xu4-0.9-zip.patch b/games-rpg/xu4/files/xu4-0.9-zip.patch
new file mode 100644
index 000000000000..a8d2c58971c9
--- /dev/null
+++ b/games-rpg/xu4/files/xu4-0.9-zip.patch
@@ -0,0 +1,144 @@
+--- a/src/unzip.c
++++ b/src/unzip.c
+@@ -493,7 +493,7 @@
+ /*
+ Get Info about the current file in the zipfile, with internal only info
+ */
+-local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
++local int unzlocal_GetCurrentFileInfoInternal _Z_OF((unzFile file,
+ unz_file_info *pfile_info,
+ unz_file_info_internal
+ *pfile_info_internal,
+--- a/src/unzip.h
++++ b/src/unzip.h
+@@ -8,7 +8,7 @@
+ Encryption and multi volume ZipFile (span) are not supported.
+ Old compressions used by old PKZip 1.x are not supported
+
+- THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
++ THIS IS AN ALPHA VERSION. AT THIS STAGE _Z_OF DEVELOPPEMENT, SOMES API OR STRUCTURE
+ CAN CHANGE IN FUTURE VERSION !!
+ I WAIT FEEDBACK at mail info@winimage.com
+ Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
+@@ -111,7 +111,7 @@
+ tm_unz tmu_date;
+ } unz_file_info;
+
+-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
++extern int ZEXPORT unzStringFileNameCompare _Z_OF ((const char* fileName1,
+ const char* fileName2,
+ int iCaseSensitivity));
+ /*
+@@ -124,7 +124,7 @@
+ */
+
+
+-extern unzFile ZEXPORT unzOpen OF((const char *path));
++extern unzFile ZEXPORT unzOpen _Z_OF((const char *path));
+ /*
+ Open a Zip file. path contain the full pathname (by example,
+ on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
+@@ -135,14 +135,14 @@
+ of this unzip package.
+ */
+
+-extern int ZEXPORT unzClose OF((unzFile file));
++extern int ZEXPORT unzClose _Z_OF((unzFile file));
+ /*
+ Close a ZipFile opened with unzipOpen.
+ If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+ these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+ return UNZ_OK if there is no problem. */
+
+-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
++extern int ZEXPORT unzGetGlobalInfo _Z_OF((unzFile file,
+ unz_global_info *pglobal_info));
+ /*
+ Write info about the ZipFile in the *pglobal_info structure.
+@@ -150,7 +150,7 @@
+ return UNZ_OK if there is no problem. */
+
+
+-extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
++extern int ZEXPORT unzGetGlobalComment _Z_OF((unzFile file,
+ char *szComment,
+ uLong uSizeBuf));
+ /*
+@@ -163,20 +163,20 @@
+ /***************************************************************************/
+ /* Unzip package allow you browse the directory of the zipfile */
+
+-extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
++extern int ZEXPORT unzGoToFirstFile _Z_OF((unzFile file));
+ /*
+ Set the current file of the zipfile to the first file.
+ return UNZ_OK if there is no problem
+ */
+
+-extern int ZEXPORT unzGoToNextFile OF((unzFile file));
++extern int ZEXPORT unzGoToNextFile _Z_OF((unzFile file));
+ /*
+ Set the current file of the zipfile to the next file.
+ return UNZ_OK if there is no problem
+ return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+ */
+
+-extern int ZEXPORT unzLocateFile OF((unzFile file,
++extern int ZEXPORT unzLocateFile _Z_OF((unzFile file,
+ const char *szFileName,
+ int iCaseSensitivity));
+ /*
+@@ -189,7 +189,7 @@
+ */
+
+
+-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
++extern int ZEXPORT unzGetCurrentFileInfo _Z_OF((unzFile file,
+ unz_file_info *pfile_info,
+ char *szFileName,
+ uLong fileNameBufferSize,
+@@ -215,20 +215,20 @@
+ from it, and close it (you can close it before reading all the file)
+ */
+
+-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
++extern int ZEXPORT unzOpenCurrentFile _Z_OF((unzFile file));
+ /*
+ Open for reading data the current file in the zipfile.
+ If there is no error, the return value is UNZ_OK.
+ */
+
+-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
++extern int ZEXPORT unzCloseCurrentFile _Z_OF((unzFile file));
+ /*
+ Close the file in zip opened with unzOpenCurrentFile
+ Return UNZ_CRCERROR if all the file was read but the CRC is not good
+ */
+
+
+-extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
++extern int ZEXPORT unzReadCurrentFile _Z_OF((unzFile file,
+ voidp buf,
+ unsigned len));
+ /*
+@@ -242,17 +242,17 @@
+ (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+ */
+
+-extern z_off_t ZEXPORT unztell OF((unzFile file));
++extern z_off_t ZEXPORT unztell _Z_OF((unzFile file));
+ /*
+ Give the current position in uncompressed data
+ */
+
+-extern int ZEXPORT unzeof OF((unzFile file));
++extern int ZEXPORT unzeof _Z_OF((unzFile file));
+ /*
+ return 1 if the end of file was reached, 0 elsewhere
+ */
+
+-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
++extern int ZEXPORT unzGetLocalExtrafield _Z_OF((unzFile file,
+ voidp buf,
+ unsigned len));
+ /*
diff --git a/games-rpg/xu4/metadata.xml b/games-rpg/xu4/metadata.xml
new file mode 100644
index 000000000000..4bc2f4a79c26
--- /dev/null
+++ b/games-rpg/xu4/metadata.xml
@@ -0,0 +1,11 @@
+<?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>
+ <upstream>
+ <remote-id type="sourceforge">xu4</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-rpg/xu4/xu4-0.9-r1.ebuild b/games-rpg/xu4/xu4-0.9-r1.ebuild
new file mode 100644
index 000000000000..69fd4ed87d0b
--- /dev/null
+++ b/games-rpg/xu4/xu4-0.9-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils
+
+DESCRIPTION="A remake of the computer game Ultima IV"
+HOMEPAGE="http://xu4.sourceforge.net/"
+SRC_URI="mirror://sourceforge/xu4/${P}.tar.gz
+ mirror://sourceforge/xu4/ultima4-1.01.zip
+ mirror://sourceforge/xu4/u4upgrad.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/libxml2
+ media-libs/libsdl[sound,video]
+ media-libs/sdl-mixer[timidity]"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}/u4
+
+src_unpack() {
+ # xu4 will read the data files right out of the zip files
+ # but we want the docs from the original.
+ unpack ${P}.tar.gz
+ cp "${DISTDIR}"/{ultima4-1.01.zip,u4upgrad.zip} . || die
+ cd "${WORKDIR}" || die
+ mv ultima4-1.01.zip ultima4.zip || die
+ mkdir u4-dos || die
+ cd u4-dos || die
+ unzip -q ../ultima4.zip || die
+}
+
+PATCHES=(
+ "${FILESDIR}/${P}-ldflags.patch"
+ "${FILESDIR}/${PV}-savegame.patch"
+ "${FILESDIR}/${P}-warnings.patch"
+ "${FILESDIR}/${P}-zip.patch"
+)
+src_prepare() {
+ default
+
+ sed -i \
+ -e "s:/usr/local/lib/u4:/usr/$(get_libdir)/u4:" src/u4file.c \
+ || die
+ sed -i \
+ -e 's:-Wall:$(E_CFLAGS):' src/Makefile \
+ || die
+}
+
+src_compile() {
+ emake -C src \
+ DEBUGCFLAGS= \
+ E_CFLAGS="${CFLAGS}" \
+ bindir="/usr/bin" \
+ datadir="/usr/share" \
+ libdir="/usr/$(get_libdir)"
+}
+
+src_install() {
+ emake -C src \
+ DEBUGCFLAGS= \
+ E_CFLAGS="${CFLAGS}" \
+ bindir="${D}/usr/bin" \
+ datadir="${D}/usr/share" \
+ libdir="${D}/usr/$(get_libdir)" \
+ install
+ dodoc AUTHORS README doc/*txt "${WORKDIR}/u4-dos/ULTIMA4/"*TXT
+ insinto "/usr/$(get_libdir)/u4"
+ doins "${WORKDIR}/"*zip
+}
diff --git a/games-rpg/xu4/xu4-0.9.ebuild b/games-rpg/xu4/xu4-0.9.ebuild
new file mode 100644
index 000000000000..3822179cfa59
--- /dev/null
+++ b/games-rpg/xu4/xu4-0.9.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils games
+
+DESCRIPTION="A remake of the computer game Ultima IV"
+HOMEPAGE="http://xu4.sourceforge.net/"
+SRC_URI="mirror://sourceforge/xu4/${P}.tar.gz
+ mirror://sourceforge/xu4/ultima4-1.01.zip
+ mirror://sourceforge/xu4/u4upgrad.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 x86"
+IUSE=""
+
+RDEPEND="dev-libs/libxml2
+ media-libs/sdl-mixer[timidity]
+ media-libs/libsdl[sound,video]"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}/u4
+
+src_unpack() {
+ # xu4 will read the data files right out of the zip files
+ # but we want the docs from the original.
+ unpack ${P}.tar.gz
+ cp "${DISTDIR}"/{ultima4-1.01.zip,u4upgrad.zip} . || die
+ cd "${WORKDIR}"
+ mv ultima4-1.01.zip ultima4.zip
+ mkdir u4-dos
+ cd u4-dos
+ unzip -q ../ultima4.zip || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV}-savegame.patch" \
+ "${FILESDIR}"/${P}-ldflags.patch \
+ "${FILESDIR}"/${P}-zip.patch \
+ "${FILESDIR}"/${P}-warnings.patch
+ sed -i \
+ -e "s:/usr/local/lib/u4:$(games_get_libdir)/u4:" src/u4file.c \
+ || die
+ sed -i \
+ -e 's:-Wall:$(E_CFLAGS):' src/Makefile \
+ || die
+}
+
+src_compile() {
+ emake -C src \
+ DEBUGCFLAGS= \
+ E_CFLAGS="${CFLAGS}" \
+ bindir="${GAMES_BINDIR}" \
+ datadir="/usr/share" \
+ libdir="$(games_get_libdir)"
+}
+
+src_install() {
+ emake -C src \
+ DEBUGCFLAGS= \
+ E_CFLAGS="${CFLAGS}" \
+ bindir="${D}${GAMES_BINDIR}" \
+ datadir="${D}/usr/share" \
+ libdir="${D}$(games_get_libdir)" \
+ install
+ dodoc AUTHORS README doc/*txt "${WORKDIR}/u4-dos/ULTIMA4/"*TXT
+ insinto "$(games_get_libdir)/u4"
+ doins "${WORKDIR}/"*zip
+ prepgamesdirs
+}