Merge pull request #111284 from siraben/remove-new-stdenv-lib

stdenv: warn about use of inherited lib
This commit is contained in:
John Ericson 2021-01-30 22:28:05 -05:00 committed by GitHub
commit 6717246373
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 14 deletions

View file

@ -477,6 +477,14 @@ self: super:
<title>Other Notable Changes</title>
<itemizedlist>
<listitem>
<para>
<literal>stdenv.lib</literal> has been deprecated and will break
eval in 21.11. Please use <literal>pkgs.lib</literal> instead.
See <link xlink:href="https://github.com/NixOS/nixpkgs/issues/108938">#108938</link>
for details.
</para>
</listitem>
<listitem>
<para>
The Mailman NixOS module (<literal>services.mailman</literal>) has a new

View file

@ -16,15 +16,15 @@ stdenv.mkDerivation rec {
};
patchPhase = "patchShebangs .";
preBuild = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
make CC=${buildPackages.stdenv.cc}/bin/cc find_sizes
mv find_sizes find_sizes_build
make clean
substituteInPlace Makefile --replace "./find_sizes" "./find_sizes_build"
substituteInPlace Makefile --replace "ar cr" "${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar cr"
substituteInPlace Makefile --replace "ranlib" "${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
substituteInPlace Makefile --replace "STRIP=strip" "STRIP=${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
substituteInPlace Makefile --replace "ar cr" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar cr"
substituteInPlace Makefile --replace "ranlib" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
substituteInPlace Makefile --replace "STRIP=strip" "STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
'';
nativeBuildInputs = [ perl zlib ];
# buildInputs = [ zlib ];

View file

@ -1,4 +1,5 @@
{ stdenv
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, nix-update-script
@ -30,10 +31,10 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/cargo-valgrind --prefix PATH : ${stdenv.lib.makeBinPath [ valgrind ]}
wrapProgram $out/bin/cargo-valgrind --prefix PATH : ${lib.makeBinPath [ valgrind ]}
'';
meta = with stdenv.lib; {
meta = with lib; {
description = ''Cargo subcommand "valgrind": runs valgrind and collects its output in a helpful manner'';
homepage = "https://github.com/jfrimmel/cargo-valgrind";
license = with licenses; [ asl20 /* or */ mit ];

View file

@ -1,4 +1,5 @@
{ stdenv
{ lib
, stdenv
, autoPatchelfHook
, fetchurl
, file
@ -60,11 +61,11 @@ stdenv.mkDerivation {
pleroma = nixosTests.pleroma;
};
meta = {
meta = with lib; {
description = "ActivityPub microblogging server";
homepage = https://git.pleroma.social/pleroma/pleroma;
license = stdenv.lib.licenses.agpl3;
maintainers = with stdenv.lib.maintainers; [ ninjatrappeur ];
license = licenses.agpl3;
maintainers = with maintainers; [ ninjatrappeur ];
platforms = [ "x86_64-linux" "aarch64-linux" ];
};
}

View file

@ -152,9 +152,12 @@ let
inherit lib config stdenv;
}) mkDerivation;
# For convenience, bring in the library functions in lib/ so
# packages don't have to do that themselves.
inherit lib;
# Slated for deprecation in 21.11
lib = builtins.trace
( "Warning: `stdenv.lib` is deprecated and will be removed in the next release."
+ " Please use `pkgs.lib` instead."
+ " For more information see https://github.com/NixOS/nixpkgs/issues/108938")
lib;
inherit fetchurlBoot;