From 01baff6a433f6061141d578f80cf46cf7e1d4754 Mon Sep 17 00:00:00 2001
From: Alexis Ballier <aballier@gentoo.org>
Date: Sat, 6 Oct 2012 21:05:21 +0000
Subject: initial import, bug #425098, by Jacques-Pascal Deplaix

(Portage version: 2.2.0_alpha135/cvs/Linux x86_64)
---
 dev-ml/pgocaml/ChangeLog                        | 11 +++
 dev-ml/pgocaml/files/pgocaml-1.6-makefile.patch | 30 ++++++++
 dev-ml/pgocaml/files/pgocaml-1.6-test.patch     | 27 ++++++++
 dev-ml/pgocaml/metadata.xml                     |  8 +++
 dev-ml/pgocaml/pgocaml-1.6.ebuild               | 91 +++++++++++++++++++++++++
 5 files changed, 167 insertions(+)
 create mode 100644 dev-ml/pgocaml/ChangeLog
 create mode 100644 dev-ml/pgocaml/files/pgocaml-1.6-makefile.patch
 create mode 100644 dev-ml/pgocaml/files/pgocaml-1.6-test.patch
 create mode 100644 dev-ml/pgocaml/metadata.xml
 create mode 100644 dev-ml/pgocaml/pgocaml-1.6.ebuild

(limited to 'dev-ml/pgocaml')

