2023-01-20 10:41:00 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch
|
2022-03-30 09:31:56 +00:00
|
|
|
, bash-completion, perl, ncurses, zlib, sqlite, libffi
|
|
|
|
, mcpp, cmake, bison, flex, doxygen, graphviz
|
2020-04-24 23:36:52 +00:00
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
toolsPath = lib.makeBinPath [ mcpp ];
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "souffle";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "2.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "souffle-lang";
|
|
|
|
repo = "souffle";
|
|
|
|
rev = version;
|
2022-08-21 13:32:41 +00:00
|
|
|
sha256 = "sha256-wdTBSmyA2I+gaSV577NNKA2oY2fdVTGmvV7h15NY1tU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
patches = [
|
|
|
|
./threads.patch
|
|
|
|
(fetchpatch {
|
|
|
|
name = "missing-override.patch";
|
|
|
|
url = "https://github.com/souffle-lang/souffle/commit/da2d778f0cca94f206686546fa56b9ffc738ad75.patch";
|
|
|
|
sha256 = "Oefm3vRRwOyom94oGSOK2w9m23gkbJ++9gcWrdLlkyk=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
hardeningDisable = lib.optionals stdenv.isDarwin [ "strictoverflow" ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ bison cmake flex mcpp doxygen graphviz makeWrapper perl ];
|
|
|
|
buildInputs = [ bash-completion ncurses zlib sqlite libffi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
# 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?
|
|
|
|
propagatedBuildInputs = [ ncurses zlib sqlite libffi ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
cmakeFlags = [ "-DSOUFFLE_GIT=OFF" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/souffle" --prefix PATH : "${toolsPath}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A translator of declarative Datalog programs into the C++ language";
|
|
|
|
homepage = "https://souffle-lang.github.io/";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice copumpkin wchresta ];
|
|
|
|
license = licenses.upl;
|
|
|
|
};
|
|
|
|
}
|