2019-06-18 02:07:56 -07:00
|
|
|
{ lib, stdenv, fetchurl
|
2018-07-04 07:19:25 -07:00
|
|
|
, enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179
|
2017-06-28 13:01:43 -07:00
|
|
|
}:
|
2004-11-19 06:57:43 -08:00
|
|
|
|
2012-10-03 11:06:53 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "boehm-gc";
|
2019-03-02 16:05:52 -08:00
|
|
|
version = "8.0.4";
|
2008-09-05 01:03:44 -07:00
|
|
|
|
2011-02-02 04:17:29 -08:00
|
|
|
src = fetchurl {
|
2017-12-26 16:03:12 -08:00
|
|
|
urls = [
|
|
|
|
"https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz"
|
2018-12-23 14:52:07 -08:00
|
|
|
"http://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
|
2017-12-26 16:03:12 -08:00
|
|
|
];
|
2019-03-02 16:05:52 -08:00
|
|
|
sha256 = "1798rp3mcfkgs38ynkbg2p47bq59pisrc6mn0l20pb5iczf0ssj3";
|
2011-02-02 04:17:29 -08:00
|
|
|
};
|
2016-12-03 14:04:21 -08:00
|
|
|
|
2016-08-28 17:30:01 -07:00
|
|
|
outputs = [ "out" "dev" "doc" ];
|
2017-07-05 07:04:54 -07:00
|
|
|
separateDebugInfo = stdenv.isLinux;
|
2013-08-26 03:04:19 -07:00
|
|
|
|
2018-01-12 14:18:55 -08:00
|
|
|
preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
|
2019-02-03 11:25:42 -08:00
|
|
|
export NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR"
|
2018-01-11 12:35:31 -08:00
|
|
|
'';
|
|
|
|
|
2019-01-08 07:23:32 -08:00
|
|
|
patches =
|
2018-02-17 22:40:29 -08:00
|
|
|
# https://github.com/ivmai/bdwgc/pull/208
|
2018-08-20 11:43:41 -07:00
|
|
|
lib.optional stdenv.hostPlatform.isRiscV ./riscv.patch;
|
2018-01-11 12:35:31 -08:00
|
|
|
|
2014-09-18 03:16:12 -07:00
|
|
|
configureFlags =
|
2019-02-03 18:24:17 -08:00
|
|
|
[ "--enable-cplusplus" "--with-libatomic-ops=none" ]
|
2018-01-11 12:35:31 -08:00
|
|
|
++ lib.optional enableLargeConfig "--enable-large-config"
|
2019-02-03 18:24:17 -08:00
|
|
|
++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
|
2012-10-03 11:06:53 -07:00
|
|
|
|
2018-01-07 23:19:47 -08:00
|
|
|
doCheck = true; # not cross;
|
2008-09-05 01:03:44 -07:00
|
|
|
|
2017-11-21 09:58:48 -08:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2008-01-05 16:12:25 -08:00
|
|
|
meta = {
|
2009-09-16 05:39:57 -07:00
|
|
|
description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
The Boehm-Demers-Weiser conservative garbage collector can be used as a
|
|
|
|
garbage collecting replacement for C malloc or C++ new. It allows you
|
|
|
|
to allocate memory basically as you normally would, without explicitly
|
|
|
|
deallocating memory that is no longer useful. The collector
|
|
|
|
automatically recycles memory when it determines that it can no longer
|
|
|
|
be otherwise accessed.
|
|
|
|
|
|
|
|
The collector is also used by a number of programming language
|
|
|
|
implementations that either use C as intermediate code, want to
|
|
|
|
facilitate easier interoperation with C libraries, or just prefer the
|
|
|
|
simple collector interface.
|
|
|
|
|
|
|
|
Alternatively, the garbage collector may be used as a leak detector for
|
|
|
|
C or C++ programs, though that is not its primary goal.
|
|
|
|
'';
|
|
|
|
|
2014-11-17 16:47:23 -08:00
|
|
|
homepage = http://hboehm.info/gc/;
|
2009-09-16 05:39:57 -07:00
|
|
|
|
|
|
|
# non-copyleft, X11-style license
|
2014-11-17 16:47:23 -08:00
|
|
|
license = http://hboehm.info/gc/license.txt;
|
2009-09-16 05:39:57 -07:00
|
|
|
|
2015-01-13 13:33:24 -08:00
|
|
|
maintainers = [ ];
|
2010-02-12 06:14:40 -08:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2004-11-19 06:57:43 -08:00
|
|
|
};
|
|
|
|
}
|