treewide: with stdenv.lib; in meta -> with lib;

Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
This commit is contained in:
Profpatsch
2021-01-11 10:38:22 +01:00
parent e87aef06e0
commit 4a7f99d55d
6869 changed files with 13585 additions and 13580 deletions
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, b43FirmwareCutter }:
{ lib, stdenv, fetchurl, b43FirmwareCutter }:
stdenv.mkDerivation rec {
pname = "b43-firmware";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
b43-fwcutter -w $out *.wl_apsta.o
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Firmware for cards supported by the b43 kernel module";
homepage = "http://wireless.kernel.org/en/users/Drivers/b43";
downloadPage = "http://www.lwfinger.com/b43-firmware";
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, cabextract, bt-fw-converter }:
{ lib, stdenv, fetchurl, cabextract, bt-fw-converter }:
# Kernels between 4.2 and 4.7 will not work with
# this packages as they expect the firmware to be named "BCM.hcd"
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
outputHashAlgo = "sha256";
outputHash = "042frb2dmrqfj8q83h5p769q6hg2b3i8fgnyvs9r9a71z7pbsagq";
meta = with stdenv.lib; {
meta = with lib; {
description = "Firmware for Broadcom WIDCOMM® Bluetooth devices";
homepage = "http://www.catalog.update.microsoft.com/Search.aspx?q=Broadcom+bluetooth";
license = licenses.unfree;
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, perl, perlPackages, bluez }:
{ lib, stdenv, fetchurl, makeWrapper, perl, perlPackages, bluez }:
stdenv.mkDerivation rec {
pname = "bt-fw-converter";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/bt-fw-converter --set PERL5LIB $PERL5LIB
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/winterheart/broadcom-bt-firmware/";
description = "A tool that converts hex to hcd based on inf file";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, cpio, xz, pkgs }:
{ lib, stdenv, fetchurl, cpio, xz, pkgs }:
let
@@ -54,7 +54,7 @@ stdenv.mkDerivation {
gunzip -c ${firmwareOut}.gz > $out/lib/firmware/facetimehd/${firmwareOut}
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "facetimehd firmware";
homepage = "https://support.apple.com/kb/DL1877";
license = licenses.unfree;
@@ -1,6 +1,6 @@
# Updating? Keep $out/etc synchronized with passthru keys
{ stdenv
{ lib, stdenv
, fetchurl
, fetchFromGitHub
, substituteAll
@@ -329,7 +329,7 @@ let
};
};
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://fwupd.org/";
maintainers = with maintainers; [ jtojnar ];
license = licenses.lgpl21Plus;
@@ -1,4 +1,4 @@
{ stdenv, fetchurl }:
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "openelec-dvb-firmware";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
find $out \( -name 'README.*' -or -name 'LICEN[SC]E.*' -or -name '*.txt' \) | xargs rm
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "DVB firmware from OpenELEC";
homepage = "https://github.com/OpenELEC/dvb-firmware";
license = licenses.unfreeRedistributableFirmware;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation {
pname = "raspberrypi-wireless-firmware";
@@ -43,7 +43,7 @@ stdenv.mkDerivation {
outputHashAlgo = "sha256";
outputHash = "17k9y499kjc4zv7ivnsfrgfibwj0ldr3sqdgia4dackbr70jfg2h";
meta = with stdenv.lib; {
meta = with lib; {
description = "Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W";
homepage = "https://github.com/RPi-Distro/firmware-nonfree";
license = licenses.unfreeRedistributableFirmware;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
{ lib, stdenv, fetchFromGitHub, cmake, pkgconfig }:
let
inherit (stdenv.lib) optionals;
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
cp -v *.bin $out/
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Firmware related ARM stubs for the Raspberry Pi";
homepage = https://github.com/raspberrypi/tools;
license = licenses.bsd3;
@@ -1,4 +1,4 @@
{ stdenv, fetchgit }:
{ lib, stdenv, fetchgit }:
stdenv.mkDerivation {
name = "rt5677-firmware";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
cp ./firmware/rt5677_elf_vad $out/lib/firmware
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Firmware for Realtek rt5677 device";
license = licenses.unfreeRedistributableFirmware;
maintainers = [ maintainers.zohl ];
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
with stdenv.lib;
stdenv.mkDerivation {
name = "rtl8192su-unstable-2016-10-05";
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
done
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Firmware for Realtek RTL8188SU/RTL8191SU/RTL8192SU";
homepage = "https://github.com/chunkeey/rtl8192su";
license = licenses.unfreeRedistributableFirmware;
@@ -1,4 +1,4 @@
{ stdenv, linuxPackages }:
{ lib, stdenv, linuxPackages }:
with stdenv.lib;
stdenv.mkDerivation {
name = "rtl8723bs-firmware-${linuxPackages.rtl8723bs.version}";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
cp rtl8723bs_wowlan.bin "$out/lib/firmware/rtlwifi"
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Firmware for RealTek 8723bs";
homepage = "https://github.com/hadess/rtl8723bs";
license = licenses.unfreeRedistributableFirmware;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation {
name = "rtl8761b-firmware";
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
$out/lib/firmware/rtl_bt/rtl8761b_config.bin
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Firmware for Realtek RTL8761b";
license = licenses.unfreeRedistributableFirmware;
maintainers = with maintainers; [ edibopp ];
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
with stdenv.lib;
stdenv.mkDerivation rec {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
ROOT=$out SOF_VERSION=v${version} ./go.sh
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Sound Open Firmware";
homepage = "https://www.sofproject.org/";
license = with licenses; [ bsd3 isc ];