forked from auxolotl/labs
feat: create make capability, use to build bash
This commit is contained in:
parent
b226ca0968
commit
b90aeab27f
2 changed files with 44 additions and 8 deletions
40
tidepool/src/capabilities/make.nix
Normal file
40
tidepool/src/capabilities/make.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ config, global }:
|
||||
|
||||
let
|
||||
inherit (global)
|
||||
lib
|
||||
packages
|
||||
;
|
||||
in
|
||||
{
|
||||
options.make = {
|
||||
flags = lib.options.create {
|
||||
description = "List of flags to pass to make.";
|
||||
type = lib.types.list.of lib.types.string;
|
||||
default.value = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
deps.build.build = {
|
||||
gnumake =
|
||||
if (config.platform.build == "i686-linux") then
|
||||
packages.foundation.gnumake.versions."4.4.1-bootstrap"
|
||||
else
|
||||
packages.foundation.gnumake.versions."4.4.1-stage1-passthrough";
|
||||
};
|
||||
|
||||
phases =
|
||||
let
|
||||
makeFlags = builtins.concatStringsSep " " config.make.flags;
|
||||
in
|
||||
{
|
||||
makeBuild = lib.dag.entry.before [ "build" ] ''
|
||||
make -j $NIX_BUILD_CORES ${makeFlags}
|
||||
'';
|
||||
makeInstall = lib.dag.entry.before [ "install" ] ''
|
||||
make -j $NIX_BUILD_CORES install ${makeFlags}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -16,6 +16,10 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
includes = [
|
||||
../../../../capabilities/make.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
meta = {
|
||||
description = "GNU Bourne-Again Shell, the de facto standard shell on Linux";
|
||||
|
|
@ -50,7 +54,6 @@ in
|
|||
(
|
||||
if (config.platform.build == "i686-linux") then
|
||||
{
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-bootstrap";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-bootstrap";
|
||||
gnused = packages.foundation.gnused.versions."4.9-bootstrap";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-bootstrap";
|
||||
|
|
@ -64,7 +67,6 @@ in
|
|||
}
|
||||
else
|
||||
{
|
||||
gnumake = packages.foundation.gnumake.versions."4.4.1-stage1-passthrough";
|
||||
gnupatch = packages.foundation.gnupatch.versions."2.7-stage1-passthrough";
|
||||
gnused = packages.foundation.gnused.versions."4.9-stage1-passthrough";
|
||||
gnutar = packages.foundation.gnutar.versions."1.35-stage1-passthrough";
|
||||
|
|
@ -111,14 +113,8 @@ in
|
|||
bash_cv_func_strtoimax=y
|
||||
'';
|
||||
|
||||
build = ''
|
||||
# Build
|
||||
make -j $NIX_BUILD_CORES
|
||||
'';
|
||||
|
||||
install = ''
|
||||
# Install
|
||||
make -j $NIX_BUILD_CORES install
|
||||
rm $out/bin/bashbug
|
||||
|
||||
ln -s $out/bin/bash $out/bin/sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue