dwarf-fortress-packages.dfhack: add stoneSense support

This commit is contained in:
Herwig Hochleitner
2017-10-28 14:55:25 +02:00
parent 24ea093806
commit 85056ee698
7 changed files with 55 additions and 19 deletions
+8 -6
View File
@@ -1,6 +1,6 @@
{ stdenv, fetchgit, cmake, writeScriptBin
, perl, XMLLibXML, XMLLibXSLT
, zlib
{ stdenv, lib, fetchgit, cmake, writeScriptBin, callPackage
, perl, XMLLibXML, XMLLibXSLT, zlib
, enableStoneSense ? false, allegro5, mesa
}:
let
@@ -43,11 +43,12 @@ in stdenv.mkDerivation rec {
inherit rev sha256;
};
patches = [ ./skip-ruby.patch ];
patches = [ ./fix-stonesense.patch ];
nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ];
# We don't use system libraries because dfhack needs old C++ ABI.
buildInputs = [ zlib ];
buildInputs = [ zlib ]
++ lib.optionals enableStoneSense [ allegro5 mesa ];
preConfigure = ''
# 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"
'';
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;
@@ -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)