Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / compilers / souffle / default.nix
blobe57062642ba40c12e85f1e1ec10a5a32656182bc
1 { lib, stdenv, fetchFromGitHub
2 , perl, ncurses, zlib, sqlite, libffi
3 , autoreconfHook, mcpp, bison, flex, doxygen, graphviz
4 , makeWrapper
5 }:
8 let
9   toolsPath = lib.makeBinPath [ mcpp ];
11 stdenv.mkDerivation rec {
12   pname = "souffle";
13   version = "2.0.2";
15   src = fetchFromGitHub {
16     owner  = "souffle-lang";
17     repo   = "souffle";
18     rev    = version;
19     sha256 = "1fa6yssgndrln8qbbw2j7j199glxp63irfrz1c2y424rq82mm2r5";
20   };
22   nativeBuildInputs = [ autoreconfHook bison flex mcpp doxygen graphviz makeWrapper perl ];
23   buildInputs = [ ncurses zlib sqlite libffi ];
25   # these propagated inputs are needed for the compiled Souffle mode to work,
26   # since generated compiler code uses them. TODO: maybe write a g++ wrapper
27   # that adds these so we can keep the propagated inputs clean?
28   propagatedBuildInputs = [ ncurses zlib sqlite libffi ];
30   # see 565a8e73e80a1bedbb6cc037209c39d631fc393f and parent commits upstream for
31   # Wno-error fixes
32   patchPhase = ''
33     substituteInPlace ./src/Makefile.am \
34       --replace '-Werror' '-Werror -Wno-error=deprecated -Wno-error=other'
36     substituteInPlace configure.ac \
37       --replace "m4_esyscmd([git describe --tags --always | tr -d '\n'])" "${version}"
38   '';
40   postInstall = ''
41     wrapProgram "$out/bin/souffle" --prefix PATH : "${toolsPath}"
42   '';
44   outputs = [ "out" ];
46   meta = with lib; {
47     description = "A translator of declarative Datalog programs into the C++ language";
48     homepage    = "https://souffle-lang.github.io/";
49     platforms   = platforms.unix;
50     maintainers = with maintainers; [ thoughtpolice copumpkin wchresta ];
51     license     = licenses.upl;
52   };