ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / dw / dwt1-shell-color-scripts / package.nix
blob0843962703fe5272fe0afc9a2514950c803d620c
1 { lib
2 , stdenvNoCC
3 , fetchFromGitLab
4 , installShellFiles
5 }:
7 stdenvNoCC.mkDerivation {
8   pname = "dwt1-shell-color-scripts";
9   version = "unstable-2023-03-27";
11   src = fetchFromGitLab {
12     owner = "dwt1";
13     repo = "shell-color-scripts";
14     rev = "576735cf656ece1bfd314e617b91c0e9d486d262";
15     hash = "sha256-1iDcUv6uVq5LzFgZo36RRKqAzKoYKZW/MnlbneayvCY=";
16   };
18   nativeBuildInputs = [ installShellFiles ];
20   postPatch = ''
21     patchShebangs ./colorscript.sh
22     patchShebangs ./colorscripts
23   '';
25   installPhase = ''
26     runHook preInstall
28     mkdir -p $out/bin $out/share/shell-color-scripts
29     install -Dm755 colorscript.sh $out/bin/colorscript
30     cp -r colorscripts $out/share/shell-color-scripts/colorscripts
32     installManPage colorscript.1
33     installShellCompletion --fish completions/colorscript.fish
34     installShellCompletion --zsh completions/_colorscript
36     runHook postInstall
37   '';
39   postFixup = ''
40     substituteInPlace \
41       $out/bin/colorscript \
42       $out/share/fish/vendor_completions.d/colorscript.fish \
43       $out/share/zsh/site-functions/_colorscript \
44       --replace-fail "/opt/shell-color-scripts/colorscripts" \
45         "$out/share/shell-color-scripts/colorscripts"
46   '';
48   meta = {
49     homepage = "https://gitlab.com/dwt1/shell-color-scripts";
50     description = "Collection of shell color scripts collected by dt (Derek Taylor)";
51     license = with lib.licenses; [ mit ];
52     maintainers = [ ];
53     platforms = lib.platforms.all;
54     mainProgram = "colorscript";
55   };