2021-07-12 19:12:26 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, autoPatchelfHook
|
|
|
|
, cmake
|
|
|
|
, llvmPackages_latest
|
|
|
|
, xxHash
|
|
|
|
, zlib
|
|
|
|
, openssl
|
2022-01-27 08:45:38 +00:00
|
|
|
, nix-update-script
|
2021-07-12 19:12:26 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mold";
|
2022-03-09 15:29:14 +00:00
|
|
|
version = "1.1.1";
|
2021-07-12 19:12:26 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rui314";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-03-09 15:29:14 +00:00
|
|
|
sha256 = "sha256-+uPVt3w3A25JFyENxqhAcjZMRzSowi2uHwGjkeQP8Og=";
|
2021-07-12 19:12:26 +00:00
|
|
|
};
|
|
|
|
|
2021-07-28 15:11:51 +00:00
|
|
|
buildInputs = [ zlib openssl ];
|
2021-07-12 19:12:26 +00:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook cmake xxHash ];
|
|
|
|
|
2022-01-01 18:21:23 +00:00
|
|
|
enableParallelBuilding = true;
|
2021-07-12 19:12:26 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
EXTRA_LDFLAGS = "-fuse-ld=${llvmPackages_latest.lld}/bin/ld.lld";
|
|
|
|
LTO = 1;
|
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
|
2022-01-27 08:45:38 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-07-12 19:12:26 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A high performance drop-in replacement for existing unix linkers";
|
|
|
|
homepage = "https://github.com/rui314/mold";
|
|
|
|
license = lib.licenses.agpl3Plus;
|
|
|
|
maintainers = with maintainers; [ nitsky ];
|
2021-07-17 22:19:30 +00:00
|
|
|
broken = stdenv.isAarch64;
|
2021-07-12 19:12:26 +00:00
|
|
|
};
|
|
|
|
}
|