From 6f62ff2261e1f750e4c0b4bb38fbdeef82aa5fc7 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:37:53 +0000 Subject: [PATCH 01/13] libtommath: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/li/libtommath/package.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/by-name/li/libtommath/package.nix b/pkgs/by-name/li/libtommath/package.nix index cfc07912e46d..296617e1ee38 100644 --- a/pkgs/by-name/li/libtommath/package.nix +++ b/pkgs/by-name/li/libtommath/package.nix @@ -29,10 +29,6 @@ stdenv.mkDerivation rec { makefile = "makefile.shared"; - env.NIX_CFLAGS_COMPILE = lib.optionalString ( - stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 - ) "-DTARGET_OS_IPHONE=0"; - enableParallelBuilding = true; meta = with lib; { From 69c435e77a2833f47a11afa09198c2a588a5798a Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 6 Oct 2024 01:38:47 +0100 Subject: [PATCH 02/13] libtomcrypt: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/li/libtomcrypt/package.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/by-name/li/libtomcrypt/package.nix b/pkgs/by-name/li/libtomcrypt/package.nix index b44b19cc53cf..f2a74bba838b 100644 --- a/pkgs/by-name/li/libtomcrypt/package.nix +++ b/pkgs/by-name/li/libtomcrypt/package.nix @@ -16,10 +16,6 @@ stdenv.mkDerivation rec { sha256 = "113vfrgapyv72lalhd3nkw7jnks8az0gcb5wqn9hj19nhcxlrbcn"; }; - # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin - # upgrades to a newer SDK. - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DTARGET_OS_IPHONE=0"; - patches = [ (fetchpatch { name = "CVE-2019-17362.patch"; From 6cdd31392ae4e1f156f40b51e60d58eff5d54b43 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:40:06 +0000 Subject: [PATCH 03/13] grandorgue: remove obsolete `TARGET_OS_*` workaround --- pkgs/applications/audio/grandorgue/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/applications/audio/grandorgue/default.nix b/pkgs/applications/audio/grandorgue/default.nix index 674486a23adb..ab333f83ed53 100644 --- a/pkgs/applications/audio/grandorgue/default.nix +++ b/pkgs/applications/audio/grandorgue/default.nix @@ -47,8 +47,6 @@ stdenv.mkDerivation rec { "-DINSTALL_DEPEND=OFF" ] ++ lib.optional (!includeDemo) "-DINSTALL_DEMO=OFF"; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DTARGET_OS_IPHONE=0"; - postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p $out/{Applications,bin,lib} mv $out/GrandOrgue.app $out/Applications/ From b0e229092a554ca127f26f738c1c995026628eb3 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:40:27 +0000 Subject: [PATCH 04/13] gtk-frdp: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/gt/gtk-frdp/package.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkgs/by-name/gt/gtk-frdp/package.nix b/pkgs/by-name/gt/gtk-frdp/package.nix index 94d558c9ff7b..b2956f1926aa 100644 --- a/pkgs/by-name/gt/gtk-frdp/package.nix +++ b/pkgs/by-name/gt/gtk-frdp/package.nix @@ -48,13 +48,6 @@ stdenv.mkDerivation rec { }; }; - env.NIX_CFLAGS_COMPILE = toString ( - lib.optionals stdenv.hostPlatform.isDarwin [ - "-DTARGET_OS_IPHONE=0" - "-DTARGET_OS_WATCH=0" - ] - ); - meta = with lib; { homepage = "https://gitlab.gnome.org/GNOME/gtk-frdp"; description = "RDP viewer widget for GTK"; From 26e9e065fa7f501ec7693b39634036182a69eae9 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:41:33 +0000 Subject: [PATCH 05/13] alac: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/al/alac/package.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/by-name/al/alac/package.nix b/pkgs/by-name/al/alac/package.nix index 5aaedfe3c454..e46b5443477c 100644 --- a/pkgs/by-name/al/alac/package.nix +++ b/pkgs/by-name/al/alac/package.nix @@ -26,9 +26,6 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook ]; - # error: 'TARGET_OS_MAC' is not defined, evaluates to 0 - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DTARGET_OS_MAC"; - passthru = { updateScript = unstableGitUpdater { }; tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; From 110cca6232e13741bcf3e2f65faa14c11697225b Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:42:06 +0000 Subject: [PATCH 06/13] gotop: remove obsolete `TARGET_OS_*` workaround --- pkgs/tools/system/gotop/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/tools/system/gotop/default.nix b/pkgs/tools/system/gotop/default.nix index 0adbb2c4faf9..3c220cf9fd05 100644 --- a/pkgs/tools/system/gotop/default.nix +++ b/pkgs/tools/system/gotop/default.nix @@ -32,9 +32,6 @@ buildGoModule rec { "-X main.Version=v${version}" ]; - # prevent `error: 'TARGET_OS_MAC' is not defined` - env.CGO_CFLAGS = "-Wno-undef-prefix"; - nativeBuildInputs = [ installShellFiles ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ IOKit ]; From 4ba8d9956e1b89be0544258996decafd172c3066 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:42:37 +0000 Subject: [PATCH 07/13] freerdp{,3}: remove obsolete `TARGET_OS_*` workaround --- pkgs/applications/networking/remote/freerdp/3.nix | 2 -- pkgs/applications/networking/remote/freerdp/default.nix | 2 -- 2 files changed, 4 deletions(-) diff --git a/pkgs/applications/networking/remote/freerdp/3.nix b/pkgs/applications/networking/remote/freerdp/3.nix index 26c0567c666e..c40db22191e1 100644 --- a/pkgs/applications/networking/remote/freerdp/3.nix +++ b/pkgs/applications/networking/remote/freerdp/3.nix @@ -197,8 +197,6 @@ stdenv.mkDerivation (finalAttrs: { env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.hostPlatform.isDarwin [ - "-DTARGET_OS_IPHONE=0" - "-DTARGET_OS_WATCH=0" "-include AudioToolbox/AudioToolbox.h" ] ++ lib.optionals stdenv.cc.isClang [ diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix index e586c0e89c27..923aeea8db2f 100644 --- a/pkgs/applications/networking/remote/freerdp/default.nix +++ b/pkgs/applications/networking/remote/freerdp/default.nix @@ -217,8 +217,6 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.hostPlatform.isDarwin [ - "-DTARGET_OS_IPHONE=0" - "-DTARGET_OS_WATCH=0" "-include AudioToolbox/AudioToolbox.h" ] ++ lib.optionals stdenv.cc.isClang [ From 07464c4dca6f10b8f3197552eb9b76bd59cc5797 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:43:15 +0000 Subject: [PATCH 08/13] remmina: remove obsolete `TARGET_OS_*` workaround --- pkgs/applications/networking/remote/remmina/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/applications/networking/remote/remmina/default.nix b/pkgs/applications/networking/remote/remmina/default.nix index ba512da0c6aa..394bccb19fe1 100644 --- a/pkgs/applications/networking/remote/remmina/default.nix +++ b/pkgs/applications/networking/remote/remmina/default.nix @@ -125,11 +125,6 @@ stdenv.mkDerivation (finalAttrs: { "-DWITH_ICON_CACHE=OFF" ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [ - "-DTARGET_OS_IPHONE=0" - "-DTARGET_OS_WATCH=0" - ]); - dontWrapQtApps = true; preFixup = '' From 873cc4bf0faf539e3d05109996258cedd72ccfd5 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:43:42 +0000 Subject: [PATCH 09/13] fluent-bit: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/fl/fluent-bit/package.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/by-name/fl/fluent-bit/package.nix b/pkgs/by-name/fl/fluent-bit/package.nix index 93638c5efab3..4b1aca1de4ef 100644 --- a/pkgs/by-name/fl/fluent-bit/package.nix +++ b/pkgs/by-name/fl/fluent-bit/package.nix @@ -52,11 +52,9 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13" ]; env.NIX_CFLAGS_COMPILE = toString ( - # Used by the embedded luajit, but is not predefined on older mac SDKs. - lib.optionals stdenv.hostPlatform.isDarwin [ "-DTARGET_OS_IPHONE=0" ] # Assumes GNU version of strerror_r, and the posix version has an # incompatible return type. - ++ lib.optionals (!stdenv.hostPlatform.isGnu) [ "-Wno-int-conversion" ] + lib.optionals (!stdenv.hostPlatform.isGnu) [ "-Wno-int-conversion" ] ); outputs = [ From 7d9c19c00d5f0a36dfd8b97baaf5d98c31114c08 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:44:01 +0000 Subject: [PATCH 10/13] mynewt-newt: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/my/mynewt-newt/package.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/by-name/my/mynewt-newt/package.nix b/pkgs/by-name/my/mynewt-newt/package.nix index 524c27ad29e0..fcaf7d410fc4 100644 --- a/pkgs/by-name/my/mynewt-newt/package.nix +++ b/pkgs/by-name/my/mynewt-newt/package.nix @@ -19,10 +19,6 @@ buildGoModule rec { doCheck = false; - # CGO_ENABLED=0 required for mac - "error: 'TARGET_OS_MAC' is not defined, evaluates to 0" - # https://github.com/shirou/gopsutil/issues/976 - env.CGO_ENABLED = if stdenv.hostPlatform.isLinux then 1 else 0; - meta = with lib; { homepage = "https://mynewt.apache.org/"; description = "Build and package management tool for embedded development"; From 2dfb2974314c1150b3de806a871f9bad7c7e0b6d Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:45:06 +0000 Subject: [PATCH 11/13] cdo: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/cd/cdo/package.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/by-name/cd/cdo/package.nix b/pkgs/by-name/cd/cdo/package.nix index 886aa98be83d..6fb2fb68abe7 100644 --- a/pkgs/by-name/cd/cdo/package.nix +++ b/pkgs/by-name/cd/cdo/package.nix @@ -42,12 +42,6 @@ stdenv.mkDerivation rec { ++ lib.optional enable_all_static "--enable-all-static" ++ lib.optional enable_cxx "--enable-cxx"; - # address error: 'TARGET_OS_MACCATALYST' is not defined, - # evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_] - # we don't want to appear to be a catalyst build; - # we are a TARGET_OS_MAC - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DTARGET_OS_MACCATALYST=0"; - meta = with lib; { description = "Collection of command line Operators to manipulate and analyse Climate and NWP model Data"; mainProgram = "cdo"; From e28dd23eed8b0265b3bae12369cabf6e3e498914 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:46:28 +0000 Subject: [PATCH 12/13] icoutils: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/ic/icoutils/package.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/by-name/ic/icoutils/package.nix b/pkgs/by-name/ic/icoutils/package.nix index 399ff1cc6234..e85ef53206a8 100644 --- a/pkgs/by-name/ic/icoutils/package.nix +++ b/pkgs/by-name/ic/icoutils/package.nix @@ -37,9 +37,6 @@ stdenv.mkDerivation rec { ]; propagatedBuildInputs = [ perlPackages.LWP ]; - # Fixes build failures on Darwin. These should be defined in `TargetConditional.h`, but it’s failing anyway. - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DTARGET_OS_IPHONE=0 -DTARGET_OS_EMBEDDED=0"; - postPatch = '' patchShebangs extresso/extresso patchShebangs extresso/extresso.in From cb73dab54d14b352bde5b43e96b4ac88fbc609a7 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 6 Jan 2025 00:46:47 +0000 Subject: [PATCH 13/13] jwhois: remove obsolete `TARGET_OS_*` workaround --- pkgs/by-name/jw/jwhois/package.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/by-name/jw/jwhois/package.nix b/pkgs/by-name/jw/jwhois/package.nix index 78f2398b2876..a4f0de644ef2 100644 --- a/pkgs/by-name/jw/jwhois/package.nix +++ b/pkgs/by-name/jw/jwhois/package.nix @@ -33,11 +33,6 @@ stdenv.mkDerivation (finalAttrs: { ln -s $out/bin/jwhois $out/bin/whois ''; - # Work around error from on aarch64-darwin: - # error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_] - # TODO: this should probably be fixed at a lower level than this? - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-undef-prefix"; - env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-liconv"; meta = {