qt-tools: new package (#45602)

* qt-tools: new pkg with +designer to build Qt Designer for QWT

* qt-tools: fix style

* qt-tools: fix unused variable

* qt-tools: rm setup_run_environments (now in qt-base)

* qt-tools: add myself as maintainer

* qt-tools: add variant assistant; use commits with submodule

* qt-base: define QtPackage.get_git
This commit is contained in:
Wouter Deconinck 2024-11-16 09:09:41 -06:00 committed by GitHub
parent e56057fd79
commit 448049ccfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 65 additions and 0 deletions

View File

@ -27,6 +27,11 @@ def get_url(qualname):
_url = "https://github.com/qt/{}/archive/refs/tags/v6.2.3.tar.gz"
return _url.format(qualname.lower())
@staticmethod
def get_git(qualname):
_git = "https://github.com/qt/{}.git"
return _git.format(qualname.lower())
@staticmethod
def get_list_url(qualname):
_list_url = "https://github.com/qt/{}/tags"

View File

@ -0,0 +1,60 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
from spack.pkg.builtin.qt_base import QtBase, QtPackage
class QtTools(QtPackage):
"""Qt Tools contains tools like Qt Designer."""
url = QtPackage.get_url(__qualname__)
git = QtPackage.get_git(__qualname__)
list_url = QtPackage.get_list_url(__qualname__)
maintainers("wdconinc")
license("BSD-3-Clause")
# src/assistant/qlitehtml is a submodule that is not in the git archive
version("6.7.3", commit="ec4747e62a837a0262212a5f4fb03734660c7360", submodules=True)
version("6.7.2", commit="46ffaed90df8c14d67b4b16fdf5e0b87ab227c88", submodules=True)
variant(
"assistant",
default=False,
description="Qt Assistant for viewing on-line documentation in Qt help file format.",
)
variant(
"designer",
default=False,
description="Qt Widgets Designer for designing and building GUIs with Qt Widgets.",
)
depends_on("llvm +clang")
depends_on("qt-base +network")
depends_on("qt-base +widgets", when="+designer")
for _v in QtBase.versions:
v = str(_v)
depends_on("qt-base@" + v, when="@" + v)
def cmake_args(self):
spec = self.spec
args = super().cmake_args() + []
def define(cmake_var, value):
args.append(self.define(cmake_var, value))
if spec.satisfies("+assistant"):
define("FEATURE_assistant", True)
if spec.satisfies("+designer"):
define("FEATURE_designer", True)
return args