Second attempt :)

On Sat, Dec 04, 2010 at 08:53:16PM +0500, Alexandr Shadchin wrote:
> 
> 1) reorder, cleanup and aligned in Makefile
> 2) add CONFIGURE_ARGS += --enable-unicode

  remove CONFIGURE_ARGS += --enable-unicode 
  because add two regress in math/maxima (rtest8: 125, 126)

> 3) fix replacement of ecl-config.1 on ecl.1 
> 4) remove create symlinks lib/libecl.so

  returned symlink lib/libecl.so 

plus
 5) remove create lib/{Copyright, LGPL} (or better to be moved to share/ecl ?)
 6) fix two regress math/maxima (rtest16: 382, 383)
    based on the commit
    
http://ecls.git.sourceforge.net/git/gitweb.cgi?p=ecls/ecl;a=commit;h=ed8dbe4c139f3428abbbda962d9bd243ab5eb777

Tested on amd64.

-- 
Alexandr Shadchin

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/ecl/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- Makefile    4 Dec 2010 14:36:19 -0000       1.10
+++ Makefile    7 Dec 2010 16:41:17 -0000
@@ -1,53 +1,52 @@
 # $OpenBSD: Makefile,v 1.10 2010/12/04 14:36:19 espie Exp $
 
-COMMENT =      embeddable common-lisp
-CATEGORIES =   lang
+COMMENT =              embeddable common-lisp
+BROKEN-hppa =          infinite loop during build
 
-BROKEN-hppa =  infinite loop during build
+V =                    10.4.1
+DISTNAME =             ecl-$V
+REVISION =             0
+SHARED_LIBS =          ecl     1.0
 
-V =            10.4.1
-DISTNAME =     ecl-$V
-SHARED_LIBS += ecl     1.0
+CATEGORIES =           lang
 
-HOMEPAGE =     http://ecls.sourceforge.net/
-SUBST_VARS =   V
+HOMEPAGE =             http://ecls.sourceforge.net/
 
-# GPLv2 or later
-PERMIT_PACKAGE_CDROM =         Yes
+# LGPLv2
+PERMIT_PACKAGE_CDROM = Yes
 PERMIT_PACKAGE_FTP =   Yes
-PERMIT_DISTFILES_CDROM = Yes
-PERMIT_DISTFILES_FTP =         Yes
+PERMIT_DISTFILES_CDROM =Yes
+PERMIT_DISTFILES_FTP = Yes
 
 MASTER_SITES =         ${MASTER_SITE_SOURCEFORGE:=ecls/}
 
-CONFIGURE_STYLE =      gnu
-USE_GMAKE =            Yes
-USE_LIBTOOL =          Yes
+WANTLIB =              c gc gmp m pthread
+
+LIB_DEPENDS =          devel/boehm-gc \
+                       devel/gmp
+
+SUBST_VARS =           V
+
+USE_GMAKE =            Yes
 USE_GROFF =            Yes
-NO_REGRESS =           Yes
-CONFIGURE_ENV +=       LDFLAGS='-pthread -L${LOCALBASE}/lib' \
-                       CPPFLAGS=-I${LOCALBASE}/include \
-                       CFLAGS='${CFLAGS} -pthread' \
-                       ECLLIB_VERSION=${LIBecl_VERSION}
+
+NO_REGRESS =           Yes
+
+CONFIGURE_STYLE =      gnu
+CONFIGURE_ARGS =       --enable-boehm=system \
+                       --with-system-gmp
+CONFIGURE_ENV =                ECLLIB_VERSION=${LIBecl_VERSION} \
+                       CPPFLAGS="-I${LOCALBASE}/include" \
+                       LDFLAGS="-L${LOCALBASE}/lib"
+
+MODGNU_CONFIG_GUESS_DIRS =     ${WRKDIST} \
+                               ${WRKDIST}/src
+
 FLAVORS =              debug
 FLAVOR ?=
 
-CONFIGURE_ARGS +=      --enable-boehm=system \
-                       --with-system-gmp \
-                       --with-gmp-prefix=${LOCALBASE} \
-
 .if ${FLAVOR:L:Mdebug}
 CONFIGURE_ARGS +=      --with-debug-cflags=-g
 .endif
-
-MODGNU_CONFIG_GUESS_DIRS =     ${WRKDIST} \
-                               ${WRKDIST}/src \
-                               ${WRKDIST}/src/gc \
-                               ${WRKDIST}/src/gmp
-
-LIB_DEPENDS += devel/gmp \
-               devel/boehm-gc
-               
-WANTLIB +=     c gc gmp m pthread
 
 .include <bsd.port.mk>
