about summary refs log tree commit diff
path: root/pkgs/development/libraries/java
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/java')
-rw-r--r--pkgs/development/libraries/java/hsqldb/default.nix4
-rw-r--r--pkgs/development/libraries/java/jffi/default.nix2
-rw-r--r--pkgs/development/libraries/java/lombok/default.nix4
-rw-r--r--pkgs/development/libraries/java/saxon/default.nix115
-rw-r--r--pkgs/development/libraries/java/swt/awt-libs.patch8
-rw-r--r--pkgs/development/libraries/java/swt/default.nix158
-rw-r--r--pkgs/development/libraries/java/swt/gtk-libs.patch14
7 files changed, 92 insertions, 213 deletions
diff --git a/pkgs/development/libraries/java/hsqldb/default.nix b/pkgs/development/libraries/java/hsqldb/default.nix
index c4f9bf9773020..b4aaed0078957 100644
--- a/pkgs/development/libraries/java/hsqldb/default.nix
+++ b/pkgs/development/libraries/java/hsqldb/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   pname = "hsqldb";
-  version = "2.7.2";
+  version = "2.7.3";
   underscoreMajMin = lib.replaceStrings ["."] ["_"] (lib.versions.majorMinor version);
 
   src = fetchurl {
     url = "mirror://sourceforge/project/hsqldb/hsqldb/hsqldb_${underscoreMajMin}/hsqldb-${version}.zip";
-    sha256 = "sha256-/7NZy+ZroxeTF7av22LNJ0dlMzvTAWfOMypLLYWXWBI=";
+    sha256 = "sha256-0+3uhZ9/xYI34QiGSnFzPv9WE9ktxlUI36M1vAxbHpQ=";
   };
 
   nativeBuildInputs = [ unzip makeWrapper ];
