summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-lang/mercury-extras/ChangeLog16
-rw-r--r--dev-lang/mercury-extras/Manifest6
-rw-r--r--dev-lang/mercury-extras/files/digest-mercury-extras-0.12.23
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-0.12.2-concurrency.patch11
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_glut.patch24
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_opengl.patch81
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_tcltk.patch20
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-0.12.2-odbc.patch340
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-0.12.2-trailed_update.patch22
-rw-r--r--dev-lang/mercury-extras/mercury-extras-0.12.2.ebuild95
-rw-r--r--dev-lang/mercury-extras/metadata.xml9
11 files changed, 627 insertions, 0 deletions
diff --git a/dev-lang/mercury-extras/ChangeLog b/dev-lang/mercury-extras/ChangeLog
new file mode 100644
index 000000000000..80240373f3ed
--- /dev/null
+++ b/dev-lang/mercury-extras/ChangeLog
@@ -0,0 +1,16 @@
+# ChangeLog for dev-lang/mercury-extras
+# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/ChangeLog,v 1.1 2006/03/27 11:06:43 keri Exp $
+
+*mercury-extras-0.12.2 (27 Mar 2006)
+
+ 27 Mar 2006; Keri Harris <keri@gentoo.org>
+ +files/mercury-extras-0.12.2-concurrency.patch,
+ +files/mercury-extras-0.12.2-mercury_glut.patch,
+ +files/mercury-extras-0.12.2-mercury_opengl.patch,
+ +files/mercury-extras-0.12.2-mercury_tcltk.patch,
+ +files/mercury-extras-0.12.2-odbc.patch,
+ +files/mercury-extras-0.12.2-trailed_update.patch, +metadata.xml,
+ +mercury-extras-0.12.2.ebuild:
+ Initial import.
+
diff --git a/dev-lang/mercury-extras/Manifest b/dev-lang/mercury-extras/Manifest
new file mode 100644
index 000000000000..bd3cf76569ea
--- /dev/null
+++ b/dev-lang/mercury-extras/Manifest
@@ -0,0 +1,6 @@
+MD5 04bb3f50c82519cd929f7754557a4124 files/digest-mercury-extras-0.12.2 265
+RMD160 e18050a352bc3f86650cf53244bbb17545ef0817 files/digest-mercury-extras-0.12.2 265
+SHA256 087bf13f383826ff1da30ff861cfc48008b7037a9a844f14fee94f51934ec525 files/digest-mercury-extras-0.12.2 265
+MD5 1c0e6c59a3dd3961fed73048c30620bd mercury-extras-0.12.2.ebuild 2454
+RMD160 df71c9d0e320da4b7c0a0d1efd2d193607db6818 mercury-extras-0.12.2.ebuild 2454
+SHA256 2c2b4e532a5de55510d6808d79e841ba5c0734e08d19ad2d6497b20fe0ba00b0 mercury-extras-0.12.2.ebuild 2454
diff --git a/dev-lang/mercury-extras/files/digest-mercury-extras-0.12.2 b/dev-lang/mercury-extras/files/digest-mercury-extras-0.12.2
new file mode 100644
index 000000000000..13cdfec9edd6
--- /dev/null
+++ b/dev-lang/mercury-extras/files/digest-mercury-extras-0.12.2
@@ -0,0 +1,3 @@
+MD5 31101288778657de8bf063abe970bb70 mercury-extras-0.12.2.tar.gz 759070
+RMD160 3e7c4c67590408d2da056135c9560ff4d078eff6 mercury-extras-0.12.2.tar.gz 759070
+SHA256 3a5be0941fad7ed8f8d2e967138984127510ba388b65b0f3f35f46ae8b6b43a8 mercury-extras-0.12.2.tar.gz 759070
diff --git a/dev-lang/mercury-extras/files/mercury-extras-0.12.2-concurrency.patch b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-concurrency.patch
new file mode 100644
index 000000000000..6742134600d6
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-concurrency.patch
@@ -0,0 +1,11 @@
+--- mercury-extras-0.12.2.orig/concurrency/Mmakefile 2003-01-16 23:44:13.000000000 +1300
++++ mercury-extras-0.12.2/concurrency/Mmakefile 2006-03-26 18:45:21.000000000 +1200
+@@ -8,6 +8,8 @@
+
+ TESTS = philo philo2 philo3 midimon
+
++LIBGRADES := $(LIBGRADES:hlc.gc=)
++
+ -include ../Mmake.params
+
+ default_target: all
diff --git a/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_glut.patch b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_glut.patch
new file mode 100644
index 000000000000..6475491c0fef
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_glut.patch
@@ -0,0 +1,24 @@
+--- mercury-extras-0.12.2.orig/graphics/mercury_glut/Mmakefile 2004-05-17 20:28:51.000000000 +1200
++++ mercury-extras-0.12.2/graphics/mercury_glut/Mmakefile 2006-03-26 22:37:20.000000000 +1200
+@@ -13,10 +13,10 @@
+ # The following libraries are for X on Linux (Debian) using Mesa.
+
+ # Libaries required by X windows.
+-X_LIBS = -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/X11R6/lib
++# X_LIBS = -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/X11R6/lib
+
+ # Libraries required by OpenGL.
+-GL_LIBS = -lGL -LGL
++# GL_LIBS = -lGL -LGL
+
+ MCFLAGS-mercury_glut+=--no-warn-nothing-exported --no-warn-interface-imports
+
+@@ -26,7 +26,7 @@
+ MGNUCFLAGS = --pic-reg
+ EXTRA_MLFLAGS = -shared
+
+-MLLIBS = -lglut $(X_LIBS) $(GL_LIBS)
++MLLIBS = -lglut
+
+ depend: mercury_glut.depend
+
diff --git a/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_opengl.patch b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_opengl.patch
new file mode 100644
index 000000000000..c9bc5260bece
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_opengl.patch
@@ -0,0 +1,81 @@
+--- mercury-extras-0.12.2.orig/graphics/mercury_opengl/Mmakefile 2004-12-01 14:45:30.000000000 +1300
++++ mercury-extras-0.12.2/graphics/mercury_opengl/Mmakefile 2006-03-26 10:41:53.000000000 +1200
+@@ -11,7 +11,7 @@
+
+ # Specify what libraries we need to link against for OpenGL on this system.
+ # (The following works on Debian with mesa as the OpenGL implementation).
+-GL_LIBS = -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXi -lXmu -lXt -lICE -lXext -lSM
++GL_LIBS = -lGL -lGLU
+
+ # Don't issue a warning because mercury_opengl doesn't export anything.
+ MCFLAGS-mercury_opengl = --no-warn-nothing-exported
+--- mercury-extras-0.12.2.orig/graphics/mercury_opengl/Mmakefile.mtogl 2004-12-01 14:45:30.000000000 +1300
++++ mercury-extras-0.12.2/graphics/mercury_opengl/Mmakefile.mtogl 2006-03-26 23:50:23.000000000 +1200
+@@ -11,29 +11,30 @@
+ MLOBJS-mtogl = togl.o
+
+ # Specify the location of the `mercury_tcltk' package.
+-MERCURY_TCLTK_DIR = ../mercury_tcltk
++# MERCURY_TCLTK_DIR = ../mercury_tcltk
+
+ # Specify the version of Tcl/Tk.
+-TCLTK_VERSION = 8.0
++TCLTK_VERSION = 8.4
+
+ # Specify what libraries we need to link against for Tcl/Tk on this system.
+-TCLTK_LIBS = -ltcl$(TCLTK_VERSION) -ltk$(TCLTK_VERSION) -ldl
++TCLTK_LIBS = -ltcl -ltk -ldl
++GL_LIBS = -lGL -lGLU -lX11 -lXmu
+
+ # Tell mmake to use the `mercury_tcltk' library.
+-VPATH = $(MERCURY_TCLTK_DIR):$(MMAKE_VPATH)
+-MCFLAGS = -I$(MERCURY_TCLTK_DIR) $(EXTRA_MCFLAGS)
+-MLFLAGS = -R$(MERCURY_TCLTK_DIR) $(EXTRA_MLFLAGS) \
+- -L$(MERCURY_TCLTK_DIR)
+-MLLIBS = $(TCLTK_LIBS) $(EXTRA_MLLIBS)
+-C2INITARGS = $(MERCURY_TCLTK_DIR)/mercury_tcltk.init
++# VPATH = $(MERCURY_TCLTK_DIR):$(MMAKE_VPATH)
++# MCFLAGS = -I$(MERCURY_TCLTK_DIR) $(EXTRA_MCFLAGS)
++# MLFLAGS = -R$(MERCURY_TCLTK_DIR) $(EXTRA_MLFLAGS) \
++# -L$(MERCURY_TCLTK_DIR)
++MLLIBS = $(TCLTK_LIBS) $(GL_LIBS) $(EXTRA_MLLIBS)
++# C2INITARGS = $(MERCURY_TCLTK_DIR)/mercury_tcltk.init
+
+ # We may need to tell mmake where tcl.h and tk.h are.
+ # If we are using Tcl/Tk version 8.0 on Debian the include directory
+ # we need is `/usr/include/tcl8.0/generic'.
+-CFLAGS = -I/usr/include/tcl$(TCLTK_VERSION)
++# CFLAGS = -I/usr/include/tcl$(TCLTK_VERSION)
+
+ # We need to also access mtcltk.mh
+-MGNUCFLAGS = -I$(MERCURY_TCLTK_DIR)
++MGNUCFLAGS = -I/usr/lib/tk$(TCLTK_VERSION)/include/generic
+
+ depend: mtogl.depend
+
+--- mercury-extras-0.12.2.orig/graphics/mercury_opengl/togl.c 2003-08-13 17:49:46.000000000 +1200
++++ mercury-extras-0.12.2/graphics/mercury_opengl/togl.c 2006-03-26 09:42:40.000000000 +1200
+@@ -274,22 +274,7 @@
+ #include <tcl.h>
+ #include <tk.h>
+ #if defined(X11)
+-#if TK_MAJOR_VERSION==4 && TK_MINOR_VERSION==0
+-# include "tkInt4.0.h"
+-# define NO_TK_CURSOR
+-#elif TK_MAJOR_VERSION==4 && TK_MINOR_VERSION==1
+-# include "tkInt4.1.h"
+-#elif TK_MAJOR_VERSION==4 && TK_MINOR_VERSION==2
+-# include "tkInt4.2.h"
+-#elif TK_MAJOR_VERSION==8 && TK_MINOR_VERSION==0 && TK_RELEASE_SERIAL==0
+-# include "tkInt8.0.h"
+-#elif TK_MAJOR_VERSION==8 && TK_MINOR_VERSION==0 && TK_RELEASE_SERIAL==2
+-# include "tkInt8.0p2.h"
+-#elif TK_MAJOR_VERSION==8 && TK_MINOR_VERSION==0 && TK_RELEASE_SERIAL==5
+-# include "tkInt8.0p5.h"
+-#else
+- Sorry, you will have to edit togl.c to include the right tkInt.h file
+-#endif
++#include <tkInt.h>
+ #elif defined(WIN32)
+ #if TK_MAJOR_VERSION<8
+ Sorry Windows version requires Tcl/Tk ver 8.0 or higher.
diff --git a/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_tcltk.patch b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_tcltk.patch
new file mode 100644
index 000000000000..db43dcee2771
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-mercury_tcltk.patch
@@ -0,0 +1,20 @@
+--- mercury-extras-0.12.2.orig/graphics/mercury_tcltk/Mmakefile 2005-08-15 21:12:13.000000000 +1200
++++ mercury-extras-0.12.2/graphics/mercury_tcltk/Mmakefile 2006-03-26 11:37:21.000000000 +1200
+@@ -4,14 +4,13 @@
+ # Public License - see the file COPYING.LIB in the Mercury distribution.
+ #-----------------------------------------------------------------------------#
+
++INSTALL_PREFIX := $(INSTALL_PREFIX)/extras
++
+ include Mercury.options
+
+ # You may need to modify the line below
+
+-MLLIBS = -ltk8.4 -ltcl8.4 -L/usr/X11R6/lib -lX11 -lXmu -lXext -lm -ldl \
+- -lXt -lICE -lSM
+-
+-MLFLAGS = -R/usr/X11R6/lib
++MLLIBS = -ltk -ltcl
+
+ # On some Linux machines you may need to let mgnuc know where the
+ # tcl/tk header files are.
diff --git a/dev-lang/mercury-extras/files/mercury-extras-0.12.2-odbc.patch b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-odbc.patch
new file mode 100644
index 000000000000..a274618386ff
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-odbc.patch
@@ -0,0 +1,340 @@
+--- mercury-extras-0.12.2.orig/odbc/Mmakefile 2003-01-16 23:44:21.000000000 +1300
++++ mercury-extras-0.12.2/odbc/Mmakefile 2006-03-26 17:23:25.000000000 +1200
+@@ -37,16 +37,18 @@
+ ODBC_INCL_DIR=$(ODBC_SDK_DIR)/include
+ MLLIBS=-lodbc32
+ else
+- ODBC_LIB_DIR=$(IODBC_DIR)/lib
+- ODBC_INCL_DIR=$(IODBC_DIR)/include
++ ODBC_LIBS=`iodbc-config --libs`
++ ODBC_INCLS=`iodbc-config --cflags`
+ # note: on a DEC Alpha using OSF1 remove the -ldl.
+- MLLIBS=-L$(ODBC_LIB_DIR) -R$(ODBC_LIB_DIR) -liodbc -ldl
++ MLLIBS=-$(ODBC_LIBS) -lpthread -ldl
+ endif
+
+-MAIN_TARGET=odbc_test
++MAIN_TARGET=libodbc
+
+ .PHONY: depend
+-depend: odbc_test.depend
++depend: odbc.depend
++
++install: libodbc.install
+
+ .PHONY: check
+ check:
+@@ -57,7 +59,7 @@
+ # `--no-ansi' is needed because the ODBC header files include C++-style
+ # "//" comments. `--no-ansi' allows recognition of C++-style "//" comments,
+ # presuming you have gcc version 2.7.1 or greater.
+-MGNUCFLAGS=--no-ansi -D$(MODBC_DRIVER) -D$(MODBC_DB) -I$(ODBC_INCL_DIR)
++MGNUCFLAGS=-D$(MODBC_DRIVER) -D$(MODBC_DB) $(ODBC_INCLS)
+
+ #-----------------------------------------------------------------------------#
+ #-----------------------------------------------------------------------------#
+--- mercury-extras-0.12.2.orig/odbc/odbc.m 2005-02-13 02:50:41.000000000 +1300
++++ mercury-extras-0.12.2/odbc/odbc.m 2006-03-26 16:05:49.000000000 +1200
+@@ -1316,38 +1316,38 @@
+ Status::out, DB0::di, DB::uo),
+ may_call_mercury,
+ "{
+- MODBC_Statement *stat;
++ MODBC_Statement *statement;
+
+- stat = (MODBC_Statement *) Statement0;
++ statement = (MODBC_Statement *) Statement0;
+
+- MR_assert(stat != NULL);
++ MR_assert(statement != NULL);
+
+- if (stat->num_rows == 0 ) {
++ if (statement->num_rows == 0 ) {
+ MR_DEBUG(printf(""Fetching rows...\\n""));
+ }
+
+ /* Fetching new row */
+- Status = SQLFetch(stat->stat_handle);
++ Status = SQLFetch(statement->stat_handle);
+
+ if (Status != SQL_NO_DATA_FOUND &&
+ ! odbc_check(odbc_env_handle, odbc_connection,
+- stat->stat_handle, Status))
++ statement->stat_handle, Status))
+ {
+- odbc_do_cleanup_statement(stat);
++ odbc_do_cleanup_statement(statement);
+ odbc_throw();
+ /* not reached */
+ }
+
+ /* Update number of rows fetched */
+ if (Status == SQL_SUCCESS) {
+- stat->num_rows++;
++ statement->num_rows++;
+ }
+
+ if (Status == SQL_NO_DATA_FOUND) {
+- MR_DEBUG(printf(""Fetched %d rows\\n"", stat->num_rows));
++ MR_DEBUG(printf(""Fetched %d rows\\n"", statement->num_rows));
+ }
+
+- Statement = (MR_Word) stat;
++ Statement = (MR_Word) statement;
+ DB = DB0;
+
+ }").
+@@ -1362,13 +1362,13 @@
+ Statement::uo, DB0::di, DB::uo),
+ will_not_call_mercury,
+ "{
+- MODBC_Statement * stat;
++ MODBC_Statement * statement;
+
+- stat = (MODBC_Statement *) Statement0;
++ statement = (MODBC_Statement *) Statement0;
+
+- MR_assert(stat != NULL);
++ MR_assert(statement != NULL);
+
+- NumColumns = stat->num_columns;
++ NumColumns = statement->num_columns;
+ DB = DB0;
+ Statement = Statement0;
+ }").
+@@ -1384,25 +1384,25 @@
+ may_call_mercury,
+ "{
+
+- MODBC_Statement *stat;
++ MODBC_Statement *statement;
+ MODBC_Column *col;
+ SQLRETURN rc;
+ SDWORD column_info;
+
+- stat = (MODBC_Statement *) Statement0;
++ statement = (MODBC_Statement *) Statement0;
+
+- MR_assert(stat != NULL);
+- MR_assert(stat->row != NULL);
++ MR_assert(statement != NULL);
++ MR_assert(statement->row != NULL);
+
+- MR_DEBUG(printf(""Getting column %i\n"", (int) Column));
++ MR_DEBUG(printf(""Getting column %i\\n"", (int) Column));
+
+- if (stat->binding_type == MODBC_GET_DATA) {
++ if (statement->binding_type == MODBC_GET_DATA) {
+
+ /* Slurp up the data for this column. */
+- odbc_do_get_data(stat, Column);
++ odbc_do_get_data(statement, Column);
+ }
+
+- col = &(stat->row[Column]);
++ col = &(statement->row[Column]);
+
+ if (col->value_info == SQL_NULL_DATA) {
+ Type = MODBC_NULL;
+@@ -1430,7 +1430,7 @@
+ odbc_message_list =
+ MR_list_cons(overflow_message,
+ odbc_message_list);
+- odbc_do_cleanup_statement(stat);
++ odbc_do_cleanup_statement(statement);
+ odbc_throw();
+ }
+ break;
+@@ -1475,7 +1475,7 @@
+ break;
+ } /* end switch (Type) */
+
+- Statement = (MR_Word) stat;
++ Statement = (MR_Word) statement;
+ DB = DB0;
+
+ } /* end odbc__get_data() */
+@@ -1484,7 +1484,7 @@
+ :- pragma c_code("
+
+ void
+-odbc_do_get_data(MODBC_Statement *stat, int column_id)
++odbc_do_get_data(MODBC_Statement *statement, int column_id)
+ {
+ MODBC_Column *column;
+ SQLRETURN rc;
+@@ -1494,11 +1494,11 @@
+ ** byte and nothing else.
+ */
+
+- column = &(stat->row[column_id]);
++ column = &(statement->row[column_id]);
+ if (column->attr_type == MODBC_VAR_STRING) {
+
+ /* Just get the length first time through. */
+- rc = SQLGetData(stat->stat_handle, column_id,
++ rc = SQLGetData(statement->stat_handle, column_id,
+ column->conversion_type, dummy_buffer,
+ 1, &(column->value_info));
+
+@@ -1510,9 +1510,9 @@
+ if (rc != SQL_SUCCESS_WITH_INFO &&
+ ! odbc_check(odbc_env_handle,
+ odbc_connection,
+- stat->stat_handle, rc))
++ statement->stat_handle, rc))
+ {
+- odbc_do_cleanup_statement(stat);
++ odbc_do_cleanup_statement(statement);
+ odbc_throw();
+ }
+
+@@ -1535,7 +1535,7 @@
+ ** length of the available data, rather than the
+ ** total length of data available.
+ */
+- odbc_get_data_in_chunks(stat, column_id);
++ odbc_get_data_in_chunks(statement, column_id);
+ } else {
+ MR_Word data;
+
+@@ -1545,40 +1545,40 @@
+ column->size = column->value_info + 1;
+ MR_incr_hp_atomic(MR_LVALUE_CAST(MR_Word, column->data),
+ (column->size + sizeof(MR_Word)) / sizeof(MR_Word));
+- odbc_get_data_in_one_go(stat, column_id);
++ odbc_get_data_in_one_go(statement, column_id);
+ }
+ } else {
+ /*
+ ** It's a fixed length column, so we can
+ ** get the lot in one go.
+ */
+- odbc_get_data_in_one_go(stat, column_id);
++ odbc_get_data_in_one_go(statement, column_id);
+ }
+ }
+
+ void
+-odbc_get_data_in_one_go(MODBC_Statement *stat, int column_id)
++odbc_get_data_in_one_go(MODBC_Statement *statement, int column_id)
+ {
+ MODBC_Column *col;
+ SQLRETURN rc;
+
+- MR_DEBUG(printf(""getting column %i in one go\n"", column_id));
++ MR_DEBUG(printf(""getting column %i in one go\\n"", column_id));
+
+- col = &(stat->row[column_id]);
++ col = &(statement->row[column_id]);
+
+- rc = SQLGetData(stat->stat_handle, column_id, col->conversion_type,
++ rc = SQLGetData(statement->stat_handle, column_id, col->conversion_type,
+ (SQLPOINTER) col->data, col->size, &(col->value_info));
+
+ if (! odbc_check(odbc_env_handle, odbc_connection,
+- stat->stat_handle, rc))
++ statement->stat_handle, rc))
+ {
+- odbc_do_cleanup_statement(stat);
++ odbc_do_cleanup_statement(statement);
+ odbc_throw();
+ }
+ }
+
+ void
+-odbc_get_data_in_chunks(MODBC_Statement *stat, int column_id)
++odbc_get_data_in_chunks(MODBC_Statement *statement, int column_id)
+ {
+ MODBC_Column *col;
+ SQLRETURN rc;
+@@ -1586,11 +1586,11 @@
+ MR_Word chunk_list;
+ String result;
+
+- MR_DEBUG(printf(""getting column %i in chunks\n"", column_id));
++ MR_DEBUG(printf(""getting column %i in chunks\\n"", column_id));
+
+ chunk_list = MR_list_empty();
+
+- col = &(stat->row[column_id]);
++ col = &(statement->row[column_id]);
+
+ rc = SQL_SUCCESS_WITH_INFO;
+
+@@ -1601,7 +1601,7 @@
+ */
+ while (rc == SQL_SUCCESS_WITH_INFO) {
+
+- rc = SQLGetData(stat->stat_handle, column_id,
++ rc = SQLGetData(statement->stat_handle, column_id,
+ col->conversion_type, (SQLPOINTER) this_bit,
+ MODBC_CHUNK_SIZE - 1, &(col->value_info));
+
+@@ -1611,9 +1611,9 @@
+
+ if (rc != SQL_SUCCESS_WITH_INFO &&
+ ! odbc_check(odbc_env_handle, odbc_connection,
+- stat->stat_handle, rc))
++ statement->stat_handle, rc))
+ {
+- odbc_do_cleanup_statement(stat);
++ odbc_do_cleanup_statement(statement);
+ odbc_throw();
+ }
+
+@@ -1655,12 +1655,12 @@
+ odbc__cleanup_statement_check_error(Statement::di, DB0::di, DB::uo),
+ may_call_mercury,
+ "{
+- MODBC_Statement *stat;
++ MODBC_Statement *statement;
+ SQLRETURN rc;
+
+- stat = (MODBC_Statement *) Statement;
++ statement = (MODBC_Statement *) Statement;
+
+- rc = odbc_do_cleanup_statement(stat);
++ rc = odbc_do_cleanup_statement(statement);
+ if (! odbc_check(odbc_env_handle, odbc_connection,
+ SQL_NULL_HSTMT, rc))
+ {
+@@ -1672,29 +1672,29 @@
+ :- pragma c_code("
+
+ static SQLRETURN
+-odbc_do_cleanup_statement(MODBC_Statement *stat)
++odbc_do_cleanup_statement(MODBC_Statement *statement)
+ {
+ int i;
+ SQLRETURN rc;
+
+- if (stat != NULL) {
++ if (statement != NULL) {
+ MR_DEBUG(printf(""cleaning up statement\\n""));
+- if (stat->row != NULL) {
+- for (i = 1; i <= stat->num_columns; i++) {
++ if (statement->row != NULL) {
++ for (i = 1; i <= statement->num_columns; i++) {
+ /*
+ ** Variable length types are allocated directly
+ ** onto the Mercury heap, so don't free them here.
+ */
+ if (! is_variable_length_sql_type(
+- stat->row[i].sql_type))
++ statement->row[i].sql_type))
+ {
+- MR_GC_free(stat->row[i].data);
++ MR_GC_free(statement->row[i].data);
+ }
+ }
+- MR_GC_free(stat->row);
++ MR_GC_free(statement->row);
+ }
+- rc = SQLFreeStmt(stat->stat_handle, SQL_DROP);
+- MR_GC_free(stat);
++ rc = SQLFreeStmt(statement->stat_handle, SQL_DROP);
++ MR_GC_free(statement);
+ return rc;
+ } else {
+ return SQL_SUCCESS;
diff --git a/dev-lang/mercury-extras/files/mercury-extras-0.12.2-trailed_update.patch b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-trailed_update.patch
new file mode 100644
index 000000000000..75281dd710b9
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-0.12.2-trailed_update.patch
@@ -0,0 +1,22 @@
+--- mercury-extras-0.12.2.orig/trailed_update/Mmakefile 2004-07-30 19:03:46.000000000 +1200
++++ mercury-extras-0.12.2/trailed_update/Mmakefile 2006-03-26 22:00:13.000000000 +1200
+@@ -4,6 +4,10 @@
+ # Public License - see the file COPYING.LIB in the Mercury distribution.
+ #-----------------------------------------------------------------------------#
+
++LIBGRADES := $(foreach grade,$(LIBGRADES), \
++ $(subst .tr.,$(grade),$(findstring .tr.,$(grade))) \
++ $(filter %.tr,$(grade)))
++
+ GRADEFLAGS += --use-trail
+
+ # enable C debugging
+@@ -25,6 +29,8 @@
+ cd samples && mmake $(MMAKEFLAGS) depend
+ cd tests && mmake $(MMAKEFLAGS) depend
+
++install: libtrailed_update.install
++
+ .PHONY: check
+ check: libtrailed_update
+ cd samples && mmake $(MMAKEFLAGS) check
diff --git a/dev-lang/mercury-extras/mercury-extras-0.12.2.ebuild b/dev-lang/mercury-extras/mercury-extras-0.12.2.ebuild
new file mode 100644
index 000000000000..b2c16c044181
--- /dev/null
+++ b/dev-lang/mercury-extras/mercury-extras-0.12.2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-0.12.2.ebuild,v 1.1 2006/03/27 11:06:43 keri Exp $
+
+inherit eutils
+
+DESCRIPTION="Additional libraries and tools that are not part of the Mercury standard library"
+HOMEPAGE="http://www.cs.mu.oz.au/research/mercury/index.html"
+SRC_URI="ftp://ftp.mercury.cs.mu.oz.au/pub/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+
+IUSE="doc glut iodbc opengl tcltk"
+
+DEPEND="~dev-lang/mercury-0.12.2
+ sys-libs/ncurses
+ glut? ( virtual/glut )
+ iodbc? ( dev-db/libiodbc )
+ opengl? ( virtual/opengl )
+ tcktk? ( =dev-lang/tk-8.4*
+ x11-libs/libX11
+ x11-libs/libXmu )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-concurrency.patch
+ epatch "${FILESDIR}"/${P}-mercury_glut.patch
+ epatch "${FILESDIR}"/${P}-mercury_tcltk.patch
+ epatch "${FILESDIR}"/${P}-mercury_opengl.patch
+ epatch "${FILESDIR}"/${P}-odbc.patch
+ epatch "${FILESDIR}"/${P}-trailed_update.patch
+
+ sed -i -e "s:curs:concurrency curs:" \
+ -e "s:posix:posix quickcheck:" \
+ -e "s:xml:trailed_update xml:" Mmakefile
+
+ use iodbc && sed -i -e "s:moose:moose odbc:" Mmakefile
+ use glut && sed -i -e "s: lex : graphics/mercury_glut lex :" Mmakefile
+ use tcltk && sed -i -e "s: lex : graphics/mercury_tcltk lex :" Mmakefile
+ use opengl && sed -i -e "s: lex : graphics/mercury_opengl lex :" Mmakefile
+}
+
+src_compile() {
+ mmake depend || die "mmake depend failed"
+ mmake || die "mmake failed"
+
+ if use opengl && use tcltk ; then
+ cd "${S}"/graphics/mercury_opengl
+ cp ../mercury_tcltk/mtcltk.m ./
+ mmake -f Mmakefile.mtogl depend || die "mmake depend mtogl failed"
+ mmake -f Mmakefile.mtogl || die "mmake mtogl failed"
+ fi
+}
+
+src_install() {
+ cd "${S}"
+ mmake INSTALL_PREFIX="${D}"/usr install || die "mmake install failed"
+
+ if use opengl && use tcltk ; then
+ cd "${S}"/graphics/mercury_opengl
+ mv Mmakefile Mmakefile.opengl
+ mv Mmakefile.mtogl Mmakefile
+ mmake INSTALL_PREFIX="${D}"/usr \
+ install || die "mmake install mtogl failed"
+ fi
+
+ cd "${S}"
+ if use doc ; then
+ docinto samples/complex_numbers
+ dodoc complex_numbers/samples/*.m
+
+ docinto samples/curs
+ dodoc curs/samples/*.m
+
+ docinto samples/curses
+ dodoc curses/sample/*.m
+
+ docinto samples/dynamic_linking
+ dodoc dynamic_linking/hello.m
+
+ docinto samples/lex
+ dodoc lex/samples/*.m
+
+ docinto samples/moose
+ dodoc moose/samples/*.m moose/samples/*.moo
+
+ docinto samples/references
+ dodoc references/samples/*.m
+ fi
+
+ dodoc README
+}
diff --git a/dev-lang/mercury-extras/metadata.xml b/dev-lang/mercury-extras/metadata.xml
new file mode 100644
index 000000000000..5391604cf31e
--- /dev/null
+++ b/dev-lang/mercury-extras/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer>
+ <email>keri@gentoo.org</email>
+ <name>Keri Harris</name>
+</maintainer>
+</pkgmetadata>