nixpkgs/pkgs/by-name/co/cosmic-store/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

113 lines
2.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
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.2";
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-store";
rev = "epoch-${version}";
hash = "sha256-mq94ZMVOdXAPR52ID5x8nppJ9mNoTOPBfn7Eouj3T1U=";
fetchSubmodules = true;
};
useFetchCargoVendor = true;
cargoHash = "sha256-lhMMzT6igjEEvwpcc7d8JyyHU0DcWVIh3z9KR6eCv7c=";
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
]
}
'';
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;
};
}