diff --git a/pkgs/os-specific/linux/musl/default.nix b/pkgs/os-specific/linux/musl/default.nix index bfc7b717bf7c..9a97b4259b24 100644 --- a/pkgs/os-specific/linux/musl/default.nix +++ b/pkgs/os-specific/linux/musl/default.nix @@ -1,5 +1,8 @@ -{ stdenv, fetchurl, linuxHeaders, useBSDCompatHeaders ? true }: - +{ stdenv, lib, fetchurl +, buildPackages +, linuxHeaders ? null +, useBSDCompatHeaders ? true +}: let cdefs_h = fetchurl { url = "http://git.alpinelinux.org/cgit/aports/plain/main/libc-dev/sys-cdefs.h"; @@ -13,13 +16,14 @@ let url = "http://git.alpinelinux.org/cgit/aports/plain/main/libc-dev/sys-tree.h"; sha256 = "14igk6k00bnpfw660qhswagyhvr0gfqg4q55dxvaaq7ikfkrir71"; }; + in stdenv.mkDerivation rec { name = "musl-${version}"; version = "1.1.18"; src = fetchurl { - url = "http://www.musl-libc.org/releases/${name}.tar.gz"; + url = "http://www.musl-libc.org/releases/musl-${version}.tar.gz"; sha256 = "0651lnj5spckqjf83nz116s8qhhydgqdy3rkl4icbh5f05fyw5yh"; }; @@ -56,7 +60,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin # Create 'ldd' symlink, builtin ln -s $out/lib/libc.so $out/bin/ldd - '' + stdenv.lib.optionalString useBSDCompatHeaders '' + '' + lib.optionalString useBSDCompatHeaders '' install -D ${queue_h} $dev/include/sys/queue.h install -D ${cdefs_h} $dev/include/sys/cdefs.h install -D ${tree_h} $dev/include/sys/tree.h @@ -67,8 +71,8 @@ stdenv.mkDerivation rec { meta = { description = "An efficient, small, quality libc implementation"; homepage = "http://www.musl-libc.org"; - license = stdenv.lib.licenses.mit; - platforms = stdenv.lib.platforms.linux; - maintainers = [ stdenv.lib.maintainers.thoughtpolice ]; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + maintainers = [ lib.maintainers.thoughtpolice ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9b7c1863553e..3208f0c8b4d0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8741,12 +8741,17 @@ with pkgs; stdenv = crossLibcStdenv; }; + muslCross = callPackage ../os-specific/linux/musl { + stdenv = crossLibcStdenv; + }; + # We can choose: libcCrossChooser = name: # libc is hackily often used from the previous stage. This `or` # hack fixes the hack, *sigh*. /**/ if name == "glibc" then targetPackages.glibcCross or glibcCross else if name == "uclibc" then uclibcCross + else if name == "musl" then targetPackages.muslCross or muslCross else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 else if name == "libSystem" then darwin.xcode else throw "Unknown libc";