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.
This commit is contained in:
Jan Tojnar 2021-03-14 17:00:32 +01:00
parent 6f0dd4247b
commit 4853c6369d
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -1,4 +1,5 @@
{ lib { stdenv
, lib
, fetchFromGitLab , fetchFromGitLab
, cairo , cairo
, dbus , dbus
@ -7,17 +8,17 @@
, glib , glib
, gtk3 , gtk3
, libhandy_0 , libhandy_0
, libsass
, meson , meson
, ninja , ninja
, pango , pango
, pkg-config , pkg-config
, python3 , python3
, rustc
, rustPlatform , rustPlatform
, wrapGAppsHook , wrapGAppsHook
}: }:
rustPlatform.buildRustPackage rec { stdenv.mkDerivation rec {
pname = "contrast"; pname = "contrast";
version = "0.0.3"; version = "0.0.3";
@ -30,7 +31,11 @@ rustPlatform.buildRustPackage rec {
sha256 = "0kk3mv7a6y258109xvgicmsi0lw0rcs00gfyivl5hdz7qh47iccy"; sha256 = "0kk3mv7a6y258109xvgicmsi0lw0rcs00gfyivl5hdz7qh47iccy";
}; };
cargoSha256 = "0vi8nv4hkhsgqgz36xacwkk5cxirg6li44nbmk3x7vx7c64hzybq"; cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-ePkPiWGn79PHrMsSEql5OXZW5uRMdTP+w0/DCcm2KG4=";
};
nativeBuildInputs = [ nativeBuildInputs = [
desktop-file-utils desktop-file-utils
@ -39,6 +44,9 @@ rustPlatform.buildRustPackage rec {
ninja ninja
pkg-config pkg-config
python3 python3
rustPlatform.rust.cargo
rustPlatform.cargoSetupHook
rustPlatform.rust.rustc
wrapGAppsHook wrapGAppsHook
glib # for glib-compile-resources glib # for glib-compile-resources
]; ];
@ -49,6 +57,7 @@ rustPlatform.buildRustPackage rec {
glib glib
gtk3 gtk3
libhandy_0 libhandy_0
libsass
pango pango
]; ];
@ -56,12 +65,6 @@ rustPlatform.buildRustPackage rec {
patchShebangs build-aux/meson_post_install.py 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; { meta = with lib; {
description = "Checks whether the contrast between two colors meet the WCAG requirements"; description = "Checks whether the contrast between two colors meet the WCAG requirements";
homepage = "https://gitlab.gnome.org/World/design/contrast"; homepage = "https://gitlab.gnome.org/World/design/contrast";