cosmic-player: refactor

This commit is contained in:
Heitor Augusto
2025-02-26 16:38:10 -03:00
parent 962f4cd575
commit f622612445
+9 -42
View File
@@ -1,22 +1,17 @@
{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
libcosmicAppHook,
just,
pkg-config,
alsa-lib,
ffmpeg,
glib,
gst_all_1,
just,
pkg-config,
libxkbcommon,
stdenv,
cosmic-icons,
libglvnd,
libgbm,
wayland,
xorg,
vulkan-loader,
makeBinaryWrapper,
}:
rustPlatform.buildRustPackage rec {
@@ -25,8 +20,8 @@ rustPlatform.buildRustPackage rec {
src = fetchFromGitHub {
owner = "pop-os";
repo = pname;
rev = "epoch-${version}";
repo = "cosmic-player";
tag = "epoch-${version}";
hash = "sha256-Ebjj+C+yLCRomZy2W8mYDig1pv7aQcD3A9V2M53RM5U=";
};
@@ -40,7 +35,8 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [
just
pkg-config
makeBinaryWrapper
libcosmicAppHook
rustPlatform.bindgenHook
];
# Largely based on lilyinstarlight's work linked below
@@ -54,15 +50,12 @@ rustPlatform.buildRustPackage rec {
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
libxkbcommon
libgbm
wayland
vulkan-loader
xorg.libX11
libglvnd
];
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
@@ -73,32 +66,6 @@ rustPlatform.buildRustPackage rec {
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-player"
];
# 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"
];
# LD_LIBRARY_PATH can be removed once tiny-xlib is bumped above 0.2.2
postInstall = ''
wrapProgram "$out/bin/cosmic-player" \
--suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
xorg.libX11
xorg.libXcursor
xorg.libXi
vulkan-loader
libxkbcommon
wayland
]
}
'';
meta = {
homepage = "https://github.com/pop-os/cosmic-player";
description = "Media player for the COSMIC Desktop Environment";