1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-01 10:00:56 +00:00
nixpkgs/pkgs/applications/science/logic/acgtk/default.nix

58 lines
2 KiB
Nix
Raw Normal View History

2017-07-08 07:52:02 +01:00
{ stdenv, fetchurl, ocamlPackages,
2014-10-28 13:06:21 +00:00
buildBytecode ? true,
buildNative ? true,
installExamples ? true,
installEmacsMode ? true }:
let inherit (stdenv.lib) versionAtLeast optionalString; in
2014-10-28 13:06:21 +00:00
2017-07-08 07:52:02 +01:00
let inherit (ocamlPackages) ocaml camlp4; in
2014-10-28 13:06:21 +00:00
assert buildBytecode || buildNative;
stdenv.mkDerivation {
2017-07-08 07:52:02 +01:00
name = "acgtk-1.3.1";
2014-10-28 13:06:21 +00:00
src = fetchurl {
2017-07-08 07:52:02 +01:00
url = http://calligramme.loria.fr/acg/software/acg-1.3.1-20170303.tar.gz;
sha256 = "1hhrf6bx2x2wbv5ldn4fnxhpr9lyrj3zh1vcnx8wf8f06ih4rzfq";
2014-10-28 13:06:21 +00:00
};
2017-07-08 07:52:02 +01:00
buildInputs = with ocamlPackages; [
2017-12-09 08:38:50 +00:00
ocaml findlib camlp4 ansiterminal biniou bolt cairo2 dypgen easy-format ocf yojson
2017-07-08 07:52:02 +01:00
];
2014-10-28 13:06:21 +00:00
patches = [ ./install-emacs-to-site-lisp.patch
./use-nix-ocaml-byteflags.patch ];
2017-11-27 05:37:11 +00:00
postPatch = optionalString (camlp4 != null) ''
2015-06-24 23:24:04 +01:00
substituteInPlace src/Makefile.master.in \
2017-07-08 07:52:02 +01:00
--replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4/"
2017-11-27 05:37:11 +00:00
'' + optionalString (versionAtLeast (stdenv.lib.getVersion ocamlPackages.yojson) "1.4") ''
substituteInPlace src/scripting/Makefile.in --replace yojson.cmo yojson.cma
2015-06-24 23:24:04 +01:00
'';
2014-10-28 13:06:21 +00:00
# The bytecode executable is dependent on the dynamic library provided by
# ANSITerminal. We can use the -dllpath flag of ocamlc (analogous to
# -rpath) to make sure that ocamlrun is able to link the library at
# runtime and that Nix detects a runtime dependency.
2017-07-08 07:52:02 +01:00
NIX_OCAML_BYTEFLAGS = "-dllpath ${ocamlPackages.ansiterminal}/lib/ocaml/${ocaml.version}/site-lib/ANSITerminal";
2014-10-28 13:06:21 +00:00
buildFlags = optionalString buildBytecode "byte"
+ " "
+ optionalString buildNative "opt";
installTargets = "install"
+ " " + optionalString installExamples "install-examples"
+ " " + optionalString installEmacsMode "install-emacs";
meta = with stdenv.lib; {
2017-08-17 22:58:03 +01:00
homepage = http://calligramme.loria.fr/acg/;
2014-10-28 13:06:21 +00:00
description = "A toolkit for developing ACG signatures and lexicon";
license = licenses.cecill20;
platforms = ocaml.meta.platforms or [];
2014-10-28 13:06:21 +00:00
maintainers = [ maintainers.jirkamarsik ];
};
}