From c3e5c9981a7fcfe3b89d27c81d120672890b627b Mon Sep 17 00:00:00 2001
From: Neil Flood <neilflood@fastmail.fm>
Date: Wed, 3 Apr 2019 11:18:56 +1000
Subject: [PATCH] proj package: add versions 5.2.0 and 5.1.0 (#11079)

* Add versions 5.2.0 and 5.1.0
* Avoid adding version 6.0.0: this version has a new API that is
  not compatible with older versions (and dependents may break with
  it)
* Added comment block explaining the problems with version 6.x
* Replace old datumgrid resource (1.7) with new (1.8)
* Add speculative sqlite dependency for when a 6.x version is added
---
 var/spack/repos/builtin/packages/proj/package.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/var/spack/repos/builtin/packages/proj/package.py b/var/spack/repos/builtin/packages/proj/package.py
index 82ae972f1d..67f27dea6a 100644
--- a/var/spack/repos/builtin/packages/proj/package.py
+++ b/var/spack/repos/builtin/packages/proj/package.py
@@ -15,6 +15,13 @@ class Proj(AutotoolsPackage):
     homepage = "https://proj4.org/"
     url      = "http://download.osgeo.org/proj/proj-5.0.1.tar.gz"
 
+    # Version 6.0.0 deprecates the older API, and things which do
+    # not know this will fail to build. So, I recommend that we
+    # do not put in 6.x until you are ready to put in selective
+    # dependencies in all packages which depend on proj. I have
+    # done libgeotiff, but there are lots of others.
+    version('5.2.0', 'ad285c7d03cbb138d9246e10e1f3191c')
+    version('5.1.0', '68c46f6da7e4cd5708f83fe47af80db6')
     version('5.0.1', '15c8d7d6a8cb945c7878d0ff322a232c')
     version('4.9.2', '9843131676e31bbd903d60ae7dc76cf9')
     version('4.9.1', '3cbb2a964fd19a496f5f4265a717d31c')
@@ -26,11 +33,14 @@ class Proj(AutotoolsPackage):
     # https://github.com/OSGeo/proj-datumgrid
     resource(
         name='proj-datumgrid',
-        url='https://download.osgeo.org/proj/proj-datumgrid-1.7.tar.gz',
-        md5='6799bd8ac411b8a78724e34850c206c4',
+        url='https://download.osgeo.org/proj/proj-datumgrid-1.8.tar.gz',
+        md5='be7e8f77c12714a4cd53732c1f3cf8d9',
         placement='nad'
     )
 
+    # @6 appears to be the first version which makes use of sqlite at all.
+    depends_on('sqlite@3.7:', when='@6:')
+
     def configure_args(self):
         return [
             'PROJ_LIB={0}'.format(join_path(self.stage.source_path, 'nad'))
-- 
GitLab