Merge pull request #132991 from SuperSandro2000/gitstatus

Gitstatus
This commit is contained in:
Pascal Bach 2021-08-09 23:24:59 +02:00 committed by GitHub
commit 293026e7ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 13 deletions

View file

@ -1,4 +1,4 @@
{ callPackage, lib, stdenv, fetchFromGitHub, git, zsh, ...}: { callPackage, lib, stdenv, fetchFromGitHub, git, zsh }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gitstatus"; pname = "gitstatus";
@ -11,25 +11,33 @@ stdenv.mkDerivation rec {
sha256 = "sha256-MQG4thW73gDqY68bKP2FO8z5uc2R/tED+/X9qas/GOA="; sha256 = "sha256-MQG4thW73gDqY68bKP2FO8z5uc2R/tED+/X9qas/GOA=";
}; };
buildInputs = [ (callPackage ./romkatv_libgit2.nix {}) ]; buildInputs = [ (callPackage ./romkatv_libgit2.nix { }) ];
patchPhase = ''
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.sh
sed -i '1i GITSTATUS_AUTO_INSTALL=''${GITSTATUS_AUTO_INSTALL-0}' gitstatus.plugin.zsh sed -i '1i GITSTATUS_AUTO_INSTALL=''${GITSTATUS_AUTO_INSTALL-0}' gitstatus.plugin.zsh
sed -i "1a GITSTATUS_DAEMON=$out/bin/gitstatusd" install sed -i "1a GITSTATUS_DAEMON=$out/bin/gitstatusd" install
''; '';
installPhase = '' installPhase = ''
install -Dm755 usrbin/gitstatusd $out/bin/gitstatusd install -Dm755 usrbin/gitstatusd $out/bin/gitstatusd
install -Dm444 gitstatus.plugin.sh $out install -Dm444 gitstatus.plugin.sh -t $out/share/gitstatus/
install -Dm444 gitstatus.plugin.zsh $out install -Dm444 gitstatus.plugin.zsh -t $out/share/gitstatus/
install -Dm555 install $out install -Dm555 install -t $out/share/gitstatus/
install -Dm444 build.info $out 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 # Don't install the "install" and "build.info" files, which the end user
# should not need to worry about. # should not need to worry about.
pathsToLink = [ pathsToLink = [
"/bin/gitstatusd" "/bin/gitstatusd"
"/gitstatus.plugin.sh" "/share/gitstatus/gitstatus.plugin.sh"
"/gitstatus.plugin.zsh" "/share/gitstatus/gitstatus.plugin.zsh"
]; ];
# The install check sets up an empty Git repository and a minimal zshrc that # The install check sets up an empty Git repository and a minimal zshrc that
@ -47,7 +55,7 @@ stdenv.mkDerivation rec {
echo ' echo '
GITSTATUS_LOG_LEVEL=DEBUG 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_stop NIX_TEST && gitstatus_start NIX_TEST
gitstatus_query NIX_TEST gitstatus_query NIX_TEST
@ -77,6 +85,6 @@ stdenv.mkDerivation rec {
description = "10x faster implementation of `git status` command"; description = "10x faster implementation of `git status` command";
homepage = "https://github.com/romkatv/gitstatus"; homepage = "https://github.com/romkatv/gitstatus";
license = licenses.gpl3Only; license = licenses.gpl3Only;
maintainers = with maintainers; [ mmlb hexa ]; maintainers = with maintainers; [ mmlb hexa SuperSandro2000 ];
}; };
} }

View file

@ -16,7 +16,7 @@ libgit2.overrideAttrs (oldAttrs: {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "romkatv"; owner = "romkatv";
repo = "libgit2"; repo = "libgit2";
rev = "tag-82cefe2b42300224ad3c148f8b1a569757cc617a"; rev = "tag-5860a42d19bcd226cb6eff2dcbfcbf155d570c73";
sha256 = "1vhnqynqyxizzkq1h5dfjm75f0jm5637jh0gypwqqz2yjqrscza0"; sha256 = "sha256-OdGLNGOzXbWQGqw5zYM1RhU4Z2yRXi9cpAt7Vn9+j5I=";
}; };
}) })