Commit 5ca30687 authored by Will Dietz's avatar Will Dietz
Browse files

lwan: no jemalloc w/musl

parent 0341e3d5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, pkg-config, zlib, cmake, jemalloc }:
{ lib, stdenv, fetchFromGitHub, pkg-config, zlib, cmake, enableJemalloc ? !stdenv.hostPlatform.isMusl, jemalloc }:

stdenv.mkDerivation rec {
  pname = "lwan";
@@ -13,10 +13,10 @@ stdenv.mkDerivation rec {

  nativeBuildInputs = [ cmake pkg-config ];

  buildInputs = [ jemalloc zlib ];
  buildInputs = [ zlib ] ++ lib.optional enableJemalloc jemalloc;

  # Note: tcmalloc and mimalloc are also supported (and normal malloc)
  cmakeFlags = [ "-DUSE_ALTERNATIVE_MALLOC=jemalloc" ];
  cmakeFlags = lib.optional enableJemalloc "-DUSE_ALTERNATIVE_MALLOC=jemalloc";

  meta = with lib; {
    description = "Lightweight high-performance multi-threaded web server";