diff --git a/pkgs/development/compilers/souffle/default.nix b/pkgs/development/compilers/souffle/default.nix index dd6c11120e4d..cacd63450c4b 100644 --- a/pkgs/development/compilers/souffle/default.nix +++ b/pkgs/development/compilers/souffle/default.nix @@ -1,12 +1,12 @@ { lib, stdenv, fetchFromGitHub , bash-completion, perl, ncurses, zlib, sqlite, libffi , mcpp, cmake, bison, flex, doxygen, graphviz -, makeWrapper +, makeWrapper, python3 }: let - toolsPath = lib.makeBinPath [ mcpp ]; + toolsPath = lib.makeBinPath [ mcpp python3 ]; in stdenv.mkDerivation rec { pname = "souffle"; @@ -21,12 +21,13 @@ stdenv.mkDerivation rec { patches = [ ./threads.patch + ./includes.patch ]; hardeningDisable = lib.optionals stdenv.isDarwin [ "strictoverflow" ]; nativeBuildInputs = [ bison cmake flex mcpp doxygen graphviz makeWrapper perl ]; - buildInputs = [ bash-completion ncurses zlib sqlite libffi ]; + buildInputs = [ bash-completion ncurses zlib sqlite libffi python3 ]; # these propagated inputs are needed for the compiled Souffle mode to work, # since generated compiler code uses them. TODO: maybe write a g++ wrapper # that adds these so we can keep the propagated inputs clean? @@ -42,6 +43,12 @@ stdenv.mkDerivation rec { wrapProgram "$out/bin/souffle" --prefix PATH : "${toolsPath}" ''; + postFixup = '' + substituteInPlace "$out/bin/souffle-compile.py" \ + --replace "-IPLACEHOLDER_FOR_INCLUDES_THAT_ARE_SET_BY_NIXPKGS" \ + "-I${ncurses.dev}/include -I${zlib.dev}/include -I${sqlite.dev}/include -I${libffi.dev}/include -I$out/include" + ''; + outputs = [ "out" ]; meta = with lib; { diff --git a/pkgs/development/compilers/souffle/includes.patch b/pkgs/development/compilers/souffle/includes.patch new file mode 100644 index 000000000000..3e37641a6cab --- /dev/null +++ b/pkgs/development/compilers/souffle/includes.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 946a1f8..bc60339 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -428,7 +428,7 @@ set(SOUFFLE_COMPILED_RELEASE_CXX_FLAGS ${CMAKE_CXX_FLAGS_RELEASE}) + set(SOUFFLE_COMPILED_DEBUG_CXX_FLAGS ${CMAKE_CXX_FLAGS_DEBUG}) + get_target_property(SOUFFLE_COMPILED_DEFS compiled COMPILE_DEFINITIONS) + get_target_property(SOUFFLE_COMPILED_OPTS compiled COMPILE_OPTIONS) +-get_target_property(SOUFFLE_COMPILED_INCS compiled INCLUDE_DIRECTORIES) ++set(SOUFFLE_COMPILED_INCS PLACEHOLDER_FOR_INCLUDES_THAT_ARE_SET_BY_NIXPKGS) + + set(SOUFFLE_COMPILED_LIBS "") + set(SOUFFLE_COMPILED_RPATHS "")