From 4527b45e865e2ff38fe5defb0137831b484e959f Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sat, 20 Jul 2024 01:56:40 -0400 Subject: [PATCH 1/2] gtksourceview5: fix build on x86_64-darwin --- pkgs/development/libraries/gtksourceview/5.x.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gtksourceview/5.x.nix b/pkgs/development/libraries/gtksourceview/5.x.nix index d4ac1e9bb09f..f1a12eb0de12 100644 --- a/pkgs/development/libraries/gtksourceview/5.x.nix +++ b/pkgs/development/libraries/gtksourceview/5.x.nix @@ -40,6 +40,9 @@ stdenv.mkDerivation (finalAttrs: { ./4.x-nix_share_path.patch ]; + # The 10.12 SDK used by x86_64-darwin requires defining `_POSIX_C_SOURCE` to use `strnlen`. + env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) "-D_POSIX_C_SOURCE=200809L"; + nativeBuildInputs = [ meson ninja @@ -113,7 +116,5 @@ stdenv.mkDerivation (finalAttrs: { platforms = platforms.unix; license = licenses.lgpl21Plus; maintainers = teams.gnome.members; - # https://hydra.nixos.org/build/258191535/nixlog/1 - broken = stdenv.isDarwin && stdenv.isx86_64; }; }) From 08f4ed25f25da5bbf2cac83406d14db37941d1c4 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sat, 20 Jul 2024 00:33:52 -0400 Subject: [PATCH 2/2] icon-library: use gettext from nixpkgs The vendored gettext fails to build with clang 16 on Darwin. The gettext in nixpkgs works. --- pkgs/applications/graphics/icon-library/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/applications/graphics/icon-library/default.nix b/pkgs/applications/graphics/icon-library/default.nix index 2f4aae6dc261..8b2347f43818 100644 --- a/pkgs/applications/graphics/icon-library/default.nix +++ b/pkgs/applications/graphics/icon-library/default.nix @@ -2,12 +2,14 @@ , stdenv , fetchurl , wrapGAppsHook4 +, buildPackages , cargo , desktop-file-utils , meson , ninja , pkg-config , rustc +, gettext , gdk-pixbuf , glib , gtk4 @@ -25,6 +27,14 @@ stdenv.mkDerivation rec { hash = "sha256-nWGTYoSa0/fxnD0Mb2132LkeB1oa/gj/oIXBbI+FDw8="; }; + env = lib.optionalAttrs stdenv.isDarwin { + # Set the location to gettext to ensure the nixpkgs one on Darwin instead of the vendored one. + # The vendored gettext does not build with clang 16. + GETTEXT_BIN_DIR = "${lib.getBin buildPackages.gettext}/bin"; + GETTEXT_INCLUDE_DIR = "${lib.getDev gettext}/include"; + GETTEXT_LIB_DIR = "${lib.getLib gettext}/lib"; + }; + nativeBuildInputs = [ cargo desktop-file-utils