From 6f0dd4247b51111acf1539f7eda7bff2a13cc95a Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 14 Mar 2021 16:26:12 +0100 Subject: [PATCH 1/4] fractal: port away from buildRustPackage The new setup hooks compose better with Meson setup hooks. Also correct license. --- .../instant-messengers/fractal/default.nix | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/fractal/default.nix b/pkgs/applications/networking/instant-messengers/fractal/default.nix index 14cf45e97bb..9f5cd6f69bf 100644 --- a/pkgs/applications/networking/instant-messengers/fractal/default.nix +++ b/pkgs/applications/networking/instant-messengers/fractal/default.nix @@ -1,12 +1,9 @@ { lib, stdenv , fetchFromGitLab , nix-update-script -, fetchpatch , meson , ninja , gettext -, cargo -, rustc , python3 , rustPlatform , pkg-config @@ -24,7 +21,7 @@ , wrapGAppsHook }: -rustPlatform.buildRustPackage rec { +stdenv.mkDerivation rec { pname = "fractal"; version = "4.4.0"; @@ -36,16 +33,21 @@ rustPlatform.buildRustPackage rec { sha256 = "DSNVd9YvI7Dd3s3+M0+wE594tmL1yPNMnD1W9wLhSuw="; }; - cargoSha256 = "xim5sOzeXJjRXbTOg2Gk/LHU0LioiyMK5nSr1LwMPjc="; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-xim5sOzeXJjRXbTOg2Gk/LHU0LioiyMK5nSr1LwMPjc="; + }; nativeBuildInputs = [ - cargo gettext meson ninja pkg-config python3 - rustc + rustPlatform.rust.cargo + rustPlatform.cargoSetupHook + rustPlatform.rust.rustc wrapGAppsHook glib ]; @@ -76,12 +78,6 @@ rustPlatform.buildRustPackage rec { patchShebangs scripts/meson_post_install.py scripts/test.sh ''; - # Don't use buildRustPackage phases, only use it for rust deps setup - configurePhase = null; - buildPhase = null; - checkPhase = null; - installPhase = null; - passthru = { updateScript = nix-update-script { attrPath = pname; @@ -91,7 +87,7 @@ rustPlatform.buildRustPackage rec { meta = with lib; { description = "Matrix group messaging app"; homepage = "https://gitlab.gnome.org/GNOME/fractal"; - license = licenses.gpl3; + license = licenses.gpl3Plus; broken = stdenv.isDarwin; maintainers = with maintainers; [ dtzWill worldofpeace ]; }; From 4853c6369d5fd0af478091812b4de5b2789bd975 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 14 Mar 2021 17:00:32 +0100 Subject: [PATCH 2/4] contrast: port away from buildRustPackage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new setup hooks compose better with Meson setup hooks. Needed to add libsass – not sure how sass-sys crate built without it before. --- .../accessibility/contrast/default.nix | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/accessibility/contrast/default.nix b/pkgs/applications/accessibility/contrast/default.nix index 689ad273575..44bee86880a 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"; From e3b0f976d44d1b4fee907496d904e3b648d72c26 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 14 Mar 2021 17:20:58 +0100 Subject: [PATCH 3/4] shortwave: port away from buildRustPackage The new setup hooks compose better with Meson setup hooks. Had to add Git since mkDerivation does not bring it in any more. --- pkgs/applications/audio/shortwave/default.nix | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/audio/shortwave/default.nix b/pkgs/applications/audio/shortwave/default.nix index 96433221e93..36ee6c12eef 100644 --- a/pkgs/applications/audio/shortwave/default.nix +++ b/pkgs/applications/audio/shortwave/default.nix @@ -1,10 +1,11 @@ -{ lib +{ stdenv +, lib , fetchFromGitLab -, cargo , dbus , desktop-file-utils , gdk-pixbuf , gettext +, gitMinimal , glib , gst_all_1 , gtk3 @@ -14,13 +15,12 @@ , openssl , pkg-config , python3 -, rustc , rustPlatform , sqlite , wrapGAppsHook }: -rustPlatform.buildRustPackage rec { +stdenv.mkDerivation rec { pname = "shortwave"; version = "1.1.1"; @@ -32,18 +32,24 @@ rustPlatform.buildRustPackage rec { sha256 = "1vlhp2ss06j41simjrrjg38alp85jddhqyvccy6bhfzm0gzynwld"; }; - cargoSha256 = "181699rlpr5dszc18wg0kbss3gfskxaz9lpxpgsc4yfb6ip89qnk"; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-0+KEbjTLecL0u/3S9FWf2r2h9ZrgcRTY163kS3NKJqA="; + }; nativeBuildInputs = [ - cargo desktop-file-utils gettext + gitMinimal glib # for glib-compile-schemas meson ninja pkg-config python3 - rustc + rustPlatform.rust.cargo + rustPlatform.cargoSetupHook + rustPlatform.rust.rustc wrapGAppsHook ]; @@ -62,12 +68,6 @@ rustPlatform.buildRustPackage rec { gst-plugins-bad ]); - # Don't use buildRustPackage phases, only use it for rust deps setup - configurePhase = null; - buildPhase = null; - checkPhase = null; - installPhase = null; - postPatch = '' patchShebangs build-aux/meson/postinstall.py ''; From c3b4d2d0739b4ac78e117506c050a96cea4ea722 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 14 Mar 2021 17:25:45 +0100 Subject: [PATCH 4/4] gnome-podcasts: port away from buildRustPackage The new setup hooks compose better with Meson setup hooks. Also correct license. --- .../audio/gnome-podcasts/default.nix | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/audio/gnome-podcasts/default.nix b/pkgs/applications/audio/gnome-podcasts/default.nix index fbd94ebd3d1..6524700ae15 100644 --- a/pkgs/applications/audio/gnome-podcasts/default.nix +++ b/pkgs/applications/audio/gnome-podcasts/default.nix @@ -1,11 +1,10 @@ -{ lib +{ stdenv +, lib , rustPlatform , fetchFromGitLab , meson , ninja , gettext -, cargo -, rustc , python3 , pkg-config , glib @@ -18,9 +17,9 @@ , wrapGAppsHook }: -rustPlatform.buildRustPackage rec { - version = "0.4.8"; +stdenv.mkDerivation rec { pname = "gnome-podcasts"; + version = "0.4.8"; src = fetchFromGitLab { domain = "gitlab.gnome.org"; @@ -30,16 +29,21 @@ rustPlatform.buildRustPackage rec { sha256 = "0y2332zjq7vf1v38wzwz98fs19vpzy9kl7y0xbdzqr303l59hjb1"; }; - cargoSha256 = "1jbii9k4bkrivdk1ffr6556q1sgk9j4jbzwnn8vbxmksyl1x328q"; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-GInRA/V61r42spb/JYlM8+mATSkmOxdm2zHPRWaKcck="; + }; nativeBuildInputs = [ meson ninja pkg-config gettext - cargo - rustc python3 + rustPlatform.rust.cargo + rustPlatform.cargoSetupHook + rustPlatform.rust.rustc wrapGAppsHook glib ]; @@ -57,12 +61,6 @@ rustPlatform.buildRustPackage rec { gst_all_1.gst-plugins-good ]; - # use Meson/Ninja phases - configurePhase = null; - buildPhase = null; - checkPhase = null; - installPhase = null; - # tests require network doCheck = false; @@ -74,7 +72,7 @@ rustPlatform.buildRustPackage rec { meta = with lib; { description = "Listen to your favorite podcasts"; homepage = "https://wiki.gnome.org/Apps/Podcasts"; - license = licenses.gpl3; + license = licenses.gpl3Plus; maintainers = teams.gnome.members; platforms = platforms.unix; };