Skip to content

Commit

Permalink
readest: init at 0.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
aucub committed Jan 15, 2025
1 parent b644cbe commit 0cbadf5
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions pkgs/by-name/re/readest/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
rustPlatform,
pnpm_9,
cargo-tauri,
nodejs,
pkg-config,
webkitgtk_4_1,
wrapGAppsHook3,
fetchFromGitHub,
gtk3,
librsvg,
libappindicator,
openssl,
autoPatchelfHook,
makeWrapper,
lib,
desktop-file-utils,
nix-update-script,
}:

rustPlatform.buildRustPackage rec {
pname = "readest";
version = "0.9.5";

src = fetchFromGitHub {
owner = "readest";
repo = "readest";
tag = "v${version}";
hash = "sha256-JtxW3ngP+oHCE6E55+wUL3ptcJ86UEqj2LFXhDQW6/k=";
fetchSubmodules = true;
};

sourceRoot = "${src.name}/apps/readest-app";

pnpmDeps = pnpm_9.fetchDeps {
inherit pname version src;
hash = "sha256-YmuqMqO9AisSHv7iJK/ElQig/fF/+ngrqSzlvtnX2xc=";
};

pnpmRoot = "..";

cargoHash = "sha256-2Fx31kVJfQrOeGVtkL1ARCo+REbRKO1JBIZEZO93Lis=";

cargoRoot = "src-tauri";

buildAndTestSubdir = cargoRoot;

postPatch = ''
substituteInPlace $cargoRoot/Cargo.toml \
--replace-fail '"devtools"' '"devtools", "rustls-tls"'
substituteInPlace $cargoRoot/tauri.conf.json \
--replace-fail '"createUpdaterArtifacts": true' '"createUpdaterArtifacts": false'
'';

preConfigure = ''
chmod -R +w ../..
'';

nativeBuildInputs = [
cargo-tauri.hook
nodejs
pnpm_9.configHook
pkg-config
wrapGAppsHook3
autoPatchelfHook
makeWrapper
];

buildInputs = [
webkitgtk_4_1
gtk3
librsvg
libappindicator
openssl
];

preBuild = ''
pnpm setup-pdfjs
'';

dontWrapGApps = true;

postFixup = ''
wrapProgram $out/bin/readest \
''${gappsWrapperArgs[@]} \
--prefix PATH : ${lib.makeBinPath [ desktop-file-utils ]}
'';

passthru.updateScript = nix-update-script { };

meta = {
description = "Modern, feature-rich ebook reader";
homepage = "https://github.com/readest/readest";
mainProgram = "readest";
license = with lib.licenses; [ agpl3Plus ];
maintainers = with lib.maintainers; [ aucub ];
platforms = lib.platforms.linux;
};
}

0 comments on commit 0cbadf5

Please sign in to comment.