summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Harmon <russ@eatnumber1.com>2010-02-13 15:38:58 -0500
committerRussell Harmon <russ@eatnumber1.com>2010-02-14 01:56:03 -0500
commit9d957154f2bbd28323d48af49710e65710ab11f0 (patch)
tree356fbccb44d07649c1f5016f0f38b8acd7e3e7ae
parentAdd multilib fmod. (diff)
downloadeatnumber1-9d957154f2bbd28323d48af49710e65710ab11f0.tar.gz
eatnumber1-9d957154f2bbd28323d48af49710e65710ab11f0.tar.bz2
eatnumber1-9d957154f2bbd28323d48af49710e65710ab11f0.zip
Add dwarf fortress ebuild.
-rw-r--r--.gitignore1
-rw-r--r--games-roguelike/dwarf-fortress/dwarf-fortress-scm.ebuild119
-rw-r--r--games-roguelike/dwarf-fortress/files/dwarf-fortress-scm_gentoo.patch73
3 files changed, 193 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index cc4bbd3..8bc8c96 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.nfs*
cross-*
+.*.swp
diff --git a/games-roguelike/dwarf-fortress/dwarf-fortress-scm.ebuild b/games-roguelike/dwarf-fortress/dwarf-fortress-scm.ebuild
new file mode 100644
index 0000000..4b05640
--- /dev/null
+++ b/games-roguelike/dwarf-fortress/dwarf-fortress-scm.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=2
+EGIT_REPO_URI="git://github.com/Baughn/Dwarf-Fortress--libgraphics-.git"
+inherit games eutils git multilib
+
+DESCRIPTION="Dwarf Fortress is a single-player fantasy game. You can control a dwarven outpost or an adventurer in a randomly generated, persistent world."
+HOMEPAGE="http://www.bay12games.com/dwarves"
+SRC_URI=""
+
+LICENSE=""
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc"
+
+DEPEND="
+ amd64? (
+ media-libs/fmod[multilib]
+ app-emulation/emul-linux-x86-soundlibs
+ app-emulation/emul-linux-x86-sdl
+ app-emulation/emul-linux-x86-baselibs
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !amd64? (
+ media-libs/fmod
+ )
+ media-libs/libsndfile
+ media-libs/openal
+ virtual/glu
+ dev-libs/boost
+ media-libs/sdl-image
+ media-libs/libsdl
+ sys-libs/zlib
+ sys-libs/ncurses
+ dev-util/scons"
+RDEPEND="${DEPEND}
+ sys-libs/glibc
+ amd64? (
+ app-emulation/emul-linux-x86-gtklibs
+ )
+ !amd64? (
+ x11-libs/gtk+:2
+ dev-libs/atk
+ x11-libs/pango
+ dev-libs/glib
+ x11-libs/cairo
+ media-libs/freetype
+ virtual/opengl
+ x11-libs/libXinerama
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXcursor
+ x11-libs/libXcomposite
+ x11-libs/libXext
+ x11-libs/libXdamage
+ x11-libs/libXfixes
+ x11-libs/pixman
+ media-libs/libpng
+ x11-libs/libXrender
+ x11-libs/libX11
+ x11-libs/libxcb
+ x11-libs/libXau
+ x11-libs/libXdmcp
+ dev-libs/expat
+ x11-libs/libXxf86vm
+ x11-libs/libdrm
+ )"
+
+pkg_setup() {
+ if use amd64; then
+ if ! has_multilib_profile; then
+ eerror "You must be on a multilib profile to use dwarf fortress!"
+ die "No multilib profile"
+ fi
+ multilib_toolchain_setup x86
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}_gentoo.patch"
+}
+
+src_compile() {
+ scons || die
+}
+
+src_install() {
+ insinto "${GAMES_SYSCONFDIR}"
+ cp -rl data/init "${T}"/dwarfort || die
+ doins -r "${T}"/dwarfort || die
+ rm -r "${T}"/dwarfort || die
+
+ keepdir "${GAMES_STATEDIR}"/dwarfort/save "${GAMES_STATEDIR}"/dwarfort/movies "${GAMES_STATEDIR}"/dwarfort/objects || die
+
+ local dir="${GAMES_PREFIX_OPT}/${PN}"
+ insinto "$dir"
+ doins -r raw data || die
+ exeinto "$dir"
+ doexe dwarfort.exe || die
+
+ into "${GAMES_PREFIX}"
+ dolib libs/libgraphics.so libs/libboost_regex.so.1.35.0 || die
+ dodoc README.linux *.txt || die
+
+ dosym "${GAMES_SYSCONFDIR}"/dwarfort "$dir"/data/init || die
+ dosym "${GAMES_STATEDIR}"/dwarfort/save "$dir"/data/save || die
+ dosym "${GAMES_STATEDIR}"/dwarfort/movies "$dir"/data/movies || die
+ dosym "${GAMES_STATEDIR}"/dwarfort/objects "$dir"/data/objects || die
+
+ games_make_wrapper dwarfort "$dir"/dwarfort.exe "$dir"
+
+ prepgamesdirs
+
+ chmod -R g+w "${D}/${GAMES_STATEDIR}"/dwarfort || die
+ chmod g+w "${D}/${dir}/data/index" || die
+ chmod -R g+w "${D}/${dir}/data"/{announcement,dipscript,help} || die
+}
diff --git a/games-roguelike/dwarf-fortress/files/dwarf-fortress-scm_gentoo.patch b/games-roguelike/dwarf-fortress/files/dwarf-fortress-scm_gentoo.patch
new file mode 100644
index 0000000..56dd0c5
--- /dev/null
+++ b/games-roguelike/dwarf-fortress/files/dwarf-fortress-scm_gentoo.patch
@@ -0,0 +1,73 @@
+diff --git a/g_src/SConscript b/g_src/SConscript
+index b0e6bd1..edfc04b 100644
+--- a/g_src/SConscript
++++ b/g_src/SConscript
+@@ -1,6 +1,7 @@
+ # -*- mode: python -*-
+ from sys import platform
+ import os
++import SCons.Util
+
+ src_dll = ["basics.cpp","command_line.cpp","enabler_sdl.cpp","files.cpp",
+ "find_files_posix.cpp","graphics.cpp","init.cpp","interface.cpp",
+@@ -17,42 +18,41 @@ profile = False
+ # Propagate PATH. We'll just take our chances with non-repeatable builds.
+ env = Environment(ENV = {'PATH' : os.environ['PATH']})
+
++if optimize:
++ env["CCFLAGS"]+=["-O3"]
++
++if os.environ.has_key('CC'):
++ env['CC'] = os.environ['CC']
++if os.environ.has_key('CFLAGS'):
++ env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
++if os.environ.has_key('CXX'):
++ env['CXX'] = os.environ['CXX']
++if os.environ.has_key('CXXFLAGS'):
++ env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
++if os.environ.has_key('LDFLAGS'):
++ env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
++
+ # Init variables, and make sure they're around for appending to
+ # These variables are the ones used by the actual compilation. We construct
+ # them from ccflags/libs in varying ways depending on which compiler is used,
+ # below.
+-env['CPPPATH']=["#g_src/fmodexinclude"]
+ env['CCFLAGS']=["-Dunix"]
+-env['LIBS']=["ncursesw", "SDL_image", "boost_regex"]
++env['LIBS']=["ncursesw", "SDL_image"]
+ # If there's a library in the libs folder it will get linked over a system one.
+-env['LIBPATH']=["#libs"]
+-env['LINKFLAGS']=["-Wl,--as-needed",'-Wl,-rpath=\$$ORIGIN/libs','-Wl,-static','-lSDL','-lSDL_image','-lsndfile','-Wl,-Bdynamic']
+-
+-# GLEW
+-env["CPPPATH"].append('#g_src/glext')
+-env["CCFLAGS"].append('-DGLEW_STATIC') # Should only be needed on windows, but can't hurt.
++env['LINKFLAGS']=["-Wl,--as-needed",'-Wl,-rpath=\$$ORIGIN/libs','-lSDL','-lSDL_image','-lsndfile','-lz']
+
+ # Generic unix, including Linux
+-env['ASFLAGS']="--32"
+-env['LINKFLAGS'].append("-m32")
+-env["CCFLAGS"].append("-m32")
+ env.ParseConfig('pkg-config gtk+-2.0 --cflags --libs')
+ env.ParseConfig('pkg-config openal --cflags --libs')
+-env.ParseConfig('pkg-config sndfile --static --cflags')
+-env.ParseConfig('pkg-config sdl --static --cflags')
+-env.ParseConfig('pkg-config zlib --cflags --libs')
++env.ParseConfig('pkg-config sndfile --cflags')
++env.ParseConfig('pkg-config sdl --cflags')
+ env.ParseConfig('pkg-config glu --cflags --libs')
+
+-
+ if profile:
+ env["CCFLAGS"].append("-pg")
+ env['LINKFLAGS'].append("-pg")
+
+-if optimize:
+- env["CCFLAGS"]+=["-O3","-march=pentium3","-mfpmath=sse"]
+-
+ if debug:
+- env["CCFLAGS"].append("-ggdb")
+ env["CCFLAGS"].append("-DDEBUG")
+
+ # Finally, do the build