2018-07-12 09:42:52 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake
|
2018-02-24 12:06:44 +00:00
|
|
|
, libGL, libSM, SDL, SDL_image, SDL_ttf, glew, openalSoft
|
2016-04-22 23:34:11 +01:00
|
|
|
, ncurses, glib, gtk2, libsndfile, zlib
|
2020-01-30 19:13:05 +00:00
|
|
|
, dfVersion, pkg-config
|
2016-01-12 17:56:59 +00:00
|
|
|
}:
|
|
|
|
|
2018-07-12 09:42:52 +01:00
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
2018-09-09 08:12:36 +01:00
|
|
|
unfuck-releases = {
|
|
|
|
"0.43.05" = {
|
|
|
|
unfuckRelease = "0.43.05";
|
|
|
|
sha256 = "173dyrbxlzqvjf1j3n7vpns4gfjkpyvk9z16430xnmd5m6nda8p2";
|
|
|
|
};
|
|
|
|
"0.44.05" = {
|
|
|
|
unfuckRelease = "0.44.05";
|
|
|
|
sha256 = "00yj4l4gazxg4i6fj9rwri6vm17i6bviy2mpkx0z5c0mvsr7s14b";
|
|
|
|
};
|
|
|
|
"0.44.09" = {
|
|
|
|
unfuckRelease = "0.44.09";
|
|
|
|
sha256 = "138p0v8z2x47f0fk9k6g75ikw5wb3vxldwv5ggbkf4hhvlw6lvzm";
|
|
|
|
};
|
|
|
|
"0.44.10" = {
|
|
|
|
unfuckRelease = "0.44.10";
|
|
|
|
sha256 = "0vb19qx2ibc79j4bgbk9lskb883qfb0815zw1dfz9k7rqwal8mzj";
|
|
|
|
};
|
|
|
|
"0.44.11" = {
|
|
|
|
unfuckRelease = "0.44.11.1";
|
|
|
|
sha256 = "1kszkb1d1vll8p04ja41nangsaxb5lv4p3xh2jhmsmipfixw7nvz";
|
|
|
|
};
|
|
|
|
"0.44.12" = {
|
|
|
|
unfuckRelease = "0.44.12";
|
|
|
|
sha256 = "1kszkb1d1vll8p04ja41nangsaxb5lv4p3xh2jhmsmipfixw7nvz";
|
|
|
|
};
|
2020-01-30 19:13:05 +00:00
|
|
|
"0.47.01" = {
|
|
|
|
unfuckRelease = "0.47.01";
|
|
|
|
sha256 = "11xvb3qh4crdf59pwfwpi73rzm3ysd1r1xp2k1jp7527jmqapk4k";
|
|
|
|
};
|
2020-02-09 16:18:32 +00:00
|
|
|
"0.47.02" = {
|
|
|
|
unfuckRelease = "0.47.01";
|
|
|
|
sha256 = "11xvb3qh4crdf59pwfwpi73rzm3ysd1r1xp2k1jp7527jmqapk4k";
|
|
|
|
};
|
2020-03-12 18:40:32 +00:00
|
|
|
"0.47.04" = {
|
|
|
|
unfuckRelease = "0.47.04";
|
|
|
|
sha256 = "1wa990xbsyiiz7abq153xmafvvk1dmgz33rp907d005kzl1z86i9";
|
|
|
|
};
|
2018-09-09 08:12:36 +01:00
|
|
|
};
|
2018-07-12 09:42:52 +01:00
|
|
|
|
|
|
|
release = if hasAttr dfVersion unfuck-releases
|
|
|
|
then getAttr dfVersion unfuck-releases
|
|
|
|
else throw "[unfuck] Unknown Dwarf Fortress version: ${dfVersion}";
|
|
|
|
in
|
2017-12-06 23:53:24 +00:00
|
|
|
|
2016-01-12 17:56:59 +00:00
|
|
|
stdenv.mkDerivation {
|
2018-07-12 09:42:52 +01:00
|
|
|
name = "dwarf_fortress_unfuck-${release.unfuckRelease}";
|
2016-01-12 17:56:59 +00:00
|
|
|
|
2016-03-03 12:01:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "svenstaro";
|
|
|
|
repo = "dwarf_fortress_unfuck";
|
2018-07-12 09:42:52 +01:00
|
|
|
rev = release.unfuckRelease;
|
|
|
|
sha256 = release.sha256;
|
2016-01-12 17:56:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2016-04-14 02:11:58 +01:00
|
|
|
"-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
|
|
|
|
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
|
2016-01-12 17:56:59 +00:00
|
|
|
];
|
|
|
|
|
2020-01-30 19:13:05 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2016-01-12 17:56:59 +00:00
|
|
|
buildInputs = [
|
2016-08-22 05:43:12 +01:00
|
|
|
libSM SDL SDL_image SDL_ttf glew openalSoft
|
2018-02-24 12:06:44 +00:00
|
|
|
ncurses gtk2 libsndfile zlib libGL
|
2016-01-12 17:56:59 +00:00
|
|
|
];
|
|
|
|
|
2018-07-01 21:28:59 +01:00
|
|
|
# Don't strip unused symbols; dfhack hooks into some of them.
|
|
|
|
dontStrip = true;
|
|
|
|
|
2016-01-12 17:56:59 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -D -m755 ../build/libgraphics.so $out/lib/libgraphics.so
|
|
|
|
'';
|
|
|
|
|
2016-11-23 23:51:51 +00:00
|
|
|
# Breaks dfhack because of inlining.
|
|
|
|
hardeningDisable = [ "fortify" ];
|
|
|
|
|
2017-12-06 23:53:24 +00:00
|
|
|
passthru = { inherit dfVersion; };
|
2016-01-12 17:56:59 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-01-12 17:56:59 +00:00
|
|
|
description = "Unfucked multimedia layer for Dwarf Fortress";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/svenstaro/dwarf_fortress_unfuck";
|
2016-01-12 17:56:59 +00:00
|
|
|
license = licenses.free;
|
2016-08-13 01:11:45 +01:00
|
|
|
platforms = platforms.linux;
|
2018-07-12 09:42:52 +01:00
|
|
|
maintainers = with maintainers; [ abbradar numinit ];
|
2016-01-12 17:56:59 +00:00
|
|
|
};
|
|
|
|
}
|