2018-07-21 01:44:44 +01:00
|
|
|
{ haskellPackages, mkDerivation, fetchFromGitHub, lib
|
2017-12-31 00:35:46 +00:00
|
|
|
# the following are non-haskell dependencies
|
2019-01-18 19:22:52 +00:00
|
|
|
, makeWrapper, which, maude, graphviz, ocaml
|
2017-12-30 22:12:40 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2019-01-18 19:22:52 +00:00
|
|
|
version = "1.4.1";
|
2017-12-30 22:12:40 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tamarin-prover";
|
|
|
|
repo = "tamarin-prover";
|
2019-01-18 19:22:52 +00:00
|
|
|
rev = "d2e1c57311ce4ed0ef46d0372c4995b8fdc25323";
|
|
|
|
sha256 = "1bf2qvb646jg3qxd6jgp9ja3wlr888wchxi9mfr3kg7hfn63vxbq";
|
2017-12-30 22:12:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# tamarin has its own dependencies, but they're kept inside the repo,
|
|
|
|
# no submodules. this factors out the common metadata among all derivations
|
|
|
|
common = pname: src: {
|
|
|
|
inherit pname version src;
|
|
|
|
|
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
homepage = https://tamarin-prover.github.io;
|
|
|
|
description = "Security protocol verification in the symbolic model";
|
|
|
|
maintainers = [ lib.maintainers.thoughtpolice ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# tamarin use symlinks to the LICENSE and Setup.hs files, so for these sublibraries
|
|
|
|
# we set the patchPhase to fix that. otherwise, cabal cries a lot.
|
|
|
|
replaceSymlinks = ''
|
|
|
|
cp --remove-destination ${src}/LICENSE .;
|
|
|
|
cp --remove-destination ${src}/Setup.hs .;
|
|
|
|
'';
|
|
|
|
|
|
|
|
tamarin-prover-utils = mkDerivation (common "tamarin-prover-utils" (src + "/lib/utils") // {
|
2018-09-13 13:11:09 +01:00
|
|
|
postPatch = replaceSymlinks;
|
2017-12-30 22:12:40 +00:00
|
|
|
libraryHaskellDepends = with haskellPackages; [
|
|
|
|
base base64-bytestring binary blaze-builder bytestring containers
|
|
|
|
deepseq dlist fclabels mtl pretty safe SHA syb time transformers
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
tamarin-prover-term = mkDerivation (common "tamarin-prover-term" (src + "/lib/term") // {
|
2018-09-13 13:11:09 +01:00
|
|
|
postPatch = replaceSymlinks;
|
2017-12-30 22:12:40 +00:00
|
|
|
libraryHaskellDepends = (with haskellPackages; [
|
|
|
|
attoparsec base binary bytestring containers deepseq dlist HUnit
|
|
|
|
mtl process safe
|
|
|
|
]) ++ [ tamarin-prover-utils ];
|
|
|
|
});
|
|
|
|
|
|
|
|
tamarin-prover-theory = mkDerivation (common "tamarin-prover-theory" (src + "/lib/theory") // {
|
2018-09-13 13:11:09 +01:00
|
|
|
postPatch = replaceSymlinks;
|
2017-12-30 22:12:40 +00:00
|
|
|
doHaddock = false; # broken
|
|
|
|
libraryHaskellDepends = (with haskellPackages; [
|
|
|
|
aeson aeson-pretty base binary bytestring containers deepseq dlist
|
|
|
|
fclabels mtl parallel parsec process safe text transformers uniplate
|
|
|
|
]) ++ [ tamarin-prover-utils tamarin-prover-term ];
|
|
|
|
});
|
|
|
|
|
|
|
|
in
|
|
|
|
mkDerivation (common "tamarin-prover" src // {
|
|
|
|
isLibrary = false;
|
|
|
|
isExecutable = true;
|
|
|
|
|
|
|
|
# strip out unneeded deps manually
|
|
|
|
doHaddock = false;
|
|
|
|
enableSharedExecutables = false;
|
|
|
|
postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
|
|
|
|
|
2018-05-07 11:18:06 +01:00
|
|
|
# Fix problem with MonadBaseControl not being found
|
|
|
|
patchPhase = ''
|
|
|
|
sed -ie 's,\(import *\)Control\.Monad$,&\
|
|
|
|
\1Control.Monad.Trans.Control,' src/Web/Handler.hs
|
|
|
|
|
|
|
|
sed -ie 's~\( *, \)mtl~&\
|
|
|
|
\1monad-control~' tamarin-prover.cabal
|
2019-01-18 19:22:52 +00:00
|
|
|
|
|
|
|
patch -p1 < ${./sapic-native.patch}
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
cd plugins/sapic && make sapic && cd ../..
|
2018-05-07 11:18:06 +01:00
|
|
|
'';
|
|
|
|
|
2017-12-31 01:39:23 +00:00
|
|
|
# wrap the prover to be sure it can find maude, sapic, etc
|
2019-01-18 19:22:52 +00:00
|
|
|
executableToolDepends = [ makeWrapper which maude graphviz ];
|
2017-12-30 22:12:40 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/tamarin-prover \
|
2019-01-18 19:22:52 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ which maude graphviz ]}
|
2018-03-31 22:55:03 +01:00
|
|
|
# so that the package can be used as a vim plugin to install syntax coloration
|
2018-05-07 17:01:50 +01:00
|
|
|
install -Dt $out/share/vim-plugins/tamarin-prover/syntax/ etc/{spthy,sapic}.vim
|
2018-03-31 22:55:03 +01:00
|
|
|
install etc/filetype.vim -D $out/share/vim-plugins/tamarin-prover/ftdetect/tamarin.vim
|
2019-01-18 19:22:52 +00:00
|
|
|
install -m0755 ./plugins/sapic/sapic $out/bin/sapic
|
2017-12-30 22:12:40 +00:00
|
|
|
'';
|
|
|
|
|
2017-12-31 01:39:23 +00:00
|
|
|
checkPhase = "./dist/build/tamarin-prover/tamarin-prover test";
|
|
|
|
|
2019-01-18 19:22:52 +00:00
|
|
|
executableSystemDepends = [ ocaml ];
|
2017-12-30 22:12:40 +00:00
|
|
|
executableHaskellDepends = (with haskellPackages; [
|
|
|
|
base binary binary-orphans blaze-builder blaze-html bytestring
|
2018-05-07 11:18:06 +01:00
|
|
|
cmdargs conduit containers monad-control deepseq directory fclabels file-embed
|
2018-05-07 17:01:50 +01:00
|
|
|
filepath gitrev http-types HUnit lifted-base mtl monad-unlift parsec process
|
2017-12-30 22:12:40 +00:00
|
|
|
resourcet safe shakespeare tamarin-prover-term
|
|
|
|
template-haskell text threads time wai warp yesod-core yesod-static
|
|
|
|
]) ++ [ tamarin-prover-utils
|
|
|
|
tamarin-prover-term
|
|
|
|
tamarin-prover-theory
|
|
|
|
];
|
2019-09-24 14:25:43 +01:00
|
|
|
|
|
|
|
broken = true;
|
2017-12-30 22:12:40 +00:00
|
|
|
})
|