-
Notifications
You must be signed in to change notification settings - Fork 389
Expand file tree
/
Copy pathdefault.nix
More file actions
44 lines (36 loc) · 1.13 KB
/
default.nix
File metadata and controls
44 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
stdenv
, pkgs
, linuxHeaders ? null
}:
let
self = stdenv.mkDerivation rec {
pname = "musl-unpatched";
version = "1.2.5";
src = fetchGit {
url = "git://git.musl-libc.org/musl";
rev = "0784374d561435f7c787a555aeab8ede699ed298";
};
enableParallelBuilding = true;
configurePhase = ''
echo "Configuring with musl's configure script"
echo "Target platform is ${stdenv.targetPlatform.config}"
./configure --prefix=$out --with-malloc=oldmalloc --disable-shared --enable-debug CROSS_COMPILE=${stdenv.targetPlatform.config}-
'';
# Copy linux headers - taken from upstream nixpkgs musl, needed for libcxx to build
postInstall = ''
(cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
'';
CFLAGS = "-Wno-error=int-conversion -nostdinc";
passthru.linuxHeaders = linuxHeaders;
meta = {
description = "musl - Linux based libc (unpatched)";
homepage = "https://www.musl-libc.org/";
license = pkgs.lib.licenses.mit;
};
};
dev = pkgs.lib.getDev self;
lib = pkgs.lib.getLib self;
in
self.overrideAttrs (oldAttrs: {
})