2023-11-13 17:23:58 +01:00
|
|
|
{ lib
|
2024-01-20 21:50:23 +01:00
|
|
|
, stdenv
|
2023-11-13 17:23:58 +01:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, pkg-config
|
|
|
|
, libinput
|
|
|
|
, libglvnd
|
|
|
|
, libxkbcommon
|
|
|
|
, mesa
|
|
|
|
, seatd
|
|
|
|
, udev
|
|
|
|
, xwayland
|
|
|
|
, wayland
|
|
|
|
, xorg
|
2024-01-22 16:28:32 +01:00
|
|
|
, useXWayland ? true
|
2024-01-20 21:50:23 +01:00
|
|
|
, systemd
|
|
|
|
, useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
|
2023-08-21 19:07:25 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
pname = "cosmic-comp";
|
2023-11-13 17:23:58 +01:00
|
|
|
version = "unstable-2023-11-13";
|
2023-08-21 19:07:25 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pop-os";
|
|
|
|
repo = "cosmic-comp";
|
2023-11-13 17:23:58 +01:00
|
|
|
rev = "d051d141979820f50b75bd686c745fb7f84fcd05";
|
|
|
|
hash = "sha256-8okRiVVPzmuPJjnv1YoQPQFI8g0j1DQhwUoO51dHgGA=";
|
2023-08-21 19:07:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-11-13 17:23:58 +01:00
|
|
|
"cosmic-config-0.1.0" = "sha256-5WajbfcfCc0ZRpJfysqEydthOsF04ipb35QVWuWKrEs=";
|
|
|
|
"cosmic-protocols-0.1.0" = "sha256-st46wmOncJvu0kj6qaot6LT/ojmW/BwXbbGf8s0mdZ8=";
|
2023-08-21 19:07:25 +02:00
|
|
|
"id_tree-1.8.0" = "sha256-uKdKHRfPGt3vagOjhnri3aYY5ar7O3rp2/ivTfM2jT0=";
|
2023-11-13 17:23:58 +01:00
|
|
|
"smithay-0.3.0" = "sha256-e6BSrsrVSBcOuF8m21m74h7DWZnYHGIYs/4D4ABvqNM=";
|
2023-08-21 19:07:25 +02:00
|
|
|
"smithay-egui-0.1.0" = "sha256-FcSoKCwYk3okwQURiQlDUcfk9m/Ne6pSblGAzHDaVHg=";
|
|
|
|
"softbuffer-0.2.0" = "sha256-VD2GmxC58z7Qfu/L+sfENE+T8L40mvUKKSfgLmCTmjY=";
|
2023-11-13 17:23:58 +01:00
|
|
|
"taffy-0.3.11" = "sha256-0hXOEj6IjSW8e1t+rvxBFX6V9XRum3QO2Des1XlHJEw=";
|
2023-08-21 19:07:25 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
separateDebugInfo = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeBinaryWrapper pkg-config ];
|
2024-01-20 21:50:23 +01:00
|
|
|
buildInputs = [
|
|
|
|
libglvnd
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
|
|
|
seatd
|
|
|
|
udev
|
|
|
|
wayland
|
|
|
|
] ++ lib.optional useSystemd systemd;
|
|
|
|
|
|
|
|
# Only default feature is systemd
|
|
|
|
buildNoDefaultFeatures = !useSystemd;
|
2023-08-21 19:07:25 +02:00
|
|
|
|
|
|
|
# Force linking to libEGL, which is always dlopen()ed, and to
|
|
|
|
# libwayland-client, which is always dlopen()ed except by the
|
|
|
|
# obscure winit backend.
|
|
|
|
RUSTFLAGS = map (a: "-C link-arg=${a}") [
|
|
|
|
"-Wl,--push-state,--no-as-needed"
|
|
|
|
"-lEGL"
|
|
|
|
"-lwayland-client"
|
|
|
|
"-Wl,--pop-state"
|
|
|
|
];
|
|
|
|
|
|
|
|
# These libraries are only used by the X11 backend, which will not
|
|
|
|
# be the common case, so just make them available, don't link them.
|
|
|
|
postInstall = ''
|
2024-01-22 16:28:32 +01:00
|
|
|
wrapProgramArgs=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
|
2023-08-21 19:07:25 +02:00
|
|
|
xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr
|
2024-01-22 16:28:32 +01:00
|
|
|
]})
|
|
|
|
'' + lib.optionalString useXWayland ''
|
|
|
|
wrapProgramArgs+=(--prefix PATH : ${lib.makeBinPath [ xwayland ]})
|
|
|
|
'' + ''
|
|
|
|
wrapProgram $out/bin/cosmic-comp "''${wrapProgramArgs[@]}"
|
2023-08-21 19:07:25 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/pop-os/cosmic-comp";
|
|
|
|
description = "Compositor for the COSMIC Desktop Environment";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "cosmic-comp";
|
2023-08-21 19:07:25 +02:00
|
|
|
license = licenses.gpl3Only;
|
2023-11-13 17:23:58 +01:00
|
|
|
maintainers = with maintainers; [ qyliss nyanbinary ];
|
2023-08-21 19:07:25 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|