tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
minimal-bootstrap.coreutils-musl: init at 9.4
Emily Trau
2 years ago
a680950c
d73a8465
+81
2 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
minimal-bootstrap
coreutils
musl.nix
default.nix
+74
pkgs/os-specific/linux/minimal-bootstrap/coreutils/musl.nix
···
1
1
+
{ lib
2
2
+
, buildPlatform
3
3
+
, hostPlatform
4
4
+
, fetchurl
5
5
+
, bash
6
6
+
, tinycc
7
7
+
, gnumake
8
8
+
, gnugrep
9
9
+
, gnused
10
10
+
, gawk
11
11
+
, gnutar
12
12
+
, gzip
13
13
+
}:
14
14
+
let
15
15
+
pname = "coreutils";
16
16
+
version = "9.4";
17
17
+
18
18
+
src = fetchurl {
19
19
+
url = "mirror://gnu/coreutils/coreutils-${version}.tar.gz";
20
20
+
hash = "sha256-X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk=";
21
21
+
};
22
22
+
23
23
+
configureFlags = [
24
24
+
"--prefix=${placeholder "out"}"
25
25
+
"--build=${buildPlatform.config}"
26
26
+
"--host=${hostPlatform.config}"
27
27
+
# musl 1.1.x doesn't use 64bit time_t
28
28
+
"--disable-year2038"
29
29
+
# libstdbuf.so fails in static builds
30
30
+
"--enable-no-install-program=stdbuf"
31
31
+
];
32
32
+
in
33
33
+
bash.runCommand "${pname}-${version}" {
34
34
+
inherit pname version;
35
35
+
36
36
+
nativeBuildInputs = [
37
37
+
tinycc.compiler
38
38
+
gnumake
39
39
+
gnused
40
40
+
gnugrep
41
41
+
gawk
42
42
+
gnutar
43
43
+
gzip
44
44
+
];
45
45
+
46
46
+
passthru.tests.get-version = result:
47
47
+
bash.runCommand "${pname}-get-version-${version}" {} ''
48
48
+
${result}/bin/cat --version
49
49
+
mkdir $out
50
50
+
'';
51
51
+
52
52
+
meta = with lib; {
53
53
+
description = "The GNU Core Utilities";
54
54
+
homepage = "https://www.gnu.org/software/coreutils";
55
55
+
license = licenses.gpl3Plus;
56
56
+
maintainers = teams.minimal-bootstrap.members;
57
57
+
platforms = platforms.unix;
58
58
+
};
59
59
+
} ''
60
60
+
# Unpack
61
61
+
tar xzf ${src}
62
62
+
cd coreutils-${version}
63
63
+
64
64
+
# Configure
65
65
+
export CC="tcc -B ${tinycc.libs}/lib"
66
66
+
export LD=tcc
67
67
+
bash ./configure ${lib.concatStringsSep " " configureFlags}
68
68
+
69
69
+
# Build
70
70
+
make -j $NIX_BUILD_CORES AR="tcc -ar" MAKEINFO="true"
71
71
+
72
72
+
# Install
73
73
+
make -j $NIX_BUILD_CORES install MAKEINFO="true"
74
74
+
''
+7
pkgs/os-specific/linux/minimal-bootstrap/default.nix
···
32
32
};
33
33
34
34
coreutils = callPackage ./coreutils { tinycc = tinycc-mes; };
35
35
+
coreutils-musl = callPackage ./coreutils/musl.nix {
36
36
+
bash = bash_2_05;
37
37
+
tinycc = tinycc-musl;
38
38
+
gnumake = gnumake-musl;
39
39
+
gnutar = gnutar-musl;
40
40
+
};
35
41
36
42
diffutils = callPackage ./diffutils {
37
43
bash = bash_2_05;
···
168
174
echo ${bash_2_05.tests.get-version}
169
175
echo ${binutils.tests.get-version}
170
176
echo ${bzip2.tests.get-version}
177
177
+
echo ${coreutils-musl.tests.get-version}
171
178
echo ${diffutils.tests.get-version}
172
179
echo ${findutils.tests.get-version}
173
180
echo ${gawk-mes.tests.get-version}