diff --git a/pkgs/development/libraries/java/jffi/default.nix b/pkgs/development/libraries/java/jffi/default.nix
index 46f2701635498..dddcfd1fa3031 100644
--- a/pkgs/development/libraries/java/jffi/default.nix
+++ b/pkgs/development/libraries/java/jffi/default.nix
@@ -65,7 +65,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   meta = with lib; {
     broken = stdenv.isDarwin;
-    description = "Java Foreign Function Interface ";
+    description = "Java Foreign Function Interface";
     homepage = "https://github.com/jnr/jffi";
     platforms = platforms.unix;
     license = licenses.asl20;
diff --git a/pkgs/development/libraries/java/lombok/default.nix b/pkgs/development/libraries/java/lombok/default.nix
index de197b7966ef0..87d5f02230e82 100644
--- a/pkgs/development/libraries/java/lombok/default.nix
+++ b/pkgs/development/libraries/java/lombok/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "lombok";
-  version = "1.18.32";
+  version = "1.18.34";
 
   src = fetchurl {
     url = "https://projectlombok.org/downloads/lombok-${version}.jar";
-    sha256 = "sha256-l1dGdOKiX1Z6MTc2rOAN+Hh9RD3jFkB9V/yHfZ8Zpl0=";
+    sha256 = "sha256-wn1rKv9WJB0bB/y8xrGDcJ5rQyyA9zdO6x2CPobUuBo=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/development/libraries/java/saxon/default.nix b/pkgs/development/libraries/java/saxon/default.nix
index 17dfd7385e124..cb6df7e5558b8 100644
--- a/pkgs/development/libraries/java/saxon/default.nix
+++ b/pkgs/development/libraries/java/saxon/default.nix
@@ -1,46 +1,92 @@
-{ lib, stdenv, fetchurl, unzip, jre, jre8 }:
+{ lib
+, stdenv
+, fetchurl
+, unzip
+, jre
+, jre8
+, genericUpdater
+, writeShellScript
+, common-updater-scripts
+, gnused
+}:
 
 let
+  inherit (lib.versions) major majorMinor splitVersion;
+  inherit (lib.strings) concatStringsSep versionAtLeast;
+
   common = { pname, version, src, description, java ? jre
-           , prog ? null, jar ? null, license ? lib.licenses.mpl20 }:
-    stdenv.mkDerivation {
-      name = "${pname}-${version}";
+           , prog ? null, jar ? null, license ? lib.licenses.mpl20
+           , updateScript ? null }:
+    stdenv.mkDerivation (finalAttrs: let
+      mainProgram = if prog == null then pname else prog;
+      jar' = if jar == null then pname else jar;
+    in {
       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 ''
+      buildCommand = ''
         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
+        cat > $out/bin/${mainProgram} <<EOF
         #! $shell
         export JAVA_HOME=${jre}
         exec ${jre}/bin/java -jar $out/${jar'}.jar "\$@"
         EOF
-        chmod a+x $out/bin/${prog'}
+        chmod a+x $out/bin/${mainProgram}
       '';
 
+      passthru = lib.optionalAttrs (updateScript != null) {
+        inherit updateScript;
+      };
+
       meta = with lib; {
-        inherit description license;
-        homepage = "https://saxon.sourceforge.net/";
+        inherit description license mainProgram;
+        homepage = if versionAtLeast finalAttrs.version "11"
+          then "https://www.saxonica.com/products/latest.xml"
+          else "https://www.saxonica.com/products/archive.xml";
         sourceProvenance = with sourceTypes; [ binaryBytecode ];
         maintainers = with maintainers; [ rvl ];
         platforms = platforms.all;
       };
-    };
+    });
+
+  # Saxon release zipfiles and tags often use dashes instead of dots.
+  dashify = version: concatStringsSep "-" (splitVersion version);
+
+  # SaxonJ-HE release files are pushed to the Saxon-HE GitHub repository.
+  # They are also available from Maven.
+  #
+  # Older releases were uploaded to SourceForge. They are also
+  # available from the Saxon-Archive GitHub repository.
+  github = {
+    updateScript = version: genericUpdater {
+      versionLister = writeShellScript "saxon-he-versionLister" ''
+        export PATH="${lib.makeBinPath [ common-updater-scripts gnused ]}:$PATH"
+        major_ver="${major version}"
+        list-git-tags --url="https://github.com/Saxonica/Saxon-HE.git" \
+          | sed -En \
+            -e "s/SaxonHE([0-9]+)-([0-9]+)/\1.\2/" \
+            -e "/^''${major_ver:-[0-9]+}\./p"
+        '';
+      };
+
+    downloadUrl = version: let
+      tag = "SaxonHE${dashify version}";
+      filename = "${major version}/Java/${tag}J.zip";
+    in
+      "https://raw.githubusercontent.com/Saxonica/Saxon-HE/${tag}/${filename}";
+  };
 
 in {
-  saxon = common {
+  saxon = common rec {
     pname = "saxon";
     version = "6.5.3";
     src = fetchurl {
-      url = "mirror://sourceforge/saxon/saxon6_5_3.zip";
+      url = "mirror://sourceforge/saxon/saxon${dashify version}.zip";
       sha256 = "0l5y3y2z4wqgh80f26dwwxwncs8v3nkz3nidv14z024lmk730vs3";
     };
     description = "XSLT 1.0 processor";
@@ -49,50 +95,63 @@ in {
     java = jre8;
   };
 
-  saxonb_8_8 = common {
+  saxonb_8_8 = common rec {
     pname = "saxonb";
     version = "8.8";
     jar = "saxon8";
     src = fetchurl {
-      url = "mirror://sourceforge/saxon/saxonb8-8j.zip";
+      url = "mirror://sourceforge/saxon/saxonb${dashify version}j.zip";
       sha256 = "15bzrfyd2f1045rsp9dp4znyhmizh1pm97q8ji2bc0b43q23xsb8";
     };
     description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
     java = jre8;
   };
 
-  saxonb_9_1 = common {
+  saxonb_9_1 = common rec {
     pname = "saxonb";
     version = "9.1.0.8";
     jar = "saxon9";
     src = fetchurl {
-      url = "mirror://sourceforge/saxon/Saxon-B/9.1.0.8/saxonb9-1-0-8j.zip";
+      url = "mirror://sourceforge/saxon/Saxon-B/${version}/saxonb${dashify version}j.zip";
       sha256 = "1d39jdnwr3v3pzswm81zry6yikqlqy9dp2l2wmpqdiw00r5drg4j";
     };
     description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
   };
 
-  saxon_9-he = common {
+  # Saxon-HE (home edition) replaces Saxon-B as the open source
+  # version of the Saxon XSLT and XQuery processor.
+  saxon_9-he = common rec {
     pname = "saxon-he";
     version = "9.9.0.1";
-    prog = "saxon-he";
     jar = "saxon9he";
     src = fetchurl {
-      url = "mirror://sourceforge/saxon/Saxon-HE/9.9/SaxonHE9-9-0-1J.zip";
+      url = "mirror://sourceforge/saxon/Saxon-HE/${majorMinor version}/SaxonHE${dashify version}J.zip";
       sha256 = "1inxd7ia7rl9fxfrw8dy9sb7rqv76ipblaki5262688wf2dscs60";
     };
     description = "Processor for XSLT 3.0, XPath 2.0 and 3.1, and XQuery 3.1";
   };
 
-  saxon-he = common {
+  saxon_11-he = common rec {
     pname = "saxon-he";
-    version = "11.5";
-    prog = "saxon-he";
-    jar = "saxon-he-11.5";
+    version = "11.6";
+    jar = "saxon-he-${version}";
     src = fetchurl {
-      url = "https://github.com/Saxonica/Saxon-HE/raw/a6d11dec3853326b661e9aff283e30b43c02e163/11/Java/SaxonHE11-5J.zip";
-      sha256 = "2Nwh6dG3YAjc/OTr8DMOfbnRvdCWB0YsVP3ZLRbM9U0=";
+      url = github.downloadUrl version;
+      sha256 = "/AVX5mtZSO6Is19t3+FlEvtIBsnwB3MIWAPCht8Aqnw=";
     };
+    updateScript = github.updateScript version;
     description = "Processor for XSLT 3.0, XPath 2.0 and 3.1, and XQuery 3.1";
   };
+
+  saxon_12-he = common rec {
+    pname = "saxon-he";
+    version = "12.5";
+    jar = "saxon-he-${version}";
+    src = fetchurl {
+      url = github.downloadUrl version;
+      hash = "sha256-NaRnKHkr1M7C/CYtSHd7THm1ze7wPSmB46ZOyzoZ9xY=";
+    };
+    updateScript = github.updateScript version;
+    description = "Processor for XSLT 3.0, XPath 3.1, and XQuery 3.1";
+  };
 }
diff --git a/pkgs/development/libraries/java/swt/awt-libs.patch b/pkgs/development/libraries/java/swt/awt-libs.patch
deleted file mode 100644
index 6c3ff53b79835..0000000000000
--- a/pkgs/development/libraries/java/swt/awt-libs.patch
+++ /dev/null
@@ -1,8 +0,0 @@
---- a/make_linux.mak
-+++ b/make_linux.mak
-@@ -63,4 +63,4 @@
-
- AWT_LFLAGS = -shared ${SWT_LFLAGS}
--AWT_LIBS = -L$(AWT_LIB_PATH) -ljawt
-+AWT_LIBS = `pkg-config --libs x11` -L$(AWT_LIB_PATH) -ljawt
-
diff --git a/pkgs/development/libraries/java/swt/default.nix b/pkgs/development/libraries/java/swt/default.nix
deleted file mode 100644
index 2d3f4eeb65755..0000000000000
--- a/pkgs/development/libraries/java/swt/default.nix
+++ /dev/null
@@ -1,158 +0,0 @@
-{ lib
-, stdenv
-, stripJavaArchivesHook
-, fetchzip
-, pkg-config
-, atk
-, glib
-, gtk2
-, jdk
-, libGL
-, libGLU
-, libXt
-, libXtst
-, gnome2
-}:
-
-let
-  platformMap = {
-    x86_64-linux =
-      { platform = "gtk-linux-x86_64";
-        sha256 = "17frac2nsx22hfa72264as31rn35hfh9gfgy0n6wvc3knl5d2716"; };
-    i686-linux =
-      { platform = "gtk-linux-x86";
-        sha256 = "13ca17rga9yvdshqvh0sfzarmdcl4wv4pid0ls7v35v4844zbc8b"; };
-    x86_64-darwin =
-      { platform = "cocoa-macosx-x86_64";
-        sha256 = "0wjyxlw7i9zd2m8syd6k1q85fj8pzhxlfsrl8fpgsj37p698bd0a"; };
-  };
-
-  metadata = assert platformMap ? ${stdenv.hostPlatform.system};
-    platformMap.${stdenv.hostPlatform.system};
-in stdenv.mkDerivation rec {
-  pname = "swt";
-  version = "4.5";
-  fullVersion = "${version}-201506032000";
-
-  hardeningDisable = [ "format" ];
-
-  # Alas, the Eclipse Project apparently doesn't produce source-only
-  # releases of SWT.  So we just grab a binary release and extract
-  # "src.zip" from that.
-  src = fetchzip {
-    url = "https://archive.eclipse.org/eclipse/downloads/drops4/" +
-      "R-${fullVersion}/${pname}-${version}-${metadata.platform}.zip";
-    inherit (metadata) sha256;
-    stripRoot = false;
-    postFetch = ''
-      mkdir "$unpackDir"
-      cd "$unpackDir"
-
-      renamed="$TMPDIR/src.zip"
-      mv "$out/src.zip" "$renamed"
-      unpackFile "$renamed"
-      rm -r "$out"
-
-      mv "$unpackDir" "$out"
-    '';
-  };
-
-  nativeBuildInputs = [
-    stripJavaArchivesHook
-    pkg-config
-  ];
-  buildInputs = [
-    atk
-    gtk2
-    jdk
-    libGL
-    libGLU
-    libXtst
-    gnome2.gnome_vfs
-    gnome2.libgnome
-    gnome2.libgnomeui
-  ] ++ lib.optionals (lib.hasPrefix "8u" jdk.version) [
-    libXt
-  ];
-
-  patches = [ ./awt-libs.patch ./gtk-libs.patch ];
-
-  prePatch = ''
-    # clear whitespace from makefiles (since we match on EOL later)
-    sed -i 's/ \+$//' ./*.mak
-  '';
-
-  postPatch = let makefile-sed = builtins.toFile "swt-makefile.sed" (''
-    # fix pkg-config invocations in CFLAGS/LIBS pairs.
-    #
-    # change:
-    #     FOOCFLAGS = `pkg-config --cflags `foo bar`
-    #     FOOLIBS = `pkg-config --libs-only-L foo` -lbaz
-    # into:
-    #     FOOCFLAGS = `pkg-config --cflags foo bar`
-    #     FOOLIBS = `pkg-config --libs foo bar`
-    #
-    # the latter works more consistently.
-    /^[A-Z0-9_]\+CFLAGS = `pkg-config --cflags [^`]\+`$/ {
-      N
-      s'' +
-        "/" + ''
-          ^\([A-Z0-9_]\+\)CFLAGS = `pkg-config --cflags \(.\+\)`\
-          \1LIBS = `pkg-config --libs-only-L .\+$'' +
-        "/" + ''
-          \1CFLAGS = `pkg-config --cflags \2`\
-          \1LIBS = `pkg-config --libs \2`'' +
-        "/\n" + ''
-    }
-    # fix WebKit libs not being there
-    s/\$(WEBKIT_LIB) \$(WEBKIT_OBJECTS)$/\0 `pkg-config --libs glib-2.0`/g
-  ''); in ''
-    declare -a makefiles=(./*.mak)
-    sed -i -f ${makefile-sed} "''${makefiles[@]}"
-    # assign Makefile variables eagerly & change backticks to `$(shell …)`
-    sed -i -e 's/ = `\([^`]\+\)`/ := $(shell \1)/' \
-      -e 's/`\([^`]\+\)`/$(shell \1)/' \
-      "''${makefiles[@]}"
-  '';
-
-  buildPhase = ''
-    runHook preBuild
-
-    export JAVA_HOME=${jdk}
-
-    ./build.sh
-
-    mkdir out
-    find org/ -name '*.java' -type f -exec javac -d out/ {} +
-
-    runHook postBuild
-  '';
-
-  installPhase = ''
-    runHook preInstall
-
-    if [ -n "$prefix" ]; then
-      mkdir -p "$prefix"
-    fi
-
-    mkdir -p "$out/lib"
-    cp -t "$out/lib" ./*.so
-
-    mkdir -p "$out/jars"
-    cp -t out/ version.txt
-    (cd out && jar -c *) > "$out/jars/swt.jar"
-
-    runHook postInstall
-  '';
-
-  meta = with lib; {
-    homepage = "https://www.eclipse.org/swt/";
-    description = ''
-      A widget toolkit for Java to access the user-interface facilities of
-      the operating systems on which it is implemented.
-    '';
-    license = licenses.epl10;
-    maintainers = with maintainers; [ bb010g ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/development/libraries/java/swt/gtk-libs.patch b/pkgs/development/libraries/java/swt/gtk-libs.patch
deleted file mode 100644
index cd13082b5df78..0000000000000
--- a/pkgs/development/libraries/java/swt/gtk-libs.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/make_linux.mak
-+++ b/make_linux.mak
-@@ -53,9 +53,4 @@
-
--# Do not use pkg-config to get libs because it includes unnecessary dependencies (i.e. pangoxft-1.0)
--GTKCFLAGS = `pkg-config --cflags gtk+-$(GTK_VERSION) gtk+-unix-print-$(GTK_VERSION)`
-+GTKCFLAGS = `pkg-config --cflags gtk+-$(GTK_VERSION) gthread-2.0 gtk+-unix-print-$(GTK_VERSION) x11 xtst`
-+GTKLIBS = `pkg-config --libs gtk+-$(GTK_VERSION) gthread-2.0 gtk+-unix-print-$(GTK_VERSION) x11 xtst`
--ifeq ($(GTK_VERSION), 3.0)
--GTKLIBS = `pkg-config --libs-only-L gtk+-$(GTK_VERSION) gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-3 -lgdk-3 -lcairo -lgthread-2.0 -lXtst
--else
--GTKLIBS = `pkg-config --libs-only-L gtk+-$(GTK_VERSION) gthread-2.0` $(XLIB64) -L/usr/X11R6/lib -lgtk-x11-$(GTK_VERSION) -lgthread-2.0 -lXtst
--endif
-