about summary refs log tree commit diff
path: root/pkgs/applications/networking/feedreaders/newsflash
diff options
context:
space:
mode:
authorKira Bruneau <kira.bruneau@pm.me>2021-02-28 11:46:30 -0500
committerKira Bruneau <kira.bruneau@pm.me>2021-02-28 11:47:47 -0500
commit6e3988ae064d1999befa786fa21737ee7b6328b9 (patch)
tree693d27842ea79b47f7eda3ef0d8c81d6f8f9844e /pkgs/applications/networking/feedreaders/newsflash
parentcad6cb7b5aaa184d55719a66a88786008d3468e8 (diff)
newsflash: use cargoSetupHook instead of buildRustPackage
The new cargoSetupHook makes it easier to work with mixed projects. In
this case meson & ninja + rust.

See https://github.com/NixOS/nixpkgs/pull/114669#issuecomment-787470564
Diffstat (limited to 'pkgs/applications/networking/feedreaders/newsflash')
-rw-r--r--pkgs/applications/networking/feedreaders/newsflash/default.nix22
1 files changed, 12 insertions, 10 deletions
diff --git a/pkgs/applications/networking/feedreaders/newsflash/default.nix b/pkgs/applications/networking/feedreaders/newsflash/default.nix
index 36dbd40a426a8..6c135439322a1 100644
--- a/pkgs/applications/networking/feedreaders/newsflash/default.nix
+++ b/pkgs/applications/networking/feedreaders/newsflash/default.nix
@@ -1,4 +1,5 @@
 { lib
+, stdenv
 , rustPlatform
 , fetchFromGitLab
 , meson
@@ -17,7 +18,7 @@
 , gst_all_1
 }:
 
-rustPlatform.buildRustPackage rec {
+stdenv.mkDerivation rec {
   pname = "newsflash";
   version = "1.3.0";
 
@@ -28,7 +29,11 @@ rustPlatform.buildRustPackage rec {
     hash = "sha256-Vu8PXdnayrglAFVfO+WZTzk4Qrb/3uqzQIwClnRHto8=";
   };
 
-  cargoHash = "sha256-dWumQi/Bk7w2C8zVVExxguWchZU+K2qTC02otsiK9jA=";
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src;
+    name = "${pname}-${version}";
+    hash = "sha256-dWumQi/Bk7w2C8zVVExxguWchZU+K2qTC02otsiK9jA=";
+  };
 
   patches = [
     # Post install tries to generate an icon cache & update the
@@ -54,7 +59,11 @@ rustPlatform.buildRustPackage rec {
 
     # Provides glib-compile-resources to compile gresources
     glib
-  ];
+  ] ++ (with rustPlatform; [
+    cargoSetupHook
+    rust.cargo
+    rust.rustc
+  ]);
 
   buildInputs = [
     gtk3
@@ -76,13 +85,6 @@ rustPlatform.buildRustPackage rec {
     gst-plugins-bad
   ]);
 
-  # Unset default rust phases to use meson & ninja instead
-  configurePhase = null;
-  buildPhase = null;
-  checkPhase = null;
-  installPhase = null;
-  installCheckPhase = null;
-
   meta = with lib; {
     description = "A modern feed reader designed for the GNOME desktop";
     homepage = "https://gitlab.com/news-flash/news_flash_gtk";