cosmic-player: init at unstable-2025-01-14 (#373897)

authored by Tristan Ross and committed by GitHub fcbaac0f 0c0db621

+110
+110
pkgs/by-name/co/cosmic-player/package.nix
··· 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + rustPlatform, 5 + alsa-lib, 6 + ffmpeg, 7 + glib, 8 + gst_all_1, 9 + just, 10 + pkg-config, 11 + libxkbcommon, 12 + stdenv, 13 + cosmic-icons, 14 + libglvnd, 15 + libgbm, 16 + wayland, 17 + xorg, 18 + vulkan-loader, 19 + makeBinaryWrapper, 20 + }: 21 + 22 + rustPlatform.buildRustPackage rec { 23 + pname = "cosmic-player"; 24 + version = "1.0.0-alpha.5.1"; 25 + 26 + src = fetchFromGitHub { 27 + owner = "pop-os"; 28 + repo = pname; 29 + rev = "epoch-${version}"; 30 + hash = "sha256-IgMFKtuMAfRtbxunwrwRzFi/0PcSMWhx33uJcxiAHhI="; 31 + }; 32 + 33 + useFetchCargoVendor = true; 34 + cargoHash = "sha256-VSUv4yV54fzWPhxZV/EjBrkx7tTLo6vfSHNiluWnn9A="; 35 + 36 + postPatch = '' 37 + substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)" 38 + ''; 39 + 40 + nativeBuildInputs = [ 41 + just 42 + pkg-config 43 + makeBinaryWrapper 44 + ]; 45 + 46 + # Largely based on lilyinstarlight's work linked below 47 + # https://github.com/lilyinstarlight/nixos-cosmic/blob/main/pkgs/cosmic-player/package.nix 48 + 49 + buildInputs = [ 50 + alsa-lib 51 + ffmpeg 52 + glib 53 + gst_all_1.gstreamer 54 + gst_all_1.gst-plugins-base 55 + gst_all_1.gst-plugins-good 56 + gst_all_1.gst-plugins-bad 57 + libxkbcommon 58 + libgbm 59 + wayland 60 + vulkan-loader 61 + xorg.libX11 62 + libglvnd 63 + ]; 64 + 65 + dontUseJustBuild = true; 66 + 67 + justFlags = [ 68 + "--set" 69 + "prefix" 70 + (placeholder "out") 71 + "--set" 72 + "bin-src" 73 + "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-player" 74 + ]; 75 + 76 + # Force linking to libEGL, which is always dlopen()ed, and to 77 + # libwayland-client, which is always dlopen()ed except by the 78 + # obscure winit backend. 79 + RUSTFLAGS = map (a: "-C link-arg=${a}") [ 80 + "-Wl,--push-state,--no-as-needed" 81 + "-lEGL" 82 + "-lwayland-client" 83 + "-Wl,--pop-state" 84 + ]; 85 + 86 + # LD_LIBRARY_PATH can be removed once tiny-xlib is bumped above 0.2.2 87 + postInstall = '' 88 + wrapProgram "$out/bin/cosmic-player" \ 89 + --suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \ 90 + --prefix LD_LIBRARY_PATH : ${ 91 + lib.makeLibraryPath [ 92 + xorg.libX11 93 + xorg.libXcursor 94 + xorg.libXi 95 + vulkan-loader 96 + libxkbcommon 97 + wayland 98 + ] 99 + } 100 + ''; 101 + 102 + meta = { 103 + homepage = "https://github.com/pop-os/cosmic-player"; 104 + description = "Media player for the COSMIC Desktop Environment"; 105 + license = lib.licenses.gpl3Only; 106 + maintainers = with lib.maintainers; [ ahoneybun ]; 107 + platforms = lib.platforms.linux; 108 + mainProgram = "cosmic-player"; 109 + }; 110 + }