Unverified Commit b33a7fa3 authored by Naïm Favier's avatar Naïm Favier Committed by GitHub
Browse files

Merge pull request #201568 from ncfavier/df

parents 84e81bb7 34e0667b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ let

          dfhack = callPackage ./dfhack {
            inherit (perlPackages) XMLLibXML XMLLibXSLT;
            inherit dfVersion twbt;
            inherit dfVersion;
            stdenv = gccStdenv;
          };

+34 −49
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
, buildEnv
, lib
, fetchFromGitHub
, fetchpatch
, cmake
, writeScriptBin
, perl
@@ -13,8 +14,6 @@
, allegro5
, libGLU
, libGL
, enableTWBT ? true
, twbt
, SDL
, dfVersion
}:
@@ -23,24 +22,6 @@ with lib;

let
  dfhack-releases = {
    "0.43.05" = {
      dfHackRelease = "0.43.05-r3.1";
      sha256 = "1ds366i0qcfbn62w9qv98lsqcrm38npzgvcr35hf6ihqa6nc6xrl";
      xmlRev = "860a9041a75305609643d465123a4b598140dd7f";
      prerelease = false;
    };
    "0.44.05" = {
      dfHackRelease = "0.44.05-r2";
      sha256 = "1cwifdhi48a976xc472nf6q2k0ibwqffil5a4llcymcxdbgxdcc9";
      xmlRev = "2794f8a6d7405d4858bac486a0bb17b94740c142";
      prerelease = false;
    };
    "0.44.09" = {
      dfHackRelease = "0.44.09-r1";
      sha256 = "1nkfaa43pisbyik5inj5q2hja2vza5lwidg5z02jyh136jm64hwk";
      xmlRev = "3c0bf63674d5430deadaf7befaec42f0ec1e8bc5";
      prerelease = false;
    };
    "0.44.10" = {
      dfHackRelease = "0.44.10-r2";
      sha256 = "19bxsghxzw3bilhr8sm4axz7p7z8lrvbdsd1vdjf5zbg04rs866i";
@@ -66,22 +47,24 @@ let
      prerelease = true;
    };
    "0.47.04" = {
      dfHackRelease = "0.47.04-r2";
      sha256 = "18ppn1dqaxi6ahjzsvb9kw70rvca106a1hibhzc4rxmraypnqb89";
      xmlRev = "036b662a1bbc96b4911f3cbe74dfa1243b6459bc";
      dfHackRelease = "0.47.04-r5";
      sha256 = "sha256-0s+/LKbqsS/mrxKPDeniqykE5+Gy3ZzCa8yEDzMyssY=";
      xmlRev = "be0444cc165a1abff053d5893dc1f780f06526b7";
      prerelease = false;
    };
    "0.47.05" = {
      dfHackRelease = "0.47.05-r1";
      sha256 = "sha256-B0iv7fpIcnaO8sx9wPqI7/WuyLK15p8UYlYIcF5F5bw=";
      xmlRev = "11c379ffd31255f2a1415d98106114a46245e1c3";
      dfHackRelease = "0.47.05-r7";
      sha256 = "sha256-vBKUTSjfCnalkBzfjaIKcxUuqsGGOTtoJC1RHJIDlNc=";
      xmlRev = "f5019a5c6f19ef05a28bd974c3e8668b78e6e2a4";
      prerelease = false;
    };

  };

  release =
    if hasAttr dfVersion dfhack-releases
    if lib.isAttrs dfVersion
    then dfVersion
    else if hasAttr dfVersion dfhack-releases
    then getAttr dfVersion dfhack-releases
    else throw "[DFHack] Unsupported Dwarf Fortress version: ${dfVersion}";

@@ -115,9 +98,9 @@ let
      exit 1
    fi
  '';

  dfhack = stdenv.mkDerivation {
    pname = "dfhack-base";
in
  stdenv.mkDerivation {
    pname = "dfhack";
    inherit version;

    # Beware of submodules
@@ -129,10 +112,20 @@ let
      fetchSubmodules = true;
    };

    patches = [ ./fix-stonesense.patch ];
    patches = lib.optional (lib.versionOlder version "0.44.12-r3") (fetchpatch {
      name = "fix-stonesense.patch";
      url = "https://github.com/DFHack/stonesense/commit/f5be6fe5fb192f01ae4551ed9217e97fd7f6a0ae.patch";
      extraPrefix = "plugins/stonesense/";
      stripLen = 1;
      hash = "sha256-wje6Mkct29eyMOcJnbdefwBOLJko/s4JcJe52ojuW+8=";
    }) ++ lib.optional (lib.versionOlder version "0.47.04-r1") (fetchpatch {
      name = "fix-protobuf.patch";
      url = "https://github.com/DFHack/dfhack/commit/7bdf958518d2892ee89a7173224a069c4a2190d8.patch";
      hash = "sha256-p+mKhmYbnhWKNiGPMjbYO505Gcg634n0nudqH0NX3KY=";
    });

    # gcc 11 fix
    NIX_CFLAGS_COMPILE = "-fpermissive";
    CXXFLAGS = lib.optionalString (lib.versionOlder version "0.47.05-r3") "-fpermissive";

    # As of
    # https://github.com/DFHack/dfhack/commit/56e43a0dde023c5a4595a22b29d800153b31e3c4,
@@ -166,21 +159,13 @@ let
      ln -s ${ruby}/lib/libruby-*.so $out/hack/libruby.so
    '';

  };
in

buildEnv {
  name = "dfhack-${version}";

  passthru = { inherit version dfVersion; };

  paths = [ dfhack ] ++ lib.optionals enableTWBT [ twbt.lib ];
    passthru = { inherit dfVersion; };

    meta = with lib; {
      description = "Memory hacking library for Dwarf Fortress and a set of tools that use it";
      homepage = "https://github.com/DFHack/dfhack/";
      license = licenses.zlib;
      platforms = [ "x86_64-linux" "i686-linux" ];
    maintainers = with maintainers; [ robbinch a1russell abbradar numinit ];
      maintainers = with maintainers; [ robbinch a1russell abbradar numinit ncfavier ];
    };
  }
+0 −23
Original line number Diff line number Diff line
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
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -104,6 +104,6 @@ stdenv.mkDerivation {
    homepage = "https://www.bay12games.com/dwarves/";
    license = licenses.unfreeRedistributable;
    platforms = attrNames platforms;
    maintainers = with maintainers; [ a1russell robbinch roconnor abbradar numinit shazow ];
    maintainers = with maintainers; [ a1russell robbinch roconnor abbradar numinit shazow ncfavier ];
  };
}
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
, theme ? themes.phoebus
  # General config options:
, enableIntro ? true
, enableTruetype ? true
, enableTruetype ? null # defaults to 24, see init.txt
, enableFPS ? false
, enableTextMode ? false
, enableSound ? true
Loading