mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-23 12:34:15 +00:00
Merge pull request #145520 from SuperSandro2000/highlight
highlight: remove with lib; convert prePatch to postPatch
This commit is contained in:
commit
08c9f103f5
@ -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 New Issue
Block a user