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

View file

@ -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;
};

View file

@ -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
'';

View file

@ -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 ];
};