From e3bb39daf7728d017f7ccdc93bc14d70585ff678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 6 Aug 2021 17:21:32 +0200 Subject: [PATCH 1/4] gitstatus: format, cleanup --- .../git-and-tools/gitstatus/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 ab0ce9c7cd0..d010ac43531 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,12 +11,14 @@ 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 @@ -24,6 +26,7 @@ stdenv.mkDerivation rec { install -Dm555 install $out install -Dm444 build.info $out ''; + # Don't install the "install" and "build.info" files, which the end user # should not need to worry about. pathsToLink = [ From 52cab6b8951fb5e69ee932852f36640dc7b5182f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 6 Aug 2021 17:22:13 +0200 Subject: [PATCH 2/4] gitstatus: move scripts to $out/share/gitstatus, fix a bug when loading from home-manager --- .../git-and-tools/gitstatus/default.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 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 d010ac43531..4a0cbc708be 100644 --- a/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix +++ b/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix @@ -21,18 +21,23 @@ stdenv.mkDerivation rec { 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 @@ -50,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 From f4cae7047edae00693f005c7da5bdb258e9bb850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 6 Aug 2021 17:22:55 +0200 Subject: [PATCH 3/4] gitstatus: add SuperSandro2000 maintainer --- .../version-management/git-and-tools/gitstatus/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4a0cbc708be..1ab6bfd1a2f 100644 --- a/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix +++ b/pkgs/applications/version-management/git-and-tools/gitstatus/default.nix @@ -85,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 ]; }; } From e4cbde69075dd0ffd175cfc32626bd44c6fd7c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 6 Aug 2021 17:23:08 +0200 Subject: [PATCH 4/4] gitstatus: update libgit2 --- .../git-and-tools/gitstatus/romkatv_libgit2.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/git-and-tools/gitstatus/romkatv_libgit2.nix b/pkgs/applications/version-management/git-and-tools/gitstatus/romkatv_libgit2.nix index 9c74fa35752..f94f772f50f 100644 --- a/pkgs/applications/version-management/git-and-tools/gitstatus/romkatv_libgit2.nix +++ b/pkgs/applications/version-management/git-and-tools/gitstatus/romkatv_libgit2.nix @@ -16,7 +16,7 @@ libgit2.overrideAttrs (oldAttrs: { src = fetchFromGitHub { owner = "romkatv"; repo = "libgit2"; - rev = "tag-82cefe2b42300224ad3c148f8b1a569757cc617a"; - sha256 = "1vhnqynqyxizzkq1h5dfjm75f0jm5637jh0gypwqqz2yjqrscza0"; + rev = "tag-5860a42d19bcd226cb6eff2dcbfcbf155d570c73"; + sha256 = "sha256-OdGLNGOzXbWQGqw5zYM1RhU4Z2yRXi9cpAt7Vn9+j5I="; }; })