From 7ce464459d12260e715c8519bb18e2239c322a32 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sat, 20 Jul 2024 00:30:46 -0400 Subject: [PATCH] wv2: fix build with clang 16 and on Darwin - Set the language version to C++14, so Synfig Studio can continue using the deprecated APIs; and - Explicitly link gobject-2.0 on Darwin to avoid missing symbol errors when linking. --- pkgs/tools/misc/wv2/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/tools/misc/wv2/default.nix b/pkgs/tools/misc/wv2/default.nix index 14420c1c3908..3a7bd5d395a6 100644 --- a/pkgs/tools/misc/wv2/default.nix +++ b/pkgs/tools/misc/wv2/default.nix @@ -10,6 +10,15 @@ stdenv.mkDerivation rec { patches = [ ./fix-include.patch ]; + # Newer versions of clang default to C++17, which removes some deprecated APIs such as bind1st. + # Setting the language version to C++14 makes them available again. + cmakeFlags = lib.optionals stdenv.cc.isClang [ (lib.cmakeFeature "CMAKE_CXX_STANDARD" "14") ]; + + # Linking gobject explicitly fixes missing symbols (such as missing `_g_object_unref`) on Darwin. + preConfigure = lib.optionalString stdenv.isDarwin '' + export NIX_LDFLAGS+=" $(pkg-config gobject-2.0 --libs)" + ''; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ libgsf glib libxml2 ];