diff --git a/dev-ml/pgocaml/ChangeLog b/dev-ml/pgocaml/ChangeLog
new file mode 100644
index 000000000000..10578b141fdd
--- /dev/null
+++ b/dev-ml/pgocaml/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for dev-ml/pgocaml
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ml/pgocaml/ChangeLog,v 1.1 2012/10/06 21:05:20 aballier Exp $
+
+*pgocaml-1.6 (07 Oct 2012)
+
+  07 Oct 2012; Alexis Ballier <aballier@gentoo.org> +pgocaml-1.6.ebuild,
+  +files/pgocaml-1.6-makefile.patch, +files/pgocaml-1.6-test.patch,
+  +metadata.xml:
+  initial import, bug #425098, by Jacques-Pascal Deplaix
+
diff --git a/dev-ml/pgocaml/files/pgocaml-1.6-makefile.patch b/dev-ml/pgocaml/files/pgocaml-1.6-makefile.patch
new file mode 100644
index 000000000000..ba691fb45955
--- /dev/null
+++ b/dev-ml/pgocaml/files/pgocaml-1.6-makefile.patch
@@ -0,0 +1,30 @@
+Fix depends for a test file in the Makefile
+
+--- a/Makefile	2012-07-04 19:53:31.000000000 +0200
++++ b/Makefile	2012-09-10 14:24:48.502757692 +0200
+@@ -19,7 +19,7 @@
+ include Makefile.config
+ 
+ ifeq ($(USE_BATTERIES),yes)
+-EXTLIB := batteries
++EXTLIB := camomile,batteries
+ else
+ EXTLIB := extlib
+ endif
+@@ -44,11 +44,15 @@
+ 
+ GETLIB=-I +$(1) $(shell ocamlfind query $(1) -predicates byte -format "%d/%a")
+ 
++COMMA = ,
++
+ FOR_P4  := \
+ 	$(call GETLIB,unix) \
+ 	$(call GETLIB,str) \
++	$(call GETLIB,num.core) \
++	$(call GETLIB,bigarray) \
+ 	$(call GETLIB,pcre) \
+-	$(call GETLIB,$(EXTLIB)) \
++	$(shell ocamlfind query $(subst $(COMMA), ,$(EXTLIB)) -predicates byte -format "%d/%a") \
+ 	$(call GETLIB,calendar) \
+ 	$(call GETLIB,csv) \
+ 	./pgocaml.cma
diff --git a/dev-ml/pgocaml/files/pgocaml-1.6-test.patch b/dev-ml/pgocaml/files/pgocaml-1.6-test.patch
new file mode 100644
index 000000000000..d33c8dfbfdfa
--- /dev/null
+++ b/dev-ml/pgocaml/files/pgocaml-1.6-test.patch
@@ -0,0 +1,27 @@
+Fix the lowlevel test with the batteries USE flag
+
+--- a/test_pgocaml_lowlevel.ml	2012-04-10 20:45:04.000000000 +0200
++++ b/test_pgocaml_lowlevel.ml	2012-09-15 16:45:37.104790274 +0200
+@@ -22,7 +22,11 @@
+ 
+ open Printf
+ 
++IFDEF USE_BATTERIES THEN
++module List = BatList
++ELSE
+ open ExtList
++ENDIF
+ 
+ let print_row i row =
+   printf "row %d: [%s]\n" i
+--- a/Makefile	2012-07-04 19:53:31.000000000 +0200
++++ b/Makefile	2012-09-15 17:00:58.384820257 +0200
+@@ -84,7 +84,7 @@
+ #
+ 
+ test_pgocaml_lowlevel$(EXECUTABLE_SUFFIX): test_pgocaml_lowlevel.cmo pgocaml.cma
+-	ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $(OCAMLCLIBS) pgocaml.cma -o $@ $<
++	ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLSYNTAX) $(OCAMLCPACKAGES) $(OCAMLCLIBS) pgocaml.cma -o $@ $<
+ 
+ test_pgocaml$(EXECUTABLE_SUFFIX): test_pgocaml.cmo pgocaml.cma
+ 	ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $(OCAMLCLIBS) pgocaml.cma -o $@ $<
diff --git a/dev-ml/pgocaml/metadata.xml b/dev-ml/pgocaml/metadata.xml
new file mode 100644
index 000000000000..2bf9f17d9357
--- /dev/null
+++ b/dev-ml/pgocaml/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ml</herd>
+		<use>
+			<flag name='batteries'>Enable Batteries support instead of extlib</flag>
+		</use>
+</pkgmetadata>
diff --git a/dev-ml/pgocaml/pgocaml-1.6.ebuild b/dev-ml/pgocaml/pgocaml-1.6.ebuild
new file mode 100644
index 000000000000..7f7733471f8d
--- /dev/null
+++ b/dev-ml/pgocaml/pgocaml-1.6.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ml/pgocaml/pgocaml-1.6.ebuild,v 1.1 2012/10/06 21:05:20 aballier Exp $
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="PG'OCaml is a set of OCaml bindings for the PostgreSQL database"
+HOMEPAGE="http://pgocaml.forge.ocamlcore.org/"
+SRC_URI="http://forge.ocamlcore.org/frs/download.php/922/${P}.tgz"
+
+LICENSE="LGPL-2.1-with-linking-exception"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc batteries"
+
+DEPEND="dev-ml/calendar
+	!batteries? ( dev-ml/extlib )
+	batteries? ( dev-ml/batteries )
+	dev-ml/csv
+	dev-ml/pcre-ocaml
+	>=dev-lang/ocaml-3.10[ocamlopt]"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+	epatch "${FILESDIR}/${P}-test.patch"
+	epatch "${FILESDIR}/${P}-makefile.patch"
+}
+
+src_configure() {
+	echo "DESTDIR := \"${ED}/\"" >> Makefile.config
+	use batteries && echo "USE_BATTERIES := yes" >> Makefile.config
+	emake depend
+}
+
+src_compile() {
+	use doc && emake doc
+	emake
+}
+
+src_test() {
+	local default_pguser="postgres"
+	local default_pghost="localhost"
+	local default_pgport=""
+
+	einfo "The tests need a running PostgreSQL server."
+	einfo "Test requires PGUSER or/and PGPORT or/and PGHOST to be set."
+	einfo "If there are not, defaults are:"
+	einfo "    PGUSER=${default_pguser}"
+	einfo "    PGHOST=${default_pghost}"
+	einfo "    PGPORT=${default_pgport}"
+	einfo "Define them at the command line or in:"
+	einfo "    ${EROOT%/}/etc/pgocaml_test_env"
+
+	local user_defined_pguser=$PGUSER
+	local user_defined_pghost=$PGHOST
+	local user_defined_pgport=$PGPORT
+
+	unset PGUSER
+	unset PGHOST
+	unset PGPORT
+
+	if [[ -f ${EROOT%/}/etc/pgocaml_test_env ]]; then
+		source "${EROOT%/}/etc/pgocaml_test_env"
+	fi
+	[[ -n $PGUSER ]] && export PGUSER
+	[[ -n $PGHOST ]] && export PGHOST
+	[[ -n $PGPORT ]] && export PGPORT
+
+	[[ -n $user_defined_pguser ]] && export PGUSER=$user_defined_pguser
+	[[ -n $user_defined_pghost ]] && export PGHOST=$user_defined_pghost
+	[[ -n $user_defined_pgport ]] && export PGPORT=$user_defined_pgport
+
+	[[ -z $PGUSER ]] && export PGUSER=${default_pguser}
+	[[ -z $PGHOST ]] && export PGHOST=${default_pghost}
+	[[ -z $PGPORT ]] && export PGPORT=${default_pgport}
+
+	einfo "PGUSER set to: ${PGUSER}"
+	einfo "PGHOST set to: ${PGHOST}"
+	einfo "PGPORT set to: ${PGPORT}"
+
+	emake test
+}
+
+src_install() {
+	emake install
+	dodoc BUGS.txt CONTRIBUTORS.txt HOW_IT_WORKS.txt README.txt \
+		CHANGELOG.txt README.profiling
+	use doc && dohtml -r html
+}
-- 
cgit v1.2.3-65-gdbad