From dd21449c73c2514dc58b76f1fe05175bd12f1a96 Mon Sep 17 00:00:00 2001 From: aleksana Date: Wed, 10 May 2023 00:00:35 +0800 Subject: [PATCH] health: init at 0.94.0 --- pkgs/applications/misc/health/default.nix | 79 +++++++++++++++++++ .../misc/health/update_gtk4_cargo_deps.patch | 28 +++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 109 insertions(+) create mode 100644 pkgs/applications/misc/health/default.nix create mode 100644 pkgs/applications/misc/health/update_gtk4_cargo_deps.patch diff --git a/pkgs/applications/misc/health/default.nix b/pkgs/applications/misc/health/default.nix new file mode 100644 index 00000000000..84683c1a4d3 --- /dev/null +++ b/pkgs/applications/misc/health/default.nix @@ -0,0 +1,79 @@ +{ lib +, stdenv +, fetchFromGitLab +, fetchpatch +, meson +, ninja +, pkg-config +, rustPlatform +, rustc +, cargo +, wrapGAppsHook4 +, blueprint-compiler +, libadwaita +, libsecret +, tracker +, darwin +}: + +stdenv.mkDerivation rec { + pname = "health"; + version = "0.94.0"; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "World"; + repo = pname; + rev = version; + hash = "sha256-KS0sdCQg2LqQB0K1cUbAjA8VITn5rAb8XCWjOKYbPqM="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + patches = [ ./update_gtk4_cargo_deps.patch ]; + name = "${pname}-${version}"; + hash = "sha256-j0I0vKoGaf2pce2C/xkz+nJYCfLvHB5F6Q9XpJtABMI="; + }; + + patches = [ + (fetchpatch { + url = "https://aur.archlinux.org/cgit/aur.git/plain/max_size_tightending_thresh_0.94.0.patch?h=health&id=d35d89760964b00ad457eca07855143a1dcbabdf"; + hash = "sha256-ndoxyrm+SVGVxfUbc5sQItQwzK75ZtKMSGUOB9mzBmo="; + }) + (fetchpatch { + url = "https://aur.archlinux.org/cgit/aur.git/plain/max_value_0.94.0.patch?h=health&id=d35d89760964b00ad457eca07855143a1dcbabdf"; + hash = "sha256-YKVQNtz+RWN6Ydw+kbStCVf0vu0eTrMKGd6kEijFG00="; + }) + # patch both or it will complain Cargo.lock mismatch + ./update_gtk4_cargo_deps.patch + ]; + + nativeBuildInputs = [ + meson + ninja + pkg-config + rustPlatform.cargoSetupHook + rustc + cargo + wrapGAppsHook4 + blueprint-compiler + ]; + + buildInputs = [ + libadwaita + libsecret + tracker + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security + darwin.apple_sdk.frameworks.Foundation + ]; + + meta = with lib; { + description = "A health tracking app for the GNOME desktop"; + homepage = "https://apps.gnome.org/app/dev.Cogitri.Health"; + license = licenses.gpl3Plus; + mainProgram = "dev.Cogitri.Health"; + maintainers = with maintainers; [ aleksana ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/applications/misc/health/update_gtk4_cargo_deps.patch b/pkgs/applications/misc/health/update_gtk4_cargo_deps.patch new file mode 100644 index 00000000000..9c22a8465b7 --- /dev/null +++ b/pkgs/applications/misc/health/update_gtk4_cargo_deps.patch @@ -0,0 +1,28 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 0331121..8d290e4 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -829,9 +829,9 @@ checksum = "da5bf7748fd4cd0b2490df8debcc911809dbcbee4ece9531b96c29a9c729de5a" + + [[package]] + name = "gtk4" +-version = "0.4.8" ++version = "0.4.9" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "c64f0c2a3d80e899dc3febddad5bac193ffcf74a0fd7e31037f30dd34d6f7396" ++checksum = "4e8ae5aef2793bc3551b5e5e3fa062a5de54bb1eccf10dfa4effe9e4384fbbbc" + dependencies = [ + "bitflags", + "cairo-rs", +@@ -852,9 +852,9 @@ dependencies = [ + + [[package]] + name = "gtk4-macros" +-version = "0.4.8" ++version = "0.4.10" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "fafbcc920af4eb677d7d164853e7040b9de5a22379c596f570190c675d45f7a7" ++checksum = "6aba0b544e91a753068e279e99d34e9624b8cfd26282167024c8a5773b8a826c" + dependencies = [ + "anyhow", + "proc-macro-crate", diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 013f7bda2c8..c9a0b22f122 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8406,6 +8406,8 @@ with pkgs; headscale = callPackage ../servers/headscale { }; + health = callPackage ../applications/misc/health { }; + healthchecks = callPackage ../servers/web-apps/healthchecks { }; heisenbridge = callPackage ../servers/heisenbridge { };