pkgs/development: stdenv.lib -> lib

This commit is contained in:
Ben Siraphob
2021-01-24 00:15:07 +07:00
parent ec334a1b01
commit 2f78ee7e81
121 changed files with 324 additions and 322 deletions

View File

@@ -15,7 +15,7 @@
, buildFlags ? []
, ... }@attrs:
with stdenv.lib;
with lib;
let
debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "+debug_info";

View File

@@ -1,11 +1,11 @@
{ stdenv, buildRebar3, fetchHex }:
{ lib, stdenv, buildRebar3, fetchHex }:
{ name, version, sha256
, builder ? buildRebar3
, hexPkg ? name
, ... }@attrs:
with stdenv.lib;
with lib;
let
pkg = self: builder (attrs // {

View File

@@ -15,7 +15,7 @@
, enableDebugInfo ? false
, ... }@attrs:
with stdenv.lib;
with lib;
let

View File

@@ -14,7 +14,7 @@
, enableDebugInfo ? false
, ... }@attrs:
with stdenv.lib;
with lib;
let
debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "debug-info";

View File

@@ -1,12 +1,12 @@
{ stdenv, pkgs, erlang }:
{ lib, stdenv, pkgs, erlang }:
let
inherit (stdenv.lib) makeExtensible;
inherit (lib) makeExtensible;
lib = pkgs.callPackage ./lib.nix {};
lib' = pkgs.callPackage ./lib.nix {};
# FIXME: add support for overrideScope
callPackageWithScope = scope: drv: args: stdenv.lib.callPackageWith scope drv args;
callPackageWithScope = scope: drv: args: lib'.callPackageWith scope drv args;
mkScope = scope: pkgs // scope;
packages = self:
@@ -38,27 +38,27 @@ let
# BEAM-based languages.
elixir = elixir_1_11;
elixir_1_11 = lib.callElixir ../interpreters/elixir/1.11.nix {
elixir_1_11 = lib'.callElixir ../interpreters/elixir/1.11.nix {
inherit erlang;
debugInfo = true;
};
elixir_1_10 = lib.callElixir ../interpreters/elixir/1.10.nix {
elixir_1_10 = lib'.callElixir ../interpreters/elixir/1.10.nix {
inherit erlang;
debugInfo = true;
};
elixir_1_9 = lib.callElixir ../interpreters/elixir/1.9.nix {
elixir_1_9 = lib'.callElixir ../interpreters/elixir/1.9.nix {
inherit erlang;
debugInfo = true;
};
elixir_1_8 = lib.callElixir ../interpreters/elixir/1.8.nix {
elixir_1_8 = lib'.callElixir ../interpreters/elixir/1.8.nix {
inherit erlang;
debugInfo = true;
};
elixir_1_7 = lib.callElixir ../interpreters/elixir/1.7.nix {
elixir_1_7 = lib'.callElixir ../interpreters/elixir/1.7.nix {
inherit erlang;
debugInfo = true;
};
@@ -67,8 +67,8 @@ let
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html
lfe = lfe_1_3;
lfe_1_2 = lib.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; };
lfe_1_3 = lib.callLFE ../interpreters/lfe/1.3.nix { inherit erlang buildRebar3 buildHex; };
lfe_1_2 = lib'.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; };
lfe_1_3 = lib'.callLFE ../interpreters/lfe/1.3.nix { inherit erlang buildRebar3 buildHex; };
# Non hex packages. Examples how to build Rebar/Mix packages with and
# without helper functions buildRebar3 and buildMix.

View File

@@ -1,10 +1,10 @@
{ stdenv, fetchurl }:
{ lib, stdenv, fetchurl }:
{ pkg, version, sha256
, meta ? {}
}:
with stdenv.lib;
with lib;
stdenv.mkDerivation ({
name = "hex-source-${pkg}-${version}";

View File

@@ -1,10 +1,10 @@
{ stdenv, rebar3 }:
{ lib, stdenv, rebar3 }:
{ name, version, sha256, src
, meta ? {}
}:
with stdenv.lib;
with lib;
stdenv.mkDerivation ({
name = "rebar-deps-${name}-${version}";
@@ -28,6 +28,6 @@ stdenv.mkDerivation ({
outputHashMode = "recursive";
outputHash = sha256;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
inherit meta;
})

View File

@@ -45,13 +45,13 @@ let
meta = {
description = "Package manager for the Erlang VM https://hex.pm";
license = stdenv.lib.licenses.mit;
license = lib.licenses.mit;
homepage = "https://github.com/hexpm/hex";
maintainers = with stdenv.lib.maintainers; [ ericbmerritt ];
maintainers = with lib.maintainers; [ ericbmerritt ];
};
passthru = {
env = shell self;
};
};
in stdenv.lib.fix pkg
in lib.fix pkg

View File

@@ -1,4 +1,4 @@
{ pkgs, stdenv }:
{ pkgs, lib, stdenv }:
rec {
@@ -7,7 +7,7 @@ rec {
callPackageWith = autoArgs: fn: args:
let
f = if pkgs.lib.isFunction fn then fn else import fn;
auto = builtins.intersectAttrs (stdenv.lib.functionArgs f) autoArgs;
auto = builtins.intersectAttrs (lib.functionArgs f) autoArgs;
in f (auto // args);
callPackage = callPackageWith pkgs;

View File

@@ -7,7 +7,7 @@ buildHex {
meta = {
description = "a rebar3 port compiler for native code";
license = stdenv.lib.licenses.mit;
license = lib.licenses.mit;
homepage = "https://github.com/blt/port_compiler";
};
}

View File

@@ -21,9 +21,9 @@ let
meta = {
description = "Erlang PostgreSQL Driver";
license = stdenv.lib.licenses.mit;
license = lib.licenses.mit;
homepage = "https://github.com/semiocast/pgsql";
maintainers = with stdenv.lib.maintainers; [ ericbmerritt ];
maintainers = with lib.maintainers; [ ericbmerritt ];
};
passthru = {
@@ -31,4 +31,4 @@ let
};
};
in stdenv.lib.fix pkg
in lib.fix pkg

View File

@@ -15,7 +15,7 @@
, enableDebugInfo ? false
, ... }@attrs:
with stdenv.lib;
with lib;
let
shell = drv: stdenv.mkDerivation {

View File

@@ -27,9 +27,9 @@ let
meta = {
description = "WebDriver implementation in Erlang";
license = stdenv.lib.licenses.mit;
license = lib.licenses.mit;
homepage = "https://github.com/Quviq/webdrv";
maintainers = with stdenv.lib.maintainers; [ ericbmerritt ];
maintainers = with lib.maintainers; [ ericbmerritt ];
};
passthru = {
@@ -37,4 +37,4 @@ let
};
};
in stdenv.lib.fix pkg
in lib.fix pkg