commit:     7ef084cef0ea5fbbcc1ae2cbf3c741e7db90d4eb
Author:     Michael Weber <michael <AT> xmw <DOT> de>
AuthorDate: Wed Sep  2 12:17:07 2015 +0000
Commit:     Michael Weber <xmw <AT> gentoo <DOT> org>
CommitDate: Wed Sep  2 12:17:07 2015 +0000
URL:        https://gitweb.gentoo.org/dev/xmw.git/commit/?id=7ef084ce

dev-util/eclipse-clp: fix ebuild

Package-Manager: portage-2.2.20.1
Manifest-Sign-Key: 62EEF090

 dev-util/eclipse-clp/eclipse-clp-6.1.204.ebuild    | 112 ++++++++---------
 .../files/eclipse-clp-6.1.194-Alog-64bit.patch     |  42 -------
 .../files/eclipse-clp-6.1.194-Eplex-include.patch  |  10 --
 .../files/eclipse-clp-6.1.204-Alog.patch           | 138 +++++++++++++++++++++
 ...efile.patch => eclipse-clp-6.1.204-Eplex.patch} |  10 ++
 ...s-64bit.patch => eclipse-clp-6.1.204-Pds.patch} |   0
 ...dsystem.patch => eclipse-clp-6.1.204-Shm.patch} |   0
 ...c-64bit.patch => eclipse-clp-6.1.204-Usc.patch} |  10 ++
 8 files changed, 212 insertions(+), 110 deletions(-)

diff --git a/dev-util/eclipse-clp/eclipse-clp-6.1.204.ebuild 
b/dev-util/eclipse-clp/eclipse-clp-6.1.204.ebuild
index 1411725..b56b0b3 100644
--- a/dev-util/eclipse-clp/eclipse-clp-6.1.204.ebuild
+++ b/dev-util/eclipse-clp/eclipse-clp-6.1.204.ebuild
@@ -44,24 +44,23 @@ REQUIRED_USE="coin? ( gmp ) glpk? ( coin ) parallel? ( tcl 
)"
 
 src_prepare() {
        epatch \
+               "${FILESDIR}"/${PN}-6.1.204-Shm.patch \
+               "${FILESDIR}"/${PN}-6.1.204-Usc.patch \
+               "${FILESDIR}"/${PN}-6.1.204-Alog.patch \
+               "${FILESDIR}"/${PN}-6.1.204-Pds.patch \
+               "${FILESDIR}"/${PN}-6.1.204-Eplex.patch \
                "${FILESDIR}"/${PN}-6.1.194-mysql.patch \
                "${FILESDIR}"/${PN}-6.1.194-tcl8.6.patch \
-               "${FILESDIR}"/${PN}-6.1.194-Eplex-Makefile.patch \
                "${FILESDIR}"/${PN}-6.1.194-AR.patch \
-               "${FILESDIR}"/${PN}-6.1.194-Eplex-include.patch \
                "${FILESDIR}"/${PN}-6.1.194-icparc_solvers.patch \
                "${FILESDIR}"/${PN}-6.1.194-Oci-mkdir.patch \
-               "${FILESDIR}"/${PN}-6.1.194-Usc-64bit.patch \
-               "${FILESDIR}"/${PN}-6.1.194-Pds-64bit.patch \
-               "${FILESDIR}"/${PN}-6.1.194-Alog-64bit.patch \
                "${FILESDIR}"/${PN}-6.1.194-weclipse.patch \
-               "${FILESDIR}"/${PN}-6.1.194-Shm-buildsystem.patch \
                "${FILESDIR}"/${PN}-6.1.204-Visualisation-buildsystem.patch \
                "${FILESDIR}"/${PN}-6.1.204-grappa-detect.patch \
                "${FILESDIR}"/${PN}-6.1.204-cp-viz-detect.patch \
                "${FILESDIR}"/${PN}-6.1.204-JavaInterface-string.patch
 
-       rm ARCH RUNME || die
+       rm -v ARCH RUNME || die
 
        case "${ARCH}" in
                amd64) export ARCH=x86_64_linux ;;
@@ -69,9 +68,7 @@ src_prepare() {
                *)     die "unsupported arch ${ARCH}" ;;
        esac
        export ECLIPSEDIR=${EROOT}opt/${PN}
-       if use mysql ; then
-               export MYSQLDIR="${EROOT}usr/include/mysql"
-       fi
+       use mysql && export MYSQLDIR="${EROOT}usr/include/mysql"
        if use java ; then
                export GRAPPA_DIR="${EROOT}usr/share/grappa-1.2/lib"
                export GRAPPA_JAR="grappa.jar"
@@ -80,24 +77,21 @@ src_prepare() {
                export JAVACUP_DIR="${EROOT}usr/share/javacup/lib"
                export JAVACUP_JAR="javacup-runtime.jar"
        fi
-       tc-export CC AR
+       tc-export CC AR LD
        eautoreconf
-
-       pushd Shm/src >/dev/null
+       cd Shm/src || die
        eautoreconf
-       popd >/dev/null
 }
 
 src_configure() {
        my_submods="Shm Usc Alog Pds"
-       local my_submod
        for my_submod in ${my_submods}; do
                einfo "configure ${my_submod}"
-               pushd ${my_submod}/src >/dev/null || die
+               cd "${S}"/${my_submod}/src || die
                econf
-               popd >/dev/null || die
        done
 
+       cd "${S}"
        econf \
                --without-cplex \
                --without-xpress \
@@ -115,29 +109,10 @@ src_configure() {
                $(use_with tcl)
 }
 
-src_compile() {
-       #replace toplevel Makefile.${ARCH}, -j1 bug etc.
-       rm -fv Makefile.${ARCH} || die
-       mkdir -p sys_{include,{bin,lib}/${ARCH}} || die
-
-       local my_out
-       local my_submod
-       for my_submod in ${my_submods}; do
-               einfo "compile and install ${my_submod}"
-               mkdir -p $my_submod/{include,{bin,lib}/${ARCH}} || die
-               case $my_submod in
-                       Pds)    emake -C ${my_submod}/src install_all ;;
-                       *)              emake -C ${my_submod}/src install ;;
-               esac
-               for my_out in $(find ${my_submod}/{include,{bin,lib}/${ARCH}} 
-type f) ; do
-                       mv -vn ${my_out} sys_${my_out/${my_submod}\/} || die
-               done
-       done
-       runme() {
-               einfo "create wrapper $1"
-               local my_dest="${S}/build/bin/${ARCH}/$1"
-               mkdir -p "$(dirname "${my_dest}")" || die
-               cat << EOF > "${my_dest}"
+make_ecl_wrapper() {
+       einfo "create wrapper $1"
+       local my_dest="${S}/build/bin/${ARCH}/$1"
+       cat << EOF > "${my_dest}"
 #!/bin/sh
 export ECLIPSEDIR="\${ECLIPSEDIR:-${EROOT}opt/${PN}}"
 if [ -z "\${LD_LIBRARY_PATH}" ] ; then
@@ -148,32 +123,52 @@ fi
 export JRE_HOME="\${JRE_HOME:-\${JAVA_HOME}}"
 $2
 EOF
-               chmod +x "${my_dest}" || die
-       }
-       mkdir -p "${S}/bin/${ARCH}"
+       chmod +x "${my_dest}" || die
+}
+
+eemake() {
+       emake -f Makefile.${ARCH} PREFIX="${S}/build" ECLIPSEDIR="${S}/build" 
"$@"
+}
+
+src_compile() {
+       rm -fv Makefile.${ARCH} || die
+       mkdir -p build/{include,{bin,lib}/${ARCH}} || die
+
+       for my_submod in ${my_submods} ; do
+               #einfo "compile & install ${mysubmod}"
+               mkdir -p ${my_submod}/{include,{bin,lib}/${ARCH}} || die
+               case ${my_submod} in
+                       Shm)    emake -C Shm/src SYS_LIB="../lib/${ARCH}" 
SYS_INCLUDE="../include" install ;;
+                       Usc)    emake -C Usc/src install ;;
+                       Alog)   emake -C Alog/src IPATH="-I${S}/build/include" 
install ;;
+                       Pds)    emake -C ${my_submod}/src 
SYS_LIB="${S}/build/lib/${ARCH}" SYS_INCL="${S}/build/include" install_all ;;
+               esac
+               for my_out in $(find ${my_submod}/{include,{bin,lib}/${ARCH}} 
-type f) ; do
+                       mv -vn ${my_out} ${my_out/${my_submod}/build} || die
+               done
+       done
+
        einfo "compile installation kernel (sepia)"
-       emake -C Kernel/${ARCH} sepia
+       echo "char * whereami(void) { return(\"${EROOT}opt/${PN}\"); }" > 
Kernel/${ARCH}/whereami.c || die
+       emake -C Kernel/${ARCH} SYS_LIB="${S}/build/lib/${ARCH}" 
SYS_INCL="${S}/build/include" sepia
        einfo "compile runtime kernel (eclipse.exe)"
