summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeri Harris <keri@gentoo.org>2007-11-21 06:25:29 +0000
committerKeri Harris <keri@gentoo.org>2007-11-21 06:25:29 +0000
commit4061d360556899eb0c361d56ffd24e05be558bac (patch)
tree1a02eadca14e2ad9aea089f62c675ccdfa051e7b
parentupdated to latest upstream release, fixes bug 198954 (diff)
downloadgentoo-2-4061d360556899eb0c361d56ffd24e05be558bac.tar.gz
gentoo-2-4061d360556899eb0c361d56ffd24e05be558bac.tar.bz2
gentoo-2-4061d360556899eb0c361d56ffd24e05be558bac.zip
Version bump
(Portage version: 2.1.3.19)
-rw-r--r--dev-lang/yap/ChangeLog12
-rw-r--r--dev-lang/yap/files/digest-yap-5.1.23
-rw-r--r--dev-lang/yap/files/yap-5.1.2-SONAME.patch11
-rw-r--r--dev-lang/yap/files/yap-5.1.2-analyst.patch55
-rw-r--r--dev-lang/yap/files/yap-5.1.2-chr.patch77
-rw-r--r--dev-lang/yap/files/yap-5.1.2-configure.patch183
-rw-r--r--dev-lang/yap/files/yap-5.1.2-jpl.patch47
-rw-r--r--dev-lang/yap/files/yap-5.1.2-multilib.patch169
-rw-r--r--dev-lang/yap/files/yap-5.1.2-parallel-make.patch77
-rw-r--r--dev-lang/yap/files/yap-5.1.2-tabling.patch61
-rw-r--r--dev-lang/yap/files/yap-5.1.2-tkyap.patch26
-rw-r--r--dev-lang/yap/yap-5.1.2.ebuild95
12 files changed, 815 insertions, 1 deletions
diff --git a/dev-lang/yap/ChangeLog b/dev-lang/yap/ChangeLog
index 4c4519567029..2d2a25a56a39 100644
--- a/dev-lang/yap/ChangeLog
+++ b/dev-lang/yap/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for dev-lang/yap
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/yap/ChangeLog,v 1.16 2007/02/03 23:03:23 keri Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/yap/ChangeLog,v 1.17 2007/11/21 06:25:28 keri Exp $
+
+*yap-5.1.2 (21 Nov 2007)
+
+ 21 Nov 2007; keri <keri@gentoo.org> +files/yap-5.1.2-SONAME.patch,
+ +files/yap-5.1.2-analyst.patch, +files/yap-5.1.2-chr.patch,
+ +files/yap-5.1.2-configure.patch, +files/yap-5.1.2-jpl.patch,
+ +files/yap-5.1.2-multilib.patch, +files/yap-5.1.2-parallel-make.patch,
+ +files/yap-5.1.2-tabling.patch, +files/yap-5.1.2-tkyap.patch,
+ +yap-5.1.2.ebuild:
+ Version bump.
03 Feb 2007; keri <keri@gentoo.org> +files/yap-5.1.1-parallel-make.patch,
yap-5.1.1.ebuild:
diff --git a/dev-lang/yap/files/digest-yap-5.1.2 b/dev-lang/yap/files/digest-yap-5.1.2
new file mode 100644
index 000000000000..675897b1b9f0
--- /dev/null
+++ b/dev-lang/yap/files/digest-yap-5.1.2
@@ -0,0 +1,3 @@
+MD5 368a8c8f764f50b927f21a9b727139c9 Yap-5.1.2.tar.gz 4102453
+RMD160 be2f814a516a1b389bb910121af35898253f9137 Yap-5.1.2.tar.gz 4102453
+SHA256 ee28e7077925685b0f375bb733e477b5a8cb08537fa5d1e2f387e20fa6e07ccb Yap-5.1.2.tar.gz 4102453
diff --git a/dev-lang/yap/files/yap-5.1.2-SONAME.patch b/dev-lang/yap/files/yap-5.1.2-SONAME.patch
new file mode 100644
index 000000000000..3ccc0f52b1aa
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-SONAME.patch
@@ -0,0 +1,11 @@
+--- Yap-5.1.2.orig/Makefile.in 2007-06-21 01:45:42.000000000 +1200
++++ Yap-5.1.2/Makefile.in 2007-11-20 21:06:56.000000000 +1300
+@@ -572,7 +572,7 @@
+ $(RANLIB) libYap.a
+
+ @DYNYAPLIB@: $(LIB_OBJECTS)
+- @DYNLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS)
++ @DYNLIB_LD@ -Wl,-soname=$@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS)
+
+ install: install_bin install_data
+
diff --git a/dev-lang/yap/files/yap-5.1.2-analyst.patch b/dev-lang/yap/files/yap-5.1.2-analyst.patch
new file mode 100644
index 000000000000..0e88393ded5c
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-analyst.patch
@@ -0,0 +1,55 @@
+diff -ur Yap-5.1.2.orig/C/analyst.c Yap-5.1.2/C/analyst.c
+--- Yap-5.1.2.orig/C/analyst.c 2006-11-29 03:10:19.000000000 +1300
++++ Yap-5.1.2/C/analyst.c 2007-08-21 19:58:15.000000000 +1200
+@@ -312,19 +312,17 @@
+ total;
+ Term t1;
+ Atom at1;
++ char *program;
++ wchar_t *programw;
+
+ t1 = Deref(ARG1);
+ if (IsVarTerm(t1) || !IsAtomTerm(t1))
+ return (FALSE);
+ at1 = AtomOfTerm(t1);
+ if (IsWideAtom(at1)) {
+- wchar_t *program;
+-
+- program = RepAtom(at1)->WStrOfAE;
+- fprintf(Yap_stderr, "\n Instructions Executed in %S\n", program);
++ programw = RepAtom(at1)->WStrOfAE;
++ fprintf(Yap_stderr, "\n Instructions Executed in %S\n", programw);
+ } else {
+- char *program;
+-
+ program = RepAtom(at1)->StrOfAE;
+ fprintf(Yap_stderr, "\n Instructions Executed in %s\n", program);
+ }
+@@ -675,7 +673,10 @@
+ fprintf(Yap_stderr, " TOTAL instructions: %8d (%3d%%)\n\n", total,
+ (total * 100) / total);
+
+- fprintf(Yap_stderr, "\n Analysis of Unification Instructions in %s \n", program);
++ if (IsWideAtom(at1))
++ fprintf(Yap_stderr, "\n Analysis of Unification Instructions in %S \n", programw);
++ else
++ fprintf(Yap_stderr, "\n Analysis of Unification Instructions in %s \n", program);
+ fprintf(Yap_stderr, " XVAR, YVAR, XVAL, YVAL, CONS, LIST, STRUCT\n");
+ fprintf(Yap_stderr, " GET: %8d %8d %8d %8d %8d %8d %8d\n",
+ c_get.nxvar,
+diff -ur Yap-5.1.2.orig/H/Yap.h Yap-5.1.2/H/Yap.h
+--- Yap-5.1.2.orig/H/Yap.h 2007-04-11 10:13:20.000000000 +1200
++++ Yap-5.1.2/H/Yap.h 2007-08-22 19:39:03.000000000 +1200
+@@ -53,12 +53,6 @@
+ #undef TRAILING_REQUIRES_BRANCH
+ #endif /* YAPOR || TABLING */
+
+-#if ANALYST
+-#ifdef USE_THREADED_CODE
+-#undef USE_THREADED_CODE
+-#endif
+-#endif
+-
+ #ifdef COROUTINING
+ #ifndef TERM_EXTENSIONS
+ #define TERM_EXTENSIONS 1
diff --git a/dev-lang/yap/files/yap-5.1.2-chr.patch b/dev-lang/yap/files/yap-5.1.2-chr.patch
new file mode 100644
index 000000000000..f3927ee93b9a
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-chr.patch
@@ -0,0 +1,77 @@
+--- Yap-5.1.2.orig/LGPL/chr/Makefile.in 2005-10-29 13:47:10.000000000 +1300
++++ Yap-5.1.2/LGPL/chr/Makefile.in 2007-11-20 20:58:04.000000000 +1300
+@@ -47,39 +47,50 @@
+ $(srcdir)/Benchmarks/bool.chr $(srcdir)/Benchmarks/family.chr $(srcdir)/Benchmarks/fibonacci.chr $(srcdir)/Benchmarks/leq.chr $(srcdir)/Benchmarks/listdom.chr \
+ $(srcdir)/Benchmarks/chrdif.chr
+
++BOOTSTRAP=bootstrap('../../pl/init.yap'),module(user),['chr_swi_bootstrap']
++
+ all: chr_translate.pl
+
+ chr_translate_bootstrap1.pl: $(srcdir)/chr_translate_bootstrap1.chr
+- $(PL) -l chr_swi_bootstrap.yap \
+- -g "chr_compile_step1('$<','$@'),halt." \
+- -z 'halt(1).'
+- $(PL) -l chr_swi_bootstrap.yap \
+- -g "chr_compile_step2('$<','$@'),halt." \
+- -z 'halt(1).'
++ echo "$(BOOTSTRAP),chr:chr_compile_step1('$<','$@'),halt." | \
++ LD_LIBRARY_PATH=../..:system:yap2swi \
++ YAPSHAREDIR=$(PWD)/../../library \
++ $(PL) -b ../../pl/boot.yap
++ echo "$(BOOTSTRAP),chr:chr_compile_step2('$<','$@'),halt." | \
++ LD_LIBRARY_PATH=../..:system:yap2swi \
++ YAPSHAREDIR=$(PWD)/../../library \
++ $(PL) -b ../../pl/boot.yap
+
+ chr_translate_bootstrap2.pl: $(srcdir)/chr_translate_bootstrap2.chr chr_translate_bootstrap1.pl
+- $(PL) -l chr_swi_bootstrap.yap \
+- -g "chr_compile_step2('$<','$@'),halt." \
+- -z 'halt(1).'
+- $(PL) -l chr_swi_bootstrap.yap \
+- -g "chr_compile_step3('$<','$@'),halt." \
+- -z 'halt(1).'
++ echo "$(BOOTSTRAP),chr:chr_compile_step2('$<','$@'),halt." | \
++ LD_LIBRARY_PATH=../..:system:yap2swi \
++ YAPSHAREDIR=$(PWD)/../../library \
++ $(PL) -b ../../pl/boot.yap
++ echo "$(BOOTSTRAP),chr:chr_compile_step3('$<','$@'),halt." | \
++ LD_LIBRARY_PATH=../..:system:yap2swi \
++ YAPSHAREDIR=$(PWD)/../../library \
++ $(PL) -b ../../pl/boot.yap
+
+ guard_entailment.pl: $(srcdir)/guard_entailment.chr chr_translate_bootstrap2.pl
+- $(PL) -l chr_swi_bootstrap.yap \
+- -g "chr_compile_step3('$<','$@'),halt." \
+- -z 'halt(1).'
++ echo "$(BOOTSTRAP),chr:chr_compile_step3('$<','$@'),halt." | \
++ LD_LIBRARY_PATH=../..:system:yap2swi \
++ YAPSHAREDIR=$(PWD)/../../library \
++ $(PL) -b ../../pl/boot.yap
+
+ chr_translate.pl: $(srcdir)/chr_translate.chr chr_translate_bootstrap2.pl guard_entailment.pl
+- $(PL) -l chr_swi_bootstrap.yap \
+- -g "chr_compile_step3('$<','$@'),halt." \
+- -z 'halt(1).'
+- $(PL) -p chr=. -l chr_swi_bootstrap.yap \
+- -g "chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt." \
+- -z 'halt(1).'
+- $(PL) -p chr=. -l chr_swi_bootstrap.yap \
+- -g "chr_compile_step4('$<','$@'),halt." \
+- -z 'halt(1).'
++ echo "$(BOOTSTRAP),chr:chr_compile_step3('$<','$@'),halt." | \
++ LD_LIBRARY_PATH=../..:system:yap2swi \
++ YAPSHAREDIR=$(PWD)/../../library \
++ $(PL) -b ../../pl/boot.yap
++ echo "$(BOOTSTRAP),asserta(user:file_search_path(chr,'.')),chr:chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt." | \
++ LD_LIBRARY_PATH=../..:system:yap2swi \
++ YAPSHAREDIR=$(PWD)/../../library \
++ $(PL) -b ../../pl/boot.yap
++ cp ../clp/clp_events.pl ../../library/clp
++ echo "$(BOOTSTRAP),asserta(user:file_search_path(chr,'.')),chr:chr_compile_step4('$<','$@'),halt." | \
++ LD_LIBRARY_PATH=../..:system:yap2swi \
++ YAPSHAREDIR=$(PWD)/../../library \
++ $(PL) -b ../../pl/boot.yap
+
+ chr.pl: chr_swi.pl
+ cp $< $@
diff --git a/dev-lang/yap/files/yap-5.1.2-configure.patch b/dev-lang/yap/files/yap-5.1.2-configure.patch
new file mode 100644
index 000000000000..5912d35a07cd
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-configure.patch
@@ -0,0 +1,183 @@
+--- Yap-5.1.2.orig/configure.in 2007-06-21 01:45:42.000000000 +1200
++++ Yap-5.1.2/configure.in 2007-08-20 20:19:45.000000000 +1200
+@@ -43,7 +43,7 @@
+ [ --enable-threads support system threads ],
+ threads="$enableval", threads=no)
+ AC_ARG_ENABLE(pthread-locking,
+- [ --pthread-locking use pthread locking primitives for internal locking (requires threads) ],
++ [ --enable-pthread-locking use pthread locking primitives for internal locking (requires threads) ],
+ pthreadlocking="$enableval", pthreadlocking=no)
+ AC_ARG_ENABLE(max-performance,
+ [ --enable-max-performance try using the best flags for specific architecture ],
+@@ -91,22 +91,35 @@
+ fi,
+ [yap_cv_gmp=yes])
+
+-AC_ARG_ENABLE(myddas,
+- [ --enable-myddas[[=DIR]] enable the MYDDAS library],
++AC_ARG_ENABLE(myddas-mysql,
++ [ --enable-myddas-mysql[[=DIR]] enable the MYDDAS MySQL library],
+ if test "$enableval" = yes; then
+- yap_cv_myddas=/usr/
++ yap_cv_myddas_mysql=/usr/
+ elif test "$enableval" = no; then
+- yap_cv_myddas=no
++ yap_cv_myddas_mysql=no
+ else
+- yap_cv_myddas=$enable_myddas
+- LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib "
+- CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include "
++ yap_cv_myddas_mysql=$enable_myddas_mysql
++ LDFLAGS="$LDFLAGS -L${yap_cv_myddas_mysql}/lib "
++ CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas_mysql}/include "
+ fi,
+- [yap_cv_myddas=no])
++ [yap_cv_myddas_mysql=no])
++
++AC_ARG_ENABLE(myddas-odbc,
++ [ --enable-myddas-odbc[[=DIR]] enable the MYDDAS ODBC library],
++ if test "$enableval" = yes; then
++ yap_cv_myddas_odbc=/usr/
++ elif test "$enableval" = no; then
++ yap_cv_myddas_odbc=no
++ else
++ yap_cv_myddas_odbc=$enable_myddas_odbc
++ LDFLAGS="$LDFLAGS -L${yap_cv_myddas_odbc}/lib "
++ CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas_odbc}/include "
++ fi,
++ [yap_cv_myddas_odbc=no])
+
+ AC_ARG_ENABLE(myddas-stats,
+ [ --enable-myddas-stats enable the MYDDAS library statistics support],
+- if test "$yap_cv_myddas" = no; then
++ if test "$yap_cv_myddas_mysql" = no; then
+ myddasstats=no
+ else
+ myddasstats="$enableval"
+@@ -114,7 +127,7 @@
+
+ AC_ARG_ENABLE(myddas-top-level,
+ [ --enable-myddas-top-level enable the MYDDAS top-level support to MySQL],
+- if test "$yap_cv_myddas" = no; then
++ if test "$yap_cv_myddas_mysql" = no; then
+ myddastoplevel=no
+ else
+ myddastoplevel="$enableval"
+@@ -124,8 +137,6 @@
+ [ --with-jpl=JAVA_HOME use Java instalation in JAVA_HOME],
+ if test "$withval" = yes; then
+ yap_cv_jpl="$JAVA_HOME"
+- dynamic_loading=yes
+- maxmemory=yes
+ dnl threads=yes
+ elif test "$withval" = no; then
+ yap_cv_jpl=no
+@@ -410,6 +421,8 @@
+ AC_PATH_PROG(INSTALL_INFO,install-info,true,$PATH:/sbin:/usr/sbin:/usr/etc:/usr/local/sbin)
+ AC_PATH_PROG(SHELL,sh)
+
++AC_HEADER_STDC
++
+ dnl Check for libraries.
+ dnl mingw does not get along well with libm
+ dnl cygnus and mingw32 also need wsock32 to use sockets.
+@@ -464,7 +477,7 @@
+ AC_CHECK_LIB(gmp,main)
+ fi
+
+-if test "$yap_cv_myddas" != "no"
++if test "$yap_cv_myddas_mysql" != "no"
+ then
+ dnl check for mysql
+ AC_MSG_CHECKING(for main in -lmysqlclient)
+@@ -481,9 +494,26 @@
+ if test "$yap_mysql" = yes
+ then
+ YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL"
+- LIBS="$LIBS -L${yap_cv_myddas}/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv "
++ LIBS="$LIBS -L${yap_cv_myddas_mysql}/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv "
+ fi
+-
++ if test "$yap_mysql" = no
++ then
++ echo "-------------------------------"
++ echo "--"
++ echo "--"
++ echo "--"
++ echo "-- There\'s no devel libraries for MySQL"
++ echo "--"
++ echo "--"
++ echo "--"
++ echo "-------------------------------"
++ exit
++ fi
++ cutc="yes"
++fi
++
++if test "$yap_cv_myddas_odbc" != "no"
++then
+ dnl check for odbc
+ AC_MSG_CHECKING(for main in -lodbc)
+ AC_CACHE_VAL(yap_odbc,[
+@@ -502,40 +532,21 @@
+ YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
+ LIBS="$LIBS -lodbc "
+ fi
+-
+- if test "$yap_mysql" = no -a "$yap_odbc" = no
++ if test "$yap_odbc" = no
+ then
+ echo "-------------------------------"
+ echo "--"
+ echo "--"
+ echo "--"
+- echo "-- There\'s no devel libraries for MySQL or ODBC"
++ echo "-- There\'s no devel libraries for ODBC"
+ echo "--"
+ echo "--"
+ echo "--"
+ echo "-------------------------------"
+ exit
+ fi
+-
+- if test "$cutc" = no
+- then
+- echo
+- echo
+- echo "********************************************************"
+- echo
+- echo
+- echo "!!!!!! WARNING !!!!!!"
+- echo "The MYDDAS interface makes no sense without cut-c"
+- echo "Please contact tiagosoares@ncc.up.pt for help"
+- echo
+- echo "Enabling cut-c"
+- echo
+- echo "********************************************************"
+- echo
+- echo
+- cutc="yes"
+- fi
+-fi
++ cutc="yes"
++fi
+
+ if test "$myddasstats" = "yes"
+ then
+@@ -946,7 +957,6 @@
+ fi
+
+ dnl Checks for header files.
+-AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+ AC_CHECK_HEADERS(arpa/inet.h ctype.h direct.h dirent.h dlfcn.h)
+ AC_CHECK_HEADERS(errno.h fcntl.h)
+@@ -965,7 +975,7 @@
+ then
+ AC_CHECK_HEADERS(gmp.h)
+ fi
+-if test "$yap_cv_myddas" != "no"
++if test "$yap_cv_myddas_mysql" != "no"
+ then
+ AC_CHECK_HEADERS(mysql/mysql.h)
+ fi
diff --git a/dev-lang/yap/files/yap-5.1.2-jpl.patch b/dev-lang/yap/files/yap-5.1.2-jpl.patch
new file mode 100644
index 000000000000..3297033e7477
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-jpl.patch
@@ -0,0 +1,47 @@
+--- Yap-5.1.2.orig/LGPL/JPL/src/jpl.c 2006-09-01 15:01:58.000000000 +1200
++++ Yap-5.1.2/LGPL/JPL/src/jpl.c 2007-11-20 20:16:37.000000000 +1300
+@@ -1827,7 +1827,7 @@
+
+
+ //=== JVM initialisation, startup etc. =============================================================
+-
++/*
+ // this isn't much use; it can't discover JDK 1.2 support...
+ static int
+ jni_supported_jvm_version(
+@@ -1848,7 +1848,7 @@
+ && minor == mlo
+ ;
+ }
+-
++*/
+
+ static int
+ jni_get_created_jvm_count(void)
+@@ -1930,7 +1930,7 @@
+ );
+ }
+
+-
++/*
+ static foreign_t
+ jni_supported_jvm_version_plc( // not as useful as I'd hoped...
+ term_t t1,
+@@ -1945,7 +1945,7 @@
+ && jni_supported_jvm_version(major,minor)
+ ;
+ }
+-
++*/
+
+ static foreign_t
+ jni_get_created_jvm_count_plc(
+@@ -3908,7 +3908,7 @@
+ static
+ PL_extension predspecs[] =
+ { { "jni_create_jvm", 2, jni_create_jvm_plc, 0 },
+- { "jni_supported_jvm_version", 2, jni_supported_jvm_version_plc, 0 },
++/* { "jni_supported_jvm_version", 2, jni_supported_jvm_version_plc, 0 },*/
+ { "jni_get_created_jvm_count", 1, jni_get_created_jvm_count_plc, 0 },
+ { "jni_ensure_jvm", 0, jni_ensure_jvm_plc, 0 },
+ { "jni_tag_to_iref", 2, jni_tag_to_iref_plc, 0 },
diff --git a/dev-lang/yap/files/yap-5.1.2-multilib.patch b/dev-lang/yap/files/yap-5.1.2-multilib.patch
new file mode 100644
index 000000000000..b19727c0502b
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-multilib.patch
@@ -0,0 +1,169 @@
+diff -ur Yap-5.1.2.orig/CLPBN/Makefile.in Yap-5.1.2/CLPBN/Makefile.in
+--- Yap-5.1.2.orig/CLPBN/Makefile.in 2006-02-12 13:41:23.000000000 +1300
++++ Yap-5.1.2/CLPBN/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -9,7 +9,7 @@
+ #
+ # where YAP should look for libraries
+ #
+-LIBDIR=$(ROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ # where YAP should look for architecture-independent Prolog libraries
+ #
+diff -ur Yap-5.1.2.orig/LGPL/JPL/Makefile.in Yap-5.1.2/LGPL/JPL/Makefile.in
+--- Yap-5.1.2.orig/LGPL/JPL/Makefile.in 2005-03-12 17:04:58.000000000 +1300
++++ Yap-5.1.2/LGPL/JPL/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -9,7 +9,7 @@
+ #
+ # where YAP should look for binary libraries
+ #
+-LIBDIR=$(ROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ # where YAP should look for architecture-independent Prolog libraries
+ #
+diff -ur Yap-5.1.2.orig/LGPL/JPL/java/Makefile.in Yap-5.1.2/LGPL/JPL/java/Makefile.in
+--- Yap-5.1.2.orig/LGPL/JPL/java/Makefile.in 2006-03-22 10:28:08.000000000 +1200
++++ Yap-5.1.2/LGPL/JPL/java/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -15,7 +15,7 @@
+ #
+ # where YAP should look for binary libraries
+ #
+-LIBDIR=$(ROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ # where YAP should look for architecture-independent Prolog libraries
+ #
+diff -ur Yap-5.1.2.orig/LGPL/JPL/src/Makefile.in Yap-5.1.2/LGPL/JPL/src/Makefile.in
+--- Yap-5.1.2.orig/LGPL/JPL/src/Makefile.in 2006-05-25 13:02:03.000000000 +1200
++++ Yap-5.1.2/LGPL/JPL/src/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -19,7 +19,7 @@
+ #
+ # where YAP should look for libraries
+ #
+-LIBDIR=$(EROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ #
+ CC=@CC@
+diff -ur Yap-5.1.2.orig/LGPL/clp/Makefile.in Yap-5.1.2/LGPL/clp/Makefile.in
+--- Yap-5.1.2.orig/LGPL/clp/Makefile.in 2005-10-28 15:43:57.000000000 +1300
++++ Yap-5.1.2/LGPL/clp/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -9,7 +9,7 @@
+ #
+ # where YAP should look for binary libraries
+ #
+-LIBDIR=$(ROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ # where YAP should look for architecture-independent Prolog libraries
+ #
+diff -ur Yap-5.1.2.orig/Makefile.in Yap-5.1.2/Makefile.in
+--- Yap-5.1.2.orig/Makefile.in 2007-06-21 01:45:42.000000000 +1200
++++ Yap-5.1.2/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -4,7 +4,7 @@
+ #
+ prefix = @prefix@
+ ROOTDIR = $(prefix)
+-EROOTDIR = @exec_prefix@
++EROOTDIR = @prefix@
+ #
+ # where the binary should be
+ #
+@@ -12,8 +12,8 @@
+ #
+ # where YAP should look for binary libraries
+ #
+-LIBDIR=$(EROOTDIR)/lib
+-YAPLIBDIR=$(EROOTDIR)/lib/Yap
++LIBDIR=@libdir@
++YAPLIBDIR=@libdir@/Yap
+ #
+ # where YAP should look for architecture-independent Prolog libraries
+ #
+diff -ur Yap-5.1.2.orig/library/Makefile.in Yap-5.1.2/library/Makefile.in
+--- Yap-5.1.2.orig/library/Makefile.in 2007-06-21 01:46:02.000000000 +1200
++++ Yap-5.1.2/library/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -9,7 +9,7 @@
+ #
+ # where YAP should look for binary libraries
+ #
+-LIBDIR=$(ROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ # where YAP should look for architecture-independent Prolog libraries
+ #
+diff -ur Yap-5.1.2.orig/library/Tries/Makefile.in Yap-5.1.2/library/Tries/Makefile.in
+--- Yap-5.1.2.orig/library/Tries/Makefile.in 2004-12-15 06:00:33.000000000 +1300
++++ Yap-5.1.2/library/Tries/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -18,7 +18,7 @@
+ #
+ # where YAP should look for libraries
+ #
+-LIBDIR=$(EROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ #
+ CC=@CC@
+diff -ur Yap-5.1.2.orig/library/mpi/Makefile.in Yap-5.1.2/library/mpi/Makefile.in
+--- Yap-5.1.2.orig/library/mpi/Makefile.in 2004-12-15 06:00:33.000000000 +1300
++++ Yap-5.1.2/library/mpi/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -20,8 +20,8 @@
+ #
+ # where YAP should look for binary libraries
+ #
+-LIBDIR=$(EROOTDIR)/lib
+-YAPLIBDIR=$(EROOTDIR)/lib/Yap
++LIBDIR=@libdir@
++YAPLIBDIR=@libdir@/Yap
+ #
+ # where YAP should look for architecture-independent Prolog libraries
+ #
+diff -ur Yap-5.1.2.orig/library/random/Makefile.in Yap-5.1.2/library/random/Makefile.in
+--- Yap-5.1.2.orig/library/random/Makefile.in 2004-12-15 06:00:33.000000000 +1300
++++ Yap-5.1.2/library/random/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -12,7 +12,7 @@
+ #
+ # where YAP should look for libraries
+ #
+-LIBDIR=$(EROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ #
+ CC=@CC@
+diff -ur Yap-5.1.2.orig/library/regex/Makefile.in Yap-5.1.2/library/regex/Makefile.in
+--- Yap-5.1.2.orig/library/regex/Makefile.in 2004-12-15 06:00:33.000000000 +1300
++++ Yap-5.1.2/library/regex/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -12,7 +12,7 @@
+ #
+ # where YAP should look for libraries
+ #
+-LIBDIR=$(EROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ #
+ CC=@CC@
+diff -ur Yap-5.1.2.orig/library/system/Makefile.in Yap-5.1.2/library/system/Makefile.in
+--- Yap-5.1.2.orig/library/system/Makefile.in 2004-12-15 06:00:33.000000000 +1300
++++ Yap-5.1.2/library/system/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -12,7 +12,7 @@
+ #
+ # where YAP should look for libraries
+ #
+-LIBDIR=$(EROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ #
+ CC=@CC@
+diff -ur Yap-5.1.2.orig/library/yap2swi/Makefile.in Yap-5.1.2/library/yap2swi/Makefile.in
+--- Yap-5.1.2.orig/library/yap2swi/Makefile.in 2004-12-15 06:00:33.000000000 +1300
++++ Yap-5.1.2/library/yap2swi/Makefile.in 2007-08-20 20:24:58.000000000 +1200
+@@ -12,7 +12,7 @@
+ #
+ # where YAP should look for libraries
+ #
+-LIBDIR=$(EROOTDIR)/lib/Yap
++LIBDIR=@libdir@/Yap
+ #
+ #
+ CC=@CC@
diff --git a/dev-lang/yap/files/yap-5.1.2-parallel-make.patch b/dev-lang/yap/files/yap-5.1.2-parallel-make.patch
new file mode 100644
index 000000000000..ab381db11b77
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-parallel-make.patch
@@ -0,0 +1,77 @@
+--- Yap-5.1.2.orig/Makefile.in 2007-06-21 01:45:42.000000000 +1200
++++ Yap-5.1.2/Makefile.in 2007-11-20 21:09:49.000000000 +1300
+@@ -549,15 +549,15 @@
+ $(CC) $(CFLAGS) $(srcdir)/mycb.c -o mycb
+
+ all: startup
+- @INSTALL_DLLS@ (cd library/random; make)
+- @INSTALL_DLLS@ (cd library/regex; make)
+- @INSTALL_DLLS@ (cd library/system; make)
+- @INSTALL_DLLS@ (cd library/yap2swi; make)
+- @INSTALL_DLLS@ (cd library/tries; make)
+- @INSTALL_DLLS@ (cd library/lammpi; make)
+- @INSTALL_DLLS@ (cd library/matrix; make)
+- @INSTALL_MATLAB@ (cd library/matlab; make)
+- @ENABLE_JPL@ @INSTALL_DLLS@ (cd LGPL/JPL/src; make)
++ @INSTALL_DLLS@ (cd library/random; $(MAKE))
++ @INSTALL_DLLS@ (cd library/regex; $(MAKE))
++ @INSTALL_DLLS@ (cd library/system; $(MAKE))
++ @INSTALL_DLLS@ (cd library/yap2swi; $(MAKE))
++ @INSTALL_DLLS@ (cd library/tries; $(MAKE))
++ @INSTALL_DLLS@ (cd library/lammpi; $(MAKE))
++ @INSTALL_DLLS@ (cd library/matrix; $(MAKE))
++ @INSTALL_MATLAB@ (cd library/matlab; $(MAKE))
++ @ENABLE_JPL@ @INSTALL_DLLS@ (cd LGPL/JPL/src; $(MAKE))
+
+ startup: yap@EXEC_SUFFIX@ $(PL_SOURCES)
+ -rm -f startup
+@@ -587,15 +587,15 @@
+ mkdir -p $(DESTDIR)$(SHAREDIR)/Yap
+ mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/pl
+ for f in $(PL_SOURCES); do $(INSTALL) $$f $(DESTDIR)$(SHAREDIR)/Yap/pl; done
+- @INSTALL_DLLS@ (cd library/random; make install)
+- @INSTALL_DLLS@ (cd library/regex; make install)
+- @INSTALL_DLLS@ (cd library/system; make install)
+- @INSTALL_DLLS@ (cd library/yap2swi; make install)
+- @INSTALL_DLLS@ (cd library/tries; make install)
+- @INSTALL_DLLS@ (cd library/lammpi; make install)
+- @INSTALL_DLLS@ (cd library/matrix; make install)
+- @INSTALL_MATLAB@ (cd library/matlab; make install)
+- @ENABLE_JPL@ @INSTALL_DLLS@ (cd LGPL/JPL/src; make install)
++ @INSTALL_DLLS@ (cd library/random; $(MAKE) install)
++ @INSTALL_DLLS@ (cd library/regex; $(MAKE) install)
++ @INSTALL_DLLS@ (cd library/system; $(MAKE) install)
++ @INSTALL_DLLS@ (cd library/yap2swi; $(MAKE) install)
++ @INSTALL_DLLS@ (cd library/tries; $(MAKE) install)
++ @INSTALL_DLLS@ (cd library/lammpi; $(MAKE) install)
++ @INSTALL_DLLS@ (cd library/matrix; $(MAKE) install)
++ @INSTALL_MATLAB@ (cd library/matlab; $(MAKE) install)
++ @ENABLE_JPL@ @INSTALL_DLLS@ (cd LGPL/JPL/src; $(MAKE) install)
+ mkdir -p $(DESTDIR)$(INCLUDEDIR)
+ for h in $(INTERFACE_HEADERS); do $(INSTALL) $$h $(DESTDIR)$(INCLUDEDIR); done
+
+@@ -627,17 +627,17 @@
+ for h in $(HEADERS); do $(INSTALL) $$h $(DESTDIR)$(INCLUDEDIR); done
+
+ install_data:
+- (cd library ; make install)
+- @ENABLE_JPL@ (cd LGPL/JPL ; make install)
+- @ENABLE_JPL@ (cd LGPL/JPL/java; make install)
++ (cd library ; $(MAKE) install)
++ @ENABLE_JPL@ (cd LGPL/JPL ; $(MAKE) install)
++ @ENABLE_JPL@ (cd LGPL/JPL/java; $(MAKE) install)
+ $(INSTALL_DATA) $(srcdir)/LGPL/pillow/icon_address.pl $(DESTDIR)$(SHAREDIR)/Yap/
+ $(INSTALL_DATA) $(srcdir)/LGPL/pillow/pillow.pl $(DESTDIR)$(SHAREDIR)/Yap/
+ # (cd CLPQR ; make install)
+- @INSTALLCLP@(cd LGPL/clp ; make install)
+- @INSTALLCLP@(cd LGPL/clpr ; make install)
++ @INSTALLCLP@(cd LGPL/clp ; $(MAKE) install)
++ @INSTALLCLP@(cd LGPL/clpr ; $(MAKE) install)
+ # (cd CHR ; make install)
+- @INSTALLCLP@(cd LGPL/chr ; make install)
+- @INSTALLCLP@(cd CLPBN ; make install)
++ @INSTALLCLP@(cd LGPL/chr ; $(MAKE) install)
++ @INSTALLCLP@(cd CLPBN ; $(MAKE) install)
+
+
+ ##########
diff --git a/dev-lang/yap/files/yap-5.1.2-tabling.patch b/dev-lang/yap/files/yap-5.1.2-tabling.patch
new file mode 100644
index 000000000000..dcc1ef6cc9a7
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-tabling.patch
@@ -0,0 +1,61 @@
+diff -ur Yap-5.1.2.orig/OPTYap/opt.structs.h Yap-5.1.2/OPTYap/opt.structs.h
+--- Yap-5.1.2.orig/OPTYap/opt.structs.h 2007-05-02 07:33:53.000000000 +1200
++++ Yap-5.1.2/OPTYap/opt.structs.h 2007-08-21 19:44:56.000000000 +1200
+@@ -41,7 +41,7 @@
+ ** ---------------------- */
+
+ struct pages {
+-#ifdef YAPOR
++#if defined(YAPOR) || defined(THREADS)
+ lockvar lock;
+ #endif /* YAPOR */
+ volatile long pages_allocated;
+@@ -275,9 +275,11 @@
+ ** --------------------------- */
+
+ struct local_data{
++#if defined(YAPOR) || defined(THREADS)
++ lockvar lock;
++#endif
+ #ifdef YAPOR
+ /* local data related to or-parallelism */
+- lockvar lock;
+ volatile int load;
+ choiceptr top_choice_point;
+ struct or_frame *top_or_frame;
+diff -ur Yap-5.1.2.orig/OPTYap/tab.structs.h Yap-5.1.2/OPTYap/tab.structs.h
+--- Yap-5.1.2.orig/OPTYap/tab.structs.h 2005-08-05 06:06:35.000000000 +1200
++++ Yap-5.1.2/OPTYap/tab.structs.h 2007-08-21 19:30:06.000000000 +1200
+@@ -50,7 +50,7 @@
+ ** ---------------------------- */
+
+ typedef struct table_entry {
+-#ifdef YAPOR
++#if defined(YAPOR) || defined(THREADS)
+ lockvar lock;
+ #endif /* YAPOR */
+ struct pred_entry *pred_entry;
+@@ -149,8 +149,10 @@
+ ** ------------------------------ */
+
+ typedef struct subgoal_frame {
+-#ifdef YAPOR
++#if defined(YAPOR) || defined(THREADS)
+ lockvar lock;
++#endif
++#ifdef YAPOR
+ int generator_worker;
+ struct or_frame *top_or_frame_on_generator_branch;
+ #endif /* YAPOR */
+@@ -225,8 +227,10 @@
+ ** --------------------------------- */
+
+ typedef struct dependency_frame {
+-#ifdef YAPOR
++#if defined(YAPOR) || defined(THREADS)
+ lockvar lock;
++#endif
++#ifdef YAPOR
+ int leader_dependency_is_on_stack;
+ struct or_frame *top_or_frame;
+ #ifdef TIMESTAMP_CHECK
diff --git a/dev-lang/yap/files/yap-5.1.2-tkyap.patch b/dev-lang/yap/files/yap-5.1.2-tkyap.patch
new file mode 100644
index 000000000000..bdc0b22cec54
--- /dev/null
+++ b/dev-lang/yap/files/yap-5.1.2-tkyap.patch
@@ -0,0 +1,26 @@
+--- Yap-5.1.2.orig/misc/tkyap 2006-02-21 02:18:08.000000000 +1300
++++ Yap-5.1.2/misc/tkyap 2007-11-21 18:51:19.000000000 +1300
+@@ -33,19 +33,10 @@
+ #option add "*message*Font" $TextFont
+ #option add "*list*Font" $TextFont
+
+-if {[file exists /vmlinuz]} {
+- set TextFont "*6x10*"
+- if {[file exists /home/luis/Yap94/linux]} {
+- set homeyap /home/luis/Yap94/linux
+- } else {
+- set homeyap .
+- }
+- set PrologCommand "$homeyap/yap $homeyap/startup -c localhost $service $YapOptions"
+- set SolarisBug 0
+-} else {
+- set PrologCommand "ny -h8000 -s1000"
+- set SolarisBug 1
+-}
++set TextFont "*6x10*"
++
++set PrologCommand "yap -c localhost $service $YapOptions"
++set SolarisBug 0
+
+
+
diff --git a/dev-lang/yap/yap-5.1.2.ebuild b/dev-lang/yap/yap-5.1.2.ebuild
new file mode 100644
index 000000000000..ea777665819f
--- /dev/null
+++ b/dev-lang/yap/yap-5.1.2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/yap/yap-5.1.2.ebuild,v 1.1 2007/11/21 06:25:28 keri Exp $
+
+inherit autotools eutils java-pkg-opt-2
+
+MY_P="Yap-${PV}"
+
+DESCRIPTION="YAP is a high-performance Prolog compiler."
+HOMEPAGE="http://www.ncc.up.pt/~vsc/Yap/"
+SRC_URI="http://www.ncc.up.pt/~vsc/Yap/current/Yap-5.1.2.tar.gz"
+
+LICENSE="Artistic LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="debug doc examples gmp java mpi mysql odbc readline static tk threads"
+
+DEPEND="gmp? ( dev-libs/gmp )
+ java? ( >=virtual/jdk-1.4 )
+ mpi? ( virtual/mpi )
+ mysql? ( virtual/mysql )
+ odbc? ( dev-db/unixODBC )
+ readline? ( sys-libs/readline )"
+
+RDEPEND="${DEPEND}
+ tk? ( dev-lang/tk )"
+
+S="${WORKDIR}"/${MY_P}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-configure.patch
+ epatch "${FILESDIR}"/${P}-multilib.patch
+ epatch "${FILESDIR}"/${P}-parallel-make.patch
+ epatch "${FILESDIR}"/${P}-SONAME.patch
+ epatch "${FILESDIR}"/${P}-analyst.patch
+ epatch "${FILESDIR}"/${P}-tabling.patch
+ epatch "${FILESDIR}"/${P}-chr.patch
+ epatch "${FILESDIR}"/${P}-jpl.patch
+ epatch "${FILESDIR}"/${P}-tkyap.patch
+}
+
+src_compile() {
+ eautoconf
+ econf \
+ --libdir=/usr/$(get_libdir) \
+ --enable-low-level-tracer \
+ --enable-rational-trees \
+ --enable-coroutining \
+ --enable-myddas-stats \
+ --disable-tabling \
+ --disable-eam \
+ --disable-depth-limit \
+ --disable-or-parallelism \
+ $(use_enable threads) \
+ $(use_enable threads pthread-locking) \
+ $(use_enable threads use-malloc) \
+ $(use_enable !static dynamic-loading) \
+ $(use_enable debug debug-yap) \
+ $(use_enable debug wam-profile) \
+ $(use_enable mysql myddas-mysql) \
+ $(use_enable mysql myddas-stats) \
+ $(use_enable mysql myddas-top-level) \
+ $(use_enable odbc myddas-odbc) \
+ $(use_with gmp) \
+ $(use_with readline) \
+ $(use_with mpi) \
+ $(use_with mpi mpe) \
+ $(use_with java jpl) \
+ || die "econf failed"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed."
+
+ if use tk ; then
+ exeinto /usr/bin
+ doexe misc/tkyap
+ fi
+
+ dodoc changes*.html README
+
+ if use doc ; then
+ dodoc docs/yap.html
+ fi
+
+ if use examples ; then
+ docinto examples
+ dodoc CLPBN/clpbn/examples/cg.yap
+ dodoc CLPBN/clpbn/examples/School/*
+ fi
+}