Use pinnedPkgs only if initialBuild is true

This commit is contained in:
Tobias Happ 2019-10-04 17:19:01 +02:00 committed by Alexander Sosedkin
parent 89523d2268
commit 341df0f8fd
5 changed files with 21 additions and 20 deletions

View file

@ -1,20 +1,21 @@
# Licensed under GNU Lesser General Public License v3 or later, see COPYING. # Licensed under GNU Lesser General Public License v3 or later, see COPYING.
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS. # Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
{ arch }: { arch, initialBuild ? true }:
assert builtins.elem arch [ "aarch64" "i686" ]; assert builtins.elem arch [ "aarch64" "i686" ];
let let
nixpkgs = import <nixpkgs> { }; pkgs = import <nixpkgs> { };
pinnedPkgs = import ./pinned-pkgs.nix { pkgsList = import ./pkgs-list.nix {
inherit arch; inherit arch;
inherit (nixpkgs) fetchFromGitHub; inherit (pkgs) fetchFromGitHub;
}; };
in in
import ./pkgs { import ./pkgs {
inherit arch; inherit arch initialBuild;
inherit (pinnedPkgs) buildPkgs crossPkgs crossStaticPkgs; inherit (pkgsList) pinnedPkgs crossPkgs crossStaticPkgs;
buildPkgs = if initialBuild then pkgsList.pinnedPkgs else pkgs;
} }

View file

@ -5,7 +5,7 @@
let let
# head of nixos-19.03 as of 2019-09-15 # head of nixos-19.03 as of 2019-09-15
pinnedPkgs = fetchFromGitHub { pinnedPkgsSrc = fetchFromGitHub {
owner = "NixOS"; owner = "NixOS";
repo = "nixpkgs"; repo = "nixpkgs";
rev = "2dfae8e22fde5032419c3027964c406508332974"; rev = "2dfae8e22fde5032419c3027964c406508332974";
@ -17,10 +17,10 @@ let
overlays = [ ]; overlays = [ ];
}; };
buildPkgs = import pinnedPkgs defaultNixpkgsArgs; pinnedPkgs = import pinnedPkgsSrc defaultNixpkgsArgs;
overlayJpegNoStatic = self: super: { overlayJpegNoStatic = self: super: {
inherit (buildPkgs) libjpeg; inherit (pinnedPkgs) libjpeg;
}; };
crossSystem = { crossSystem = {
@ -32,15 +32,15 @@ let
in in
{ {
inherit buildPkgs; inherit pinnedPkgs;
crossPkgs = import pinnedPkgs ({ inherit crossSystem; } // defaultNixpkgsArgs); crossPkgs = import pinnedPkgsSrc ({ inherit crossSystem; } // defaultNixpkgsArgs);
crossStaticPkgs = import pinnedPkgs ({ crossStaticPkgs = import pinnedPkgsSrc ({
inherit crossSystem; inherit crossSystem;
crossOverlays = [ crossOverlays = [
(import "${pinnedPkgs}/pkgs/top-level/static.nix") (import "${pinnedPkgsSrc}/pkgs/top-level/static.nix")
overlayJpegNoStatic overlayJpegNoStatic
]; ];
} // defaultNixpkgsArgs); } // defaultNixpkgsArgs);

View file

@ -1,7 +1,7 @@
# Licensed under GNU Lesser General Public License v3 or later, see COPYING. # Licensed under GNU Lesser General Public License v3 or later, see COPYING.
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS. # Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
{ arch, buildPkgs, crossPkgs, crossStaticPkgs } @ args: { arch, buildPkgs, crossPkgs, crossStaticPkgs, pinnedPkgs } @ args:
let let
callPackage = buildPkgs.lib.callPackageWith (args // pkgs); callPackage = buildPkgs.lib.callPackageWith (args // pkgs);

View file

@ -1,13 +1,13 @@
# Licensed under GNU Lesser General Public License v3 or later, see COPYING. # Licensed under GNU Lesser General Public License v3 or later, see COPYING.
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS. # Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
{ buildPkgs, crossStaticPkgs, talloc }: { pinnedPkgs, crossStaticPkgs, talloc }:
crossStaticPkgs.stdenv.mkDerivation rec { crossStaticPkgs.stdenv.mkDerivation rec {
pname = "proot-termux"; pname = "proot-termux";
version = "unstable-2019-09-05"; version = "unstable-2019-09-05";
src = buildPkgs.fetchFromGitHub { src = pinnedPkgs.fetchFromGitHub {
repo = "proot"; repo = "proot";
owner = "termux"; owner = "termux";
rev = "3ea655b1ae40bfa2ee612d45bf1e7ad97c4559f8"; rev = "3ea655b1ae40bfa2ee612d45bf1e7ad97c4559f8";

View file

@ -1,23 +1,23 @@
# Licensed under GNU Lesser General Public License v3 or later, see COPYING. # Licensed under GNU Lesser General Public License v3 or later, see COPYING.
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS. # Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
{ buildPkgs, crossPkgs }: { pinnedPkgs, crossPkgs }:
crossPkgs.stdenv.mkDerivation rec { crossPkgs.stdenv.mkDerivation rec {
name = "talloc-2.1.14"; name = "talloc-2.1.14";
src = buildPkgs.fetchurl { src = pinnedPkgs.fetchurl {
url = "mirror://samba/talloc/${name}.tar.gz"; url = "mirror://samba/talloc/${name}.tar.gz";
sha256 = "1kk76dyav41ip7ddbbf04yfydb4jvywzi2ps0z2vla56aqkn11di"; sha256 = "1kk76dyav41ip7ddbbf04yfydb4jvywzi2ps0z2vla56aqkn11di";
}; };
depsBuildBuild = [ buildPkgs.python2 buildPkgs.zlib ]; depsBuildBuild = [ pinnedPkgs.python2 pinnedPkgs.zlib ];
buildDeps = [ crossPkgs.zlib ]; buildDeps = [ crossPkgs.zlib ];
configurePhase = '' configurePhase = ''
substituteInPlace buildtools/bin/waf \ substituteInPlace buildtools/bin/waf \
--replace "/usr/bin/env python" "${buildPkgs.python2}/bin/python" --replace "/usr/bin/env python" "${pinnedPkgs.python2}/bin/python"
./configure --prefix=$out \ ./configure --prefix=$out \
--disable-rpath \ --disable-rpath \
--disable-python \ --disable-python \