Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 69 lines 1.4 kB view raw
1{ 2 stdenv, 3 lib, 4 fetchFromGitHub, 5 cmake, 6 ninja, 7 llvm, 8 clang, 9 z3, 10 makeWrapper, 11}: 12 13stdenv.mkDerivation { 14 pname = "symcc"; 15 version = "1.0-unstable-2024-07-16"; 16 17 src = fetchFromGitHub { 18 owner = "eurecom-s3"; 19 repo = "symcc"; 20 rev = "65a3633992318ded8939629eda54022932fd582d"; 21 hash = "sha256-WzZLeq+if7FyQKkSMDiqxnjtbb7eg8EVuNkCwxyEryM="; 22 fetchSubmodules = true; 23 }; 24 25 cmakeFlags = [ 26 "-DZ3_TRUST_SYSTEM_VERSION=on" 27 "-DSYMCC_RT_BACKEND=qsym" 28 ]; 29 30 postPatch = '' 31 echo 'install(TARGETS SymCC LIBRARY DESTINATION '\$'{CMAKE_INSTALL_LIBDIR})' >> CMakeLists.txt 32 ''; 33 34 postInstall = '' 35 cp SymCCRuntime-prefix/src/SymCCRuntime-build/libsymcc-rt.{a,so} $out/lib/ 36 37 install -Dm755 symcc sym++ -t $out/bin 38 39 wrapProgram $out/bin/symcc \ 40 --set SYMCC_RUNTIME_DIR $out/lib \ 41 --set SYMCC_PASS_DIR $out/lib 42 43 wrapProgram $out/bin/sym++ \ 44 --set SYMCC_RUNTIME_DIR $out/lib \ 45 --set SYMCC_PASS_DIR $out/lib 46 ''; 47 48 nativeBuildInputs = [ 49 cmake 50 ninja 51 llvm 52 clang 53 makeWrapper 54 ]; 55 56 buildInputs = [ 57 llvm 58 z3 59 ]; 60 61 meta = { 62 description = "Efficient compiler-based symbolic execution"; 63 homepage = "https://www.s3.eurecom.fr/tools/symbolic_execution/symcc.html"; 64 license = lib.licenses.gpl3Plus; 65 maintainers = [ lib.maintainers.dump_stack ]; 66 platforms = lib.platforms.linux; 67 mainProgram = "symcc"; 68 }; 69}