2024-06-05 15:53:02 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2022-03-30 09:31:56 +00:00
|
|
|
, bash-completion, perl, ncurses, zlib, sqlite, libffi
|
|
|
|
, mcpp, cmake, bison, flex, doxygen, graphviz
|
2024-07-27 06:49:29 +00:00
|
|
|
, makeWrapper, python3, callPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
|
|
let
|
2024-07-27 06:49:29 +00:00
|
|
|
toolsPath = lib.makeBinPath [ mcpp python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "souffle";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.4.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "souffle-lang";
|
|
|
|
repo = "souffle";
|
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-U3/1iNOLFzuXiBsVDAc5AXnK4F982Uifp18jjFNUv2o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
patches = [
|
|
|
|
./threads.patch
|
2024-07-27 06:49:29 +00:00
|
|
|
./includes.patch
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
hardeningDisable = lib.optionals stdenv.hostPlatform.isDarwin [ "strictoverflow" ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ bison cmake flex mcpp doxygen graphviz makeWrapper perl ];
|
2024-07-27 06:49:29 +00:00
|
|
|
buildInputs = [ bash-completion ncurses zlib sqlite libffi python3 ];
|
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
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
env = lib.optionalAttrs stdenv.cc.isClang {
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable";
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/souffle" --prefix PATH : "${toolsPath}"
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
outputs = [ "out" ];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
passthru.tests = callPackage ./tests.nix { };
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Translator of declarative Datalog programs into the C++ language";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://souffle-lang.github.io/";
|
|
|
|
platforms = platforms.unix;
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with maintainers; [ thoughtpolice copumpkin wchresta markusscherer ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.upl;
|
|
|
|
};
|
|
|
|
}
|