mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
minimal-bootstrap.gnumake: rebuild with musl
This commit is contained in:
parent
114d57a054
commit
109ba06491
@ -87,6 +87,13 @@ lib.makeScope
|
||||
|
||||
gnumake = callPackage ./gnumake { tinycc = tinycc-mes; };
|
||||
|
||||
gnumake-musl = callPackage ./gnumake/musl.nix {
|
||||
bash = bash_2_05;
|
||||
tinycc = tinycc-musl;
|
||||
gawk = gawk-mes;
|
||||
gnumakeBoot = gnumake;
|
||||
};
|
||||
|
||||
gnupatch = callPackage ./gnupatch { tinycc = tinycc-mes; };
|
||||
|
||||
gnused = callPackage ./gnused {
|
||||
|
82
pkgs/os-specific/linux/minimal-bootstrap/gnumake/musl.nix
Normal file
82
pkgs/os-specific/linux/minimal-bootstrap/gnumake/musl.nix
Normal file
@ -0,0 +1,82 @@
|
||||
{ lib
|
||||
, buildPlatform
|
||||
, hostPlatform
|
||||
, fetchurl
|
||||
, bash
|
||||
, tinycc
|
||||
, gnumakeBoot
|
||||
, gnupatch
|
||||
, gnused
|
||||
, gnugrep
|
||||
, gawk
|
||||
, gnutar
|
||||
, gzip
|
||||
}:
|
||||
let
|
||||
pname = "gnumake";
|
||||
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;
|
||||
|
||||
nativeBuildInputs = [
|
||||
tinycc.compiler
|
||||
gnumakeBoot
|
||||
gnupatch
|
||||
gnused
|
||||
gnugrep
|
||||
gawk
|
||||
gnutar
|
||||
gzip
|
||||
];
|
||||
|
||||
passthru.tests.get-version = result:
|
||||
bash.runCommand "${pname}-get-version-${version}" {} ''
|
||||
${result}/bin/make --version
|
||||
mkdir $out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A tool to control the generation of non-source files from sources";
|
||||
homepage = "https://www.gnu.org/software/make";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = teams.minimal-bootstrap.members;
|
||||
mainProgram = "make";
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
} ''
|
||||
# Unpack
|
||||
tar xzf ${src}
|
||||
cd make-${version}
|
||||
|
||||
# Patch
|
||||
${lib.concatMapStringsSep "\n" (f: "patch -Np1 -i ${f}") patches}
|
||||
|
||||
# Configure
|
||||
export CC="tcc -B ${tinycc.libs}/lib"
|
||||
export LD=tcc
|
||||
bash ./configure \
|
||||
--prefix=$out \
|
||||
--build=${buildPlatform.config} \
|
||||
--host=${hostPlatform.config}
|
||||
|
||||
# Build
|
||||
make AR="tcc -ar"
|
||||
|
||||
# Install
|
||||
make install
|
||||
''
|
Loading…
Reference in New Issue
Block a user