2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, jre_headless, jdk, ant, saxon }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "jing-trang";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "20181222";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "relaxng";
|
|
|
|
repo = "jing-trang";
|
2021-12-06 16:07:01 +00:00
|
|
|
rev = "V${version}";
|
|
|
|
sha256 = "sha256-Krupa3MGk5UaaQsaNpPMZuIUzHJytDiksz9ysCPkFS4=";
|
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ jdk ant saxon ];
|
|
|
|
|
|
|
|
CLASSPATH = "lib/saxon.jar";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
patches = [
|
|
|
|
./no-git-during-build.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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" <<EOF
|
|
|
|
#! $SHELL
|
|
|
|
export JAVA_HOME='${jre_headless}'
|
|
|
|
exec '${jre_headless}/bin/java' -jar '$out/share/java/$tool.jar' "\$@"
|
|
|
|
EOF
|
|
|
|
done
|
|
|
|
|
|
|
|
chmod +x "$out"/bin/*
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = "ant test";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A RELAX NG validator in Java";
|
|
|
|
# The homepage is www.thaiopensource.com, but it links to googlecode.com
|
|
|
|
# for downloads and call it the "project site".
|
|
|
|
homepage = "https://www.thaiopensource.com/relaxng/trang.html";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|