about summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorJiri Marsik <jiri.marsik89@gmail.com>2014-10-28 14:06:21 +0100
committerJiri Marsik <jiri.marsik89@gmail.com>2014-10-28 14:06:21 +0100
commitceba23605c35de2a1eb41ac1a951036389f3238a (patch)
tree77d2b4eff1ef1f9dc46467c09871f05a4bf55d17 /pkgs/applications/science
parentb4b3368c8ddd513255ffe7c48e52750e0189d7cb (diff)
downloadnixlib-ceba23605c35de2a1eb41ac1a951036389f3238a.tar
nixlib-ceba23605c35de2a1eb41ac1a951036389f3238a.tar.gz
nixlib-ceba23605c35de2a1eb41ac1a951036389f3238a.tar.bz2
nixlib-ceba23605c35de2a1eb41ac1a951036389f3238a.tar.lz
nixlib-ceba23605c35de2a1eb41ac1a951036389f3238a.tar.xz
nixlib-ceba23605c35de2a1eb41ac1a951036389f3238a.tar.zst
nixlib-ceba23605c35de2a1eb41ac1a951036389f3238a.zip
Added acgtk-1.1
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/logic/acgtk/default.nix51
-rw-r--r--pkgs/applications/science/logic/acgtk/install-emacs-to-site-lisp.patch23
-rw-r--r--pkgs/applications/science/logic/acgtk/use-nix-ocaml-byteflags.patch11
3 files changed, 85 insertions, 0 deletions
diff --git a/pkgs/applications/science/logic/acgtk/default.nix b/pkgs/applications/science/logic/acgtk/default.nix
new file mode 100644
index 000000000000..41c6cf75f325
--- /dev/null
+++ b/pkgs/applications/science/logic/acgtk/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, ocaml, findlib, dypgen, bolt, ansiterminal,
+  buildBytecode ? true,
+  buildNative ? true,
+  installExamples ? true,
+  installEmacsMode ? true }:
+
+let inherit (stdenv.lib) getVersion versionAtLeast
+                         optionals optionalString; in
+
+assert versionAtLeast (getVersion ocaml) "3.07";
+assert versionAtLeast (getVersion dypgen) "20080925";
+assert versionAtLeast (getVersion bolt) "1.4";
+
+assert buildBytecode || buildNative;
+
+stdenv.mkDerivation {
+
+  name = "acgtk-1.1";
+
+  src = fetchurl {
+    url = "http://www.loria.fr/equipes/calligramme/acg/software/acg-1.1-20140905.tar.gz";
+    sha256 = "1k1ldqg34bwmgdpmi9gry9czlsk85ycjxnkd25fhlf3mmgg4n9p6";
+  };
+
+  buildInputs = [ ocaml findlib dypgen bolt ansiterminal ];
+
+  patches = [ ./install-emacs-to-site-lisp.patch
+              ./use-nix-ocaml-byteflags.patch ];
+
+  # 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.
+  NIX_OCAML_BYTEFLAGS = "-dllpath ${ansiterminal}/lib/ocaml/${getVersion ocaml}/site-lib/ANSITerminal";
+
+  buildFlags = optionalString buildBytecode "byte"
+             + " "
+             + optionalString buildNative "opt";
+
+  installTargets = "install"
+                 + " " + optionalString installExamples "install-examples"
+                 + " " + optionalString installEmacsMode "install-emacs";
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.loria.fr/equipes/calligramme/acg";
+    description = "A toolkit for developing ACG signatures and lexicon";
+    license = licenses.cecill20;
+    platforms = ocaml.meta.platforms;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
diff --git a/pkgs/applications/science/logic/acgtk/install-emacs-to-site-lisp.patch b/pkgs/applications/science/logic/acgtk/install-emacs-to-site-lisp.patch
new file mode 100644
index 000000000000..43ddd20b4a39
--- /dev/null
+++ b/pkgs/applications/science/logic/acgtk/install-emacs-to-site-lisp.patch
@@ -0,0 +1,23 @@
+--- acg-1.1-20140905/Makefile.in	2014-10-24 15:21:39.442287208 +0200
++++ acg-1.1-20140905/Makefile.in.new	2014-10-24 15:24:58.557117228 +0200
+@@ -35,6 +35,7 @@
+ ACGC_DIR=src/acg-data
+ 
+ DATA_DIR=@datarootdir@/acgtk
++EMACS_DIR=@prefix@/share/emacs/site-lisp
+ 
+ 
+ 
+@@ -82,10 +83,10 @@
+ 	rm -r $(DATA_DIR)
+ 
+ install-emacs:
+-	mkdir -p $(DATA_DIR) && cp -r emacs $(DATA_DIR)/.
++	mkdir -p $(EMACS_DIR) && cp emacs/acg.el $(EMACS_DIR)
+ 
+ uninstall-emacs:
+-	rm -rf $(DATA_DIR)/emacs
++	rm -rf $(EMACS_DIR)/emacs
+ 
+ install-examples:
+ 	mkdir -p $(DATA_DIR) && cp -r examples $(DATA_DIR)/.
diff --git a/pkgs/applications/science/logic/acgtk/use-nix-ocaml-byteflags.patch b/pkgs/applications/science/logic/acgtk/use-nix-ocaml-byteflags.patch
new file mode 100644
index 000000000000..26ade37e4521
--- /dev/null
+++ b/pkgs/applications/science/logic/acgtk/use-nix-ocaml-byteflags.patch
@@ -0,0 +1,11 @@
+--- acg-1.1-20140905/src/Makefile.master.in	2014-10-27 10:59:42.263382081 +0100
++++ acg-1.1-20140905/src/Makefile.master.in.new	2014-10-27 10:59:59.683597972 +0100
+@@ -23,7 +23,7 @@
+ # All warnings are treated as errors
+ WARNINGS = @OCAML09WARNINGS@ -warn-error A
+ COMMONFLAGS= $(WARNINGS) @TYPES@
+-BYTEFLAGS = $(COMMONFLAGS) $(DEBUGFLAG)
++BYTEFLAGS = $(COMMONFLAGS) $(DEBUGFLAG) $(NIX_OCAML_BYTEFLAGS)
+ OPTFLAGS = $(COMMONFLAGS)
+ LFLAGS= -a
+