nixpkgs/pkgs/by-name/co/cosmic-reader/package.nix

81 lines
1.5 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
just,
libcosmicAppHook,
fontconfig,
freetype,
gumbo,
harfbuzz,
jbig2dec,
lcms2,
leptonica,
libjpeg,
openjpeg,
tesseract,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cosmic-reader";
version = "0-unstable-2025-09-21";
src = fetchFromGitHub {
owner = "pop-os";
repo = "cosmic-reader";
rev = "a5b1b5c0583deacafde19de4ee936cdd126b25df";
hash = "sha256-yXY1t67ws2PvK7IubNHT0jp+xnfDAdyK5H7LCMGcMQI=";
};
cargoHash = "sha256-4ofAtZN3FpYwNahinldALbdEJA5lDwa+CUsVIISnSTc=";
nativeBuildInputs = [
just
libcosmicAppHook
rustPlatform.bindgenHook
];
buildInputs = [
fontconfig
freetype
gumbo
harfbuzz
jbig2dec
lcms2
leptonica
libjpeg
openjpeg
tesseract
];
dontUseJustBuild = true;
dontUseJustCheck = true;
justFlags = [
"--set"
"prefix"
(placeholder "out")
"--set"
"cargo-target-dir"
"target/${stdenv.hostPlatform.rust.cargoShortTarget}"
];
env.VERGEN_GIT_SHA = finalAttrs.src.rev;
passthru.updateScript = nix-update-script {
extraArgs = [
"--version"
"branch=HEAD"
];
};
meta = {
description = "PDF reader for the COSMIC Desktop Environment";
homepage = "https://github.com/pop-os/cosmic-reader";
license = lib.licenses.gpl3Only;
mainProgram = "cosmic-reader";
platforms = lib.platforms.linux;
teams = [ lib.teams.cosmic ];
};
})