commit 4bf58b2e5238109a622f215be0efeff3b417f1f7
Author: Ben Rosser <rosser.bjr(a)gmail.com>
Date: Wed Feb 21 14:49:06 2018 -0500
Initial import (#4639).
.gitignore | 6 +
dfhack-run | 51 +++++
dfhack.pc.in | 10 +
dfhack.spec | 397 +++++++++++++++++++++++++++++++++++
git-describe.h | 5 +
isoworld-cmath-include.patch | 18 ++
isoworld-external-allegro-agui.patch | 23 ++
prepare-dfhack-release | 69 ++++++
sources | 6 +
9 files changed, 585 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..bba1d9b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,6 @@
+/dfhack-0.44.05-r1.tar.gz
+/dfhack-clsocket-0f0ad78.tar.gz
+/dfhack-df-structures-40da723.tar.gz
+/dfhack-isoworld-3ff3f05.tar.gz
+/dfhack-scripts-8d079a5.tar.gz
+/dfhack-stonesense-455b51a.tar.gz
diff --git a/dfhack-run b/dfhack-run
new file mode 100644
index 0000000..5408fc4
--- /dev/null
+++ b/dfhack-run
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
+#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
+
+pkgname=dwarffortress
+prefix=/usr
+libdir=lib
+
+# Check for user DF directory
+
+if [[ ! -d "$HOME/.$pkgname" ]]; then
+ mkdir -p "$HOME/.$pkgname/data"
+ ln -s ${prefix}/share/"$pkgname"/raw "$HOME/.$pkgname/raw"
+ ln -s ${prefix}/libexec/"$pkgname" "$HOME/.$pkgname/libs"
+ cp -rn ${prefix}/share/"$pkgname"/data/init
"$HOME/.$pkgname/data/init"
+fi
+
+# Check for dfhack directory (currently, opt/dfhack).
+
+hack_pkgname=dfhack
+
+if [[ ! -d "$HOME/.$pkgname/hack" ]]; then
+# Link libraries out of libdir.
+ ln -sf ${libdir}/"$hack_pkgname"/hack "$HOME/.$pkgname/hack"
+ ln -sf ${libdir}/"$hack_pkgname"/dfhack "$HOME/.$pkgname/dfhack"
+ ln -sf ${libdir}/"$hack_pkgname"/dfhack-run
"$HOME/.$pkgname/dfhack-run"
+
+# Link and copy configuration out of datadir.
+ ln -sf ${prefix}/share/"$hack_pkgname"/dfhack.init-example
"$HOME/.$pkgname/dfhack.init-example"
+ cp -r ${prefix}/share/"$hack_pkgname"/dfhack-config
"$HOME/.$pkgname/dfhack-config"
+
+fi
+
+# stonesense and dfhack can be installed independendently.
+if [[ ! -d "$HOME/.${pkgname}/stonesense" ]]; then
+ if [ -d "${prefix}/share/${hack_pkgname}/stonesense" ]; then
+ ln -s ${prefix}/share/"$hack_pkgname"/stonesense
"$HOME/.$pkgname/stonesense"
+ fi
+fi
+
+# Copy over bits of DF.
+
+if [[ ! -f "$HOME/.dwarffortress/.stockpile" ]]; then
+ for link in announcement art dipscript help index initial_movies movies shader.fs
shader.vs sound speech; do
+ cp -r ${prefix}/share/"$pkgname"/data/$link
"$HOME/.$pkgname/data/$link"
+ done
+fi
+
+cd "$HOME/.$pkgname"
+exec ./dfhack "$@"
diff --git a/dfhack.pc.in b/dfhack.pc.in
new file mode 100644
index 0000000..2ff7bf4
--- /dev/null
+++ b/dfhack.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: dfhack
+Version: @version@
+Description: Dwarf Fortress Memory Hacking Library
+Libs: -L${libdir}/dfhack/hack/ -ldfhack -ldfhack-version
+Cflags: -I${includedir}/dfhack/dfhack -I${includedir}/dfhack/proto
-I${includedir}/dfhack/protobuf -I${includedir}/dfhack/lua
diff --git a/dfhack.spec b/dfhack.spec
new file mode 100644
index 0000000..0613770
--- /dev/null
+++ b/dfhack.spec
@@ -0,0 +1,397 @@
+# To update dfhack to a new release, first run "prepare-dfhack-release
RELEASE"
+# where RELEASE is the upstream "dfversion-hackrelease" string. e.g.
0.44.05-r1.
+# This gets the right submodule commits (which should be pasted below) and
+# generates Source3 (git-describe.h).
+
+# Autogenerate commit lines from prepare-dfhack-release:
+
+# dfhack submodule: depends/clsocket
+%global commit10 0f0ad78c4fd429caacd0694b5c868dbeacea16b6
+# dfhack submodule: library/xml
+%global commit11 40da7231a0114fe3420d475961b08826f64fbf79
+# dfhack submodule: plugins/isoworld
+%global commit12 3ff3f05da53077dd9e67c1eef672427a2bfd95ea
+# dfhack submodule: plugins/stonesense
+%global commit13 455b51aab7a93095a775285782635cfc17ac651a
+# dfhack submodule: scripts
+%global commit14 8d079a59122d9ba72ce9c0f7687402a343d09bc7
+
+# End autogenerated commit lines.
+
+# Shortcommits:
+%global shortcommit10 %(c=%{commit10}; echo ${c:0:7})
+%global shortcommit11 %(c=%{commit11}; echo ${c:0:7})
+%global shortcommit12 %(c=%{commit12}; echo ${c:0:7})
+%global shortcommit13 %(c=%{commit13}; echo ${c:0:7})
+%global shortcommit14 %(c=%{commit14}; echo ${c:0:7})
+
+# dfhack version string.
+%global dfversion 0.44.05
+%global hackrelease r1
+
+# Define dfhack build architecture.
+%global dfhack_arch 32
+%ifarch x86_64
+%global dfhack_arch 64
+%endif
+
+Name: dfhack
+Version: %{dfversion}
+Release: 2.%{hackrelease}%{?dist}
+Summary: Memory hacking library for Dwarf Fortress and a set of tools that use it
+
+# It'd be nice if we could unbundle some of these things, but I suspect it won't
happen.
+# Licensing explained in LICENSE.rst quite thoroughly, though. Thanks upstream!
+License: zlib and MIT and BSD and CC-BY-SA
+URL:
https://github.com/DFHack/dfhack
+
+# Main dfhack archive.
+Source0:
https://github.com/DFHack/dfhack/archive/%{dfversion}-%{hackrelease}/dfha...
+
+# Script to actually *run* dfhack, adapted from Arch.
+# (gets installed as "dfhack-run", "dfhack", and
"dwarffortress-hacked").
+Source1:
https://mars.arosser.com/fedora/dwarffortress/rpmfusion/dfhack-run
+
+# pkgconfig file for other plugins to use.
+Source2:
https://mars.arosser.com/fedora/dwarffortress/rpmfusion/dfhack.pc.in
+
+# Git describe header, generated by prepare-dfhack-release script.
+Source3: git-describe.h
+
+# prepare-dfhack-release script.
+Source4: prepare-dfhack-release
+
+# Submodules. I started at 10, as there are some loose source files too.
+# See
https://github.com/DFHack/dfhack/blob/master/.gitmodules
+Source10:
https://github.com/DFHack/clsocket/archive/%{commit10}/dfhack-clsocket-%{...
+Source11:
https://github.com/DFHack/df-structures/archive/%{commit11}/dfhack-df-str...
+Source12:
https://github.com/DFHack/isoworld/archive/%{commit12}/dfhack-isoworld-%{...
+Source13:
https://github.com/DFHack/stonesense/archive/%{commit13}/dfhack-stonesens...
+Source14:
https://github.com/DFHack/scripts/archive/%{commit14}/dfhack-scripts-%{sh...
+
+# Patch to unbundle Agui from dfhack-plugins-isoworld.
+Patch0: isoworld-external-allegro-agui.patch
+
+# Patch to include cmath in isoworld.
+Patch1: isoworld-cmath-include.patch
+
+# See
https://github.com/DFHack/dfhack/issues/961 for these isoworld issues.
+
+# dfhack does not currently support non-32-bit DF.
+ExclusiveArch: %{ix86} x86_64
+
+BuildRequires: gcc, cmake, zlib-devel, mesa-libGL-devel
+BuildRequires: perl-XML-LibXML, perl-XML-LibXSLT, perl-Digest-SHA
+
+# Unbundled ruby.
+BuildRequires: ruby-libs, ruby-devel
+Requires: ruby, ruby-libs, ruby-devel
+
+# For stonesense and isoworld.
+%if 0%{?fedora}
+BuildRequires: allegro5-devel, allegro5-addon-ttf-devel, allegro5-addon-image-devel,
+BuildRequires: allegro5-addon-dialog-devel
+%endif
+
+# Unbundled tinyxml.
+BuildRequires: tinyxml-devel
+
+Requires: dwarffortress, valgrind
+
+# List of bundled provides... dfhack currently provides _no_ way to not bundle these.
+# Also, they have been modified downstream inside the dfhack tree.
+Provides: bundled(tinythread) = 1.1
+Provides: bundled(jsoncpp) = 1.6.5
+Provides: bundled(lua) = 5.3.3
+# This was unbundled, but because dfhack and df must be built / are built with
D_GLIBCXX_USE_CXX11_ABI=0
+# it currently doesn't work. When df upstream is built against gcc >= 5.0, this
can be unbundled.
+Provides: bundled(tinyxml) = 2.5.3
+
+# Protobuf is forked, but the last version was 2.4.1, so... use that.
+Provides: bundled(protobuf) = 2.4.1
+
+%description
+DFHack is a Dwarf Fortress memory access library, distributed with a wide
+variety of useful scripts and plugins.
+
+For users, it provides a significant suite of bugfixes and interface
+enhancements by default, and more can be enabled. There are also many tools
+(such as workflow or autodump) which can make life easier. You can even add
+third-party scripts and plugins to do almost anything!
+
+For modders, DFHack makes many things possible. Custom reactions, new
+interactions, magic creature abilities, and more can be set through Scripts
+for Modders and custom raws. Non-standard DFHack scripts and inits can be
+stored in the raw directory, making raws or saves fully self-contained for
+distribution - or for coexistence in a single DF install, even with
+incompatible components.
+
+For developers, DFHack unites the various ways tools access DF memory and
+allows easier development of new tools. As an open-source project under
+various copyleft licenses, contributions are welcome.
+
+# Spit out a -devel subpackage containing include files for all
+# dependencies.
+%package devel
+
+Summary: Development files and headers for dfhack
+
+# Require dfhack, dfhack-static
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+# Provide the static package.
+Provides: dfhack-static = %{version}-%{release}
+
+%description devel
+
+This package contains the development headers and files necessary
+to build dfhack plugins.
+
+# Generate a doc subpackage for the noarch documentation.
+%package doc
+
+Summary: DFHack documentation
+BuildArch: noarch
+
+%description doc
+
+This package contains the documentation for dfhack, a Dwarf Fortress
+memory access library and API. See the description of the "dfhack"
+package for more information.
+
+# Plugin subpackages.
+# At the moment, that's just stonesense, but isoworld (when we figure out how to
build it)
+# or any other 'large' dfhack plugins should be included here.
+
+# If for some reason a plugin should be shipped independently of dfhack this is, I
guess,
+# a template for how to do it, either as a subpackage or a separate package.
+# (Though the latter is probably currently almost impossible to build).
+
+%if 0%{?fedora}
+
+%package plugin-stonesense
+
+Summary: A retro isometric visualizer for Dwarf Fortress
+
+# Require dfhack.
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+# Provide "stonesense"; the software is commonly called that.
+# also more importantly, there is discussion about splitting stonesense out of dfhack
+# meaning it would need to be packaged separately.
+Provides: stonesense = %{version}-%{release}
+
+%description plugin-stonesense
+
+Stonesense is a third party visualizer that lets you view your Dwarf
+Fortress world in a classic isometric perspective. It is implemented as
+a plugin for dfhack.
+
+%endif
+
+%prep
+%setup -qn dfhack-%{dfversion}-%{hackrelease}
+
+# Extract submodules onto the right place.
+tar xfz %SOURCE10 -C depends/clsocket --strip-components=1
+tar xfz %SOURCE11 -C library/xml --strip-components=1
+tar xfz %SOURCE12 -C plugins/isoworld --strip-components=1
+tar xfz %SOURCE13 -C plugins/stonesense --strip-components=1
+tar xfz %SOURCE14 -C scripts --strip-components=1
+
+# Put git-describe.h in the right place.
+cp -a %SOURCE3 library/include/
+
+# Apply patches. This complains about line endings, for some reason...
+# You know what, don't apply patches. We don't build isoworld, anyway.
+%patch0 -p1
+%patch1 -p1
+
+# Manually (for now) apply fix to plugins/stonesense/CMakeLists.txt.
+sed 's/dfhack-tinyxml/${DFHACK_TINYXML}/' -i plugins/stonesense/CMakeLists.txt
+
+# Fix an issue caught by -fpermissive in isoworld.
+sed 's/MapSection::load_colors/load_colors/g' -i plugins/isoworld/MapSection.h
+
+# Remove the bundled agui.
+rm -rf plugins/isoworld/agui/
+
+# Comment out piece of code that uses git-describe.
+sed "s/ADD_DEPENDENCIES(dfhack-version
git-describe)/#ADD_DEPENDENCIES(dfhack-version git-describe)/" -i
library/CMakeLists.txt
+
+%build
+cd build
+# cmake options
+# * set install prefix to libdir/dfhack
+# * build stonesense
+# * link stonesense against system-wide allegro
+# * link against system-wide tinyxml
+# * don't download libruby.so, load system one.
+%cmake .. -DCMAKE_BUILD_TYPE:string=Release
-DCMAKE_INSTALL_PREFIX=%{buildroot}%{_libdir}/dfhack -DDFHACK_BUILD_ARCH=%{dfhack_arch}
%{?fedora:-DBUILD_STONESENSE:BOOL=True -DSTONESENSE_INTERNAL_SO=OFF} -DDOWNLOAD_RUBY=OFF
+# These do not seem to work currently.
+# -DBUILD_ISOWORLD=ON -DISOWORLD_INTERNAL_SO=OFF
+
+%make_build
+
+# Create pkgconfig file.
+sed -e 's,@version@,%{version}-%{hackrelease},' -e
's,@libdir@,%{_libdir},' -e 's,@prefix@,%{_prefix},' -e
's,@includedir@,%{_includedir},' < %SOURCE2 > dfhack.pc
+
+%install
+cd build/
+make install
+
+# Install the runner scripts, modify them appropriately.
+mkdir -p %{buildroot}/%{_bindir}
+install -m755 -p %SOURCE1 %{buildroot}%{_bindir}/
+ln -s %{_bindir}/dfhack-run %{buildroot}%{_bindir}/dfhack
+ln -s %{_bindir}/dfhack-run %{buildroot}%{_bindir}/dwarffortress-hacked
+sed 's|prefix=/usr|prefix=%{_prefix}|' -i %{buildroot}%{_bindir}/dfhack-run
+sed 's|libdir=lib|libdir=%{_libdir}|' -i %{buildroot}%{_bindir}/dfhack-run
+
+
+# Move data out of "_libdir/dfhack" and into "_datadir/dfhack".
+mkdir -p %{buildroot}%{_datadir}/dfhack
+mv %{buildroot}%{_libdir}/dfhack/dfhack.init-example %{buildroot}%{_datadir}/dfhack/
+mv %{buildroot}%{_libdir}/dfhack/dfhack-config %{buildroot}%{_datadir}/dfhack/
+
+# Stonesense data, too, should be in usr/share.
+%if 0%{?fedora}
+mv %{buildroot}%{_libdir}/dfhack/stonesense %{buildroot}%{_datadir}/dfhack/stonesense/
+%endif
+
+# Install the headers that are necessary.
+mkdir -p %{buildroot}%{_includedir}/dfhack
+mkdir -p %{buildroot}%{_includedir}/dfhack/dfhack
+mkdir -p %{buildroot}%{_includedir}/dfhack/proto
+mkdir -p %{buildroot}%{_includedir}/dfhack/lua
+mkdir -p %{buildroot}%{_includedir}/dfhack/protobuf
+cp -ar ../library/include/* %{buildroot}%{_includedir}/dfhack/dfhack/
+cp -ar ../library/proto/*.proto ../library/proto/*.h
%{buildroot}%{_includedir}/dfhack/proto/
+cp -ar ../depends/lua/include/* %{buildroot}%{_includedir}/dfhack/lua/
+
+# This one is harder, unfortunately.
+cp -ar depends/protobuf/config.h %{buildroot}%{_includedir}/dfhack/protobuf/
+cd ../depends/protobuf/
+find google/ -name '*.h' -exec cp --parents \{\}
%{buildroot}%{_includedir}/dfhack/protobuf/ \;
+cd ../../build/
+
+# Install the pkgconfig file.
+mkdir -p %{buildroot}%{_libdir}/pkgconfig/
+cp -a dfhack.pc %{buildroot}%{_libdir}/pkgconfig/
+
+# Install static libraries for plugins to link with.
+cp library/libdfhack-version.a %{buildroot}%{_libdir}/dfhack/hack/
+
+# Fix executable flag on some protobuf files.
+chmod -x %{buildroot}%{_includedir}/dfhack/proto/*.proto
+
+# Exclude docs build script.
+rm -f docs/build.sh
+
+%if 0%{?fedora}
+%files plugin-stonesense
+%{_libdir}/dfhack/hack/plugins/stonesense.plug.so
+%{_datadir}/dfhack/stonesense/
+%doc plugins/stonesense/README.md plugins/stonesense/docs
+%license plugins/stonesense/LICENSE
+%endif
+
+%files devel
+%exclude %{_includedir}/dfhack/dfhack/df/.gitignore
+%{_includedir}/dfhack/
+%{_libdir}/pkgconfig/dfhack.pc
+%{_libdir}/dfhack/hack/libdfhack-version.a
+
+%files doc
+%doc docs/*
+%license LICENSE.rst
+
+%files
+%if 0%{?fedora}
+%exclude %{_datadir}/dfhack/stonesense
+%exclude %{_libdir}/dfhack/hack/plugins/stonesense.plug.so
+%endif
+%exclude %{_libdir}/dfhack/hack/libdfhack-version.a
+%{_bindir}/dfhack
+%{_bindir}/dfhack-run
+%{_bindir}/dwarffortress-hacked
+%{_libdir}/dfhack/
+%{_datadir}/dfhack/
+%doc README.md
+%license LICENSE.rst
+
+%changelog
+* Wed Feb 21 2018 Ben Rosser <rosser.bjr(a)gmail.com> - 0.44.05-2.r1
+- Added missing provides for dfhack-static to dfhack-devel.
+
+* Tue Feb 20 2018 Ben Rosser <rosser.bjr(a)gmail.com> - 0.44.05-1.r1
+- Update to latest upstream release, add various review fixes.
+- Remove static subpackage, move static library into devel subpackage.
+- Remove re-definition of dist tag for EPEL.
+- Use make_build instead of make smp_flags macro.
+- Remove BR on git.
+- Add comment to upstream ticket about isoworld issues/patches.
+- Generate dfhack-doc subpackage, excluding documentation build script.
+
+* Sun Dec 31 2017 Ben Rosser <rosser.bjr(a)gmail.com> - 0.44.03-1.beta1
+- Updated to latest dfhack upstream release, beta1 for 0.44.03.
+- Redid packaging to use several source URLs, one for each git repository.
+- Commit hashes and git-describe.h get generated by prepare-dfhack-release,
+ script, both included in source RPM.
+- Fixed executable permissions on some proto files, excluded df-structures
+ gitignore in devel package.
+- Added bundled protobuf version to Provide.
+- Made stonesense Provides versioned.
+
+* Sun Jul 16 2017 Ben Rosser <rosser.bjr(a)gmail.com> - 0.43.05-7.r2
+- Update to latest dfhack upstream release, r2 for 0.43.05.
+
+* Tue Jun 20 2017 Ben Rosser <rosser.bjr(a)gmail.com> - 0.43.05-6.r1
+- Update to r1 release for DF 0.43.05.
+
+* Tue May 09 2017 Ben Rosser <rosser.bjr(a)gmail.com> - 0.43.05-5.beta2
+- Update to beta2 release for DF 0.43.05.
+
+* Wed Feb 15 2017 Ben Rosser <rosser.bjr(a)gmail.com> - 0.43.05-4.beta1
+- Update to beta1 release for DF 0.43.05.
+
+* Fri Jan 20 2017 Ben Rosser <rosser.bjr(a)gmail.com> - 0.43.05-3.alpha4
+- Rebuild with DOWLOAD_RUBY actually set to off.
+
+* Fri Jan 20 2017 Ben Rosser <rosser.bjr(a)gmail.com> - 0.43.05-2.alpha4
+- Update to latest 0.43.05 alpha release.
+- The libruby.so symlink is no longer required.
+
+* Sun Oct 23 2016 Ben Rosser <rosser.bjr(a)gmail.com> - 0.43.05-1.alpha1
+- Initial support for 0.43.05 and 64-bit Dwarf Fortress; not perfectly stable.
+- Now that ruby plugin supports 2.x libruby, unbundle libruby.
+- Rebundle tinyxml; as dfhack segfaults when it is unbundled for whatever reason.
+- Keep libdfhack-version as static library, install it in dfhack-static package.
+
+* Sat Oct 1 2016 Ben Rosser <rosser.bjr(a)gmail.com> - 0.43.03-6.r1
+- Add -devel subpackage containing all development headers and pkgconfig file.
+- Build libdfhack-version as shared library and install it in main package.
+
+* Thu Jul 7 2016 Ben Rosser <rosser.bjr(a)gmail.com> 0.43.03-5.r1
+- Update to 0.43.03 stable release
+- Unbundle tinyxml, link against system-wide tinyxml (patch accepted upstream)
+
+* Sat Jun 18 2016 Ben Rosser <rosser.bjr(a)gmail.com> 0.43.03-4.alpha1
+- Unbundle allegro, link stonesense against system-wide allegro.
+
+* Sat Jun 18 2016 Ben Rosser <rosser.bjr(a)gmail.com> 0.43.03-3.alpha1
+- Fix bug in dfhack-run when installing stonesense.
+
+* Sat Jun 18 2016 Ben Rosser <rosser.bjr(a)gmail.com> 0.43.03-2.alpha1
+- Change Source0 to use version macro so I don't accidentally forget to update it.
+
+* Sat Jun 18 2016 Ben Rosser <rosser.bjr(a)gmail.com> 0.43.03-1.alpha1
+- Update to 0.43.03 alpha release
+
+* Fri Jun 17 2016 Ben Rosser <rosser.bjr(a)gmail.com> 0.42.06-2.r1
+- Switch to using _libdir and _datadir to store dfhack instead of opt.
+- Added valgrind as run-time dependency.
+- Include stonesense as subpackage.
+
+* Fri Jun 17 2016 Ben Rosser <rosser.bjr(a)gmail.com> 0.42.06-1.r1
+- Initial package.
diff --git a/git-describe.h b/git-describe.h
new file mode 100644
index 0000000..de4b0fb
--- /dev/null
+++ b/git-describe.h
@@ -0,0 +1,5 @@
+#define DFHACK_GIT_DESCRIPTION "0.44.05-r1-0-gc92227f0"
+#define DFHACK_GIT_COMMIT "c92227f007114148f0b48059908b86645a6c36d7"
+#define DFHACK_GIT_XML_EXPECTED_COMMIT
"40da7231a0114fe3420d475961b08826f64fbf79"
+#define DFHACK_GIT_XML_COMMIT "40da7231a0114fe3420d475961b08826f64fbf79"
+#define DFHACK_GIT_XML_MATCH
diff --git a/isoworld-cmath-include.patch b/isoworld-cmath-include.patch
new file mode 100644
index 0000000..9a118cf
--- /dev/null
+++ b/isoworld-cmath-include.patch
@@ -0,0 +1,18 @@
+diff -rupN dfhack/plugins/isoworld/DetailedTile.cpp
dfhack-fork/plugins/isoworld/DetailedTile.cpp
+--- dfhack/plugins/isoworld/DetailedTile.cpp 2016-09-25 22:58:38.603797808 -0400
++++ dfhack-fork/plugins/isoworld/DetailedTile.cpp 2016-09-25 22:59:13.050852941 -0400
+@@ -4,6 +4,7 @@
+ #include "UserConfig.h"
+ #include "ColorList.h"
+ #include "TileSet.h"
++#include <cmath>
+ #include <sstream>
+
+ using namespace isoworldremote;
+@@ -468,4 +469,4 @@ void load_detailed_tiles(ALLEGRO_PATH *
+ }
+ al_destroy_fs_entry(base_folder);
+ al_destroy_path(tile_path);
+-}
+\ No newline at end of file
++}
diff --git a/isoworld-external-allegro-agui.patch b/isoworld-external-allegro-agui.patch
new file mode 100644
index 0000000..0265d5a
--- /dev/null
+++ b/isoworld-external-allegro-agui.patch
@@ -0,0 +1,23 @@
+diff -rupN dfhack/plugins/isoworld/CMakeLists.txt
dfhack-fork/plugins/isoworld/CMakeLists.txt
+--- dfhack/plugins/isoworld/CMakeLists.txt 2016-07-07 16:43:07.000000000 -0400
++++ dfhack-fork/plugins/isoworld/CMakeLists.txt 2016-07-12 22:04:41.787097086 -0400
+@@ -56,8 +56,8 @@ IF(UNIX)
+ ENDIF()
+ ELSE(APPLE)
+ #linux
+- OPTION(STONESENSE_INTERNAL_SO "Link with prebuilt internal allegro libs and
headers." ON)
+- IF(STONESENSE_INTERNAL_SO)
++ OPTION(ISOWORLD_INTERNAL_SO "Link with prebuilt internal allegro libs and
headers." ON)
++ IF(ISOWORLD_INTERNAL_SO)
+ FILE(DOWNLOAD
http://dethware.org/dfhack/download/allegro509b.tar.bz2
+ ${CMAKE_CURRENT_SOURCE_DIR}/allegro509b.tar.bz2
+ EXPECTED_MD5 74ead5d95a83a03a301cdc76fa0a3df8)
+@@ -90,6 +90,8 @@ IF(UNIX)
+ allegro_dialog
+ allegro_image
+ allegro_ttf
++ agui
++ agui_allegro5
+ ${PROJECT_LIBS}
+ )
+ ENDIF()
diff --git a/prepare-dfhack-release b/prepare-dfhack-release
new file mode 100755
index 0000000..7ef1232
--- /dev/null
+++ b/prepare-dfhack-release
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Sources in rpm spec start at this identifier.
+SOURCE_START=10
+
+# Run this script as "prepare-dfhack-release RELEASE_NAME":
+# No longer actually builds tarball, but does get submodule commits
+# correctly.
+# Take resultant "git-describe.h" and put it into library/include.
+
+RELEASE_NAME=$1
+
+UPSTREAM="git://github.com/dfhack/dfhack"
+
+# Fetch the repo.
+git clone --depth=1 --recursive -b ${RELEASE_NAME} ${UPSTREAM} dfhack-${RELEASE_NAME}
+
+# Replace gitdir incantations in submodules to relative paths.
+# Credit to
https://stackoverflow.com/questions/10953953/ensuring-relative-git-paths
+cd dfhack-${RELEASE_NAME}/
+find -type f -name .git -exec bash -c 'f="{}"; cd $(dirname $f); echo
"gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" >
.git' \;
+
+# Get the current submodule commits.
+SUBMODULES=`git submodule status --recursive`
+
+GIT_XML_COMMIT=""
+
+# Add some whitespace.
+echo ""
+
+# Loop through all the commits.
+# If the submodule is "library/xml", store commit.
+IFS=$'\n' read -rd '' -a SUBMODULE_ARRAY <<<
"${SUBMODULES}"
+for index in "${!SUBMODULE_ARRAY[@]}"
+do
+ LINE=${SUBMODULE_ARRAY[index]}
+ HASH=`echo $LINE | cut -d' ' -f1 -`
+ NAME=`echo $LINE | cut -d' ' -f2 -`
+ COMMIT_INDEX=`expr $index + $SOURCE_START`
+ echo "# dfhack submodule: ${NAME}"
+ echo "%global commit${COMMIT_INDEX} ${HASH}"
+
+ # If the submodule name is 'library/xml' store it.
+ if [ ${NAME} == "library/xml" ]; then
+ GIT_XML_COMMIT=${HASH}
+ fi
+done
+
+# Now get the git description and current commit to create the header.
+GIT_DESCRIPTION=`git describe --tags --abbrev=8 --long`
+GIT_COMMIT=`git rev-parse HEAD`
+cd ../
+
+# Add some whitespace.
+echo ""
+
+# Remove git-describe.h if it exists.
+rm -rf git-describe.h
+
+# Write out git-describe.h.
+set -x
+echo "#define DFHACK_GIT_DESCRIPTION \"${GIT_DESCRIPTION}\"" >>
git-describe.h
+echo "#define DFHACK_GIT_COMMIT \"${GIT_COMMIT}\"" >>
git-describe.h
+echo "#define DFHACK_GIT_XML_EXPECTED_COMMIT \"${GIT_XML_COMMIT}\""
>> git-describe.h
+echo "#define DFHACK_GIT_XML_COMMIT \"${GIT_XML_COMMIT}\"" >>
git-describe.h
+echo "#define DFHACK_GIT_XML_MATCH" >> git-describe.h
+
+# Delete checkout directory.
+rm -rf dfhack-${RELEASE_NAME}/
diff --git a/sources b/sources
index e69de29..2905517 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,6 @@
+a5caf80229e67fb88096975e8a858a0e dfhack-0.44.05-r1.tar.gz
+b16252960c7de5dfa6a580cbd6a32dbd dfhack-clsocket-0f0ad78.tar.gz
+cb37d829a73fbdbe6656dfdef8814b1f dfhack-df-structures-40da723.tar.gz
+5c5a2bd6b863de63d7d1dcb4cf3c1176 dfhack-isoworld-3ff3f05.tar.gz
+cc008e1113678d1893ec3df441e6b199 dfhack-scripts-8d079a5.tar.gz
+aa48d3b86648b7d024bec20b8ec1f1a6 dfhack-stonesense-455b51a.tar.gz