git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #79970 from dtzWill/fix/lwan-jemalloc-use-if-gonna-use-but-not-with-musl
commit8bc584626ba1508b7ef87110b919bb5464303c7e authorSandro <sandro.jaeckel@gmail.com> dateTue 22 Mar 2022, 02:13 (5 years ago) parent4348e36e225f91
1 file changed+7−2
pkgs/servers/http/lwan/default.nix+7−2
pkgs/servers/http/lwan/default.nix+7−2
@@ -1,4 +1,4 @@
1−{ lib, stdenv, fetchFromGitHub, pkg-config, zlib, cmake, jemalloc }:
1+{ lib, stdenv, fetchFromGitHub, pkg-config, zlib, cmake, enableJemalloc ? !stdenv.hostPlatform.isMusl, jemalloc }:
22
33stdenv.mkDerivation rec {
44 pname = "lwan";
@@ -13,7 +13,12 @@ stdenv.mkDerivation rec {
1313
1414 nativeBuildInputs = [ cmake pkg-config ];
1515
16− buildInputs = [ jemalloc zlib ];
16+ buildInputs = [ zlib ] ++ lib.optional enableJemalloc jemalloc;
17+
18+ # Note: tcmalloc and mimalloc are also supported (and normal malloc)
19+ cmakeFlags = lib.optional enableJemalloc "-DUSE_ALTERNATIVE_MALLOC=jemalloc";
20+
21+ hardeningDisable = lib.optional stdenv.hostPlatform.isMusl "pie";
1722
1823 meta = with lib; {
1924 description = "Lightweight high-performance multi-threaded web server";