From e4d5928ba37c705cf2a1b5468f87725a2d5e1dfa Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 11 Jan 2018 14:35:31 -0600 Subject: [PATCH] boehm-gc: fix missing include, fix build w/musl Also disable-static, don't remember why --- pkgs/development/libraries/boehm-gc/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index f3c58a93872a..9efcf023a455 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, pkgconfig, libatomic_ops, enableLargeConfig ? false +{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops, enableLargeConfig ? false , buildPlatform, hostPlatform }: @@ -20,9 +20,19 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "doc" ]; separateDebugInfo = stdenv.isLinux; + preConfigure = stdenv.lib.optionalString (stdenv.cc.libc == "musl") '' + export NIX_CFLAGS_COMPILE+="-D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR" + ''; + + patches = [ (fetchpatch { + url = "https://raw.githubusercontent.com/gentoo/musl/85b6a600996bdd71162b357e9ba93d8559342432/dev-libs/boehm-gc/files/boehm-gc-7.6.0-sys_select.patch"; + sha256 = "1gydwlklvci30f5dpp5ccw2p2qpph5y41r55wx9idamjlq66fbb3"; + }) ]; + configureFlags = [ "--enable-cplusplus" ] - ++ lib.optional enableLargeConfig "--enable-large-config"; + ++ lib.optional enableLargeConfig "--enable-large-config" + ++ lib.optional (stdenv.cc.libc == "musl") "--disable-static"; doCheck = true; # not cross;