guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 92/96] gnu: Add ocaml-piqilib


From: Julien Lepiller
Subject: [PATCH 92/96] gnu: Add ocaml-piqilib
Date: Tue, 3 Jan 2017 20:12:13 +0100

* gnu/packages/ocaml.scm (ocaml-piqilib): New package.
* gnu/packages/patches/ocaml-piqilib-fix-makefile.patch: New file.
* gnu/local.mk (dist_patch_DATA): New patch.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/ocaml.scm                             | 38 +++++++++++++++++
 .../patches/ocaml-piqilib-fix-makefile.patch       | 47 ++++++++++++++++++++++
 3 files changed, 86 insertions(+)
 create mode 100644 gnu/packages/patches/ocaml-piqilib-fix-makefile.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 0b879c367..ba04b9648 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -757,6 +757,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/ocaml-findlib-make-install.patch        \
   %D%/packages/patches/ocaml-janestreet-fix-libdir.patch \
   %D%/packages/patches/ocaml-omake-fix-non-determinism.patch   \
+  %D%/packages/patches/ocaml-piqilib-fix-makefile.patch \
   %D%/packages/patches/ola-readdir-r.patch                     \
   %D%/packages/patches/openexr-missing-samples.patch           \
   %D%/packages/patches/openjpeg-CVE-2016-5157.patch            \
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index ed24aa526..68e941cc9 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -2800,3 +2800,41 @@ the OCaml standard library.")
     (synopsis "Optional compilation with cpp-like directives")
     (description "Optional compilation with cpp-like directives.")
     (license license:bsd-3)))
+
+(define-public ocaml-piqilib
+  (package
+    (name "ocaml-piqilib")
+    (version "0.6.13")
+    (home-page "http://piqi.org";)
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/alavrik/piqi/archive/v";
+                                  version ".tar.gz"))
+              (sha256
+                (base32
+                  "1whqr2bb3gds2zmrzqnv8vqka9928w4lx6mi6g244kmbwb2h8d8l"))
+              (patches (search-patches "ocaml-piqilib-fix-makefile.patch"))))
+    (build-system ocaml-build-system)
+    (arguments
+        `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "make/OCamlMakefile"
+                 (("/bin/sh") (which "bash")))
+               (zero? (system* "./configure" "--prefix" out "--ocaml-libdir"
+                               (string-append out "/lib/ocaml"))))))
+       (add-after 'install 'install-ocaml
+         (lambda* (#:key outputs #:allow-other-keys)
+           (zero? (system* "make" "ocaml-install")))))))
+    (native-inputs `(("which" ,which)
+                     ("camlp4" ,camlp4)))
+    (propagated-inputs `(("xmlm" ,ocaml-xmlm)
+                         ("ulex" ,ocaml-ulex)
+                         ("optcomp" ,ocaml-optcomp)
+                         ("easy-format" ,ocaml-easy-format)
+                         ("base64" ,ocaml-base64)))
+    (synopsis "Data serialization and conversion library")
+    (description "Common library used by piqi command-line tool and 
piqi-ocaml.")
+    (license license:asl2.0)))
diff --git a/gnu/packages/patches/ocaml-piqilib-fix-makefile.patch 
b/gnu/packages/patches/ocaml-piqilib-fix-makefile.patch
new file mode 100644
index 000000000..a21b21983
--- /dev/null
+++ b/gnu/packages/patches/ocaml-piqilib-fix-makefile.patch
@@ -0,0 +1,47 @@
+From 336e69d6882a1b8d725c43f1c2e340ef4464bac5 Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <address@hidden>
+Date: Sat, 31 Dec 2016 11:21:14 +0100
+Subject: [PATCH] fix OCAMLPATH in makefile
+
+---
+ Makefile            | 2 +-
+ make/Makefile.ocaml | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4db87da..9315887 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,7 +23,7 @@ OCAMLFIND_DESTDIR := $(shell cygpath -w $(OCAMLFIND_DESTDIR))
+ endif
+ export OCAMLFIND_DESTDIR
+
+-OCAMLPATH := $(PIQI_ROOT)/deps
++OCAMLPATH := $(OCAMLPATH):$(PIQI_ROOT)/deps
+ ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64))
+ OCAMLPATH := $(shell cygpath -w $(OCAMLPATH))
+ endif
+diff --git a/make/Makefile.ocaml b/make/Makefile.ocaml
+index 2b6324d..b82c041 100644
+--- a/make/Makefile.ocaml
++++ b/make/Makefile.ocaml
+@@ -1,7 +1,7 @@
+ OCAMLMAKEFILE := $(PIQI_ROOT)/make/OCamlMakefile
+
+
+-OCAMLPATH := $(PIQI_BUILD)/lib/ocaml
++OCAMLPATH := $(OCAMLPATH):$(PIQI_BUILD)/lib/ocaml
+ ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64))
+ OCAMLPATH := $(shell cygpath -w $(OCAMLPATH))
+ endif
+@@ -23,6 +23,7 @@ post_target::
+
+
+ .ml.mli: $(EXTRADEPS)
++                      echo $(OCAMLPATH)
+                       $(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) 
\*)/\1/p;q' $<`; \
+                       if [ -z "$$pp" ]; then \
+                         $(ECHO) $(REAL_OCAMLFIND) $(INTF_OCAMLC) 
$(OCAML_FIND_PACKAGES) \
+--
+2.11.0
+
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]