Merge pull request #116324 from jtojnar/modernize-fractal

Port meson projects away from buildRustPackage
This commit is contained in:
WORLDofPEACE 2021-03-15 01:42:34 -04:00 committed by GitHub
commit 0080cc56d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 52 deletions

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";

View File

@ -1,11 +1,10 @@
{ lib { stdenv
, lib
, rustPlatform , rustPlatform
, fetchFromGitLab , fetchFromGitLab
, meson , meson
, ninja , ninja
, gettext , gettext
, cargo
, rustc
, python3 , python3
, pkg-config , pkg-config
, glib , glib
@ -18,9 +17,9 @@
, wrapGAppsHook , wrapGAppsHook
}: }:
rustPlatform.buildRustPackage rec { stdenv.mkDerivation rec {
version = "0.4.8";
pname = "gnome-podcasts"; pname = "gnome-podcasts";
version = "0.4.8";
src = fetchFromGitLab { src = fetchFromGitLab {
domain = "gitlab.gnome.org"; domain = "gitlab.gnome.org";
@ -30,16 +29,21 @@ rustPlatform.buildRustPackage rec {
sha256 = "0y2332zjq7vf1v38wzwz98fs19vpzy9kl7y0xbdzqr303l59hjb1"; sha256 = "0y2332zjq7vf1v38wzwz98fs19vpzy9kl7y0xbdzqr303l59hjb1";
}; };
cargoSha256 = "1jbii9k4bkrivdk1ffr6556q1sgk9j4jbzwnn8vbxmksyl1x328q"; cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-GInRA/V61r42spb/JYlM8+mATSkmOxdm2zHPRWaKcck=";
};
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
pkg-config pkg-config
gettext gettext
cargo
rustc
python3 python3
rustPlatform.rust.cargo
rustPlatform.cargoSetupHook
rustPlatform.rust.rustc
wrapGAppsHook wrapGAppsHook
glib glib
]; ];
@ -57,12 +61,6 @@ rustPlatform.buildRustPackage rec {
gst_all_1.gst-plugins-good gst_all_1.gst-plugins-good
]; ];
# use Meson/Ninja phases
configurePhase = null;
buildPhase = null;
checkPhase = null;
installPhase = null;
# tests require network # tests require network
doCheck = false; doCheck = false;
@ -74,7 +72,7 @@ rustPlatform.buildRustPackage rec {
meta = with lib; { meta = with lib; {
description = "Listen to your favorite podcasts"; description = "Listen to your favorite podcasts";
homepage = "https://wiki.gnome.org/Apps/Podcasts"; homepage = "https://wiki.gnome.org/Apps/Podcasts";
license = licenses.gpl3; license = licenses.gpl3Plus;
maintainers = teams.gnome.members; maintainers = teams.gnome.members;
platforms = platforms.unix; platforms = platforms.unix;
}; };

View File

@ -1,10 +1,11 @@
{ lib { stdenv
, lib
, fetchFromGitLab , fetchFromGitLab
, cargo
, dbus , dbus
, desktop-file-utils , desktop-file-utils
, gdk-pixbuf , gdk-pixbuf
, gettext , gettext
, gitMinimal
, glib , glib
, gst_all_1 , gst_all_1
, gtk3 , gtk3
@ -14,13 +15,12 @@
, openssl , openssl
, pkg-config , pkg-config
, python3 , python3
, rustc
, rustPlatform , rustPlatform
, sqlite , sqlite
, wrapGAppsHook , wrapGAppsHook
}: }:
rustPlatform.buildRustPackage rec { stdenv.mkDerivation rec {
pname = "shortwave"; pname = "shortwave";
version = "1.1.1"; version = "1.1.1";
@ -32,18 +32,24 @@ rustPlatform.buildRustPackage rec {
sha256 = "1vlhp2ss06j41simjrrjg38alp85jddhqyvccy6bhfzm0gzynwld"; sha256 = "1vlhp2ss06j41simjrrjg38alp85jddhqyvccy6bhfzm0gzynwld";
}; };
cargoSha256 = "181699rlpr5dszc18wg0kbss3gfskxaz9lpxpgsc4yfb6ip89qnk"; cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-0+KEbjTLecL0u/3S9FWf2r2h9ZrgcRTY163kS3NKJqA=";
};
nativeBuildInputs = [ nativeBuildInputs = [
cargo
desktop-file-utils desktop-file-utils
gettext gettext
gitMinimal
glib # for glib-compile-schemas glib # for glib-compile-schemas
meson meson
ninja ninja
pkg-config pkg-config
python3 python3
rustc rustPlatform.rust.cargo
rustPlatform.cargoSetupHook
rustPlatform.rust.rustc
wrapGAppsHook wrapGAppsHook
]; ];
@ -62,12 +68,6 @@ rustPlatform.buildRustPackage rec {
gst-plugins-bad gst-plugins-bad
]); ]);
# Don't use buildRustPackage phases, only use it for rust deps setup
configurePhase = null;
buildPhase = null;
checkPhase = null;
installPhase = null;
postPatch = '' postPatch = ''
patchShebangs build-aux/meson/postinstall.py patchShebangs build-aux/meson/postinstall.py
''; '';

View File

@ -1,12 +1,9 @@
{ lib, stdenv { lib, stdenv
, fetchFromGitLab , fetchFromGitLab
, nix-update-script , nix-update-script
, fetchpatch
, meson , meson
, ninja , ninja
, gettext , gettext
, cargo
, rustc
, python3 , python3
, rustPlatform , rustPlatform
, pkg-config , pkg-config
@ -24,7 +21,7 @@
, wrapGAppsHook , wrapGAppsHook
}: }:
rustPlatform.buildRustPackage rec { stdenv.mkDerivation rec {
pname = "fractal"; pname = "fractal";
version = "4.4.0"; version = "4.4.0";
@ -36,16 +33,21 @@ rustPlatform.buildRustPackage rec {
sha256 = "DSNVd9YvI7Dd3s3+M0+wE594tmL1yPNMnD1W9wLhSuw="; sha256 = "DSNVd9YvI7Dd3s3+M0+wE594tmL1yPNMnD1W9wLhSuw=";
}; };
cargoSha256 = "xim5sOzeXJjRXbTOg2Gk/LHU0LioiyMK5nSr1LwMPjc="; cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-xim5sOzeXJjRXbTOg2Gk/LHU0LioiyMK5nSr1LwMPjc=";
};
nativeBuildInputs = [ nativeBuildInputs = [
cargo
gettext gettext
meson meson
ninja ninja
pkg-config pkg-config
python3 python3
rustc rustPlatform.rust.cargo
rustPlatform.cargoSetupHook
rustPlatform.rust.rustc
wrapGAppsHook wrapGAppsHook
glib glib
]; ];
@ -76,12 +78,6 @@ rustPlatform.buildRustPackage rec {
patchShebangs scripts/meson_post_install.py scripts/test.sh 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 = { passthru = {
updateScript = nix-update-script { updateScript = nix-update-script {
attrPath = pname; attrPath = pname;
@ -91,7 +87,7 @@ rustPlatform.buildRustPackage rec {
meta = with lib; { meta = with lib; {
description = "Matrix group messaging app"; description = "Matrix group messaging app";
homepage = "https://gitlab.gnome.org/GNOME/fractal"; homepage = "https://gitlab.gnome.org/GNOME/fractal";
license = licenses.gpl3; license = licenses.gpl3Plus;
broken = stdenv.isDarwin; broken = stdenv.isDarwin;
maintainers = with maintainers; [ dtzWill worldofpeace ]; maintainers = with maintainers; [ dtzWill worldofpeace ];
}; };