Merge pull request #110913 from siraben/other-stdenv-lib
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{stdenvNoCC, git, git-lfs, cacert}: let
|
||||
{lib, stdenvNoCC, git, git-lfs, cacert}: let
|
||||
urlToName = url: rev: let
|
||||
inherit (stdenvNoCC.lib) removeSuffix splitString last;
|
||||
inherit (lib) removeSuffix splitString last;
|
||||
base = last (splitString ":" (baseNameOf (removeSuffix "/" url)));
|
||||
|
||||
matched = builtins.match "(.*).git" base;
|
||||
@@ -56,7 +56,7 @@ stdenvNoCC.mkDerivation {
|
||||
fetcher = ./nix-prefetch-git; # This must be a string to ensure it's called with bash.
|
||||
|
||||
nativeBuildInputs = [ git ]
|
||||
++ stdenvNoCC.lib.optionals fetchLFS [ git-lfs ];
|
||||
++ lib.optionals fetchLFS [ git-lfs ];
|
||||
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
@@ -66,7 +66,7 @@ stdenvNoCC.mkDerivation {
|
||||
|
||||
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||
|
||||
impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars ++ [
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
|
||||
"GIT_PROXY_COMMAND" "SOCKS_SERVER"
|
||||
];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenvNoCC, mercurial }:
|
||||
{ lib, stdenvNoCC, mercurial }:
|
||||
{ name ? null
|
||||
, url
|
||||
, rev ? null
|
||||
@@ -16,7 +16,7 @@ stdenvNoCC.mkDerivation {
|
||||
builder = ./builder.sh;
|
||||
nativeBuildInputs = [mercurial];
|
||||
|
||||
impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
|
||||
subrepoClause = if fetchSubrepos then "S" else "";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# You can specify some extra mirrors and a cache DB via options
|
||||
{stdenvNoCC, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}:
|
||||
{lib, stdenvNoCC, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}:
|
||||
# dbs is a list of strings
|
||||
# each is an url for sync
|
||||
|
||||
@@ -19,7 +19,7 @@ stdenvNoCC.mkDerivation {
|
||||
dbs = defaultDBMirrors ++ dbs;
|
||||
inherit branch cacheDB name selector;
|
||||
|
||||
impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenvNoCC, gitRepo, cacert, copyPathsToStore }:
|
||||
{ lib, stdenvNoCC, gitRepo, cacert, copyPathsToStore }:
|
||||
|
||||
{ name, manifest, rev ? "HEAD", sha256
|
||||
# Optional parameters:
|
||||
@@ -9,7 +9,7 @@
|
||||
assert repoRepoRev != "" -> repoRepoURL != "";
|
||||
assert createMirror -> !useArchive;
|
||||
|
||||
with stdenvNoCC.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
extraRepoInitFlags = [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenvNoCC, runCommand, awscli }:
|
||||
{ lib, stdenvNoCC, runCommand, awscli }:
|
||||
|
||||
{ s3url
|
||||
, name ? builtins.baseNameOf s3url
|
||||
@@ -16,7 +16,7 @@ let
|
||||
AWS_SESSION_TOKEN = session_token;
|
||||
};
|
||||
|
||||
credentialAttrs = stdenvNoCC.lib.optionalAttrs (credentials != null) (mkCredentials credentials);
|
||||
credentialAttrs = lib.optionalAttrs (credentials != null) (mkCredentials credentials);
|
||||
in runCommand name ({
|
||||
nativeBuildInputs = [ awscli ];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenvNoCC, buildPackages
|
||||
{ lib, stdenvNoCC, buildPackages
|
||||
, subversion, glibcLocales, sshSupport ? true, openssh ? null
|
||||
}:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
assert sshSupport -> openssh != null;
|
||||
|
||||
let
|
||||
repoName = with stdenvNoCC.lib;
|
||||
repoName = with lib;
|
||||
let
|
||||
fst = head;
|
||||
snd = l: head (tail l);
|
||||
@@ -39,7 +39,7 @@ stdenvNoCC.mkDerivation {
|
||||
name = name_;
|
||||
builder = ./builder.sh;
|
||||
nativeBuildInputs = [ subversion glibcLocales ]
|
||||
++ stdenvNoCC.lib.optional sshSupport openssh;
|
||||
++ lib.optional sshSupport openssh;
|
||||
|
||||
SVN_SSH = if sshSupport then "${buildPackages.openssh}/bin/ssh" else null;
|
||||
|
||||
@@ -49,6 +49,6 @@ stdenvNoCC.mkDerivation {
|
||||
|
||||
inherit url rev ignoreExternals ignoreKeywords;
|
||||
|
||||
impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
inherit preferLocalBuild;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ in stdenvNoCC.mkDerivation rec {
|
||||
builder = ./make-initrd.sh;
|
||||
|
||||
nativeBuildInputs = [ perl cpio ]
|
||||
++ stdenvNoCC.lib.optional makeUInitrd ubootTools;
|
||||
++ lib.optional makeUInitrd ubootTools;
|
||||
|
||||
compress = "${_compressorExecutable} ${lib.escapeShellArgs _compressorArgsReal}";
|
||||
|
||||
|
||||
@@ -229,26 +229,26 @@ class SPECTemplate(object):
|
||||
|
||||
@property
|
||||
def meta(self):
|
||||
out = ' meta = {\n'
|
||||
out = ' meta = with lib; {\n'
|
||||
out += ' homepage = ' + self.spec.sourceHeader['url'] + ';\n'
|
||||
out += ' description = "' + self.spec.sourceHeader['summary'] + '";\n'
|
||||
out += ' license = stdenv.lib.licenses.' + self.spec.sourceHeader['license'] + ';\n'
|
||||
out += ' license = lib.licenses.' + self.spec.sourceHeader['license'] + ';\n'
|
||||
out += ' platforms = [ "i686-linux" "x86_64-linux" ];\n'
|
||||
out += ' maintainers = with stdenv.lib.maintainers; [ ' + self.maintainer + ' ];\n'
|
||||
out += ' maintainers = with lib.maintainers; [ ' + self.maintainer + ' ];\n'
|
||||
out += ' };\n'
|
||||
out += '}\n'
|
||||
return out
|
||||
|
||||
|
||||
def __str__(self):
|
||||
head = '{stdenv, fetchurl, ' + ', '.join(self.getBuildInputs("ALL")) + '}:\n\n'
|
||||
head = '{lib, stdenv, fetchurl, ' + ', '.join(self.getBuildInputs("ALL")) + '}:\n\n'
|
||||
head += 'stdenv.mkDerivation {\n'
|
||||
body = [ self.name, self.src, self.patch, self.buildInputs, self.configure, self.build, self.ocamlExtra, self.install, self.meta ]
|
||||
return head + '\n'.join(body)
|
||||
|
||||
|
||||
def getTemplate(self):
|
||||
head = '{stdenv, buildRoot, fetchurl, ' + ', '.join(self.getBuildInputs("ALL")) + '}:\n\n'
|
||||
head = '{lib, stdenv, buildRoot, fetchurl, ' + ', '.join(self.getBuildInputs("ALL")) + '}:\n\n'
|
||||
head += 'let\n'
|
||||
head += ' buildRootInput = (import "${buildRoot}/usr/share/buildroot/buildRootInput.nix") { fetchurl=fetchurl; buildRoot=buildRoot; };\n'
|
||||
head += 'in\n\n'
|
||||
|
||||
Reference in New Issue
Block a user