-       emake -C Kernel/${ARCH} eclipse.exe
+       emake -C Kernel/${ARCH} SYS_LIB="${S}/build/lib/${ARCH}" 
SYS_INCL="${S}/build/include" eclipse.exe
        einfo "install kernel and header files"
        emake -C Kernel/${ARCH} PREFIX="${S}/build" install
-       runme "eclipse" "exec \"\${ECLIPSEDIR}/lib/${ARCH}/eclipse.exe\" 
\"\$@\""
+       make_ecl_wrapper "eclipse" "exec 
\"\${ECLIPSEDIR}/lib/${ARCH}/eclipse.exe\" \"\$@\""
        if use parallel ; then
                einfo "compile & install parallel Kernel"
-               emake -C Kernel/${ARCH} weclipse
-               cp -v Kernel/${ARCH}/weclipse "${S}/build/bin" || die
-               runme "weclipse" "exec \"\${ECLIPSEDIR}/lib/${ARCH}/weclipse\" 
\"\$@\""
-               emake -C Kernel/${ARCH} peclipse
-               cp -v Kernel/${ARCH}/peclipse "${S}/build/bin" || die
-               runme "peclipse" "exec \"\${ECLIPSEDIR}/lib/${ARCH}/peclipse\" 
\"\$@\""
+               emake -C Kernel/${ARCH} SYS_LIB="${S}/build/lib/${ARCH}" 
SYS_INCL="${S}/build/include" weclipse
+               cp -v Kernel/${ARCH}/weclipse "${S}/build/bin/${ARCH}" || die
+               make_ecl_wrapper "weclipse" "exec 
\"\${ECLIPSEDIR}/lib/${ARCH}/weclipse\" \"\$@\""
+               emake -C Kernel/${ARCH} SYS_LIB="${S}/build/lib/${ARCH}" 
SYS_INCL="${S}/build/include" peclipse
+               cp -v Kernel/${ARCH}/peclipse "${S}/build/bin/${ARCH}" || die
+               make_ecl_wrapper "peclipse" "exec 
\"\${ECLIPSEDIR}/lib/${ARCH}/peclipse\" \"\$@\""
        fi
        if use tcl ; then
-               runme "tkeclipse" "exec wish 
\"\${ECLIPSEDIR}/lib_tcl/tkeclipse.tcl\" -- \"\$@\""
-               runme "tktools" "exec wish 
\"\${ECLIPSEDIR}/lib_tcl/tktools.tcl\" -- \"\$@\""
+               make_ecl_wrapper "tkeclipse" "exec wish 
\"\${ECLIPSEDIR}/lib_tcl/tkeclipse.tcl\" -- \"\$@\""
+               make_ecl_wrapper "tktools" "exec wish 
\"\${ECLIPSEDIR}/lib_tcl/tktools.tcl\" -- \"\$@\""
        fi
-       eemake() {
-               emake -f Makefile.${ARCH} PREFIX="${S}/build" 
ECLIPSEDIR="${S}/build" -j1 "$@"
-       }
        einfo "compile & install ecrc_solvers"
        eemake -C ecrc_solvers install \
                AUX_ECLIPSE="${S}/build/bin/${ARCH}/eclipse"
@@ -185,6 +180,7 @@ EOF
                einfo "compile & install Eplex"
                eemake -C Eplex install
                einfo "compile & install icparc_solvers"
+               eemake -C icparc_solvers ${ARCH}/bitmap.so -j1
                eemake -C icparc_solvers install
        fi
        if use gecode ; then
@@ -195,7 +191,7 @@ EOF
                einfo "compile & install JavaInterface"
                eemake -C JavaInterface install \
                        AUX_ECLIPSE="${S}/build/bin/${ARCH}/eclipse"
-               runme "jeclipse" "exec \"\${JRE_HOME}/bin/java\" -Xss2m  
-Declipse.directory=\"\${ECLIPSEDIR}\" -classpath 
\"\${ECLIPSEDIR}/lib/eclipse.jar\" com.parctechnologies.eclipse.JEclipse 
\"\$@\""
+               make_ecl_wrapper "jeclipse" "exec \"\${JRE_HOME}/bin/java\" 
-Xss2m  -Declipse.directory=\"\${ECLIPSEDIR}\" -classpath 
\"\${ECLIPSEDIR}/lib/eclipse.jar\" com.parctechnologies.eclipse.JEclipse 
\"\$@\""
                einfo "compile & install Visualisation"
                java-pkg_jar-from --build-only javacup javacup-runtime.jar
                eemake -C Visualisation all_visualisation

