summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-lang/mercury-extras/ChangeLog18
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-curs.patch314
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-dynamic-linking.patch11
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-iodbc.patch69
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-lex.patch31
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_glut.patch24
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_opengl.patch21
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_tcltk.patch27
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-odbc.patch60
-rw-r--r--dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-posix.patch12
-rw-r--r--dev-lang/mercury-extras/mercury-extras-10.04_beta1.ebuild133
-rw-r--r--dev-lang/mercury/ChangeLog13
-rw-r--r--dev-lang/mercury/files/mercury-10.04_beta1-docs.patch20
-rw-r--r--dev-lang/mercury/files/mercury-10.04_beta1-multilib.patch116
-rw-r--r--dev-lang/mercury/files/mercury-10.04_beta1-no-reconf.patch59
-rw-r--r--dev-lang/mercury/files/mercury-10.04_beta1-tests-workspace.patch29
-rw-r--r--dev-lang/mercury/mercury-10.04_beta1.ebuild128
17 files changed, 1081 insertions, 4 deletions
diff --git a/dev-lang/mercury-extras/ChangeLog b/dev-lang/mercury-extras/ChangeLog
index 30191b3f8468..980e00af9743 100644
--- a/dev-lang/mercury-extras/ChangeLog
+++ b/dev-lang/mercury-extras/ChangeLog
@@ -1,6 +1,20 @@
# ChangeLog for dev-lang/mercury-extras
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/ChangeLog,v 1.69 2008/12/25 22:15:14 keri Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/ChangeLog,v 1.70 2010/02/13 02:53:06 keri Exp $
+
+*mercury-extras-10.04_beta1 (13 Feb 2010)
+
+ 13 Feb 2010; <keri@gentoo.org> +mercury-extras-10.04_beta1.ebuild,
+ +files/mercury-extras-10.04_beta1-curs.patch,
+ +files/mercury-extras-10.04_beta1-dynamic-linking.patch,
+ +files/mercury-extras-10.04_beta1-iodbc.patch,
+ +files/mercury-extras-10.04_beta1-lex.patch,
+ +files/mercury-extras-10.04_beta1-mercury_glut.patch,
+ +files/mercury-extras-10.04_beta1-mercury_opengl.patch,
+ +files/mercury-extras-10.04_beta1-mercury_tcltk.patch,
+ +files/mercury-extras-10.04_beta1-odbc.patch,
+ +files/mercury-extras-10.04_beta1-posix.patch:
+ Version bump
25 Dec 2008; <keri@gentoo.org>
-files/mercury-extras-0.12.2-concurrency.patch,
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-curs.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-curs.patch
new file mode 100644
index 000000000000..e6cac458982f
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-curs.patch
@@ -0,0 +1,314 @@
+diff -u mercury-extras-10.04-beta.orig/curs/curs.m mercury-extras-10.04-beta/curs/curs.m
+--- mercury-extras-10.04-beta.orig/curs/curs.m 2006-04-21 15:37:10.000000000 +1200
++++ mercury-extras-10.04-beta/curs/curs.m 2010-02-13 12:46:18.000000000 +1300
+@@ -31,6 +31,8 @@
+ :- import_module io.
+ :- import_module string.
+
++:- include_module curs__panel.
++
+ %-----------------------------------------------------------------------------%
+
+ % Start a curses session (colour, unbuffered input, no echoing,
+@@ -210,90 +212,6 @@
+ :- func cyan = colour.
+ :- func white = colour.
+
+- %-------------------------------------------------------------------------%
+- %-------------------------------------------------------------------------%
+-
+- % Panels are windows over the main display; they may be
+- % stacked, moved, ordered and hidden. Contents of panels
+- % closer to the top of the stack obscure the parts of panels
+- % they overlap that are lower in the stack.
+- %
+- :- module panel.
+- :- interface.
+-
+- :- type panel.
+-
+- % new(Rows, Cols, Row, Col, Attr, Panel) creates a new panel
+- % Panel whose size is given by (Rows, Cols) and whose position
+- % on the display is given by (Row, Col). The new panel starts
+- % visible and at the top of the stack. The default attributes
+- % for the panel are set to Attr.
+- %
+- :- pred new(int::in, int::in, int::in, int::in, attr::in, panel::out,
+- io::di, io::uo) is det.
+-
+- % Destroy a panel.
+- %
+- :- pred delete(panel::in, io::di, io::uo) is det.
+-
+- % Raise/lower a panel to the top/bottom of the stack.
+- %
+- :- pred raise(panel::in, io::di, io::uo) is det.
+- :- pred lower(panel::in, io::di, io::uo) is det.
+-
+- % Hide/reveal a panel (revealing places it at the top of the stack).
+- %
+- :- pred hide(panel::in, io::di, io::uo) is det.
+- :- pred reveal(panel::in, io::di, io::uo) is det.
+-
+- % Move a panel to (Row, Col) on the display.
+- %
+- :- pred relocate(panel::in, int::in, int::in, io::di, io::uo) is det.
+-
+- % Clear a panel.
+- %
+- :- pred clear(panel::in, io::di, io::uo) is det.
+-
+- % Move the virtual cursor to given row and column; (0, 0) are the
+- % coordinates for the upper left hand corner of the panel.
+- %
+- :- pred move(panel::in, int::in, int::in, io::di, io::uo) is det.
+-
+- % Add a char/string to a panel with the given attributes.
+- % Note that char codes are passed rather than plain chars.
+- %
+- :- pred addch(panel::in, attr::in, int::in, io::di, io::uo) is det.
+- :- pred addstr(panel::in, attr::in, string::in, io::di, io::uo) is det.
+-
+- % Turn on/off or set attributes that will be applied by default.
+- %
+- :- pred attr_on(panel::in, attr::in, io::di, io::uo) is det.
+- :- pred attr_off(panel::in, attr::in, io::di, io::uo) is det.
+- :- pred attr_set(panel::in, attr::in, io::di, io::uo) is det.
+-
+- % Update the display (also calls doupdate).
+- % NOTE: doupdate does not call update_panels.
+- %
+- :- pred update_panels(io::di, io::uo) is det.
+-
+- % Draws a border around the inside edge of the display.
+- %
+- :- pred border(panel::in, io::di, io::uo) is det.
+-
+- % Draws an horizontal line of length N moving to the right.
+- %
+- :- pred hline(panel::in, int::in, int::in, io::di, io::uo) is det.
+-
+- % Draws a vertical line of length N moving down.
+- %
+- :- pred vline(panel::in, int::in, int::in, io::di, io::uo) is det.
+-
+- :- end_module panel.
+-
+- %-------------------------------------------------------------------------%
+- %-------------------------------------------------------------------------%
+-
+-%-----------------------------------------------------------------------------%
+ %-----------------------------------------------------------------------------%
+
+ :- implementation.
+@@ -1044,210 +962,4 @@
+ IO = IO0;
+ ").
+
+- %-------------------------------------------------------------------------%
+- %-------------------------------------------------------------------------%
+-
+- :- module panel.
+-
+- :- implementation.
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_decl("C", "
+-
+- #include <ncurses.h>
+- #include <panel.h>
+-
+- ").
+-
+- :- pragma foreign_type("C", panel, "PANEL *").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- new(Rows::in, Cols::in, Row::in, Col::in, Attr::in, Panel::out,
+- IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- WINDOW *w = newwin(Rows, Cols, Row, Col);
+- scrollok(w, TRUE);
+- wattrset(w, Attr);
+- wcolor_set(w, Attr, NULL);
+- wclear(w);
+- Panel = new_panel(w);
+-
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- delete(Panel::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- delwin(panel_window(Panel));
+- del_panel(Panel);
+-
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- raise(Panel::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- top_panel(Panel);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- lower(Panel::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- bottom_panel(Panel);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- hide(Panel::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- hide_panel(Panel);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- reveal(Panel::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- show_panel(Panel);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- relocate(Panel::in, Row::in, Col::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- move_panel(Panel, Row, Col);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- clear(Panel::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- wclear(panel_window(Panel));
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- move(Panel::in, Row::in, Col::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- wmove(panel_window(Panel), Row, Col);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- addch(Panel::in, Attr::in, CharCode::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- waddch(panel_window(Panel), (chtype)Attr | (chtype)CharCode);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- addstr(Panel, Attr, Str, !IO) :-
+- string.foldl(
+- ( pred(Char::in, !.IO::di, !:IO::uo) is det :-
+- addch(Panel, Attr, char.to_int(Char), !IO)
+- ),
+- Str, !IO
+- ).
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- attr_on(Panel::in, Attr::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- wattron(panel_window(Panel), Attr);
+- IO = IO0;
+- ").
+-
+- :- pragma foreign_proc("C",
+- attr_off(Panel::in, Attr::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- wattroff(panel_window(Panel), Attr);
+- IO = IO0;
+- ").
+-
+- :- pragma foreign_proc("C",
+- attr_set(Panel::in, Attr::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- wattrset(panel_window(Panel), Attr);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- update_panels(IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- update_panels();
+- doupdate();
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+-
+- :- pragma foreign_proc("C",
+- border(Panel::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- wborder(panel_window(Panel), 0, 0, 0, 0, 0, 0, 0, 0);
+- IO = IO0;
+- ").
+-
+- :- pragma foreign_proc("C",
+- hline(Panel::in, C::in, N::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- whline(panel_window(Panel), C, N);
+- IO = IO0;
+- ").
+-
+- :- pragma foreign_proc("C",
+- vline(Panel::in, C::in, N::in, IO0::di, IO::uo),
+- [will_not_call_mercury, promise_pure],
+- "
+- wvline(panel_window(Panel), C, N);
+- IO = IO0;
+- ").
+-
+- %-------------------------------------------------------------------------%
+- :- end_module panel.
+- %-------------------------------------------------------------------------%
+- %-------------------------------------------------------------------------%
+-
+-%-----------------------------------------------------------------------------%
+ %-----------------------------------------------------------------------------%
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-dynamic-linking.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-dynamic-linking.patch
new file mode 100644
index 000000000000..742b78064a33
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-dynamic-linking.patch
@@ -0,0 +1,11 @@
+--- mercury-extras-10.04-beta.orig/dynamic_linking/Mmakefile 2005-01-25 20:49:05.000000000 +1300
++++ mercury-extras-10.04-beta/dynamic_linking/Mmakefile 2010-02-13 15:17:10.000000000 +1300
+@@ -11,7 +11,7 @@
+ MLFLAGS = --shared
+
+ # Link in the `-ldl' library (this may not be needed on some systems)
+-MLLIBS = -ldl
++MLLIBS = -L/usr/@libdir@ -ldl
+
+ # enable C-level debugging
+ CFLAGS = -g
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-iodbc.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-iodbc.patch
new file mode 100644
index 000000000000..0624d37c88fa
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-iodbc.patch
@@ -0,0 +1,69 @@
+diff -u mercury-extras-10.04-beta.orig/odbc/Mmakefile mercury-extras-10.04-beta/odbc/Mmakefile
+--- mercury-extras-10.04-beta.orig/odbc/Mmakefile 2006-04-03 18:19:54.000000000 +1200
++++ mercury-extras-10.04-beta/odbc/Mmakefile 2010-02-13 14:40:32.000000000 +1300
+@@ -12,7 +12,7 @@
+ # The driver manager.
+ # Legal values for MODBC_DRIVER are MODBC_IODBC, MODBC_UNIX, and MODBC_MS.
+ # Feel free to add more (and handle them in odbc.m).
+-MODBC_DRIVER=MODBC_UNIX
++MODBC_DRIVER=MODBC_IODBC
+
+ # The database.
+ # Legal values for MODBC_DB are MODBC_MYSQL and MODBC_SQL_SERVER.
+@@ -41,17 +41,20 @@
+ # The following are for Debian.
+
+ # for unixODBC
+- MLLIBS=-lodbc -lpthread -lltdl -ldl
+-
++ MLLIBS=`iodbc-config --libs`
++ ODBC_CFLAGS=`iodbc-config --cflags`
+ # for iODBC
+ # MLLIBS=-liodbc l-pthread -ldl
+ # note: on a DEC Alpha using OSF1 remove the -ldl.
+ endif
+
+-MAIN_TARGET=odbc_test
++MAIN_TARGET=libodbc
+
+ .PHONY: depend
+-depend: odbc_test.depend
++depend: odbc.depend
++
++.PHONY: install
++install: libodbc.install
+
+ .PHONY: check
+ check:
+@@ -62,7 +65,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=--no-ansi -D$(MODBC_DRIVER) -D$(MODBC_DB) $(ODBC_CFLAGS)
+
+ #-----------------------------------------------------------------------------#
+ #-----------------------------------------------------------------------------#
+diff -u mercury-extras-10.04-beta.orig/odbc/odbc.m mercury-extras-10.04-beta/odbc/odbc.m
+--- mercury-extras-10.04-beta.orig/odbc/odbc.m 2006-08-31 23:09:50.000000000 +1200
++++ mercury-extras-10.04-beta/odbc/odbc.m 2010-02-13 14:29:04.000000000 +1300
+@@ -2000,8 +2000,8 @@
+ ** Arbitrary size, only needs to hold a
+ ** descriptive string like ""SQL Server"".
+ */
+- String new_dsn;
+- String new_desc;
++ LPSTR new_dsn;
++ LPSTR new_desc;
+ SWORD dsn_len;
+ SWORD desc_len;
+ SQLRETURN rc;
+@@ -2335,7 +2335,7 @@
+ SQLSMALLINT msg_len;
+ UCHAR message[SQL_MAX_MESSAGE_LENGTH];
+ UCHAR sql_state[SQL_SQLSTATE_SIZE + 1];
+- String mercury_message;
++ LPSTR mercury_message;
+ MR_Word new_message;
+
+ MR_ASSERT_IMPLY(connection_handle == SQL_NULL_HDBC,
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-lex.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-lex.patch
new file mode 100644
index 000000000000..e37879fae401
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-lex.patch
@@ -0,0 +1,31 @@
+diff -uN lex/Mmakefile lex/Mmakefile
+--- lex/Mmakefile 1970-01-01 12:00:00.000000000 +1200
++++ lex/Mmakefile 2010-02-13 12:52:46.000000000 +1300
+@@ -0,0 +1,27 @@
++# Copyright (C) 2001 Ralph Becket <rbeck@microsoft.com>
++# Copyright (C) 2002 The University of Melbourne
++
++# To build, do the following:
++#
++# $ mmake depend
++# $ mmake all
++# $ mmake install
++#
++# If you have problems, try the following instead:
++#
++# $ mmake depend
++# $ mmake all
++# $ mmake liblex.install
++# $ mmake libregex.install
++
++MAIN_TARGET = all
++
++.PHONEY: all depend install
++
++all: liblex libregex
++
++depend: lex.depend regex.depend
++
++install:
++ $(MMAKE) $(MMAKEFLAGS) liblex.install
++ $(MMAKE) $(MMAKEFLAGS) libregex.install
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_glut.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_glut.patch
new file mode 100644
index 000000000000..a735b30743d7
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_glut.patch
@@ -0,0 +1,24 @@
+--- mercury-extras-10.04-beta.orig/graphics/mercury_glut/Mmakefile 2006-03-30 14:52:44.000000000 +1200
++++ mercury-extras-10.04-beta/graphics/mercury_glut/Mmakefile 2010-02-13 12:12:57.000000000 +1300
+@@ -13,10 +13,10 @@
+ # The following libraries are for X on Linux (Debian) using Mesa.
+
+ # Libaries required by X windows.
+-X_LIBS = -lX11 -lXext -lXt -lXi -lSM -lICE -L/usr/X11R6/lib
++#X_LIBS = -lX11 -lXext -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-10.04_beta1-mercury_opengl.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_opengl.patch
new file mode 100644
index 000000000000..c04b8eb5a073
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_opengl.patch
@@ -0,0 +1,21 @@
+--- mercury-extras-10.04-beta.orig/graphics/mercury_opengl/Mmakefile 2007-10-11 19:21:31.000000000 +1300
++++ mercury-extras-10.04-beta/graphics/mercury_opengl/Mmakefile 2010-02-13 12:23:34.000000000 +1300
+@@ -17,7 +17,8 @@
+
+ # 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 -lXt -lICE -lXext -lSM
++GL_LIBS = `pkg-config --libs gl` `pkg-config --libs glu`
++GL_CFLAGS = `pkg-config --cflags gl` `pkg-config --cflags glu`
+
+ # Don't issue a warning because mercury_opengl doesn't export anything.
+ MCFLAGS-mercury_opengl = --no-warn-nothing-exported
+@@ -26,7 +27,7 @@
+ # implemented completely.
+ MCFLAGS-mogl = --no-warn-inferred-erroneous
+
+-MCFLAGS = --halt-at-warn --intermodule-optimization
++MCFLAGS = --halt-at-warn --intermodule-optimization $(GL_CFLAGS)
+
+ MLLIBS = $(GL_LIBS) $(EXTRA_MLLIBS)
+
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_tcltk.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_tcltk.patch
new file mode 100644
index 000000000000..b05fbe018d4f
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-mercury_tcltk.patch
@@ -0,0 +1,27 @@
+diff -ur mercury-extras-10.04-beta.orig/graphics/mercury_tcltk/Mmakefile mercury-extras-10.04-beta/graphics/mercury_tcltk/Mmakefile
+--- mercury-extras-10.04-beta.orig/graphics/mercury_tcltk/Mmakefile 2005-08-15 16:11:42.000000000 +1200
++++ mercury-extras-10.04-beta/graphics/mercury_tcltk/Mmakefile 2010-02-13 13:27:23.000000000 +1300
+@@ -8,10 +8,7 @@
+
+ # 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 -ur mercury-extras-10.04-beta.orig/graphics/mercury_tcltk/mtcltk.m mercury-extras-10.04-beta/graphics/mercury_tcltk/mtcltk.m
+--- mercury-extras-10.04-beta.orig/graphics/mercury_tcltk/mtcltk.m 2007-08-21 14:47:37.000000000 +1200
++++ mercury-extras-10.04-beta/graphics/mercury_tcltk/mtcltk.m 2010-02-13 13:45:21.000000000 +1300
+@@ -154,7 +154,7 @@
+ MR_incr_hp(argv_word, argc + 1);
+ argv = (char **) argv_word;
+
+- for (i = 0, l = Args; l != list_empty(); l = list_tail(l), i++) {
++ for (i = 0, l = Args; l != MR_list_empty(); l = MR_list_tail(l), i++) {
+ argv[i] = (char *) MR_list_head(l);
+ }
+
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-odbc.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-odbc.patch
new file mode 100644
index 000000000000..ea427cb5a0c2
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-odbc.patch
@@ -0,0 +1,60 @@
+diff -u mercury-extras-10.04-beta.orig/odbc/Mmakefile mercury-extras-10.04-beta/odbc/Mmakefile
+--- mercury-extras-10.04-beta.orig/odbc/Mmakefile 2006-04-03 18:19:54.000000000 +1200
++++ mercury-extras-10.04-beta/odbc/Mmakefile 2010-02-13 14:40:32.000000000 +1300
+@@ -41,17 +41,20 @@
+ # The following are for Debian.
+
+ # for unixODBC
+- MLLIBS=-lodbc -lpthread -lltdl -ldl
+-
++ MLLIBS=`odbc_config --libs`
++ ODBC_CFLAGS=`odbc_config --cflags`
+ # for iODBC
+ # MLLIBS=-liodbc l-pthread -ldl
+ # note: on a DEC Alpha using OSF1 remove the -ldl.
+ endif
+
+-MAIN_TARGET=odbc_test
++MAIN_TARGET=libodbc
+
+ .PHONY: depend
+-depend: odbc_test.depend
++depend: odbc.depend
++
++.PHONY: install
++install: libodbc.install
+
+ .PHONY: check
+ check:
+@@ -62,7 +65,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=--no-ansi -D$(MODBC_DRIVER) -D$(MODBC_DB) $(ODBC_CFLAGS)
+
+ #-----------------------------------------------------------------------------#
+ #-----------------------------------------------------------------------------#
+diff -u mercury-extras-10.04-beta.orig/odbc/odbc.m mercury-extras-10.04-beta/odbc/odbc.m
+--- mercury-extras-10.04-beta.orig/odbc/odbc.m 2006-08-31 23:09:50.000000000 +1200
++++ mercury-extras-10.04-beta/odbc/odbc.m 2010-02-13 14:29:04.000000000 +1300
+@@ -2000,8 +2000,8 @@
+ ** Arbitrary size, only needs to hold a
+ ** descriptive string like ""SQL Server"".
+ */
+- String new_dsn;
+- String new_desc;
++ LPSTR new_dsn;
++ LPSTR new_desc;
+ SWORD dsn_len;
+ SWORD desc_len;
+ SQLRETURN rc;
+@@ -2335,7 +2335,7 @@
+ SQLSMALLINT msg_len;
+ UCHAR message[SQL_MAX_MESSAGE_LENGTH];
+ UCHAR sql_state[SQL_SQLSTATE_SIZE + 1];
+- String mercury_message;
++ LPSTR mercury_message;
+ MR_Word new_message;
+
+ MR_ASSERT_IMPLY(connection_handle == SQL_NULL_HDBC,
diff --git a/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-posix.patch b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-posix.patch
new file mode 100644
index 000000000000..03a208c09b17
--- /dev/null
+++ b/dev-lang/mercury-extras/files/mercury-extras-10.04_beta1-posix.patch
@@ -0,0 +1,12 @@
+diff -ur mercury-extras-10.04-beta.orig/posix/Mmakefile mercury-extras-10.04-beta/posix/Mmakefile
+--- mercury-extras-10.04-beta.orig/posix/Mmakefile 2008-09-02 21:45:54.000000000 +1200
++++ mercury-extras-10.04-beta/posix/Mmakefile 2010-02-13 10:56:21.000000000 +1300
+@@ -34,7 +34,7 @@
+
+ .PHONY: install
+ install: libposix.install
+- cp $(ADDITIONAL_HDRS) $(INSTALL_PREFIX)/lib/mercury/inc
++ cp $(ADDITIONAL_HDRS) $(INSTALL_PREFIX)/@libdir@/mercury/inc
+
+ .PHONY: clean
+ clean:
diff --git a/dev-lang/mercury-extras/mercury-extras-10.04_beta1.ebuild b/dev-lang/mercury-extras/mercury-extras-10.04_beta1.ebuild
new file mode 100644
index 000000000000..6fa52805d02b
--- /dev/null
+++ b/dev-lang/mercury-extras/mercury-extras-10.04_beta1.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury-extras/mercury-extras-10.04_beta1.ebuild,v 1.1 2010/02/13 02:53:06 keri Exp $
+
+inherit eutils
+
+MY_PV=${PV/%?/}
+MY_P=${PN}-${MY_PV/_/-}
+
+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="http://www.mercury.cs.mu.oz.au/download/files/beta-releases/10.04-beta/mercury-extras-10.04-beta.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE="X examples glut iodbc ncurses odbc opengl tcl tk xml"
+
+DEPEND="~dev-lang/mercury-${PV}
+ glut? ( virtual/glut )
+ odbc? ( dev-db/unixODBC )
+ iodbc? ( !odbc? ( dev-db/libiodbc ) )
+ ncurses? ( sys-libs/ncurses )
+ opengl? ( virtual/opengl )
+ tcl? ( tk? (
+ dev-lang/tcl
+ dev-lang/tk
+ x11-libs/libX11
+ x11-libs/libXmu ) )"
+
+S="${WORKDIR}"/${MY_P}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-curs.patch
+ epatch "${FILESDIR}"/${P}-dynamic-linking.patch
+ epatch "${FILESDIR}"/${P}-lex.patch
+ epatch "${FILESDIR}"/${P}-mercury_glut.patch
+ epatch "${FILESDIR}"/${P}-mercury_tcltk.patch
+ epatch "${FILESDIR}"/${P}-mercury_opengl.patch
+ epatch "${FILESDIR}"/${P}-posix.patch
+
+ if use odbc; then
+ epatch "${FILESDIR}"/${P}-odbc.patch
+ elif use iodbc; then
+ epatch "${FILESDIR}"/${P}-iodbc.patch
+ fi
+
+ sed -i -e "s:posix:posix quickcheck:" \
+ -e "s:references::" \
+ -e "s:windows_installer_generator ::" Mmakefile
+
+ use glut && sed -i -e "s: lex : graphics/mercury_glut lex :" Mmakefile
+ use tcl && use tk && sed -i -e "s: lex : graphics/mercury_tcltk lex :" Mmakefile
+ use opengl && sed -i -e "s: lex : graphics/mercury_opengl lex :" Mmakefile
+
+ if use odbc || use iodbc; then
+ sed -i -e "s:moose:moose odbc:" Mmakefile
+ fi
+
+ ! use ncurses && sed -i -e "s:curs curses::" Mmakefile
+ ! use xml && sed -i -e "s:xml::" Mmakefile
+
+ sed -i -e "s:@libdir@:$(get_libdir):" \
+ dynamic_linking/Mmakefile posix/Mmakefile
+
+ # disable broken packages
+ sed -i -e "s:lazy_evaluation ::" \
+ -e "s:quickcheck::" Mmakefile
+}
+
+src_compile() {
+ mmake \
+ -j1 depend || die "mmake depend failed"
+
+ mmake \
+ MMAKEFLAGS="${MAKEOPTS}" \
+ EXTRA_MLFLAGS=--no-strip \
+ || die "mmake failed"
+}
+
+src_install() {
+ mmake \
+ MMAKEFLAGS="${MAKEOPTS}" \
+ INSTALL_PREFIX="${D}"/usr \
+ install || die "mmake install failed"
+
+ find "${D}"/usr/$(get_libdir)/mercury -type l | xargs rm
+
+ cd "${S}"
+ if use examples; then
+ insinto /usr/share/doc/${PF}/samples/complex_numbers
+ doins complex_numbers/samples/*.m
+
+ if use ncurses; then
+ insinto /usr/share/doc/${PF}/samples/curs
+ doins curs/samples/*.m
+
+ insinto /usr/share/doc/${PF}/samples/curses
+ doins curses/sample/*.m
+ fi
+
+ if use X; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/easyx/samples/*.m
+ fi
+
+ if use glut && use opengl; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/samples/calc/*.m
+ doins graphics/samples/gears/*.m
+ doins graphics/samples/maze/*.m
+ fi
+
+ if use opengl && use tck && use tk; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/samples/pent/*.m
+ fi
+
+ insinto /usr/share/doc/${PF}/samples/dynamic_linking
+ doins dynamic_linking/hello.m
+
+ insinto /usr/share/doc/${PF}/samples/lex
+ doins lex/samples/*.m
+
+ insinto /usr/share/doc/${PF}/samples/moose
+ doins moose/samples/*.m moose/samples/*.moo
+ fi
+
+ dodoc README
+}
diff --git a/dev-lang/mercury/ChangeLog b/dev-lang/mercury/ChangeLog
index 0f83e774de03..0c3107bf8715 100644
--- a/dev-lang/mercury/ChangeLog
+++ b/dev-lang/mercury/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for dev-lang/mercury
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/ChangeLog,v 1.95 2008/12/25 22:07:58 keri Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/ChangeLog,v 1.96 2010/02/13 02:50:34 keri Exp $
+
+*mercury-10.04_beta1 (13 Feb 2010)
+
+ 13 Feb 2010; <keri@gentoo.org> +mercury-10.04_beta1.ebuild,
+ +files/mercury-10.04_beta1-docs.patch,
+ +files/mercury-10.04_beta1-multilib.patch,
+ +files/mercury-10.04_beta1-no-reconf.patch,
+ +files/mercury-10.04_beta1-tests-workspace.patch:
+ Version bump
25 Dec 2008; <keri@gentoo.org> -files/mercury-0.12.2-CFLAGS.patch,
-files/mercury-0.12.2-MAKEOPTS.patch,
diff --git a/dev-lang/mercury/files/mercury-10.04_beta1-docs.patch b/dev-lang/mercury/files/mercury-10.04_beta1-docs.patch
new file mode 100644
index 000000000000..32074b0b3e55
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04_beta1-docs.patch
@@ -0,0 +1,20 @@
+--- mercury-compiler-10.04-beta.orig/doc/Mmakefile 2009-10-02 17:38:22.000000000 +1300
++++ mercury-compiler-10.04-beta/doc/Mmakefile 2010-02-10 05:45:10.000000000 +1300
+@@ -120,7 +120,7 @@
+ # formatted versions of the man pages.
+ # But it might make sense to add them.
+ .PHONY: all
+-all: $(INFOPAGES) $(DVI) $(HTML) manpages $(MDB_DOC)
++all: $(INFOPAGES) $(HTML) manpages $(MDB_DOC)
+ #all: ps pdf text formatted_manpages
+
+ #-----------------------------------------------------------------------------#
+@@ -351,7 +351,7 @@
+ # versions of the documentation. If they are added they should
+ # be installed here.
+ .PHONY: install
+-install: install_info install_html install_dvi install_manpages \
++install: install_info install_html install_manpages \
+ install_mdb_doc
+ # install_text install_ps
+
diff --git a/dev-lang/mercury/files/mercury-10.04_beta1-multilib.patch b/dev-lang/mercury/files/mercury-10.04_beta1-multilib.patch
new file mode 100644
index 000000000000..a037730f60c1
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04_beta1-multilib.patch
@@ -0,0 +1,116 @@
+diff -u mercury-compiler-10.04-beta.orig/compiler/make.program_target.c mercury-compiler-10.04-beta/compiler/make.program_target.c
+--- mercury-compiler-10.04-beta.orig/compiler/make.program_target.c 2010-02-04 12:34:34.000000000 +1300
++++ mercury-compiler-10.04-beta/compiler/make.program_target.c 2010-02-13 07:43:10.000000000 +1300
+@@ -5449,7 +5449,7 @@
+ make__program_target__install_grade_init_6_0_i2);
+ MR_def_label(make__program_target__install_grade_init_6_0,2)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_grade_init_6_0_i3);
+ MR_def_label(make__program_target__install_grade_init_6_0,3)
+@@ -5900,7 +5900,7 @@
+ make__program_target__make_grade_install_dirs_6_0_i2);
+ MR_def_label(make__program_target__make_grade_install_dirs_6_0,2)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__make_grade_install_dirs_6_0_i3);
+ MR_def_label(make__program_target__make_grade_install_dirs_6_0,3)
+@@ -6336,7 +6336,7 @@
+ if ((strcmp((char *) (MR_Word *) MR_sv(3), MR_string_const("java", 4)) != 0)) {
+ MR_GOTO_LAB(make__program_target__install_library_grade_files_10_0_i11);
+ }
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_library_grade_files_10_0_i13);
+ MR_def_label(make__program_target__install_library_grade_files_10_0,13)
+@@ -6393,7 +6393,7 @@
+ if ((strcmp((char *) (MR_Word *) MR_sv(3), MR_string_const("erlang", 6)) != 0)) {
+ MR_GOTO_LAB(make__program_target__install_library_grade_files_10_0_i19);
+ }
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_library_grade_files_10_0_i21);
+ MR_def_label(make__program_target__install_library_grade_files_10_0,21)
+@@ -6458,7 +6458,7 @@
+ make__program_target__install_library_grade_files_10_0_i41);
+ MR_def_label(make__program_target__install_library_grade_files_10_0,19)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_library_grade_files_10_0_i28);
+ MR_def_label(make__program_target__install_library_grade_files_10_0,28)
+@@ -6595,7 +6595,7 @@
+ make__program_target__make_install_dirs_5_0_i2);
+ MR_def_label(make__program_target__make_install_dirs_5_0,2)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__make_install_dirs_5_0_i3);
+ MR_def_label(make__program_target__make_install_dirs_5_0,3)
+@@ -6816,7 +6816,7 @@
+ make__program_target__install_library_7_0_i11);
+ MR_def_label(make__program_target__install_library_7_0,11)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_library_7_0_i12);
+ MR_def_label(make__program_target__install_library_7_0,12)
+@@ -10604,7 +10604,7 @@
+ make__program_target__install_ints_and_headers_8_0_i13);
+ MR_def_label(make__program_target__install_ints_and_headers_8_0,13)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_ints_and_headers_8_0_i14);
+ MR_def_label(make__program_target__install_ints_and_headers_8_0,14)
+@@ -11233,7 +11233,7 @@
+ make__program_target__install_grade_ints_and_headers_9_0_i5);
+ MR_def_label(make__program_target__install_grade_ints_and_headers_9_0,5)
+ MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
+- MR_r2 = (MR_Word) MR_string_const("lib", 3);
++ MR_r2 = (MR_Word) MR_string_const("@libdir@", 3);
+ MR_np_call_localret_ent(fn__f_100_105_114_95_95_47_2_0,
+ make__program_target__install_grade_ints_and_headers_9_0_i6);
+ MR_def_label(make__program_target__install_grade_ints_and_headers_9_0,6)
+diff -u mercury-compiler-10.04-beta.orig/scripts/Mmake.vars.in mercury-compiler-10.04-beta/scripts/Mmake.vars.in
+--- mercury-compiler-10.04-beta.orig/scripts/Mmake.vars.in 2009-08-18 17:10:40.000000000 +1200
++++ mercury-compiler-10.04-beta/scripts/Mmake.vars.in 2010-02-13 07:48:26.000000000 +1300
+@@ -688,18 +688,18 @@
+ INSTALL_PREFIX = @prefix@
+ FINAL_INSTALL_PREFIX = @prefix@
+ INSTALL_BINDIR = $(INSTALL_PREFIX)/bin
+-INSTALL_LIBDIR = $(INSTALL_PREFIX)/lib/mercury
+-FINAL_INSTALL_LIBDIR = $(FINAL_INSTALL_PREFIX)/lib/mercury
+-INSTALL_JAVA_LIBRARY_DIR= $(INSTALL_PREFIX)/lib/mercury/lib/java
++INSTALL_LIBDIR = $(INSTALL_PREFIX)/@libdir@/mercury
++FINAL_INSTALL_LIBDIR = $(FINAL_INSTALL_PREFIX)/@libdir@/mercury
++INSTALL_JAVA_LIBRARY_DIR= $(INSTALL_PREFIX)/@libdir@/mercury/lib/java
+ INSTALL_INFO_DIR = $(INSTALL_PREFIX)/info
+-INSTALL_DVI_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
+-INSTALL_TEXT_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
+-INSTALL_PS_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
+-INSTALL_PDF_DIR = $(INSTALL_PREFIX)/lib/mercury/doc
++INSTALL_DVI_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/doc
++INSTALL_TEXT_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/doc
++INSTALL_PS_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/doc
++INSTALL_PDF_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/doc
+ INSTALL_MAN_DIR = $(INSTALL_PREFIX)/man
+-INSTALL_HTML_DIR = $(INSTALL_PREFIX)/lib/mercury/html
+-INSTALL_MDB_DOC_DIR = $(INSTALL_PREFIX)/lib/mercury/mdb
+-INSTALL_ELISP_DIR = $(INSTALL_PREFIX)/lib/mercury/elisp
++INSTALL_HTML_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/html
++INSTALL_MDB_DOC_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/mdb
++INSTALL_ELISP_DIR = $(INSTALL_PREFIX)/@libdir@/mercury/elisp
+ INSTALL_CGI_DIR = @CGIDIR@
+
+ # You should not need to override anything below here
diff --git a/dev-lang/mercury/files/mercury-10.04_beta1-no-reconf.patch b/dev-lang/mercury/files/mercury-10.04_beta1-no-reconf.patch
new file mode 100644
index 000000000000..5c9601737302
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04_beta1-no-reconf.patch
@@ -0,0 +1,59 @@
+diff -ur mercury-compiler-10.04-beta.orig/runtime/Mmakefile mercury-compiler-10.04-beta/runtime/Mmakefile
+--- mercury-compiler-10.04-beta.orig/runtime/Mmakefile 2009-12-03 18:28:00.000000000 +1300
++++ mercury-compiler-10.04-beta/runtime/Mmakefile 2010-02-10 05:47:50.000000000 +1300
+@@ -460,8 +460,6 @@
+ mkdir -p $(INSTALL_GRADE_MODULE_DIR)
+ -[ -d $(INSTALL_MERC_LIB_DIR) ] || mkdir -p $(INSTALL_MERC_LIB_DIR)
+ -[ -d $(INSTALL_CONF_DIR) ] || mkdir -p $(INSTALL_CONF_DIR)
+- -[ -d $(INSTALL_RECONF_DIR)/runtime ] || \
+- mkdir -p $(INSTALL_RECONF_DIR)/runtime
+
+ ifneq "$(filter java% erlang%,$(GRADE))" ""
+
+@@ -507,7 +505,6 @@
+ rm -f $(INSTALL_INC_DIR)/mercury_conf.h
+ cp `vpath_find mercury_conf.h` $(INSTALL_CONF_DIR)
+ -chmod u+w $(INSTALL_CONF_DIR)/mercury_conf.h
+- cp `vpath_find mercury_conf.h.in` $(INSTALL_RECONF_DIR)/runtime
+ cp `vpath_find $(MACHHDRS)` $(INSTALL_INC_DIR)/machdeps
+
+ .PHONY: install_init
+diff -ur mercury-compiler-10.04-beta.orig/scripts/Mmakefile mercury-compiler-10.04-beta/scripts/Mmakefile
+--- mercury-compiler-10.04-beta.orig/scripts/Mmakefile 2009-09-02 11:54:38.000000000 +1200
++++ mercury-compiler-10.04-beta/scripts/Mmakefile 2010-02-10 05:50:28.000000000 +1300
+@@ -24,17 +24,13 @@
+ canonical_grade \
+ mdb \
+ mdprof \
+- mercury.bat \
+- mercury_config \
+ mercury_update_interface \
+ mgnuc \
+- mkfifo_using_mknod \
+ ml \
+ mmake \
+ mmc \
+ mprof \
+- mtags \
+- prepare_install_dir
++ mtags
+
+ SCRIPTS = $(NONCONF_SCRIPTS) $(CONF_SCRIPTS)
+
+@@ -113,8 +109,6 @@
+ [ -d $(INSTALL_LIBDIR)/mdb ] || mkdir -p $(INSTALL_LIBDIR)/mdb
+ [ -d $(INSTALL_CONF_DIR) ] || mkdir -p $(INSTALL_CONF_DIR)
+ [ -d $(INSTALL_ELISP_DIR) ] || mkdir -p $(INSTALL_ELISP_DIR)
+- [ -d $(INSTALL_RECONF_DIR)/scripts ] || \
+- mkdir -p $(INSTALL_RECONF_DIR)/scripts
+
+ .PHONY: install_mmake
+ install_mmake: Mmake.vars Mmake.rules install_dirs
+@@ -132,7 +126,6 @@
+ -for file in $(SCRIPTS); do \
+ chmod u+w $(INSTALL_BINDIR)/$$file ;\
+ done
+- cp *.in *.sh-subr $(SCRIPTS) $(INSTALL_RECONF_DIR)/scripts
+ -rm -f $(INSTALL_BINDIR)/mmake.old
+
+ .PHONY: install_config
diff --git a/dev-lang/mercury/files/mercury-10.04_beta1-tests-workspace.patch b/dev-lang/mercury/files/mercury-10.04_beta1-tests-workspace.patch
new file mode 100644
index 000000000000..04999eb3fefc
--- /dev/null
+++ b/dev-lang/mercury/files/mercury-10.04_beta1-tests-workspace.patch
@@ -0,0 +1,29 @@
+--- mercury-tests-10.04-beta.orig/Mmake.common 2009-08-14 15:21:53.000000000 +1200
++++ mercury-tests-10.04-beta/Mmake.common 2010-02-11 18:43:14.000000000 +1300
+@@ -79,8 +79,8 @@
+ -include $(TESTS_DIR)/Mmake.params
+
+ MCFLAGS += --flags $(TESTS_DIR)/TESTS_FLAGS
+-ifdef WORKSPACE_FLAGS
+-MCFLAGS += --flags $(TESTS_DIR)/WS_FLAGS
++ifdef WORKSPACE
++MCFLAGS += --flags $(TESTS_DIR)/WS_FLAGS.ws
+ endif
+
+ # Avoid trying to make this file with `mmc --make' if it doesn't exist.
+--- mercury-compiler-10.04-beta.orig/configure 2010-02-03 18:50:14.000000000 +1300
++++ mercury-compiler-10.04-beta/configure 2010-02-11 18:46:48.000000000 +1300
+@@ -14688,10 +14688,10 @@
+ test_flags="tests/TESTS_FLAGS"
+ test_mdbrc="tests/mdbrc"
+ else
+- if test -e ../tests/TESTS_FLAGS.in
++ if test -e ../mercury-tests-10.04-beta/TESTS_FLAGS.in
+ then
+- test_flags="../tests/TESTS_FLAGS"
+- test_mdbrc="../tests/mdbrc"
++ test_flags="../mercury-tests-10.04-beta/TESTS_FLAGS"
++ test_mdbrc="../mercury-tests-10.04-beta/mdbrc"
+ else
+ test_flags=""
+ test_mdbrc=""
diff --git a/dev-lang/mercury/mercury-10.04_beta1.ebuild b/dev-lang/mercury/mercury-10.04_beta1.ebuild
new file mode 100644
index 000000000000..31574d1abe8b
--- /dev/null
+++ b/dev-lang/mercury/mercury-10.04_beta1.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/mercury/mercury-10.04_beta1.ebuild,v 1.1 2010/02/13 02:50:34 keri Exp $
+
+inherit elisp-common eutils flag-o-matic java-pkg-opt-2 multilib
+
+MY_PV=${PV/%?/}
+MY_P=${PN}-compiler-${MY_PV/_/-}
+
+DESCRIPTION="Mercury is a modern general-purpose logic/functional programming language"
+HOMEPAGE="http://www.cs.mu.oz.au/research/mercury/index.html"
+SRC_URI="http://www.mercury.cs.mu.oz.au/download/files/beta-releases/10.04-beta/mercury-compiler-10.04-beta.tar.gz
+ test? ( http://www.mercury.cs.mu.oz.au/download/files/beta-releases/10.04-beta/mercury-tests-10.04-beta.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE="debug emacs java minimal readline test threads"
+
+DEPEND="!dev-libs/mpatrol
+ !dev-util/mono-debugger
+ readline? ( sys-libs/readline )
+ java? ( >=virtual/jdk-1.5 )"
+
+RDEPEND="${DEPEND}
+ emacs? ( virtual/emacs )"
+
+S="${WORKDIR}"/${MY_P}
+TESTDIR="${WORKDIR}"/${PN}-tests-${MY_PV/_/-}
+
+SITEFILE=50${PN}-gentoo.el
+
+src_unpack() {
+ unpack ${A}
+
+ epatch "${FILESDIR}"/${P}-multilib.patch
+ epatch "${FILESDIR}"/${P}-docs.patch
+ epatch "${FILESDIR}"/${P}-no-reconf.patch
+
+ sed -i -e "s/@libdir@/$(get_libdir)/" \
+ "${S}"/compiler/make.program_target.c \
+ "${S}"/scripts/Mmake.vars.in
+
+ if use test; then
+ epatch "${FILESDIR}"/${P}-tests-workspace.patch
+ fi
+}
+
+src_compile() {
+ strip-flags
+
+ local myconf
+ myconf="--libdir=/usr/$(get_libdir) \
+ --disable-gcc-back-end \
+ --disable-aditi-back-end \
+ --disable-deep-profiler \
+ --disable-dotnet-grades \
+ $(use_enable java java-grade) \
+ $(use_enable debug debug-grades) \
+ $(use_enable threads par-grades) \
+ $(use_enable !minimal most-grades) \
+ $(use_with readline) \
+ PACKAGE_VERSION=${PV}"
+
+ econf \
+ ${myconf} \
+ || die "econf failed"
+ emake \
+ PARALLEL=${MAKEOPTS} \
+ EXTRA_MLFLAGS=--no-strip \
+ || die "emake failed"
+}
+
+src_test() {
+ TEST_GRADE=`scripts/ml --print-grade`
+ TWS="${S}"
+
+ cd "${TESTDIR}"
+ sed -i -e "s:@WORKSPACE@:${TWS}:" WS_FLAGS.ws
+
+ PATH="${TWS}"/scripts:"${TWS}"/util:"${PATH}" \
+ TERM="" \
+ WORKSPACE="${TWS}" \
+ MERCURY_COMPILER="${TWS}"/compiler/mercury_compile \
+ MERCURY_CONFIG_DIR="${TWS}" \
+ MMAKE_DIR="${TWS}"/scripts \
+ MERCURY_SUPPRESS_STACK_TRACE=yes \
+ GRADE=${TEST_GRADE} \
+ MERCURY_ALL_LOCAL_C_INCL_DIRS=" -I${TWS}/boehm_gc \
+ -I${TWS}/boehm_gc/include \
+ -I${TWS}/runtime \
+ -I${TWS}/library \
+ -I${TWS}/mdbcomp \
+ -I${TWS}/browser \
+ -I${TWS}/trace" \
+ mmake || die "mmake test failed"
+}
+
+src_install() {
+ emake \
+ PARALLEL=${MAKEOPTS} \
+ MERCURY_COMPILER="${S}"/compiler/mercury_compile \
+ INSTALL_PREFIX="${D}"/usr \
+ INSTALL_MAN_DIR="${D}"/usr/share/man \
+ INSTALL_INFO_DIR="${D}"/usr/share/info \
+ INSTALL_HTML_DIR="${D}"/usr/share/doc/${PF}/html \
+ INSTALL_ELISP_DIR="${D}/${SITELISP}"/${PN} \
+ install || die "make install failed"
+
+ if use emacs; then
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
+ || die "elisp-site-file-install failed"
+ fi
+
+ dodoc \
+ BUGS HISTORY LIMITATIONS NEWS README README.Linux \
+ README.Linux-Alpha README.Linux-m68k README.Linux-PPC \
+ RELEASE_NOTES TODO VERSION WORK_IN_PROGRESS
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}