Merge pull request #145520 from SuperSandro2000/highlight

highlight: remove with lib; convert prePatch to postPatch

authored by Thiago Kenji Okada and committed by GitHub 08c9f103 a5e4ef9a

+6 -7
+6 -7
pkgs/tools/text/highlight/default.nix
··· 1 { lib, stdenv, fetchFromGitLab, getopt, lua, boost, pkg-config, swig, perl, gcc }: 2 3 - with lib; 4 - 5 let 6 self = stdenv.mkDerivation rec { 7 pname = "highlight"; ··· 16 17 enableParallelBuilding = true; 18 19 - nativeBuildInputs = [ pkg-config swig perl ] ++ optional stdenv.isDarwin gcc; 20 21 buildInputs = [ getopt lua boost ]; 22 23 - prePatch = '' 24 substituteInPlace src/makefile \ 25 --replace "shell pkg-config" "shell $PKG_CONFIG" 26 substituteInPlace makefile \ ··· 36 37 # This has to happen _before_ the main build because it does a 38 # `make clean' for some reason. 39 - preBuild = optionalString (!stdenv.isDarwin) '' 40 make -C extras/swig $makeFlags perl 41 ''; 42 43 - postCheck = optionalString (!stdenv.isDarwin) '' 44 perl -Iextras/swig extras/swig/testmod.pl 45 ''; 46 47 - preInstall = optionalString (!stdenv.isDarwin) '' 48 mkdir -p $out/${perl.libPrefix} 49 install -m644 extras/swig/highlight.{so,pm} $out/${perl.libPrefix} 50 make -C extras/swig clean # Clean up intermediate files.
··· 1 { lib, stdenv, fetchFromGitLab, getopt, lua, boost, pkg-config, swig, perl, gcc }: 2 3 let 4 self = stdenv.mkDerivation rec { 5 pname = "highlight"; ··· 14 15 enableParallelBuilding = true; 16 17 + nativeBuildInputs = [ pkg-config swig perl ] 18 + ++ lib.optional stdenv.isDarwin gcc; 19 20 buildInputs = [ getopt lua boost ]; 21 22 + postPatch = '' 23 substituteInPlace src/makefile \ 24 --replace "shell pkg-config" "shell $PKG_CONFIG" 25 substituteInPlace makefile \ ··· 35 36 # This has to happen _before_ the main build because it does a 37 # `make clean' for some reason. 38 + preBuild = lib.optionalString (!stdenv.isDarwin) '' 39 make -C extras/swig $makeFlags perl 40 ''; 41 42 + postCheck = lib.optionalString (!stdenv.isDarwin) '' 43 perl -Iextras/swig extras/swig/testmod.pl 44 ''; 45 46 + preInstall = lib.optionalString (!stdenv.isDarwin) '' 47 mkdir -p $out/${perl.libPrefix} 48 install -m644 extras/swig/highlight.{so,pm} $out/${perl.libPrefix} 49 make -C extras/swig clean # Clean up intermediate files.