summary refs log tree commit diff
path: root/pkgs/applications/accessibility
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-03-14 17:00:32 +0100
committerJan Tojnar <jtojnar@gmail.com>2021-03-14 17:47:18 +0100
commit4853c6369d5fd0af478091812b4de5b2789bd975 (patch)
treedb6fdb13c31438c5398ff4fbb164607ef54fef86 /pkgs/applications/accessibility
parent6f0dd4247b51111acf1539f7eda7bff2a13cc95a (diff)
contrast: port away from buildRustPackage
The new setup hooks compose better with Meson setup hooks.

Needed to add libsass – not sure how sass-sys crate built without it before.
Diffstat (limited to 'pkgs/applications/accessibility')
-rw-r--r--pkgs/applications/accessibility/contrast/default.nix23
1 files changed, 13 insertions, 10 deletions
diff --git a/pkgs/applications/accessibility/contrast/default.nix b/pkgs/applications/accessibility/contrast/default.nix
index 689ad27357524..44bee86880a76 100644
--- a/pkgs/applications/accessibility/contrast/default.nix
+++ b/pkgs/applications/accessibility/contrast/default.nix
@@ -1,4 +1,5 @@
-{ lib
+{ stdenv
+, lib
 , fetchFromGitLab
 , cairo
 , dbus
@@ -7,17 +8,17 @@
 , glib
 , gtk3
 , libhandy_0
+, libsass
 , meson
 , ninja
 , pango
 , pkg-config
 , python3
-, rustc
 , rustPlatform
 , wrapGAppsHook
 }:
 
-rustPlatform.buildRustPackage rec {
+stdenv.mkDerivation rec {
   pname = "contrast";
   version = "0.0.3";
 
@@ -30,7 +31,11 @@ rustPlatform.buildRustPackage rec {
     sha256 = "0kk3mv7a6y258109xvgicmsi0lw0rcs00gfyivl5hdz7qh47iccy";
   };
 
-  cargoSha256 = "0vi8nv4hkhsgqgz36xacwkk5cxirg6li44nbmk3x7vx7c64hzybq";
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src;
+    name = "${pname}-${version}";
+    hash = "sha256-ePkPiWGn79PHrMsSEql5OXZW5uRMdTP+w0/DCcm2KG4=";
+  };
 
   nativeBuildInputs = [
     desktop-file-utils
@@ -39,6 +44,9 @@ rustPlatform.buildRustPackage rec {
     ninja
     pkg-config
     python3
+    rustPlatform.rust.cargo
+    rustPlatform.cargoSetupHook
+    rustPlatform.rust.rustc
     wrapGAppsHook
     glib # for glib-compile-resources
   ];
@@ -49,6 +57,7 @@ rustPlatform.buildRustPackage rec {
     glib
     gtk3
     libhandy_0
+    libsass
     pango
   ];
 
@@ -56,12 +65,6 @@ rustPlatform.buildRustPackage rec {
     patchShebangs build-aux/meson_post_install.py
   '';
 
-  # Don't use buildRustPackage phases, only use it for rust deps setup
-  configurePhase = null;
-  buildPhase = null;
-  checkPhase = null;
-  installPhase = null;
-
   meta = with lib; {
     description = "Checks whether the contrast between two colors meet the WCAG requirements";
     homepage = "https://gitlab.gnome.org/World/design/contrast";