{ 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-2026-06-06"; src = fetchFromGitHub { owner = "pop-os"; repo = "cosmic-reader"; rev = "31485419db10e12c2942029d673836343e4609dd"; hash = "sha256-XZ5A7Qi+sxlUel1Fpr9wy8o0MD9mtyqFIwBN4Rf7CcU="; }; cargoHash = "sha256-DPGpGWzAgdpHp3qzksLtLnfqk+DJsaukdT2ekFFiGaM="; separateDebugInfo = true; __structuredAttrs = true; env.VERGEN_GIT_SHA = finalAttrs.src.rev; 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}" ]; 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 ]; }; })