summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreroen <eroen@occam.eroen.eu>2014-07-14 14:07:17 +0200
committereroen <eroen@occam.eroen.eu>2014-08-07 20:06:08 +0200
commit25c4fd796e6c76962e48622b55221ae774fc06e8 (patch)
tree9c01fcd6e5e6a4c09e5c0b9d2353a70903986f61 /games-simulation
parentopenmw-0.31.0 - bump (diff)
downloaderoen-25c4fd796e6c76962e48622b55221ae774fc06e8.tar.gz
eroen-25c4fd796e6c76962e48622b55221ae774fc06e8.tar.bz2
eroen-25c4fd796e6c76962e48622b55221ae774fc06e8.zip
dwarffortress-40.03
- New slot - Move state files to $HOME with launcher script.
Diffstat (limited to 'games-simulation')
-rw-r--r--games-simulation/dwarffortress/Manifest1
-rw-r--r--games-simulation/dwarffortress/dwarffortress-40.03.ebuild80
-rw-r--r--games-simulation/dwarffortress/files/dwarffortress.sh69
-rw-r--r--games-simulation/dwarffortress/notes.mkd9
4 files changed, 159 insertions, 0 deletions
diff --git a/games-simulation/dwarffortress/Manifest b/games-simulation/dwarffortress/Manifest
index 98f144b..2c3f3ae 100644
--- a/games-simulation/dwarffortress/Manifest
+++ b/games-simulation/dwarffortress/Manifest
@@ -1 +1,2 @@
DIST df_34_11_linux.tar.bz2 11587360 SHA256 720eda6c83e72fb1212a8eead0c39989ab5387bcf42dc4028a14e8df5bdd69e2 SHA512 3e270b53aa0ad0abcd3d435dc7da765b08e450de8cf6e5402f40e8dbd20ec2001cf0d59c20a58e3a65dd661260e92123e037e25606d0fece1d354ccfbe454438 WHIRLPOOL caa0e3ee4d521e4399ca5f203c6de4d7180eb89bde5fd969ef380ebc7a2f6bc57dfe6d44b32099314b8d4ca698726bcd712b7dd6c245177180d322e60887b8c4
+DIST df_40_03_linux.tar.bz2 12687273 SHA256 5d20f22621704354d663e6f335b51f4c90956c85c336e89d18d7dad80ec9e9ed SHA512 26a5eee7c7e2d52c97b814dd753fadb19a86b2992475662aa078ae9fd49a50e45d60757ed6f36b71bd7f4a85c23186cad7da2f402163937c8a2c28f721124618 WHIRLPOOL 59eae5c26396884da922f90a287fee44e3a65240d2c64d7f556bd8bf79547e1d5fad14578128cbcbbc760f594dd6cfbc616945b45a2b979fe064a32539279090
diff --git a/games-simulation/dwarffortress/dwarffortress-40.03.ebuild b/games-simulation/dwarffortress/dwarffortress-40.03.ebuild
new file mode 100644
index 0000000..3ce5fd9
--- /dev/null
+++ b/games-simulation/dwarffortress/dwarffortress-40.03.ebuild
@@ -0,0 +1,80 @@
+# By eroen, 2014
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# $Header: $
+
+EAPI=5
+
+inherit eutils games
+
+DESCRIPTION="Part roguelike, part city-building game set in a procedurally generated high fantasy universe."
+HOMEPAGE="http://www.bay12games.com/dwarves/"
+SRC_URI="http://www.bay12games.com/dwarves/df_${PV//./_}_linux.tar.bz2"
+
+S=${WORKDIR}/df_linux
+
+# DF: allows unmodified redistribution free of charge
+# libgraphics: BSD
+LICENSE="all-rights-reserved BSD"
+SLOT=${PV}
+KEYWORDS="-* ~amd64" # ~x86
+IUSE=""
+
+LIBGRAPHICS_RDEPEND="
+ dev-libs/glib[abi_x86_32]
+ virtual/glu[abi_x86_32]
+ =media-libs/libsdl-1*[abi_x86_32]
+ media-libs/sdl-image[abi_x86_32]
+ media-libs/sdl-ttf[abi_x86_32]
+ x11-libs/gtk+:2[abi_x86_32]
+ "
+RDEPEND="
+ ${LIBGRAPHICS_RDEPEND}
+ =media-libs/libsdl-1*[abi_x86_32]
+ >=sys-devel/gcc-4.5
+ "
+DEPEND=""
+
+MY_PREFIX=${GAMES_PREFIX_OPT}/${P}
+DF_DIR='${HOME}'/.${P}
+
+QA_PREBUILT="${MY_PREFIX#/}/libs/*"
+
+src_prepare() {
+ # libgcc: GLIBC_2.2.4 -> gcc-4.5 ?
+ # libstdc++: GLIBCXX_3.4.14 -> gcc-4.5 ?
+ rm -f libs/{libgcc_s.so.1,libstdc++.so.6} || die
+
+ cp "${FILESDIR}"/dwarffortress.sh "${T}"/${P}
+ sed -e "s:@@DF_DIR@@:${DF_DIR}:" \
+ -e "s:@@DATA_PREFIX@@:${MY_PREFIX}:" \
+ -e '/PRELOAD_LIBZ/s/false/true/' \
+ -i "${T}"/${P} || die
+
+ # For raws.
+ epatch_user
+}
+
+src_install() {
+ dodoc README.linux "command line.txt" "file changes.txt" readme.txt "release notes.txt"
+ insinto "${MY_PREFIX}"
+ doins -r data/ libs/ raw/
+ dogamesbin "${T}"/${P}
+ prepgamesdirs
+ fperms 755 "${MY_PREFIX}"/libs/Dwarf_Fortress
+}
+
+pkg_postinst() {
+ elog "The ${P} wrapper script will copy and symlink required"
+ elog "files to ${DF_DIR} before launching ${PN}."
+ elog "Before making modifications to the symlinked files, replace the links"
+ elog "with their targets."
+ elog
+ ewarn "${PN} versions from 40.03 are unable to import saves from"
+ ewarn "versions 40.01 and 40.02."
+ ewarn
+ games_pkg_postinst
+}
diff --git a/games-simulation/dwarffortress/files/dwarffortress.sh b/games-simulation/dwarffortress/files/dwarffortress.sh
new file mode 100644
index 0000000..c06a133
--- /dev/null
+++ b/games-simulation/dwarffortress/files/dwarffortress.sh
@@ -0,0 +1,69 @@
+#!/bin/sh
+# Launcher script for running dwarffortress-40.03 on Gentoo
+# By eroen, 2014
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# DF expects to find its resources in the CWD, and it also expects write access
+# to some of them. This script sets up a minimal CWD within $DF_DIR by
+# symlinking and copying from $DATA_PREFIX, then executes DF.
+
+if [ "--help" == "${1}" ] || [ "-h" == "${1}" ]; then
+ echo "Usage: ${0} [OPTION]"
+ echo " -h, --help Print this message and exit."
+ echo " -i, --install Only install workdir files to \$HOME, do not launch DF."
+ echo
+ echo "This launcher script is specific to Gentoo Linux."
+ echo "Please report any issues to the package maintainer."
+
+ exit 0
+fi
+
+DF_DIR="@@DF_DIR@@"
+DATA_PREFIX="@@DATA_PREFIX@@"
+
+if ! [ -d "${DF_DIR}" ]; then
+ echo "Creating and populating ${DF_DIR} ..."
+ mkdir -p "${DF_DIR}"
+
+ for item in data data/save; do
+ echo "Creating ${item}/ ..."
+ mkdir -p "${DF_DIR}/${item}"
+ done
+
+ # 40.03:
+ # open("data/announcement/fortressintro", O_RDWR|O_LARGEFILE
+ # open("data/dipscript/dwarf_liaison", O_RDWR|O_LARGEFILE
+ # open("data/help/main", O_RDWR|O_LARGEFILE)
+ # data/init holds user configuration files
+ # open("data/index", O_RDWR|O_LARGEFILE)
+ # open("data/movies/last_record.cmv", O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE, 0666)
+ for item in data/announcement data/dipscript data/help data/init data/index data/movies; do
+ echo "Copying ${item} ..."
+ cp -R "${DATA_PREFIX}/${item}" "${DF_DIR}/${item}"
+ done
+
+ for item in data/{art,initial_movies,shader.fs,shader.vs,sound,speech} raw; do
+ echo "Symlinking ${item} ..."
+ ln -s "${DATA_PREFIX}/${item}" "${DF_DIR}/${item}"
+ done
+
+ echo "${DF_DIR} populated, launching..."
+else
+ echo "${DF_DIR} already exists, not populating..."
+fi
+
+# Exit early if only installing.
+if [ "--install" == "${1}" ] || [ "-i" == "${1}" ]; then
+ exit 0
+fi
+
+# 40.03: There seems to be an issue with prebuilt libgraphics
+if false; then # PRELOAD_LIBZ
+ export LD_PRELOAD=${LD_PRELOAD}:/lib32/libz.so.1
+fi
+
+cd "${DF_DIR}"
+exec "${DATA_PREFIX}"/libs/Dwarf_Fortress
diff --git a/games-simulation/dwarffortress/notes.mkd b/games-simulation/dwarffortress/notes.mkd
new file mode 100644
index 0000000..15e9288
--- /dev/null
+++ b/games-simulation/dwarffortress/notes.mkd
@@ -0,0 +1,9 @@
+## 40.03
+- Fails to run with pre-built libgraphics unless zlib is preloaded.
+- "Broken Unicode" warnings for some keybindings.[1]
+
+1: <http://www.bay12games.com/dwarves/mantisbt/view.php?id=6558>
+
+### Todo:
+- Split out libgraphics.
+- More granular check for installed folders.