summaryrefslogtreecommitdiff
path: root/dev-lang/mercury-extras
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-lang/mercury-extras
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-lang/mercury-extras')
-rw-r--r--dev-lang/mercury-extras/Manifest12
-rw-r--r--dev-lang/mercury-extras/mercury-extras-13.05.2.ebuild198
-rw-r--r--dev-lang/mercury-extras/mercury-extras-14.01.1.ebuild199
-rw-r--r--dev-lang/mercury-extras/mercury-extras-14.01.ebuild198
-rw-r--r--dev-lang/mercury-extras/metadata.xml8
5 files changed, 615 insertions, 0 deletions
diff --git a/dev-lang/mercury-extras/Manifest b/dev-lang/mercury-extras/Manifest
new file mode 100644
index 000000000000..6bcb092993a5
--- /dev/null
+++ b/dev-lang/mercury-extras/Manifest
@@ -0,0 +1,12 @@
+DIST mercury-extras-13.05.2-gentoo-patchset-3.tar.gz 3538 SHA256 96a041d185778befa98c98b232041738878666a33bd695dbc7d1e2ab9eccca41 SHA512 c151f876768c6b6ab7b46b4e2501569586249f5e185e534ebb5817206ac0844cd081ccae86a26ef85f27eab9d851017393c837728bd194520a549a0a60f738ef WHIRLPOOL 3b8eccd3252027a99a700240a45be2a1dc650055e65a4699ee3f93b8aca39da9057787e576c3e76a48a9134f25cff2c3e7a9ab88c1fc25a6eb2580d1f38ddb42
+DIST mercury-extras-14.01-gentoo-patchset-1.tar.gz 3856 SHA256 2ea27bc699998834298dab3f9c1179681ac528b32f005493cd5027d0dbe52fbc SHA512 c584efd4c7af54d2e8d5af0a63acced118f356527a2bf692262e37366e1018247aac8c1bb8f700f08f8f0a2c95d979e215e3c949ec1dc2994ab40048eb5b253c WHIRLPOOL 4b5169eb5cdd70caa350e562c276a59bfe9eca5fc3d66d10a3e10b6b653d0a41dd18409c1d26a66a20d1cecf31282408fcbf2d3e5321f16a57f095dd4907165f
+DIST mercury-extras-14.01.1-gentoo-patchset-0.tar.gz 3688 SHA256 4aa4d2f1e1b7637b8df0dfba1ac6e46bf0314c06645ed3197452c615e84d6b66 SHA512 02781ca23e72920c932067f7270d06e45909728133588c181b94f7b7580f841b4b0f1dd523e0c100350b191e5b28a7d1f10ad51fdffe2dcb02ff78cd5a906e3b WHIRLPOOL 834923a00ea98ae4d28cfd451e5d6e0638adac99c92a85d173210b87e357cc8419a3a80cf6f11242ce548b3c4b3658841da226600df73821b57c4192766e0cc3
+DIST mercury-srcdist-13.05.2.tar.gz 53847394 SHA256 8491cf419b996a315bf8664154dd91aed940274ded98e3aded733dbe1939f95f SHA512 2298804d3a04bca6be4bd3046643c7c0d0b22c447423017869cd9bf3a4fb6ec9fd29b5d8e1a386d5d52d07be5cad73608f1fcacf46732a7add93a01dcd199c08 WHIRLPOOL 2a81bebfd4b97b9bb1b0e174025e6050149c8e5f812cd97cbdc41818faa18c15f9494925f1f320682087cc45264bc00db07bef6862afef12317f77cc169a7f86
+DIST mercury-srcdist-14.01.1.tar.gz 52658945 SHA256 98f7cbde7a7425365400feef3e69f1d6a848b25dc56ba959050523d546c4e88b SHA512 a128ef0fd4955abadea32019ec59297ffe32537415f32e9e948cbc1c3439bb40eb09de77569690fb18dd7d6969a2b1141b3ae5baeb87f2627eaa65ad93add92c WHIRLPOOL 7b859eb5c7c1194d63c0aeeeeac3686c57436100b5618ae31a901119a33443363acb80a908a15dfdfa8b61fd9ccb4e552cbb972a3cc735b7a768ee7c9b1b6091
+DIST mercury-srcdist-14.01.tar.gz 52683989 SHA256 4446b7b4eafd35540495ef90ce93b71cb88efa2d744628aee80f76a694aefcc1 SHA512 77f61df64fc150e08f191860f285b97d11a71a52eabc95f660b3c90d88f8ee71d1227f7ab4b8be78be9d4aa3d62a260a874020023e4795da4cfd2e6fefa9965f WHIRLPOOL a7123063590e39ae15222eb59a2c3681ae37bea211967c857eb8725090d342f0aba7a55446529f8608afb9895746581943527b1b3c313c5cbb96f638a3377404
+EBUILD mercury-extras-13.05.2.ebuild 4700 SHA256 87e3a8a1c17d542f0e55812a1a8935e5ce7d28be989c63a0e391b90eddacb1a5 SHA512 df9663114548982f6f3453e8e1550712faa09093de7a2f24db4102ad4ac0856e2510cdb1f2841d6cec03f98311b0c170e0818507b7b7d7cd6b9e8dc22d13a33f WHIRLPOOL 53451b9f0d6cd3d2d76f7b45748496527325adae99065ede4529c3cc46ef2eac6c2c0cf38734b623a386d6370035dba4f204d86251ec21a254cd81d9a17699a7
+EBUILD mercury-extras-14.01.1.ebuild 4598 SHA256 d01f67b21b2d7ad00c464242924787320d613f5377e9502228a65df7b8650a8c SHA512 6e3a8990ede65e71cfa12c900b190f112e203b3f27b83895d8935666e4c67b2256d75ff6032bb2f8cda765991a371552eda291610a5603d3365be08cbf5241dd WHIRLPOOL 228855ec48dafaeb1c4c9f76454fa1aef35a2bdd3d08c61ecf72c922264f3bb43755a2fbab19a6aefcb16b8d90892be95f97ad7eaadd380696117462b05bdc1e
+EBUILD mercury-extras-14.01.ebuild 4582 SHA256 71daf72be4dd8c2c77f7e124cef1a908d3675a5b13adbb0f16fb3c8af81b9cab SHA512 4f9d352fe306c95f3cf22acfcd9ac6623c51d4575140452cca095eebdf52271bf3061da52c735ad0d00d943792f332711de46b67773a26bab1e2d1c44813723a WHIRLPOOL 100b4284e483b2a7c845fd56bec792464ae54dcaa6315fc1e947d32c37d2939fee1e5ed3c2451b4b41017a9f12184aa900b7edbbf15c9452da0b72a69f921879
+MISC ChangeLog 2615 SHA256 d4fb74ae94b7f4882ce737bce5fd1de790efde37950b6aa5aab6253716a63e79 SHA512 00b6576c42904b50196204e1e80bb37ad9f57338d34a8318a3bc7da619750f9bdecb065f33c2af92310c32d60d2e98dad539a3776ecd60359de2ccc9c983a99f WHIRLPOOL 9a6024d18b19f054f895ea5a167af0c70fcd31113a92ab4aff9709e3c818c56e0893bc4dfacef98fa3edfad72e24c02f246a859a8e4805ece446bf01231c4963
+MISC ChangeLog-2015 29656 SHA256 b2eb66e81713a348a6a39fbe3f42910dfba899b183c616201526e4d4e8760658 SHA512 c38add40078ccb93755c55234277bfb5a2c3a3e89b7b386ff58fb502433e190dd9827245111c3e317f5fa5d271456db7bc7f7c546af0286332708996b8060fac WHIRLPOOL 0070baf5d90e6c6965689bba408ffe87379f2d663f9e5dccdddddd04b2555f999f7638dc5da550d192261904df29225d451ccac47e15890fe99d123f95795b9d
+MISC metadata.xml 240 SHA256 9f29aeb8bcf21ea7557e7dfa496635c23e7ec764c7cfa0056e6ea3097c872d1c SHA512 7cd99ce62ca4f9307fa7dfdbfd0ff9d8ff7485c58cd08cd684065aca4b570f8655587425f6a240453a9e86452de41f26f8b82aa81c023764d0beb47daa1b15d3 WHIRLPOOL 38fdadd29270b880b2e31e022ab3f5d3b7c1c340097575662735fc48a7b7d290a33f5485d86cab077c0480f2beb7f2bcb172579bb27bc672a5c0885fce869cfc
diff --git a/dev-lang/mercury-extras/mercury-extras-13.05.2.ebuild b/dev-lang/mercury-extras/mercury-extras-13.05.2.ebuild
new file mode 100644
index 000000000000..a3abc55dadf1
--- /dev/null
+++ b/dev-lang/mercury-extras/mercury-extras-13.05.2.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=2
+
+inherit eutils multilib
+
+PATCHSET_VER="3"
+MY_P=mercury-srcdist-${PV}
+
+DESCRIPTION="Additional libraries and tools that are not part of the Mercury standard library"
+HOMEPAGE="http://www.mercurylang.org/index.html"
+SRC_URI="http://dl.mercurylang.org/release/${MY_P}.tar.gz
+ mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+IUSE="X cairo examples glut iodbc ncurses odbc opengl ssl tcl tk xml"
+
+RDEPEND="~dev-lang/mercury-${PV}
+ cairo? ( >=x11-libs/cairo-1.10.0 )
+ glut? ( media-libs/freeglut )
+ odbc? ( dev-db/unixODBC )
+ iodbc? ( !odbc? ( dev-db/libiodbc ) )
+ ncurses? ( sys-libs/ncurses )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ tcl? ( tk? (
+ dev-lang/tcl:0
+ dev-lang/tk:0
+ x11-libs/libX11
+ x11-libs/libXmu
+ )
+ )"
+
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_P}/extras
+
+src_prepare() {
+ cd "${WORKDIR}"
+
+ EPATCH_FORCE=yes
+ EPATCH_SUFFIX=patch
+ epatch "${WORKDIR}"/${PV}
+
+ if use odbc; then
+ epatch "${WORKDIR}"/${PV}-odbc/${P}-odbc.patch
+ elif use iodbc; then
+ epatch "${WORKDIR}"/${PV}-odbc/${P}-iodbc.patch
+ fi
+
+ cd "${S}"
+ sed -i -e "s:references:references solver_types/library:" \
+ -e "s:windows_installer_generator::" \
+ Mmakefile || die "sed default packages failed"
+
+ if use cairo; then
+ sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_cairo lex \\\\:" Mmakefile \
+ || die "sed cairo failed"
+ fi
+
+ if use glut; then
+ sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_glut lex \\\\:" Mmakefile \
+ || die "sed glut failed"
+ fi
+
+ if use opengl; then
+ sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_opengl lex \\\\:" Mmakefile \
+ || die "sed opengl failed"
+ fi
+
+ if use tcl && use tk; then
+ sed -i -e "s:lex[ \t]*\\\\:graphics/mercury_tcltk lex \\\\:" Mmakefile \
+ || die "sed tcltk failed"
+ fi
+
+ if use odbc || use iodbc; then
+ sed -i -e "s:moose:moose odbc:" Mmakefile \
+ || die "sed odbc failed"
+ fi
+
+ if use ncurses; then
+ sed -i -e "s:complex_numbers:complex_numbers curs curses:" Mmakefile \
+ || die "sed ncurses failed"
+ fi
+
+ if ! use xml; then
+ sed -i -e "s:xml::" Mmakefile \
+ || die "sed xml failed"
+ fi
+
+ sed -i -e "s:@libdir@:$(get_libdir):" \
+ dynamic_linking/Mmakefile \
+ || die "sed libdir failed"
+
+ # disable broken packages
+ sed -i -e "s:references::" Mmakefile \
+ || die "sed broken packages failed"
+}
+
+src_compile() {
+ # Mercury dependency generation must be run single-threaded
+ mmake \
+ -j1 depend || die "mmake depend failed"
+
+ # Compiling Mercury submodules is not thread-safe
+ mmake -j1 \
+ EXTRA_MLFLAGS=--no-strip \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ || die "mmake failed"
+}
+
+src_install() {
+ # Compiling Mercury submodules is not thread-safe
+ mmake -j1 \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ 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/base64
+ doins base64/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/complex_numbers
+ doins complex_numbers/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/dynamic_linking
+ doins dynamic_linking/hello.m || die
+
+ insinto /usr/share/doc/${PF}/samples/error
+ doins error/* || die
+
+ insinto /usr/share/doc/${PF}/samples/fixed
+ doins fixed/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/gator
+ doins -r gator/* || die
+
+ insinto /usr/share/doc/${PF}/samples/lex
+ doins lex/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/log4m
+ doins log4m/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/monte
+ doins monte/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/moose
+ doins moose/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/net
+ doins net/*.m || die
+
+ if use ncurses; then
+ insinto /usr/share/doc/${PF}/samples/curs
+ doins curs/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/curses
+ doins curses/sample/* || die
+ fi
+
+ if use X; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/easyx/samples/*.m || die
+ fi
+
+ if use glut && use opengl; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/samples/calc/* || die
+ doins graphics/samples/gears/* || die
+ doins graphics/samples/maze/* || die
+ doins graphics/samples/pent/* || die
+ fi
+
+ if use opengl && use tcl && use tk; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/samples/pent/*.m || die
+ fi
+
+ if use ssl; then
+ insinto /usr/share/doc/${PF}/samples/mopenssl
+ doins mopenssl/*.m || die
+ fi
+
+ ecvs_clean
+ fi
+
+ dodoc README || die
+}
diff --git a/dev-lang/mercury-extras/mercury-extras-14.01.1.ebuild b/dev-lang/mercury-extras/mercury-extras-14.01.1.ebuild
new file mode 100644
index 000000000000..0fb9ffe07f2b
--- /dev/null
+++ b/dev-lang/mercury-extras/mercury-extras-14.01.1.ebuild
@@ -0,0 +1,199 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib
+
+PATCHSET_VER="0"
+MY_P=mercury-srcdist-${PV}
+
+DESCRIPTION="Additional libraries and tools that are not part of the Mercury standard library"
+HOMEPAGE="http://www.mercurylang.org/index.html"
+SRC_URI="http://dl.mercurylang.org/release/${MY_P}.tar.gz
+ mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="X cairo examples glut iodbc ncurses odbc opengl ssl tcl tk xml"
+
+RDEPEND="~dev-lang/mercury-${PV}
+ cairo? ( >=x11-libs/cairo-1.10.0 )
+ glut? ( media-libs/freeglut )
+ odbc? ( dev-db/unixODBC )
+ iodbc? ( !odbc? ( dev-db/libiodbc ) )
+ ncurses? ( sys-libs/ncurses:= )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ tcl? ( tk? (
+ dev-lang/tcl:0
+ dev-lang/tk:0
+ x11-libs/libX11
+ x11-libs/libXmu
+ )
+ )"
+
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_P}/extras
+
+mercury_pkgs()
+{
+ echo "base64
+ cgi
+ complex_numbers
+ dynamic_linking
+ error
+ fixed
+ lex
+ moose
+ posix
+ solver_types/library
+ $(use ncurses && echo curs curses)
+ $(use glut && echo graphics/mercury_glut)
+ $(use opengl && echo graphics/mercury_opengl)
+ $(use tcl && use tk && echo graphics/mercury_tcltk)
+ $(use odbc && echo odbc || use iodbc && echo odbc)
+ $(has_version dev-lang/mercury[trail] && echo references)
+ $(usev xml)"
+}
+
+src_prepare() {
+ cd "${WORKDIR}"
+
+ EPATCH_FORCE=yes
+ EPATCH_SUFFIX=patch
+ if [[ -d "${WORKDIR}"/${PV} ]] ; then
+ epatch "${WORKDIR}"/${PV}
+ fi
+
+ cd "${S}"
+ if use odbc; then
+ cp odbc/Mmakefile.odbc odbc/Mmakefile
+ elif use iodbc; then
+ cp odbc/Mmakefile.iodbc odbc/Mmakefile
+ fi
+}
+
+src_compile() {
+ local MERCURY_PKGS="$(mercury_pkgs)"
+
+ # Mercury dependency generation must be run single-threaded
+ mmake -j1 \
+ SUBDIRS="${MERCURY_PKGS}" \
+ depend || die "mmake depend failed"
+
+ # Compiling Mercury submodules is not thread-safe
+ mmake -j1 \
+ SUBDIRS="${MERCURY_PKGS}" \
+ EXTRA_MLFLAGS=--no-strip \
+ EXTRA_CFLAGS="${CFLAGS}" \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ || die "mmake failed"
+
+ if use cairo; then
+ cd "${S}"/graphics/mercury_cairo
+ mmc --make libmercury_cairo \
+ || die "mmc --make libmercury_cairo failed"
+ fi
+}
+
+src_install() {
+ local MERCURY_PKGS="$(mercury_pkgs)"
+
+ # Compiling Mercury submodules is not thread-safe
+ mmake -j1 \
+ SUBDIRS="${MERCURY_PKGS}" \
+ EXTRA_MLFLAGS=--no-strip \
+ EXTRA_CFLAGS="${CFLAGS}" \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ DESTDIR="${D}" \
+ INSTALL_PREFIX="${D}"/usr \
+ install || die "mmake install failed"
+
+ if use cairo; then
+ cd "${S}"/graphics/mercury_cairo
+ INSTALL_PREFIX="${D}"/usr \
+ mmc --make libmercury_cairo.install \
+ || die "mmc --make libmercury_cairo.install failed"
+ fi
+
+ find "${D}"/usr/$(get_libdir)/mercury -type l | xargs rm
+
+ cd "${S}"
+ if use examples; then
+ insinto /usr/share/doc/${PF}/samples/base64
+ doins base64/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/complex_numbers
+ doins complex_numbers/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/dynamic_linking
+ doins dynamic_linking/hello.m || die
+
+ insinto /usr/share/doc/${PF}/samples/error
+ doins error/* || die
+
+ insinto /usr/share/doc/${PF}/samples/fixed
+ doins fixed/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/gator
+ doins -r gator/* || die
+
+ insinto /usr/share/doc/${PF}/samples/lex
+ doins lex/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/log4m
+ doins log4m/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/monte
+ doins monte/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/moose
+ doins moose/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/net
+ doins net/*.m || die
+
+ if use ncurses; then
+ insinto /usr/share/doc/${PF}/samples/curs
+ doins curs/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/curses
+ doins curses/sample/* || die
+ fi
+
+ if use X; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/easyx/samples/*.m || die
+ fi
+
+ if use glut && use opengl; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/samples/calc/* || die
+ doins graphics/samples/gears/* || die
+ doins graphics/samples/maze/* || die
+ doins graphics/samples/pent/* || die
+ fi
+
+ if use opengl && use tcl && use tk; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/samples/pent/*.m || die
+ fi
+
+ if use ssl; then
+ insinto /usr/share/doc/${PF}/samples/mopenssl
+ doins mopenssl/*.m || die
+ fi
+
+ ecvs_clean
+ fi
+
+ dodoc README || die
+}
diff --git a/dev-lang/mercury-extras/mercury-extras-14.01.ebuild b/dev-lang/mercury-extras/mercury-extras-14.01.ebuild
new file mode 100644
index 000000000000..e6be7669abd1
--- /dev/null
+++ b/dev-lang/mercury-extras/mercury-extras-14.01.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib
+
+PATCHSET_VER="1"
+MY_P=mercury-srcdist-${PV}
+
+DESCRIPTION="Additional libraries and tools that are not part of the Mercury standard library"
+HOMEPAGE="http://www.mercurylang.org/index.html"
+SRC_URI="http://dl.mercurylang.org/release/${MY_P}.tar.gz
+ mirror://gentoo/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="X cairo examples glut iodbc ncurses odbc opengl ssl tcl tk xml"
+
+RDEPEND="~dev-lang/mercury-${PV}
+ cairo? ( >=x11-libs/cairo-1.10.0 )
+ glut? ( media-libs/freeglut )
+ odbc? ( dev-db/unixODBC )
+ iodbc? ( !odbc? ( dev-db/libiodbc ) )
+ ncurses? ( sys-libs/ncurses:= )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ tcl? ( tk? (
+ dev-lang/tcl:0
+ dev-lang/tk:0
+ x11-libs/libX11
+ x11-libs/libXmu
+ )
+ )"
+
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/${MY_P}/extras
+
+mercury_pkgs()
+{
+ echo "base64
+ cgi
+ complex_numbers
+ dynamic_linking
+ error
+ fixed
+ lex
+ moose
+ posix
+ solver_types/library
+ $(use ncurses && echo curs curses)
+ $(use glut && echo graphics/mercury_glut)
+ $(use opengl && echo graphics/mercury_opengl)
+ $(use tcl && use tk && echo graphics/mercury_tcltk)
+ $(use odbc && echo odbc || use iodbc && echo odbc)
+ $(has_version dev-lang/mercury[-minimal] && echo references)
+ $(usev xml)"
+}
+
+src_prepare() {
+ cd "${WORKDIR}"
+
+ EPATCH_FORCE=yes
+ EPATCH_SUFFIX=patch
+ if [[ -d "${WORKDIR}"/${PV} ]] ; then
+ epatch "${WORKDIR}"/${PV}
+ fi
+
+ cd "${S}"
+ if use odbc; then
+ cp odbc/Mmakefile.odbc odbc/Mmakefile
+ elif use iodbc; then
+ cp odbc/Mmakefile.iodbc odbc/Mmakefile
+ fi
+}
+
+src_compile() {
+ local MERCURY_PKGS="$(mercury_pkgs)"
+
+ # Mercury dependency generation must be run single-threaded
+ mmake -j1 \
+ SUBDIRS="${MERCURY_PKGS}" \
+ depend || die "mmake depend failed"
+
+ # Compiling Mercury submodules is not thread-safe
+ mmake -j1 \
+ SUBDIRS="${MERCURY_PKGS}" \
+ EXTRA_MLFLAGS=--no-strip \
+ EXTRA_CFLAGS="${CFLAGS}" \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ || die "mmake failed"
+
+ if use cairo; then
+ cd "${S}"/graphics/mercury_cairo
+ mmc --make libmercury_cairo \
+ || die "mmc --make libmercury_cairo failed"
+ fi
+}
+
+src_install() {
+ local MERCURY_PKGS="$(mercury_pkgs)"
+
+ # Compiling Mercury submodules is not thread-safe
+ mmake -j1 \
+ SUBDIRS="${MERCURY_PKGS}" \
+ EXTRA_MLFLAGS=--no-strip \
+ EXTRA_CFLAGS="${CFLAGS}" \
+ EXTRA_LDFLAGS="${LDFLAGS}" \
+ EXTRA_LD_LIBFLAGS="${LDFLAGS}" \
+ INSTALL_PREFIX="${D}"/usr \
+ install || die "mmake install failed"
+
+ if use cairo; then
+ cd "${S}"/graphics/mercury_cairo
+ INSTALL_PREFIX="${D}"/usr \
+ mmc --make libmercury_cairo.install \
+ || die "mmc --make libmercury_cairo.install failed"
+ fi
+
+ find "${D}"/usr/$(get_libdir)/mercury -type l | xargs rm
+
+ cd "${S}"
+ if use examples; then
+ insinto /usr/share/doc/${PF}/samples/base64
+ doins base64/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/complex_numbers
+ doins complex_numbers/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/dynamic_linking
+ doins dynamic_linking/hello.m || die
+
+ insinto /usr/share/doc/${PF}/samples/error
+ doins error/* || die
+
+ insinto /usr/share/doc/${PF}/samples/fixed
+ doins fixed/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/gator
+ doins -r gator/* || die
+
+ insinto /usr/share/doc/${PF}/samples/lex
+ doins lex/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/log4m
+ doins log4m/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/monte
+ doins monte/*.m || die
+
+ insinto /usr/share/doc/${PF}/samples/moose
+ doins moose/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/net
+ doins net/*.m || die
+
+ if use ncurses; then
+ insinto /usr/share/doc/${PF}/samples/curs
+ doins curs/samples/* || die
+
+ insinto /usr/share/doc/${PF}/samples/curses
+ doins curses/sample/* || die
+ fi
+
+ if use X; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/easyx/samples/*.m || die
+ fi
+
+ if use glut && use opengl; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/samples/calc/* || die
+ doins graphics/samples/gears/* || die
+ doins graphics/samples/maze/* || die
+ doins graphics/samples/pent/* || die
+ fi
+
+ if use opengl && use tcl && use tk; then
+ insinto /usr/share/doc/${PF}/samples/graphics
+ doins graphics/samples/pent/*.m || die
+ fi
+
+ if use ssl; then
+ insinto /usr/share/doc/${PF}/samples/mopenssl
+ doins mopenssl/*.m || die
+ fi
+
+ ecvs_clean
+ fi
+
+ dodoc README || die
+}
diff --git a/dev-lang/mercury-extras/metadata.xml b/dev-lang/mercury-extras/metadata.xml
new file mode 100644
index 000000000000..c301cedb922a
--- /dev/null
+++ b/dev-lang/mercury-extras/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>keri@gentoo.org</email>
+ <name>Keri Harris</name>
+</maintainer>
+</pkgmetadata>