nixpkgs-suyu/pkgs/tools/text/xml/jing-trang/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

43 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, jre_headless, jdk, ant, saxon }:
stdenv.mkDerivation {
pname = "jing-trang";
version = "20151127";
src = fetchFromGitHub {
owner = "relaxng";
repo = "jing-trang";
rev = "47a0cbdaec2d48824b78a1c19879ac7875509598"; # needed to compile with jdk8
sha256 = "1hhn52z9mv1x9nyvyqnmzg5yrs2lzm9xac7i15izppv02wp32qha";
};
buildInputs = [ jdk ant saxon ];
CLASSPATH = "lib/saxon.jar";
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/*
'';
meta = with 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".
homepage = "https://www.thaiopensource.com/relaxng/trang.html";
platforms = platforms.unix;
maintainers = [ maintainers.bjornfor ];
};
}