From f590d97bcb6990d5fa111fa31c89c1ed6ffc61b3 Mon Sep 17 00:00:00 2001 From: Chuang Zhu Date: Sat, 27 May 2023 16:25:45 +0800 Subject: [PATCH] denaro: 2023.2.2 -> 2023.5.0; add updateScript --- pkgs/applications/finance/denaro/default.nix | 28 +++++++++++--------- pkgs/applications/finance/denaro/deps.nix | 15 +++++++---- pkgs/applications/finance/denaro/update.sh | 18 +++++++++++++ 3 files changed, 44 insertions(+), 17 deletions(-) create mode 100755 pkgs/applications/finance/denaro/update.sh diff --git a/pkgs/applications/finance/denaro/default.nix b/pkgs/applications/finance/denaro/default.nix index 84a76e21f2b5..ee36127106d9 100644 --- a/pkgs/applications/finance/denaro/default.nix +++ b/pkgs/applications/finance/denaro/default.nix @@ -2,7 +2,6 @@ , stdenvNoCC , buildDotnetModule , fetchFromGitHub -, fetchpatch , dotnetCorePackages , gtk4 , libadwaita @@ -10,20 +9,19 @@ , wrapGAppsHook4 , glib , shared-mime-info -, python3 -, desktop-file-utils , gdk-pixbuf +, blueprint-compiler }: buildDotnetModule rec { pname = "denaro"; - version = "2023.2.2"; + version = "2023.5.0"; src = fetchFromGitHub { - owner = "nlogozzo"; - repo = "NickvisionMoney"; + owner = "NickvisionApps"; + repo = "Denaro"; rev = version; - hash = "sha256-B84uzJ+B7kGU+O2tuObrIFCvgUfszLd1VU7F5tL90bU="; + hash = "sha256-kYN4Qm4xxOUkMi3twyVkT9PBnauDp7aenYy0YXzwKNA="; }; dotnet-sdk = dotnetCorePackages.sdk_7_0; @@ -42,15 +40,19 @@ buildDotnetModule rec { wrapGAppsHook4 glib # For glib-compile-resources shared-mime-info # For update-mime-database - python3 - desktop-file-utils gdk-pixbuf # Fixes icon missing in envs where GDK_PIXBUF_MODULE_FILE is not set + blueprint-compiler ]; + buildInputs = [ gtk4 libadwaita ]; # Used by blueprint-compiler + + # Denaro switches installation tool frequently (bash -> just -> cake) + # For maintainability, let's do it ourselves postInstall = '' - sh NickvisionMoney.GNOME/install_extras.sh $out - desktop-file-edit $out/share/applications/org.nickvision.money.desktop \ - --set-key=Exec --set-value=$out/bin/NickvisionMoney.GNOME + substituteInPlace NickvisionMoney.Shared/org.nickvision.money.desktop.in --replace '@EXEC@' "NickvisionMoney.GNOME" + install -Dm444 NickvisionMoney.Shared/Resources/org.nickvision.money.svg -t $out/share/icons/hicolor/scalable/apps/ + install -Dm444 NickvisionMoney.Shared/Resources/org.nickvision.money-symbolic.svg -t $out/share/icons/hicolor/symbolic/apps/ + install -Dm444 NickvisionMoney.Shared/org.nickvision.money.desktop.in -T $out/share/applications/org.nickvision.money.desktop ''; runtimeDeps = [ @@ -59,6 +61,8 @@ buildDotnetModule rec { glib # Fixes "Could not retrieve parent type - is the typeid valid?" ]; + passthru.updateScript = ./update.sh; + meta = with lib; { description = "Personal finance manager for GNOME"; homepage = "https://github.com/nlogozzo/NickvisionMoney"; diff --git a/pkgs/applications/finance/denaro/deps.nix b/pkgs/applications/finance/denaro/deps.nix index d6762f6bbe7a..8418edf10c57 100644 --- a/pkgs/applications/finance/denaro/deps.nix +++ b/pkgs/applications/finance/denaro/deps.nix @@ -2,6 +2,7 @@ # Please dont edit it manually, your changes might get overwritten! { fetchNuGet }: [ + (fetchNuGet { pname = "Cake.Tool"; version = "3.0.0"; sha256 = "0gjacqdgnh1d40sm9vrdb8vr6jv3vyh6j265gj1aaf9af2569637"; }) (fetchNuGet { pname = "Docnet.Core"; version = "2.3.1"; sha256 = "03b39x0vlymdknwgwhsmnpw4gj3njmbl9pd57ls3rhfn9r832d44"; }) (fetchNuGet { pname = "GirCore.Adw-1"; version = "0.3.0"; sha256 = "1bsjqxck58dff9hnw21cp3xk1afly8721sfsbnxcr5i39hlrbl37"; }) (fetchNuGet { pname = "GirCore.Cairo-1.0"; version = "0.3.0"; sha256 = "1zb8ilgywpwgjrzrbdvzvy70f46fb05iy49592mkjg2lv24q5l3y"; }) @@ -21,14 +22,15 @@ (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.macOS"; version = "2.8.2.3"; sha256 = "052d8frpkj4ijs6fm6xp55xbv95b1s9biqwa0w8zp3rgm88m9236"; }) (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.Win32"; version = "2.8.2.3"; sha256 = "08khd2jqm8sw58ljz5srangzfm2sz3gd2q1jzc5fr80lj8rv6r74"; }) (fetchNuGet { pname = "Hazzik.Qif"; version = "1.0.3"; sha256 = "16v6cfy3pa0qy699v843pss3418rvq5agz6n43sikzh69vzl2azy"; }) - (fetchNuGet { pname = "Microsoft.Data.Sqlite.Core"; version = "7.0.3"; sha256 = "00rdsirs32vlqpa1hri3f1m368b05d4r0k95wv5n2y0xi5i8lml6"; }) + (fetchNuGet { pname = "Microsoft.Data.Sqlite.Core"; version = "7.0.5"; sha256 = "11gkdlf2apnzvwfd7bxdhjvb4qd0p2ridp4rrz44f7h76x1sb0gk"; }) (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.1.0"; sha256 = "08vh1r12g6ykjygq5d3vq09zylgb84l63k49jc4v8faw9g93iqqm"; }) (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "5.0.0"; sha256 = "0mwpwdflidzgzfx2dlpkvvnkgkr2ayaf0s80737h4wa35gaj11rc"; }) (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "5.0.0"; sha256 = "0z3qyv7qal5irvabc8lmkh58zsl42mrzd1i0sssvzhv4q4kl3cg6"; }) (fetchNuGet { pname = "Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0j0c1wj4ndj21zsgivsc24whiya605603kxrbiw6wkfdync464wq"; }) (fetchNuGet { pname = "NETStandard.Library"; version = "1.6.1"; sha256 = "1z70wvsx2d847a2cjfii7b83pjfs34q05gb037fdjikv5kbagml8"; }) (fetchNuGet { pname = "OfxSharp.NetStandard"; version = "1.0.0"; sha256 = "1v7yw2glyywb4s0y5fw306bzh2vw175bswrhi5crvd92wf93makj"; }) - (fetchNuGet { pname = "QuestPDF"; version = "2022.12.1"; sha256 = "0nbbk43jr73f0pfgdx3fzn57mjba34sir5jzxk2rscyfljfw002x"; }) + (fetchNuGet { pname = "PdfSharpCore"; version = "1.3.56"; sha256 = "0a01b2a14gygh25rq3509rky85331l8808q052br2fzidhb2vc10"; }) + (fetchNuGet { pname = "QuestPDF"; version = "2023.5.1"; sha256 = "1yfjwb7aj975aars7mcp1dxvarxl8aq122bndpw808b4cx3058gl"; }) (fetchNuGet { pname = "ReadSharp.Ports.SgmlReader.Core"; version = "1.0.0"; sha256 = "0pcvlh0gq513vw6y12lfn90a0br56a6f26lvppcj4qb839zmh3id"; }) (fetchNuGet { pname = "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "16rnxzpk5dpbbl1x354yrlsbvwylrq456xzpsha1n9y3glnhyx9d"; }) (fetchNuGet { pname = "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0hkg03sgm2wyq8nqk6dbm9jh5vcq57ry42lkqdmfklrw89lsmr59"; }) @@ -46,16 +48,19 @@ (fetchNuGet { pname = "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "160p68l2c7cqmyqjwxydcvgw7lvl1cr0znkw8fp24d1by9mqc8p3"; }) (fetchNuGet { pname = "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "15zrc8fgd8zx28hdghcj5f5i34wf3l6bq5177075m2bc2j34jrqy"; }) (fetchNuGet { pname = "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1p4dgxax6p7rlgj4q73k73rslcnz4wdcv8q2flg1s8ygwcm58ld5"; }) + (fetchNuGet { pname = "SharpZipLib"; version = "1.3.3"; sha256 = "1gij11wfj1mqm10631cjpnhzw882bnzx699jzwhdqakxm1610q8x"; }) + (fetchNuGet { pname = "SixLabors.Fonts"; version = "1.0.0-beta17"; sha256 = "1qm8q82wzj54nbv63kx3ybln51k47sl18hia3jnzk1zrb6wdsw9a"; }) (fetchNuGet { pname = "SixLabors.ImageSharp"; version = "2.1.3"; sha256 = "12qb0r7v2v91vw8q8ygr67y527gwhbas6d6zdvrv4ksxwjx9dzp9"; }) (fetchNuGet { pname = "SkiaSharp"; version = "2.88.3"; sha256 = "1yq694myq2rhfp2hwwpyzcg1pzpxcp7j72wib8p9pw9dfj7008sv"; }) (fetchNuGet { pname = "SkiaSharp.HarfBuzz"; version = "2.88.3"; sha256 = "0axz2zfyg0h3zis7rr86ikrm2jbxxy0gqb3bbawpgynf1k0fsi6a"; }) (fetchNuGet { pname = "SkiaSharp.NativeAssets.Linux"; version = "2.88.3"; sha256 = "0dajvr60nwvnv7s6kcqgw1w97zxdpz1c5lb7kcq7r0hi0l05ck3q"; }) (fetchNuGet { pname = "SkiaSharp.NativeAssets.macOS"; version = "2.88.3"; sha256 = "191ajgi6fnfqcvqvkayjsxasiz6l0bv3pps8vv9abbyc4b12qvph"; }) (fetchNuGet { pname = "SkiaSharp.NativeAssets.Win32"; version = "2.88.3"; sha256 = "03wwfbarsxjnk70qhqyd1dw65098dncqk2m0vksx92j70i7lry6q"; }) - (fetchNuGet { pname = "SQLitePCLRaw.bundle_e_sqlcipher"; version = "2.1.4"; sha256 = "1v9wly6v2bj244wch6ijfx2imrbgmafn1w9km44718fngdxfhysq"; }) + (fetchNuGet { pname = "SQLitePCLRaw.bundle_e_sqlcipher"; version = "2.1.5"; sha256 = "0xnzpkhm9z09yay76wxgn4j8js260pansx8r10lrksxv2b4b0n4x"; }) (fetchNuGet { pname = "SQLitePCLRaw.core"; version = "2.1.4"; sha256 = "09akxz92qipr1cj8mk2hw99i0b81wwbwx26gpk21471zh543f8ld"; }) - (fetchNuGet { pname = "SQLitePCLRaw.lib.e_sqlcipher"; version = "2.1.4"; sha256 = "14qr84h88jfvy263yx51zjm059aqgwlvgi6g02yxhbr2m7brs4mm"; }) - (fetchNuGet { pname = "SQLitePCLRaw.provider.e_sqlcipher"; version = "2.1.4"; sha256 = "1s1dv1qfgjsvcdbwf2pl48c6k60hkxwyy6z5w8g32fypksnvb7cs"; }) + (fetchNuGet { pname = "SQLitePCLRaw.core"; version = "2.1.5"; sha256 = "03181hahmxv8jlaikx0nkzfc2q1l1cdp3chgx5q6780nhqyjkhhx"; }) + (fetchNuGet { pname = "SQLitePCLRaw.lib.e_sqlcipher"; version = "2.1.5"; sha256 = "1chij7jlpi2mdm55chrkn8bmlda5qb3q6idkljgc3rz26n6c2l5b"; }) + (fetchNuGet { pname = "SQLitePCLRaw.provider.e_sqlcipher"; version = "2.1.5"; sha256 = "11xah1nfzryh52zfwhlvfm2ra7d3an5ygff2brylp75wa685gm7g"; }) (fetchNuGet { pname = "System.AppContext"; version = "4.3.0"; sha256 = "1649qvy3dar900z3g817h17nl8jp4ka5vcfmsr05kh0fshn7j3ya"; }) (fetchNuGet { pname = "System.Buffers"; version = "4.3.0"; sha256 = "0fgns20ispwrfqll4q1zc1waqcmylb3zc50ys9x8zlwxh9pmd9jy"; }) (fetchNuGet { pname = "System.Collections"; version = "4.3.0"; sha256 = "19r4y64dqyrq6k4706dnyhhw7fs24kpp3awak7whzss39dakpxk9"; }) diff --git a/pkgs/applications/finance/denaro/update.sh b/pkgs/applications/finance/denaro/update.sh new file mode 100755 index 000000000000..545cbf1e827a --- /dev/null +++ b/pkgs/applications/finance/denaro/update.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env nix-shell +#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts +#shellcheck shell=bash + +set -eu -o pipefail + +version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ + https://api.github.com/repos/NickvisionApps/Denaro/releases/latest | jq -e -r .tag_name) +old_version=$(nix-instantiate --eval -A denaro.version | jq -e -r) + +if [[ $version == "$old_version" ]]; then + echo "New version same as old version, nothing to do." >&2 + exit 0 +fi + +update-source-version denaro "$version" + +$(nix-build -A denaro.fetch-deps --no-out-link) "$(dirname -- "${BASH_SOURCE[0]}")/deps.nix"