depot/third_party/nixpkgs/pkgs/by-name/al/alive2/package.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

67 lines
1.2 KiB
Nix

{
lib,
clangStdenv,
fetchFromGitHub,
re2c,
z3,
hiredis,
llvm_18,
cmake,
ninja,
}:
clangStdenv.mkDerivation (finalAttrs: {
pname = "alive2";
version = "0-unstable-2024-09-23";
src = fetchFromGitHub {
owner = "AliveToolkit";
repo = "alive2";
rev = "05a964284056b38a6dc1f807e7acad64a0308328";
sha256 = "sha256-okKKUU7WLXLD9Hvsfoz+1HQWoyQ/bqRpBk5ogr7kSJA=";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
re2c
z3
hiredis
llvm_18
ninja
];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail 'find_package(Git REQUIRED)' ""
'';
env = {
ALIVE2_HOME = "$PWD";
LLVM2_HOME = "${llvm_18}";
LLVM2_BUILD = "$LLVM2_HOME/build";
};
preBuild = ''
mkdir -p build
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp alive $out/bin/
cp alive-jobserver $out/bin/
rm -rf $out/bin/CMakeFiles $out/bin/*.o
runHook postInstall
'';
meta = {
description = "Automatic verification of LLVM optimizations";
homepage = "https://github.com/AliveToolkit/alive2";
license = lib.licenses.mit;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ shogo ];
mainProgram = "alive";
};
})