2022-04-03 18:54:34 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, jre_headless, jdk_headless, 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
|
|
|
};
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
buildInputs = [ jdk_headless ant saxon ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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}
|
2023-08-10 07:59:29 +00:00
|
|
|
cp ./build/*.jar ./lib/resolver.jar "$out/share/java/"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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;
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryBytecode # source bundles dependencies as jars
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|