2017-06-07 13:09:48 +01:00
|
|
|
{ stdenv, fetchFromGitHub, jre_headless, jdk, ant, saxon }:
|
2016-11-05 08:55:51 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "jing-trang-${version}";
|
2017-11-10 11:59:24 +00:00
|
|
|
version = "20151127";
|
2016-11-05 08:55:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "relaxng";
|
|
|
|
repo = "jing-trang";
|
2017-11-10 11:59:24 +00:00
|
|
|
rev = "47a0cbdaec2d48824b78a1c19879ac7875509598"; # needed to compile with jdk8
|
|
|
|
sha256 = "1hhn52z9mv1x9nyvyqnmzg5yrs2lzm9xac7i15izppv02wp32qha";
|
2016-11-05 08:55:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ jdk ant saxon ];
|
|
|
|
|
2016-11-05 09:15:54 +00:00
|
|
|
preBuild = "ant";
|
2016-11-05 08:55:51 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"/{share/java,bin}
|
|
|
|
cp ./build/*.jar "$out/share/java/"
|
|
|
|
|
|
|
|
for tool in jing trang; do
|
2016-11-05 09:16:35 +00:00
|
|
|
cat > "$out/bin/$tool" <<EOF
|
|
|
|
#! $SHELL
|
2017-06-07 13:09:48 +01:00
|
|
|
export JAVA_HOME='${jre_headless}'
|
|
|
|
exec '${jre_headless}/bin/java' -jar '$out/share/java/$tool.jar' "\$@"
|
2016-11-05 09:16:35 +00:00
|
|
|
EOF
|
2016-11-05 08:55:51 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
chmod +x "$out"/bin/*
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
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".
|
2017-11-10 11:59:24 +00:00
|
|
|
homepage = "http://www.thaiopensource.com/relaxng/trang.html";
|
2017-05-02 19:49:27 +01:00
|
|
|
platforms = platforms.unix;
|
2016-11-05 08:55:51 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|