pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

swi-prolog-lite: Import swi-prolog-lite-7.6.4 as wip/swi-prolog-lite



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Mon Sep 24 20:54:50 2018 +0200
Changeset:	0812cd9a7e74c2a7890cea677605cad6b8101592

Modified Files:
	Makefile
Added Files:
	swi-prolog-lite/DESCR
	swi-prolog-lite/Makefile
	swi-prolog-lite/Makefile.common
	swi-prolog-lite/PLIST
	swi-prolog-lite/PLIST.Darwin
	swi-prolog-lite/PLIST.Linux-x86_64
	swi-prolog-lite/buildlink3.mk
	swi-prolog-lite/distinfo
	swi-prolog-lite/patches/patch-ad
	swi-prolog-lite/patches/patch-packages_Dialect.defs.in
	swi-prolog-lite/patches/patch-packages_clib_sha1_brg_endian.h
	swi-prolog-lite/patches/patch-src_pl-funcs.h
	swi-prolog-lite/patches/patch-src_pl-rsort.c
	swi-prolog-lite/patches/patch-src_pl-thread.c

Log Message:
swi-prolog-lite: Import swi-prolog-lite-7.6.4 as wip/swi-prolog-lite

ISO/Edinburgh-style Prolog compiler.  Compliant with Part 1 of the ISO
standard for Prolog.  Covers all traditional Edinburgh Prolog features
and shares many features with Quintus and SICStus Prolog, including a
compatible module system. Very fast compiler, garbage collection (also
on atoms), fast and powerful C/C++ interface, autoloading,
GNU-readline interface.  SWI-Prolog supports architectures with 32-bit
or greater (64-bit) word-length.

This is the core package, packages are available in the
swi-prolog-packages package.

Based on lang/swi-prolog-lite and intended to be used to update
lang/swi-prolog* packages.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=0812cd9a7e74c2a7890cea677605cad6b8101592

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |   1 +
 swi-prolog-lite/DESCR                              |  10 +
 swi-prolog-lite/Makefile                           |  38 ++
 swi-prolog-lite/Makefile.common                    |  18 +
 swi-prolog-lite/PLIST                              | 406 +++++++++++++++++++++
 swi-prolog-lite/PLIST.Darwin                       |   3 +
 swi-prolog-lite/PLIST.Linux-x86_64                 |   3 +
 swi-prolog-lite/buildlink3.mk                      |  17 +
 swi-prolog-lite/distinfo                           |  12 +
 swi-prolog-lite/patches/patch-ad                   |  19 +
 .../patches/patch-packages_Dialect.defs.in         |  22 ++
 .../patches/patch-packages_clib_sha1_brg_endian.h  |  15 +
 swi-prolog-lite/patches/patch-src_pl-funcs.h       |  16 +
 swi-prolog-lite/patches/patch-src_pl-rsort.c       | 217 +++++++++++
 swi-prolog-lite/patches/patch-src_pl-thread.c      |  22 ++
 15 files changed, 819 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 3845d1333c..b86be22ef0 100644
--- a/Makefile
+++ b/Makefile
@@ -4395,6 +4395,7 @@ SUBDIR+=	swami
 SUBDIR+=	swarp
 SUBDIR+=	swfmill
 SUBDIR+=	swftools
+SUBDIR+=	swi-prolog-lite
 SUBDIR+=	swift
 SUBDIR+=	swift-git
 SUBDIR+=	swisseph
