-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
aucub
committed
Jan 15, 2025
1 parent
b644cbe
commit 0c27c1b
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.3"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "readest"; | ||
repo = "readest"; | ||
tag = "v${version}"; | ||
hash = "sha256-ksqYTPgjw+J5mum9q9vJP4RpNK+LE3tIHMiaWtWrPF8="; | ||
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-pOSlbLT0UnSIdJ8ioJBxKQFr8QRf2+KL7iBYrYWzh/Y="; | ||
|
||
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; | ||
}; | ||
} |