nixpkgs/pkgs/by-name/co/cosmic-store/package.nix
Aaron Honeycutt a797d90427
cosmic-store: 1.0.0-alpha.2 -> 1.0.0-alpha.4 (#353840)
Co-authored-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
2025-01-08 11:06:16 +05:30

117 lines
2.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
nix-update-script,
rustPlatform,
appstream,
makeBinaryWrapper,
cosmic-icons,
glib,
just,
pkg-config,
libglvnd,
libxkbcommon,
libinput,
fontconfig,
flatpak,
freetype,
openssl,
wayland,
xorg,
vulkan-loader,
vulkan-validation-layers,
}:
rustPlatform.buildRustPackage rec {
pname = "cosmic-store";
version = "1.0.0-alpha.4";
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-store";
rev = "epoch-${version}";
hash = "sha256-VaOKF3cCnNbfUfJeuhx0wXRvprAnSspTe8gIiR/t2Ng=";
fetchSubmodules = true;
};
useFetchCargoVendor = true;
cargoHash = "sha256-Zt2199zlxNbrN/S6bogp4JPM3ZMZpQL5jTXKMki6LQE=";
postPatch = ''
substituteInPlace justfile --replace '#!/usr/bin/env' "#!$(command -v env)"
'';
nativeBuildInputs = [
just
pkg-config
makeBinaryWrapper
];
buildInputs = [
appstream
glib
libxkbcommon
libinput
libglvnd
fontconfig
flatpak
freetype
openssl
xorg.libX11
wayland
vulkan-loader
vulkan-validation-layers
];
dontUseJustBuild = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"bin-src"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-store"
];
# 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-store" \
--suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
libxkbcommon
vulkan-loader
]
}
'';
passthru = {
updateScript = nix-update-script { };
};
meta = with lib; {
homepage = "https://github.com/pop-os/cosmic-store";
description = "App Store for the COSMIC Desktop Environment";
license = licenses.gpl3Only;
maintainers = with maintainers; [
ahoneybun
nyabinary
];
platforms = platforms.linux;
};
}