about summary refs log tree commit diff
path: root/pkgs/games/dwarf-fortress/unfuck.nix
diff options
context:
space:
mode:
authorMorgan Jones <me@numin.it>2018-07-12 08:42:52 +0000
committerMorgan Jones <me@numin.it>2018-09-09 06:59:41 +0000
commit4ada74e293212434114ac87a679c1432650f4b40 (patch)
tree19619cb5fe604ce10b885618cf17e8b3104e5128 /pkgs/games/dwarf-fortress/unfuck.nix
parent9082a008d147c69538fedb045aacf34942ea1700 (diff)
downloadnixlib-4ada74e293212434114ac87a679c1432650f4b40.tar
nixlib-4ada74e293212434114ac87a679c1432650f4b40.tar.gz
nixlib-4ada74e293212434114ac87a679c1432650f4b40.tar.bz2
nixlib-4ada74e293212434114ac87a679c1432650f4b40.tar.lz
nixlib-4ada74e293212434114ac87a679c1432650f4b40.tar.xz
nixlib-4ada74e293212434114ac87a679c1432650f4b40.tar.zst
nixlib-4ada74e293212434114ac87a679c1432650f4b40.zip
dwarf-fortress: Support multiple unfuck/dfhack/TWBT versions
Diffstat (limited to 'pkgs/games/dwarf-fortress/unfuck.nix')
-rw-r--r--pkgs/games/dwarf-fortress/unfuck.nix32
1 files changed, 15 insertions, 17 deletions
diff --git a/pkgs/games/dwarf-fortress/unfuck.nix b/pkgs/games/dwarf-fortress/unfuck.nix
index 0c5a81a52f0f..732003118713 100644
--- a/pkgs/games/dwarf-fortress/unfuck.nix
+++ b/pkgs/games/dwarf-fortress/unfuck.nix
@@ -1,18 +1,27 @@
-{ stdenv, fetchFromGitHub, cmake
+{ stdenv, lib, fetchFromGitHub, cmake
 , libGL, libSM, SDL, SDL_image, SDL_ttf, glew, openalSoft
 , ncurses, glib, gtk2, libsndfile, zlib
+, dfVersion
 }:
 
-let dfVersion = "0.44.12"; in
+with lib;
+
+let
+  unfuck-releases = builtins.fromJSON (builtins.readFile ./unfuck.json);
+
+  release = if hasAttr dfVersion unfuck-releases
+            then getAttr dfVersion unfuck-releases
+            else throw "[unfuck] Unknown Dwarf Fortress version: ${dfVersion}";
+in
 
 stdenv.mkDerivation {
-  name = "dwarf_fortress_unfuck-${dfVersion}";
+  name = "dwarf_fortress_unfuck-${release.unfuckRelease}";
 
   src = fetchFromGitHub {
     owner = "svenstaro";
     repo = "dwarf_fortress_unfuck";
-    rev = dfVersion;
-    sha256 = "1kszkb1d1vll8p04ja41nangsaxb5lv4p3xh2jhmsmipfixw7nvz";
+    rev = release.unfuckRelease;
+    sha256 = release.sha256;
   };
 
   cmakeFlags = [
@@ -20,23 +29,12 @@ stdenv.mkDerivation {
     "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
   ];
 
-  makeFlags = [
-    ''CFLAGS="-fkeep-inline-functions"''
-    ''CXXFLAGS="-fkeep-inline-functions"''
-  ];
-
   nativeBuildInputs = [ cmake ];
   buildInputs = [
     libSM SDL SDL_image SDL_ttf glew openalSoft
     ncurses gtk2 libsndfile zlib libGL
   ];
 
-  postPatch = ''
-    substituteInPlace CMakeLists.txt --replace \
-      'set(CMAKE_BUILD_TYPE Release)' \
-      'set(CMAKE_BUILD_TYPE Debug)'
-  '';
-
   # Don't strip unused symbols; dfhack hooks into some of them.
   dontStrip = true;
 
@@ -56,6 +54,6 @@ stdenv.mkDerivation {
     homepage = https://github.com/svenstaro/dwarf_fortress_unfuck;
     license = licenses.free;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ abbradar ];
+    maintainers = with maintainers; [ abbradar numinit ];
   };
 }