Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jul 2023 22:59:34 GMT
From:      Robert Clausecker <fuz@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 94218d3a9118 - main - Mk/Uses: Add guile.mk
Message-ID:  <202307302259.36UMxY9d001106@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=94218d3a91189c7afea956e8905d5e5ecf879a2c

commit 94218d3a91189c7afea956e8905d5e5ecf879a2c
Author:     Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
AuthorDate: 2023-07-28 12:58:44 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-07-30 22:59:04 +0000

    Mk/Uses: Add guile.mk
    
    This patch adds USES=guile[:options], a framework to permit the
    concurrent installation of different guile versions, allowing
    ports to specify which guile they need.
    
    lang/guile is now a meta-port, installing the default guile version;
    guile 3 is now shipped in lang/guile3.
    
    A new port lang/guile-aclocal holds the guile.m4 file from guile3
    to permit ports written against guile1 or guile2 to avoid conflicts.
    
    PR:             260960
    Reported by:    Martin Neubauer <m.ne@gmx.net>
    Approved by:    bofh
    Differential Revision:  https://reviews.freebsd.org/D40194
---
 CHANGES                                            |   9 +
 MOVED                                              |   1 +
 Mk/Uses/guile.mk                                   | 263 +++++++
 Mk/bsd.default-versions.mk                         |   4 +-
 lang/Makefile                                      |   4 +-
 lang/guile-aclocal/Makefile                        |  18 +
 lang/guile/Makefile                                | 100 +--
 lang/guile/files/extra-patch-bootstrap_Makefile.in |  11 -
 lang/guile/files/patch-doc-ref-guile.texi          |  10 -
 lang/guile/pkg-descr                               |   9 +-
 lang/guile1/Makefile                               |  53 +-
 lang/guile1/files/patch-scripts_Makefile.am        |  12 +
 lang/guile1/pkg-plist                              | 231 +++---
 lang/guile2/Makefile                               |  57 +-
 lang/guile2/files/patch-libguile_Makefile.in       |  20 +
 lang/guile2/files/patch-libguile_gen-scmconfig.c   |  13 +-
 lang/guile2/files/patch-libguile_pthread-threads.h |   4 +-
 lang/guile2/pkg-plist                              |  19 +-
 lang/guile3/Makefile                               | 100 +++
 lang/{guile => guile3}/distinfo                    |   2 +-
 lang/guile3/files/extra-patch-upstream-fixes.patch | 789 +++++++++++++++++++++
 lang/guile3/files/patch-configure                  |  18 +
 lang/guile3/files/patch-libguile_Makefile.in       |  20 +
 lang/guile3/files/patch-libguile_gen-scmconfig.c   |  13 +
 lang/guile3/pkg-descr                              |   6 +
 lang/{guile => guile3}/pkg-plist                   |  30 +-
 26 files changed, 1544 insertions(+), 272 deletions(-)

diff --git a/CHANGES b/CHANGES
index 48f0ce9023cd..3a28ea34e815 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,15 @@ in the release notes and/or placed into UPDATING.
 
 All ports committers are allowed to commit to this file.
 
+20230728:
+AUTHOR: andrew@tao11.riddles.org.uk, fuz@FreeBSD.org
+
+  A new uses 'guile' has been added to transparently depend on the
+  proper variant of guile depending on the default version set by the
+  user and the demands of the port.
+
+  See Mk/Uses/guile.mk for in-depth documentation.
+
 20230722:
 AUTHOR: tcberner@FreeBSD.org
 
diff --git a/MOVED b/MOVED
index 0166d5aaadd1..f478d9d12334 100644
--- a/MOVED
+++ b/MOVED
@@ -7775,3 +7775,4 @@ games/naev-data||2023-07-15|Remove obsoleted port. Now games/naev installs data
 graphics/pecl-imagick-im7|graphics/pecl-imagick|2023-07-19|Merged into master port
 x11-toolkits/fox14||2023-07-27|Has expired: Obsolete leaf port, use x11-toolkits/fox(16,17) instead
 x11-wm/cage-devel|x11-wm/cage|2023-07-27|Out of date: use x11-wm/cage for now
