From 5b765c4658c2dd480776d4a942024b5eb7a82d0b Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 5 Nov 2024 19:22:34 +0800 Subject: [PATCH 1/6] cargo-gra: init at 0.6.0 --- pkgs/by-name/ca/cargo-gra/package.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 pkgs/by-name/ca/cargo-gra/package.nix diff --git a/pkgs/by-name/ca/cargo-gra/package.nix b/pkgs/by-name/ca/cargo-gra/package.nix new file mode 100644 index 0000000000000..88e5646e5d618 --- /dev/null +++ b/pkgs/by-name/ca/cargo-gra/package.nix @@ -0,0 +1,25 @@ +{ + rustPlatform, + fetchCrate, + lib, +}: + +rustPlatform.buildRustPackage rec { + pname = "cargo-gra"; + version = "0.6.0"; + + src = fetchCrate { + inherit pname version; + hash = "sha256-cli7qaIVYvoZpDml/QAxm2vjvh/g28zlDSpU9IIUBfw="; + }; + + cargoHash = "sha256-xsaavcpDaiDDbL3Dl+7NLcfB5U6vuYsVPoIuA/KXCvI="; + + meta = { + license = lib.licenses.gpl3Plus; + homepage = "https://gitlab.com/floers/gtk-stuff/cargo-gra/"; + maintainers = with lib.maintainers; [ bot-wxt1221 ]; + platforms = lib.platforms.unix; + description = "gtk-rust-app cli for building flatpak apps with ease"; + }; +} From 161e7bff14474b01129279a42d207e752ea585fc Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 5 Nov 2024 18:03:48 +0800 Subject: [PATCH 2/6] karlender: move to by-name --- .../karlender/default.nix => by-name/ka/karlender/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/office/karlender/default.nix => by-name/ka/karlender/package.nix} (100%) diff --git a/pkgs/applications/office/karlender/default.nix b/pkgs/by-name/ka/karlender/package.nix similarity index 100% rename from pkgs/applications/office/karlender/default.nix rename to pkgs/by-name/ka/karlender/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cdf056feef019..40c0321d762d3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28770,8 +28770,6 @@ with pkgs; avahi = avahi.override { withLibdnssdCompat = true; }; }; - karlender = callPackage ../applications/office/karlender { }; - keepassxc = libsForQt5.callPackage ../applications/misc/keepassxc { inherit (darwin.apple_sdk_11_0.frameworks) LocalAuthentication; stdenv = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; From dda8654cbd41249abbef64a00ed091b365969569 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 5 Nov 2024 18:04:00 +0800 Subject: [PATCH 3/6] karlender: nixfmt --- pkgs/by-name/ka/karlender/package.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ka/karlender/package.nix b/pkgs/by-name/ka/karlender/package.nix index db3e5c6876d9c..e25507ec8f5cc 100644 --- a/pkgs/by-name/ka/karlender/package.nix +++ b/pkgs/by-name/ka/karlender/package.nix @@ -1,12 +1,13 @@ -{ lib -, rustPlatform -, fetchFromGitLab -, pkg-config -, gtk4 -, libadwaita -, wrapGAppsHook4 -, glib -, tzdata +{ + lib, + rustPlatform, + fetchFromGitLab, + pkg-config, + gtk4, + libadwaita, + wrapGAppsHook4, + glib, + tzdata, }: rustPlatform.buildRustPackage rec { From 4dccc2cc9a55ee704d3b11dcfcc1e90947dbd9ac Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 5 Nov 2024 18:05:01 +0800 Subject: [PATCH 4/6] karlender: add passthru.updateScript --- pkgs/by-name/ka/karlender/package.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ka/karlender/package.nix b/pkgs/by-name/ka/karlender/package.nix index e25507ec8f5cc..7c3b1aad45056 100644 --- a/pkgs/by-name/ka/karlender/package.nix +++ b/pkgs/by-name/ka/karlender/package.nix @@ -8,6 +8,7 @@ wrapGAppsHook4, glib, tzdata, + nix-update-script, }: rustPlatform.buildRustPackage rec { @@ -53,12 +54,14 @@ rustPlatform.buildRustPackage rec { install -Dm444 target/gra-gen/data/codes.loers.Karlender.appdata.xml -t $out/share/metainfo/ ''; - meta = with lib; { + passthru.updateScript = nix-update-script { }; + + meta = { description = "Mobile-friendly GTK calendar application"; mainProgram = "karlender"; homepage = "https://gitlab.com/floers/karlender"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ chuangzhu ]; - platforms = platforms.linux; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ chuangzhu ]; + platforms = lib.platforms.linux; }; } From 7e0fc29eca02b60ecefe3f824d1de64f72437eef Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 5 Nov 2024 18:46:54 +0800 Subject: [PATCH 5/6] karlender: 0.9.2 -> 0.10.4 --- pkgs/by-name/ka/karlender/package.nix | 35 +++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ka/karlender/package.nix b/pkgs/by-name/ka/karlender/package.nix index 7c3b1aad45056..e811d86bac6ca 100644 --- a/pkgs/by-name/ka/karlender/package.nix +++ b/pkgs/by-name/ka/karlender/package.nix @@ -9,42 +9,63 @@ glib, tzdata, nix-update-script, + dbus, + cargo-gra, + fetchpatch, }: rustPlatform.buildRustPackage rec { pname = "karlender"; - version = "0.9.2"; + version = "0.10.4"; src = fetchFromGitLab { owner = "floers"; repo = pname; rev = "v${version}"; - hash = "sha256-txPMOWwxgs9PH1Scnwr/X4cuMIUa+eoLW3K2aqmqRMQ="; + hash = "sha256-W+s1RCPwy7ZiK514AaQLwV9y+VJ58oMGlrS5cdoFKIg="; }; - cargoHash = "sha256-OyyzzkoYBed2XFCesj3QBodT9e/BaapGl/z0f6+cDZA="; + cargoPatches = [ + # https://gitlab.com/floers/calendar-stuff/karlender/-/merge_requests/43 + # Remove it when it is merged and released. + (fetchpatch { + url = "https://gitlab.com/floers/calendar-stuff/karlender/-/commit/ce50c68323a834a0ee2cbff88ed285a971dfd91e.patch"; + hash = "sha256-0hGgJPwnSNGTO/eiooQkQlBJ4brbaWVKRY6MT1PZApg="; + }) + ]; + + cargoHash = "sha256-CeHIx6oUtAcr6tBdqmIDTLuYcesaA6G72L3HwHDLY7Y="; nativeBuildInputs = [ pkg-config wrapGAppsHook4 glib + cargo-gra ]; buildInputs = [ gtk4 libadwaita + dbus + ]; + + checkFlags = [ + "--skip domain::time::tests::test_get_correct_offset_for_dst" # Need time ]; + preBuild = '' + cargo-gra gen + ''; + postPatch = '' - substituteInPlace src/domain/time.rs --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" - substituteInPlace build.rs --replace "// gra::build" "gra::build" + substituteInPlace src/domain/time.rs --replace-fail "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" ''; postInstall = '' substituteInPlace target/gra-gen/data/codes.loers.Karlender.desktop \ - --replace "Exec=codes.loers.Karlender" "Exec=karlender" + --replace-fail "Exec=codes.loers.Karlender" "Exec=karlender" substituteInPlace target/gra-gen/data/codes.loers.Karlender.appdata.xml \ - --replace "codes.loers.Karlender" "karlender" + --replace-fail "codes.loers.Karlender" "karlender" install -Dm444 target/gra-gen/codes.loers.Karlender.gschema.xml -t $out/share/gsettings-schemas/$name/glib-2.0/schemas/ glib-compile-schemas $out/share/gsettings-schemas/$name/glib-2.0/schemas/ install -Dm444 target/gra-gen/data/codes.loers.Karlender.svg -t $out/share/icons/hicolor/scalable/apps/ From 9a47d382c37a6f942175c654bd42d22cfe484105 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Wed, 6 Nov 2024 16:52:09 +0800 Subject: [PATCH 6/6] karlender: add bot-wxt1221 as maintainers --- pkgs/by-name/ka/karlender/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ka/karlender/package.nix b/pkgs/by-name/ka/karlender/package.nix index e811d86bac6ca..f908979a70234 100644 --- a/pkgs/by-name/ka/karlender/package.nix +++ b/pkgs/by-name/ka/karlender/package.nix @@ -82,7 +82,10 @@ rustPlatform.buildRustPackage rec { mainProgram = "karlender"; homepage = "https://gitlab.com/floers/karlender"; license = lib.licenses.gpl3Plus; - maintainers = with lib.maintainers; [ chuangzhu ]; + maintainers = with lib.maintainers; [ + chuangzhu + bot-wxt1221 + ]; platforms = lib.platforms.linux; }; }