>From 3647f7d8e330e1f6fbb60596739a21ccd1bd85f3 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 21 Sep 2017 20:44:57 +0200 Subject: [PATCH 05/10] gnu: Add ocaml-piqilib. * gnu/packages/ocaml.scm (ocaml-piqilib): New variable. --- gnu/packages/ocaml.scm | 53 ++++++++++++++++++++++ .../patches/ocaml-piqilib-fix-makefile.patch | 47 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 gnu/packages/patches/ocaml-piqilib-fix-makefile.patch diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index 4cb66bd2b..00665959a 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -3303,6 +3303,59 @@ Format module of the OCaml standard library.") cpp-like directives.") (license license:bsd-3))) +(define-public ocaml-piqilib + (package + (name "ocaml-piqilib") + (version "0.6.13") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/alavrik/piqi/archive/v" + version ".tar.gz")) + (sha256 + (base32 + "1whqr2bb3gds2zmrzqnv8vqka9928w4lx6mi6g244kmbwb2h8d8l")) + (file-name (string-append name "-" version ".tar.gz")) + (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/site-lib")))))) + (add-after 'build 'build-ocaml + (lambda* (#:key outputs #:allow-other-keys) + (zero? (system* "make" "ocaml")))) + (add-after 'install 'install-ocaml + (lambda* (#:key outputs #:allow-other-keys) + (zero? (system* "make" "ocaml-install")))) + (add-after 'install-ocaml 'link-stubs + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (stubs (string-append out "/lib/ocaml/site-lib/stubslibs")) + (lib (string-append out "/lib/ocaml/site-lib/piqilib"))) + (mkdir-p stubs) + (symlink (string-append lib "/dllpiqilib_stubs.so") + (string-append stubs "/dllpiqilib_stubs.so")))))))) + (native-inputs + `(("which" ,which) + ("camlp4" ,camlp4))) + (propagated-inputs + `(("xmlm" ,ocaml-xmlm) + ("ulex" ,ocaml-ulex) + ("optcomp" ,optcomp) + ("easy-format" ,ocaml-easy-format) + ("base64" ,ocaml-base64))) + (home-page "http://piqi.org") + (synopsis "Data serialization and conversion library") + (description "Piqilib is the common library used by the piqi command-line +tool and piqi-ocaml.") + (license license:asl2.0))) + (define-public coq-flocq (package (name "coq-flocq") 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 +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.14.1