From d3c28b6f842ad813c61edb7330e012e3da3fb6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 11 Nov 2021 18:10:20 +0100 Subject: [PATCH] highlight: remove with lib; convert prePatch to postPatch --- pkgs/tools/text/highlight/default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/text/highlight/default.nix b/pkgs/tools/text/highlight/default.nix index 82d5eab5086..57c607e69c6 100644 --- a/pkgs/tools/text/highlight/default.nix +++ b/pkgs/tools/text/highlight/default.nix @@ -1,7 +1,5 @@ { lib, stdenv, fetchFromGitLab, getopt, lua, boost, pkg-config, swig, perl, gcc }: -with lib; - let self = stdenv.mkDerivation rec { pname = "highlight"; @@ -16,11 +14,12 @@ let enableParallelBuilding = true; - nativeBuildInputs = [ pkg-config swig perl ] ++ optional stdenv.isDarwin gcc; + nativeBuildInputs = [ pkg-config swig perl ] + ++ lib.optional stdenv.isDarwin gcc; buildInputs = [ getopt lua boost ]; - prePatch = '' + postPatch = '' substituteInPlace src/makefile \ --replace "shell pkg-config" "shell $PKG_CONFIG" substituteInPlace makefile \ @@ -36,15 +35,15 @@ let # This has to happen _before_ the main build because it does a # `make clean' for some reason. - preBuild = optionalString (!stdenv.isDarwin) '' + preBuild = lib.optionalString (!stdenv.isDarwin) '' make -C extras/swig $makeFlags perl ''; - postCheck = optionalString (!stdenv.isDarwin) '' + postCheck = lib.optionalString (!stdenv.isDarwin) '' perl -Iextras/swig extras/swig/testmod.pl ''; - preInstall = optionalString (!stdenv.isDarwin) '' + preInstall = lib.optionalString (!stdenv.isDarwin) '' mkdir -p $out/${perl.libPrefix} install -m644 extras/swig/highlight.{so,pm} $out/${perl.libPrefix} make -C extras/swig clean # Clean up intermediate files.