summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSinan <sbulutw@gmail.com>2024-03-11 03:09:29 -0700
committerGitHub <noreply@github.com>2024-03-11 05:09:29 -0500
commitc72619d4dbe1e9a36d43c9ef709fdff536dea9df (patch)
tree612de33f52e9be0ec654dea9a70159c4e51bd54d
parent8ecae17c464cc081339f8625328aa7720b3326f9 (diff)
downloadspack-c72619d4dbe1e9a36d43c9ef709fdff536dea9df.tar.gz
spack-c72619d4dbe1e9a36d43c9ef709fdff536dea9df.tar.bz2
spack-c72619d4dbe1e9a36d43c9ef709fdff536dea9df.tar.xz
spack-c72619d4dbe1e9a36d43c9ef709fdff536dea9df.zip
package/qgis: add new version (#42888)
* package/qgis: add new version * improve Qsci.pro * improve * fix undefined symbol qsciprinter error * add import test * fix bug * add version 3.36 * [@spackbot] updating style on behalf of Sinan81 * fix long line * only run import test when +python * first attempt at stand-alone test * add TODO --------- Co-authored-by: sbulut <sbulut@3vgeomatics.com> Co-authored-by: Sinan81 <Sinan81@users.noreply.github.com> Co-authored-by: Sinan81 <Sinan@world>
-rw-r--r--var/spack/repos/builtin/packages/qgis/package.py16
-rw-r--r--var/spack/repos/builtin/packages/qscintilla/package.py29
2 files changed, 32 insertions, 13 deletions
diff --git a/var/spack/repos/builtin/packages/qgis/package.py b/var/spack/repos/builtin/packages/qgis/package.py
index 7ea73f28fe..051a78660d 100644
--- a/var/spack/repos/builtin/packages/qgis/package.py
+++ b/var/spack/repos/builtin/packages/qgis/package.py
@@ -19,13 +19,17 @@ class Qgis(CMakePackage):
license("GPL-2.0-or-later")
- version("3.34.0", sha256="348a2df4c4520813a319b7f72546b3823e044cacd28646ba189b56a49c7d1b5f")
- # Prefer latest long term release
+ # TODO version 3.36 isn't building right now.
+ version("3.36.0", sha256="1b64bc92660bf07edc6b6478fc6a13656149e87d92eabe5c3db9493072506e2c")
+ # Prefer latest LTR
version(
- "3.28.12",
- sha256="d6d0ea39ed3433d553f8b83324dc14cfa90f8caaf766fa484791df9169800f25",
+ "3.34.4",
+ sha256="7d1c5fafff13f508a9bcf6244c9666f891351deb1ace2aedcc63504f070c5ce4",
preferred=True,
)
+ version("3.34.0", sha256="348a2df4c4520813a319b7f72546b3823e044cacd28646ba189b56a49c7d1b5f")
+ version("3.28.15", sha256="217342ba2232cc8fe5bf8f3671c2b3d6daf5504c33006b67424373e70d568dfa")
+ version("3.28.12", sha256="d6d0ea39ed3433d553f8b83324dc14cfa90f8caaf766fa484791df9169800f25")
version("3.28.11", sha256="c5eb703893c7f98de051c45d677c4a34b40f986db51782a4930ddefad4e193b4")
version("3.28.10", sha256="cff867e97909bbc2facce6343770dcb1b61fc6e4855f57783e30bf63d51c5218")
version("3.28.3", sha256="a09124f46465a520f6d735306ba3954c339b84aa396d6f52b476b82edcc4fe0e")
@@ -82,7 +86,7 @@ class Qgis(CMakePackage):
)
variant("oauth2_plugin", default=True, description="Build OAuth2 authentication method plugin")
variant("oracle", default=False, description="Build with Oracle support")
- # variant("pdal", default=False, description="Build with PDAL support") #TODO
+ variant("pdal", default=False, description="Build with PDAL support")
variant("postgresql", default=True, description="Build with PostreSQL support")
variant(
"py_compile",
@@ -135,10 +139,12 @@ class Qgis(CMakePackage):
depends_on("qt+dbus+location")
depends_on("qt+dbus+location@5.12.0:", when="@3.20:")
depends_on("qt+dbus+location@5.14.0:", when="@3.28:")
+ depends_on("qt+dbus+location@5.15.2:", when="@3.36:")
depends_on("qtkeychain@0.5:", when="@3:")
depends_on("qwt@5:")
depends_on("qwtpolar")
depends_on("sqlite@3.0.0: +column_metadata")
+ depends_on("pdal", when="+pdal")
depends_on("protobuf", when="@3.16.4:")
depends_on("protobuf@:3.21", when="@:3.28")
depends_on("zstd", when="@3.22:")
diff --git a/var/spack/repos/builtin/packages/qscintilla/package.py b/var/spack/repos/builtin/packages/qscintilla/package.py
index 326b1137be..bbf0b5a309 100644
--- a/var/spack/repos/builtin/packages/qscintilla/package.py
+++ b/var/spack/repos/builtin/packages/qscintilla/package.py
@@ -88,10 +88,12 @@ class Qscintilla(QMakePackage):
@run_after("install", when="+python")
def make_qsci_python(self):
if "^py-pyqt5" in self.spec:
+ qtx = "qt5"
py_pyqtx = "py-pyqt5"
pyqtx = "PyQt5"
ftoml = "pyproject-qt5.toml"
elif "^py-pyqt6" in self.spec:
+ qtx = "qt6"
py_pyqtx = "py-pyqt6"
pyqtx = "PyQt6"
ftoml = "pyproject-qt6.toml"
@@ -103,17 +105,18 @@ class Qscintilla(QMakePackage):
)
with open("pyproject.toml", "a") as tomlfile:
+ # https://pyqt-builder.readthedocs.io/en/latest/pyproject_toml.html
tomlfile.write(f'\n[tool.sip.project]\nsip-include-dirs = ["{sip_inc_dir}"]\n')
+ # add widgets and printsupport to Qsci.pro
+ # also add link statement to fix "undefined symbol _Z...Qsciprinter...
+ link_qscilibs = "LIBS += -L" + self.prefix.lib + " -lqscintilla2_" + qtx
+ tomlfile.write(
+ f'\n[tool.sip.builder]\nqmake-settings = \
+ ["QT += widgets", "QT += printsupport", "{link_qscilibs}"]\n'
+ )
+
mkdirp(os.path.join(self.prefix.share.sip, pyqtx))
- if "^py-pyqt5" in self.spec:
- # QT += widgets and QT += printsupport need to be added to Qsci.pro file
- # to be generated via project.py
- qsciproj = FileFilter(join_path("project.py"))
- ptrn = "super().__init__(project, 'Qsci', qmake_CONFIG=qmake_CONFIG"
- qsciproj.filter(
- ptrn + ")", ptrn + ",qmake_QT=['widgets','printsupport'])", string=True
- )
sip_build = Executable(self.spec["py-sip"].prefix.bin.join("sip-build"))
sip_build(
"--target-dir=" + python_platlib,
@@ -130,3 +133,13 @@ class Qscintilla(QMakePackage):
makefile = FileFilter(join_path("build", "Makefile"))
makefile.filter("$(INSTALL_ROOT)", "", string=True)
make("install", "-C", "build/")
+
+ def test_python_import(self):
+ if "+python" in self.spec:
+ python = self.spec["python"].command
+ if "^py-pyqt5" in self.spec:
+ python("-c", "import PyQt5.Qsci")
+ if "^py-pyqt6" in self.spec:
+ python("-c", "import PyQt6.Qsci")
+ else:
+ print("qscintilla ins't built with python, skipping import test")