summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Green <greenc@fnal.gov>2024-10-16 12:18:46 -0500
committerGitHub <noreply@github.com>2024-10-16 11:18:46 -0600
commit5611523bafba56017a80619cdc948b84fe15e030 (patch)
tree4269e0ce0ec31f6da8a823f68894fcfda184d137
parent4ff07c3918ec6db9fc910a5730847e48868fd318 (diff)
downloadspack-5611523bafba56017a80619cdc948b84fe15e030.tar.gz
spack-5611523bafba56017a80619cdc948b84fe15e030.tar.bz2
spack-5611523bafba56017a80619cdc948b84fe15e030.tar.xz
spack-5611523bafba56017a80619cdc948b84fe15e030.zip
`ftgl`: Handle char/unsigned char API change with the update to freetype@2.13.3 (#47003)
* [ftgl] Restrict GCC 14+ patch to apply only to GCC 14+ The patch added by #46927 should only be applied where it is needed: with GCC 11 it causes a compilation failure where none previously existed. * Fix the contraint for applying unsiged char patch to ^freetype@2.13.3: --------- Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/ftgl/package.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/ftgl/package.py b/var/spack/repos/builtin/packages/ftgl/package.py
index 202aba4fd1..3798f8457d 100644
--- a/var/spack/repos/builtin/packages/ftgl/package.py
+++ b/var/spack/repos/builtin/packages/ftgl/package.py
@@ -18,15 +18,12 @@ class Ftgl(CMakePackage):
version("2.4.0", commit="483639219095ad080538e07ceb5996de901d4e74")
version("2.3.1", commit="3c0fdf367824b6381f29df3d8b4590240db62ab7")
- depends_on("c", type="build") # generated
- depends_on("cxx", type="build") # generated
+ depends_on("c", type="build")
+ depends_on("cxx", type="build")
- # FIXME: Doc generation is broken in upstream build system
- # variant('doc', default=False, description='Build the documentation')
variant("shared", default=True, description="Build as a shared library")
depends_on("cmake@2.8:", type="build")
- # depends_on('doxygen', type='build', when='+doc') -- FIXME, see above
depends_on("pkgconfig", type="build")
depends_on("gl")
depends_on("glu")
@@ -34,16 +31,24 @@ class Ftgl(CMakePackage):
# Fix oversight in CMakeLists
patch("remove-ftlibrary-from-sources.diff", when="@:2.4.0")
- # Fix gcc14 compilation error due to type mismatch in FTContour
+
+ # As reported by Khem Raj in
+ # https://github.com/kraj/ftgl/commit/37ed7d606a0dfecdcb4ab0c26d1b0132cd96d5fa
+ # freetype 2.13.3 changed the type of many external chars to unsigned char!
patch(
"https://patch-diff.githubusercontent.com/raw/frankheckenbach/ftgl/pull/20.patch?full_index=1",
sha256="e2a0810fbf68403931bef4fbfda22e010e01421c92eeaa45f62e4e47f2381ebd",
- when="@2.4.0",
+ when="^freetype@2.13.3:",
)
def cmake_args(self):
spec = self.spec
args = ["-DBUILD_SHARED_LIBS={0}".format(spec.satisfies("+shared"))]
+
+ # To not fail the build for 'char/unsigned char' conversion errors,
+ # downgrade them to warnings in general to not fail the build:
+ args.append("-DCMAKE_CXX_FLAGS=-fpermissive")
+
if "darwin" in self.spec.architecture:
args.append("-DCMAKE_MACOSX_RPATH=ON")
return args