2023-01-19 22:21:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch
|
2022-03-23 05:30:06 +00:00
|
|
|
, bash-completion, perl, ncurses, zlib, sqlite, libffi
|
|
|
|
, mcpp, cmake, bison, flex, doxygen, graphviz
|
2019-03-12 05:44:08 +00:00
|
|
|
, makeWrapper
|
|
|
|
}:
|
2016-09-06 22:44:41 +01:00
|
|
|
|
2019-03-12 05:44:08 +00:00
|
|
|
|
|
|
|
let
|
2021-01-22 11:25:31 +00:00
|
|
|
toolsPath = lib.makeBinPath [ mcpp ];
|
2019-03-12 05:44:08 +00:00
|
|
|
in
|
2016-09-06 22:44:41 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "souffle";
|
2022-07-30 08:59:54 +01:00
|
|
|
version = "2.3";
|
2016-09-06 22:44:41 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "souffle-lang";
|
|
|
|
repo = "souffle";
|
|
|
|
rev = version;
|
2022-07-30 08:59:54 +01:00
|
|
|
sha256 = "sha256-wdTBSmyA2I+gaSV577NNKA2oY2fdVTGmvV7h15NY1tU=";
|
2016-09-06 22:44:41 +01:00
|
|
|
};
|
|
|
|
|
2023-01-19 22:21:13 +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-23 05:30:06 +00:00
|
|
|
nativeBuildInputs = [ bison cmake flex mcpp doxygen graphviz makeWrapper perl ];
|
|
|
|
buildInputs = [ bash-completion ncurses zlib sqlite libffi ];
|
2019-03-12 05:44:08 +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 ];
|
2016-09-06 22:44:41 +01:00
|
|
|
|
2022-03-23 05:30:06 +00:00
|
|
|
cmakeFlags = [ "-DSOUFFLE_GIT=OFF" ];
|
2019-03-12 05:44:08 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/souffle" --prefix PATH : "${toolsPath}"
|
2016-09-06 22:44:41 +01:00
|
|
|
'';
|
|
|
|
|
2019-03-12 05:44:08 +00:00
|
|
|
outputs = [ "out" ];
|
2016-09-06 22:44:41 +01:00
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2016-09-06 22:44:41 +01:00
|
|
|
description = "A translator of declarative Datalog programs into the C++ language";
|
2020-01-22 10:26:22 +00:00
|
|
|
homepage = "https://souffle-lang.github.io/";
|
2016-09-06 22:44:41 +01:00
|
|
|
platforms = platforms.unix;
|
2019-03-12 05:44:08 +00:00
|
|
|
maintainers = with maintainers; [ thoughtpolice copumpkin wchresta ];
|
2016-09-06 22:44:41 +01:00
|
|
|
license = licenses.upl;
|
|
|
|
};
|
|
|
|
}
|