-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
38 lines (31 loc) · 1.12 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ stdenv, lib, writeText, cmake, pandoc, plantuml, graphviz, imagemagick7, makeWrapper, bash }:
let
cmakeVersionRegex = ".*project\\(.*VERSION[[:space:]]+([[:digit:]\\.]+).*";
version = builtins.head (builtins.match cmakeVersionRegex (builtins.readFile ./CMakeLists.txt));
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "docproc";
inherit version;
src = ./.;
setupHook = writeText "setupHook.sh" ''
setDocprocDir() {
if [[ -r "$1/share/cmake/${pname}/${pname}-config.cmake" ]]; then
export docproc_DIR="$1"
fi
}
addEnvHooks "$targetOffset" setDocprocDir
'';
nativeBuildInputs = [ cmake setupHook pandoc plantuml graphviz imagemagick7 ];
buildInputs = [ makeWrapper bash ];
doCheck = true;
postPatch = ''
substituteInPlace tests/pandoc-version --replace "/usr/bin/env bash" ${bash}/bin/bash
'';
meta = with lib; {
description = "A cmake-package for document processing based on pandoc";
homepage = https://github.com/igsha/docproc;
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ igsha ];
};
}