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
{ lib, stdenv
, fetchFromGitHub
, fetchpatch
, autoreconfHook
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
echo "${version}" >.version
'';
meta = with stdenv.lib; {
meta = with lib; {
description = ''A set of tools to optimize deflate-compressed files'';
license = licenses.gpl3 ;
maintainers = [ maintainers.raskin ];
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cmake, fetchpatch
{ lib, stdenv, fetchFromGitHub, cmake, fetchpatch
, staticOnly ? stdenv.hostPlatform.isStatic
}:
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
cp ../docs/*.3 $out/share/man/man3/
'';
meta = with stdenv.lib; {
meta = with lib; {
inherit (src.meta) homepage;
description = "A generic-purpose lossless compression algorithm and tool";
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, openmp ? null }:
{ lib, stdenv, fetchurl, openmp ? null }:
stdenv.mkDerivation rec {
pname = "bsc";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
makeFlagsArray+=("PREFIX=$out")
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "High performance block-sorting data compression library";
homepage = "http://libbsc.com/";
# Later commits changed the licence to Apache2 (no release yet, though)
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv
{ lib, stdenv
, fetchFromGitLab
, meson
, python3
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
meta = with stdenv.lib; {
meta = with lib; {
description = "High-quality data compression program";
license = licenses.bsdOriginal;
platforms = platforms.all;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl
{ lib, stdenv, fetchurl
, linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin
, autoreconfHook
}:
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
meta = with stdenv.lib; {
meta = with lib; {
description = "High-quality data compression program";
license = licenses.bsdOriginal;
platforms = platforms.all;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "dejsonlz4";
version = "1.1";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
cp dejsonlz4 $out/bin/
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Decompress Mozilla Firefox bookmarks backup files";
homepage = "https://github.com/avih/dejsonlz4";
license = licenses.bsd2;
+1 -1
View File
@@ -24,7 +24,7 @@ in pythonPackages.buildPythonApplication rec {
wrapProgram "$out/bin/dtrx" --prefix PATH : "${archivers}"
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Do The Right Extraction: A tool for taking the hassle out of extracting archives";
homepage = "https://brettcsmith.org/2007/dtrx/";
license = licenses.gpl3Plus;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, gtk3, libdivsufsort, pkg-config, wrapGAppsHook }:
{ lib, stdenv, fetchFromGitHub, gtk3, libdivsufsort, pkg-config, wrapGAppsHook }:
stdenv.mkDerivation {
pname = "flips";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
makeFlags = [ "PREFIX=${placeholder "out"}" ];
buildPhase = "./make.sh";
meta = with stdenv.lib; {
meta = with lib; {
description = "A patcher for IPS and BPS files";
homepage = "https://github.com/Alcaro/Flips";
license = licenses.gpl3Plus;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "hactool";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
install -D hactool $out/bin/hactool
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/SciresM/hactool";
description = "A tool to manipulate common file formats for the Nintendo Switch";
longDescription = "A tool to view information about, decrypt, and extract common file formats for the Nintendo Switch, especially Nintendo Content Archives";
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, gnulib, perl, autoconf, automake }:
{ lib, stdenv, fetchFromGitHub, gnulib, perl, autoconf, automake }:
stdenv.mkDerivation rec {
version = "2.5";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
./build-aux/autogen.sh
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/kjn/lbzip2"; # Formerly http://lbzip2.org/
description = "Parallel bzip2 compression utility";
license = licenses.gpl3;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, valgrind, fetchpatch
{ lib, stdenv, fetchFromGitHub, valgrind, fetchpatch
, enableStatic ? stdenv.hostPlatform.isStatic
, enableShared ? !stdenv.hostPlatform.isStatic
}:
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
moveToOutput bin "$bin"
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Extremely fast compression algorithm";
longDescription = ''
Very fast lossless compression algorithm, providing compression speed
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "lzbench";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
cp lzbench $out/bin
'';
meta = with stdenv.lib; {
meta = with lib; {
inherit (src.meta) homepage;
description = "In-memory benchmark of open-source LZ77/LZSS/LZMA compressors";
license = licenses.free;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cmake }:
{ lib, stdenv, fetchFromGitHub, cmake }:
stdenv.mkDerivation rec {
pname = "lzfse";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/lzfse/lzfse";
description = "a reference C implementation of the LZFSE compressor";
longDescription = ''
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cmake } :
{ lib, stdenv, fetchFromGitHub, cmake } :
stdenv.mkDerivation {
name = "lzham-1.0";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
cp ../bin_linux/lzhamtest $out/bin
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Lossless data compression codec with LZMA-like ratios but 1.5x-8x faster decompression speed";
homepage = "https://github.com/richgel999/lzham_codec";
license = with licenses; [ mit ];
+2 -2
View File
@@ -1,4 +1,4 @@
{stdenv, fetchurl, lzo}:
{lib, stdenv, fetchurl, lzo}:
stdenv.mkDerivation rec {
name = "lzop-1.04";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
buildInputs = [ lzo ];
meta = with stdenv.lib; {
meta = with lib; {
homepage = "http://www.lzop.org";
description = "Fast file compressor";
license = licenses.gpl2;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, bzip2 }:
{ lib, stdenv, fetchurl, bzip2 }:
let major = "1.1";
version = "${major}.13";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=reserved-user-defined-literal";
meta = with stdenv.lib; {
meta = with lib; {
homepage = "http://compression.ca/pbzip2/";
description = "A parallel implementation of bzip2 for multi-core machines";
license = licenses.bsd2;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, zlib, util-linux }:
{ lib, stdenv, fetchurl, zlib, util-linux }:
let name = "pigz";
version = "2.4";
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
install -Dm755 pigz.pdf "$out/share/doc/pigz/pigz.pdf"
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "http://www.zlib.net/pigz/";
description = "A parallel implementation of gzip for multi-core machines";
license = licenses.zlib;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, ucl, zlib, perl }:
{ lib, stdenv, fetchurl, ucl, zlib, perl }:
stdenv.mkDerivation rec {
pname = "upx";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
cp src/upx.out $out/bin/upx
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://upx.github.io/";
description = "The Ultimate Packer for eXecutables";
license = licenses.gpl2Plus;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, autoreconfHook
{ lib, stdenv, fetchFromGitHub, autoreconfHook
, lzmaSupport ? true, xz ? null
}:
@@ -47,7 +47,7 @@ in stdenv.mkDerivation rec {
install -D -m644 xdelta3.1 $out/share/man/man1/xdelta3.1
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Binary differential compression in VCDIFF (RFC 3284) format";
longDescription = ''
xdelta is a command line program for delta encoding, which generates two
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, autoreconfHook
{ lib, stdenv, fetchFromGitHub, autoreconfHook
, lzmaSupport ? true, xz ? null
}:
@@ -51,7 +51,7 @@ in stdenv.mkDerivation rec {
install -D -m644 xdelta3.1 $out/share/man/man1/xdelta3.1
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Binary differential compression in VCDIFF (RFC 3284) format";
longDescription = ''
xdelta is a command line program for delta encoding, which generates two
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl
{ lib, stdenv, fetchurl
, enableStatic ? stdenv.hostPlatform.isStatic
}:
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
postInstall = "rm -rf $out/share/doc";
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://tukaani.org/xz/";
description = "A general-purpose data compression software, successor of LZMA";
+2 -2
View File
@@ -1,4 +1,4 @@
{stdenv, fetchurl}:
{lib, stdenv, fetchurl}:
stdenv.mkDerivation rec {
name = "zdelta-2.1";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
sha256 = "0k6y0r9kv5qiglnr2j4a0yvfynjkvm0pyv8ly28j0pr3w6rbxrh3";
};
meta = with stdenv.lib; {
meta = with lib; {
homepage = "http://cis.poly.edu/zdelta";
platforms = platforms.linux;
license = licenses.zlib;
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fetchpatch, cmake }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
stdenv.mkDerivation rec {
pname = "zopfli";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
cp $src/src/zopfli/*.h $dev/include/
'';
meta = with stdenv.lib; {
meta = with lib; {
inherit (src.meta) homepage;
description = "Very good, but slow, deflate or zlib compression";
longDescription = ''
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, cmake, bash, gnugrep
{ lib, stdenv, fetchFromGitHub, cmake, bash, gnugrep
, fixDarwinDylibNames
, file
, legacySupport ? false
@@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional stdenv.hostPlatform.isUnix "man"
++ [ "out" ];
meta = with stdenv.lib; {
meta = with lib; {
description = "Zstandard real-time compression algorithm";
longDescription = ''
Zstd, short for Zstandard, is a fast lossless compression algorithm,