Bug#902787: h2database: Add support for JTS 1.15

Bas Couwenberg sebastic at xs4all.nl
Sat Jun 30 21:53:02 BST 2018


Source: h2database
Version: 1.4.196-2
Severity: important
Tags: patch
User: debian-gis at lists.debian.org
Usertags: jts-1.15

Dear Maintainer,

Your packages FTBFS with JTS 1.15 available in expermental.

The attached patch fixes the build failure.

To quote the MIGRATION documentation:

"
 JTS Upgrade Guide
 =================

 The JTS Topology Suite has a long history, and in 2016/2017,
 [Vivid Solutions](http://www.vividsolutions.com/) brought the project
 to the LocationTech working group of the Eclipse Foundation.

 During that transition, the Java package names and Maven GAVs have
 changed.  For package names (typically used in imports), the change is
 reflected below:

 |               | **JTS 1.14.0 and before** | **JTS 1.15.0 and later**    |
 |---------------|:--------------------------|:----------------------------|
 | Maven GroupId | com.vividsolutions        | org.locationtech.jts        |
 | Package names | com.vividsolutions.jts.*  | org.locationtech.jts.*      |

 To upgrade a Maven project (or another build tool using Maven dependency
 management), one can do a find and replace on ```pom.xml``` files (or
 similiar build files).  In the source code, one could do a find and
 replace on the package names.  As a concrete example, one could use
 these two commands to handle most of the migration.

 ```
 git grep -l com.vividsolutions | grep pom.xml | xargs sed -i "s/com.vividsolutions/org.locationtech.jts/g"
 git grep -l com.vividsolutions | xargs sed -i "s/com.vividsolutions/org.locationtech/g"
 ```

 ## Using JTS with Maven

 To include JTS in a Maven project, add a dependency block like the following:

 ```xml
 <dependency>
     <groupId>org.locationtech.jts</groupId>
     <artifactId>jts-core</artifactId>
     <version>${jts.version}</version>
 </dependency>
 ```

 Where ${jts.version} is the released version of JTS one chooses to use.
 See the [releases](https://github.com/locationtech/jts/releases) page
 for options.
"

https://salsa.debian.org/debian-gis-team/jts/blob/upstream/1.15.1+ds/MIGRATION.md

The severity of this issue will be raised when the jts package is moved
from experimental to unstable.

Please note that JTS is up for adoption (#884537), as it should be better
to maintain the package as part of the Java team where its reverse
dependencies are maintained as well.

Kind Regards,

Bas
-------------- next part --------------
diff -Nru h2database-1.4.196/debian/changelog h2database-1.4.196/debian/changelog
--- h2database-1.4.196/debian/changelog	2017-11-24 12:53:48.000000000 +0100
+++ h2database-1.4.196/debian/changelog	2018-06-30 21:59:29.000000000 +0200
@@ -1,3 +1,10 @@
+h2database (1.4.196-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch for JTS 1.15.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 30 Jun 2018 21:59:29 +0200
+
 h2database (1.4.196-2) unstable; urgency=medium
 
   * Fixed the build failure when maven-debian-helper is installed
diff -Nru h2database-1.4.196/debian/patches/01-use-jar-files-from-debian.patch h2database-1.4.196/debian/patches/01-use-jar-files-from-debian.patch
--- h2database-1.4.196/debian/patches/01-use-jar-files-from-debian.patch	2017-06-20 09:48:22.000000000 +0200
+++ h2database-1.4.196/debian/patches/01-use-jar-files-from-debian.patch	2018-06-30 21:59:29.000000000 +0200
@@ -6,7 +6,7 @@
 Last-Update: 2011-07-13
 --- a/src/tools/org/h2/build/Build.java
 +++ b/src/tools/org/h2/build/Build.java
-@@ -202,14 +202,13 @@
+@@ -202,14 +202,13 @@ public class Build extends BuildBase {
          switchSource(debugInfo);
          clean();
          mkdir("temp");
@@ -23,7 +23,7 @@
 +                File.pathSeparator + "/usr/share/java/slf4j-api.jar" +
 +                File.pathSeparator + "/usr/share/java/org.eclipse.osgi.jar" +
 +                File.pathSeparator + "/usr/share/java/osgi.compendium.jar" +
-+                File.pathSeparator + "/usr/share/java/jts.jar" +
++                File.pathSeparator + "/usr/share/java/jts-core.jar" +
                  File.pathSeparator + javaToolsJar;
          FileList files;
          if (clientOnly) {
diff -Nru h2database-1.4.196/debian/patches/jts-1.15.patch h2database-1.4.196/debian/patches/jts-1.15.patch
--- h2database-1.4.196/debian/patches/jts-1.15.patch	1970-01-01 01:00:00.000000000 +0100
+++ h2database-1.4.196/debian/patches/jts-1.15.patch	2018-06-30 21:59:29.000000000 +0200
@@ -0,0 +1,109 @@
+Description: Update for JTS 1.15.
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/src/main/org/h2/index/SpatialTreeIndex.java
++++ b/src/main/org/h2/index/SpatialTreeIndex.java
+@@ -23,8 +23,8 @@ import org.h2.table.TableFilter;
+ import org.h2.value.Value;
+ import org.h2.value.ValueGeometry;
+ import org.h2.value.ValueNull;
+-import com.vividsolutions.jts.geom.Envelope;
+-import com.vividsolutions.jts.geom.Geometry;
++import org.locationtech.jts.geom.Envelope;
++import org.locationtech.jts.geom.Geometry;
+ 
+ /**
+  * This is an index based on a MVR-TreeMap.
+--- a/src/main/org/h2/mvstore/db/MVSpatialIndex.java
++++ b/src/main/org/h2/mvstore/db/MVSpatialIndex.java
+@@ -34,8 +34,8 @@ import org.h2.value.Value;
+ import org.h2.value.ValueGeometry;
+ import org.h2.value.ValueLong;
+ import org.h2.value.ValueNull;
+-import com.vividsolutions.jts.geom.Envelope;
+-import com.vividsolutions.jts.geom.Geometry;
++import org.locationtech.jts.geom.Envelope;
++import org.locationtech.jts.geom.Geometry;
+ 
+ /**
+  * This is an index based on a MVRTreeMap.
+--- a/src/main/org/h2/value/DataType.java
++++ b/src/main/org/h2/value/DataType.java
+@@ -59,7 +59,7 @@ public class DataType {
+     public static final Class<?> GEOMETRY_CLASS;
+ 
+     private static final String GEOMETRY_CLASS_NAME =
+-            "com.vividsolutions.jts.geom.Geometry";
++            "org.locationtech.jts.geom.Geometry";
+ 
+     /**
+      * The list of types. An ArrayList so that Tomcat doesn't set it to null
+--- a/src/main/org/h2/value/ValueGeometry.java
++++ b/src/main/org/h2/value/ValueGeometry.java
+@@ -9,19 +9,19 @@ import java.sql.PreparedStatement;
+ import java.sql.SQLException;
+ import java.util.Arrays;
+ 
+-import com.vividsolutions.jts.geom.CoordinateSequence;
+-import com.vividsolutions.jts.geom.CoordinateSequenceFilter;
+-import com.vividsolutions.jts.geom.PrecisionModel;
++import org.locationtech.jts.geom.CoordinateSequence;
++import org.locationtech.jts.geom.CoordinateSequenceFilter;
++import org.locationtech.jts.geom.PrecisionModel;
+ import org.h2.message.DbException;
+ import org.h2.util.StringUtils;
+-import com.vividsolutions.jts.geom.Envelope;
+-import com.vividsolutions.jts.geom.Geometry;
+-import com.vividsolutions.jts.geom.GeometryFactory;
+-import com.vividsolutions.jts.io.ParseException;
+-import com.vividsolutions.jts.io.WKBReader;
+-import com.vividsolutions.jts.io.WKBWriter;
+-import com.vividsolutions.jts.io.WKTReader;
+-import com.vividsolutions.jts.io.WKTWriter;
++import org.locationtech.jts.geom.Envelope;
++import org.locationtech.jts.geom.Geometry;
++import org.locationtech.jts.geom.GeometryFactory;
++import org.locationtech.jts.io.ParseException;
++import org.locationtech.jts.io.WKBReader;
++import org.locationtech.jts.io.WKBWriter;
++import org.locationtech.jts.io.WKTReader;
++import org.locationtech.jts.io.WKTWriter;
+ 
+ /**
+  * Implementation of the GEOMETRY data type.
+@@ -66,7 +66,7 @@ public class ValueGeometry extends Value
+      * Get or create a geometry value for the given geometry.
+      *
+      * @param o the geometry object (of type
+-     *            com.vividsolutions.jts.geom.Geometry)
++     *            org.locationtech.jts.geom.Geometry)
+      * @return the value
+      */
+     public static ValueGeometry getFromGeometry(Object o) {
+--- a/src/test/org/h2/test/db/TestSpatial.java
++++ b/src/test/org/h2/test/db/TestSpatial.java
+@@ -19,15 +19,15 @@ import org.h2.tools.SimpleRowSource;
+ import org.h2.value.DataType;
+ import org.h2.value.Value;
+ import org.h2.value.ValueGeometry;
+-import com.vividsolutions.jts.geom.Coordinate;
+-import com.vividsolutions.jts.geom.Envelope;
+-import com.vividsolutions.jts.geom.Geometry;
+-import com.vividsolutions.jts.geom.GeometryFactory;
+-import com.vividsolutions.jts.geom.Point;
+-import com.vividsolutions.jts.geom.Polygon;
+-import com.vividsolutions.jts.geom.util.AffineTransformation;
+-import com.vividsolutions.jts.io.ParseException;
+-import com.vividsolutions.jts.io.WKTReader;
++import org.locationtech.jts.geom.Coordinate;
++import org.locationtech.jts.geom.Envelope;
++import org.locationtech.jts.geom.Geometry;
++import org.locationtech.jts.geom.GeometryFactory;
++import org.locationtech.jts.geom.Point;
++import org.locationtech.jts.geom.Polygon;
++import org.locationtech.jts.geom.util.AffineTransformation;
++import org.locationtech.jts.io.ParseException;
++import org.locationtech.jts.io.WKTReader;
+ 
+ /**
+  * Spatial datatype and index tests.
diff -Nru h2database-1.4.196/debian/patches/series h2database-1.4.196/debian/patches/series
--- h2database-1.4.196/debian/patches/series	2017-06-20 09:46:54.000000000 +0200
+++ h2database-1.4.196/debian/patches/series	2018-06-30 21:53:41.000000000 +0200
@@ -1,3 +1,4 @@
 01-use-jar-files-from-debian.patch
 03-osgi-compatibility.patch
 04-reproducible-javadoc.patch
+jts-1.15.patch


More information about the pkg-java-maintainers mailing list