git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #132991 from SuperSandro2000/gitstatus

Gitstatus

commit293026e7ca6d813577896cfd295e44d83098fb35 authorPascal Bach <pascal.bach@nextrem.ch> dateMon 9 Aug 2021, 23:24 (5 years ago) parent37d93c8e4cbde6
2 files changed+21−13
pkgs/applications/version-management/git-and-tools/gitstatus/default.nix+19−11 pkgs/applications/version-management/git-and-tools/gitstatus/romkatv_libgit2.nix+2−2
pkgs/applications/version-management/git-and-tools/gitstatus/default.nix+19−11
@@ -1,4 +1,4 @@
1−{ callPackage, lib, stdenv, fetchFromGitHub, git, zsh, ...}:
1+{ callPackage, lib, stdenv, fetchFromGitHub, git, zsh }:
22
33stdenv.mkDerivation rec {
44 pname = "gitstatus";
@@ -11,25 +11,33 @@ stdenv.mkDerivation rec {
1111 sha256 = "sha256-MQG4thW73gDqY68bKP2FO8z5uc2R/tED+/X9qas/GOA=";
1212 };
1313
14− buildInputs = [ (callPackage ./romkatv_libgit2.nix {}) ];
15− patchPhase = ''
14+ buildInputs = [ (callPackage ./romkatv_libgit2.nix { }) ];
15+
16+ postPatch = ''
1617 sed -i '1i GITSTATUS_AUTO_INSTALL=''${GITSTATUS_AUTO_INSTALL-0}' gitstatus.plugin.sh
1718 sed -i '1i GITSTATUS_AUTO_INSTALL=''${GITSTATUS_AUTO_INSTALL-0}' gitstatus.plugin.zsh
1819 sed -i "1a GITSTATUS_DAEMON=$out/bin/gitstatusd" install
1920 '';
21+
2022 installPhase = ''
2123 install -Dm755 usrbin/gitstatusd $out/bin/gitstatusd
22− install -Dm444 gitstatus.plugin.sh $out
23− install -Dm444 gitstatus.plugin.zsh $out
24− install -Dm555 install $out
25− install -Dm444 build.info $out
24+ install -Dm444 gitstatus.plugin.sh -t $out/share/gitstatus/
25+ install -Dm444 gitstatus.plugin.zsh -t $out/share/gitstatus/
26+ install -Dm555 install -t $out/share/gitstatus/
27+ install -Dm444 build.info -t $out/share/gitstatus/
28+
29+ # the fallback path is wrong in the case of home-manager
30+ # because the FHS directories don't start at /
31+ substituteInPlace install \
32+ --replace "_gitstatus_install_main ." "_gitstatus_install_main $out"
2633 '';
34+
2735 # Don't install the "install" and "build.info" files, which the end user
2836 # should not need to worry about.
2937 pathsToLink = [
3038 "/bin/gitstatusd"
31− "/gitstatus.plugin.sh"
32− "/gitstatus.plugin.zsh"
39+ "/share/gitstatus/gitstatus.plugin.sh"
40+ "/share/gitstatus/gitstatus.plugin.zsh"
3341 ];
3442
3543 # The install check sets up an empty Git repository and a minimal zshrc that
@@ -47,7 +55,7 @@ stdenv.mkDerivation rec {
4755
4856 echo '
4957 GITSTATUS_LOG_LEVEL=DEBUG
50− . $out/gitstatus.plugin.zsh || exit 1
58+ . $out/share/gitstatus/gitstatus.plugin.zsh || exit 1
5159
5260 gitstatus_stop NIX_TEST && gitstatus_start NIX_TEST
5361 gitstatus_query NIX_TEST
@@ -77,6 +85,6 @@ stdenv.mkDerivation rec {
7785 description = "10x faster implementation of `git status` command";
7886 homepage = "https://github.com/romkatv/gitstatus";
7987 license = licenses.gpl3Only;
80− maintainers = with maintainers; [ mmlb hexa ];
88+ maintainers = with maintainers; [ mmlb hexa SuperSandro2000 ];
8189 };
8290}
pkgs/applications/version-management/git-and-tools/gitstatus/romkatv_libgit2.nix+2−2
@@ -16,7 +16,7 @@ libgit2.overrideAttrs (oldAttrs: {
1616 src = fetchFromGitHub {
1717 owner = "romkatv";
1818 repo = "libgit2";
19− rev = "tag-82cefe2b42300224ad3c148f8b1a569757cc617a";
20− sha256 = "1vhnqynqyxizzkq1h5dfjm75f0jm5637jh0gypwqqz2yjqrscza0";
19+ rev = "tag-5860a42d19bcd226cb6eff2dcbfcbf155d570c73";
20+ sha256 = "sha256-OdGLNGOzXbWQGqw5zYM1RhU4Z2yRXi9cpAt7Vn9+j5I=";
2121 };
2222})