-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
36 lines (32 loc) · 940 Bytes
/
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
{ pkgs ? let
lock = (builtins.fromJSON
(builtins.readFile ../../flake.lock)).nodes.nixpkgs.locked;
nixpkgs = fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
};
in import nixpkgs { }, jre ? pkgs.jre
, saxon_cp ? "${pkgs.saxon-he}/saxon9he.jar", ... }:
let
pname = "xspec";
version = "2.2.4";
in pkgs.stdenv.mkDerivation {
inherit pname version;
buildInputs = with pkgs; [ makeWrapper ];
src = pkgs.fetchFromGitHub {
owner = "xspec";
repo = "xspec";
rev = "v${version}";
sha256 = "sha256-8cy/B8J6O86vYFQbhOVrAriOeD2kaQCRYfIS/xTP1KQ=";
};
configurePhase = ''
mkdir -p $out/{xspec,bin}
shopt -s extglob dotglob
mv !($out) $out/xspec
'';
postFixup = ''
makeWrapper $out/xspec/bin/xspec.sh $out/bin/${pname} \
--prefix PATH : ${pkgs.lib.makeBinPath [ jre ]} \
--set-default SAXON_CP ${saxon_cp}
'';
}