mirror of
https://github.com/ipetkov/crane.git
synced 2024-10-03 17:28:35 +03:00
lib: use makeScopeWithSplicing' instead of makeScope (#634)
This commit is contained in:
parent
ae1453ffd0
commit
9787dc25b2
10
default.nix
10
default.nix
@ -1,5 +1,13 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
import ./lib {
|
||||
inherit (pkgs) lib newScope;
|
||||
inherit (pkgs) lib makeScopeWithSplicing';
|
||||
otherSplices = {
|
||||
selfBuildBuild = pkgs.pkgsBuildBuild;
|
||||
selfBuildHost = pkgs.pkgsBuildHost;
|
||||
selfBuildTarget = pkgs.pkgsBuildTarget;
|
||||
selfHostHost = pkgs.pkgsHostHost;
|
||||
selfHostTarget = pkgs.pkgsHostTarget;
|
||||
selfTargetTarget = pkgs.pkgsTargetTarget;
|
||||
};
|
||||
}
|
||||
|
@ -75,6 +75,7 @@
|
||||
# overridden above.
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
stdenv.cc
|
||||
] ++ lib.optionals stdenv.buildPlatform.isDarwin [
|
||||
libiconv
|
||||
];
|
||||
|
@ -10,10 +10,9 @@
|
||||
|
||||
outputs = { nixpkgs, ... }:
|
||||
let
|
||||
mkLib = pkgs: import ./lib {
|
||||
inherit (pkgs) lib newScope;
|
||||
mkLib = pkgs: import ./default.nix {
|
||||
inherit pkgs;
|
||||
};
|
||||
|
||||
nodes = (builtins.fromJSON (builtins.readFile ./test/flake.lock)).nodes;
|
||||
inputFromLock = name:
|
||||
let
|
||||
|
@ -1,5 +1,6 @@
|
||||
{ lib
|
||||
, newScope
|
||||
, makeScopeWithSplicing'
|
||||
, otherSplices
|
||||
}:
|
||||
|
||||
let
|
||||
@ -7,8 +8,12 @@ let
|
||||
current = lib.concatStringsSep "." (lib.lists.sublist 0 2 (lib.splitVersion lib.version));
|
||||
isUnsupported = lib.versionOlder current minSupported;
|
||||
msg = "crane requires at least nixpkgs-${minSupported}, supplied nixpkgs-${current}";
|
||||
|
||||
mySplice = f: makeScopeWithSplicing' {
|
||||
inherit otherSplices f;
|
||||
};
|
||||
in
|
||||
lib.warnIf isUnsupported msg (lib.makeScope newScope (self:
|
||||
lib.warnIf isUnsupported msg (mySplice (self:
|
||||
let
|
||||
inherit (self) callPackage;
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
{ lib
|
||||
, cargo
|
||||
, jq
|
||||
, pkgsBuildBuild
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (pkgsBuildBuild)
|
||||
cargo
|
||||
fetchgit
|
||||
jq
|
||||
stdenv;
|
||||
|
||||
craneUtils = pkgsBuildBuild.callPackage ../pkgs/crane-utils { };
|
||||
@ -42,7 +42,7 @@ stdenv.mkDerivation {
|
||||
dontBuild = true;
|
||||
dontFixup = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
depsBuildBuild = [
|
||||
cargo
|
||||
craneUtils
|
||||
jq
|
||||
|
Loading…
Reference in New Issue
Block a user