nixpkgs/pkgs/development/tools/mold/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.3 KiB
Nix
Raw Normal View History

2022-09-04 11:33:19 +00:00
{ lib
, stdenv
2021-07-12 19:12:26 +00:00
, fetchFromGitHub
, cmake
2022-09-04 11:33:19 +00:00
, mimalloc
, ninja
2021-07-12 19:12:26 +00:00
, openssl
2022-09-04 11:33:19 +00:00
, zlib
, testers
, mold
2021-07-12 19:12:26 +00:00
}:
stdenv.mkDerivation rec {
pname = "mold";
2022-11-19 12:29:23 +00:00
version = "1.7.1";
2021-07-12 19:12:26 +00:00
src = fetchFromGitHub {
owner = "rui314";
repo = pname;
rev = "v${version}";
2022-11-19 12:29:23 +00:00
hash = "sha256-sC8rJOyQB8mDCCmfpk2lVDPTWxBj7tZxVXQw8agl7t0=";
2021-07-12 19:12:26 +00:00
};
2022-09-04 11:33:19 +00:00
nativeBuildInputs = [ cmake ninja ];
2021-07-12 19:12:26 +00:00
2022-09-04 11:33:19 +00:00
buildInputs = [ openssl zlib ]
++ lib.optionals (!stdenv.isDarwin) [ mimalloc ];
2021-07-12 19:12:26 +00:00
2022-09-04 11:33:19 +00:00
postPatch = ''
sed -i CMakeLists.txt -e '/.*set(DEST\ .*/d'
'';
cmakeFlags = [ "-DMOLD_USE_SYSTEM_MIMALLOC:BOOL=ON" ];
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ "-faligned-allocation" ];
passthru.tests.version = testers.testVersion { package = mold; };
2022-01-27 08:45:38 +00:00
2021-07-12 19:12:26 +00:00
meta = with lib; {
2022-09-04 11:33:19 +00:00
description = "A faster drop-in replacement for existing Unix linkers";
longDescription = ''
mold is a faster drop-in replacement for existing Unix linkers. It is
several times faster than the LLVM lld linker. mold is designed to
increase developer productivity by reducing build time, especially in
rapid debug-edit-rebuild cycles.
'';
2021-07-12 19:12:26 +00:00
homepage = "https://github.com/rui314/mold";
2022-09-04 11:33:19 +00:00
license = licenses.agpl3Plus;
maintainers = with maintainers; [ azahi nitsky ];
platforms = platforms.unix;
2021-07-12 19:12:26 +00:00
};
}