gti: refactor installation, install completion (#210682)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
laalsaas 2023-01-24 00:14:30 +01:00 committed by GitHub
parent 7115ead0f2
commit c510d1e646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,8 @@
{ lib, stdenv, fetchFromGitHub }: { lib
, stdenv
, fetchFromGitHub
, installShellFiles
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gti"; pname = "gti";
@ -15,10 +19,16 @@ stdenv.mkDerivation rec {
substituteInPlace Makefile --replace 'CC=cc' 'CC=${stdenv.cc.targetPrefix}cc' substituteInPlace Makefile --replace 'CC=cc' 'CC=${stdenv.cc.targetPrefix}cc'
''; '';
nativeBuildInputs = [
installShellFiles
];
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/share/man/man6 install -D gti $out/bin/gti
cp gti $out/bin installManPage gti.6
cp gti.6 $out/share/man/man6 installShellCompletion --cmd gti \
--bash completions/gti.bash \
--zsh completions/gti.zsh
''; '';
meta = with lib; { meta = with lib; {