Revert "cosmic-settings: use mold linker"

This reverts commit d9344e9f67.

In Nixpkgs, we consider the linker a property of the platform.
Individual packages should not be using toolchains other than the ones
that are part of the platform without a strong justification.  In this
case, the only justification appears to have been that upstream uses
this linker.  Just like we don't force every package whose upstream
happens to use Clang in their own builds to build with Clang in
Nixpkgs rather than the platform compiler, upstream's choice alone
isn't grounds for overriding the platform linker here.
This commit is contained in:
Alyssa Ross
2025-04-08 17:58:51 +02:00
parent caf69201d3
commit 2a9bc4c1b6
+68 -76
View File
@@ -1,7 +1,6 @@
{
lib,
stdenv,
stdenvAdapters,
fetchFromGitHub,
rustPlatform,
cmake,
@@ -19,90 +18,83 @@
cosmic-randr,
xkeyboard_config,
nix-update-script,
withMoldLinker ? stdenv.targetPlatform.isLinux,
}:
let
libcosmicAppHook' = (libcosmicAppHook.__spliced.buildHost or libcosmicAppHook).override {
includeSettings = false;
};
in
rustPlatform.buildRustPackage.override
{ stdenv = if withMoldLinker then stdenvAdapters.useMoldLinker stdenv else stdenv; }
(finalAttrs: {
pname = "cosmic-settings";
version = "1.0.0-alpha.6";
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cosmic-settings";
version = "1.0.0-alpha.6";
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-settings";
tag = "epoch-${finalAttrs.version}";
hash = "sha256-UKg3TIpyaqtynk6wLFFPpv69F74hmqfMVPra2+iFbvE=";
};
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-settings";
tag = "epoch-${finalAttrs.version}";
hash = "sha256-UKg3TIpyaqtynk6wLFFPpv69F74hmqfMVPra2+iFbvE=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-mf/Cw3/RLrCYgsk7JKCU2+oPn1VPbD+4JzkUmbd47m8=";
useFetchCargoVendor = true;
cargoHash = "sha256-mf/Cw3/RLrCYgsk7JKCU2+oPn1VPbD+4JzkUmbd47m8=";
nativeBuildInputs = [
cmake
just
libcosmicAppHook'
pkg-config
rustPlatform.bindgenHook
util-linux
nativeBuildInputs = [
cmake
just
libcosmicAppHook'
pkg-config
rustPlatform.bindgenHook
util-linux
];
buildInputs = [
expat
fontconfig
freetype
libinput
pipewire
pulseaudio
udev
];
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"bin-src"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-settings"
];
preFixup = ''
libcosmicAppWrapperArgs+=(
--prefix PATH : ${lib.makeBinPath [ cosmic-randr ]}
--set-default X11_BASE_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/base.xml
--set-default X11_BASE_EXTRA_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/extra.xml
)
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"unstable"
"--version-regex"
"epoch-(.*)"
];
};
buildInputs = [
expat
fontconfig
freetype
libinput
pipewire
pulseaudio
udev
meta = {
description = "Settings for the COSMIC Desktop Environment";
homepage = "https://github.com/pop-os/cosmic-settings";
license = lib.licenses.gpl3Only;
mainProgram = "cosmic-settings";
maintainers = with lib.maintainers; [
nyabinary
HeitorAugustoLN
];
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"bin-src"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-settings"
];
env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" =
lib.optionalString withMoldLinker "-C link-arg=-fuse-ld=mold";
preFixup = ''
libcosmicAppWrapperArgs+=(
--prefix PATH : ${lib.makeBinPath [ cosmic-randr ]}
--set-default X11_BASE_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/base.xml
--set-default X11_BASE_EXTRA_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/extra.xml
)
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"unstable"
"--version-regex"
"epoch-(.*)"
];
};
meta = {
description = "Settings for the COSMIC Desktop Environment";
homepage = "https://github.com/pop-os/cosmic-settings";
license = lib.licenses.gpl3Only;
mainProgram = "cosmic-settings";
maintainers = with lib.maintainers; [
nyabinary
HeitorAugustoLN
];
platforms = lib.platforms.linux;
};
})
platforms = lib.platforms.linux;
};
})