dwarf-fortress-packages.dfhack: add stoneSense support
This commit is contained in:
parent
24ea093806
commit
85056ee698
@ -12,6 +12,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
soundSense = callPackage ./soundsense.nix { };
|
soundSense = callPackage ./soundsense.nix { };
|
||||||
|
stoneSense = callPackage ./stonesense.nix { };
|
||||||
|
|
||||||
dwarf-fortress-unfuck = callPackage ./unfuck.nix { };
|
dwarf-fortress-unfuck = callPackage ./unfuck.nix { };
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ stdenv, fetchgit, cmake, writeScriptBin
|
{ stdenv, lib, fetchgit, cmake, writeScriptBin, callPackage
|
||||||
, perl, XMLLibXML, XMLLibXSLT
|
, perl, XMLLibXML, XMLLibXSLT, zlib
|
||||||
, zlib
|
, enableStoneSense ? false, allegro5, mesa
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -43,11 +43,12 @@ in stdenv.mkDerivation rec {
|
|||||||
inherit rev sha256;
|
inherit rev sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [ ./skip-ruby.patch ];
|
patches = [ ./fix-stonesense.patch ];
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ];
|
nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ];
|
||||||
# We don't use system libraries because dfhack needs old C++ ABI.
|
# We don't use system libraries because dfhack needs old C++ ABI.
|
||||||
buildInputs = [ zlib ];
|
buildInputs = [ zlib ]
|
||||||
|
++ lib.optionals enableStoneSense [ allegro5 mesa ];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
# Trick build system into believing we have .git
|
# Trick build system into believing we have .git
|
||||||
@ -59,7 +60,8 @@ in stdenv.mkDerivation rec {
|
|||||||
export LD_LIBRARY_PATH="$PWD/depends/protobuf:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$PWD/depends/protobuf:$LD_LIBRARY_PATH"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = [ "-DDFHACK_BUILD_ARCH=${arch}" ];
|
cmakeFlags = [ "-DDFHACK_BUILD_ARCH=${arch}" "-DDOWNLOAD_RUBY=OFF" ]
|
||||||
|
++ lib.optionals enableStoneSense [ "-DBUILD_STONESENSE=ON" "-DSTONESENSE_INTERNAL_SO=OFF" ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
23
pkgs/games/dwarf-fortress/dfhack/fix-stonesense.patch
Normal file
23
pkgs/games/dwarf-fortress/dfhack/fix-stonesense.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
From f5be6fe5fb192f01ae4551ed9217e97fd7f6a0ae Mon Sep 17 00:00:00 2001
|
||||||
|
From: Herwig Hochleitner <hhochleitner@gmail.com>
|
||||||
|
Date: Sun, 1 Oct 2017 18:01:43 +0200
|
||||||
|
Subject: [PATCH] include <GL/glext.h>
|
||||||
|
|
||||||
|
this fixes `GLhandleARB` not being defined
|
||||||
|
---
|
||||||
|
plugins/stonesense/common.h | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/plugins/stonesense/common.h b/plugins/stonesense/common.h
|
||||||
|
index eb36691..ef45389 100644
|
||||||
|
--- a/plugins/stonesense/common.h
|
||||||
|
+++ b/plugins/stonesense/common.h
|
||||||
|
@@ -31,6 +31,8 @@ using namespace df::enums;
|
||||||
|
#include <allegro5/allegro_opengl.h>
|
||||||
|
#include <allegro5/utf8.h>
|
||||||
|
|
||||||
|
+#include <GL/glext.h>
|
||||||
|
+
|
||||||
|
// allegro leaks X headers, undef some of it here:
|
||||||
|
#undef TileShape
|
||||||
|
#undef None
|
@ -1,10 +0,0 @@
|
|||||||
diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt
|
|
||||||
index f1ef12ac..0976e18a 100644
|
|
||||||
--- a/plugins/ruby/CMakeLists.txt
|
|
||||||
+++ b/plugins/ruby/CMakeLists.txt
|
|
||||||
@@ -1,5 +1,5 @@
|
|
||||||
# Allow build system to turn off downloading of libruby.so.
|
|
||||||
-OPTION(DOWNLOAD_RUBY "Download prebuilt libruby.so for ruby plugin." ON)
|
|
||||||
+OPTION(DOWNLOAD_RUBY "Download prebuilt libruby.so for ruby plugin." OFF)
|
|
||||||
|
|
||||||
IF (DOWNLOAD_RUBY)
|
|
15
pkgs/games/dwarf-fortress/stonesense.nix
Normal file
15
pkgs/games/dwarf-fortress/stonesense.nix
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{ stdenv, fetchFromGitHub, cmake }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "stonesense";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "DFHack";
|
||||||
|
repo = "stonesense";
|
||||||
|
rev = "be793a080e66db1ff79ac284070632ec1a896708";
|
||||||
|
sha256 = "1kibqblxp16z75zm48kk59w483933rkg4w339f28fcrbpg4sn92s";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
|
cmakeFlags = [ "-DDFHACK_BUILD_ARCH=64" ];
|
||||||
|
}
|
@ -1,11 +1,16 @@
|
|||||||
{ stdenv, lib, buildEnv, dwarf-fortress-original, substituteAll
|
{ stdenv, lib, buildEnv, dwarf-fortress-original, substituteAll
|
||||||
, enableDFHack ? false, dfhack
|
, enableDFHack ? false, dfhack
|
||||||
, enableSoundSense ? false, soundSense, jdk
|
, enableSoundSense ? false, soundSense, jdk
|
||||||
|
, enableStoneSense ? false
|
||||||
, themes ? {}
|
, themes ? {}
|
||||||
, theme ? null
|
, theme ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
dfhack_ = dfhack.override {
|
||||||
|
inherit enableStoneSense;
|
||||||
|
};
|
||||||
|
|
||||||
ptheme =
|
ptheme =
|
||||||
if builtins.isString theme
|
if builtins.isString theme
|
||||||
then builtins.getAttr theme themes
|
then builtins.getAttr theme themes
|
||||||
@ -13,7 +18,7 @@ let
|
|||||||
|
|
||||||
# These are in inverse order for first packages to override the next ones.
|
# These are in inverse order for first packages to override the next ones.
|
||||||
pkgs = lib.optional (theme != null) ptheme
|
pkgs = lib.optional (theme != null) ptheme
|
||||||
++ lib.optional enableDFHack dfhack
|
++ lib.optional enableDFHack dfhack_
|
||||||
++ lib.optional enableSoundSense soundSense
|
++ lib.optional enableSoundSense soundSense
|
||||||
++ [ dwarf-fortress-original ];
|
++ [ dwarf-fortress-original ];
|
||||||
|
|
||||||
@ -26,7 +31,7 @@ let
|
|||||||
|
|
||||||
postBuild = lib.optionalString enableDFHack ''
|
postBuild = lib.optionalString enableDFHack ''
|
||||||
rm $out/hack/symbols.xml
|
rm $out/hack/symbols.xml
|
||||||
substitute ${dfhack}/hack/symbols.xml $out/hack/symbols.xml \
|
substitute ${dfhack_}/hack/symbols.xml $out/hack/symbols.xml \
|
||||||
--replace $(cat ${dwarf-fortress-original}/hash.md5.orig) \
|
--replace $(cat ${dwarf-fortress-original}/hash.md5.orig) \
|
||||||
$(cat ${dwarf-fortress-original}/hash.md5)
|
$(cat ${dwarf-fortress-original}/hash.md5)
|
||||||
'';
|
'';
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
source @dfInit@
|
source @dfInit@
|
||||||
|
|
||||||
for i in dfhack.init-example dfhack-config/default hack/*; do
|
for i in dfhack.init-example dfhack-config/default hack/* stonesense/*; do
|
||||||
update_path "$i"
|
update_path "$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user