diff --git a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Alog-64bit.patch 
b/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Alog-64bit.patch
deleted file mode 100644
index c204b17..0000000
--- a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Alog-64bit.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- Eclipse_6.1_187/Alog/src/configure
-+++ Eclipse_6.1_187/Alog/src/configure
-@@ -531,8 +531,9 @@
- #
- # UNIX variants
- #
--CC=cc
--CFLAGS="-O"
-+CC=${CC:-cc}
-+AR=${AR:-ar}
-+CFLAGS=${CFLAGS:-"-O"}
- case "$ARCH" in
-  sun3)
-     ;;
-@@ -556,7 +557,7 @@
-     ;;
-  i386_sunos5)
-     ;;
-- i386_linux)
-+ i386_linux|x86_64_linux)
-     LIBS="-lieee $LIBS"
-     ;;
-  rs_aix32)
-@@ -767,6 +768,7 @@
- s%@infodir@%$infodir%g
- s%@mandir@%$mandir%g
- s%@CC@%$CC%g
-+s%@AR@%$AR%g
- s%@ARCH@%$ARCH%g
- s%@RANLIB@%$RANLIB%g
- s%@SYS_DIR@%$SYS_DIR%g
---- Eclipse_6.1_187/Alog/src/Makefile.in
-+++ Eclipse_6.1_187/Alog/src/Makefile.in
-@@ -20,7 +20,7 @@
- 
- CCFLAGS = $(CFLAGS) $(IPATH)
- 
--AR = ar ruv
-+AR = @AR@ ruv
- RM = /bin/rm -f
- CP = /bin/cp
- 

diff --git a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Eplex-include.patch 
b/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Eplex-include.patch
deleted file mode 100644
index 9ad1520..0000000
--- a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Eplex-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- Eclipse_6.1_187/Eplex/coinplex.cpp
-+++ Eclipse_6.1_187/Eplex/coinplex.cpp
-@@ -139,6 +139,7 @@
- #include <stdio.h>
- #include <exception>
- #include <string>
-+#include <cmath>
- using std::string;
- using namespace std;
- 

