feat: create make capability, use to build bash

This commit is contained in:
Ruby Iris Juric 2025-10-02 23:39:40 +10:00 committed by Victor Fuentes
parent b226ca0968
commit b90aeab27f
Signed by: vlinkz
GPG key ID: DF727B8D5AF99C64
2 changed files with 44 additions and 8 deletions

View 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}
'';
};
};
}

View file

@ -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