summary refs log tree commit diff
path: root/pkgs/games/cataclysm-dda/git.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/cataclysm-dda/git.nix')
-rw-r--r--pkgs/games/cataclysm-dda/git.nix54
1 files changed, 31 insertions, 23 deletions
diff --git a/pkgs/games/cataclysm-dda/git.nix b/pkgs/games/cataclysm-dda/git.nix
index 8e3c3e33994..36f37f7aeba 100644
--- a/pkgs/games/cataclysm-dda/git.nix
+++ b/pkgs/games/cataclysm-dda/git.nix
@@ -1,33 +1,41 @@
-{ stdenv, callPackage, CoreFoundation
+{ lib, callPackage, CoreFoundation, fetchFromGitHub, pkgs, wrapCDDA
 , tiles ? true, Cocoa
 , debug ? false
+, useXdgDir ? false
+, version ? "2019-11-22"
+, rev ? "a6c8ece992bffeae3788425dd4b3b5871e66a9cd"
+, sha256 ? "0ww2q5gykxm802z1kffmnrfahjlx123j1gfszklpsv0b1fccm1ab"
 }:
 
 let
-  inherit (stdenv.lib) substring;
-  inherit (callPackage ./common.nix { inherit tiles CoreFoundation Cocoa debug; }) common utils;
-  inherit (utils) fetchFromCleverRaven;
-in
+  common = callPackage ./common.nix {
+    inherit CoreFoundation tiles Cocoa debug useXdgDir;
+  };
 
-stdenv.mkDerivation (common // rec {
-  version = "2019-11-22";
-  name = "cataclysm-dda-git-${version}";
+  self = common.overrideAttrs (common: rec {
+    pname = common.pname + "-git";
+    inherit version;
 
-  src = fetchFromCleverRaven {
-    rev = "a6c8ece992bffeae3788425dd4b3b5871e66a9cd";
-    sha256 = "0ww2q5gykxm802z1kffmnrfahjlx123j1gfszklpsv0b1fccm1ab";
-  };
+    src = fetchFromGitHub {
+      owner = "CleverRaven";
+      repo = "Cataclysm-DDA";
+      inherit rev sha256;
+    };
 
-  patches = [
-    # Locale patch required for Darwin builds, see: https://github.com/NixOS/nixpkgs/pull/74064#issuecomment-560083970
-    ./patches/fix_locale_dir_git.patch
-  ];
+    makeFlags = common.makeFlags ++ [
+      "VERSION=git-${version}-${lib.substring 0 8 src.rev}"
+    ];
 
-  makeFlags = common.makeFlags ++ [
-    "VERSION=git-${version}-${substring 0 8 src.rev}"
-  ];
+    passthru = common.passthru // {
+      pkgs = pkgs.override { build = self; };
+      withMods = wrapCDDA self;
+    };
 
-  meta = with stdenv.lib.maintainers; common.meta // {
-    maintainers = common.meta.maintainers ++ [ rardiol ];
-  };
-})
+    meta = common.meta // {
+      maintainers = with lib.maintainers;
+      common.meta.maintainers ++ [ rardiol ];
+    };
+  });
+in
+
+self