Unverified Commit 801b31bb authored by Heitor Augusto's avatar Heitor Augusto
Browse files

cosmic-randr: use mold linker

parent a91e87b1
Loading
Loading
Loading
Loading
+54 −46
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  stdenvAdapters,
  fetchFromGitHub,
  rustPlatform,
  just,
  pkg-config,
  wayland,
  nix-update-script,

  withMoldLinker ? stdenv.targetPlatform.isLinux,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage.override
  { stdenv = if withMoldLinker then stdenvAdapters.useMoldLinker stdenv else stdenv; }
  rec {
    pname = "cosmic-randr";
    version = "1.0.0-alpha.6";

@@ -42,6 +47,9 @@ rustPlatform.buildRustPackage rec {
      "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-randr"
    ];

    env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" =
      lib.optionalString withMoldLinker "-C link-arg=-fuse-ld=mold";

    passthru.updateScript = nix-update-script {
      extraArgs = [
        "--version"