minimal-bootstrap.gnumake-static: init at 4.4.1

This commit is contained in:
Emily Trau
2023-10-09 22:32:13 -07:00
committed by dish
parent e20d10e02b
commit 12fbd92c7e
5 changed files with 109 additions and 20 deletions
@@ -187,6 +187,12 @@ lib.makeScope
gnumakeBoot = gnumake;
};
gnumake-static = callPackage ./gnumake/static.nix {
gcc = gcc-latest;
gnumake = gnumake-musl;
gnutar = gnutar-latest;
};
gnupatch = callPackage ./gnupatch { tinycc = tinycc-mes; };
gnused = callPackage ./gnused {
@@ -354,6 +360,8 @@ lib.makeScope
echo ${gnugrep.tests.get-version}
echo ${gnugrep-static.tests.get-version}
echo ${gnum4.tests.get-version}
echo ${gnumake-musl.tests.get-version}
echo ${gnumake-static.tests.get-version}
echo ${gnused.tests.get-version}
echo ${gnused-mes.tests.get-version}
echo ${gnused-static.tests.get-version}
@@ -0,0 +1,11 @@
{ lib }:
{
meta = {
description = "A tool to control the generation of non-source files from sources";
homepage = "https://www.gnu.org/software/make";
license = lib.licenses.gpl3Plus;
teams = [ lib.teams.minimal-bootstrap ];
mainProgram = "make";
platforms = lib.platforms.unix;
};
}
@@ -6,6 +6,7 @@
gnupatch,
}:
let
inherit (import ./common.nix { inherit lib; }) meta;
pname = "gnumake";
version = "4.4.1";
@@ -156,21 +157,12 @@ let
in
kaem.runCommand "${pname}-${version}"
{
inherit pname version;
inherit pname version meta;
nativeBuildInputs = [
tinycc.compiler
gnupatch
];
meta = {
description = "Tool to control the generation of non-source files from sources";
homepage = "https://www.gnu.org/software/make";
license = lib.licenses.gpl3Plus;
teams = [ lib.teams.minimal-bootstrap ];
mainProgram = "make";
platforms = lib.platforms.unix;
};
}
''
# Unpack
@@ -14,6 +14,7 @@
gzip,
}:
let
inherit (import ./common.nix { inherit lib; }) meta;
pname = "gnumake-musl";
version = "4.4.1";
@@ -33,7 +34,7 @@ let
in
bash.runCommand "${pname}-${version}"
{
inherit pname version;
inherit pname version meta;
nativeBuildInputs = [
tinycc.compiler
@@ -52,15 +53,6 @@ bash.runCommand "${pname}-${version}"
${result}/bin/make --version
mkdir $out
'';
meta = {
description = "Tool to control the generation of non-source files from sources";
homepage = "https://www.gnu.org/software/make";
license = lib.licenses.gpl3Plus;
teams = [ lib.teams.minimal-bootstrap ];
mainProgram = "make";
platforms = lib.platforms.unix;
};
}
''
# Unpack
@@ -0,0 +1,86 @@
{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
gcc,
musl,
binutils,
gnumake,
gnupatch,
gnused,
gnugrep,
gawk,
diffutils,
findutils,
gnutar,
gzip,
}:
let
inherit (import ./common.nix { inherit lib; }) meta;
pname = "gnumake-static";
version = "4.4.1";
src = fetchurl {
url = "mirror://gnu/make/make-${version}.tar.gz";
hash = "sha256-3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M=";
};
patches = [
# Replaces /bin/sh with sh, see patch file for reasoning
./0001-No-impure-bin-sh.patch
# Purity: don't look for library dependencies (of the form `-lfoo') in /lib
# and /usr/lib. It's a stupid feature anyway. Likewise, when searching for
# included Makefiles, don't look in /usr/include and friends.
./0002-remove-impure-dirs.patch
];
in
bash.runCommand "${pname}-${version}"
{
inherit pname version meta;
nativeBuildInputs = [
gcc
musl
binutils
gnumake
gnupatch
gnused
gnugrep
gawk
diffutils
findutils
gnutar
gzip
];
passthru.tests.get-version =
result:
bash.runCommand "${pname}-get-version-${version}" { } ''
${result}/bin/make --version
mkdir $out
'';
}
''
# Unpack
tar xf ${src}
cd make-${version}
# Patch
${lib.concatMapStringsSep "\n" (f: "patch -Np1 -i ${f}") patches}
# Configure
bash ./configure \
--prefix=$out \
--build=${buildPlatform.config} \
--host=${hostPlatform.config} \
CC=musl-gcc \
CFLAGS=-static
# Build
make -j $NIX_BUILD_CORES
# Install
make -j $NIX_BUILD_CORES install
''