Merge pull request #66248 from peterhoeg/f/grc

grc: leave /etc/grc.conf alone so we can override it
This commit is contained in:
Peter Hoeg 2019-08-26 14:35:48 +08:00 committed by GitHub
commit de20ba7ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,9 @@
{ stdenv, fetchFromGitHub, python3Packages, makeWrapper }:
{ stdenv, fetchFromGitHub, python3Packages }:
stdenv.mkDerivation rec {
name = "grc-${version}";
python3Packages.buildPythonApplication rec {
pname = "grc";
version = "1.11.3";
format = "other";
src = fetchFromGitHub {
owner = "garabik";
@ -11,22 +12,18 @@ stdenv.mkDerivation rec {
sha256 = "0b3wx9zr7l642hizk93ysbdss7rfymn22b2ykj4kpkf1agjkbv35";
};
buildInputs = with python3Packages; [ wrapPython makeWrapper ];
postPatch = ''
for f in grc grcat; do
substituteInPlace $f \
--replace /usr/local/ $out/
done
'';
installPhase = ''
runHook preInstall
./install.sh "$out" "$out"
for f in $out/bin/* ; do
patchPythonScript $f
substituteInPlace $f \
--replace ' /usr/bin/env python3' '${python3Packages.python.interpreter}' \
--replace "'/etc/grc.conf'" "'$out/etc/grc.conf'" \
--replace "'/usr/share/grc/'" "'$out/share/grc/'"
wrapProgram $f \
--prefix PATH : $out/bin
done
install -Dm444 -t $out/share/zsh/vendor-completions _grc
runHook postInstall
'';