From 10cc136ed12c120506a446572c26218f38f23f1a Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Wed, 7 Aug 2019 12:06:17 +0800 Subject: [PATCH] grc: leave /etc/grc.conf alone so we can override it plus a few minor cleanups --- pkgs/tools/misc/grc/default.nix | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/misc/grc/default.nix b/pkgs/tools/misc/grc/default.nix index 451828b0f47b..828d4e4dab78 100644 --- a/pkgs/tools/misc/grc/default.nix +++ b/pkgs/tools/misc/grc/default.nix @@ -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 '';