treedome: 0.5.1 -> 0.5.4 (#360651)

This commit is contained in:
Arne Keller
2025-01-21 17:13:18 +01:00
committed by GitHub
2 changed files with 26 additions and 5216 deletions
-5133
View File
File diff suppressed because it is too large Load Diff
+26 -83
View File
@@ -1,127 +1,70 @@
{
lib,
cargo-tauri_1,
cmake,
cargo-tauri,
dbus,
fetchgit,
fetchYarnDeps,
freetype,
gsettings-desktop-schemas,
gtk3,
libsoup_2_4,
stdenv,
yarnConfigHook,
yarnBuildHook,
nodejs,
openssl,
pkg-config,
rustPlatform,
webkitgtk_4_0,
wrapGAppsHook3,
webkitgtk_4_1,
libayatana-appindicator,
wrapGAppsHook4,
sqlite,
}:
let
rustPlatform.buildRustPackage rec {
pname = "treedome";
version = "0.5.1";
version = "0.5.4";
src = fetchgit {
url = "https://codeberg.org/solver-orgz/treedome";
rev = version;
hash = "sha256-EYSB9BJhk0yIwT1h8cIo6fpDI10av6yCtOR4FuAY5dM=";
hash = "sha256-fJnrM9I11JKqzrprXa51mJiz9oO5hDp6u69FqJs5l8o=";
fetchLFS = true;
};
frontend-build = stdenv.mkDerivation (finalAttrs: {
pname = "treedome-ui";
inherit version src;
useFetchCargoVendor = true;
cargoHash = "sha256-scCF4xpc1COdlg57/eNTPdgY7/cJkdcc2s1YNraXzXk=";
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-H9Y/heYEPU5LvIZAgVn0FhiNQ0QKAQEDQ1/oFogi9vc=";
};
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
nodejs
];
installPhase = ''
runHook preInstall
mkdir -p $out/dist
cp -r dist/** $out/dist
runHook postInstall
'';
});
in
rustPlatform.buildRustPackage {
inherit version pname src;
sourceRoot = "${src.name}/src-tauri";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"fix-path-env-0.0.0" = "sha256-ewE3CwqLC8dvi94UrQsWbp0mjmrzEJIGPDYtdmQ/sGs=";
};
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-in1A1XcfZK5F/EV5CYgfqig+8vKsxd6XhzfSv7Z0nNQ=";
};
env = {
VERGEN_GIT_DESCRIBE = version;
};
preConfigure = ''
mkdir -p dist
cp -R ${frontend-build}/dist/** dist
'';
# copy the frontend static resources to final build directory
# Also modify tauri.conf.json so that it expects the resources at the new location
postPatch = ''
substituteInPlace ./tauri.conf.json \
--replace '"distDir": "../dist",' '"distDir": "dist",' \
--replace '"beforeBuildCommand": "yarn run build",' '"beforeBuildCommand": "",'
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
'';
nativeBuildInputs = [
cmake
cargo-tauri.hook
nodejs
pkg-config
cargo-tauri_1
wrapGAppsHook3
wrapGAppsHook4
yarnConfigHook
];
buildInputs = [
dbus
openssl
freetype
libsoup_2_4
gtk3
webkitgtk_4_0
webkitgtk_4_1
libayatana-appindicator
gsettings-desktop-schemas
sqlite
];
buildPhase = ''
runHook preBuild
cargoRoot = "src-tauri";
buildAndTestSubdir = cargoRoot;
cargo tauri build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin/
mkdir -p $out/share/
cp target/release/bundle/deb/treedome_0.0.0_amd64/data/usr/bin/treedome $out/bin/treedome
cp -R target/release/bundle/deb/treedome_0.0.0_amd64/data/usr/share/** $out/share/
runHook postInstall
'';
env = {
VERGEN_GIT_DESCRIBE = version;
};
# WEBKIT_DISABLE_COMPOSITING_MODE essential in NVIDIA + compositor https://github.com/NixOS/nixpkgs/issues/212064#issuecomment-1400202079
postFixup = ''
@@ -132,7 +75,7 @@ rustPlatform.buildRustPackage {
meta = with lib; {
description = "Local-first, encrypted, note taking application organized in tree-like structures";
homepage = " https://codeberg.org/solver-orgz/treedome";
license = licenses.agpl3Only;
license = licenses.agpl3Plus;
platforms = [ "x86_64-linux" ];
mainProgram = "treedome";
maintainers = with maintainers; [ tengkuizdihar ];