From d2c62217d3748a3ff8ac8d6c9281cb05f92ae641 Mon Sep 17 00:00:00 2001 From: aleksana Date: Wed, 26 Nov 2025 00:32:54 +0800 Subject: [PATCH] libcosmicAppHook: use RUSTFLAGS instead of platform specific flags This ensures these flags are picked up correctly, after latest rust update. We can revert this if we solve the root cause later. See https://github.com/NixOS/nixpkgs/issues/464392 --- pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh | 6 +++++- pkgs/by-name/li/libcosmicAppHook/package.nix | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh b/pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh index e6a523191956..7245d51495c0 100644 --- a/pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh +++ b/pkgs/by-name/li/libcosmicAppHook/libcosmic-app-hook.sh @@ -15,7 +15,11 @@ libcosmicAppVergenHook() { libcosmicAppLinkerArgsHook() { # Force linking to certain libraries like libEGL, which are always dlopen()ed - local flags="CARGO_TARGET_@cargoLinkerVar@_RUSTFLAGS" + # local flags="CARGO_TARGET_@cargoLinkerVar@_RUSTFLAGS" + + # Temporarily use this simpler solution, it should work for simple cross compilation + # https://github.com/NixOS/nixpkgs/issues/464392 + local flags="RUSTFLAGS" export "$flags"="${!flags-} -C link-arg=-Wl,--push-state,--no-as-needed" # shellcheck disable=SC2043 diff --git a/pkgs/by-name/li/libcosmicAppHook/package.nix b/pkgs/by-name/li/libcosmicAppHook/package.nix index f3042e13ac8e..150bfd679762 100644 --- a/pkgs/by-name/li/libcosmicAppHook/package.nix +++ b/pkgs/by-name/li/libcosmicAppHook/package.nix @@ -55,7 +55,10 @@ makeSetupHook { lib.makeSearchPath "share" ( lib.optionals includeSettings [ fallbackThemes ] ++ [ targetPackages.cosmic-icons ] ); - cargoLinkerVar = targetPackages.stdenv.hostPlatform.rust.cargoEnvVarTarget; + # Temporarily using RUSTFLAGS: https://github.com/NixOS/nixpkgs/issues/464392 + # See ./libcosmic-app-hook.sh + # cargoLinkerVar = targetPackages.stdenv.hostPlatform.rust.cargoEnvVarTarget; + # force linking for all libraries that may be dlopen'd by libcosmic/iced apps cargoLinkLibs = lib.escapeShellArgs ( [