{ lib, stdenv, fetchFromGitHub, jre_headless, jdk, ant, saxon }: stdenv.mkDerivation rec { pname = "jing-trang"; version = "20181222"; src = fetchFromGitHub { owner = "relaxng"; repo = "jing-trang"; rev = "V${version}"; sha256 = "sha256-Krupa3MGk5UaaQsaNpPMZuIUzHJytDiksz9ysCPkFS4="; fetchSubmodules = true; }; buildInputs = [ jdk ant saxon ]; CLASSPATH = "lib/saxon.jar"; patches = [ ./no-git-during-build.patch ]; preBuild = "ant"; installPhase = '' mkdir -p "$out"/{share/java,bin} cp ./build/*.jar "$out/share/java/" for tool in jing trang; do cat > "$out/bin/$tool" <