From d0cd7a09992c5e7c873632e5dd984e406cb9ae51 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 5 Dec 2017 18:02:13 +0000 Subject: [PATCH] saxons: refactor common builder code Also add myself as maintainer. --- .../libraries/java/saxon/default.nix | 72 ++++++++++++++----- .../libraries/java/saxon/default8.nix | 26 ------- .../libraries/java/saxon/unzip-builder.sh | 6 -- pkgs/top-level/all-packages.nix | 6 +- 4 files changed, 58 insertions(+), 52 deletions(-) delete mode 100644 pkgs/development/libraries/java/saxon/default8.nix delete mode 100755 pkgs/development/libraries/java/saxon/unzip-builder.sh 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'} <