Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 67 lines 1.4 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 jre_headless, 6 jdk_headless, 7 ant, 8 saxon, 9}: 10 11stdenv.mkDerivation rec { 12 pname = "jing-trang"; 13 version = "20181222"; 14 15 src = fetchFromGitHub { 16 owner = "relaxng"; 17 repo = "jing-trang"; 18 rev = "V${version}"; 19 hash = "sha256-Krupa3MGk5UaaQsaNpPMZuIUzHJytDiksz9ysCPkFS4="; 20 fetchSubmodules = true; 21 }; 22 23 buildInputs = [ 24 jdk_headless 25 ant 26 saxon 27 ]; 28 29 CLASSPATH = "lib/saxon.jar"; 30 31 patches = [ 32 ./no-git-during-build.patch 33 ]; 34 35 preBuild = "ant"; 36 37 installPhase = '' 38 mkdir -p "$out"/{share/java,bin} 39 cp ./build/*.jar ./lib/resolver.jar "$out/share/java/" 40 41 for tool in jing trang; do 42 cat > "$out/bin/$tool" <<EOF 43 #! $SHELL 44 export JAVA_HOME='${jre_headless}' 45 exec '${jre_headless}/bin/java' -jar '$out/share/java/$tool.jar' "\$@" 46 EOF 47 done 48 49 chmod +x "$out"/bin/* 50 ''; 51 52 doCheck = true; 53 checkPhase = "ant test"; 54 55 meta = with lib; { 56 description = "RELAX NG validator in Java"; 57 # The homepage is www.thaiopensource.com, but it links to googlecode.com 58 # for downloads and call it the "project site". 59 homepage = "https://www.thaiopensource.com/relaxng/trang.html"; 60 platforms = platforms.unix; 61 sourceProvenance = with sourceTypes; [ 62 fromSource 63 binaryBytecode # source bundles dependencies as jars 64 ]; 65 maintainers = [ maintainers.bjornfor ]; 66 }; 67}