diff --git a/swi-prolog-lite/DESCR b/swi-prolog-lite/DESCR
new file mode 100644
index 0000000000..b22e0f8115
--- /dev/null
+++ b/swi-prolog-lite/DESCR
@@ -0,0 +1,10 @@
+ISO/Edinburgh-style Prolog compiler.  Compliant with Part 1 of the ISO
+standard for Prolog.  Covers all traditional Edinburgh Prolog features
+and shares many features with Quintus and SICStus Prolog, including a
+compatible module system. Very fast compiler, garbage collection (also
+on atoms), fast and powerful C/C++ interface, autoloading,
+GNU-readline interface.  SWI-Prolog supports architectures with 32-bit
+or greater (64-bit) word-length.
+
+This is the core package, packages are available in the
+swi-prolog-packages package.
diff --git a/swi-prolog-lite/Makefile b/swi-prolog-lite/Makefile
new file mode 100644
index 0000000000..bbc7df0c46
--- /dev/null
+++ b/swi-prolog-lite/Makefile
@@ -0,0 +1,38 @@
+# $NetBSD: Makefile,v 1.26 2018/04/17 20:57:19 leot Exp $
+
+.include "Makefile.common"
+
+PKGNAME=		swi-prolog-lite-${SWIPLVERS}
+
+MAINTAINER=		pkgsrc-users%NetBSD.org@localhost
+COMMENT=		ISO/Edinburgh-style Prolog compiler
+
+GNU_CONFIGURE=		yes
+CONFIGURE_DIRS=		src
+
+CONFIGURE_ENV+=		PL=swi-prolog
+CONFIGURE_ENV+=		PLARCH=${MACHINE_GNU_PLATFORM}	# make PLIST consistent
+USE_TOOLS+=		gmake bash:run
+
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(LP64PLATFORMS:@.PLAT.@${MACHINE_PLATFORM:M${.PLAT.}}@) || \
+    (defined(ABI) && ${ABI} == "64")
+PLIST_SUBST+=		BITS=64
+.else
+PLIST_SUBST+=		BITS=32
+.endif
+
+REPLACE_INTERPRETER+=	swipl
+REPLACE.swipl.old=	/usr/bin/swipl
+REPLACE.swipl.new=	${PREFIX}/bin/swi-prolog
+REPLACE_FILES.swipl+=	library/dialect/sicstus/swipl-lfr.pl
+
+TEST_TARGET=		check
+
+.include "../../devel/ncurses/buildlink3.mk"
+# uses rl_event_hook() interface
+.include "../../devel/readline/buildlink3.mk"
+.include "../../devel/gmp/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/swi-prolog-lite/Makefile.common b/swi-prolog-lite/Makefile.common
new file mode 100644
index 0000000000..9e7cd7539a
--- /dev/null
+++ b/swi-prolog-lite/Makefile.common
@@ -0,0 +1,18 @@
+# $NetBSD: Makefile.common,v 1.14 2017/01/19 18:52:15 agc Exp $
+#
+# used by lang/swi-prolog/Makefile
+# used by lang/swi-prolog-packages/Makefile
+# used by lang/swi-prolog-jpl/Makefile
+
+SWIPLVERS=		7.6.4
+DISTNAME=		swipl-${SWIPLVERS}
+CATEGORIES=		lang
+MASTER_SITES=		http://www.swi-prolog.org/download/stable/src/
+MASTER_SITES+=		http://www.swi-prolog.org/download/devel/src/
+
+HOMEPAGE=		http://www.swi-prolog.org/
+LICENSE=		gnu-lgpl-v2.1
+
+DIST_SUBDIR=		swi-prolog
+DISTINFO_FILE=		${.CURDIR}/../../wip/swi-prolog-lite/distinfo
+PATCHDIR=		${.CURDIR}/../../wip/swi-prolog-lite/patches
diff --git a/swi-prolog-lite/PLIST b/swi-prolog-lite/PLIST
new file mode 100644
index 0000000000..4726bfbc0f
--- /dev/null
+++ b/swi-prolog-lite/PLIST
@@ -0,0 +1,406 @@
+@comment $NetBSD$
+bin/swi-prolog
+bin/swipl-ld
+bin/swipl-rc
+lib/pkgconfig/swipl.pc
+lib/swi-prolog-${PKGVERSION}/bin/swipl.home
+lib/swi-prolog-${PKGVERSION}/bin/${MACHINE_GNU_PLATFORM}/swi-prolog
+lib/swi-prolog-${PKGVERSION}/bin/${MACHINE_GNU_PLATFORM}/swipl-ld
+lib/swi-prolog-${PKGVERSION}/bin/${MACHINE_GNU_PLATFORM}/swipl-rc
+lib/swi-prolog-${PKGVERSION}/boot/apply.pl
+lib/swi-prolog-${PKGVERSION}/boot/attvar.pl
+lib/swi-prolog-${PKGVERSION}/boot/autoload.pl
+lib/swi-prolog-${PKGVERSION}/boot/bags.pl
+lib/swi-prolog-${PKGVERSION}/boot/dcg.pl
+lib/swi-prolog-${PKGVERSION}/boot/dicts.pl
+lib/swi-prolog-${PKGVERSION}/boot/dwim.pl
+lib/swi-prolog-${PKGVERSION}/boot/engines.pl
+lib/swi-prolog-${PKGVERSION}/boot/expand.pl
+lib/swi-prolog-${PKGVERSION}/boot/history.pl
+lib/swi-prolog-${PKGVERSION}/boot/init.pl
+lib/swi-prolog-${PKGVERSION}/boot/license.pl
+lib/swi-prolog-${PKGVERSION}/boot/load.pl
+lib/swi-prolog-${PKGVERSION}/boot/messages.pl
+lib/swi-prolog-${PKGVERSION}/boot/packs.pl
+lib/swi-prolog-${PKGVERSION}/boot/parms.pl
+lib/swi-prolog-${PKGVERSION}/boot/predopts.pl
+lib/swi-prolog-${PKGVERSION}/boot/qlf.pl
+lib/swi-prolog-${PKGVERSION}/boot/rc.pl
+lib/swi-prolog-${PKGVERSION}/boot/syspred.pl
+lib/swi-prolog-${PKGVERSION}/boot/toplevel.pl
+lib/swi-prolog-${PKGVERSION}/boot/topvars.pl
+lib/swi-prolog-${PKGVERSION}/boot${BITS}.prc
+lib/swi-prolog-${PKGVERSION}/customize/README
+lib/swi-prolog-${PKGVERSION}/customize/dotswiplrc
+lib/swi-prolog-${PKGVERSION}/customize/dotxpcerc
+lib/swi-prolog-${PKGVERSION}/customize/edit
+lib/swi-prolog-${PKGVERSION}/demo/README
+lib/swi-prolog-${PKGVERSION}/demo/likes.pl
+lib/swi-prolog-${PKGVERSION}/doc/Manual/64bits.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/Bibliography.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/Contents.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/DCG.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/DDE.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/DocIndex.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/IDE.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/IO.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/SyntaxAndSemantics.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/acknowledge.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/aggregate.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/allsolutions.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/altmoduleapi.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/ancestral-cut.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/apply.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/arith.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/assoc.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/attvar.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/autoload.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/breakpoint.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/broadcast.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/broadcast.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/builtin.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/builtinlist.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/charconv.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/chario.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/chars.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/charsio.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/chartype.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/check.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/chr.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/chrintro.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/clp.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/clpb.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/clpfd.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/clpqr.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/cmdline.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/compare.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/compilation.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/consulting.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/contrib.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/control.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/coroutining.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/csv.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/ctxmodule.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/cyclic.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/db.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/debug.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/debugger.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/debugging.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/debugoverview.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/defmodule.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/delcont.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/dialect.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/dicts.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/dynamic-modules.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/dynamic.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/edit.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/editreload.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/engine-examples.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/engine-predicates.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/engine-resources.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/engines.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/error.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/errors.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/examineprog.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/examples.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/excepthook.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/exception.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/exception3.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/ext-integration.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/ext-issues.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/ext-lists.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/ext-syntax.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/extensions.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/files.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/findappfile.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/findhome.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/flags.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/forall2.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/foreign.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/foreigninclude.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/foreignlink.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/foreignnotes.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/foreignoverview.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/foreignthread.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/foreigntypes.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/foreignxmp.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/format.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/funcsummary.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/gc.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/gemacs.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/gensym.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/glossary.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/guidelines.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/guitracer.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/gvar.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/hack.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/help.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/history.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/home.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/hooks.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/idepreds.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/idesummary.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/implhistory.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/import.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/importmodule.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/index.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/index.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/info.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/initfile.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/initgoal.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/intlibs.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/intro.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/iostream.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/jitindex.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/libpl.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/library.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/license.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/limits.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/listing.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/lists.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/loadfilehook.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/locale.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/main.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/manipatom.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/manipmodule.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/manipstack.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/manipterm.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/memory.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/metacall.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/metapred.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/miscarith.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/miscpreds.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/modulecompat.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/moduleop.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/modules.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/mt-xpce.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/mtoplevel.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/navigator.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/nb_set.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/next.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/operators.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/opsummary.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/option.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/optparse.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/ordsets.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/otherlicenses.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/overrule.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/overview.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/packs.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/pairs.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/pceemacs.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/persistency.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/pio.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/plld.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/portabilitystrategies.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/practical.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/preddesc.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/predicate_options.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/predsummary.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/prev.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/profile.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/profnode.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/projectfiles.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/prolog_xref.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/prologpack.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/protocol.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/qsaveforeign.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/qsavelimits.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/quasiquotations.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/quickstart.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/random.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/readutil.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/record.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/reexport.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/registry.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/resmodules.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/runtime.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/sicstus-chr.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/signal.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/simplex.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/softlicense.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/solutionsequences.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/sponsor.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/statistics.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/status.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/streamstat.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/strings.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/summary.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/swiorother.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/swiprolog.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/syntax.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/system.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/tabling.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/termrw.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/thmonitor.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/threadcom.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/threadcreate.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/threadpool.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/threads.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/threadsync.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/thutil.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/toplevel.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/topvars.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/tracehook.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/tty.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/typetest.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/ugraphs.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/up.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/url.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/useresource.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/usingmodules.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/varnumbers.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/whymodules.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/widechars.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/www_browser.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/xref.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/xrefchatdep.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/xrefchatfile.gif
+lib/swi-prolog-${PKGVERSION}/doc/Manual/yall.html
+lib/swi-prolog-${PKGVERSION}/doc/Manual/yellow_pages.gif
+lib/swi-prolog-${PKGVERSION}/include/SWI-Prolog.h
+lib/swi-prolog-${PKGVERSION}/include/SWI-Stream.h
+lib/swi-prolog-${PKGVERSION}/include/Yap/YapInterface.h
+lib/swi-prolog-${PKGVERSION}/include/sicstus/sicstus.h
+lib/swi-prolog-${PKGVERSION}/lib/${MACHINE_GNU_PLATFORM}/libswipl.a
+lib/swi-prolog-${PKGVERSION}/library/INDEX.pl
+lib/swi-prolog-${PKGVERSION}/library/MANUAL
+lib/swi-prolog-${PKGVERSION}/library/aggregate.pl
+lib/swi-prolog-${PKGVERSION}/library/ansi_term.pl
+lib/swi-prolog-${PKGVERSION}/library/apply.pl
+lib/swi-prolog-${PKGVERSION}/library/apply_macros.pl
+lib/swi-prolog-${PKGVERSION}/library/arithmetic.pl
+lib/swi-prolog-${PKGVERSION}/library/assoc.pl
+lib/swi-prolog-${PKGVERSION}/library/backcomp.pl
+lib/swi-prolog-${PKGVERSION}/library/base32.pl
+lib/swi-prolog-${PKGVERSION}/library/base64.pl
+lib/swi-prolog-${PKGVERSION}/library/broadcast.pl
+lib/swi-prolog-${PKGVERSION}/library/charsio.pl
+lib/swi-prolog-${PKGVERSION}/library/check.pl
+lib/swi-prolog-${PKGVERSION}/library/check_installation.pl
+lib/swi-prolog-${PKGVERSION}/library/checklast.pl
+lib/swi-prolog-${PKGVERSION}/library/checkselect.pl
+lib/swi-prolog-${PKGVERSION}/library/clp/bounds.pl
+lib/swi-prolog-${PKGVERSION}/library/clp/clp_distinct.pl
+lib/swi-prolog-${PKGVERSION}/library/clp/clp_events.pl
+lib/swi-prolog-${PKGVERSION}/library/clp/clpb.pl
+lib/swi-prolog-${PKGVERSION}/library/clp/clpfd.pl
+lib/swi-prolog-${PKGVERSION}/library/clp/simplex.pl
+lib/swi-prolog-${PKGVERSION}/library/codesio.pl
+lib/swi-prolog-${PKGVERSION}/library/coinduction.pl
+lib/swi-prolog-${PKGVERSION}/library/console_input.pl
+lib/swi-prolog-${PKGVERSION}/library/csv.pl
+lib/swi-prolog-${PKGVERSION}/library/ctypes.pl
+lib/swi-prolog-${PKGVERSION}/library/date.pl
+lib/swi-prolog-${PKGVERSION}/library/dcg/basics.pl
+lib/swi-prolog-${PKGVERSION}/library/debug.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/bim.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/commons.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/eclipse/test_util_iso.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/hprolog.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/hprolog/format.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/ifprolog.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/iso/iso_predicates.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus/arrays.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus/block.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus/lists.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus/sockets.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus/swipl-lfr.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus/system.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus/terms.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/sicstus/timeout.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/swi/syspred_options.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/yap.pl
+lib/swi-prolog-${PKGVERSION}/library/dialect/yap/README.TXT
+lib/swi-prolog-${PKGVERSION}/library/dicts.pl
+lib/swi-prolog-${PKGVERSION}/library/dif.pl
+lib/swi-prolog-${PKGVERSION}/library/edinburgh.pl
+lib/swi-prolog-${PKGVERSION}/library/edit.pl
+lib/swi-prolog-${PKGVERSION}/library/error.pl
+lib/swi-prolog-${PKGVERSION}/library/explain.pl
+lib/swi-prolog-${PKGVERSION}/library/fastrw.pl
+lib/swi-prolog-${PKGVERSION}/library/files.pl
+lib/swi-prolog-${PKGVERSION}/library/gensym.pl
+lib/swi-prolog-${PKGVERSION}/library/git.pl
+lib/swi-prolog-${PKGVERSION}/library/heaps.pl
+lib/swi-prolog-${PKGVERSION}/library/help.pl
+lib/swi-prolog-${PKGVERSION}/library/helpidx.pl
+lib/swi-prolog-${PKGVERSION}/library/hotfix.pl
+lib/swi-prolog-${PKGVERSION}/library/iostream.pl
+lib/swi-prolog-${PKGVERSION}/library/lazy_lists.pl
+lib/swi-prolog-${PKGVERSION}/library/listing.pl
+lib/swi-prolog-${PKGVERSION}/library/lists.pl
+lib/swi-prolog-${PKGVERSION}/library/main.pl
+lib/swi-prolog-${PKGVERSION}/library/make.pl
+lib/swi-prolog-${PKGVERSION}/library/modules.pl
+lib/swi-prolog-${PKGVERSION}/library/nb_rbtrees.pl
+lib/swi-prolog-${PKGVERSION}/library/nb_set.pl
+lib/swi-prolog-${PKGVERSION}/library/occurs.pl
+lib/swi-prolog-${PKGVERSION}/library/operators.pl
+lib/swi-prolog-${PKGVERSION}/library/option.pl
+lib/swi-prolog-${PKGVERSION}/library/optparse.pl
+lib/swi-prolog-${PKGVERSION}/library/ordsets.pl
+lib/swi-prolog-${PKGVERSION}/library/oset.pl
+lib/swi-prolog-${PKGVERSION}/library/pairs.pl
+lib/swi-prolog-${PKGVERSION}/library/persistency.pl
+lib/swi-prolog-${PKGVERSION}/library/pio.pl
+lib/swi-prolog-${PKGVERSION}/library/portray_text.pl
+lib/swi-prolog-${PKGVERSION}/library/pprint.pl
+lib/swi-prolog-${PKGVERSION}/library/predicate_options.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_autoload.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_breakpoints.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_clause.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_codewalk.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_colour.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_format.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_history.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_install.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_jiti.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_metainference.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_pack.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_source.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_stack.pl
+lib/swi-prolog-${PKGVERSION}/library/prolog_xref.pl
+lib/swi-prolog-${PKGVERSION}/library/pure_input.pl
+lib/swi-prolog-${PKGVERSION}/library/qpforeign.pl
+lib/swi-prolog-${PKGVERSION}/library/qsave.pl
+lib/swi-prolog-${PKGVERSION}/library/quasi_quotations.pl
+lib/swi-prolog-${PKGVERSION}/library/quintus.pl
+lib/swi-prolog-${PKGVERSION}/library/random.pl
+lib/swi-prolog-${PKGVERSION}/library/rbtrees.pl
+lib/swi-prolog-${PKGVERSION}/library/readln.pl
+lib/swi-prolog-${PKGVERSION}/library/readutil.pl
+lib/swi-prolog-${PKGVERSION}/library/record.pl
+lib/swi-prolog-${PKGVERSION}/library/sandbox.pl
+lib/swi-prolog-${PKGVERSION}/library/settings.pl
+lib/swi-prolog-${PKGVERSION}/library/shell.pl
+lib/swi-prolog-${PKGVERSION}/library/shlib.pl
+lib/swi-prolog-${PKGVERSION}/library/solution_sequences.pl
+lib/swi-prolog-${PKGVERSION}/library/sort.pl
+lib/swi-prolog-${PKGVERSION}/library/statistics.pl
+lib/swi-prolog-${PKGVERSION}/library/system.pl
+lib/swi-prolog-${PKGVERSION}/library/tabling.pl
+lib/swi-prolog-${PKGVERSION}/library/terms.pl
+lib/swi-prolog-${PKGVERSION}/library/thread.pl
+lib/swi-prolog-${PKGVERSION}/library/thread_pool.pl
+lib/swi-prolog-${PKGVERSION}/library/threadutil.pl
+lib/swi-prolog-${PKGVERSION}/library/tty.pl
+lib/swi-prolog-${PKGVERSION}/library/ugraphs.pl
+lib/swi-prolog-${PKGVERSION}/library/unicode/blocks.pl
+lib/swi-prolog-${PKGVERSION}/library/unicode/unicode_data.pl
+lib/swi-prolog-${PKGVERSION}/library/url.pl
+lib/swi-prolog-${PKGVERSION}/library/utf8.pl
+lib/swi-prolog-${PKGVERSION}/library/varnumbers.pl
+lib/swi-prolog-${PKGVERSION}/library/vm.pl
+lib/swi-prolog-${PKGVERSION}/library/when.pl
+lib/swi-prolog-${PKGVERSION}/library/win_menu.pl
+lib/swi-prolog-${PKGVERSION}/library/writef.pl
+lib/swi-prolog-${PKGVERSION}/library/www_browser.pl
+lib/swi-prolog-${PKGVERSION}/library/yall.pl
+lib/swi-prolog-${PKGVERSION}/swipl.home
+man/man1/swi-prolog.1
+man/man1/swipl-ld.1
+man/man1/swipl-rc.1
+@pkgdir lib/swi-prolog-${PKGVERSION}/library/dialect/ifprolog
diff --git a/swi-prolog-lite/PLIST.Darwin b/swi-prolog-lite/PLIST.Darwin
new file mode 100644
index 0000000000..6a249347fd
--- /dev/null
+++ b/swi-prolog-lite/PLIST.Darwin
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.Darwin,v 1.1 2012/09/28 07:58:06 sbd Exp $
+lib/swi-prolog-${PKGVERSION}/lib/${MACHINE_GNU_PLATFORM}/libswipl.so
+lib/swi-prolog-${PKGVERSION}/lib/${MACHINE_GNU_PLATFORM}/libswipl.so.${PKGVERSION}
diff --git a/swi-prolog-lite/PLIST.Linux-x86_64 b/swi-prolog-lite/PLIST.Linux-x86_64
new file mode 100644
index 0000000000..182563db35
--- /dev/null
+++ b/swi-prolog-lite/PLIST.Linux-x86_64
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.Linux-x86_64,v 1.1 2012/09/28 07:58:06 sbd Exp $
+lib/swi-prolog-${PKGVERSION}/lib/${MACHINE_GNU_PLATFORM}/libswipl.so
+lib/swi-prolog-${PKGVERSION}/lib/${MACHINE_GNU_PLATFORM}/libswipl.so.${PKGVERSION}
diff --git a/swi-prolog-lite/buildlink3.mk b/swi-prolog-lite/buildlink3.mk
new file mode 100644
index 0000000000..50d571fa73
--- /dev/null
+++ b/swi-prolog-lite/buildlink3.mk
@@ -0,0 +1,17 @@
+# $NetBSD: buildlink3.mk,v 1.12 2015/08/18 07:31:01 wiz Exp $
+
+BUILDLINK_TREE+=	swi-prolog-lite
+
+.if !defined(SWI_PROLOG_LITE_BUILDLINK3_MK)
+SWI_PROLOG_LITE_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.swi-prolog-lite+=	swi-prolog-lite>=5.2.9
+BUILDLINK_ABI_DEPENDS.swi-prolog-lite+=	swi-prolog-lite>=6.6.6nb2
+BUILDLINK_PKGSRCDIR.swi-prolog-lite?=	../../lang/swi-prolog-lite
+
+.include "../../devel/ncurses/buildlink3.mk"
+.include "../../devel/readline/buildlink3.mk"
+#.include "../../devel/gmp/buildlink3.mk" ?
+.endif	# SWI_PROLOG_LITE_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-swi-prolog-lite
diff --git a/swi-prolog-lite/distinfo b/swi-prolog-lite/distinfo
new file mode 100644
index 0000000000..b415e7539a
--- /dev/null
+++ b/swi-prolog-lite/distinfo
@@ -0,0 +1,12 @@
+$NetBSD: distinfo,v 1.21 2015/12/29 23:34:56 dholland Exp $
+
+SHA1 (swi-prolog/swipl-7.6.4.tar.gz) = 655acec1abb62a2d09edc85f52a08101a9665379
+RMD160 (swi-prolog/swipl-7.6.4.tar.gz) = 26e4358d277761380298d9e8c189e9aa1147609c
+SHA512 (swi-prolog/swipl-7.6.4.tar.gz) = f0ed16e4f1436115651c38a0bb37008d0dadad5a19b0f09894fcfc51dd3d429f86488e89cce00788c3c36cc2f0cd2957f92df47d5441133a6f8ea9d91ca5470f
+Size (swi-prolog/swipl-7.6.4.tar.gz) = 16777875 bytes
+SHA1 (patch-ad) = f5e7ec0cce757963e021539a397af387eff5cf8f
+SHA1 (patch-packages_Dialect.defs.in) = f75ceac51bae428a81ba2001d39d8408ccb099f9
+SHA1 (patch-packages_clib_sha1_brg_endian.h) = e7bc21953cedafce67e0070b9ec326446bf474fa
+SHA1 (patch-src_pl-funcs.h) = fd821e245ca49a42e595096d05a21ee20d25c41c
+SHA1 (patch-src_pl-rsort.c) = 233430c9ead3e1361f40ae541d0527408a141d6e
+SHA1 (patch-src_pl-thread.c) = 204e9afd776cbb3c9213ec41ac373b02b3fde8ac
diff --git a/swi-prolog-lite/patches/patch-ad b/swi-prolog-lite/patches/patch-ad
new file mode 100644
index 0000000000..c35d89ffd7
--- /dev/null
+++ b/swi-prolog-lite/patches/patch-ad
@@ -0,0 +1,19 @@
+$NetBSD: patch-ad,v 1.5 2014/05/28 10:29:12 markd Exp $
+
+Split install target.
+
+--- packages/Makefile.in.orig	2018-01-12 12:04:38.000000000 +0000
++++ packages/Makefile.in
+@@ -112,9 +112,11 @@ install::
+ 	        $(MAKE) -C $$p $@ || echo $$p >> .failed.$@; \
+ 	    fi; \
+ 	done
+-	$(FORCE_MKINDEX)
+ 	$(END_FORPKG)
+ 
++post-install::
++	$(FORCE_MKINDEX)
++
+ rpm-install: html-install
+ 	$(BEGIN_FORPKG)
+ 	for p in $(PKG); do \
diff --git a/swi-prolog-lite/patches/patch-packages_Dialect.defs.in b/swi-prolog-lite/patches/patch-packages_Dialect.defs.in
new file mode 100644
index 0000000000..d3572d46b2
--- /dev/null
+++ b/swi-prolog-lite/patches/patch-packages_Dialect.defs.in
@@ -0,0 +1,22 @@
+$NetBSD: patch-packages_Dialect.defs.in,v 1.1 2014/05/28 10:29:12 markd Exp $
+
+--- packages/Dialect.defs.in.orig	2014-05-27 12:23:38.000000000 +0000
++++ packages/Dialect.defs.in
+@@ -44,7 +44,7 @@ SO=@SO_EXT@
+ SO_PATH=@SO_PATH@
+ COFLAGS=@COFLAGS@
+ CWFLAGS=@CWFLAGS@
+-CMFLAGS=@CMFLAGS@
++CMFLAGS=@CMFLAGS@ -fPIC
+ CIFLAGS=@CIFLAGS@ -I@abs_top_builddir@/../include
+ DEFS=@DEFS@ -D__SWI_PROLOG__
+ CFLAGS=$(COFLAGS) $(CWFLAGS) $(CMFLAGS) $(CIFLAGS) $(PKGCFLAGS) $(DEFS)
+@@ -57,7 +57,7 @@ else
+ LIBPLSO=$(LIBPLEMBED)
+ endif
+ 
+-PLLDFLAGS=@LDFLAGS@ -L@abs_top_builddir@/../lib/$(PLARCH)
++PLLDFLAGS=@LDFLAGS@ -L$(PLBASE)/lib/$(PLARCH)
+ LDSOFLAGS=@SO_LDFLAGS@ $(PLLDFLAGS) $(PKGLDFLAGS)
+ LDFLAGS=$(PLLDFLAGS) $(PKGLDFLAGS)
+ 
diff --git a/swi-prolog-lite/patches/patch-packages_clib_sha1_brg_endian.h b/swi-prolog-lite/patches/patch-packages_clib_sha1_brg_endian.h
new file mode 100644
index 0000000000..b74403b41a
--- /dev/null
+++ b/swi-prolog-lite/patches/patch-packages_clib_sha1_brg_endian.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-packages_clib_sha1_brg_endian.h,v 1.3 2015/12/29 23:34:56 dholland Exp $
+
+Support Dragonfly and Bitrig.
+
+--- packages/clib/sha1/brg_endian.h.orig	2014-04-13 08:40:33.000000000 +0000
++++ packages/clib/sha1/brg_endian.h
+@@ -39,7 +39,7 @@
+ /* Include files where endian defines and byteswap functions may reside */
+ #if defined(__sun__)
+ #  include <sys/isa_defs.h>
+-#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ )
++#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ ) || defined( __DragonFly__ ) || defined( __Bitrig__ )
+ #  include <sys/endian.h>
+ #elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \
+       defined( __CYGWIN__ ) || defined( __DJGPP__ ) || defined( __osf__ )
diff --git a/swi-prolog-lite/patches/patch-src_pl-funcs.h b/swi-prolog-lite/patches/patch-src_pl-funcs.h
new file mode 100644
index 0000000000..b44e05fc2f
--- /dev/null
+++ b/swi-prolog-lite/patches/patch-src_pl-funcs.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_pl-funcs.h,v 1.2 2014/05/28 10:29:12 markd Exp $
+
+Don't change visibility of a system prototype.
+
+--- src/pl-funcs.h.orig	2014-04-25 14:06:38.000000000 +0000
++++ src/pl-funcs.h
+@@ -347,7 +347,9 @@ COMMON(void)		setOSPrologFlags(void);
+ COMMON(void)		RemoveTemporaryFiles(void);
+ COMMON(bool)		OpenStream(int fd);
+ COMMON(char *)		expandVars(const char *pattern, char *expanded, int len);
++#ifndef HAVE_GETWD
+ COMMON(char *)		getwd(char *buf);
++#endif
+ COMMON(char *)		AbsoluteFile(const char *spec, char *path);
+ COMMON(int)		IsAbsolutePath(const char *spec);
+ COMMON(char *)		BaseName(const char *f);
diff --git a/swi-prolog-lite/patches/patch-src_pl-rsort.c b/swi-prolog-lite/patches/patch-src_pl-rsort.c
new file mode 100644
index 0000000000..03cbf5447d
--- /dev/null
+++ b/swi-prolog-lite/patches/patch-src_pl-rsort.c
@@ -0,0 +1,217 @@
+$NetBSD$
+
+Use FreeBSD qsort_r(3) if not available instead of using nested
+functions.
+
+--- src/pl-rsort.c.orig	2018-01-12 12:04:38.000000000 +0000
++++ src/pl-rsort.c
+@@ -65,43 +65,177 @@ from pl-list.c.
+ 
+ #if !defined(HAVE_QSORT_R) && !defined(HAVE_QSORT_S)
+ 
+-#ifdef QSORT_R_WITH_NESTED_FUNCTIONS
++/*-
++ * SPDX-License-Identifier: BSD-3-Clause
++ *
++ * Copyright (c) 1992, 1993
++ *	The Regents of the University of California.  All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++typedef int		 cmp_t(void *, const void *, const void *);
++static inline char	*med3(char *, char *, char *, cmp_t *, void *);
++
++#define	MIN(a, b)	((a) < (b) ? a : b)
++
++/*
++ * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
++ */
+ 
+-void
+-sort_r(void *base, size_t nel, size_t width,
+-       int (*compar)(const void *a1, const void *a2, void *aarg), void *arg)
+-{ int nested_cmp(const void *a, const void *b)
+-  {
+-    return compar(a, b, arg);
+-  }
++static inline void
++swapfunc(char *a, char *b, size_t es)
++{
++	char t;
+ 
+-  qsort(base, nel, width, nested_cmp);
++	do {
++		t = *a;
++		*a++ = *b;
++		*b++ = t;
++	} while (--es > 0);
+ }
+ 
+-#else
++#define	vecswap(a, b, n)				\
++	if ((n) > 0) swapfunc(a, b, n)
+ 
+-static void *sort_r_ctx;
+-static int (*sort_r_compar)(const void *a1, const void *a2, void *aarg);
++#define	CMP(t, x, y) (cmp((t), (x), (y)))
+ 
+-int
+-nested_cmp(const void *a, const void *b)
+-{ return (*sort_r_compar)(a, b, sort_r_ctx);
++static inline char *
++med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk
++)
++{
++	return CMP(thunk, a, b) < 0 ?
++	       (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
++	      :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
+ }
+ 
+ void
+-sort_r(void *base, size_t nel, size_t width,
+-       int (*compar)(const void *a1, const void *a2, void *aarg), void *arg)
+-{ PL_LOCK(L_SORTR);
+-  sort_r_ctx = arg;
+-  sort_r_compar = compar;
+-
+-  qsort(base, nel, width, nested_cmp);
+-  PL_UNLOCK(L_SORTR);
++qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
++{
++	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
++	size_t d1, d2;
++	int cmp_result;
++	int swap_cnt;
++
++loop:
++	swap_cnt = 0;
++	if (n < 7) {
++		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
++			for (pl = pm; 
++			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
++			     pl -= es)
++				swapfunc(pl, pl - es, es);
++		return;
++	}
++	pm = (char *)a + (n / 2) * es;
++	if (n > 7) {
++		pl = a;
++		pn = (char *)a + (n - 1) * es;
++		if (n > 40) {
++			size_t d = (n / 8) * es;
++
++			pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
++			pm = med3(pm - d, pm, pm + d, cmp, thunk);
++			pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
++		}
++		pm = med3(pl, pm, pn, cmp, thunk);
++	}
++	swapfunc(a, pm, es);
++	pa = pb = (char *)a + es;
++
++	pc = pd = (char *)a + (n - 1) * es;
++	for (;;) {
++		while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) {
++			if (cmp_result == 0) {
++				swap_cnt = 1;
++				swapfunc(pa, pb, es);
++				pa += es;
++			}
++			pb += es;
++		}
++		while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) {
++			if (cmp_result == 0) {
++				swap_cnt = 1;
++				swapfunc(pc, pd, es);
++				pd -= es;
++			}
++			pc -= es;
++		}
++		if (pb > pc)
++			break;
++		swapfunc(pb, pc, es);
++		swap_cnt = 1;
++		pb += es;
++		pc -= es;
++	}
++	if (swap_cnt == 0) {  /* Switch to insertion sort */
++		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
++			for (pl = pm; 
++			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
++			     pl -= es)
++				swapfunc(pl, pl - es, es);
++		return;
++	}
++
++	pn = (char *)a + n * es;
++	d1 = MIN(pa - (char *)a, pb - pa);
++	vecswap(a, pb - d1, d1);
++	d1 = MIN(pd - pc, pn - pd - es);
++	vecswap(pb, pn - d1, d1);
++
++	d1 = pb - pa;
++	d2 = pd - pc;
++	if (d1 <= d2) {
++		/* Recurse on left partition, then iterate on right partition */
++		if (d1 > es) {
++			qsort_r(a, d1 / es, es, thunk, cmp);
++		}
++		if (d2 > es) {
++			/* Iterate rather than recurse to save stack space */
++			/* qsort(pn - d2, d2 / es, es, cmp); */
++			a = pn - d2;
++			n = d2 / es;
++			goto loop;
++		}
++	} else {
++		/* Recurse on right partition, then iterate on left partition */
++		if (d2 > es) {
++			qsort_r(pn - d2, d2 / es, es, thunk, cmp);
++		}
++		if (d1 > es) {
++			/* Iterate rather than recurse to save stack space */
++			/* qsort(a, d1 / es, es, cmp); */
++			n = d1 / es;
++			goto loop;
++		}
++	}
+ }
+ 
+-#endif
++#define HAVE_QSORT_R
+ 
+-#else /*HAVE_QSORT_R|HAVE_QSORT_S*/
++#endif /* !defined(HAVE_QSORT_R) && !defined(HAVE_QSORT_S) */
+ 
+ #ifndef QSORT_R_GNU
+ struct sort_r_data
+@@ -132,6 +266,3 @@ sort_r(void *base, size_t nel, size_t wi
+     qsort_s(base, nel, width, &sort_r_arg_swap, &tmp);
+ #endif
+ }
+-
+-#endif /*HAVE_QSORT_R|HAVE_QSORT_S*/
+-
diff --git a/swi-prolog-lite/patches/patch-src_pl-thread.c b/swi-prolog-lite/patches/patch-src_pl-thread.c
new file mode 100644
index 0000000000..d722ddd098
--- /dev/null
+++ b/swi-prolog-lite/patches/patch-src_pl-thread.c
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Add support for NetBSD pthread_setname_np(3).
+
+--- src/pl-thread.c.orig	2018-01-12 12:04:38.000000000 +0000
++++ src/pl-thread.c
+@@ -1635,10 +1635,15 @@ set_os_thread_name_from_charp(const char
+   if ( pthread_setname_np(name) == 0 )
+     return TRUE;
+ #else
++#if defined(__NetBSD__)
++  if ( pthread_setname_np(pthread_self(), name, NULL) == 0 )
++    return TRUE;
++#else
+   if ( pthread_setname_np(pthread_self(), name) == 0 )
+     return TRUE;
+ #endif
+ #endif
++#endif
+   return FALSE;
+ }
+ 



Home | Main Index | Thread Index | Old Index