cgns: enable tools (#35713)

This commit is contained in:
nicolas le goff 2023-03-10 08:59:23 +01:00 committed by GitHub
parent 617f44f9ed
commit 566fb51d71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 72 additions and 1 deletions

View File

@ -0,0 +1,58 @@
Description: Remove matherr hack
Remove matherr hack, that is only needed for Sun shared libraries and
causes an FTBFS with glibc 2.27 onwards, as SVID error handling has
been removed.
Author: Aurelien Jarno <aurel32@debian.org>
Last-Update: 2018-02-12
--- libcgns-3.3.0.orig/src/cgnstools/cgnscalc/calcwish.c
+++ libcgns-3.3.0/src/cgnstools/cgnscalc/calcwish.c
@@ -15,14 +15,6 @@
#include "tk.h"
#include "locale.h"
-/*
- * The following variable is a special hack that is needed in order for
- * Sun shared libraries to be used for Tcl.
- */
-
-extern int matherr();
-int *tclDummyMathPtr = (int *) matherr;
-
#ifdef TK_TEST
extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
--- libcgns-3.3.0.orig/src/cgnstools/cgnsplot/plotwish.c
+++ libcgns-3.3.0/src/cgnstools/cgnsplot/plotwish.c
@@ -15,14 +15,6 @@
#include "tk.h"
#include "locale.h"
-/*
- * The following variable is a special hack that is needed in order for
- * Sun shared libraries to be used for Tcl.
- */
-
-extern int matherr();
-int *tclDummyMathPtr = (int *) matherr;
-
extern int Cgnstcl_Init _ANSI_ARGS_((Tcl_Interp *interp));
extern int Tkogl_Init _ANSI_ARGS_((Tcl_Interp *interp));
--- libcgns-3.3.0.orig/src/cgnstools/cgnsview/cgiowish.c
+++ libcgns-3.3.0/src/cgnstools/cgnsview/cgiowish.c
@@ -15,14 +15,6 @@
#include "tk.h"
#include "locale.h"
-/*
- * The following variable is a special hack that is needed in order for
- * Sun shared libraries to be used for Tcl.
- */
-
-extern int matherr();
-int *tclDummyMathPtr = (int *) matherr;
-
#ifdef TK_TEST
extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));

View File

@ -44,6 +44,7 @@ class Cgns(CMakePackage):
variant("testing", default=False, description="Build CGNS testing") variant("testing", default=False, description="Build CGNS testing")
variant("legacy", default=False, description="Enable legacy options") variant("legacy", default=False, description="Enable legacy options")
variant("mem_debug", default=False, description="Enable memory debugging option") variant("mem_debug", default=False, description="Enable memory debugging option")
variant("tools", default=False, description="Enable CGNS tools")
depends_on("cmake@3.12:", when="@4.3:", type="build") depends_on("cmake@3.12:", when="@4.3:", type="build")
depends_on("cmake@3.8:", when="@4.2:", type="build") depends_on("cmake@3.8:", when="@4.2:", type="build")
@ -52,6 +53,18 @@ class Cgns(CMakePackage):
depends_on("hdf5+mpi", when="+hdf5+mpi") depends_on("hdf5+mpi", when="+hdf5+mpi")
depends_on("mpi", when="+mpi") depends_on("mpi", when="+mpi")
# cgnsview requires tk to run
depends_on("tk", when="+tools", type=("build", "link", "run"))
depends_on("tcl", when="+tools")
depends_on("gl", when="+tools")
depends_on("glu", when="+tools")
depends_on("libxmu", when="+tools")
depends_on("libsm", when="+tools")
# patch for error undefined reference to `matherr, see
# https://bugs.gentoo.org/662210
patch("no-matherr.patch", when="@:3.3.1 +tools")
def cmake_args(self): def cmake_args(self):
spec = self.spec spec = self.spec
options = [] options = []
@ -63,7 +76,7 @@ def cmake_args(self):
self.define_from_variant("CGNS_ENABLE_PARALLEL", "mpi"), self.define_from_variant("CGNS_ENABLE_PARALLEL", "mpi"),
"-DCGNS_ENABLE_TESTS:BOOL=OFF", "-DCGNS_ENABLE_TESTS:BOOL=OFF",
self.define_from_variant("CGNS_BUILD_TESTING", "testing"), self.define_from_variant("CGNS_BUILD_TESTING", "testing"),
"-DCGNS_BUILD_CGNSTOOLS:BOOL=OFF", self.define_from_variant("CGNS_BUILD_CGNSTOOLS", "tools"),
self.define_from_variant("CGNS_BUILD_SHARED", "shared"), self.define_from_variant("CGNS_BUILD_SHARED", "shared"),
self.define_from_variant("CGNS_BUILD_STATIC", "static"), self.define_from_variant("CGNS_BUILD_STATIC", "static"),
self.define_from_variant("CGNS_ENABLE_BASE_SCOPE", "base_scope"), self.define_from_variant("CGNS_ENABLE_BASE_SCOPE", "base_scope"),