From e336b7c768c5196244b05a12e0149af4d901b532 Mon Sep 17 00:00:00 2001 From: Emily Trau Date: Mon, 9 Oct 2023 21:40:19 -0700 Subject: [PATCH] minimal-bootstrap.gnused-static: init at 4.9 --- .../linux/minimal-bootstrap/default.nix | 7 ++ .../linux/minimal-bootstrap/gnused/static.nix | 72 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 pkgs/os-specific/linux/minimal-bootstrap/gnused/static.nix diff --git a/pkgs/os-specific/linux/minimal-bootstrap/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/default.nix index d96df87c32bc..94e4a5176154 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/default.nix @@ -189,6 +189,12 @@ lib.makeScope tinycc = tinycc-bootstrappable; }; + gnused-static = callPackage ./gnused/static.nix { + gcc = gcc-latest; + gnumake = gnumake-musl; + gnutar = gnutar-latest; + }; + gnutar = callPackage ./gnutar/mes.nix { bash = bash_2_05; tinycc = tinycc-mes; @@ -337,6 +343,7 @@ lib.makeScope echo ${gnum4.tests.get-version} echo ${gnused.tests.get-version} echo ${gnused-mes.tests.get-version} + echo ${gnused-static.tests.get-version} echo ${gnutar.tests.get-version} echo ${gnutar-latest.tests.get-version} echo ${gnutar-musl.tests.get-version} diff --git a/pkgs/os-specific/linux/minimal-bootstrap/gnused/static.nix b/pkgs/os-specific/linux/minimal-bootstrap/gnused/static.nix new file mode 100644 index 000000000000..ef6d510ce804 --- /dev/null +++ b/pkgs/os-specific/linux/minimal-bootstrap/gnused/static.nix @@ -0,0 +1,72 @@ +{ + lib, + buildPlatform, + hostPlatform, + fetchurl, + bash, + gcc, + musl, + binutils, + gnumake, + gnused, + gnugrep, + gawk, + diffutils, + findutils, + gnutar, + xz, +}: +let + inherit (import ./common.nix { inherit lib; }) meta; + pname = "gnused-static"; + version = "4.9"; + + src = fetchurl { + url = "mirror://gnu/sed/sed-${version}.tar.xz"; + hash = "sha256-biJrcy4c1zlGStaGK9Ghq6QteYKSLaelNRljHSSXUYE="; + }; +in +bash.runCommand "${pname}-${version}" + { + inherit pname version meta; + + nativeBuildInputs = [ + gcc + musl + binutils + gnumake + gnused + gnugrep + gawk + diffutils + findutils + gnutar + xz + ]; + + passthru.tests.get-version = + result: + bash.runCommand "${pname}-get-version-${version}" { } '' + ${result}/bin/sed --version + mkdir $out + ''; + } + '' + # Unpack + tar xf ${src} + cd sed-${version} + + # 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 + ''