saxons: refactor common builder code

Also add myself as maintainer.
This commit is contained in:
Rodney Lorrimar 2017-12-05 18:02:13 +00:00
parent 3eccd0b11d
commit d0cd7a0999
4 changed files with 58 additions and 52 deletions

@ -1,22 +1,60 @@
{ stdenv, fetchurl, unzip }: { stdenv, fetchurl, unzip, jre }:
let
common = { pname, version, src, description
, prog ? null, jar ? null, license ? stdenv.lib.licenses.mpl20 }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "saxon-6.5.3"; name = "${pname}-${version}";
builder = ./unzip-builder.sh; 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'} <<EOF
#! $shell
export JAVA_HOME=${jre}
exec ${jre}/bin/java -jar $out/${jar'}.jar "\$@"
EOF
chmod a+x $out/bin/${prog'}
'';
meta = with stdenv.lib; {
inherit description license;
homepage = http://saxon.sourceforge.net/;
maintainers = with maintainers; [ rvl ];
platforms = platforms.all;
};
};
in {
saxon = common {
pname = "saxon";
version = "6.5.3";
src = fetchurl { src = fetchurl {
url = mirror://sourceforge/saxon/saxon6_5_3.zip; url = mirror://sourceforge/saxon/saxon6_5_3.zip;
sha256 = "0l5y3y2z4wqgh80f26dwwxwncs8v3nkz3nidv14z024lmk730vs3"; sha256 = "0l5y3y2z4wqgh80f26dwwxwncs8v3nkz3nidv14z024lmk730vs3";
}; };
description = "XSLT 1.0 processor";
# http://saxon.sourceforge.net/saxon6.5.3/conditions.html
license = stdenv.lib.licenses.mpl10;
};
nativeBuildInputs = [ unzip ]; saxonb = common {
pname = "saxonb";
# still leaving in root as well, in case someone is relying on that version = "8.8";
preFixup = '' jar = "saxon8";
mkdir -p "$out/share/java" src = fetchurl {
cp -s "$out"/*.jar "$out/share/java/" url = mirror://sourceforge/saxon/saxonb8-8j.zip;
''; sha256 = "15bzrfyd2f1045rsp9dp4znyhmizh1pm97q8ji2bc0b43q23xsb8";
};
meta = { description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
platforms = stdenv.lib.platforms.unix;
}; };
} }

@ -1,26 +0,0 @@
{stdenv, fetchurl, unzip, jre}:
stdenv.mkDerivation {
name = "saxonb-8.8";
src = fetchurl {
url = mirror://sourceforge/saxon/saxonb8-8j.zip;
sha256 = "15bzrfyd2f1045rsp9dp4znyhmizh1pm97q8ji2bc0b43q23xsb8";
};
buildInputs = [unzip];
buildCommand = "
unzip $src -d $out
mkdir -p $out/bin
cat > $out/bin/saxon8 <<EOF
#! $shell
export JAVA_HOME=${jre}
exec ${jre}/bin/java -jar $out/saxon8.jar \"\\$@\"
EOF
chmod a+x $out/bin/saxon8
";
meta = {
platforms = stdenv.lib.platforms.unix;
};
}

@ -1,6 +0,0 @@
source $stdenv/setup
unzip $src -d $out
fixupPhase

@ -11322,9 +11322,9 @@ with pkgs;
mockobjects = callPackage ../development/libraries/java/mockobjects { }; mockobjects = callPackage ../development/libraries/java/mockobjects { };
saxon = callPackage ../development/libraries/java/saxon { }; inherit (callPackages ../development/libraries/java/saxon { })
saxon
saxonb = callPackage ../development/libraries/java/saxon/default8.nix { }; saxonb;
smack = callPackage ../development/libraries/java/smack { }; smack = callPackage ../development/libraries/java/smack { };