diff --git a/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Alog.patch 
b/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Alog.patch
new file mode 100644
index 0000000..2dfda31
--- /dev/null
+++ b/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Alog.patch
@@ -0,0 +1,138 @@
+--- Eclipse_6.1_187/Alog/src/configure
++++ Eclipse_6.1_187/Alog/src/configure
+@@ -531,8 +531,9 @@
+ #
+ # UNIX variants
+ #
+-CC=cc
+-CFLAGS="-O"
++CC=${CC:-cc}
++AR=${AR:-ar}
++CFLAGS=${CFLAGS:-"-O"}
+ case "$ARCH" in
+  sun3)
+     ;;
+@@ -556,7 +557,7 @@
+     ;;
+  i386_sunos5)
+     ;;
+- i386_linux)
++ i386_linux|x86_64_linux)
+     LIBS="-lieee $LIBS"
+     ;;
+  rs_aix32)
+@@ -767,6 +768,7 @@
+ s%@infodir@%$infodir%g
+ s%@mandir@%$mandir%g
+ s%@CC@%$CC%g
++s%@AR@%$AR%g
+ s%@ARCH@%$ARCH%g
+ s%@RANLIB@%$RANLIB%g
+ s%@SYS_DIR@%$SYS_DIR%g
+--- Eclipse_6.1_187/Alog/src/Makefile.in
++++ Eclipse_6.1_187/Alog/src/Makefile.in
+@@ -18,9 +18,7 @@
+ 
+ IPATH = -I$(SYS_DIR)/sys_include
+ 
+-CCFLAGS = $(CFLAGS) $(IPATH)
+-
+-AR = ar ruv
++AR = @AR@ ruv
+ RM = /bin/rm -f
+ CP = /bin/cp
+ 
+@@ -28,10 +26,9 @@
+ .SUFFIXES:    .o .c .f .h
+ 
+ .c.o:
+-      $(CC) $(CFLAGS) -c $*.c 
++      $(CC) $(CFLAGS) $(IPATH) -c $*.c 
+ 
+-all:  
+-      $(MAKE) -f Makefile libalog.a mergelogs
++all: libalog.a mergelogs
+       @echo NOT making adjlogs on $(ARCH)
+ 
+ install: all
+@@ -44,12 +41,6 @@
+ #     -$(RM) ../bin/$(ARCH)/adjlogs
+ #     $(CP) adjlogs ../bin/$(ARCH)
+ 
+-alog.o:
+-      $(CC) $(CCFLAGS) -c alog.c 
+-
+-alogf.o:
+-      $(CC) $(CCFLAGS) -c alogf.c 
+-
+ $(ALOG_OBJ):  $(ALOG_SRC) $(ALOG_HDR)
+ 
+ libalog.a:  $(ALOG_OBJ)
+--- Eclipse_6.1_204/Alog/src/alog.h
++++ Eclipse_6.1_204/Alog/src/alog.h
+@@ -11,6 +11,7 @@
+ #define _ALOG_H_
+ 
+ #include <stdio.h>
++#include <string.h>
+ #include "usc.h"
+ 
+ 
+--- Eclipse_6.1_204/Alog/src/mergelogs.c
++++ Eclipse_6.1_204/Alog/src/mergelogs.c
+@@ -357,7 +357,7 @@
+ 
+       do
+       {       
+-              fscanf(fp,"%d %d %d %d %d %lu",
++              (void) fscanf(fp,"%d %d %d %d %d %lu",
+                       &(table->event),&(table->proc_id),&(table->task_id),
+                       &(table->i_data),&(table->time_slot),&(table->time));
+ 
+@@ -367,7 +367,7 @@
+ 
+               do
+               {
+-                      fscanf(fp,"%c",cp);
++                      (void) fscanf(fp,"%c",cp);
+               }
+               while ( *cp == ' ' || *cp == '\t' );
+ 
+@@ -375,7 +375,7 @@
+ 
+               while ( *cp != '\n' && i < C_DATA_LEN )
+               {
+-                      fscanf(fp,"%c",++cp);
++                      (void) fscanf(fp,"%c",++cp);
+ 
+                       i++;
+               }
+--- Eclipse_6.1_204/Alog/src/adjlogs.c
++++ Eclipse_6.1_204/Alog/src/adjlogs.c
+@@ -338,7 +338,7 @@
+ 
+       do
+       {       
+-              fscanf(fp,"%d %d %d %d %d %lu",
++              (void) fscanf(fp,"%d %d %d %d %d %lu",
+                       &(table->event),&(table->proc_id),&(table->task_id),
+                       &(table->i_data),&(table->time_slot),&(table->time));
+ 
+@@ -348,7 +348,7 @@
+ 
+               do
+               {
+-                      fscanf(fp,"%c",cp);
++                      (void) fscanf(fp,"%c",cp);
+               }
+               while ( *cp == ' ' || *cp == '\t' );
+ 
+@@ -356,7 +356,7 @@
+ 
+               while ( *cp != '\n' && i < C_DATA_LEN )
+               {
+-                      fscanf(fp,"%c",++cp);
++                      (void) fscanf(fp,"%c",++cp);
+ 
+                       i++;
+               }

diff --git 
a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Eplex-Makefile.patch 
b/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Eplex.patch
similarity index 98%
rename from dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Eplex-Makefile.patch
rename to dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Eplex.patch
index be515e7..24c7738 100644
--- a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Eplex-Makefile.patch
+++ b/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Eplex.patch
@@ -226,3 +226,13 @@
        LD_LIBRARY_PATH=$(COINARCHDIR)/lib:$(LD_LIBRARY_PATH) $(ECLIPSE) -e 
'get_flag(library_path,P),set_flag(library_path,["."|P]),lib(document),icompile("$(*F)","$(@D)")'
        -@/bin/chmod $(PERM) $@
  
+--- Eclipse_6.1_187/Eplex/coinplex.cpp
++++ Eclipse_6.1_187/Eplex/coinplex.cpp
+@@ -139,6 +139,7 @@
+ #include <stdio.h>
+ #include <exception>
+ #include <string>
++#include <cmath>
+ using std::string;
+ using namespace std;
+ 

diff --git a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Pds-64bit.patch 
b/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Pds.patch
similarity index 100%
rename from dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Pds-64bit.patch
rename to dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Pds.patch

diff --git 
a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Shm-buildsystem.patch 
b/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Shm.patch
similarity index 100%
rename from dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Shm-buildsystem.patch
rename to dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Shm.patch

diff --git a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Usc-64bit.patch 
b/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Usc.patch
similarity index 83%
rename from dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Usc-64bit.patch
rename to dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Usc.patch
index 80a3d5e..0f1d299 100644
--- a/dev-util/eclipse-clp/files/eclipse-clp-6.1.194-Usc-64bit.patch
+++ b/dev-util/eclipse-clp/files/eclipse-clp-6.1.204-Usc.patch
@@ -40,3 +40,13 @@
  RM = /bin/rm -f
  CP = /bin/cp
  
+@@ -28,8 +28,7 @@
+ .c.o:
+       $(CC) $(CCFLAGS) -c $*.c 
+ 
+-all:  
+-      $(MAKE) libusc.a
++all: libusc.a
+ 
+ install: all
+       -$(RM) ../include/usc.h

Reply via email to