highlight: remove with lib; convert prePatch to postPatch
This commit is contained in:
parent
b7d071664d
commit
d3c28b6f84
1 changed files with 6 additions and 7 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue