@@ -1,40 +1,10 @@
11{ stdenv, fetchurl, fetchpatch }:
2−
3−stdenv.mkDerivation rec {
4− name = "jemalloc-${version}";
2+import ./common.nix {
3+ inherit stdenv fetchurl;
54 version = "5.0.1";
6−
7− src = fetchurl {
8− url = "https://github.com/jemalloc/jemalloc/releases/download/${version}/${name}.tar.bz2";
9− sha256 = "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9";
10− };
11−
12− # By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
13− # then stops downstream builds (mariadb in particular) from detecting it. This
14− # option should remove the prefix and give us a working jemalloc.
15− configureFlags = stdenv.lib.optional stdenv.isDarwin "--with-jemalloc-prefix="
16− # jemalloc is unable to correctly detect transparent hugepage support on
17− # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default
18− # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support
19− ++ stdenv.lib.optional stdenv.isArm "--disable-thp";
20− doCheck = true;
21−
5+ sha256 = "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9";
226 patches = stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
237 url = "https://patch-diff.githubusercontent.com/raw/jemalloc/jemalloc/pull/1035.patch";
248 sha256 = "02y0q3dp253bipxv4r954nqipbjbj92p6ww9bx5bk3d8pa81wkqq";
259 });
26−
27− enableParallelBuilding = true;
28−
29− meta = with stdenv.lib; {
30− homepage = http://jemalloc.net;
31− description = "General purpose malloc(3) implementation";
32− longDescription = ''
33− malloc(3)-compatible memory allocator that emphasizes fragmentation
34− avoidance and scalable concurrency support.
35− '';
36− license = licenses.bsd2;
37− platforms = platforms.all;
38− maintainers = with maintainers; [ wkennington ];
39− };
4010}