summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-06-26 14:19:41 +0200
committerGitHub <noreply@github.com>2024-06-26 14:19:41 +0200
commitac0fd7138f25ee8cc9680cf917c09aa3acd7452a (patch)
treee777ae24692c35e577734c4e814715a9b0d1f949
parentc0f9f47b8c35ec48d76211f45f024869f95a5c38 (diff)
downloadspack-ac0fd7138f25ee8cc9680cf917c09aa3acd7452a.tar.gz
spack-ac0fd7138f25ee8cc9680cf917c09aa3acd7452a.tar.bz2
spack-ac0fd7138f25ee8cc9680cf917c09aa3acd7452a.tar.xz
spack-ac0fd7138f25ee8cc9680cf917c09aa3acd7452a.zip
oce: deprecate (#44864)
-rw-r--r--var/spack/repos/builtin/packages/oce/package.py100
-rw-r--r--var/spack/repos/builtin/packages/oce/sierra.patch12
2 files changed, 46 insertions, 66 deletions
diff --git a/var/spack/repos/builtin/packages/oce/package.py b/var/spack/repos/builtin/packages/oce/package.py
index ecc72911ae..71a6ef5fcc 100644
--- a/var/spack/repos/builtin/packages/oce/package.py
+++ b/var/spack/repos/builtin/packages/oce/package.py
@@ -3,13 +3,10 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-import platform
-
-from spack.operating_systems.mac_os import macos_version
from spack.package import *
-class Oce(Package):
+class Oce(CMakePackage):
"""Open CASCADE Community Edition
UNMAINTAINED: see https://github.com/tpaviot/oce/issues/745#issuecomment-992285943
@@ -18,20 +15,33 @@ class Oce(Package):
homepage = "https://github.com/tpaviot/oce"
url = "https://github.com/tpaviot/oce/archive/OCE-0.18.tar.gz"
- version("0.18.3", sha256="c553d6a7bf52f790abc3b6bb7a1e91a65947e92a426bb1a88a11960c31f0966c")
- version("0.18.2", sha256="dc21ddea678a500ad87c773e9a502ed7a71768cf83d9af0bd4c43294186a7fef")
- version("0.18.1", sha256="1acf5da4bffa3592ca9f3535af9b927b79fcfeadcb81e9963e89aec192929a6c")
- version("0.18", sha256="226e45e77c16a4a6e127c71fefcd171410703960ae75c7ecc7eb68895446a993")
- version("0.17.2", sha256="8d9995360cd531cbd4a7aa4ca5ed969f08ec7c7a37755e2f3d4ef832c1b2f56e")
- version("0.17.1", sha256="b1ff0cb8cf31339bbb30ac7ed2415d376b9b75810279d2f497e115f08c090928")
- version("0.17", sha256="9ab0dc2a2d125b46cef458b56c6d171dfe2218d825860d616c5ab17994b8f74d")
- version("0.16.1", sha256="d31030c8da4a1b33f767d0d59895a995c8eabc8fc65cbe0558734f6021ea2f57")
- version("0.16", sha256="841fe4337a5a4e733e36a2efc4fe60a4e6e8974917028df05d47a02f59787515")
+ with default_args(deprecated=True):
+ version(
+ "0.18.3", sha256="c553d6a7bf52f790abc3b6bb7a1e91a65947e92a426bb1a88a11960c31f0966c"
+ )
+ version(
+ "0.18.2", sha256="dc21ddea678a500ad87c773e9a502ed7a71768cf83d9af0bd4c43294186a7fef"
+ )
+ version(
+ "0.18.1", sha256="1acf5da4bffa3592ca9f3535af9b927b79fcfeadcb81e9963e89aec192929a6c"
+ )
+ version("0.18", sha256="226e45e77c16a4a6e127c71fefcd171410703960ae75c7ecc7eb68895446a993")
+ version(
+ "0.17.2", sha256="8d9995360cd531cbd4a7aa4ca5ed969f08ec7c7a37755e2f3d4ef832c1b2f56e"
+ )
+ version(
+ "0.17.1", sha256="b1ff0cb8cf31339bbb30ac7ed2415d376b9b75810279d2f497e115f08c090928"
+ )
+ version("0.17", sha256="9ab0dc2a2d125b46cef458b56c6d171dfe2218d825860d616c5ab17994b8f74d")
+ version(
+ "0.16.1", sha256="d31030c8da4a1b33f767d0d59895a995c8eabc8fc65cbe0558734f6021ea2f57"
+ )
+ version("0.16", sha256="841fe4337a5a4e733e36a2efc4fe60a4e6e8974917028df05d47a02f59787515")
variant("tbb", default=True, description="Build with Intel Threading Building Blocks")
variant("X11", default=False, description="Build with X11 enabled")
- depends_on("cmake@2.8:", type="build")
+ depends_on("cmake@3:", type="build")
with when("+tbb"):
depends_on("tbb")
@@ -50,43 +60,25 @@ class Oce(Package):
# see https://github.com/tpaviot/oce/issues/675
patch("xlocale.patch", level=0, when="@0.18.1:0.18.2")
- # fix build with Xcode 8 "previous definition of CLOCK_REALTIME"
- # reported 27 Sep 2016 https://github.com/tpaviot/oce/issues/643
- if (platform.system() == "Darwin") and (macos_version() == Version("10.12")):
- patch("sierra.patch", when="@0.17.2:0.18.0")
-
- def install(self, spec, prefix):
- options = []
- options.extend(std_cmake_args)
- options.extend(
- [
- "-DOCE_INSTALL_PREFIX=%s" % prefix,
- "-DOCE_BUILD_SHARED_LIB:BOOL=ON",
- "-DCMAKE_BUILD_TYPE:STRING=Release",
- "-DOCE_DATAEXCHANGE:BOOL=ON",
- "-DOCE_DISABLE_X11:BOOL=%s" % ("OFF" if "+X11" in spec else "ON"),
- "-DOCE_DRAW:BOOL=OFF",
- "-DOCE_MODEL:BOOL=ON",
- "-DOCE_MULTITHREAD_LIBRARY:STRING=%s" % ("TBB" if "+tbb" in spec else "NONE"),
- "-DOCE_OCAF:BOOL=ON",
- "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=OFF",
- "-DOCE_VISUALISATION:BOOL=OFF",
- "-DOCE_WITH_FREEIMAGE:BOOL=OFF",
- "-DOCE_WITH_GL2PS:BOOL=OFF",
- "-DOCE_WITH_OPENCL:BOOL=OFF",
- ]
- )
-
- if platform.system() == "Darwin":
- options.extend(["-DOCE_OSX_USE_COCOA:BOOL=ON"])
-
- if platform.system() == "Darwin" and (macos_version() >= Version("10.12")):
- # use @rpath on Sierra due to limit of dynamic loader
- options.append("-DCMAKE_MACOSX_RPATH=ON")
- else:
- options.append("-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib" % prefix)
-
- cmake(".", *options)
- make("install/strip")
- if self.run_tests:
- make("test")
+ def cmake_args(self):
+ args = [
+ self.define("OCE_INSTALL_PREFIX", self.prefix),
+ self.define("OCE_BUILD_SHARED_LIB", True),
+ self.define("OCE_DATAEXCHANGE", True),
+ self.define("OCE_DISABLE_X11", self.spec.satisfies("~X11")),
+ self.define("OCE_DRAW", False),
+ self.define("OCE_MODEL", True),
+ self.define(
+ "OCE_MULTITHREAD_LIBRARY", ("TBB" if self.spec.satisfies("+tbb") else "NONE")
+ ),
+ self.define("OCE_OCAF", True),
+ self.define("OCE_USE_TCL_TEST_FRAMEWORK", False),
+ self.define("OCE_VISUALISATION", False),
+ self.define("OCE_WITH_FREEIMAGE", False),
+ self.define("OCE_WITH_GL2PS", False),
+ self.define("OCE_WITH_OPENCL", False),
+ ]
+
+ if self.spec.satisfies("platform=darwin"):
+ args.append(self.define("OCE_OSX_USE_COCOA", True))
+ return args
diff --git a/var/spack/repos/builtin/packages/oce/sierra.patch b/var/spack/repos/builtin/packages/oce/sierra.patch
deleted file mode 100644
index 1c0c86569b..0000000000
--- a/var/spack/repos/builtin/packages/oce/sierra.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/OSD/OSD_Chronometer.cxx b/src/OSD/OSD_Chronometer.cxx
-index f7374fb..63ac140 100644
---- a/src/OSD/OSD_Chronometer.cxx.old
-+++ b/src/OSD/OSD_Chronometer.cxx
-@@ -51,7 +51,7 @@
- #include <mach/mach.h>
- #endif
-
--#if defined(__APPLE__) && defined(__MACH__)
-+#if defined(__APPLE__) && !defined(__MAC_10_12)
- #include "gettime_osx.h"
- #endif