Skip to content

Commit b488f5c

Browse files
cosmic-settings: 1.0.0-alpha.1 -> 1.0.0-alpha.6 (#386420)
2 parents 7bff569 + b00b9d8 commit b488f5c

File tree

1 file changed

+85
-59
lines changed

1 file changed

+85
-59
lines changed
Lines changed: 85 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,108 @@
11
{
22
lib,
33
stdenv,
4+
stdenvAdapters,
45
fetchFromGitHub,
56
rustPlatform,
67
cmake,
7-
makeBinaryWrapper,
8-
cosmic-icons,
9-
cosmic-randr,
108
just,
9+
libcosmicAppHook,
1110
pkg-config,
12-
libxkbcommon,
11+
expat,
1312
libinput,
1413
fontconfig,
1514
freetype,
16-
wayland,
17-
expat,
15+
pipewire,
16+
pulseaudio,
1817
udev,
1918
util-linux,
19+
cosmic-randr,
20+
xkeyboard_config,
21+
nix-update-script,
22+
23+
withMoldLinker ? stdenv.targetPlatform.isLinux,
2024
}:
25+
let
26+
libcosmicAppHook' = (libcosmicAppHook.__spliced.buildHost or libcosmicAppHook).override {
27+
includeSettings = false;
28+
};
29+
in
30+
rustPlatform.buildRustPackage.override
31+
{ stdenv = if withMoldLinker then stdenvAdapters.useMoldLinker stdenv else stdenv; }
32+
(finalAttrs: {
33+
pname = "cosmic-settings";
34+
version = "1.0.0-alpha.6";
2135

22-
rustPlatform.buildRustPackage rec {
23-
pname = "cosmic-settings";
24-
version = "1.0.0-alpha.1";
36+
src = fetchFromGitHub {
37+
owner = "pop-os";
38+
repo = "cosmic-settings";
39+
tag = "epoch-${finalAttrs.version}";
40+
hash = "sha256-UKg3TIpyaqtynk6wLFFPpv69F74hmqfMVPra2+iFbvE=";
41+
};
2542

26-
src = fetchFromGitHub {
27-
owner = "pop-os";
28-
repo = "cosmic-settings";
29-
rev = "epoch-${version}";
30-
hash = "sha256-gTzZvhj7oBuL23dtedqfxUCT413eMoDc0rlNeqCeZ6E=";
31-
};
43+
useFetchCargoVendor = true;
44+
cargoHash = "sha256-mf/Cw3/RLrCYgsk7JKCU2+oPn1VPbD+4JzkUmbd47m8=";
3245

33-
useFetchCargoVendor = true;
34-
cargoHash = "sha256-zMHJc6ytbOoi9E47Zsg6zhbQKObsaOtVHuPnLAu36I4=";
46+
nativeBuildInputs = [
47+
cmake
48+
just
49+
libcosmicAppHook'
50+
pkg-config
51+
rustPlatform.bindgenHook
52+
util-linux
53+
];
3554

36-
postPatch = ''
37-
substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
38-
'';
55+
buildInputs = [
56+
expat
57+
fontconfig
58+
freetype
59+
libinput
60+
pipewire
61+
pulseaudio
62+
udev
63+
];
3964

40-
nativeBuildInputs = [
41-
cmake
42-
just
43-
pkg-config
44-
makeBinaryWrapper
45-
];
46-
buildInputs = [
47-
libxkbcommon
48-
libinput
49-
fontconfig
50-
freetype
51-
wayland
52-
expat
53-
udev
54-
util-linux
55-
];
65+
dontUseJustBuild = true;
66+
dontUseJustCheck = true;
5667

57-
dontUseJustBuild = true;
68+
justFlags = [
69+
"--set"
70+
"prefix"
71+
(placeholder "out")
72+
"--set"
73+
"bin-src"
74+
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-settings"
75+
];
5876

59-
justFlags = [
60-
"--set"
61-
"prefix"
62-
(placeholder "out")
63-
"--set"
64-
"bin-src"
65-
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-settings"
66-
];
77+
env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" =
78+
lib.optionalString withMoldLinker "-C link-arg=-fuse-ld=mold";
6779

68-
postInstall = ''
69-
wrapProgram "$out/bin/cosmic-settings" \
70-
--prefix PATH : ${lib.makeBinPath [ cosmic-randr ]} \
71-
--suffix XDG_DATA_DIRS : "$out/share:${cosmic-icons}/share"
72-
'';
80+
preFixup = ''
81+
libcosmicAppWrapperArgs+=(
82+
--prefix PATH : ${lib.makeBinPath [ cosmic-randr ]}
83+
--set-default X11_BASE_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/base.xml
84+
--set-default X11_BASE_EXTRA_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/extra.xml
85+
)
86+
'';
7387

74-
meta = with lib; {
75-
homepage = "https://github.com/pop-os/cosmic-settings";
76-
description = "Settings for the COSMIC Desktop Environment";
77-
license = licenses.gpl3Only;
78-
maintainers = with maintainers; [ nyabinary ];
79-
platforms = platforms.linux;
80-
mainProgram = "cosmic-settings";
81-
};
82-
}
88+
passthru.updateScript = nix-update-script {
89+
extraArgs = [
90+
"--version"
91+
"unstable"
92+
"--version-regex"
93+
"epoch-(.*)"
94+
];
95+
};
96+
97+
meta = {
98+
description = "Settings for the COSMIC Desktop Environment";
99+
homepage = "https://github.com/pop-os/cosmic-settings";
100+
license = lib.licenses.gpl3Only;
101+
mainProgram = "cosmic-settings";
102+
maintainers = with lib.maintainers; [
103+
nyabinary
104+
HeitorAugustoLN
105+
];
106+
platforms = lib.platforms.linux;
107+
};
108+
})

0 commit comments

Comments
 (0)