diff --git a/pkgs/development/libraries/java/saxon/default.nix b/pkgs/development/libraries/java/saxon/default.nix index fcd884f0a419..15a89761340e 100644 --- a/pkgs/development/libraries/java/saxon/default.nix +++ b/pkgs/development/libraries/java/saxon/default.nix @@ -1,22 +1,60 @@ -{ stdenv, fetchurl, unzip }: +{ stdenv, fetchurl, unzip, jre }: -stdenv.mkDerivation { - name = "saxon-6.5.3"; - builder = ./unzip-builder.sh; - src = fetchurl { - url = mirror://sourceforge/saxon/saxon6_5_3.zip; - sha256 = "0l5y3y2z4wqgh80f26dwwxwncs8v3nkz3nidv14z024lmk730vs3"; +let + common = { pname, version, src, description + , prog ? null, jar ? null, license ? stdenv.lib.licenses.mpl20 }: + stdenv.mkDerivation { + name = "${pname}-${version}"; + inherit pname version src; + + nativeBuildInputs = [ unzip ]; + + buildCommand = let + prog' = if prog == null then pname else prog; + jar' = if jar == null then pname else jar; + in '' + unzip $src -d $out + mkdir -p $out/bin $out/share $out/share/java + cp -s "$out"/*.jar "$out/share/java/" # */ + rm -rf $out/notices + mv $out/doc $out/share + cat > $out/bin/${prog'} <