---- ForceSelectWin.cpp.orig 2012-08-20 17:35:01.000000000 +0200
-+++ ForceSelectWin.cpp 2012-08-20 17:47:19.000000000 +0200
+--- a/ForceSelectWin.cpp.orig 2012-08-20 17:35:01.000000000 +0200
++++ b/ForceSelectWin.cpp 2012-08-20 17:47:19.000000000 +0200
@@ -1596,15 +1596,15 @@
fs::directory_iterator directoryEnd; // default construction yields past-the-end\r
for (fs::directory_iterator iter(sourcePath); iter != directoryEnd; ++iter) {\r
\r
fs::copy_file(*iter, destPath.string() + "/" + destFile);\r
}\r
---- Main.cpp.orig 2012-08-20 17:48:13.000000000 +0200
-+++ Main.cpp 2012-08-20 17:50:51.000000000 +0200
+--- a/Main.cpp.orig 2012-08-20 17:48:13.000000000 +0200
++++ b/Main.cpp 2012-08-20 17:50:51.000000000 +0200
@@ -339,12 +339,6 @@
\r
void GameInit(char* argv[]) {\r
\r
FindHomePath();\r
LoadSettings(argv);\r
---- Menu_Base.cpp.orig 2012-08-20 17:51:05.000000000 +0200
-+++ Menu_Base.cpp 2012-08-20 17:52:15.000000000 +0200
+--- a/Menu_Base.cpp.orig 2012-08-20 17:51:05.000000000 +0200
++++ b/Menu_Base.cpp 2012-08-20 17:52:15.000000000 +0200
@@ -206,7 +206,7 @@
\r
fs::directory_iterator directoryEnd; // default construction yields past-the-end\r
\r
if (filename.find('.') == filename.npos)\r
continue;\r
---- Stuff.cpp.orig 2012-08-20 17:52:36.000000000 +0200
-+++ Stuff.cpp 2012-08-20 17:53:11.000000000 +0200
+--- a/Stuff.cpp.orig 2012-08-20 17:52:36.000000000 +0200
++++ b/Stuff.cpp 2012-08-20 17:53:11.000000000 +0200
@@ -657,7 +657,7 @@
fs::directory_iterator directoryEnd; // default construction yields past-the-end\r
for (fs::directory_iterator iter(tempPath); iter != directoryEnd; ++iter) {\r
---- Main.cpp.old 2006-07-28 00:04:46.000000000 +0200
-+++ Main.cpp 2006-07-28 00:08:28.000000000 +0200
+--- a/Main.cpp.old 2006-07-28 00:04:46.000000000 +0200
++++ b/Main.cpp 2006-07-28 00:08:28.000000000 +0200
@@ -184,7 +184,7 @@
#ifndef WIN32\r
string settingsPath = userHomePath + "settings.dat";\r
---- JSDL.cpp.old 2016-01-04 10:42:56.404316856 +0100
-+++ JSDL.cpp 2016-01-04 10:51:16.744255312 +0100
+--- a/JSDL.cpp.old 2016-01-04 10:42:56.404316856 +0100
++++ b/JSDL.cpp 2016-01-04 10:51:16.744255312 +0100
@@ -47,14 +47,14 @@
if (!globalSettings.batch) {\r
if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO) == -1) {\r
---- Makefile.old 2009-02-11 22:21:26.000000000 +0100
-+++ Makefile 2009-02-11 22:20:58.000000000 +0100
+--- a/Makefile.old 2009-02-11 22:21:26.000000000 +0100
++++ b/Makefile 2009-02-11 22:20:58.000000000 +0100
@@ -6,12 +6,11 @@
# James Gregory and Everton da Silva Marques <evertonsm@yahoo.com.br>
#
--- /dev/null
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic readme.gentoo-r1
+
+DESCRIPTION="Multiplayer AI script based strategy game"
+HOMEPAGE="http://galaxyhack.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+ mirror://gentoo/${PN}.png"
+
+LICENSE="GPL-2 galaxyhack"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ media-libs/libsdl[video]
+ media-libs/sdl-image[png]
+ media-libs/sdl-mixer[mod,vorbis]
+ >=dev-libs/boost-1.34
+"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}/src"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+Settings will default to those found in
+/usr/share/galaxyhack/settings.dat
+Per user settings can be specified by creating
+~/.galaxyhack/settings.dat
+
+Additional user submitted fleets can be downloaded from
+http://galaxyhack.sourceforge.net/viewfleets.php
+"
+
+src_prepare() {
+ default
+ edos2unix Makefile
+ eapply \
+ "${FILESDIR}"/${P}-destdirs.patch \
+ "${FILESDIR}"/${P}-boost.patch \
+ "${FILESDIR}"/${P}-gcc43.patch \
+ "${FILESDIR}"/${P}-boost-1.50.patch \
+ "${FILESDIR}"/${P}-format.patch \
+ "${FILESDIR}"/${P}-gentoo.patch
+ sed -i "s:@GAMES_DATADIR@:/usr/share:" \
+ Main.cpp || die
+ sed -i "/Base data path/s:pwd:/usr/share/${PN}:" \
+ ../settings.dat || die
+}
+
+src_install() {
+ dobin "${PN}"
+ cd ..
+ insinto /usr/share/${PN}
+ doins -r fleets gamedata graphics music standardpictures \
+ settings.dat
+ dodoc readme.txt
+ readme.gentoo_create_doc
+ doicon "${DISTDIR}"/${PN}.png
+ make_desktop_entry ${PN} GalaxyHack
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}