Index: patches/patch-src_Makefile_in
===================================================================
RCS file: /cvs/ports/lang/ecl/patches/patch-src_Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_Makefile_in
--- patches/patch-src_Makefile_in       4 Dec 2010 14:36:19 -0000       1.2
+++ patches/patch-src_Makefile_in       7 Dec 2010 16:41:17 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-src_Makefile_in,v 1.2 2010/12/04 14:36:19 espie Exp $
---- src/Makefile.in.orig       Sun Apr  4 16:31:27 2010
-+++ src/Makefile.in    Sun Nov 28 20:14:34 2010
+--- src/Makefile.in.orig       Sun Apr  4 20:31:27 2010
++++ src/Makefile.in    Sun Dec  5 15:28:33 2010
 @@ -152,6 +152,7 @@ install:
        for i in BUILD-STAMP help.doc TAGS ; do \
          $(INSTALL_DATA) $$i $(DESTDIR)$(ecldir); \
@@ -9,7 +9,7 @@ $OpenBSD: patch-src_Makefile_in,v 1.2 20
        for i in $(LSP_LIBRARIES) $(LIBRARIES); do \
          if test -s $$i ; then \
           if echo $$i | grep dll; then \
-@@ -160,13 +161,7 @@ install:
+@@ -160,25 +161,16 @@ install:
           $(INSTALL_LIBRARY) $$i $(DESTDIR)$(libdir); \
          fi \
        done
@@ -24,3 +24,17 @@ $OpenBSD: patch-src_Makefile_in,v 1.2 20
        for i in c/dpp$(EXE) ecl_min$(EXE) `cat MODULES`; do \
          case $$i in \
            *.fas) $(INSTALL_PROGRAM) $$i $(DESTDIR)$(ecldir);; \
