113 lines
2.6 KiB
Nix
113 lines
2.6 KiB
Nix
{
|
|
rustPlatform,
|
|
pnpm_9,
|
|
cargo-tauri,
|
|
nodejs,
|
|
pkg-config,
|
|
webkitgtk_4_1,
|
|
wrapGAppsHook3,
|
|
fetchFromGitHub,
|
|
gtk3,
|
|
librsvg,
|
|
openssl,
|
|
autoPatchelfHook,
|
|
lib,
|
|
nix-update-script,
|
|
moreutils,
|
|
jq,
|
|
gst_all_1,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage (finalAttrs: {
|
|
pname = "readest";
|
|
version = "0.9.63";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "readest";
|
|
repo = "readest";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-xI3gKRbL4WtDDPT1lqjyVYquf7fVPWpPptv2/+1+J/A=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
postUnpack = ''
|
|
# pnpm.configHook has to write to ../.., as our sourceRoot is set to apps/readest-app
|
|
chmod -R +w .
|
|
'';
|
|
|
|
sourceRoot = "${finalAttrs.src.name}/apps/readest-app";
|
|
|
|
pnpmDeps = pnpm_9.fetchDeps {
|
|
inherit (finalAttrs) pname version src;
|
|
hash = "sha256-lez75n3dIM4efpP+qPuDteCfMnC6wPD+L2173iJbTZM=";
|
|
fetcherVersion = 1;
|
|
};
|
|
|
|
pnpmRoot = "../..";
|
|
|
|
useFetchCargoVendor = true;
|
|
|
|
cargoHash = "sha256-35REIeZy/D9UWzSI6yQZc1MRYwlAnjzsk5T7KOAhWVw=";
|
|
|
|
cargoRoot = "../..";
|
|
|
|
buildAndTestSubdir = "src-tauri";
|
|
|
|
postPatch = ''
|
|
substituteInPlace src-tauri/Cargo.toml \
|
|
--replace-fail '"devtools"' '"devtools", "rustls-tls"'
|
|
substituteInPlace src-tauri/tauri.conf.json \
|
|
--replace-fail '"createUpdaterArtifacts": true' '"createUpdaterArtifacts": false' \
|
|
--replace-fail '"Readest"' '"readest"'
|
|
jq 'del(.plugins."deep-link")' src-tauri/tauri.conf.json | sponge src-tauri/tauri.conf.json
|
|
substituteInPlace src/services/constants.ts \
|
|
--replace-fail "autoCheckUpdates: true" "autoCheckUpdates: false" \
|
|
--replace-fail "telemetryEnabled: true" "telemetryEnabled: false"
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
cargo-tauri.hook
|
|
nodejs
|
|
pnpm_9.configHook
|
|
pkg-config
|
|
wrapGAppsHook3
|
|
autoPatchelfHook
|
|
moreutils
|
|
jq
|
|
];
|
|
|
|
buildInputs = [
|
|
webkitgtk_4_1
|
|
gtk3
|
|
librsvg
|
|
openssl
|
|
# TTS
|
|
gst_all_1.gstreamer
|
|
gst_all_1.gst-plugins-base
|
|
gst_all_1.gst-plugins-good
|
|
gst_all_1.gst-plugins-bad
|
|
];
|
|
|
|
preBuild = ''
|
|
pnpm setup-pdfjs
|
|
'';
|
|
|
|
preFixup = ''
|
|
gappsWrapperArgs+=(
|
|
--set-default WEBKIT_DISABLE_DMABUF_RENDERER 1
|
|
)
|
|
'';
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "Modern, feature-rich ebook reader";
|
|
homepage = "https://github.com/readest/readest";
|
|
changelog = "https://github.com/readest/readest/releases/tag/v${finalAttrs.version}";
|
|
mainProgram = "readest";
|
|
license = lib.licenses.agpl3Plus;
|
|
maintainers = with lib.maintainers; [ eljamm ];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
})
|