Add ncvis package and add option to wxwidgets (#38204)

* Add ncvis and opengl option for wxwidgets

* Style fixes for ncvis

* Replace in with satisfies for opengl constraint

Co-authored-by: Alec Scott <alec@bcs.sh>

---------

Co-authored-by: Alec Scott <alec@bcs.sh>
This commit is contained in:
Brian Vanderwende 2024-03-02 11:26:36 -07:00 committed by GitHub
parent eb90e2c894
commit 4af9ec3d8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,32 @@
# Copyright 2013-2023 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 *
class Ncvis(CMakePackage):
"""A NetCDF file viewer. ncvis is inspired by David Pierce's
most excellent ncview utility."""
homepage = "https://github.com/SEATStandards/ncvis"
url = "https://github.com/SEATStandards/ncvis/archive/refs/tags/2022.08.28.tar.gz"
git = "https://github.com/SEATStandards/ncvis.git"
maintainers("vanderwb")
version(
"2022.08.28", sha256="a522926739b2a05ef0b436fe67a2014557f9e5fecf3b7d7700964e9006a4bf3e"
)
depends_on("cmake", type="build")
depends_on("netcdf-c", type="link")
depends_on("wxwidgets+opengl", type="link")
@run_after("install")
def install_resources(self):
install_tree("resources", self.prefix.resources)
def setup_run_environment(self, env):
env.set("NCVIS_RESOURCE_DIR", self.prefix.resources)

View File

@ -29,10 +29,13 @@ class Wxwidgets(AutotoolsPackage):
version("3.0.2", sha256="346879dc554f3ab8d6da2704f651ecb504a22e9d31c17ef5449b129ed711585d")
version("3.0.1", sha256="bd671b79ec56af8fb3844e11cafceac1a4276fb02c79404d06b91b6c19d2c5f5")
variant("opengl", default=False, description="Enable OpenGL support")
patch("math_include.patch", when="@3.0.1:3.0.2")
depends_on("pkgconfig", type="build")
depends_on("gtkplus")
depends_on("mesa-glu", when="+opengl")
@when("@:3.0.2")
def build(self, spec, prefix):
@ -42,6 +45,9 @@ def configure_args(self):
spec = self.spec
options = ["--enable-unicode", "--disable-precomp-headers"]
if self.spec.satisfies("+opengl"):
options.append("--with-opengl")
# see https://trac.wxwidgets.org/ticket/17639
if spec.satisfies("@:3.1.0") and sys.platform == "darwin":
options.extend(["--disable-qtkit", "--disable-mediactrl"])