tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
minimal-bootstrap.bzip2: build with musl
Emily Trau
2 years ago
adf49a8b
2f400ede
+10
-23
2 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
minimal-bootstrap
bzip2
default.nix
default.nix
+7
-22
pkgs/os-specific/linux/minimal-bootstrap/bzip2/default.nix
···
3
, bash
4
, tinycc
5
, gnumake
6
-
, gnupatch
7
, gzip
8
}:
9
let
···
14
url = "https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz";
15
sha256 = "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb";
16
};
17
-
18
-
patches = [
19
-
# mes libc has no time support, so we remove that.
20
-
# It also does not have fch{own,mod}, which we don't care about in the bootstrap
21
-
# anyway, so we can null-op those calls.
22
-
(fetchurl {
23
-
url = "https://github.com/fosslinux/live-bootstrap/raw/87e9d7db9d22b400d1c05247254ac39ee2577e80/sysa/bzip2-1.0.8/patches/mes-libc.patch";
24
-
sha256 = "14dciwib28h413skzfkh7samzh8x87dmwhldyxxphff04pvl1j3c";
25
-
})
26
-
];
27
in
28
bash.runCommand "${pname}-${version}" {
29
inherit pname version;
···
31
nativeBuildInputs = [
32
tinycc.compiler
33
gnumake
34
-
gnupatch
35
gzip
36
];
37
38
passthru.tests.get-version = result:
39
bash.runCommand "${pname}-get-version-${version}" {} ''
40
-
${result}/bin/bzip2 --version --help
41
mkdir $out
42
'';
43
···
50
};
51
} ''
52
# Unpack
53
-
cp ${src} bzip2.tar.gz
54
-
gunzip bzip2.tar.gz
55
-
untar --file bzip2.tar
56
-
rm bzip2.tar
57
cd bzip2-${version}
58
59
-
# Patch
60
-
${lib.concatMapStringsSep "\n" (f: "patch -Np0 -i ${f}") patches}
61
-
62
# Build
63
make \
64
-
CC="tcc -B ${tinycc.libs}/lib -I ." \
0
65
AR="tcc -ar" \
66
bzip2 bzip2recover
67
68
# Install
69
-
make install PREFIX=$out
70
''
···
3
, bash
4
, tinycc
5
, gnumake
6
+
, gnutar
7
, gzip
8
}:
9
let
···
14
url = "https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz";
15
sha256 = "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb";
16
};
0
0
0
0
0
0
0
0
0
0
17
in
18
bash.runCommand "${pname}-${version}" {
19
inherit pname version;
···
21
nativeBuildInputs = [
22
tinycc.compiler
23
gnumake
24
+
gnutar
25
gzip
26
];
27
28
passthru.tests.get-version = result:
29
bash.runCommand "${pname}-get-version-${version}" {} ''
30
+
${result}/bin/bzip2 --help
31
mkdir $out
32
'';
33
···
40
};
41
} ''
42
# Unpack
43
+
tar xzf ${src}
0
0
0
44
cd bzip2-${version}
45
0
0
0
46
# Build
47
make \
48
+
-j $NIX_BUILD_CORES \
49
+
CC="tcc -B ${tinycc.libs}/lib" \
50
AR="tcc -ar" \
51
bzip2 bzip2recover
52
53
# Install
54
+
make install -j $NIX_BUILD_CORES PREFIX=$out
55
''
+3
-1
pkgs/os-specific/linux/minimal-bootstrap/default.nix
···
32
33
bzip2 = callPackage ./bzip2 {
34
bash = bash_2_05;
35
-
tinycc = tinycc-mes;
0
0
36
};
37
38
coreutils = callPackage ./coreutils { tinycc = tinycc-mes; };
···
32
33
bzip2 = callPackage ./bzip2 {
34
bash = bash_2_05;
35
+
tinycc = tinycc-musl;
36
+
gnumake = gnumake-musl;
37
+
gnutar = gnutar-musl;
38
};
39
40
coreutils = callPackage ./coreutils { tinycc = tinycc-mes; };