minimal-bootstrap.busybox-static: drop
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
Allow BusyBox to be invoked as "<something>-busybox". This is
|
||||
necessary when it's run from the Nix store as <hash>-busybox during
|
||||
stdenv bootstrap.
|
||||
--- a/libbb/appletlib.c
|
||||
+++ b/libbb/appletlib.c
|
||||
@@ -947,7 +947,7 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **ar
|
||||
static NORETURN void run_applet_and_exit(const char *name, char **argv)
|
||||
{
|
||||
# if ENABLE_BUSYBOX
|
||||
- if (is_prefixed_with(name, "busybox"))
|
||||
+ if (strstr(name, "busybox") != 0)
|
||||
exit(busybox_main(/*unused:*/ 0, argv));
|
||||
# endif
|
||||
# if NUM_APPLETS > 0
|
||||
@@ -1045,7 +1045,7 @@ int main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv));
|
||||
# if !ENABLE_BUSYBOX
|
||||
- if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox"))
|
||||
+ if (argv[1] && strstr(bb_basename(argv[0]), "busybox") != 0)
|
||||
argv++;
|
||||
# endif
|
||||
applet_name = argv[0];
|
||||
@@ -1,92 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
fetchurl,
|
||||
bash,
|
||||
gcc,
|
||||
musl,
|
||||
binutils,
|
||||
linux-headers,
|
||||
gnumake,
|
||||
gnupatch,
|
||||
gnused,
|
||||
gnugrep,
|
||||
gawk,
|
||||
diffutils,
|
||||
findutils,
|
||||
gnutar,
|
||||
bzip2,
|
||||
}:
|
||||
let
|
||||
pname = "busybox-static";
|
||||
version = "1.36.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://busybox.net/downloads/busybox-${version}.tar.bz2";
|
||||
hash = "sha256-uMwkyVdNgJ5yecO+NJeVxdXOtv3xnKcJ+AzeUOR94xQ=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./busybox-in-store.patch
|
||||
];
|
||||
|
||||
busyboxConfig = [
|
||||
"CC=musl-gcc"
|
||||
"HOSTCC=musl-gcc"
|
||||
"CFLAGS=-I${linux-headers}/include"
|
||||
"KCONFIG_NOTIMESTAMP=y"
|
||||
"CONFIG_PREFIX=${placeholder "out"}"
|
||||
"CONFIG_STATIC=y"
|
||||
];
|
||||
in
|
||||
bash.runCommand "${pname}-${version}"
|
||||
{
|
||||
inherit pname version;
|
||||
|
||||
nativeBuildInputs = [
|
||||
gcc
|
||||
musl
|
||||
binutils
|
||||
gnumake
|
||||
gnupatch
|
||||
gnused
|
||||
gnugrep
|
||||
gawk
|
||||
diffutils
|
||||
findutils
|
||||
gnutar
|
||||
bzip2
|
||||
];
|
||||
|
||||
passthru.tests.get-version =
|
||||
result:
|
||||
bash.runCommand "${pname}-get-version-${version}" { } ''
|
||||
${result}
|
||||
mkdir $out
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Tiny versions of common UNIX utilities in a single small executable";
|
||||
homepage = "https://busybox.net/";
|
||||
license = lib.licenses.gpl2Only;
|
||||
platforms = lib.platforms.linux;
|
||||
teams = [ lib.teams.minimal-bootstrap ];
|
||||
};
|
||||
}
|
||||
''
|
||||
# Unpack
|
||||
tar xf ${src}
|
||||
cd busybox-${version}
|
||||
|
||||
# Patch
|
||||
${lib.concatMapStringsSep "\n" (f: "patch -Np1 -i ${f}") patches}
|
||||
|
||||
# Configure
|
||||
BUSYBOX_FLAGS="${lib.concatStringsSep " " busyboxConfig}"
|
||||
make -j $NIX_BUILD_CORES $BUSYBOX_FLAGS defconfig
|
||||
|
||||
# Build
|
||||
make -j $NIX_BUILD_CORES $BUSYBOX_FLAGS
|
||||
|
||||
# Install
|
||||
cp busybox $out
|
||||
''
|
||||
@@ -71,12 +71,6 @@ lib.makeScope
|
||||
gnutar = gnutar-latest;
|
||||
};
|
||||
|
||||
busybox-static = callPackage ./busybox/static.nix {
|
||||
gcc = gcc-latest;
|
||||
gnumake = gnumake-musl;
|
||||
gnutar = gnutar-latest;
|
||||
};
|
||||
|
||||
bzip2 = callPackage ./bzip2 {
|
||||
tinycc = tinycc-musl;
|
||||
gnumake = gnumake-musl;
|
||||
@@ -376,7 +370,6 @@ lib.makeScope
|
||||
echo ${binutils.tests.get-version}
|
||||
echo ${binutils-static.tests.get-version}
|
||||
echo ${bison.tests.get-version}
|
||||
echo ${busybox-static.tests.get-version}
|
||||
echo ${bzip2.tests.get-version}
|
||||
echo ${bzip2-static.tests.get-version}
|
||||
echo ${coreutils-musl.tests.get-version}
|
||||
|
||||
Reference in New Issue
Block a user