mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 21:40:12 +00:00
91 lines
1.8 KiB
Nix
91 lines
1.8 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-2026-09-15";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "pop-os";
|
|
repo = "cosmic-reader";
|
|
rev = "9a34cc93c817f07be9b3540faa5d146c2a891e64";
|
|
hash = "sha256-Jo4vXuWPb5ex/YEl+8jLzX8oMIjDSRt22aPBBXcp7YA=";
|
|
};
|
|
|
|
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}"
|
|
];
|
|
|
|
postInstall = ''
|
|
substituteInPlace $out/share/thumbnailers/com.system76.CosmicReader.thumbnailer \
|
|
--replace-fail "TryExec=cosmic-reader" "TryExec=$out/bin/cosmic-reader" \
|
|
--replace-fail "Exec=cosmic-reader" "Exec=$out/bin/cosmic-reader"
|
|
'';
|
|
|
|
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 ];
|
|
};
|
|
})
|