musl builds of gawk, gnumake, gnutar
This commit is contained in:
parent
dcbe11025b
commit
240b30723f
|
@ -118,7 +118,7 @@ in {
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.mes.compiler.package
|
||||||
stage1.gnumake.package
|
stage1.gnumake.boot.package
|
||||||
stage1.gnupatch.package
|
stage1.gnupatch.package
|
||||||
stage1.coreutils.boot.package
|
stage1.coreutils.boot.package
|
||||||
];
|
];
|
||||||
|
|
|
@ -98,7 +98,7 @@ in {
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.mes.compiler.package
|
||||||
stage1.gnumake.package
|
stage1.gnumake.boot.package
|
||||||
stage1.gnupatch.package
|
stage1.gnupatch.package
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,15 @@
|
||||||
stage1 = config.aux.foundation.stages.stage1;
|
stage1 = config.aux.foundation.stages.stage1;
|
||||||
in {
|
in {
|
||||||
includes = [
|
includes = [
|
||||||
# These packages are built using Kaem.
|
|
||||||
./nyacc
|
./nyacc
|
||||||
./mes
|
./mes
|
||||||
./ln-boot
|
./ln-boot
|
||||||
./tinycc # With the exception of `tinycc-musl` which uses Bash.
|
./tinycc
|
||||||
./gnupatch
|
./gnupatch
|
||||||
./gnumake
|
./gnumake
|
||||||
./coreutils
|
./coreutils
|
||||||
./bash
|
./bash
|
||||||
|
|
||||||
# These packages are built using Bash v2.
|
|
||||||
./gnused
|
./gnused
|
||||||
./gnugrep
|
./gnugrep
|
||||||
./gnutar
|
./gnutar
|
||||||
|
@ -29,6 +27,7 @@ in {
|
||||||
config = {
|
config = {
|
||||||
exports = {
|
exports = {
|
||||||
packages = {
|
packages = {
|
||||||
|
# These packages are built using Kaem.
|
||||||
stage1-nyacc = stage1.nyacc.package;
|
stage1-nyacc = stage1.nyacc.package;
|
||||||
stage1-mes = stage1.mes.compiler.package;
|
stage1-mes = stage1.mes.compiler.package;
|
||||||
stage1-mes-libs = stage1.mes.libs.package;
|
stage1-mes-libs = stage1.mes.libs.package;
|
||||||
|
@ -39,10 +38,11 @@ in {
|
||||||
stage1-tinycc-mes = stage1.tinycc.mes.compiler.package;
|
stage1-tinycc-mes = stage1.tinycc.mes.compiler.package;
|
||||||
stage1-tinycc-mes-libs = stage1.tinycc.mes.libs.package;
|
stage1-tinycc-mes-libs = stage1.tinycc.mes.libs.package;
|
||||||
stage1-gnupatch = stage1.gnupatch.package;
|
stage1-gnupatch = stage1.gnupatch.package;
|
||||||
stage1-gnumake = stage1.gnumake.package;
|
stage1-gnumake-boot = stage1.gnumake.boot.package;
|
||||||
stage1-coreutils-boot = stage1.coreutils.boot.package;
|
stage1-coreutils-boot = stage1.coreutils.boot.package;
|
||||||
stage1-bash-boot = stage1.bash.boot.package;
|
stage1-bash-boot = stage1.bash.boot.package;
|
||||||
|
|
||||||
|
# These packages are built using Bash v2.
|
||||||
stage1-gnused-boot = stage1.gnused.boot.package;
|
stage1-gnused-boot = stage1.gnused.boot.package;
|
||||||
stage1-gnugrep = stage1.gnugrep.package;
|
stage1-gnugrep = stage1.gnugrep.package;
|
||||||
stage1-gnutar-boot = stage1.gnutar.boot.package;
|
stage1-gnutar-boot = stage1.gnutar.boot.package;
|
||||||
|
@ -51,6 +51,10 @@ in {
|
||||||
stage1-tinycc-musl = stage1.tinycc.musl.compiler.package;
|
stage1-tinycc-musl = stage1.tinycc.musl.compiler.package;
|
||||||
stage1-tinycc-musl-libs = stage1.tinycc.musl.libs.package;
|
stage1-tinycc-musl-libs = stage1.tinycc.musl.libs.package;
|
||||||
stage1-gawk-boot = stage1.gawk.boot.package;
|
stage1-gawk-boot = stage1.gawk.boot.package;
|
||||||
|
stage1-gnused = stage1.gnused.package;
|
||||||
|
stage1-gnumake = stage1.gnumake.package;
|
||||||
|
stage1-gnutar-musl = stage1.gnutar.musl.package;
|
||||||
|
stage1-gawk = stage1.gawk.package;
|
||||||
};
|
};
|
||||||
|
|
||||||
extras = {
|
extras = {
|
||||||
|
|
|
@ -48,7 +48,7 @@ in {
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.mes.compiler.package
|
||||||
stage1.gnumake.package
|
stage1.gnumake.boot.package
|
||||||
stage1.gnused.boot.package
|
stage1.gnused.boot.package
|
||||||
stage1.gnugrep.package
|
stage1.gnugrep.package
|
||||||
stage1.gnupatch.package
|
stage1.gnupatch.package
|
||||||
|
|
|
@ -4,15 +4,31 @@
|
||||||
}: let
|
}: let
|
||||||
cfg = config.aux.foundation.stages.stage1.gawk;
|
cfg = config.aux.foundation.stages.stage1.gawk;
|
||||||
|
|
||||||
|
platform = config.aux.platform;
|
||||||
builders = config.aux.foundation.builders;
|
builders = config.aux.foundation.builders;
|
||||||
|
|
||||||
stage1 = config.aux.foundation.stages.gawk;
|
stage1 = config.aux.foundation.stages.stage1;
|
||||||
in {
|
in {
|
||||||
includes = [
|
includes = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.aux.foundation.stages.stage1.gawk = {
|
options.aux.foundation.stages.stage1.gawk = {
|
||||||
|
package = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "The package to use for gawk.";
|
||||||
|
};
|
||||||
|
|
||||||
|
version = lib.options.create {
|
||||||
|
type = lib.types.string;
|
||||||
|
description = "Version of the package.";
|
||||||
|
};
|
||||||
|
|
||||||
|
src = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "Source for the package.";
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = lib.options.create {
|
description = lib.options.create {
|
||||||
type = lib.types.string;
|
type = lib.types.string;
|
||||||
|
@ -46,4 +62,52 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
aux.foundation.stages.stage1.gawk = {
|
||||||
|
version = "5.2.2";
|
||||||
|
|
||||||
|
src = builtins.fetchurl {
|
||||||
|
url = "https://ftpmirror.gnu.org/gawk/gawk-${cfg.version}.tar.gz";
|
||||||
|
sha256 = "lFrvfM/xAfILIqEIArwAXplKsrjqPnJMwaGXxi9B9lA=";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = builders.bash.boot.build {
|
||||||
|
name = "gawk-${cfg.version}";
|
||||||
|
|
||||||
|
meta = cfg.meta;
|
||||||
|
|
||||||
|
deps.build.host = [
|
||||||
|
stage1.tinycc.musl.compiler.package
|
||||||
|
stage1.gnumake.package
|
||||||
|
stage1.gnused.package
|
||||||
|
stage1.gnugrep.package
|
||||||
|
stage1.gnutar.musl.package
|
||||||
|
stage1.gzip.package
|
||||||
|
stage1.gawk.boot.package
|
||||||
|
];
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
# Unpack
|
||||||
|
tar xzf ${cfg.src}
|
||||||
|
cd gawk-${cfg.version}
|
||||||
|
|
||||||
|
# Configure
|
||||||
|
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
|
||||||
|
export AR="tcc -ar"
|
||||||
|
export LD=tcc
|
||||||
|
bash ./configure \
|
||||||
|
--prefix=$out \
|
||||||
|
--build=${platform.build} \
|
||||||
|
--host=${platform.host}
|
||||||
|
|
||||||
|
# Build
|
||||||
|
make -j $NIX_BUILD_CORES
|
||||||
|
|
||||||
|
# Install
|
||||||
|
make -j $NIX_BUILD_CORES install
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ in {
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.mes.compiler.package
|
||||||
stage1.gnumake.package
|
stage1.gnumake.boot.package
|
||||||
];
|
];
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
|
|
234
foundation/src/stages/stage1/gnumake/boot.nix
Normal file
234
foundation/src/stages/stage1/gnumake/boot.nix
Normal file
|
@ -0,0 +1,234 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
}: let
|
||||||
|
cfg = config.aux.foundation.stages.stage1.gnumake.boot;
|
||||||
|
|
||||||
|
builders = config.aux.foundation.builders;
|
||||||
|
|
||||||
|
stage1 = config.aux.foundation.stages.stage1;
|
||||||
|
in {
|
||||||
|
options.aux.foundation.stages.stage1.gnumake.boot = {
|
||||||
|
package = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "The package to use for gnumake.";
|
||||||
|
};
|
||||||
|
|
||||||
|
version = lib.options.create {
|
||||||
|
type = lib.types.string;
|
||||||
|
description = "Version of the package.";
|
||||||
|
};
|
||||||
|
|
||||||
|
src = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "Source for the package.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
aux.foundation.stages.stage1.gnumake.boot = {
|
||||||
|
version = "4.4.1";
|
||||||
|
|
||||||
|
src = builtins.fetchurl {
|
||||||
|
url = "https://ftpmirror.gnu.org/make/make-${cfg.version}.tar.gz";
|
||||||
|
sha256 = "1cwgcmwdn7gqn5da2ia91gkyiqs9birr10sy5ykpkaxzcwfzn5nx";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = let
|
||||||
|
patches = [
|
||||||
|
# Replaces /bin/sh with sh, see patch file for reasoning
|
||||||
|
./patches/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.
|
||||||
|
./patches/0002-remove-impure-dirs.patch
|
||||||
|
# Fixes for tinycc. See comments in patch file for reasoning
|
||||||
|
./patches/0003-tinycc-support.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
/*
|
||||||
|
Maintenance notes:
|
||||||
|
|
||||||
|
Generated by
|
||||||
|
./configure \
|
||||||
|
--build i686-pc-linux-gnu \
|
||||||
|
--host i686-pc-linux-gnu \
|
||||||
|
CC="${tinycc.compiler}/bin/tcc -B ${tinycc.libs}/lib" \
|
||||||
|
ac_cv_func_dup=no
|
||||||
|
- `ac_cv_func_dup` disabled as mes-libc doesn't implement tmpfile()
|
||||||
|
|
||||||
|
The output src/config.h was then manually filtered, removing definitions that
|
||||||
|
didn't have uses in the source code
|
||||||
|
*/
|
||||||
|
config = [
|
||||||
|
"-DFILE_TIMESTAMP_HI_RES=0"
|
||||||
|
"-DHAVE_ALLOCA"
|
||||||
|
"-DHAVE_ALLOCA_H"
|
||||||
|
"-DHAVE_ATEXIT"
|
||||||
|
"-DHAVE_DECL_BSD_SIGNAL=0"
|
||||||
|
"-DHAVE_DECL_GETLOADAVG=0"
|
||||||
|
"-DHAVE_DECL_SYS_SIGLIST=0"
|
||||||
|
"-DHAVE_DECL__SYS_SIGLIST=0"
|
||||||
|
"-DHAVE_DECL___SYS_SIGLIST=0"
|
||||||
|
"-DHAVE_DIRENT_H"
|
||||||
|
"-DHAVE_DUP2"
|
||||||
|
"-DHAVE_FCNTL_H"
|
||||||
|
"-DHAVE_FDOPEN"
|
||||||
|
"-DHAVE_GETCWD"
|
||||||
|
"-DHAVE_GETTIMEOFDAY"
|
||||||
|
"-DHAVE_INTTYPES_H"
|
||||||
|
"-DHAVE_ISATTY"
|
||||||
|
"-DHAVE_LIMITS_H"
|
||||||
|
"-DHAVE_LOCALE_H"
|
||||||
|
"-DHAVE_MEMORY_H"
|
||||||
|
"-DHAVE_MKTEMP"
|
||||||
|
"-DHAVE_SA_RESTART"
|
||||||
|
"-DHAVE_SETVBUF"
|
||||||
|
"-DHAVE_SIGACTION"
|
||||||
|
"-DHAVE_SIGSETMASK"
|
||||||
|
"-DHAVE_STDINT_H"
|
||||||
|
"-DHAVE_STDLIB_H"
|
||||||
|
"-DHAVE_STRDUP"
|
||||||
|
"-DHAVE_STRERROR"
|
||||||
|
"-DHAVE_STRINGS_H"
|
||||||
|
"-DHAVE_STRING_H"
|
||||||
|
"-DHAVE_STRTOLL"
|
||||||
|
"-DHAVE_SYS_FILE_H"
|
||||||
|
"-DHAVE_SYS_PARAM_H"
|
||||||
|
"-DHAVE_SYS_RESOURCE_H"
|
||||||
|
"-DHAVE_SYS_SELECT_H"
|
||||||
|
"-DHAVE_SYS_STAT_H"
|
||||||
|
"-DHAVE_SYS_TIMEB_H"
|
||||||
|
"-DHAVE_SYS_TIME_H"
|
||||||
|
"-DHAVE_SYS_WAIT_H"
|
||||||
|
"-DHAVE_TTYNAME"
|
||||||
|
"-DHAVE_UMASK"
|
||||||
|
"-DHAVE_UNISTD_H"
|
||||||
|
"-DHAVE_WAITPID"
|
||||||
|
"-DMAKE_JOBSERVER"
|
||||||
|
"-DMAKE_SYMLINKS"
|
||||||
|
"-DPATH_SEPARATOR_CHAR=':'"
|
||||||
|
"-DSCCS_GET=\\\"get\\\""
|
||||||
|
"-DSTDC_HEADERS"
|
||||||
|
"-Dsig_atomic_t=int"
|
||||||
|
"-Dvfork=fork"
|
||||||
|
];
|
||||||
|
|
||||||
|
cflags =
|
||||||
|
[
|
||||||
|
"-I./src"
|
||||||
|
"-I./lib"
|
||||||
|
"-DHAVE_CONFIG_H"
|
||||||
|
"-DMAKE_MAINTAINER_MODE"
|
||||||
|
"-DLIBDIR=\\\"${builtins.placeholder "out"}/lib\\\""
|
||||||
|
"-DLOCALEDIR=\\\"/fake-locale\\\""
|
||||||
|
"-DPOSIX=1"
|
||||||
|
# mes-libc doesn't implement osync_* methods
|
||||||
|
"-DNO_OUTPUT_SYNC=1"
|
||||||
|
# mes-libc doesn't define O_TMPFILE
|
||||||
|
"-DO_TMPFILE=020000000"
|
||||||
|
]
|
||||||
|
++ config;
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
# Maintenance note: list of source files derived from Basic.mk
|
||||||
|
make = [
|
||||||
|
"src/ar.c"
|
||||||
|
"src/arscan.c"
|
||||||
|
"src/commands.c"
|
||||||
|
"src/default.c"
|
||||||
|
"src/dir.c"
|
||||||
|
"src/expand.c"
|
||||||
|
"src/file.c"
|
||||||
|
"src/function.c"
|
||||||
|
"src/getopt.c"
|
||||||
|
"src/getopt1.c"
|
||||||
|
"src/guile.c"
|
||||||
|
"src/hash.c"
|
||||||
|
"src/implicit.c"
|
||||||
|
"src/job.c"
|
||||||
|
"src/load.c"
|
||||||
|
"src/loadapi.c"
|
||||||
|
"src/main.c"
|
||||||
|
"src/misc.c"
|
||||||
|
"src/output.c"
|
||||||
|
"src/read.c"
|
||||||
|
"src/remake.c"
|
||||||
|
"src/rule.c"
|
||||||
|
"src/shuffle.c"
|
||||||
|
"src/signame.c"
|
||||||
|
"src/strcache.c"
|
||||||
|
"src/variable.c"
|
||||||
|
"src/version.c"
|
||||||
|
"src/vpath.c"
|
||||||
|
];
|
||||||
|
glob = [
|
||||||
|
"lib/fnmatch.c"
|
||||||
|
"lib/glob.c"
|
||||||
|
];
|
||||||
|
remote = [
|
||||||
|
"src/remote-stub.c"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
files =
|
||||||
|
sources.make
|
||||||
|
++ sources.glob
|
||||||
|
++ sources.remote
|
||||||
|
++ [
|
||||||
|
"src/posixos.c"
|
||||||
|
];
|
||||||
|
|
||||||
|
objects =
|
||||||
|
builtins.map
|
||||||
|
(
|
||||||
|
value:
|
||||||
|
builtins.replaceStrings [".c"] [".o"]
|
||||||
|
(builtins.baseNameOf value)
|
||||||
|
)
|
||||||
|
files;
|
||||||
|
in
|
||||||
|
builders.kaem.build {
|
||||||
|
name = "gnumake-${cfg.version}";
|
||||||
|
|
||||||
|
meta = stage1.gnumake.meta;
|
||||||
|
|
||||||
|
deps.build.host = [
|
||||||
|
stage1.tinycc.mes.compiler.package
|
||||||
|
stage1.gnupatch.package
|
||||||
|
];
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
# Unpack
|
||||||
|
ungz --file ${cfg.src} --output make.tar
|
||||||
|
untar --file make.tar
|
||||||
|
rm make.tar
|
||||||
|
cd make-${cfg.version}
|
||||||
|
|
||||||
|
# Patch
|
||||||
|
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
|
||||||
|
|
||||||
|
# Configure
|
||||||
|
catm src/config.h src/mkconfig.h src/mkcustom.h
|
||||||
|
cp lib/glob.in.h lib/glob.h
|
||||||
|
cp lib/fnmatch.in.h lib/fnmatch.h
|
||||||
|
|
||||||
|
# Compile
|
||||||
|
alias CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib ${builtins.concatStringsSep " " cflags}"
|
||||||
|
${lib.strings.concatMapSep "\n" (file: "CC -c ${file}") files}
|
||||||
|
|
||||||
|
# Link
|
||||||
|
CC -o make ${builtins.concatStringsSep " " objects}
|
||||||
|
|
||||||
|
# Check
|
||||||
|
./make --version
|
||||||
|
|
||||||
|
# Install
|
||||||
|
mkdir -p ''${out}/bin
|
||||||
|
cp ./make ''${out}/bin
|
||||||
|
chmod 555 ''${out}/bin/make
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -4,10 +4,15 @@
|
||||||
}: let
|
}: let
|
||||||
cfg = config.aux.foundation.stages.stage1.gnumake;
|
cfg = config.aux.foundation.stages.stage1.gnumake;
|
||||||
|
|
||||||
|
platform = config.aux.platform;
|
||||||
builders = config.aux.foundation.builders;
|
builders = config.aux.foundation.builders;
|
||||||
|
|
||||||
stage1 = config.aux.foundation.stages.stage1;
|
stage1 = config.aux.foundation.stages.stage1;
|
||||||
in {
|
in {
|
||||||
|
includes = [
|
||||||
|
./boot.nix
|
||||||
|
];
|
||||||
|
|
||||||
options.aux.foundation.stages.stage1.gnumake = {
|
options.aux.foundation.stages.stage1.gnumake = {
|
||||||
package = lib.options.create {
|
package = lib.options.create {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
|
@ -58,7 +63,7 @@ in {
|
||||||
|
|
||||||
src = builtins.fetchurl {
|
src = builtins.fetchurl {
|
||||||
url = "https://ftpmirror.gnu.org/make/make-${cfg.version}.tar.gz";
|
url = "https://ftpmirror.gnu.org/make/make-${cfg.version}.tar.gz";
|
||||||
sha256 = "1cwgcmwdn7gqn5da2ia91gkyiqs9birr10sy5ykpkaxzcwfzn5nx";
|
sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M=";
|
||||||
};
|
};
|
||||||
|
|
||||||
package = let
|
package = let
|
||||||
|
@ -69,192 +74,45 @@ in {
|
||||||
# and /usr/lib. It's a stupid feature anyway. Likewise, when searching for
|
# and /usr/lib. It's a stupid feature anyway. Likewise, when searching for
|
||||||
# included Makefiles, don't look in /usr/include and friends.
|
# included Makefiles, don't look in /usr/include and friends.
|
||||||
./patches/0002-remove-impure-dirs.patch
|
./patches/0002-remove-impure-dirs.patch
|
||||||
# Fixes for tinycc. See comments in patch file for reasoning
|
|
||||||
./patches/0003-tinycc-support.patch
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
|
||||||
Maintenance notes:
|
|
||||||
|
|
||||||
Generated by
|
|
||||||
./configure \
|
|
||||||
--build i686-pc-linux-gnu \
|
|
||||||
--host i686-pc-linux-gnu \
|
|
||||||
CC="${tinycc.compiler}/bin/tcc -B ${tinycc.libs}/lib" \
|
|
||||||
ac_cv_func_dup=no
|
|
||||||
- `ac_cv_func_dup` disabled as mes-libc doesn't implement tmpfile()
|
|
||||||
|
|
||||||
The output src/config.h was then manually filtered, removing definitions that
|
|
||||||
didn't have uses in the source code
|
|
||||||
*/
|
|
||||||
config = [
|
|
||||||
"-DFILE_TIMESTAMP_HI_RES=0"
|
|
||||||
"-DHAVE_ALLOCA"
|
|
||||||
"-DHAVE_ALLOCA_H"
|
|
||||||
"-DHAVE_ATEXIT"
|
|
||||||
"-DHAVE_DECL_BSD_SIGNAL=0"
|
|
||||||
"-DHAVE_DECL_GETLOADAVG=0"
|
|
||||||
"-DHAVE_DECL_SYS_SIGLIST=0"
|
|
||||||
"-DHAVE_DECL__SYS_SIGLIST=0"
|
|
||||||
"-DHAVE_DECL___SYS_SIGLIST=0"
|
|
||||||
"-DHAVE_DIRENT_H"
|
|
||||||
"-DHAVE_DUP2"
|
|
||||||
"-DHAVE_FCNTL_H"
|
|
||||||
"-DHAVE_FDOPEN"
|
|
||||||
"-DHAVE_GETCWD"
|
|
||||||
"-DHAVE_GETTIMEOFDAY"
|
|
||||||
"-DHAVE_INTTYPES_H"
|
|
||||||
"-DHAVE_ISATTY"
|
|
||||||
"-DHAVE_LIMITS_H"
|
|
||||||
"-DHAVE_LOCALE_H"
|
|
||||||
"-DHAVE_MEMORY_H"
|
|
||||||
"-DHAVE_MKTEMP"
|
|
||||||
"-DHAVE_SA_RESTART"
|
|
||||||
"-DHAVE_SETVBUF"
|
|
||||||
"-DHAVE_SIGACTION"
|
|
||||||
"-DHAVE_SIGSETMASK"
|
|
||||||
"-DHAVE_STDINT_H"
|
|
||||||
"-DHAVE_STDLIB_H"
|
|
||||||
"-DHAVE_STRDUP"
|
|
||||||
"-DHAVE_STRERROR"
|
|
||||||
"-DHAVE_STRINGS_H"
|
|
||||||
"-DHAVE_STRING_H"
|
|
||||||
"-DHAVE_STRTOLL"
|
|
||||||
"-DHAVE_SYS_FILE_H"
|
|
||||||
"-DHAVE_SYS_PARAM_H"
|
|
||||||
"-DHAVE_SYS_RESOURCE_H"
|
|
||||||
"-DHAVE_SYS_SELECT_H"
|
|
||||||
"-DHAVE_SYS_STAT_H"
|
|
||||||
"-DHAVE_SYS_TIMEB_H"
|
|
||||||
"-DHAVE_SYS_TIME_H"
|
|
||||||
"-DHAVE_SYS_WAIT_H"
|
|
||||||
"-DHAVE_TTYNAME"
|
|
||||||
"-DHAVE_UMASK"
|
|
||||||
"-DHAVE_UNISTD_H"
|
|
||||||
"-DHAVE_WAITPID"
|
|
||||||
"-DMAKE_JOBSERVER"
|
|
||||||
"-DMAKE_SYMLINKS"
|
|
||||||
"-DPATH_SEPARATOR_CHAR=':'"
|
|
||||||
"-DSCCS_GET=\\\"get\\\""
|
|
||||||
"-DSTDC_HEADERS"
|
|
||||||
"-Dsig_atomic_t=int"
|
|
||||||
"-Dvfork=fork"
|
|
||||||
];
|
|
||||||
|
|
||||||
cflags =
|
|
||||||
[
|
|
||||||
"-I./src"
|
|
||||||
"-I./lib"
|
|
||||||
"-DHAVE_CONFIG_H"
|
|
||||||
"-DMAKE_MAINTAINER_MODE"
|
|
||||||
"-DLIBDIR=\\\"${builtins.placeholder "out"}/lib\\\""
|
|
||||||
"-DLOCALEDIR=\\\"/fake-locale\\\""
|
|
||||||
"-DPOSIX=1"
|
|
||||||
# mes-libc doesn't implement osync_* methods
|
|
||||||
"-DNO_OUTPUT_SYNC=1"
|
|
||||||
# mes-libc doesn't define O_TMPFILE
|
|
||||||
"-DO_TMPFILE=020000000"
|
|
||||||
]
|
|
||||||
++ config;
|
|
||||||
|
|
||||||
sources = {
|
|
||||||
# Maintenance note: list of source files derived from Basic.mk
|
|
||||||
make = [
|
|
||||||
"src/ar.c"
|
|
||||||
"src/arscan.c"
|
|
||||||
"src/commands.c"
|
|
||||||
"src/default.c"
|
|
||||||
"src/dir.c"
|
|
||||||
"src/expand.c"
|
|
||||||
"src/file.c"
|
|
||||||
"src/function.c"
|
|
||||||
"src/getopt.c"
|
|
||||||
"src/getopt1.c"
|
|
||||||
"src/guile.c"
|
|
||||||
"src/hash.c"
|
|
||||||
"src/implicit.c"
|
|
||||||
"src/job.c"
|
|
||||||
"src/load.c"
|
|
||||||
"src/loadapi.c"
|
|
||||||
"src/main.c"
|
|
||||||
"src/misc.c"
|
|
||||||
"src/output.c"
|
|
||||||
"src/read.c"
|
|
||||||
"src/remake.c"
|
|
||||||
"src/rule.c"
|
|
||||||
"src/shuffle.c"
|
|
||||||
"src/signame.c"
|
|
||||||
"src/strcache.c"
|
|
||||||
"src/variable.c"
|
|
||||||
"src/version.c"
|
|
||||||
"src/vpath.c"
|
|
||||||
];
|
|
||||||
glob = [
|
|
||||||
"lib/fnmatch.c"
|
|
||||||
"lib/glob.c"
|
|
||||||
];
|
|
||||||
remote = [
|
|
||||||
"src/remote-stub.c"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
files =
|
|
||||||
sources.make
|
|
||||||
++ sources.glob
|
|
||||||
++ sources.remote
|
|
||||||
++ [
|
|
||||||
"src/posixos.c"
|
|
||||||
];
|
|
||||||
|
|
||||||
objects =
|
|
||||||
builtins.map
|
|
||||||
(
|
|
||||||
value:
|
|
||||||
builtins.replaceStrings [".c"] [".o"]
|
|
||||||
(builtins.baseNameOf value)
|
|
||||||
)
|
|
||||||
files;
|
|
||||||
in
|
in
|
||||||
builders.kaem.build {
|
builders.bash.boot.build {
|
||||||
name = "gnumake-${cfg.version}";
|
name = "gnumake-${cfg.version}";
|
||||||
|
|
||||||
meta = cfg.meta;
|
meta = cfg.meta;
|
||||||
src = cfg.src;
|
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.musl.compiler.package
|
||||||
|
stage1.gnumake.boot.package
|
||||||
stage1.gnupatch.package
|
stage1.gnupatch.package
|
||||||
|
stage1.gnused.package
|
||||||
|
stage1.gnugrep.package
|
||||||
|
stage1.gawk.boot.package
|
||||||
|
stage1.gnutar.boot.package
|
||||||
|
stage1.gzip.package
|
||||||
];
|
];
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
# Unpack
|
# Unpack
|
||||||
ungz --file ${cfg.src} --output make.tar
|
tar xzf ${cfg.src}
|
||||||
untar --file make.tar
|
|
||||||
rm make.tar
|
|
||||||
cd make-${cfg.version}
|
cd make-${cfg.version}
|
||||||
|
|
||||||
# Patch
|
# Patch
|
||||||
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
|
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
|
||||||
|
|
||||||
# Configure
|
# Configure
|
||||||
catm src/config.h src/mkconfig.h src/mkcustom.h
|
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
|
||||||
cp lib/glob.in.h lib/glob.h
|
export LD=tcc
|
||||||
cp lib/fnmatch.in.h lib/fnmatch.h
|
bash ./configure \
|
||||||
|
--prefix=$out \
|
||||||
|
--build=${platform.build} \
|
||||||
|
--host=${platform.host}
|
||||||
|
|
||||||
# Compile
|
# Build
|
||||||
alias CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib ${builtins.concatStringsSep " " cflags}"
|
make AR="tcc -ar"
|
||||||
${lib.strings.concatMapSep "\n" (file: "CC -c ${file}") files}
|
|
||||||
|
|
||||||
# Link
|
|
||||||
CC -o make ${builtins.concatStringsSep " " objects}
|
|
||||||
|
|
||||||
# Check
|
|
||||||
./make --version
|
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
mkdir -p ''${out}/bin
|
make install
|
||||||
cp ./make ''${out}/bin
|
|
||||||
chmod 555 ''${out}/bin/make
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,7 +49,7 @@ in {
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.mes.compiler.package
|
||||||
stage1.gnumake.package
|
stage1.gnumake.boot.package
|
||||||
];
|
];
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
|
|
|
@ -4,15 +4,31 @@
|
||||||
}: let
|
}: let
|
||||||
cfg = config.aux.foundation.stages.stage1.gnused;
|
cfg = config.aux.foundation.stages.stage1.gnused;
|
||||||
|
|
||||||
|
platform = config.aux.platform;
|
||||||
builders = config.aux.foundation.builders;
|
builders = config.aux.foundation.builders;
|
||||||
|
|
||||||
stage1 = config.aux.foundation.stages.gnused;
|
stage1 = config.aux.foundation.stages.stage1;
|
||||||
in {
|
in {
|
||||||
includes = [
|
includes = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.aux.foundation.stages.stage1.gnused = {
|
options.aux.foundation.stages.stage1.gnused = {
|
||||||
|
package = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "The package to use for gnumake.";
|
||||||
|
};
|
||||||
|
|
||||||
|
version = lib.options.create {
|
||||||
|
type = lib.types.string;
|
||||||
|
description = "Version of the package.";
|
||||||
|
};
|
||||||
|
|
||||||
|
src = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "Source for the package.";
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = lib.options.create {
|
description = lib.options.create {
|
||||||
type = lib.types.string;
|
type = lib.types.string;
|
||||||
|
@ -46,4 +62,53 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
aux.foundation.stages.stage1.gnused = {
|
||||||
|
version = "4.2";
|
||||||
|
|
||||||
|
src = builtins.fetchurl {
|
||||||
|
url = "https://ftpmirror.gnu.org/sed/sed-${cfg.version}.tar.gz";
|
||||||
|
sha256 = "20XNY/0BDmUFN9ZdXfznaJplJ0UjZgbl5ceCk3Jn2YM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = builders.bash.boot.build {
|
||||||
|
name = "gnused-${cfg.version}";
|
||||||
|
|
||||||
|
meta = cfg.meta;
|
||||||
|
|
||||||
|
deps.build.host = [
|
||||||
|
stage1.tinycc.musl.compiler.package
|
||||||
|
stage1.gnumake.boot.package
|
||||||
|
stage1.gnused.boot.package
|
||||||
|
stage1.gnugrep.package
|
||||||
|
stage1.gnutar.boot.package
|
||||||
|
stage1.gzip.package
|
||||||
|
];
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
# Unpack
|
||||||
|
tar xzf ${cfg.src}
|
||||||
|
cd sed-${cfg.version}
|
||||||
|
|
||||||
|
# Configure
|
||||||
|
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
|
||||||
|
export LD=tcc
|
||||||
|
./configure \
|
||||||
|
--build=${platform.build} \
|
||||||
|
--host=${platform.host} \
|
||||||
|
--disable-shared \
|
||||||
|
--disable-nls \
|
||||||
|
--disable-dependency-tracking \
|
||||||
|
--prefix=$out
|
||||||
|
|
||||||
|
# Build
|
||||||
|
make AR="tcc -ar"
|
||||||
|
|
||||||
|
# Install
|
||||||
|
make install
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ in {
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.mes.compiler.package
|
||||||
stage1.gnumake.package
|
stage1.gnumake.boot.package
|
||||||
stage1.gnused.boot.package
|
stage1.gnused.boot.package
|
||||||
stage1.gnugrep.package
|
stage1.gnugrep.package
|
||||||
];
|
];
|
||||||
|
|
|
@ -4,15 +4,32 @@
|
||||||
}: let
|
}: let
|
||||||
cfg = config.aux.foundation.stages.stage1.gnutar;
|
cfg = config.aux.foundation.stages.stage1.gnutar;
|
||||||
|
|
||||||
|
platform = config.aux.platform;
|
||||||
builders = config.aux.foundation.builders;
|
builders = config.aux.foundation.builders;
|
||||||
|
|
||||||
stage1 = config.aux.foundation.stages.gnutar;
|
stage1 = config.aux.foundation.stages.stage1;
|
||||||
in {
|
in {
|
||||||
includes = [
|
includes = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
|
./musl.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.aux.foundation.stages.stage1.gnutar = {
|
options.aux.foundation.stages.stage1.gnutar = {
|
||||||
|
package = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "The package to use for gnutar.";
|
||||||
|
};
|
||||||
|
|
||||||
|
version = lib.options.create {
|
||||||
|
type = lib.types.string;
|
||||||
|
description = "Version of the package.";
|
||||||
|
};
|
||||||
|
|
||||||
|
src = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "Source for the package.";
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = lib.options.create {
|
description = lib.options.create {
|
||||||
type = lib.types.string;
|
type = lib.types.string;
|
||||||
|
@ -46,4 +63,55 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
aux.foundation.stages.stage1.gnutar = {
|
||||||
|
version = "1.12";
|
||||||
|
|
||||||
|
src = builtins.fetchurl {
|
||||||
|
url = "https://ftpmirror.gnu.org/tar/tar-${cfg.version}.tar.gz";
|
||||||
|
sha256 = "xsN+iIsTbM76uQPFEUn0t71lnWnUrqISRfYQU6V6pgo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = builders.bash.boot.build {
|
||||||
|
name = "gnutar-${cfg.version}";
|
||||||
|
|
||||||
|
meta = cfg.meta;
|
||||||
|
|
||||||
|
deps.build.host = [
|
||||||
|
stage1.tinycc.musl.compiler.package
|
||||||
|
stage1.gnumake.boot.package
|
||||||
|
stage1.gnused.boot.package
|
||||||
|
stage1.gnugrep.package
|
||||||
|
];
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
# Unpack
|
||||||
|
ungz --file ${cfg.src} --output tar.tar
|
||||||
|
untar --file tar.tar
|
||||||
|
rm tar.tar
|
||||||
|
cd tar-${cfg.version}
|
||||||
|
|
||||||
|
# Configure
|
||||||
|
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
|
||||||
|
export LD=tcc
|
||||||
|
export ac_cv_sizeof_unsigned_long=4
|
||||||
|
export ac_cv_sizeof_long_long=8
|
||||||
|
export ac_cv_header_netdb_h=no
|
||||||
|
bash ./configure \
|
||||||
|
--prefix=$out \
|
||||||
|
--build=${platform.build} \
|
||||||
|
--host=${platform.host} \
|
||||||
|
--disable-nls
|
||||||
|
|
||||||
|
# Build
|
||||||
|
make AR="tcc -ar"
|
||||||
|
|
||||||
|
# Install
|
||||||
|
make install
|
||||||
|
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
79
foundation/src/stages/stage1/gnutar/musl.nix
Normal file
79
foundation/src/stages/stage1/gnutar/musl.nix
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
}: let
|
||||||
|
cfg = config.aux.foundation.stages.stage1.gnutar.musl;
|
||||||
|
|
||||||
|
platform = config.aux.platform;
|
||||||
|
builders = config.aux.foundation.builders;
|
||||||
|
|
||||||
|
stage1 = config.aux.foundation.stages.stage1;
|
||||||
|
in {
|
||||||
|
options.aux.foundation.stages.stage1.gnutar.musl = {
|
||||||
|
package = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "The package to use for gnutar-musl.";
|
||||||
|
};
|
||||||
|
|
||||||
|
version = lib.options.create {
|
||||||
|
type = lib.types.string;
|
||||||
|
description = "Version of the package.";
|
||||||
|
};
|
||||||
|
|
||||||
|
src = lib.options.create {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "Source for the package.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
aux.foundation.stages.stage1.gnutar.musl = {
|
||||||
|
version = "1.12";
|
||||||
|
|
||||||
|
src = builtins.fetchurl {
|
||||||
|
url = "https://ftpmirror.gnu.org/tar/tar-${cfg.version}.tar.gz";
|
||||||
|
sha256 = "xsN+iIsTbM76uQPFEUn0t71lnWnUrqISRfYQU6V6pgo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
package = builders.bash.boot.build {
|
||||||
|
name = "gnutar-musl-${cfg.version}";
|
||||||
|
|
||||||
|
meta = stage1.gnutar.meta;
|
||||||
|
|
||||||
|
deps.build.host = [
|
||||||
|
stage1.tinycc.musl.compiler.package
|
||||||
|
stage1.gnumake.boot.package
|
||||||
|
stage1.gnused.boot.package
|
||||||
|
stage1.gnugrep.package
|
||||||
|
];
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
# Unpack
|
||||||
|
ungz --file ${cfg.src} --output tar.tar
|
||||||
|
untar --file tar.tar
|
||||||
|
rm tar.tar
|
||||||
|
cd tar-${cfg.version}
|
||||||
|
|
||||||
|
# Configure
|
||||||
|
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
|
||||||
|
export LD=tcc
|
||||||
|
export ac_cv_sizeof_unsigned_long=4
|
||||||
|
export ac_cv_sizeof_long_long=8
|
||||||
|
export ac_cv_header_netdb_h=no
|
||||||
|
bash ./configure \
|
||||||
|
--prefix=$out \
|
||||||
|
--build=${platform.build} \
|
||||||
|
--host=${platform.host} \
|
||||||
|
--disable-nls
|
||||||
|
|
||||||
|
# Build
|
||||||
|
make AR="tcc -ar"
|
||||||
|
|
||||||
|
# Install
|
||||||
|
make install
|
||||||
|
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -49,12 +49,6 @@ in {
|
||||||
description = "Platforms the package supports.";
|
description = "Platforms the package supports.";
|
||||||
default.value = ["x86_64-linux" "aarch64-linux" "i686-linux"];
|
default.value = ["x86_64-linux" "aarch64-linux" "i686-linux"];
|
||||||
};
|
};
|
||||||
|
|
||||||
mainProgram = lib.options.create {
|
|
||||||
type = lib.types.string;
|
|
||||||
description = "The main program of the package.";
|
|
||||||
default.value = "grep";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,7 +69,7 @@ in {
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.mes.compiler.package
|
||||||
stage1.gnumake.package
|
stage1.gnumake.boot.package
|
||||||
stage1.gnused.boot.package
|
stage1.gnused.boot.package
|
||||||
stage1.gnugrep.package
|
stage1.gnugrep.package
|
||||||
];
|
];
|
||||||
|
|
|
@ -88,7 +88,7 @@ in {
|
||||||
|
|
||||||
deps.build.host = [
|
deps.build.host = [
|
||||||
stage1.tinycc.mes.compiler.package
|
stage1.tinycc.mes.compiler.package
|
||||||
stage1.gnumake.package
|
stage1.gnumake.boot.package
|
||||||
stage1.gnused.boot.package
|
stage1.gnused.boot.package
|
||||||
stage1.gnugrep.package
|
stage1.gnugrep.package
|
||||||
stage1.gnupatch.package
|
stage1.gnupatch.package
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
builders = config.aux.foundation.builders;
|
builders = config.aux.foundation.builders;
|
||||||
|
|
||||||
stage1 = config.aux.foundation.stages.musl;
|
stage1 = config.aux.foundation.stages.stage1;
|
||||||
in {
|
in {
|
||||||
includes = [
|
includes = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
|
|
Loading…
Reference in a new issue