From 27a71a19ed6748177c073fe8dfad95849e9f5058 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sat, 3 Aug 2019 11:09:41 -0400 Subject: [PATCH 1/5] gtk3: defines for debugging, disable cast checks Because we're using plain buildtype these have to be passed manually. See: https://gitlab.gnome.org/GNOME/gtk/blob/3.24.10/meson.build#L59 With autotools the mapping for the the options to the defines was: yes: G_ENABLE_DEBUG G_ENABLE_CONSISTENCY_CHECKS minimum: G_ENABLE_DEBUG G_DISABLE_CAST_CHECKS no: G_DISABLE_CAST_CHECKS G_DISABLE_ASSERT G_DISABLE_CHECKS So we're passing the exact ones that would've been used for minimum. Additionally it isn't a good idea to pass the equivalents used for "no" as it eliminates G_ENABLE_DEBUG which disables pre-condition checks and assertions. The actual option only existed to serve people who needed a specific build of GTK for very specific environments. And now they are much better served with meson's plain buildtype and figuring out what to pass themselves. --- pkgs/development/libraries/gtk+/3.x.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix index 94b745794f1..40be17fcac7 100644 --- a/pkgs/development/libraries/gtk+/3.x.nix +++ b/pkgs/development/libraries/gtk+/3.x.nix @@ -77,6 +77,13 @@ stdenv.mkDerivation rec { "-Dtests=false" ]; + # These are the defines that'd you'd get with --enable-debug=minimum (default). + # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options + NIX_CFLAGS_COMPILE = [ + "-DG_ENABLE_DEBUG" + "-DG_DISABLE_CAST_CHECKS" + ]; + postPatch = '' files=( build-aux/meson/post-install.py From 60266eb504938631d2162a1fba3044eaa0d62d91 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sat, 3 Aug 2019 11:10:41 -0400 Subject: [PATCH 2/5] glib: add cflag G_DISABLE_CAST_CHECKS This is what would have been passed before with the release buildtype. See: https://gitlab.gnome.org/GNOME/glib/blob/2.60.4/meson.build#L208 --- pkgs/development/libraries/glib/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index ecbcbea1394..ed7c66946fa 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -98,8 +98,12 @@ stdenv.mkDerivation rec { LC_ALL = "en_US.UTF-8"; - NIX_CFLAGS_COMPILE = (optional stdenv.isSunOS "-DBSD_COMP") - ++ [ "-Wno-error=nonnull" ]; + NIX_CFLAGS_COMPILE = [ + "-Wno-error=nonnull" + # Default for release buildtype but passed manually because + # we're using plain + "-DG_DISABLE_CAST_CHECKS" + ] ++ optional stdenv.isSunOS "-DBSD_COMP"; postPatch = '' # substitute fix-gio-launch-desktop-path.patch From c7c727fa9382e4f4cc69b63642585f96890add83 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Mon, 5 Aug 2019 06:13:01 -0400 Subject: [PATCH 3/5] gnome3.gnome-settings-daemon: add cflag G_DISABLE_CAST_CHECKS This is what would have been passed before with the release buildtype. See: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/blob/GNOME_SETTINGS_DAEMON_3_32_1/meson.build#L73 --- .../desktops/gnome-3/core/gnome-settings-daemon/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix index 6929f821e37..b9f33ce73a8 100644 --- a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix +++ b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix @@ -95,6 +95,12 @@ stdenv.mkDerivation rec { "-Dudev_dir=${placeholder "out"}/lib/udev" ]; + NIX_CFLAGS_COMPILE = [ + # Default for release buildtype but passed manually because + # we're using plain + "-DG_DISABLE_CAST_CHECKS" + ]; + # So the polkit policy can reference /run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper postFixup = '' mkdir -p $out/bin/gnome-settings-daemon From 3b085b45b903bd00d37be4fd8e28e4346aa0fd92 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sun, 4 Aug 2019 09:50:13 -0400 Subject: [PATCH 4/5] pantheon.elementary-settings-daemon: add cflag G_DISABLE_CAST_CHECKS Mirror c7c727fa9382e4f4cc69b63642585f96890add83. --- .../services/elementary-settings-daemon/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix b/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix index d8514c51f4f..b4391b2e1b0 100644 --- a/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix +++ b/pkgs/desktops/pantheon/services/elementary-settings-daemon/default.nix @@ -150,6 +150,12 @@ stdenv.mkDerivation rec { "-Dudev_dir=${placeholder "out"}/lib/udev" ]; + NIX_CFLAGS_COMPILE = [ + # Default for release buildtype but passed manually because + # we're using plain + "-DG_DISABLE_CAST_CHECKS" + ]; + passthru = { updateScript = gnome3.updateScript { packageName = projectName; From f2eddec042da1d6bf38106565f0ee5c33c23c062 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Mon, 5 Aug 2019 06:19:44 -0400 Subject: [PATCH 5/5] glib: drop define BSD_COMP I fail to see where or for what it is useful for. --- pkgs/development/libraries/glib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index ed7c66946fa..7b226f9fc80 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -103,7 +103,7 @@ stdenv.mkDerivation rec { # Default for release buildtype but passed manually because # we're using plain "-DG_DISABLE_CAST_CHECKS" - ] ++ optional stdenv.isSunOS "-DBSD_COMP"; + ]; postPatch = '' # substitute fix-gio-launch-desktop-path.patch