From 2beb67827c2e1f3c2d17d81a097f78de16a1bd9b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 19 Dec 2024 13:58:01 -0500 Subject: [PATCH] opencascade-occt: fix compilation on darwin (#365409) ``` FAILED: src/TKV3d/CMakeFiles/TKV3d.dir/__/StdPrs/StdPrs_BRepFont.cxx.o /nix/store/raqax5qp65an4jcwj1bzd5lq589ywpg0-clang-wrapper-16.0.6/bin/clang++ -DHAVE_FREETYPE -DHAVE_OPENGL -DHAVE_OPENGL_EXT -DHAVE_TK -DOCC_CO> /tmp/nix-build-opencascade-occt-7.8.1.drv-0/occt-V7_8_1-bd2a789/src/StdPrs/StdPrs_BRepFont.cxx:460:17: error: cannot initialize a variable of t> const char* aTags = &anOutline->tags[aStartIndex]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` (cherry picked from commit 159385c1aec83734ea490c762925647846f749b6) --- pkgs/by-name/op/opencascade-occt/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/op/opencascade-occt/package.nix b/pkgs/by-name/op/opencascade-occt/package.nix index 5b84417830f36..3d9c247b75eac 100644 --- a/pkgs/by-name/op/opencascade-occt/package.nix +++ b/pkgs/by-name/op/opencascade-occt/package.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, fetchpatch , cmake , ninja , tcl @@ -24,6 +25,15 @@ stdenv.mkDerivation rec { hash = "sha256-AGMZqTLLjXbzJFW/RSTsohAGV8sMxlUmdU/Y2oOzkk8="; }; + patches = [ + # fix compilation on darwin against latest version of freetype + # https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/330 + (fetchpatch { + url = "https://github.com/Open-Cascade-SAS/OCCT/commit/7236e83dcc1e7284e66dc61e612154617ef715d6.diff"; + hash = "sha256-NoC2mE3DG78Y0c9UWonx1vmXoU4g5XxFUT3eVXqLU60="; + }) + ]; + nativeBuildInputs = [ cmake ninja