about summary refs log tree commit diff
path: root/pkgs/by-name/go/got/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/go/got/package.nix')
-rw-r--r--pkgs/by-name/go/got/package.nix29
1 files changed, 25 insertions, 4 deletions
diff --git a/pkgs/by-name/go/got/package.nix b/pkgs/by-name/go/got/package.nix
index 7faf1ff013a5a..942e758972ff7 100644
--- a/pkgs/by-name/go/got/package.nix
+++ b/pkgs/by-name/go/got/package.nix
@@ -13,15 +13,25 @@
 , bison
 , autoPatchelfHook
 , testers
+, signify
+, overrideSDK
+, withSsh ? true, openssh
+# Default editor to use when neither VISUAL nor EDITOR are defined
+, defaultEditor ? null
 }:
 
-stdenv.mkDerivation (finalAttrs: {
+let
+  stdenv' = if stdenv.isDarwin && stdenv.isx86_64
+    then overrideSDK stdenv "11.0"
+    else stdenv;
+in
+stdenv'.mkDerivation (finalAttrs: {
   pname = "got";
-  version = "0.100";
+  version = "0.102";
 
   src = fetchurl {
     url = "https://gameoftrees.org/releases/portable/got-portable-${finalAttrs.version}.tar.gz";
-    hash = "sha256-/DqKIGf/aZ09aL/rB7te+AauHmJ+mOTrVEbkqT9WUBI=";
+    hash = "sha256-qstQ6mZLCdYL5uQauMt7nGlEdPkPneGfu36RbaboN3c=";
   };
 
   nativeBuildInputs = [ pkg-config bison ]
@@ -37,7 +47,18 @@ stdenv.mkDerivation (finalAttrs: {
     substituteInPlace configure --replace-fail 'xdarwin' 'xhomebrew'
   '';
 
-  env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
+  env.NIX_CFLAGS_COMPILE = toString (
+  lib.optionals (defaultEditor != null) [
+    ''-DGOT_DEFAULT_EDITOR="${lib.getExe defaultEditor}"''
+  ] ++ lib.optionals withSsh [
+    ''-DGOT_DIAL_PATH_SSH="${lib.getExe openssh}"''
+    ''-DGOT_TAG_PATH_SSH_KEYGEN="${lib.getExe' openssh "ssh-keygen"}"''
+  ] ++ lib.optionals stdenv.isLinux [
+    ''-DGOT_TAG_PATH_SIGNIFY="${lib.getExe signify}"''
+  ] ++ lib.optionals stdenv.cc.isClang [
+    "-Wno-error=implicit-function-declaration"
+    "-Wno-error=int-conversion"
+  ] ++ lib.optionals stdenv.isDarwin [
     # error: conflicting types for 'strmode'
     "-DHAVE_STRMODE=1"
     # Undefined symbols for architecture arm64: "_bsd_getopt"