2021-11-19 17:51:27 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch
|
2019-03-12 05:44:08 +00:00
|
|
|
, perl, ncurses, zlib, sqlite, libffi
|
|
|
|
, autoreconfHook, mcpp, bison, flex, doxygen, graphviz
|
|
|
|
, 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";
|
2020-11-12 04:22:54 +00:00
|
|
|
version = "2.0.2";
|
2016-09-06 22:44:41 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "souffle-lang";
|
|
|
|
repo = "souffle";
|
|
|
|
rev = version;
|
2020-11-12 04:22:54 +00:00
|
|
|
sha256 = "1fa6yssgndrln8qbbw2j7j199glxp63irfrz1c2y424rq82mm2r5";
|
2016-09-06 22:44:41 +01:00
|
|
|
};
|
|
|
|
|
2021-11-19 17:51:27 +00:00
|
|
|
patches = [
|
|
|
|
# Pull pending unstream inclusion fix for ncurses-6.3:
|
|
|
|
# https://github.com/souffle-lang/souffle/pull/2134
|
|
|
|
(fetchpatch {
|
|
|
|
name = "ncurses-6.3.patch";
|
|
|
|
url = "https://github.com/souffle-lang/souffle/commit/9e4bdf86d051ef2e1b1a1be64aff7e498fd5dd20.patch";
|
|
|
|
sha256 = "0jw1b6qfdf49dx2qlzn1b2yzrgpnkil4w9y3as1m28w8ws7iphpa";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-03-12 05:44:08 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook bison flex mcpp doxygen graphviz makeWrapper perl ];
|
|
|
|
buildInputs = [ ncurses zlib sqlite libffi ];
|
2018-05-07 06:16:50 +01:00
|
|
|
|
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
|
|
|
|
2019-03-12 05:44:08 +00:00
|
|
|
# see 565a8e73e80a1bedbb6cc037209c39d631fc393f and parent commits upstream for
|
|
|
|
# Wno-error fixes
|
2021-11-19 17:51:27 +00:00
|
|
|
postPatch = ''
|
2019-03-12 05:44:08 +00:00
|
|
|
substituteInPlace ./src/Makefile.am \
|
|
|
|
--replace '-Werror' '-Werror -Wno-error=deprecated -Wno-error=other'
|
|
|
|
|
2016-09-06 22:44:41 +01:00
|
|
|
substituteInPlace configure.ac \
|
2019-03-12 05:44:08 +00:00
|
|
|
--replace "m4_esyscmd([git describe --tags --always | tr -d '\n'])" "${version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|