+lang/guile|lang/guile3|2023-07-28|lang/guile is now meta-port for default guile version
diff --git a/Mk/Uses/guile.mk b/Mk/Uses/guile.mk
new file mode 100644
index 000000000000..d2822fd1c57d
--- /dev/null
+++ b/Mk/Uses/guile.mk
@@ -0,0 +1,263 @@
+# Provide support for guile
+#
+# MAINTAINER: ports@FreeBSD.org
+# Usage:
+#
+# USES+=	guile[:options,...]
+#
+# Options:
+#
+#   X.Y		specify a Guile version, e.g. 2.2 or 3.0
+#
+#   flavors	define FLAVOR / FLAVORS as guileX from the allowed versions
+#
+#   build	add dependency to BUILD_DEPENDS instead of LIB_DEPENDS
+#   run		add dependency to RUN_DEPENDS instead of LIB_DEPENDS
+#
+#   env		define only the GUIL[DE]_* vars and add them to PLIST_SUB,
+#		do not add dependencies or other global state
+#
+#   alias	add BINARY_ALIAS for guile tools
+#
+#   conflicts	add GUILE_NEWER_PKGS to CONFLICTS_BUILD, this tries to
+#		ensure that non-clean builds of programs that insist on
+#		using the latest available version (there are a surprising
+#		number of these) will fail if the selected version is wrong.
+#
+#   noextra	don't add _GUILE_EXTRA_LIB_DEPENDS
+#
+#   nopkgconf	don't add to PKGCONFIG_PATHS
+#
+#   nocmds	don't add GUILE_*CMD* to CONFIGURE_ENV and MAKE_ENV
+#		(but still define them)
+#
+# Variables defined for use by the port:
+#
+#   GUILE_VER		e.g. 2.2
+#   GUILE_SFX		e.g. 2  (be careful, consider the possibility of 3.1)
+#   GUILE_FLAVOR	e.g. guile22
+#   GUILE_PORT		e.g. lang/guile2
+#   GUILE_CMD		name of guile binary, e.g. guile-2.2
+#   GUILE_*_CMD		name of guile-* binary (legacy)
+#   GUILD_CMD		name of guild binary, e.g. guild-2.2
+#   GUIL*_CMDPATH	full paths of commands
+#   GUILE_PKGCONFIG_DIR	directory for version-specific .pc files
+#			(relative to PREFIX or LOCALBASE)
+#   GUILE_PREFIX
+#   GUILE_GLOBAL_SITE_DIR
+#   GUILE_SITE_DIR
+#   GUILE_SITE_CCACHE_DIR
+#   GUILE_DOCS_DIR	where to put version-specific docs
+#   GUILE_EXAMPLES_DIR	where to put version-specific examples
+#   GUILE_INFO_PATH	a suitable value for INFO_PATH
+#
+# (the _DIR vars are relativized and added to PLIST_SUB without the
+# _DIR suffix)
+#
+.if !defined(_INCLUDE_USES_GUILE_MK)
+_INCLUDE_USES_GUILE_MK=	yes
+
+# When adding a version, please keep the comment in
+# Mk/bsd.default-versions.mk in sync.
+_GUILE_VALID_VERSIONS:=	1.8 2.2 3.0
+.  if defined(_GUILE_EXTRA_VER)
+_GUILE_VALID_VERSIONS+= ${_GUILE_EXTRA_VER}
+.  endif
+
+_GUILE_DEFAULT_VERSION:= ${GUILE_DEFAULT}
+
+.  if ! ${_GUILE_VALID_VERSIONS:M${_GUILE_DEFAULT_VERSION}}
+IGNORE=	Invalid default Guile version ${GUILE_DEFAULT}
+.  endif
+
+# args. Allow a list of numeric versions
+_GUILE_ARG_VERSIONS:=	${guile_ARGS:M[1-9].[0-9]}
+
+# We anticipate which args will be almost universally required
+# and define them negatively. In practice "alias" is needed a lot
+# thanks to makefile assumptions, but it's intrusive enough that
+# we require it to be stated explicitly.
+_GUILE_ARG_NAMES:=	flavors build run env alias conflicts \
+			noextra nopkgconf nocmds
+
+# Define an 0/1 flag for each arg
+.  for _v in ${_GUILE_ARG_NAMES}
+.    if ${_v:Mno*}
+_GUILE_ARG_${_v:tu:S/^NO//}:=${"${guile_ARGS:M${_v}}":?0:1}
+.    else
+_GUILE_ARG_${_v:tu}:=${"${guile_ARGS:M${_v}}":?1:0}
+.    endif
+.  endfor
+
+#
+# Parse ver arguments
+#
+# If multiple versions are specified, we are either doing flavors (in
+# which case we build them all) or we are supposed to pick just one, in
+# which case we pick the default version if it was specified, otherwise
+# the highest.
+#
+_GUILE_CHOSEN_VER:=
+_GUILE_REQUESTED_VERS:=
+
+# check args for validity first
+.  for _v in ${_GUILE_ARG_VERSIONS}
+.    if ! ${_GUILE_VALID_VERSIONS:M${_v}}
+IGNORE=	Invalid Guile version ${_v}
+.    else
+_GUILE_REQUESTED_VERS+= ${_v}
+.    endif
+.  endfor
+
+.  if ${_GUILE_ARG_FLAVORS}
+
+# default to all versions (unlikely in practice)
+.    if empty(_GUILE_REQUESTED_VERS)
+_GUILE_REQUESTED_VERS:= ${_GUILE_VALID_VERSIONS}
+.    endif
+
+# Note that we organize the FLAVORS list so that the
+# first (default) one corresponds to the default version.
+.    if empty(FLAVORS)
+FLAVORS=${_GUILE_DEFAULT_VERSION:S/.//:S/^/guile/} \
+	${_GUILE_REQUESTED_VERS:N${_GUILE_DEFAULT_VERSION}:S/.//:S/^/guile/}
+.    endif
+# User may have specified this; we must respect that.
+.    if empty(FLAVOR)
+FLAVOR= ${FLAVORS:[1]}
+.    endif
+# Translate the selected (possibly by the user) flavor back to the
+# corresponding Guile version.
+_GUILE_CHOSEN_VER:= ${FLAVOR:S/^guile//:C/./&./}
+
+.  else # !${_GUILE_ARG_FLAVORS}
+
+# default to default version
+.    if empty(_GUILE_REQUESTED_VERS)
+_GUILE_REQUESTED_VERS:= ${_GUILE_DEFAULT_VERSION}
+.    endif
+
+# Find default version, or highest. (We abuse alphabetic sort here.)
+_GUILE_CHOSEN_VER:= ${_GUILE_REQUESTED_VERS:M${_GUILE_DEFAULT_VERSION}}
+.    if empty(_GUILE_CHOSEN_VER)
+_GUILE_CHOSEN_VER:= ${_GUILE_REQUESTED_VERS:O:[-1]}
+.    endif
+
+.  endif # ${_GUILE_ARG_FLAVORS}
+
+# _GUILE_CHOSEN_VER is now the desired version in all cases.
+#
+# The GUILE_VER / GUILE_SFX here is the existing usage, but if a
+# version 3.1 comes along, that'll all need to be revisited. (So
+# we discourage the use of GUILE_SFX for anything important.)
+#
+# GUILE_VER= 3.0  (for example)
+# GUILE_SFX= 3
+# GUILE_FLAVOR= guile30
+#
+# GUILE_OTHER/NEWER_PKGS is defined such that it can be placed in
+# CONFLICTS_BUILD for ports that use non-overridable version searches.
+# This gives a proper diagnostic for non-clean builds.
+
+GUILE_VER=	${_GUILE_CHOSEN_VER}
+GUILE_SFX=	${_GUILE_CHOSEN_VER:R}
+
+GUILE_OTHER_PKGS:=${_GUILE_VALID_VERSIONS:@_v@${${_v} != ${_GUILE_CHOSEN_VER}:?guile${_v:R}:}@}
+GUILE_NEWER_PKGS:=${_GUILE_VALID_VERSIONS:@_v@${${_v} > ${_GUILE_CHOSEN_VER}:?guile${_v:R}:}@}
+
+.  if ${_GUILE_ARG_CONFLICTS}
+CONFLICTS_BUILD+=${GUILE_NEWER_PKGS}
+.  endif
+
+GUILE_PORT=	lang/guile${GUILE_SFX}
+GUILE_FLAVOR=	guile${GUILE_VER:S/.//}
+
+GUILE_PREFIX=	${PREFIX}
+
+GUILE_GLOBAL_SITE_DIR=	${GUILE_PREFIX}/share/guile/site
+GUILE_SITE_DIR=		${GUILE_GLOBAL_SITE_DIR}/${GUILE_VER}
+GUILE_SITE_CCACHE_DIR=	${GUILE_PREFIX}/lib/guile/${GUILE_VER}/site-ccache
+GUILE_DOCS_DIR=		${GUILE_PREFIX}/share/doc/${GUILE_FLAVOR}
+GUILE_EXAMPLES_DIR=	${GUILE_PREFIX}/share/examples/${GUILE_FLAVOR}
+GUILE_INFO_PATH=	share/info/guile${GUILE_SFX}
+
+_GUILE_CMDNAMES:=	guile guile-snarf guile-config guile-tools
+.  if ${GUILE_SFX} > 1
+_GUILE_CMDNAMES+=	guild
+.  endif
+
+.  for _c in ${_GUILE_CMDNAMES}
+${_c:S/-/_/:tu}_CMD:=	${_c}-${GUILE_VER}
+${_c:S/-/_/:tu}_CMDPATH:=	${LOCALBASE}/bin/${_c}-${GUILE_VER}
+.  endfor
+
+PLIST_SUB+=	GUILE_VER=${GUILE_VER} GUILE_SFX=${GUILE_SFX} \
+		GUILE_SITE=${GUILE_SITE_DIR:S,^${GUILE_PREFIX}/,,} \
+		GUILE_GLOBAL_SITE=${GUILE_GLOBAL_SITE_DIR:S,^${GUILE_PREFIX}/,,} \
+		GUILE_SITE_CCACHE=${GUILE_SITE_CCACHE_DIR:S,^${GUILE_PREFIX}/,,} \
+		GUILE_DOCS=${GUILE_DOCS_DIR:S,^${GUILE_PREFIX}/,,} \
+		GUILE_EXAMPLES=${GUILE_EXAMPLES_DIR:S,^${GUILE_PREFIX}/,,}
+
+# This may reduce the need for BINARY_ALIAS
+GUILE_ENV=	${_GUILE_CMDNAMES:tu:S/-/_/:@t@${t}=${${t}_CMDPATH}@}
+
+# XXX XXX XXX
+#
+# This all assumes that the underlying Guile >= 2 is built with the
+# threading option, which is on by default.
+
+_GUILE_1.8_EXTRA_LIB_DEPENDS= \
+	libgmp.so:math/gmp \
+	libltdl.so:devel/libltdl
+_GUILE_2.2_EXTRA_LIB_DEPENDS= \
+	libgc-threaded.so:devel/boehm-gc-threaded
+_GUILE_3.0_EXTRA_LIB_DEPENDS= \
+	libgc-threaded.so:devel/boehm-gc-threaded
+
+.  if ${_GUILE_ARG_EXTRA}
+_GUILE_EXTRA_LIB_DEPENDS= ${_GUILE_${GUILE_VER}_EXTRA_LIB_DEPENDS}
+.  else
+_GUILE_EXTRA_LIB_DEPENDS?=
+.  endif
+
+.  if !${_GUILE_ARG_ENV}
+.    if ${_GUILE_ARG_BUILD}
+BUILD_DEPENDS+=	${GUILE_CMD}:${GUILE_PORT}
+.    endif
+.    if ${_GUILE_ARG_RUN}
+RUN_DEPENDS+=	${GUILE_CMD}:${GUILE_PORT}
+.    endif
+.    if !${_GUILE_ARG_BUILD} && !${_GUILE_ARG_RUN}
+.      if ${GUILE_SFX} > 1
+LIB_DEPENDS+=	libguile-${GUILE_VER}.so:${GUILE_PORT} ${_GUILE_EXTRA_LIB_DEPENDS}
+.      else
+LIB_DEPENDS+=	libguile.so:${GUILE_PORT} ${_GUILE_EXTRA_LIB_DEPENDS}
+.      endif
+.    endif
+.    if ${_GUILE_ARG_CMDS}
+.      if ${_GUILE_ARG_ALIAS}
+# If we're doing binary-alias, then only add GUILE itself to the
+# environment, not the build-only tools. This helps when dealing with
+# broken configure scripts that respect e.g. GUILE_CONFIG but then
+# barf on the output if the program name has a suffix.
+CONFIGURE_ENV+=	GUILE=${GUILE_CMDPATH}
+MAKE_ENV+=	GUILE=${GUILE_CMDPATH}
+.      else
+CONFIGURE_ENV+=	${GUILE_ENV}
+MAKE_ENV+=	${GUILE_ENV}
+.      endif
+.    endif # ${_GUILE_ARG_CMDS}
+CONFIGURE_ENV+=	GUILE_EFFECTIVE_VERSION=${GUILE_VER}
+.  endif # !${_GUILE_ARG_ENV}
+
+.  if ${_GUILE_ARG_ALIAS}
+BINARY_ALIAS+=	${_GUILE_CMDNAMES:@t@${t}=${${t:tu:S/-/_/}_CMD}@}
+.  endif
+
+.  if ${_GUILE_ARG_PKGCONF}
+GUILE_PKGCONFIG_DIR:=	libdata/pkgconfig/guile/${GUILE_VER}
+PKGCONFIG_PATHS+=	${LOCALBASE}/${GUILE_PKGCONFIG_DIR}
+PLIST_SUB+=		GUILE_PKGCONFIG_DIR=${GUILE_PKGCONFIG_DIR}
+.  endif
+
+.endif
diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk
index 86e3f5aac016..5410c4a05322 100644
--- a/Mk/bsd.default-versions.mk
+++ b/Mk/bsd.default-versions.mk
@@ -18,7 +18,7 @@ _INCLUDE_BSD_DEFAULT_VERSIONS_MK=	yes
 LOCALBASE?=	/usr/local
 
 .  for lang in APACHE BDB COROSYNC EMACS FIREBIRD FORTRAN FPC GCC \
-	GHOSTSCRIPT GL GO IMAGEMAGICK JAVA LAZARUS LIBRSVG2 LINUX LLVM \
+	GHOSTSCRIPT GL GO GUILE IMAGEMAGICK JAVA LAZARUS LIBRSVG2 LINUX LLVM \
 	LUA LUAJIT MONO MYSQL NINJA NODEJS OPENLDAP PERL5 PGSQL PHP PYTHON \
 	PYTHON2 PYTHON3 PYCRYPTOGRAPHY RUBY RUST SAMBA SSL TCLTK VARNISH
 .    if defined(${lang}_DEFAULT)
@@ -59,6 +59,8 @@ GHOSTSCRIPT_DEFAULT?=	agpl
 GL_DEFAULT?=		mesa-libs
 # Possible values: 1.18, 1.19, 1.20, 1.21-devel
 GO_DEFAULT?=		1.20
+# Possible values: 1.8, 2.2, 3.0
+GUILE_DEFAULT?=		2.2
 # Possible versions: 6, 7
 # Possible flavors:  x11, nox11
 #                    (defaults to x11 when not specified)
diff --git a/lang/Makefile b/lang/Makefile
index e0eb15a5c98f..441660670e75 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -129,9 +129,11 @@
     SUBDIR += gravity
     SUBDIR += groovy
     SUBDIR += gscheme
-    SUBDIR += guile
+    SUBDIR += guile-aclocal
+    SUBDIR += guile-meta
     SUBDIR += guile1
     SUBDIR += guile2
+    SUBDIR += guile3
     SUBDIR += halide
     SUBDIR += harec
     SUBDIR += haskell-mode.el
diff --git a/lang/guile-aclocal/Makefile b/lang/guile-aclocal/Makefile
new file mode 100644
index 000000000000..53a119c0317c
--- /dev/null
+++ b/lang/guile-aclocal/Makefile
@@ -0,0 +1,18 @@
+PORTNAME=	guile-aclocal
+CATEGORIES=	lang scheme
+PKGNAMESUFFIX=
+DISTNAME=	guile-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
+
+MASTERDIR=	${.CURDIR}/../guile3
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+PLIST=		# disable MASTERDIR's plist
+PLIST_FILES=	${PREFIX}/share/aclocal/guile.m4
+
+do-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/aclocal/
+	${INSTALL_DATA} ${WRKSRC}/meta/guile.m4 ${STAGEDIR}${PREFIX}/share/aclocal/
+
+.include "${MASTERDIR}/Makefile"
diff --git a/lang/guile/Makefile b/lang/guile/Makefile
index a263a16fd376..b5a534383e68 100644
--- a/lang/guile/Makefile
+++ b/lang/guile/Makefile
@@ -1,70 +1,36 @@
-PORTNAME=	guile
-PORTVERSION=	3.0.9
-PORTREVISION=	2
+PORTNAME=	guile-meta
+PORTVERSION=	4
 CATEGORIES=	lang scheme
-MASTER_SITES=	GNU
-
-MAINTAINER=	bofh@FreeBSD.org
-COMMENT=	GNU Ubiquitous Intelligent Language for Extension
-WWW=		https://www.gnu.org/software/guile/
-
-LICENSE=	GPLv3 LGPL3
-LICENSE_COMB=	multi
-
-# Currently has linker error in i386. Feel free to add other ARCHS in
-# case of failure
-NOT_FOR_ARCHS=	i386
-
-LIB_DEPENDS=	libffi.so:devel/libffi \
-		libgmp.so:math/gmp \
-		libltdl.so:devel/libltdl \
-		libunistring.so:devel/libunistring
-
-USES=		charsetfix compiler:c11 cpe gmake iconv libtool \
-		makeinfo pathfix pkgconfig readline tar:lz
-CPE_VENDOR=	gnu
-USE_LDCONFIG=	yes
-
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--enable-lto=${WITHOUT_LTO:Dno:U${WITH_LTO:Dyes:Uno}}
-
-#MAKE_JOBS_UNSAFE=	yes
-INSTALL_TARGET=	install-strip
-
-CONFLICTS_INSTALL=	guile1 guile2
-
-INFO=		guile r5rs
-
-PLIST_SUB=	GUILE_VER=${PORTVERSION:R}
-
-OPTIONS_DEFINE=		NLS THREADS
-OPTIONS_DEFAULT=	NLS THREADS
-OPTIONS_SUB=		yes
-
-NLS_USES=		gettext
-NLS_CONFIGURE_ENABLE=	nls
-
-THREADS_LIB_DEPENDS=		libgc-threaded.so:devel/boehm-gc-threaded
-THREADS_LIB_DEPENDS_OFF=	libgc.so:devel/boehm-gc
-THREADS_CONFIGURE_WITH=		threads
-
-.include <bsd.port.options.mk>
-
-.if ${ARCH} == powerpc
-EXTRA_PATCHES=	${FILESDIR}/extra-patch-bootstrap_Makefile.in
-.endif
-
-post-patch:
-	@${REINPLACE_CMD} -e 's|-i -e|-i.bak -e|' \
-		${WRKSRC}/libguile/Makefile.in
-	@${RM} -r ${WRKSRC}/prebuilt/32-bit-big-endian
-
-post-patch-THREADS-on:
-	@${REINPLACE_CMD} -e 's|bdw-gc|bdw-gc-threaded|g' ${WRKSRC}/configure
-
-# Currently guile fails to run if libs are stripped. Will need to debug
-# the case.
-#post-install:
-#	@${FIND} ${STAGEDIR}${PREFIX}/lib -name "*.go" | ${XARGS} ${STRIP_CMD}
+MASTER_SITES=	# empty
+DISTFILES=	# empty
+EXTRACT_ONLY=	# empty
+
+MAINTAINER=	andrew@tao11.riddles.org.uk
+COMMENT=	Meta-port for the Guile interpreter
+WWW=		http://www.gnu.org/software/guile/
+
+LICENSE=	NA
+LICENSE_COMB=	single
+LICENSE_NAME=	Non applicable
+LICENSE_TEXT=	No licenses are applicable to metaports
+LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+# no flavors and no version specified, so that we get the default
+# version as specified in DEFAULT_VERSIONS.
+USES=		guile:run
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+# We don't provide a pkgconf or similar - this is purely a user
+# convenience, and building should always be done against a specific
+# version.
+PLIST_FILES=	bin/guile bin/guild
+
+do-install:
+	for prog in guile guild; do \
+		${LN} -sf $${prog}-${GUILE_VER} \
+			${STAGEDIR}${PREFIX}/bin/$${prog}; \
+	done
 
 .include <bsd.port.mk>
diff --git a/lang/guile/files/extra-patch-bootstrap_Makefile.in b/lang/guile/files/extra-patch-bootstrap_Makefile.in
deleted file mode 100644
index b5c56900c963..000000000000
--- a/lang/guile/files/extra-patch-bootstrap_Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- bootstrap/Makefile.in.orig	2022-02-02 15:41:58 UTC
-+++ bootstrap/Makefile.in
-@@ -1751,7 +1751,7 @@ top_builddir_absolute = @top_builddir_absolute@
- top_srcdir = @top_srcdir@
- top_srcdir_absolute = @top_srcdir_absolute@
- GUILE_WARNINGS = -W0
--GUILE_OPTIMIZATIONS = -O1
-+GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps
- GOBJECTS = $(SOURCES:%.scm=%.go)
- nobase_noinst_DATA = $(GOBJECTS)
- CLEANFILES = $(GOBJECTS)
diff --git a/lang/guile/files/patch-doc-ref-guile.texi b/lang/guile/files/patch-doc-ref-guile.texi
deleted file mode 100644
index 2551eb4914ee..000000000000
--- a/lang/guile/files/patch-doc-ref-guile.texi
+++ /dev/null
@@ -1,10 +0,0 @@
---- doc/ref/guile.texi.orig	2020-05-30 20:06:44 UTC
-+++ doc/ref/guile.texi
-@@ -1,6 +1,7 @@
- \input texinfo
- @c -*-texinfo-*-
- @c %**start of header
-+@documentencoding ISO-8859-1
- @setfilename guile.info
- @documentencoding UTF-8
- @settitle Guile Reference Manual
diff --git a/lang/guile/pkg-descr b/lang/guile/pkg-descr
index 9bde69d6b6d3..a193da7e9d15 100644
--- a/lang/guile/pkg-descr
+++ b/lang/guile/pkg-descr
@@ -1,6 +1,7 @@
 GUILE, GNU's Ubiquitous Intelligent Language for Extension,
 is a library that implements the Scheme language plus various
-convenient facilities. It's designed so that you can link it
-into an application or utility to make it extensible.  Our
-plan is to link this library into all GNU programs that call for
-extensibility.
+convenient facilities. See the lang/guile3 port for more detail.
+
+This is a meta port to the Guile interpreter and provides symbolic
+links to bin/guile and bin/guild as a convenience to users. Do not
+depend on this port.
diff --git a/lang/guile1/Makefile b/lang/guile1/Makefile
index 16d46faaf494..f4b32e378206 100644
--- a/lang/guile1/Makefile
+++ b/lang/guile1/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	guile
 PORTVERSION=	1.8.8
+PORTREVISION=	1
 CATEGORIES=	lang scheme
 MASTER_SITES=	GNU
 PKGNAMESUFFIX=	1
@@ -14,41 +15,69 @@ LICENSE_FILE=	${WRKSRC}/COPYING.LESSER
 LIB_DEPENDS=	libltdl.so:devel/libltdl \
 		libgmp.so:math/gmp
 
-USES=		autoreconf cpe gmake libtool makeinfo ncurses pathfix
+# We need to pull the aclocal/guile.m4 from guile3 rather than using
+# our own version, in order to avoid conflicts.
+RUN_DEPENDS=	guile-aclocal>=3:lang/guile-aclocal
+
+USES=		guile:${PORTVERSION:R},env \
+		autoreconf cpe gmake libtool makeinfo ncurses pathfix \
+		readline
 CPE_VENDOR=	gnu
 USE_LDCONFIG=	yes
 
-CONFLICTS_INSTALL=	guile2 guile
-
 GNU_CONFIGURE=	yes
+CONFIGURE_ARGS+=--program-suffix=-${GUILE_VER} \
+		--includedir='$${prefix}/include/guile/${GUILE_VER}/'
+
+INSTALL_TARGET=	install-strip
+
 CFLAGS+=	-fwrapv
 CPPFLAGS+=	-I${LOCALBASE}/include
 LIBS+=		-L${LOCALBASE}/lib
-INSTALL_TARGET=	install-strip
 PORTSCOUT=	limit:^1\.
 
-PLIST_SUB=	GUILE_VER=${PORTVERSION:R}
-
-REINPLACE_FILES=	libguile/smob.c libguile/filesys.c libguile/gc.c \
-			libguile/mallocs.c libguile/eval.c libguile/gc-malloc.c \
-			libguile/ports.c libguile/gc-mark.c libguile/gc_os_dep.c
-
 INFO=		goops guile-tut guile r5rs
+INFO_PATH=	${GUILE_INFO_PATH}
 
 OPTIONS_DEFINE=	NLS
 OPTIONS_SUB=	yes
 
-NLS_CONFIGURE_ENABLE=	nls
 NLS_USES=		gettext
 NLS_USES_OFF=		gettext-tools
+NLS_CONFIGURE_ENABLE=	nls
 
 post-extract:
 	@${FIND} ${WRKSRC}/doc -name "*.info*" -delete
 
+REINPLACE_FILES_1=	libguile/smob.c libguile/filesys.c libguile/gc.c \
+			libguile/mallocs.c libguile/eval.c libguile/gc-malloc.c \
+			libguile/ports.c libguile/gc-mark.c libguile/gc_os_dep.c
+
+REINPLACE_FILES_2=	guile-config/guile-config.in
+
+REINPLACE_FILES_3=	PROGRAM frisk read-text-outline generate-autoload \
+			scan-api api-diff lint snarf-check-and-output-texi \
+			autofrisk punify snarf-guile-m4-docs display-commentary \
+			read-rfc822 summarize-guile-TODO doc-snarf \
+			read-scheme-source use2dot
+
 post-patch:
 	@cd ${WRKSRC} ; \
-	  ${REINPLACE_CMD} -e 's|<malloc\.h>|<stdlib.h>|g' ${REINPLACE_FILES}
+	  ${REINPLACE_CMD} -e 's|<malloc\.h>|<stdlib.h>|g' ${REINPLACE_FILES_1}
 	@${REINPLACE_CMD} -e 's|$$(libdir)|$$(libdir)data|g' ${WRKSRC}/Makefile.am
 	@${TOUCH} ${WRKSRC}/Makefile.in
+	@cd ${WRKSRC} ; \
+	  ${REINPLACE_CMD} -e '1s/guile/guile-${GUILE_VER}/' ${REINPLACE_FILES_2}
+	@cd ${WRKSRC}/scripts ; \
+	  ${REINPLACE_CMD} -e '1,/!#/s/GUILE-guile/GUILE-guile-${GUILE_VER}/' \
+		${REINPLACE_FILES_3}
+
+post-install:
+	${RM} ${STAGEDIR}${PREFIX}/share/aclocal/guile.m4
+	for p in guile guile-tools guile-config guile-snarf; do \
+	  ${LN} -s $${p}-${GUILE_VER} ${STAGEDIR}${PREFIX}/bin/$${p}${GUILE_SFX}; \
+	done
+	${MV} ${STAGEDIR}${PREFIX}/man/man1/guile-${GUILE_VER}.1 \
+	      ${STAGEDIR}${PREFIX}/man/man1/guile${GUILE_SFX}.1
 
 .include <bsd.port.mk>
diff --git a/lang/guile1/files/patch-scripts_Makefile.am b/lang/guile1/files/patch-scripts_Makefile.am
new file mode 100644
index 000000000000..8b8495e29698
--- /dev/null
+++ b/lang/guile1/files/patch-scripts_Makefile.am
@@ -0,0 +1,12 @@
+--- scripts/Makefile.am.orig	2023-05-22 16:38:21 UTC
++++ scripts/Makefile.am
+@@ -21,6 +21,9 @@
+ 
+ AUTOMAKE_OPTIONS = gnu
+ 
++# prevent program-suffix being used in this dir
++transform=
++
+ # These should be installed and distributed.
+ scripts_sources =				\
+ 	PROGRAM					\
diff --git a/lang/guile1/pkg-plist b/lang/guile1/pkg-plist
index 21a21b732956..02566278242f 100644
--- a/lang/guile1/pkg-plist
+++ b/lang/guile1/pkg-plist
@@ -1,115 +1,119 @@
-bin/guile
-bin/guile-config
-bin/guile-snarf
-bin/guile-tools
-include/guile/gh.h
-include/guile/readline.h
-include/guile/srfi/srfi-1.h
-include/guile/srfi/srfi-13.h
-include/guile/srfi/srfi-14.h
-include/guile/srfi/srfi-4.h
-include/guile/srfi/srfi-60.h
-include/libguile.h
-include/libguile/__scm.h
-include/libguile/alist.h
-include/libguile/arbiters.h
-include/libguile/async.h
-include/libguile/backtrace.h
-include/libguile/boolean.h
-include/libguile/chars.h
-include/libguile/continuations.h
-include/libguile/convert.h
-include/libguile/debug-malloc.h
-include/libguile/debug.h
-include/libguile/deprecated.h
-include/libguile/deprecation.h
-include/libguile/discouraged.h
-include/libguile/dynl.h
-include/libguile/dynwind.h
-include/libguile/environments.h
-include/libguile/eq.h
-include/libguile/error.h
-include/libguile/eval.h
-include/libguile/evalext.h
-include/libguile/extensions.h
-include/libguile/feature.h
-include/libguile/filesys.h
-include/libguile/fluids.h
-include/libguile/fports.h
-include/libguile/futures.h
-include/libguile/gc.h
-include/libguile/gdb_interface.h
-include/libguile/gdbint.h
-include/libguile/goops.h
-include/libguile/gsubr.h
-include/libguile/guardians.h
-include/libguile/hash.h
-include/libguile/hashtab.h
-include/libguile/hooks.h
-include/libguile/i18n.h
-include/libguile/init.h
-include/libguile/inline.h
-include/libguile/ioext.h
-include/libguile/iselect.h
-include/libguile/keywords.h
-include/libguile/lang.h
-include/libguile/list.h
-include/libguile/load.h
-include/libguile/macros.h
-include/libguile/mallocs.h
-include/libguile/modules.h
-include/libguile/net_db.h
-include/libguile/null-threads.h
-include/libguile/numbers.h
-include/libguile/objects.h
-include/libguile/objprop.h
-include/libguile/options.h
-include/libguile/pairs.h
-include/libguile/ports.h
-include/libguile/posix.h
-include/libguile/print.h
-include/libguile/procprop.h
-include/libguile/procs.h
-include/libguile/properties.h
-include/libguile/pthread-threads.h
-include/libguile/ramap.h
-include/libguile/random.h
-include/libguile/rdelim.h
-include/libguile/read.h
-include/libguile/regex-posix.h
-include/libguile/root.h
-include/libguile/rw.h
-include/libguile/scmconfig.h
-include/libguile/scmsigs.h
-include/libguile/script.h
-include/libguile/simpos.h
-include/libguile/smob.h
-include/libguile/snarf.h
-include/libguile/socket.h
-include/libguile/sort.h
-include/libguile/srcprop.h
-include/libguile/srfi-13.h
-include/libguile/srfi-14.h
-include/libguile/srfi-4.h
-include/libguile/stackchk.h
-include/libguile/stacks.h
-include/libguile/stime.h
-include/libguile/strings.h
-include/libguile/strorder.h
-include/libguile/strports.h
-include/libguile/struct.h
-include/libguile/symbols.h
-include/libguile/tags.h
-include/libguile/threads.h
-include/libguile/throw.h
-include/libguile/unif.h
-include/libguile/validate.h
-include/libguile/values.h
-include/libguile/variable.h
-include/libguile/vectors.h
-include/libguile/version.h
-include/libguile/vports.h
-include/libguile/weaks.h
+bin/guile-%%GUILE_VER%%
+bin/guile-config-%%GUILE_VER%%
+bin/guile-snarf-%%GUILE_VER%%
+bin/guile-tools-%%GUILE_VER%%
+bin/guile%%GUILE_SFX%%
+bin/guile-config%%GUILE_SFX%%
+bin/guile-snarf%%GUILE_SFX%%
+bin/guile-tools%%GUILE_SFX%%
+include/guile/%%GUILE_VER%%/guile/gh.h
+include/guile/%%GUILE_VER%%/guile/readline.h
+include/guile/%%GUILE_VER%%/guile/srfi/srfi-1.h
+include/guile/%%GUILE_VER%%/guile/srfi/srfi-13.h
+include/guile/%%GUILE_VER%%/guile/srfi/srfi-14.h
+include/guile/%%GUILE_VER%%/guile/srfi/srfi-4.h
+include/guile/%%GUILE_VER%%/guile/srfi/srfi-60.h
+include/guile/%%GUILE_VER%%/libguile.h
+include/guile/%%GUILE_VER%%/libguile/__scm.h
+include/guile/%%GUILE_VER%%/libguile/alist.h
+include/guile/%%GUILE_VER%%/libguile/arbiters.h
+include/guile/%%GUILE_VER%%/libguile/async.h
+include/guile/%%GUILE_VER%%/libguile/backtrace.h
+include/guile/%%GUILE_VER%%/libguile/boolean.h
+include/guile/%%GUILE_VER%%/libguile/chars.h
+include/guile/%%GUILE_VER%%/libguile/continuations.h
+include/guile/%%GUILE_VER%%/libguile/convert.h
+include/guile/%%GUILE_VER%%/libguile/debug-malloc.h
+include/guile/%%GUILE_VER%%/libguile/debug.h
+include/guile/%%GUILE_VER%%/libguile/deprecated.h
+include/guile/%%GUILE_VER%%/libguile/deprecation.h
+include/guile/%%GUILE_VER%%/libguile/discouraged.h
+include/guile/%%GUILE_VER%%/libguile/dynl.h
+include/guile/%%GUILE_VER%%/libguile/dynwind.h
+include/guile/%%GUILE_VER%%/libguile/environments.h
+include/guile/%%GUILE_VER%%/libguile/eq.h
+include/guile/%%GUILE_VER%%/libguile/error.h
+include/guile/%%GUILE_VER%%/libguile/eval.h
+include/guile/%%GUILE_VER%%/libguile/evalext.h
+include/guile/%%GUILE_VER%%/libguile/extensions.h
+include/guile/%%GUILE_VER%%/libguile/feature.h
+include/guile/%%GUILE_VER%%/libguile/filesys.h
+include/guile/%%GUILE_VER%%/libguile/fluids.h
+include/guile/%%GUILE_VER%%/libguile/fports.h
+include/guile/%%GUILE_VER%%/libguile/futures.h
+include/guile/%%GUILE_VER%%/libguile/gc.h
+include/guile/%%GUILE_VER%%/libguile/gdb_interface.h
+include/guile/%%GUILE_VER%%/libguile/gdbint.h
+include/guile/%%GUILE_VER%%/libguile/goops.h
+include/guile/%%GUILE_VER%%/libguile/gsubr.h
+include/guile/%%GUILE_VER%%/libguile/guardians.h
+include/guile/%%GUILE_VER%%/libguile/hash.h
+include/guile/%%GUILE_VER%%/libguile/hashtab.h
+include/guile/%%GUILE_VER%%/libguile/hooks.h
+include/guile/%%GUILE_VER%%/libguile/i18n.h
+include/guile/%%GUILE_VER%%/libguile/init.h
+include/guile/%%GUILE_VER%%/libguile/inline.h
+include/guile/%%GUILE_VER%%/libguile/ioext.h
+include/guile/%%GUILE_VER%%/libguile/iselect.h
+include/guile/%%GUILE_VER%%/libguile/keywords.h
+include/guile/%%GUILE_VER%%/libguile/lang.h
+include/guile/%%GUILE_VER%%/libguile/list.h
+include/guile/%%GUILE_VER%%/libguile/load.h
+include/guile/%%GUILE_VER%%/libguile/macros.h
+include/guile/%%GUILE_VER%%/libguile/mallocs.h
+include/guile/%%GUILE_VER%%/libguile/modules.h
+include/guile/%%GUILE_VER%%/libguile/net_db.h
+include/guile/%%GUILE_VER%%/libguile/null-threads.h
+include/guile/%%GUILE_VER%%/libguile/numbers.h
+include/guile/%%GUILE_VER%%/libguile/objects.h
+include/guile/%%GUILE_VER%%/libguile/objprop.h
+include/guile/%%GUILE_VER%%/libguile/options.h
+include/guile/%%GUILE_VER%%/libguile/pairs.h
+include/guile/%%GUILE_VER%%/libguile/ports.h
+include/guile/%%GUILE_VER%%/libguile/posix.h
+include/guile/%%GUILE_VER%%/libguile/print.h
+include/guile/%%GUILE_VER%%/libguile/procprop.h
+include/guile/%%GUILE_VER%%/libguile/procs.h
+include/guile/%%GUILE_VER%%/libguile/properties.h
+include/guile/%%GUILE_VER%%/libguile/pthread-threads.h
+include/guile/%%GUILE_VER%%/libguile/ramap.h
+include/guile/%%GUILE_VER%%/libguile/random.h
+include/guile/%%GUILE_VER%%/libguile/rdelim.h
+include/guile/%%GUILE_VER%%/libguile/read.h
+include/guile/%%GUILE_VER%%/libguile/regex-posix.h
+include/guile/%%GUILE_VER%%/libguile/root.h
+include/guile/%%GUILE_VER%%/libguile/rw.h
+include/guile/%%GUILE_VER%%/libguile/scmconfig.h
+include/guile/%%GUILE_VER%%/libguile/scmsigs.h
+include/guile/%%GUILE_VER%%/libguile/script.h
+include/guile/%%GUILE_VER%%/libguile/simpos.h
+include/guile/%%GUILE_VER%%/libguile/smob.h
+include/guile/%%GUILE_VER%%/libguile/snarf.h
+include/guile/%%GUILE_VER%%/libguile/socket.h
+include/guile/%%GUILE_VER%%/libguile/sort.h
+include/guile/%%GUILE_VER%%/libguile/srcprop.h
+include/guile/%%GUILE_VER%%/libguile/srfi-13.h
+include/guile/%%GUILE_VER%%/libguile/srfi-14.h
+include/guile/%%GUILE_VER%%/libguile/srfi-4.h
+include/guile/%%GUILE_VER%%/libguile/stackchk.h
+include/guile/%%GUILE_VER%%/libguile/stacks.h
+include/guile/%%GUILE_VER%%/libguile/stime.h
+include/guile/%%GUILE_VER%%/libguile/strings.h
+include/guile/%%GUILE_VER%%/libguile/strorder.h
+include/guile/%%GUILE_VER%%/libguile/strports.h
+include/guile/%%GUILE_VER%%/libguile/struct.h
+include/guile/%%GUILE_VER%%/libguile/symbols.h
+include/guile/%%GUILE_VER%%/libguile/tags.h
+include/guile/%%GUILE_VER%%/libguile/threads.h
+include/guile/%%GUILE_VER%%/libguile/throw.h
+include/guile/%%GUILE_VER%%/libguile/unif.h
+include/guile/%%GUILE_VER%%/libguile/validate.h
+include/guile/%%GUILE_VER%%/libguile/values.h
+include/guile/%%GUILE_VER%%/libguile/variable.h
+include/guile/%%GUILE_VER%%/libguile/vectors.h
+include/guile/%%GUILE_VER%%/libguile/version.h
+include/guile/%%GUILE_VER%%/libguile/vports.h
+include/guile/%%GUILE_VER%%/libguile/weaks.h
 lib/libguile-srfi-srfi-1-v-3.a
 lib/libguile-srfi-srfi-1-v-3.so
 lib/libguile-srfi-srfi-1-v-3.so.3
@@ -135,8 +139,7 @@ lib/libguilereadline-v-17.so
 lib/libguilereadline-v-17.so.17
 lib/libguilereadline-v-17.so.17.0.3
 libdata/pkgconfig/guile-1.8.pc
-man/man1/guile.1.gz
-share/aclocal/guile.m4
+man/man1/guile%%GUILE_SFX%%.1.gz
 %%DATADIR%%/%%GUILE_VER%%/guile-procedures.txt
 %%DATADIR%%/%%GUILE_VER%%/ice-9/and-let-star.scm
 %%DATADIR%%/%%GUILE_VER%%/ice-9/boot-9.scm
diff --git a/lang/guile2/Makefile b/lang/guile2/Makefile
index c2a252891a30..7236fa11e2c1 100644
--- a/lang/guile2/Makefile
+++ b/lang/guile2/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	guile
-PORTVERSION=	2.2.7
-PORTREVISION=	3
+DISTVERSION=	2.2.7
+PORTREVISION=	4
 CATEGORIES=	lang scheme
 MASTER_SITES=	GNU
 PKGNAMESUFFIX=	2
@@ -16,51 +16,52 @@ LIB_DEPENDS=	libgmp.so:math/gmp \
 		libltdl.so:devel/libltdl \
 		libunistring.so:devel/libunistring \
 		libffi.so:devel/libffi
+RUN_DEPENDS=	guile-aclocal>=3:lang/guile-aclocal
 
-USES=		charsetfix compiler:c11 cpe gmake iconv libtool makeinfo ncurses pathfix \
-		pkgconfig readline tar:lz
-USE_LDCONFIG=	yes
-
+USES=		guile:${PORTVERSION:R},env \
+		charsetfix compiler:c11 cpe gmake iconv libtool localbase \
+		makeinfo ncurses pathfix pkgconfig readline tar:lz
 CPE_VENDOR=	gnu
+USE_LDCONFIG=	yes
 
-CONFLICTS_INSTALL=	guile guile1 # bin/guild bin/guile bin/guile-config bin/guile-snarf bin/guile-tools
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--program-suffix=-${GUILE_VER}
+# eliminate some pointless configure warnings/errors
+CONFIGURE_ENV+= gl_cv_func_working_mktime=yes \
+		ac_cv_header_sys_timeb_h=0
 
 MAKE_JOBS_UNSAFE=	yes
-
-GNU_CONFIGURE=	yes
-CPPFLAGS+=	-I${LOCALBASE}/include
-LIBS+=		-L${LOCALBASE}/lib
 INSTALL_TARGET=	install-strip
 
 INFO=		guile r5rs
-
-PLIST_SUB=	GUILE_VER=${PORTVERSION:R}
+INFO_PATH=	${GUILE_INFO_PATH}
 
 OPTIONS_DEFINE=	NLS THREADS
 OPTIONS_DEFAULT=THREADS
 OPTIONS_SUB=	yes
 
-NLS_CONFIGURE_ENABLE=	nls
 NLS_USES=	gettext
+NLS_CONFIGURE_ENABLE=	nls
 
-THREADS_CONFIGURE_WITH=	threads
*** 1227 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307302259.36UMxY9d001106>