From d0bee3aeec2ac5d79ab8644fc0193f14420d5b45 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 13 Aug 2016 03:12:20 +0300 Subject: [PATCH] dwarf-fortress-packages.dfhack: 0.42.06-r1 -> 0.43.03-r1 --- pkgs/games/dwarf-fortress/dfhack/default.nix | 12 +++--- .../dfhack/use-system-libraries.patch | 42 +++++++------------ 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/pkgs/games/dwarf-fortress/dfhack/default.nix b/pkgs/games/dwarf-fortress/dfhack/default.nix index 1ee0f829571d..176971920071 100644 --- a/pkgs/games/dwarf-fortress/dfhack/default.nix +++ b/pkgs/games/dwarf-fortress/dfhack/default.nix @@ -5,8 +5,9 @@ }: let - dfVersion = "0.42.06"; + dfVersion = "0.43.03"; version = "${dfVersion}-r1"; + rev = "refs/tags/${version}"; # revision of library/xml submodule xmlRev = "98cc1e01886aaea161d651cf97229ad08e9782b0"; @@ -14,7 +15,7 @@ let fakegit = writeScriptBin "git" '' #! ${stdenv.shell} if [ "$*" = "describe --tags --long" ]; then - echo "${dfVersion}-unknown" + echo "${version}-unknown" elif [ "$*" = "rev-parse HEAD" ]; then if [ "$(dirname "$(pwd)")" = "xml" ]; then echo "${xmlRev}" @@ -35,19 +36,20 @@ in stdenv.mkDerivation rec { src = fetchgit { url = "https://github.com/DFHack/dfhack"; inherit rev; - sha256 = "1p234m8r84cdr4bx622hcd13mshnjc5bw7hdxhv18waaxvdpv6jh"; + sha256 = "0m5kqpaz0ypji4c32w0hhbsicvgvnjh56pqvq7af6pqqnyg1nzcx"; }; patches = [ ./use-system-libraries.patch ]; - postPatch = "sed '1i#include ' -i plugins/3dveins.cpp"; nativeBuildInputs = [ cmake perl XMLLibXML XMLLibXSLT fakegit ]; # we can't use native Lua; upstream uses private headers buildInputs = [ zlib jsoncpp protobuf tinyxml ]; + cmakeFlags = [ "-DEXTERNAL_TINYXML=ON" ]; + enableParallelBuilding = true; - passthru = { inherit dfVersion; }; + passthru = { inherit version dfVersion; }; meta = with stdenv.lib; { description = "Memory hacking library for Dwarf Fortress and a set of tools that use it"; diff --git a/pkgs/games/dwarf-fortress/dfhack/use-system-libraries.patch b/pkgs/games/dwarf-fortress/dfhack/use-system-libraries.patch index b6ff92398a54..e33fec9f87ec 100644 --- a/pkgs/games/dwarf-fortress/dfhack/use-system-libraries.patch +++ b/pkgs/games/dwarf-fortress/dfhack/use-system-libraries.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 46fd565..254c3c0 100644 +index 956edfc..fb0e6bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,8 +160,6 @@ ELSEIF(MSVC) @@ -11,7 +11,7 @@ index 46fd565..254c3c0 100644 ADD_DEFINITIONS(-DLUA_BUILD_AS_DLL) if(APPLE) -@@ -182,11 +180,8 @@ else() +@@ -182,10 +180,8 @@ else() set(ZLIB_ROOT /usr/lib/i386-linux-gnu) endif() find_package(ZLIB REQUIRED) @@ -19,27 +19,31 @@ index 46fd565..254c3c0 100644 include_directories(depends/lua/include) include_directories(depends/md5) -include_directories(depends/jsoncpp) --include_directories(depends/tinyxml) - include_directories(depends/tthread) - include_directories(${ZLIB_INCLUDE_DIRS}) - include_directories(depends/clsocket/src) + + # Support linking against external tinyxml + # If we find an external tinyxml, set the DFHACK_TINYXML variable to "tinyxml" diff --git a/depends/CMakeLists.txt b/depends/CMakeLists.txt -index bf0345b..2a1a852 100644 +index d8442b1..b47dc2a 100644 --- a/depends/CMakeLists.txt +++ b/depends/CMakeLists.txt -@@ -1,10 +1,7 @@ +@@ -1,7 +1,6 @@ #list depends here. add_subdirectory(lua) add_subdirectory(md5) -add_subdirectory(protobuf) --add_subdirectory(tinyxml) + + # Don't build tinyxml if it's being externally linked against. + if(NOT TinyXML_FOUND) +@@ -9,7 +8,6 @@ if(NOT TinyXML_FOUND) + endif() + add_subdirectory(tthread) -add_subdirectory(jsoncpp) # build clsocket static and only as a dependency. Setting those options here overrides its own default settings. OPTION(CLSOCKET_SHARED "Build clsocket lib as shared." OFF) OPTION(CLSOCKET_DEP_ONLY "Build for use inside other CMake projects as dependency." ON) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt -index 54300ec..128bfd1 100644 +index d3e3480..5d4b572 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -223,10 +223,10 @@ LIST(APPEND PROJECT_SOURCES ${PROJECT_PROTO_SRCS}) @@ -55,24 +59,8 @@ index 54300ec..128bfd1 100644 ) # Merge headers into sources -@@ -269,12 +269,12 @@ IF(UNIX) - ENDIF() - - IF(APPLE) -- SET(PROJECT_LIBS dl dfhack-md5 dfhack-tinyxml dfhack-tinythread) -+ SET(PROJECT_LIBS dl dfhack-md5 tinyxml dfhack-tinythread) - ELSEIF(UNIX) -- SET(PROJECT_LIBS rt dl dfhack-md5 dfhack-tinyxml dfhack-tinythread) -+ SET(PROJECT_LIBS rt dl dfhack-md5 tinyxml dfhack-tinythread) - ELSE(WIN32) - #FIXME: do we really need psapi? -- SET(PROJECT_LIBS psapi dfhack-md5 dfhack-tinyxml dfhack-tinythread) -+ SET(PROJECT_LIBS psapi dfhack-md5 tinyxml dfhack-tinythread) - ENDIF() - - ADD_LIBRARY(dfhack-version STATIC DFHackVersion.cpp) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt -index dd1c634..7bd8c17 100644 +index c24b940..afeb888 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -47,11 +47,11 @@ STRING(REPLACE ".proto" ".pb.h" PROJECT_PROTO_HDRS "${PROJECT_PROTOS}")