Monday, July 10, 2017

UPDATE: lang/swi-prolog

Hi,

Here's an work in progress update to SWI-Prolog. Notes:

* I've disabled the SSL module because upstream uses the CRYPTO_ONCE
API, which LibreSSL doesn't seem to have.

* A few tests fail. I'm working with upstream to fix these.

The SSL thing, I'd like to have fixed. Upstream has asked [0] if we are
likely to support the CRYPTO_ONCE API any time soon, before they
implement a workaround. Anyone in the know?

[0] https://github.com/SWI-Prolog/swipl-devel/issues/249


Index: Makefile
===================================================================
RCS file: /home/edd/cvsync/ports/lang/swi-prolog/Makefile,v
retrieving revision 1.70
diff -u -p -r1.70 Makefile
--- Makefile 14 Mar 2017 12:23:21 -0000 1.70
+++ Makefile 10 Jul 2017 21:47:11 -0000
@@ -1,17 +1,17 @@
-# $OpenBSD: Makefile,v 1.70 2017/03/14 12:23:21 jca Exp $
+# $OpenBSD: Makefile,v 1.66 2016/05/12 01:17:13 naddy Exp $

+BROKEN-arm = undefined reference to `__sync_fetch_and_add_4'
BROKEN-hppa = undefined reference to __sync_fetch_and_add_4
BROKEN-sparc64 = infinite loop or aborts during build

COMMENT = Prolog for the real world

-V = 6.6.4
-REVISION = 10
-DISTNAME = pl-$V
+V = 7.4.2
+DISTNAME = swipl-$V
PKGNAME = swi-prolog-$V
CATEGORIES = lang

-SHARED_LIBS = pl 5.0
+SHARED_LIBS = pl 6.0

HOMEPAGE = http://www.swi-prolog.org/

@@ -20,17 +20,24 @@ MAINTAINER = Edd Barrett <edd@openbsd.o
# LGPLv2.1
PERMIT_PACKAGE_CDROM = Yes

-WANTLIB += ICE SM X11 Xext Xft Xinerama Xpm Xt c crypto execinfo
-WANTLIB += fontconfig freetype gmp jpeg m ncursesw pthread readline ssl
-WANTLIB += z
+WANTLIB += ICE SM X11 Xext Xft Xinerama Xpm Xt archive c db execinfo
+WANTLIB += fontconfig freetype gmp iodbc jpeg m ncursesw ossp-uuid
+WANTLIB += pthread readline z

MASTER_SITES = ${HOMEPAGE}download/stable/src/ \
https://distfiles.nl/

CONFIGURE_STYLE = gnu
-MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC}/src \
+MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC}/packages/clib \
${WRKSRC}/packages/jpl \
- ${WRKSRC}/packages/xpce/src
+ ${WRKSRC}/packages/xpce/ \
+ ${WRKSRC}/packages/xpce/src \
+ ${WRKSRC}/src
+
+# error: trampoline code generation is not allowed without -ftrampolines
+CFLAGS += -ftrampolines
+
+USE_WXNEEDED = Yes

CONFIGURE_ENV += CIFLAGS=' -I${LOCALBASE}/include' \
LDFLAGS=' -L${LOCALBASE}/lib' \
@@ -39,14 +46,19 @@ CONFIGURE_ENV += CIFLAGS=' -I${LOCALBASE
CONFIGURE_ARGS = --enable-mt \
--disable-custom-flags \
--with-world \
- --with-jpeg=${LOCALBASE} \
--enable-shared

+# LibreSSL missing CRYPTO_ONCE API
+# https://github.com/SWI-Prolog/swipl-devel/issues/249
+CONFIGURE_ARGS += --without-ssl
+
USE_GMAKE = Yes

# Don't pick up bash
MAKE_ENV = MAKESHELL=/bin/sh

+MAKE_ENV += LDFLAGS=-L${LOCALBASE}/lib
+
MAKE_FLAGS = SONAMEOPT= \
SHAREDV=libpl.so.${LIBpl_VERSION}

@@ -57,7 +69,11 @@ MODGCC4_ARCHS = arm
BUILD_DEPENDS = ${RUN_DEPENDS}
LIB_DEPENDS = devel/gmp \
devel/libexecinfo \
- graphics/jpeg
+ graphics/jpeg \
+ devel/uuid \
+ databases/db/v4 \
+ archivers/libarchive \
+ databases/iodbc

FULLARCH = ${MACHINE_ARCH:S/amd64/x86_64/}-openbsd${OSREV}
SUBST_VARS += V BOOT FULLARCH
@@ -67,13 +83,12 @@ post-install:
ln -sf swipl-$V/lib/${FULLARCH}/libpl.so.${LIBpl_VERSION}
mv ${PREFIX}/lib/swipl-${V}/doc ${PREFIX}/share/doc/swipl

-# Swipl multithreading flaky at best on OpenBSD.
-# We are not sure if this is our threading implementation or their code.
-# The following tests fail (hang). We remove them to allow the rest
-# of the tests to execute atleast.
-# When updating, uncomment these to see if they still fail.
+# The following test files hang. We remove them to allow the rest of the tests
+# to execute atleast. When updating, uncomment these to see if they still fail.
+# One test fails after removing all hanging tests.
pre-test:
- rm -f ${WRKBUILD}/src/Tests/core/test_resource_error.pl
+ rm -f ${WRKBUILD}/src/Tests/core/test_resource_error.pl \
+ ${WRKBUILD}/src/Tests/core/test_cgc.pl

.include <bsd.port.arch.mk>

Index: distinfo
===================================================================
RCS file: /home/edd/cvsync/ports/lang/swi-prolog/distinfo,v
retrieving revision 1.10
diff -u -p -r1.10 distinfo
--- distinfo 4 Apr 2014 17:17:03 -0000 1.10
+++ distinfo 9 Jul 2017 18:52:47 -0000
@@ -1,2 +1,2 @@
-SHA256 (pl-6.6.4.tar.gz) = Zjl3lZl544nfD4fC60JqtxEFwSIGYF7ECSWJO5FzPO8=
-SIZE (pl-6.6.4.tar.gz) = 14830255
+SHA256 (swipl-7.4.2.tar.gz) = fxclfaM0vB56NenPXLj8oB2C8epAbHrOdukGKvjw34s=
+SIZE (swipl-7.4.2.tar.gz) = 16496738
Index: patches/patch-packages_bdb_bdb4pl_c
===================================================================
RCS file: patches/patch-packages_bdb_bdb4pl_c
diff -N patches/patch-packages_bdb_bdb4pl_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-packages_bdb_bdb4pl_c 9 Jul 2017 18:52:47 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+DB_FAILCHK not defined in our bdb packages.
+
+Index: packages/bdb/bdb4pl.c
+--- packages/bdb/bdb4pl.c.orig
++++ packages/bdb/bdb4pl.c
+@@ -1497,7 +1497,6 @@ static db_flag dbenv_flags[] =
+ { "use_environ_root", DB_USE_ENVIRON_ROOT, 0 },
+ { "create", DB_CREATE, 0 },
+ { "lockdown", DB_LOCKDOWN, 0 },
+- { "failchk", DB_FAILCHK, 0 },
+ { "private", DB_PRIVATE, 0 },
+ { "register", DB_REGISTER, 0 },
+ { "system_mem", DB_SYSTEM_MEM, 0 },
Index: patches/patch-packages_bdb_bdb4pl_h
===================================================================
RCS file: patches/patch-packages_bdb_bdb4pl_h
diff -N patches/patch-packages_bdb_bdb4pl_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-packages_bdb_bdb4pl_h 9 Jul 2017 19:35:10 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Use the right version of bdb.
+
+Index: packages/bdb/bdb4pl.h
+--- packages/bdb/bdb4pl.h.orig
++++ packages/bdb/bdb4pl.h
+@@ -37,7 +37,7 @@
+ #define DB4PL_H_INCLUDED
+
+ #include <SWI-Prolog.h>
+-#include <db.h>
++#include <db4/db.h>
+
+ /* Consider anything >= DB4.3 as DB43 */
+ #if DB_VERSION_MAJOR >= 4
Index: patches/patch-packages_clib_Makefile_in
===================================================================
RCS file: patches/patch-packages_clib_Makefile_in
diff -N patches/patch-packages_clib_Makefile_in
--- patches/patch-packages_clib_Makefile_in 4 Apr 2014 17:53:49 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-packages_clib_Makefile_in,v 1.3 2014/04/04 17:53:49 edd Exp $
-
-More hanging tests.
-
---- packages/clib/Makefile.in.orig Thu Dec 5 11:26:17 2013
-+++ packages/clib/Makefile.in Thu Dec 5 11:26:22 2013
-@@ -127,7 +127,7 @@ uninstall::
- # Testing
- ################################################################
-
--check: check-socket check-memfile check-unit check-process \
-+check: check-socket check-memfile check-unit \
- check-read check-uri check-cgi
-
- torture: torture-socket
Index: patches/patch-packages_clib_nonblockio_h
===================================================================
RCS file: /home/edd/cvsync/ports/lang/swi-prolog/patches/patch-packages_clib_nonblockio_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-packages_clib_nonblockio_h
--- patches/patch-packages_clib_nonblockio_h 10 Sep 2016 13:03:42 -0000 1.1
+++ patches/patch-packages_clib_nonblockio_h 9 Jul 2017 18:58:00 -0000
@@ -1,7 +1,9 @@
-$OpenBSD: patch-packages_clib_nonblockio_h,v 1.1 2016/09/10 13:03:42 ajacoutot Exp $
---- packages/clib/nonblockio.h.orig Sat Sep 10 11:42:58 2016
-+++ packages/clib/nonblockio.h Sat Sep 10 11:43:31 2016
-@@ -52,6 +52,7 @@
+$OpenBSD$
+
+Index: packages/clib/nonblockio.h
+--- packages/clib/nonblockio.h.orig
++++ packages/clib/nonblockio.h
+@@ -55,6 +55,7 @@

#else /*__WINDOWS__*/

Index: patches/patch-packages_readline_configure
===================================================================
RCS file: patches/patch-packages_readline_configure
diff -N patches/patch-packages_readline_configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-packages_readline_configure 9 Jul 2017 18:52:47 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+readline needs termcap linked.
+
+Index: packages/readline/configure
+--- packages/readline/configure.orig
++++ packages/readline/configure
+@@ -4581,7 +4581,7 @@ if ${ac_cv_lib_readline_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lreadline $LIBS"
++LIBS="-lreadline -ltermcap $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
Index: patches/patch-packages_ssl_ssl4pl_c
===================================================================
RCS file: patches/patch-packages_ssl_ssl4pl_c
diff -N patches/patch-packages_ssl_ssl4pl_c
--- patches/patch-packages_ssl_ssl4pl_c 24 Apr 2014 21:52:20 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@
-$OpenBSD: patch-packages_ssl_ssl4pl_c,v 1.3 2014/04/24 21:52:20 edd Exp $
-
-Fallout from OpenSSL rampage.
-
---- packages/ssl/ssl4pl.c.orig Tue Jan 21 14:47:42 2014
-+++ packages/ssl/ssl4pl.c Thu Apr 24 11:16:54 2014
-@@ -67,7 +67,9 @@ static functor_t FUNCTOR_equals2;
- static functor_t FUNCTOR_crl1;
- static functor_t FUNCTOR_revocations1;
- static functor_t FUNCTOR_revoked2;
-+#ifndef __OpenBSD__
- static functor_t FUNCTOR_session_key1;
-+

No comments:

Post a Comment