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, fetchFromGitHub, python3, wrapQtAppsHook }:
{ lib, stdenv, fetchFromGitHub, python3, wrapQtAppsHook }:
let
inherit (python3.pkgs) wrapPython pyqt5;
@@ -27,7 +27,7 @@ in stdenv.mkDerivation rec {
makeQtWrapper $out/share/convertall/convertall.py $out/bin/convertall
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://convertall.bellz.org/";
description = "Graphical unit converter";
license = licenses.gpl2Plus;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, jdk, maven, javaPackages }:
{ lib, stdenv, fetchFromGitHub, jdk, maven, javaPackages }:
let
version = "0.9.2";
@@ -55,7 +55,7 @@ stdenv.mkDerivation {
echo "jdkhome=${jdk}" >> $out/etc/gephi.conf
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "A platform for visualizing and manipulating large graphs";
homepage = "https://gephi.org";
license = licenses.gpl3;
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, qt4, qwt6_qt4, libGLU, libGL, glew, gdal, cgal
{ lib, stdenv, fetchurl, qt4, qwt6_qt4, libGLU, libGL, glew, gdal, cgal
, proj, boost, cmake, python2, doxygen, graphviz, gmp, mpfr }:
stdenv.mkDerivation rec {
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_LINK="-ldl -lpthread -lutil";
meta = with stdenv.lib; {
meta = with lib; {
description = "Desktop software for the interactive visualisation of plate-tectonics";
homepage = "https://www.gplates.org";
license = licenses.gpl2;
@@ -1,4 +1,4 @@
{ jre, stdenv, fetchurl, makeWrapper, makeDesktopItem }:
{ jre, lib, stdenv, fetchurl, makeWrapper, makeDesktopItem }:
let
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
cp ${desktopItem}/share/applications/* $out/share/applications
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "A multi-agent programmable modeling environment";
longDescription = ''
NetLogo is a multi-agent programmable modeling environment. It is used by
@@ -1,4 +1,4 @@
{stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
{lib, stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
hwloc, jre, lapack, blas, hdf5, expat, ncurses, readline, qt4, webkitgtk, which,
lp_solve, omniorb, sqlite, libatomic_ops, pkgconfig, file, gettext, flex, bison,
doxygen, boost, openscenegraph, gnome2, xorg, git, bash, gtk2, makeWrapper }:
@@ -42,7 +42,7 @@ stdenv.mkDerivation {
done
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "An open-source Modelica-based modeling and simulation environment";
homepage = "https://openmodelica.org";
license = licenses.gpl3;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, pkgconfig, cmake
{ lib, stdenv, fetchFromGitHub, pkgconfig, cmake
, eigen, opencv, ceres-solver, cgal, boost, vcg
, gmp, mpfr, glog, gflags, libjpeg_turbo }:
@@ -50,7 +50,7 @@ stdenv.mkDerivation {
dontUseCmakeBuildDir = true;
meta = with stdenv.lib; {
meta = with lib; {
description = "A library for computer-vision scientists and especially targeted to the Multi-View Stereo reconstruction community";
homepage = "http://cdcseacave.github.io/openMVS/";
license = licenses.agpl3;
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, rustPlatform, openssl, pkg-config, ncurses }:
{ lib, stdenv, fetchFromGitHub, rustPlatform, openssl, pkg-config, ncurses }:
rustPlatform.buildRustPackage rec {
version = "0.5.1";
@@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
# Some tests fail and/or attempt to use internet servers.
doCheck = false;
meta = with stdenv.lib; {
meta = with lib; {
description = "Unit-aware calculator";
homepage = "https://rinkcalc.app";
license = with licenses; [ mpl20 gpl3 ];
+2 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, cmake, pcre, pkg-config, python2
{ lib, stdenv, fetchurl, fetchpatch, cmake, pcre, pkg-config, python2
, libX11, libXpm, libXft, libXext, libGLU, libGL, zlib, libxml2, lz4, lzma, gsl_1, xxHash
, Cocoa, OpenGL, noSplash ? false }:
@@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
setupHook = ./setup-hook.sh;
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://root.cern.ch/";
description = "A data analysis framework";
platforms = platforms.unix;
@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
setupHook = ./setup-hook.sh;
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://root.cern.ch/";
description = "A data analysis framework";
platforms = platforms.unix;
@@ -1,4 +1,4 @@
{ stdenv, python3Packages }:
{ lib, stdenv, python3Packages }:
python3Packages.buildPythonApplication rec {
pname = "snakemake";
@@ -28,7 +28,7 @@ python3Packages.buildPythonApplication rec {
doCheck = false; # Tests depend on Google Cloud credentials at ${HOME}/gcloud-service-key.json
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://snakemake.readthedocs.io";
license = licenses.mit;
description = "Python-based execution environment for make-like workflows";