From dbc55b66671e4bb4479b37dbd484118985048a9e Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Wed, 30 Mar 2022 16:52:05 +0800 Subject: [PATCH] gnome.gnome-screenshot: format - use pname + version - format with nixpkgs-fmt - reorder the attributes --- .../gnome/core/gnome-screenshot/default.nix | 59 ++++++++++++++----- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/pkgs/desktops/gnome/core/gnome-screenshot/default.nix b/pkgs/desktops/gnome/core/gnome-screenshot/default.nix index ba6d05b3cbf8..a2c8f7527177 100644 --- a/pkgs/desktops/gnome/core/gnome-screenshot/default.nix +++ b/pkgs/desktops/gnome/core/gnome-screenshot/default.nix @@ -1,18 +1,53 @@ -{ lib, stdenv, gettext, libxml2, libhandy, fetchurl, pkg-config, libcanberra-gtk3 -, gtk3, glib, meson, ninja, python3, wrapGAppsHook, appstream-glib, desktop-file-utils -, gnome, gsettings-desktop-schemas }: +{ stdenv +, lib +, gettext +, libxml2 +, libhandy +, fetchurl +, pkg-config +, libcanberra-gtk3 +, gtk3 +, glib +, meson +, ninja +, python3 +, wrapGAppsHook +, appstream-glib +, desktop-file-utils +, gnome +, gsettings-desktop-schemas +}: -let +stdenv.mkDerivation rec { pname = "gnome-screenshot"; version = "41.0"; -in stdenv.mkDerivation rec { - name = "${pname}-${version}"; src = fetchurl { - url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${name}.tar.xz"; + url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz"; sha256 = "Stt97JJkKPdCY9V5ZnPPFC5HILbnaPVGio0JM/mMlZc="; }; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + appstream-glib + libxml2 + desktop-file-utils + python3 + wrapGAppsHook + ]; + + buildInputs = [ + gtk3 + glib + libcanberra-gtk3 + libhandy + gnome.adwaita-icon-theme + gsettings-desktop-schemas + ]; + doCheck = true; postPatch = '' @@ -20,12 +55,6 @@ in stdenv.mkDerivation rec { patchShebangs build-aux/postinstall.py ''; - nativeBuildInputs = [ meson ninja pkg-config gettext appstream-glib libxml2 desktop-file-utils python3 wrapGAppsHook ]; - buildInputs = [ - gtk3 glib libcanberra-gtk3 libhandy gnome.adwaita-icon-theme - gsettings-desktop-schemas - ]; - passthru = { updateScript = gnome.updateScript { packageName = pname; @@ -34,10 +63,10 @@ in stdenv.mkDerivation rec { }; meta = with lib; { - homepage = "https://en.wikipedia.org/wiki/GNOME_Screenshot"; + homepage = "https://gitlab.gnome.org/GNOME/gnome-screenshot"; description = "Utility used in the GNOME desktop environment for taking screenshots"; maintainers = teams.gnome.members; - license = licenses.gpl2; + license = licenses.gpl2Plus; platforms = platforms.linux; }; }