Skip to content

Commit 0f622f8

Browse files
authored
qgis: add 3.44 (#3622)
1 parent 834397a commit 0f622f8

File tree

2 files changed

+48
-7
lines changed

2 files changed

+48
-7
lines changed

repos/spack_repo/builtin/packages/py_psycopg2/package.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class PyPsycopg2(PythonPackage):
1313
homepage = "https://psycopg.org/"
1414
pypi = "psycopg2/psycopg2-2.8.6.tar.gz"
1515

16+
version("2.9.11", sha256="964d31caf728e217c697ff77ea69c2ba0865fa41ec20bb00f0977e62fdcc52e3")
1617
version("2.9.10", sha256="12ec0b40b0273f95296233e8750441339298e6a572f7039da5b260e3c8b60e11")
1718
version("2.9.6", sha256="f15158418fd826831b28585e2ab48ed8df2d0d98f502a2b4fe619e7d5ca29011")
1819
version("2.9.1", sha256="de5303a6f1d0a7a34b9d40e4d3bef684ccc44a49bbe3eb85e3c0bffb4a131b7c")
@@ -24,7 +25,8 @@ class PyPsycopg2(PythonPackage):
2425
# https://github.com/psycopg/psycopg2/blob/master/doc/src/install.rst
2526
# https://www.psycopg.org/docs/news.html#news
2627
# https://pypi.org/project/psycopg2/#history
27-
depends_on("python@:3.13", when="@2.9.10:", type=("build", "link", "run"))
28+
depends_on("python@:3.14", when="@2.9.11:", type=("build", "link", "run"))
29+
depends_on("python@:3.13", when="@2.9.10", type=("build", "link", "run"))
2830
depends_on("python@:3.11", when="@2.9.5:2.9.9", type=("build", "link", "run"))
2931
depends_on("python@:3.10", when="@2.9.1:2.9.4", type=("build", "link", "run"))
3032
depends_on("python@:3.9", when="@2.8.6:2.9.0", type=("build", "link", "run"))

repos/spack_repo/builtin/packages/qgis/package.py

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
44

5+
from pathlib import Path
6+
57
from spack_repo.builtin.build_systems.cmake import CMakePackage
68

79
from spack.package import *
@@ -14,18 +16,23 @@ class Qgis(CMakePackage):
1416
"""
1517

1618
homepage = "https://qgis.org"
17-
url = "https://qgis.org/downloads/qgis-3.8.1.tar.bz2"
19+
20+
# the downloads are listed via json, so the spack checksum crawler won't find them
21+
# spack checksum qgis x.y.z will provide the new checksum
22+
url = "https://qgis.org/downloads/qgis-3.44.7.tar.bz2"
1823

1924
maintainers("adamjstewart", "Sinan81", "Chrismarsh")
2025

2126
license("GPL-2.0-or-later")
2227

2328
# Prefer latest LTR
2429
version(
25-
"3.40.6",
26-
sha256="dd68d39a2a29326031195bed2125e8b0fa7112fe9ee74d5f9850d06b02cef6a8",
30+
"3.44.8",
31+
sha256="146e197f34f1f9ede8cfdf5b9cc4d76667771720a302172c32d4117367356e96",
2732
preferred=True,
2833
)
34+
version("3.44.7", sha256="1ab06f40600c84e928b4fe22a66997d80973201b10769e7a636e5be83459b814")
35+
version("3.40.6", sha256="dd68d39a2a29326031195bed2125e8b0fa7112fe9ee74d5f9850d06b02cef6a8")
2936
version("3.40.1", sha256="53110464c9f5ba5562c437e1563ab36dad2f218e6e7d1c0cfbe5b6effe241c8e")
3037
version("3.34.15", sha256="afb0bed05ffbc7bcb6d27dd1a8644b1e63ac2cb322baa058ff65b848c760efc2")
3138
version("3.34.13", sha256="a8873ca9bae346bae48ef3fe3eed702ef1f06d951201464464a64019302ba50b")
@@ -122,17 +129,22 @@ class Qgis(CMakePackage):
122129
depends_on("gdal@2.1.0: +python", type=("build", "link", "run"))
123130
depends_on("gdal@3.2.0: +python", type=("build", "link", "run"), when="@3.28:")
124131
depends_on("geos@3.4.0:")
125-
depends_on("libspatialindex")
132+
133+
# https://github.com/libspatialindex/libspatialindex/issues/276
134+
depends_on("libspatialindex@:2.0.0")
126135
depends_on("libspatialite@4.2.0:")
127136
depends_on("libzip")
128137
depends_on("libtasn1")
138+
129139
depends_on("proj@4.4.0:")
130140
depends_on("proj@4.9.3:", when="@3.8.2:")
131141
depends_on("proj@7.2:", when="@3.28:")
132142
depends_on("proj@:8", when="@3.28") # build fails with proj@9
133143
# fails to build with proj 9.4+ until the backported patch in 3.34.5
134144
# https://github.com/qgis/QGIS/pull/56761
135145
depends_on("proj@:9.3", when="@:3.34.4")
146+
depends_on("proj@:9.5", when="@3.34.5:3.34.15")
147+
136148
depends_on("py-psycopg2", type=("build", "run")) # TODO: is build dependency necessary?
137149
depends_on("py-pyqt4", when="@2")
138150
depends_on("py-pyqt5@5.3:", when="@3")
@@ -163,6 +175,7 @@ class Qgis(CMakePackage):
163175
depends_on("py-owslib", type="run")
164176
depends_on("py-jinja2", type="run")
165177
depends_on("py-pygments", type="run")
178+
depends_on("py-packaging", type="run", when="@3.44:")
166179

167180
# optionals
168181
depends_on("postgresql@8:", when="+postgresql") # for PostGIS support
@@ -223,9 +236,35 @@ def fix_qsci_sip(self):
223236
elif "^py-pyqt6" in self.spec:
224237
pyqtx = "PyQt6"
225238

239+
pp = Path("python/gui/pyproject.toml.in")
240+
txt = pp.read_text(encoding="utf-8")
241+
226242
sip_inc_dir = join_path(self["qscintilla"].module.python_platlib, pyqtx, "bindings")
227-
with open(join_path("python", "gui", "pyproject.toml.in"), "a") as tomlfile:
228-
tomlfile.write(f'\n[tool.sip.project]\nsip-include-dirs = ["{sip_inc_dir}"]\n')
243+
sip_line = f'sip-include-dirs = ["{sip_inc_dir}"]'
244+
245+
# QGis 3.42.0 added a @sipabi@ that expands to the [tool.sip.project] header.
246+
# The simple patch append approach results in a duplicate header which causes a
247+
# build failure. The middle case is probably overkill but it is kept as a just
248+
# in (edge) case
249+
250+
# if it's already there, do nothing
251+
if sip_line not in txt:
252+
if "@sipabi@" in txt:
253+
# @sipabi@ expands to the [tool.sip.project] table + abi-version,
254+
# add just the key immediately after it
255+
txt = txt.replace("@sipabi@", "@sipabi@\n" + sip_line, 1)
256+
257+
elif "[tool.sip.project]" in txt:
258+
# insert right after the first header occurrence
259+
txt = txt.replace("[tool.sip.project]", "[tool.sip.project]\n" + sip_line, 1)
260+
261+
else:
262+
# no macro + no table, append a new table
263+
if not txt.endswith("\n"):
264+
txt += "\n"
265+
txt += "\n[tool.sip.project]\n" + sip_line + "\n"
266+
267+
pp.write_text(txt, encoding="utf-8")
229268

230269
def cmake_args(self):
231270
spec = self.spec

0 commit comments

Comments
 (0)