+           *) $(INSTALL_DATA) $$i $(DESTDIR)$(ecldir);; \
+         esac \
+       done
+-      for i in Copyright LGPL; do \
+-        $(INSTALL_DATA) $(top_srcdir)/../$$i $(DESTDIR)$(libdir); \
+-      done
+       $(mkinstalldirs) $(DESTDIR)$(mandir)/man$(manext)
+-      for i in doc/ecl.man doc/ecl-config.man; do \
+-          $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man$(manext)/ecl.$(manext); 
\
++      for i in ecl ecl-config; do \
++          $(INSTALL_DATA) doc/$$i.man 
$(DESTDIR)$(mandir)/man$(manext)/$$i.$(manext); \
+       done
+ 
+ flatinstall: BUILD-STAMP
Index: patches/patch-src_c_num_sfun_d
===================================================================
RCS file: patches/patch-src_c_num_sfun_d
diff -N patches/patch-src_c_num_sfun_d
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_c_num_sfun_d      7 Dec 2010 16:41:17 -0000
@@ -0,0 +1,105 @@
+$OpenBSD$
+--- src/c/num_sfun.d.orig      Sun Apr  4 20:31:28 2010
++++ src/c/num_sfun.d   Tue Dec  7 21:34:18 2010
+@@ -153,52 +153,67 @@ cl_exp(cl_object x)
+ }
+ 
+ cl_object
+-cl_expt(cl_object x, cl_object y)
++expt_zero(cl_object x, cl_object y)
+ {
+       cl_type ty, tx;
+       cl_object z;
+-        ty = type_of(y);
+-        if (ecl_unlikely(!ECL_NUMBER_TYPE_P(ty))) {
+-                FEwrong_type_nth_arg(@[expt], 2, y, @[number]);
++      ty = type_of(y);
++      tx = type_of(x);
++      if (ecl_unlikely(!ECL_NUMBER_TYPE_P(tx))) {
++              FEwrong_type_nth_arg(@[expt], 1, x, @[number]);
+       }
+-        tx = type_of(x);
+-        if (ecl_unlikely(!ECL_NUMBER_TYPE_P(tx))) {
+-                FEwrong_type_nth_arg(@[expt], 2, x, @[number]);
+-      }
+-      if (ecl_zerop(y)) {
+-              /* INV: The most specific numeric types come first. */
+-              switch ((ty > tx)? ty : tx) {
+-              case t_fixnum:
+-              case t_bignum:
+-              case t_ratio:
+-                      z = MAKE_FIXNUM(1); break;
++      /* INV: The most specific numeric types come first. */
++      switch ((ty > tx)? ty : tx) {
++      case t_fixnum:
++      case t_bignum:
++      case t_ratio:
++              return MAKE_FIXNUM(1);
+ #ifdef ECL_SHORT_FLOAT
+-              case t_shortfloat:
+-                      z = make_shortfloat(1.0); break;
++      case t_shortfloat:
++              return make_shortfloat(1.0);
+ #endif
+-              case t_singlefloat:
+-                      z = ecl_make_singlefloat(1.0); break;
+-              case t_doublefloat:
+-                      z = ecl_make_doublefloat(1.0); break;
++      case t_singlefloat:
++              return ecl_make_singlefloat(1.0);
++      case t_doublefloat:
++              return ecl_make_doublefloat(1.0);
+ #ifdef ECL_LONG_FLOAT
+-              case t_longfloat:
+-                      z = ecl_make_longfloat(1.0); break;
++      case t_longfloat:
++              return ecl_make_longfloat(1.0);
+ #endif
+-              case t_complex:
+-                      z = cl_expt((tx == t_complex)? x->complex.real : x,
+-                                  (ty == t_complex)? y->complex.real : y);
+-                      z = ecl_make_complex(z, MAKE_FIXNUM(0));
+-                      break;
+-              default:
+-                      /* We will never reach this */
+-                      (void)0;
+-              }
+-      } else if (ecl_zerop(x)) {
++      case t_complex:
++              z = expt_zero((tx == t_complex)? x->complex.real : x,
++                            (ty == t_complex)? y->complex.real : y);
++              return ecl_make_complex(z, MAKE_FIXNUM(0));
++      default:
++              /* We will never reach this */
++              (void)0;
++      }
++}
++
++cl_object
++cl_expt(cl_object x, cl_object y)
++{
++      cl_type ty, tx;
++      cl_object z;
++      if (ecl_unlikely(ecl_zerop(y))) {
++              @(return expt_zero(x, y));
++      }
++      ty = type_of(y);
++      tx = type_of(x);
++      if (ecl_unlikely(!ECL_NUMBER_TYPE_P(tx))) {
++              FEwrong_type_nth_arg(@[expt], 1, x, @[number]);
++      }
++      if (ecl_zerop(x)) {
+               z = ecl_times(x, y);
+               if (!ecl_plusp(ty==t_complex?y->complex.real:y))
+                       z = ecl_divide(MAKE_FIXNUM(1), z);
+       } else if (ty != t_fixnum && ty != t_bignum) {
+-              z = ecl_log1(x);
++              /* The following could be just
++                 z = ecl_log1(x);
++                 however, Maxima expects EXPT to have double accuracy
++                 when the first argument is integer and the second
++                 is double-float */
++              z = ecl_log1(ecl_times(x, expt_zero(x, y)));
+               z = ecl_times(z, y);
+               z = cl_exp(z);
+       } else if (ecl_minusp(y)) {
Index: patches/patch-src_configure
===================================================================
RCS file: /cvs/ports/lang/ecl/patches/patch-src_configure,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_configure
--- patches/patch-src_configure 4 Dec 2010 14:36:19 -0000       1.2
+++ patches/patch-src_configure 7 Dec 2010 16:41:17 -0000
@@ -1,14 +1,16 @@
 $OpenBSD: patch-src_configure,v 1.2 2010/12/04 14:36:19 espie Exp $
---- src/configure.orig Sun Apr  4 16:31:32 2010
-+++ src/configure      Sun Nov 28 20:13:19 2010
-@@ -13715,13 +13715,14 @@ _ACEOF
- 
- fi
- 
-+: ${ECLLIB_VERSION:=8.12}
- if test ${enable_shared} = "yes"; then
- 
- cat >>confdefs.h <<\_ACEOF
+--- src/configure.orig Sun Apr  4 20:31:32 2010
++++ src/configure      Fri Jul 23 00:18:53 2010
+@@ -4459,7 +4459,7 @@ case "${host_os}" in
+               SHARED_LDFLAGS="-shared ${LDFLAGS}"
+               BUNDLE_LDFLAGS="-shared ${LDFLAGS}"
+               ECL_LDRPATH="-Wl,--rpath,~A"
+-              clibs="-lpthread -lm"
++              clibs="-pthread -lm"
+               SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION"
+               SONAME_LDFLAGS="-Wl,-soname,SONAME"
+               ;;
+@@ -13721,7 +13721,7 @@ cat >>confdefs.h <<\_ACEOF
  #define ENABLE_DLOPEN 1
  _ACEOF
  
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/lang/ecl/pkg/PLIST,v
retrieving revision 1.4
diff -u -p -r1.4 PLIST
--- pkg/PLIST   4 Dec 2010 14:36:19 -0000       1.4
+++ pkg/PLIST   7 Dec 2010 16:41:17 -0000
@@ -18,8 +18,6 @@ include/ecl/object.h
 include/ecl/page.h
 include/ecl/stacks.h
 include/ecl/unify.h
-lib/Copyright
-lib/LGPL
 lib/ecl-${V}/
 lib/ecl-${V}/BUILD-STAMP
 lib/ecl-${V}/TAGS
@@ -54,4 +52,5 @@ lib/ecl-${V}/sockets.asd
 @bin lib/ecl-${V}/sockets.fas
 lib/ecl-${V}/sysfun.lsp
 lib/ecl-${V}/ucd.dat
+...@man man/man1/ecl-config.1
 @man man/man1/ecl.1

Reply via email to