1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

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.
This commit is contained in:
Randy Eckenrode 2024-07-20 00:30:46 -04:00
parent ce5160509e
commit 7ce464459d
No known key found for this signature in database
GPG key ID: 64C1CD4EC2A600D9

View file

@ -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 ];