summary refs log tree commit diff
path: root/pkgs/applications/misc/health
diff options
context:
space:
mode:
authoraleksana <me@aleksana.moe>2023-05-10 00:00:35 +0800
committeraleksana <me@aleksana.moe>2023-05-10 14:13:36 +0800
commitdd21449c73c2514dc58b76f1fe05175bd12f1a96 (patch)
treea74015ba8e28a010a4b015757e6210ab5f974a13 /pkgs/applications/misc/health
parent2909d9b11778ee01908656f63398aa5b9831bc27 (diff)
downloadnixpkgs-dd21449c73c2514dc58b76f1fe05175bd12f1a96.tar
nixpkgs-dd21449c73c2514dc58b76f1fe05175bd12f1a96.tar.gz
nixpkgs-dd21449c73c2514dc58b76f1fe05175bd12f1a96.tar.bz2
nixpkgs-dd21449c73c2514dc58b76f1fe05175bd12f1a96.tar.lz
nixpkgs-dd21449c73c2514dc58b76f1fe05175bd12f1a96.tar.xz
nixpkgs-dd21449c73c2514dc58b76f1fe05175bd12f1a96.tar.zst
nixpkgs-dd21449c73c2514dc58b76f1fe05175bd12f1a96.zip
health: init at 0.94.0
Diffstat (limited to 'pkgs/applications/misc/health')
-rw-r--r--pkgs/applications/misc/health/default.nix79
-rw-r--r--pkgs/applications/misc/health/update_gtk4_cargo_deps.patch28
2 files changed, 107 insertions, 0 deletions
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",