about summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-08-11 16:22:42 +0200
committerJan Tojnar <jtojnar@gmail.com>2021-08-11 16:22:42 +0200
commit4e7e464ae8e897d487fc412b50560f9f5f744353 (patch)
tree606f3898906c89a001671f51e6c0315d73e79277 /pkgs/applications/version-management/git-and-tools/gitstatus/default.nix
parent610ef47b2030813fcc9017eeda5bfd7621851bc3 (diff)
parent59287a7ba19cafec0301f77acf16ee28b4f5fd84 (diff)
downloadnixlib-4e7e464ae8e897d487fc412b50560f9f5f744353.tar
nixlib-4e7e464ae8e897d487fc412b50560f9f5f744353.tar.gz
nixlib-4e7e464ae8e897d487fc412b50560f9f5f744353.tar.bz2
nixlib-4e7e464ae8e897d487fc412b50560f9f5f744353.tar.lz
nixlib-4e7e464ae8e897d487fc412b50560f9f5f744353.tar.xz
nixlib-4e7e464ae8e897d487fc412b50560f9f5f744353.tar.zst
nixlib-4e7e464ae8e897d487fc412b50560f9f5f744353.zip
Merge branch 'master' into staging-next
; Conflicts:
;	pkgs/tools/system/sg3_utils/default.nix
Diffstat (limited to 'pkgs/applications/version-management/git-and-tools/gitstatus/default.nix')
-rw-r--r--pkgs/applications/version-management/git-and-tools/gitstatus/default.nix30
1 files changed, 19 insertions, 11 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix b/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix
index ab0ce9c7cd0f..1ab6bfd1a2f3 100644
--- a/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix
@@ -1,4 +1,4 @@
-{ callPackage, lib, stdenv, fetchFromGitHub, git, zsh, ...}:
+{ callPackage, lib, stdenv, fetchFromGitHub, git, zsh }:
 
 stdenv.mkDerivation rec {
   pname = "gitstatus";
@@ -11,25 +11,33 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-MQG4thW73gDqY68bKP2FO8z5uc2R/tED+/X9qas/GOA=";
   };
 
-  buildInputs = [ (callPackage ./romkatv_libgit2.nix {}) ];
-  patchPhase = ''
+  buildInputs = [ (callPackage ./romkatv_libgit2.nix { }) ];
+
+  postPatch = ''
     sed -i '1i GITSTATUS_AUTO_INSTALL=''${GITSTATUS_AUTO_INSTALL-0}' gitstatus.plugin.sh
     sed -i '1i GITSTATUS_AUTO_INSTALL=''${GITSTATUS_AUTO_INSTALL-0}' gitstatus.plugin.zsh
     sed -i "1a GITSTATUS_DAEMON=$out/bin/gitstatusd" install
   '';
+
   installPhase = ''
     install -Dm755 usrbin/gitstatusd $out/bin/gitstatusd
-    install -Dm444 gitstatus.plugin.sh $out
-    install -Dm444 gitstatus.plugin.zsh $out
-    install -Dm555 install $out
-    install -Dm444 build.info $out
+    install -Dm444 gitstatus.plugin.sh -t $out/share/gitstatus/
+    install -Dm444 gitstatus.plugin.zsh -t $out/share/gitstatus/
+    install -Dm555 install -t $out/share/gitstatus/
+    install -Dm444 build.info -t $out/share/gitstatus/
+
+    # the fallback path is wrong in the case of home-manager
+    # because the FHS directories don't start at /
+    substituteInPlace install \
+      --replace "_gitstatus_install_main ." "_gitstatus_install_main $out"
   '';
+
   # Don't install the "install" and "build.info" files, which the end user
   # should not need to worry about.
   pathsToLink = [
     "/bin/gitstatusd"
-    "/gitstatus.plugin.sh"
-    "/gitstatus.plugin.zsh"
+    "/share/gitstatus/gitstatus.plugin.sh"
+    "/share/gitstatus/gitstatus.plugin.zsh"
   ];
 
   # The install check sets up an empty Git repository and a minimal zshrc that
@@ -47,7 +55,7 @@ stdenv.mkDerivation rec {
 
     echo '
       GITSTATUS_LOG_LEVEL=DEBUG
-      . $out/gitstatus.plugin.zsh || exit 1
+      . $out/share/gitstatus/gitstatus.plugin.zsh || exit 1
 
       gitstatus_stop NIX_TEST && gitstatus_start NIX_TEST
       gitstatus_query NIX_TEST
@@ -77,6 +85,6 @@ stdenv.mkDerivation rec {
     description = "10x faster implementation of `git status` command";
     homepage = "https://github.com/romkatv/gitstatus";
     license = licenses.gpl3Only;
-    maintainers = with maintainers; [ mmlb hexa ];
+    maintainers = with maintainers; [ mmlb hexa SuperSandro2000 ];
   };
 }