public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem
@ 2024-08-11 22:22 Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 1/9] guile-utils.eclass: new eclass, common code for guile packages Arsen Arsenović
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Evening!

This patchset brings Gentoo a new set of ecosystem-style packages à la
Lua or Python.  Now, the trouble with that is that we already have a
bunch of Guile packages in the Gentoo repositories:

  ~$ qdepends -Qt dev-scheme/guile | wc -l
  85

... and more, probably.

My attempt to do this started last year(!), I got through about a third
of the ecosystem before running out of time.  When I revisited, those
patches were (obviously) out-of-date and were difficult to rebase due to
the nature of our usage of Git, so that never got anywhere.  So, bare
with me on the code as it might be partially stale and I might've missed
stuff when re-reviewing it.

The idea, like with Lua, is to do -r100 revisions where we use
the new Guile slots and keep them masked until the mass-unmask day.  For
each ported/new package, add the appropriate mask to
profiles/package.mask under "Guile rework masks".  If a package is
entirely fresh (e.g. www-apps/haunt), it is redundant to do -r100, and
so the entire package may be masked.

However, the eclasses are still relatively okay, and Sam persuaded me to
try a new approach - asking for help - so, here it is.

Anyway - the patch primarily consists of three eclasses:

- guile-utils.eclass, which provides some functionality useful to /all/
  Guile ebuilds, as well as some common semi-private code between
  guile.eclass and guile-single.eclass.  It is usually not (ever?)
  useful to inherit from it, but it does provide a few useful "end-user"
  functions, namely guile_export, guile_unstrip_ccache,
  guile_create_temporary_config, guile_bump_sources.
- guile-single.eclass, which is analogous to python-single-r1.eclass, is
  useful for packages extended with Guile (gdb, make - included as an
  example, gnucash come to mind) and to individual Guile programs
  (haunt, which is included as an example).  Packages using this eclass
  cannot be "multi-installed".
- guile.eclass, which is the meat and potatoes of the ecosystem
  mechanism.  It contains the facilities required to build and
  multi-version-able (?) Guile libraries (or potentially libraries with
  an associated program picked from the best variant).

  Packages using this eclass require most care - the ecosystem as it
  stands right now is somewhat inconsistent in terms of build systems
  and conventions, so there might be need to patch on occasion.  For
  instance, I know from previous porting attempts that guile-lib
  installs files that depend on the configure-time Guile version in an
  unversioned directory.  This is very bad for us.  The eclass also
  won't detect this (to be consistent with multibuild.eclass and because
  working around it would be difficult when needed), rather, it works on
  a "best variant wins" basis.

  To prevent such a conflict, one should check where the package
  installs its files.  Usually, scripts should end up in (%site-dir),
  their corresponding .go files should be in (%site-ccache-dir).  But,
  if, say, the source scripts (in (%site-dir)) don't depend on the Guile
  version they're being configured for and they're being installed
  unversioned, it is probably OK to leave them as-is.

  For the guile-lib example above, one version-dependent but unslotted
  file that the build system installs is a pkg-config file called
  guile-lib-1.0.pc.  This file does not appear to do much but it does
  contain a reference to the (%site-ccache-dir), which is certainly
  slotted, and so, can't be left there.  Installing it into
  /usr/share/guile-data/${GUILE_CURRENT_VERSION}/pkgconfig is probably
  okay.  If in doubt, duplicate the possibly non-version-dependent
  files.  This is always safe, and more consistent.

  Sometimes, one might need to modify the build system of these packages
  to achieve the above.  We should strive, as usual, to get those
  patches uptream.

* Porting notes
I recommend testing in a container that does not have a /usr/bin/guile
symlink, has minimal USE on dev-scheme/guile (so that you can notice if
you need GUILE_REQ_USE="deprecated", for instance).  Always check
package contents and see if there are any files that seem like they
should get a copy per Guile version but didn't.

Never forget to use GUILE_REQUIRED_USE, GUILE_DEPS, guile_bump_sources,
guile_unstrip_ccache or guile{,-single}_pkg_setup, as well as
guile_gen_cond_dep for guile-single packages, if applicable.

Please ping me with any questions and to review code, as well as for
novel situations so that we may decide what to do about them.  The
appropriate channel for this discussion is #gentoo-lisp.

* TODO list
- Checks for bad shebangs and references to the unversioned Guile
  executable
- More 'static' checks if possible (e.g. ensuring GUILE_REQUIRED_USE was
  used, ditto for GUILE_DEPS etc)
- Making sure that GUILE_COMPAT is in ascending order
- Fixing bugs
- guile.eselect

Thank you all in advance, both for the help and for bearing with me.  I
imagine this won't be the last revision.

Have a lovely evening!

Arsen Arsenović (9):
  guile-utils.eclass: new eclass, common code for guile packages
  guile-single.eclass: new eclass, for single-impl guile packages
  guile.eclass: new eclass, for guile multi-impl packages
  profiles/base: add guile _TARGETS USE_EXPAND variables
  dev-build/make: switch to new guile mechanism
  dev-scheme/guile-reader: port to new guile eclasses
  dev-scheme/guile-commonmark: new package, add 0.1.2_pre20240803
  www-apps/haunt: new package, add 0.3.0
  dev-scheme/slib: add 3c1, port to new guile eclasses

 dev-build/make/make-4.4.1-r100.ebuild         | 102 +++++
 dev-build/make/make-9999.ebuild               |  14 +-
 dev-scheme/guile-commonmark/Manifest          |   1 +
 .../guile-commonmark-0.1.2_pre20240803.ebuild |  29 ++
 dev-scheme/guile-commonmark/metadata.xml      |  15 +
 .../guile-reader-0.6.3-implicit-fn-decl.patch |  25 ++
 .../files/guile-reader-0.6.3-slot.patch       |  66 ++++
 .../guile-reader-0.6.3-r100.ebuild            |  60 +++
 dev-scheme/slib/Manifest                      |   1 +
 dev-scheme/slib/slib-3.3.1-r100.ebuild        | 123 ++++++
 eclass/guile-single.eclass                    | 245 ++++++++++++
 eclass/guile-utils.eclass                     | 277 ++++++++++++++
 eclass/guile.eclass                           | 358 ++++++++++++++++++
 profiles/base/make.defaults                   |   8 +-
 profiles/desc/guile_single_target.desc        |   7 +
 profiles/desc/guile_targets.desc              |   7 +
 profiles/package.mask                         |   5 +
 www-apps/haunt/Manifest                       |   1 +
 www-apps/haunt/haunt-0.3.0.ebuild             |  25 ++
 www-apps/haunt/metadata.xml                   |  12 +
 20 files changed, 1378 insertions(+), 3 deletions(-)
 create mode 100644 dev-build/make/make-4.4.1-r100.ebuild
 create mode 100644 dev-scheme/guile-commonmark/Manifest
 create mode 100644 dev-scheme/guile-commonmark/guile-commonmark-0.1.2_pre20240803.ebuild
 create mode 100644 dev-scheme/guile-commonmark/metadata.xml
 create mode 100644 dev-scheme/guile-reader/files/guile-reader-0.6.3-implicit-fn-decl.patch
 create mode 100644 dev-scheme/guile-reader/files/guile-reader-0.6.3-slot.patch
 create mode 100644 dev-scheme/guile-reader/guile-reader-0.6.3-r100.ebuild
 create mode 100644 dev-scheme/slib/slib-3.3.1-r100.ebuild
 create mode 100644 eclass/guile-single.eclass
 create mode 100644 eclass/guile-utils.eclass
 create mode 100644 eclass/guile.eclass
 create mode 100644 profiles/desc/guile_single_target.desc
 create mode 100644 profiles/desc/guile_targets.desc
 create mode 100644 www-apps/haunt/Manifest
 create mode 100644 www-apps/haunt/haunt-0.3.0.ebuild
 create mode 100644 www-apps/haunt/metadata.xml

-- 
2.45.2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 1/9] guile-utils.eclass: new eclass, common code for guile packages
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 2/9] guile-single.eclass: new eclass, for single-impl " Arsen Arsenović
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Bug: https://bugs.gentoo.org/689408
Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 eclass/guile-utils.eclass | 277 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 277 insertions(+)
 create mode 100644 eclass/guile-utils.eclass

diff --git a/eclass/guile-utils.eclass b/eclass/guile-utils.eclass
new file mode 100644
index 000000000000..a7cfc0cc8724
--- /dev/null
+++ b/eclass/guile-utils.eclass
@@ -0,0 +1,277 @@
+# Copyright 2023-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: guile-utils.eclass
+# @MAINTAINER:
+# Gentoo Scheme project <scheme@gentoo.org>
+# @AUTHOR:
+# Author: Arsen Arsenović <arsen@gentoo.org>
+# Inspired by prior work in the Gentoo Python ecosystem.
+# @BLURB: Common code between GNU Guile-related eclasses and ebuilds.
+# @SUPPORTED_EAPIS: 8
+# @DESCRIPTION:
+# This eclass contains various bits of common code between
+# dev-scheme/guile, Guile multi-implementation ebuilds and Guile
+# single-implementation ebuilds.
+
+case "${EAPI}" in
+	8) ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ ! "${_GUILE_UTILS_ECLASS}" ]]; then
+_GUILE_UTILS_ECLASS=1
+
+inherit toolchain-funcs
+
+BDEPEND="virtual/pkgconfig"
+
+# @ECLASS_VARIABLE: GUILE_COMPAT
+# @REQUIRED
+# @PRE_INHERIT
+# @DESCRIPTION:
+# List of acceptable versions of Guile.  For instance, setting this
+# variable like below will allow the package to be built against either
+# Guile 2.2 or 3.0:
+#
+# @CODE
+# GUILE_COMPAT=( 2-2 3-0 )
+# @CODE
+#
+# Please keep in ascending order.
+
+# @FUNCTION: guile_check_compat
+# @DESCRIPTION:
+# Checks that GUILE_COMPAT is set to an array, and has no invalid
+# values.
+guile_check_compat() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	if ! [[ $(declare -p GUILE_COMPAT) =~ 'declare -a '* ]]; then
+		die "GUILE_COMPAT not set to an array"
+	fi
+
+	if [[ ${#GUILE_COMPAT[@]} -eq 0 ]]; then
+		die "GUILE_COMPAT is empty"
+	fi
+}
+
+guile_check_compat
+
+# @ECLASS_VARIABLE: GUILE_REQ_USE
+# @PRE_INHERIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Specifies a USE dependency string for all versions of Guile in
+# GUILE_COMPAT.
+#
+# @EXAMPLE:
+# GUILE_REQ_USE="deprecated"
+
+# @ECLASS_VARIABLE: GUILE_USEDEP
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# This variable is populated with a USE-dependency string which can be
+# used to depend on other Guile multi-implementation packages.
+# This variable is not usable from guile-single packages.
+
+# @ECLASS_VARIABLE: GUILE_DEPS
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# Contains the dependency string for the compatible Guile runtimes.
+
+# @FUNCTION: guile_set_common_vars
+# @USAGE: guile_set_common_vars
+# @VARIABLE: QA_PREBUILT
+# @DESCRIPTION:
+# Sets common variables that apply to all Guile packages, namely,
+# QA_PREBUILT.
+guile_set_common_vars() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	# These aren't strictly speaking prebuilt. but they do generated a
+	# nonstandard ELF object.
+	if [[ -z ${QA_PREBUILT} ]]; then
+		QA_PREBUILT="usr/$(get_libdir)/guile/*/site-ccache/*"
+	fi
+}
+
+# @FUNCTION: guile_filter_pkgconfig_path
+# @USAGE: <acceptable slots>...
+# @DESCRIPTION:
+# Alters ${PKG_CONFIG_PATH} such that it does not contain any Guile
+# slots besides the ones required by the caller.
+guile_filter_pkgconfig_path() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local filtered_path= unfiltered_path path
+	IFS=: read -ra unfiltered_path <<<"${PKG_CONFIG_PATH}"
+	debug-print "Unfiltered PKG_CONFIG_PATH:" "${unfiltered_path[@]}"
+	for p in "${unfiltered_path[@]}"; do
+		for v in "$@"; do
+			debug-print "... considering '${p}' for ${v}"
+			# Exclude non-selected versions.
+			[[ ${p} == */usr/share/guile-data/${v}/pkgconfig* ]] \
+				|| continue
+			debug-print "... OK"
+
+			# Add separator, if some data already exists.
+			[[ "${filtered_path}" ]] && filtered_path+=:
+
+			filtered_path+="${p}"
+			break
+		done
+	done
+
+	debug-print "${FUNCNAME}: Constructed PKG_CONFIG_PATH: ${filtered_path}"
+	PKG_CONFIG_PATH="$filtered_path"
+}
+
+# @FUNCTION: guile_generate_depstrings
+# @USAGE: <prefix> <depop>
+# @DESCRIPTION:
+# Generates GUILE_REQUIRED_USE/GUILE_DEPS/GUILE_USEDEP based on
+# GUILE_COMPAT, and populates IUSE.
+guile_generate_depstrings() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	# Generate IUSE, REQUIRED_USE, GUILE_USEDEP
+	local prefix="$1" depop="$2"
+	GUILE_USEDEP=""
+	local ver uses=()
+	# TODO(arsen): enforce GUILE_COMPAT is in ascending order.
+	for ver in "${GUILE_COMPAT[@]}"; do
+		[[ -n ${GUILE_USEDEP} ]] && GUILE_USEDEP+=","
+		uses+=("${prefix}_${ver}")
+		GUILE_USEDEP+="${prefix}_${ver}"
+	done
+	GUILE_REQUIRED_USE="${depop} ( ${uses[@]} )"
+	IUSE="${uses[@]}"
+	debug-print "${FUNCNAME}: requse ${GUILE_REQUIRED_USE}"
+	debug-print "${FUNCNAME}: generated ${uses[*]}"
+	debug-print "${FUNCNAME}: iuse ${IUSE}"
+
+	# Generate GUILE_DEPS
+	local base_deps=()
+	local requse="${GUILE_REQ_USE+[}${GUILE_REQ_USE:-}${GUILE_REQ_USE+]}"
+	for ver in "${GUILE_COMPAT[@]}"; do
+		base_deps+="
+			${prefix}_${ver}? (
+				dev-scheme/guile:${ver/-/.}${requse}
+			)
+		"
+	done
+	GUILE_DEPS="${base_deps[*]}"
+	debug-print "${FUNCNAME}: GUILE_DEPS=${GUILE_DEPS}"
+	debug-print "${FUNCNAME}: GUILE_USEDEP=${GUILE_USEDEP}"
+}
+
+# @FUNCTION: guile_unstrip_ccache
+# @DESCRIPTION:
+# Marks site-ccache files not to be stripped.  Operates on ${D}.
+guile_unstrip_ccache() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local ccache
+	while read -r -d $'\0' ccache; do
+		debug-print "${FUNCNAME}: ccache found: ${ccache#.}"
+		dostrip -x "${ccache#.}"
+	done < <(cd "${ED}" || die; \
+			 find . \
+				  -name '*.go' \
+				  -path "*/usr/$(get_libdir)/guile/*/site-ccache/*" \
+				  -print0 || die) || die
+}
+
+# @FUNCTION: guile_export
+# @USAGE: [GUILE|GUILD|GUILE_SITECCACHEDIR|GUILE_SITEDIR]...
+# @DESCRIPTION:
+# Exports a given variable for the selected Guile variant.
+#
+# Supported variables are:
+#
+# - GUILE - Path to the guile executable,
+# - GUILD - Path to the guild executable,
+# - GUILESNARF - Path to the guile-snarf executable
+# - GUILECONFIG - Path to the guile-config executable
+# - GUILE_SITECCACHEDIR - Path to the site-ccache directory,
+# - GUILE_SITEDIR - Path to the site Scheme directory
+guile_export() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local gver
+	if [[ "${GUILE_CURRENT_VERSION}" ]]; then
+		gver="${GUILE_CURRENT_VERSION}"
+	elif [[ "${GUILE_SELECTED_TARGET}" ]]; then
+		gver="${GUILE_SELECTED_TARGET}"
+	else
+		die "Calling guile_export outside of a Guile build context?"
+	fi
+
+	_guile_pcvar() {
+		local tip="Did you source /etc/profile after an update?"
+		$(tc-getPKG_CONFIG) --variable="$1" guile-"${gver}" \
+			|| die "Could not get $1 out of guile-${gver}.  ${tip}"
+	}
+
+	for var; do
+		case "${var}" in
+			GUILE) export GUILE="$(_guile_pcvar guile)" ;;
+			GUILD) export GUILD="$(_guile_pcvar guild)" ;;
+			GUILESNARF)
+				GUILESNARF="${EPREFIX}/usr/bin/guile-snarf-${gver}"
+				export GUILESNARF
+				;;
+			GUILECONFIG)
+				GUILECONFIG="${EPREFIX}/usr/bin/guile-config-${gver}"
+				export GUILECONFIG
+				;;
+			GUILE_SITECCACHEDIR)
+				GUILE_SITECCACHEDIR="$(_guile_pcvar siteccachedir)"
+				export GUILE_SITECCACHEDIR
+				;;
+			GUILE_SITEDIR)
+				export GUILE_SITEDIR="$(_guile_pcvar sitedir)"
+				;;
+			*) die "Unknown variable '${var}'" ;;
+		esac
+	done
+}
+
+# @FUNCTION: guile_create_temporary_config
+# @USAGE: <version>
+# @DESCRIPTION:
+# Creates a guile-config executable for a given Guile version, and
+# inserts it into path.
+guile_create_temporary_config() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	[[ ${1} ]] || die "Must specify a Guile version"
+
+	local cdir="${T}/guiles/${1}/"
+	mkdir -p "${cdir}" || die
+
+	pushd "${cdir}" >/dev/null 2>&1 || die
+	cat >guile-config <<-EOF
+	#!/bin/sh
+	exec guile-config-${1} "\${@}"
+	EOF
+	chmod +x guile-config
+	popd >/dev/null 2>&1 || die
+	PATH="${cdir}:${PATH}"
+}
+
+# @FUNCTION: guile_bump_sources
+# @DESCRIPTION:
+# Searches over ${S} for .scm files and bumps them to avoid Guile using
+# the system ccache while trying to build packages.
+#
+# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38112
+guile_bump_sources() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	einfo "bumping *.scm source files..."
+	find "${S}" -name "*.scm" -exec touch {} + || die
+}
+
+fi  # _GUILE_UTILS_ECLASS
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 2/9] guile-single.eclass: new eclass, for single-impl guile packages
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 1/9] guile-utils.eclass: new eclass, common code for guile packages Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 3/9] guile.eclass: new eclass, for guile multi-impl packages Arsen Arsenović
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Bug: https://bugs.gentoo.org/689408
Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 eclass/guile-single.eclass | 245 +++++++++++++++++++++++++++++++++++++
 1 file changed, 245 insertions(+)
 create mode 100644 eclass/guile-single.eclass

diff --git a/eclass/guile-single.eclass b/eclass/guile-single.eclass
new file mode 100644
index 000000000000..9ccafa2fdaa7
--- /dev/null
+++ b/eclass/guile-single.eclass
@@ -0,0 +1,245 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: guile-single.eclass
+# @PROVIDES: guile-utils
+# @MAINTAINER:
+# Gentoo Scheme project <scheme@gentoo.org>
+# @AUTHOR:
+# Author: Arsen Arsenović <arsen@gentoo.org>
+# Inspired by prior work in the Gentoo Python ecosystem.
+# @BLURB: Utilities for packages that build against a single Guile.
+# @SUPPORTED_EAPIS: 8
+# @PROVIDES: guile-utils
+# @DESCRIPTION:
+# This eclass facilitates packages building against a single slot of
+# Guile, which is normally something that uses Guile for extending, like
+# GNU Make, or for programs built in Guile, like Haunt.
+#
+# These packages should use guile_gen_cond_dep to generate a dependency
+# string for their Guile package dependencies (i.e. other Guile single-
+# and multi-implementation packages).  They should also utilize
+# GUILE_DEPS and GUILE_REQUIRED_USE to specify a dependency on their
+# Guile versions.
+#
+# They should also bump sources via guile_bump_sources during
+# src_prepare, and unstrip ccache via guile_unstrip_ccache during
+# src_install.
+#
+# If the user of the eclass needs some USE flag on Guile itself, they
+# should provide it via GUILE_REQ_USE.
+#
+# This eclass provides a guile-single_pkg_setup that sets up environment
+# variables needed for Guile and build systems using it.  See the
+# documentation for that function for more details.
+#
+# @EXAMPLE:
+# A Guile program:
+#
+# @CODE
+# # Copyright 2024 Gentoo Authors
+# # Distributed under the terms of the GNU General Public License v2
+#
+# EAPI=8
+#
+# GUILE_COMPAT=( 3-0 2-2 )
+# inherit guile-single
+#
+# DESCRIPTION="Haunt is a simple, functional, hackable static site generator"
+# HOMEPAGE="https://dthompson.us/projects/haunt.html"
+# SRC_URI="https://files.dthompson.us/releases/${PN}/${P}.tar.gz"
+#
+# LICENSE="GPL-3+"
+# SLOT="0"
+# KEYWORDS="~amd64"
+# REQUIRED_USE="${GUILE_REQUIRED_USE}"
+#
+# RDEPEND="
+# 	${GUILE_DEPS}
+# 	$(guile_gen_cond_dep '
+# 		dev-scheme/guile-reader[${GUILE_MULTI_USEDEP}]
+# 		dev-scheme/guile-commonmark[${GUILE_MULTI_USEDEP}]
+# 	')
+# "
+# DEPEND="${RDEPEND}"
+# @CODE
+#
+# A program utilizing Guile for extension (GNU make, irrelevant pieces
+# elided):
+# @CODE
+# GUILE_COMPAT=( 3-0 2-2 2-0 1-8 )
+# inherit flag-o-matic unpacker verify-sig guile-single
+# # ...
+# REQUIRED_USE="guile? ( ${GUILE_REQUIRED_USE} )"
+# DEPEND="
+# 	guile? ( ${GUILE_DEPS} )
+# "
+#
+# src_prepare() {
+# 	# ...
+# 	if use guile; then
+# 		guile-single_src_prepare
+# 	fi
+# }
+#
+# pkg_setup() {
+# 	if use guile; then
+# 		guile-single_pkg_setup
+# 	fi
+# }
+#
+# src_configure() {
+# 	# ...
+# 	local myeconfargs=(
+# 		$(use_with guile)
+# 	)
+# 	econf "${myeconfargs[@]}"
+# }
+#
+# src_install() {
+# 	# ...
+# 	if use guile; then
+# 		guile_unstrip_ccache
+# 	fi
+# }
+# @CODE
+
+case "${EAPI}" in
+	8) ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ ! "${_GUILE_SINGLE_ECLASS}" ]]; then
+_GUILE_SINGLE_ECLASS=1
+
+inherit guile-utils
+
+# @ECLASS_VARIABLE: GUILE_COMPAT
+# @REQUIRED
+# @PRE_INHERIT
+# @DESCRIPTION:
+# List of acceptable versions of Guile.  For instance, setting this
+# variable like below will allow the package to be built against either
+# Guile 2.2 or 3.0:
+#
+# @CODE
+# GUILE_COMPAT=( 2-2 3-0 )
+# @CODE
+#
+# Please keep in ascending order.
+
+_guile_setup() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	# Inhibit generating the GUILE_USEDEP.  This variable is not usable
+	# for single packages.
+	local GUILE_USEDEP
+	guile_generate_depstrings guile_single_target ^^
+}
+
+_guile_setup
+unset -f _guile_setup
+
+# @FUNCTION: guile_gen_cond_dep
+# @USAGE: <dependency> [<pattern>...]
+# @DESCRIPTION:
+# Takes a string that uses (quoted) ${GUILE_SINGLE_USEDEP} and
+# ${GUILE_MULTI_USEDEP} markers as placeholders for the correct USE
+# dependency strings for each compatible slot.
+#
+# If the pattern is provided, it is taken to be list of slots to
+# generate the dependency string for, otherwise, ${GUILE_COMPAT[@]} is
+# taken.
+#
+# @EXAMPLE:
+# Note that the "inner" dependency string is in single quotes!
+# @CODE
+# RDEPEND="
+#	$(guile_gen_cond_dep '
+#		dev-scheme/guile-zstd[${GUILE_MULTI_USEDEP}]
+#		dev-scheme/guile-config[${GUILE_SINGLE_USEDEP}]
+#	')
+# "
+# @CODE
+guile_gen_cond_dep() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local deps="$1"
+	shift
+
+	local candidates=( "$@" )
+	if [[ ${#candidates[@]} -eq 0 ]]; then
+		candidates=( "${GUILE_COMPAT[@]}" )
+	fi
+
+	local candidate
+	for candidate in "${candidates[@]}"; do
+		local s="guile_single_target_${candidate}(-)" \
+			  m="guile_targets_${candidate}(-)" \
+			  subdeps=${deps//\$\{GUILE_SINGLE_USEDEP\}/${s}}
+		subdeps=${subdeps//\$\{GUILE_MULTI_USEDEP\}/${m}}
+		echo "
+		guile_single_target_${candidate}? (
+			${subdeps}
+		)
+		"
+	done
+}
+
+# @FUNCTION: guile-single_pkg_setup
+# @DESCRIPTION:
+# Sets up the PKG_CONFIG_PATH with the appropriate GUILE_SINGLE_TARGET,
+# as well as setting up a guile-config and the GUILE, GUILD and
+# GUILESNARF environment variables.  Also sets GUILE_EFFECTIVE_VERSION
+# to the same value as GUILE_SELECTED_TARGET, as build systems sometimes
+# check that variable.
+#
+# For details on the latter three, see guile_export.
+guile-single_pkg_setup() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	guile_set_common_vars
+
+	GUILE_SELECTED_TARGET=
+	for ver in "${GUILE_COMPAT[@]}"; do
+		debug-print "${FUNCNAME}: checking for ${ver}"
+		use "guile_single_target_${ver}" || continue
+		GUILE_SELECTED_TARGET="${ver/-/.}"
+		break
+	done
+
+	[[ ${GUILE_SELECTED_TARGET} ]] \
+		|| die "No GUILE_SINGLE_TARGET specified."
+
+	export PKG_CONFIG_PATH
+	guile_filter_pkgconfig_path "${GUILE_SELECTED_TARGET}"
+	guile_create_temporary_config "${GUILE_SELECTED_TARGET}"
+	local -x GUILE_EFFECTIVE_VERSION="${GUILE_SELECTED_TARGET}"
+	guile_export GUILE GUILD GUILESNARF
+}
+
+# @FUNCTION: guile-single_src_prepare
+# @DESCRIPTION:
+# Runs the default prepare stage, and then bumps Guile sources via
+# guile_bump_sources.
+guile-single_src_prepare() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	default
+	guile_bump_sources
+}
+
+# @FUNCTION: guile-single_src_install
+# @DESCRIPTION:
+# Runs the default install stage, and then marks ccache files not to be
+# stripped using guile_unstrip_ccache.
+guile-single_src_install() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	default
+	guile_unstrip_ccache
+}
+
+EXPORT_FUNCTIONS pkg_setup src_prepare src_install
+
+fi  # _GUILE_SINGLE_ECLASS
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 3/9] guile.eclass: new eclass, for guile multi-impl packages
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 1/9] guile-utils.eclass: new eclass, common code for guile packages Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 2/9] guile-single.eclass: new eclass, for single-impl " Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 4/9] profiles/base: add guile _TARGETS USE_EXPAND variables Arsen Arsenović
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Bug: https://bugs.gentoo.org/689408
Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 eclass/guile.eclass | 358 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 358 insertions(+)
 create mode 100644 eclass/guile.eclass

diff --git a/eclass/guile.eclass b/eclass/guile.eclass
new file mode 100644
index 000000000000..0e222d289274
--- /dev/null
+++ b/eclass/guile.eclass
@@ -0,0 +1,358 @@
+# Copyright 2023-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: guile.eclass
+# @PROVIDES: guile-utils
+# @MAINTAINER:
+# Gentoo Scheme project <scheme@gentoo.org>
+# @AUTHOR:
+# Author: Arsen Arsenović <arsen@gentoo.org>
+# Inspired by prior work in the Gentoo Python ecosystem.
+# @SUPPORTED_EAPIS: 8
+# @BLURB: Utilities for packages multi-implementation Guile packages.
+# @DESCRIPTION:
+# This eclass facilitates building against many Guile implementations,
+# useful for Guile libraries.  Each ebuild must set GUILE_COMPAT to a
+# list of versions they support, which will be intersected with
+# GUILE_TARGETS to pick which versions to install.  The eclass will
+# generate a GUILE_DEPS based on the configured GUILE_COMPAT, as well as
+# a GUILE_REQUIRED_USE, that the user must use.
+#
+# If the user of the eclass needs some USE flag on Guile itself, they
+# should provide it via GUILE_REQ_USE.
+#
+# This ebuild provides multibuild functionality.  Use guile_foreach_impl
+# to run a given command for each enabled Guile version.  The command
+# provided will be ran in a modified environment, see the description of
+# that function for more details.
+#
+# This package provides some stage functions written assuming a
+# conventional GNU Build System-based Guile library and may or may not
+# work.
+#
+# For each Guile target, a Guile library should have at least compiled
+# .go files in the ccache or %site-ccache-dir.  It must also have
+# corresponding sources installed in %site-dir.
+#
+# If your package has some steps that should only happen for one
+# implementation (e.g. installing a program), you can utilize
+# guile_for_best_impl.
+#
+# Due to http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38112, Guile
+# packages ought to bump their sources before building.  To this end,
+# the src_prepare this eclass provides will call guile_bump_sources of
+# the guile-utils eclass.
+#
+# When installing, the packages using this eclass ought to use
+# guile_foreach_impl and its SLOTTED_{,E}D, followed by merging roots
+# via guile_merge_roots and unstripping ccache objects via
+# guile_unstrip_ccache.  See descriptions of those functions for
+# details.
+#
+# Ebuild authors, please pay attention for potential conflicts between
+# slots.  As an example, dev-scheme/guile-lib installs a pkg-config file
+# that depends on the Guile version it is installed for.  This is not
+# acceptable, as it means revdeps will only ever see the version of the
+# file for the best Guile implementation in GUILE_TARGETS.
+#
+# @EXAMPLE:
+# The following example demonstrates a simple package relying entirely
+# on the setup of this eclass.  For each enabled, compatible target, the
+# ebuild will bump sources (see description), and run the default
+# configure, compile and test stages (per PMS, meaning GNU Build
+# System), and an install stage modified such that it installs each
+# variant into SLOTTED_D followed by merging roots and unstripping.
+#
+# @CODE
+# EAPI=8
+#
+# GUILE_COMPAT=( 2-2 3-0 )
+# inherit guile
+#
+# DESCRIPTION="iCalendar/vCard parser for GNU Guile"
+# HOMEPAGE="https://github.com/artyom-poptsov/guile-ics"
+# SRC_URI="https://github.com/artyom-poptsov/${PN}/releases/download/v${PV}/${P}.tar.gz"
+#
+# LICENSE="GPL-3+"
+# SLOT="0"
+# KEYWORDS="~amd64"
+# REQUIRED_USE="${GUILE_REQUIRED_USE}"
+#
+# RDEPEND="
+# 	${GUILE_DEPS}
+# 	dev-scheme/guile-smc[${GUILE_USEDEP}]
+# "
+# DEPEND="${RDEPEND}"
+# @CODE
+
+case "${EAPI}" in
+	8) ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ ! "${_GUILE_ECLASS}" ]]; then
+_GUILE_ECLASS=1
+
+inherit guile-utils multibuild
+
+# @ECLASS_VARIABLE: GUILE_USEDEP
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# USE dependency string that can be applied to Guile
+# multi-implementation dependencies.
+#
+# @EXAMPLE:
+# RDEPEND="
+# 	${GUILE_DEPS}
+# 	dev-scheme/bytestructures[${GUILE_USEDEP}]
+# 	>=dev-libs/libgit2-1:=
+# "
+# DEPEND="${RDEPEND}"
+
+# @ECLASS_VARIABLE: GUILE_COMPAT
+# @REQUIRED
+# @PRE_INHERIT
+# @DESCRIPTION:
+# List of acceptable versions of Guile.  For instance, setting this
+# variable like below will allow the package to be built against either
+# Guile 2.2 or 3.0:
+#
+# @CODE
+# GUILE_COMPAT=( 2-2 3-0 )
+# @CODE
+#
+# Please keep in ascending order.
+
+_guile_setup() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	guile_generate_depstrings guile_targets '||'
+}
+
+_guile_setup
+unset -f _guile_setup
+
+# @ECLASS_VARIABLE: GUILE_SELECTED_TARGETS
+# @INTERNAL
+# @DESCRIPTION:
+# Contains the intersection of GUILE_TARGETS and GUILE_COMPAT.
+# Generated in guile_pkg_setup.
+
+# @FUNCTION: guile_pkg_setup
+# @DESCRIPTION:
+# Sets up eclass-internal variables for this build.
+guile_pkg_setup() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	guile_set_common_vars
+	GUILE_SELECTED_TARGETS=()
+	for ver in "${GUILE_COMPAT[@]}"; do
+		debug-print "${FUNCNAME}: checking for ${ver}"
+		use "guile_targets_${ver}" || continue
+		GUILE_SELECTED_TARGETS+=("${ver/-/.}")
+	done
+	if [[ "${#GUILE_SELECTED_TARGETS[@]}" -eq 0 ]]; then
+		die "No GUILE_TARGETS specified."
+	fi
+}
+
+# @FUNCTION: guile_copy_sources
+# @DESCRIPTION:
+# Create a single copy of the package sources for each selected Guile
+# implementation.
+guile_copy_sources() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local MULTIBUILD_VARIANTS
+	MULTIBUILD_VARIANTS=("${GUILE_SELECTED_TARGETS[@]}")
+
+	multibuild_copy_sources
+}
+
+# @FUNCTION: _guile_multibuild_wrapper
+# @USAGE: <command> [<argv>...]
+# @INTERNAL
+# @DESCRIPTION:
+# Initialize the environment for a single build variant.  See
+# guile_foreach_impl.
+_guile_multibuild_wrapper() {
+	local GUILE_CURRENT_VERSION="${MULTIBUILD_VARIANT}"
+	debug-print-function ${FUNCNAME} "${@}" "on ${MULTIBUILD_VARIANT}"
+
+	local -x PATH="${PATH}"
+	guile_create_temporary_config "${GUILE_CURRENT_VERSION}"
+	guile_export GUILE GUILD GUILESNARF
+
+	local -x PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
+	guile_filter_pkgconfig_path "${MULTIBUILD_VARIANT}"
+	local ECONF_SOURCE="${S}"
+	local -x SLOTTED_D="${T}/dests/image${MULTIBUILD_ID}/"
+	local -x SLOTTED_ED="${SLOTTED_D%/}${EPREFIX}/"
+	local -x GUILE_EFFECTIVE_VERSION="${GUILE_CURRENT_VERSION}"
+	mkdir -p "${BUILD_DIR}" || die
+	cd "${BUILD_DIR}" || die
+	"$@"
+}
+
+# @VARIABLE: SLOTTED_D
+# @DESCRIPTION:
+# In functions ran by guile_foreach_impl, this variable is set to a new
+# ${D} value that the variant being installed should use.
+
+# @VARIABLE: SLOTTED_ED
+# @DESCRIPTION:
+# In functions ran by guile_foreach_impl, this variable is set to a new
+# ${ED} value that the variant being installed should use.  It is
+# equivalent to "${SLOTTED_D%/}${EPREFIX}/".
+
+# @VARIABLE: ECONF_SOURCE
+# @DESCRIPTION:
+# In functions ran by guile_foreach_impl, this variable is set to ${S},
+# for convenience.
+
+# @VARIABLE: PKG_CONFIG_PATH
+# @DESCRIPTION:
+# In functions ran by guile_foreach_impl, PKG_CONFIG_PATH is filtered to
+# contain only the current ${MULTIBUILD_VARIANT}.
+
+# @VARIABLE: BUILD_DIR
+# @DESCRIPTION:
+# In functions ran by guile_foreach_impl, this variable is set to a
+# newly-generated build directory for this variant.
+
+# @FUNCTION: guile_foreach_impl
+# @USAGE: <command> [<argv>...]
+# @DESCRIPTION:
+# Runs the given command for each of the selected Guile implementations.
+#
+# The function will return 0 status if all invocations succeed.
+# Otherwise, the return code from first failing invocation will
+# be returned.
+#
+# Each invocation will have PKG_CONFIG_DIR altered to contain only one
+# Guile implementation, as well as a SLOTTED_D, SLOTTED_ED for
+# installation purposes, and a new BUILD_DIR, in which the wrapped
+# function will be executed, with a pre-configured ECONF_SOURCE.  A
+# temporary program called 'guile-config' is generated and inserted into
+# the PATH.
+#
+# Also automatically exported are GUILE, GUILD, and GUILESNARF - see
+# guile_export for details - as well as GUILE_CURRENT_VERSION and
+# GUILE_EFFECTIVE_VERSION, which are set to the same value (the current
+# version).
+#
+# This combination should cover Guile detection of a large amount of
+# packages out of the box.
+guile_foreach_impl() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local MULTIBUILD_VARIANTS
+	MULTIBUILD_VARIANTS=("${GUILE_SELECTED_TARGETS[@]}")
+
+	debug-print "${FUNCNAME}: Running for each of:" \
+				"${GUILE_SELECTED_TARGETS[@]}"
+
+	multibuild_foreach_variant _guile_multibuild_wrapper "${@}"
+}
+
+# @FUNCTION: _guile_merge_single_root
+# @INTERNAL
+# @DESCRIPTION:
+# Runs a single merge_root step for guile_merge_roots.
+_guile_merge_single_root() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	multibuild_merge_root "${SLOTTED_D}" "${D}"
+}
+
+# @FUNCTION: guile_merge_roots
+# @DESCRIPTION:
+# Merges install roots from all slots, diagnosing conflicts.
+guile_merge_roots() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	guile_foreach_impl _guile_merge_single_root
+}
+
+# @FUNCTION: guile_for_best_impl
+# @DESCRIPTION:
+# Runs the passed command once, for the best installed Guile
+# implementation.
+guile_for_best_impl() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	multibuild_for_best_variant _guile_multibuild_wrapper "${@}"
+}
+
+# Default implementations for a GNU Build System based Guile package.
+
+# @FUNCTION: guile_src_prepare
+# @DESCRIPTION:
+# Bumps SCM sources runs the default src_prepare and bumps all *.scm
+# files.  See guile_bump_sources of guile-utils.eclass.
+guile_src_prepare() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	default
+	guile_bump_sources
+}
+
+# @FUNCTION: guile_src_configure
+# @DESCRIPTION:
+# Runs the default src_configure for each selected variant target.
+guile_src_configure() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	guile_foreach_impl default
+}
+
+# @FUNCTION: guile_src_compile
+# @DESCRIPTION:
+# Runs the default src_compile for each selected variant target.
+guile_src_compile() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	guile_foreach_impl default
+}
+
+# @FUNCTION: guile_src_test
+# @DESCRIPTION:
+# Runs the default src_test phase for each implementation.
+guile_src_test() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	guile_foreach_impl default
+}
+
+# @FUNCTION: _guile_default_install_slot
+# @INTERNAL
+# @DESCRIPTION:
+# Imitates the default build system install "substep", but for a given
+# ${SLOTTED_D} rather than the usual ${D}.  See guile_src_install.
+_guile_default_install_slot() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
+		emake DESTDIR="${SLOTTED_D}" install
+	fi
+}
+
+# @FUNCTION: guile_src_install
+# @DESCRIPTION:
+# Runs the an imitation of the src_install that does the right thing for
+# a GNU Build System based Guile package, for each selected variant
+# target.  Merges roots after completing the installs.
+guile_src_install() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	guile_foreach_impl _guile_default_install_slot
+	guile_merge_roots
+	guile_unstrip_ccache
+
+	einstalldocs
+}
+
+EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile \
+				 src_install src_test
+
+fi  # _GUILE_ECLASS
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 4/9] profiles/base: add guile _TARGETS USE_EXPAND variables
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
                   ` (2 preceding siblings ...)
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 3/9] guile.eclass: new eclass, for guile multi-impl packages Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 5/9] dev-build/make: switch to new guile mechanism Arsen Arsenović
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Bug: https://bugs.gentoo.org/689408
Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 profiles/base/make.defaults            | 8 +++++++-
 profiles/desc/guile_single_target.desc | 7 +++++++
 profiles/desc/guile_targets.desc       | 7 +++++++
 3 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 profiles/desc/guile_single_target.desc
 create mode 100644 profiles/desc/guile_targets.desc

diff --git a/profiles/base/make.defaults b/profiles/base/make.defaults
index 957af187bda2..302010846cdc 100644
--- a/profiles/base/make.defaults
+++ b/profiles/base/make.defaults
@@ -12,7 +12,7 @@ USE_EXPAND_VALUES_KERNEL="Darwin linux SunOS"
 
 # Env vars to expand into USE vars.  Modifying this requires prior
 # discussion on gentoo-dev@lists.gentoo.org.
-USE_EXPAND="ABI_MIPS ABI_S390 ABI_X86 ADA_TARGET ALSA_CARDS AMDGPU_TARGETS APACHE2_MODULES APACHE2_MPMS CALLIGRA_FEATURES CAMERAS COLLECTD_PLUGINS CPU_FLAGS_ARM CPU_FLAGS_PPC CPU_FLAGS_X86 CURL_SSL CURL_QUIC ELIBC FFTOOLS GPSD_PROTOCOLS GRUB_PLATFORMS INPUT_DEVICES KERNEL L10N LCD_DEVICES LIBREOFFICE_EXTENSIONS LLVM_SLOT LLVM_TARGETS LUA_SINGLE_TARGET LUA_TARGETS MONKEYD_PLUGINS NGINX_MODULES_HTTP NGINX_MODULES_MAIL NGINX_MODULES_STREAM OFFICE_IMPLEMENTATION OPENMPI_FABRICS OPENMPI_OFED_FEATURES OPENMPI_RM PERL_FEATURES PHP_TARGETS POSTGRES_TARGETS PYTHON_SINGLE_TARGET PYTHON_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS UWSGI_PLUGINS VIDEO_CARDS VOICEMAIL_STORAGE XTABLES_ADDONS"
+USE_EXPAND="ABI_MIPS ABI_S390 ABI_X86 ADA_TARGET ALSA_CARDS AMDGPU_TARGETS APACHE2_MODULES APACHE2_MPMS CALLIGRA_FEATURES CAMERAS COLLECTD_PLUGINS CPU_FLAGS_ARM CPU_FLAGS_PPC CPU_FLAGS_X86 CURL_SSL CURL_QUIC ELIBC FFTOOLS GPSD_PROTOCOLS GRUB_PLATFORMS GUILE_SINGLE_TARGET GUILE_TARGETS INPUT_DEVICES KERNEL L10N LCD_DEVICES LIBREOFFICE_EXTENSIONS LLVM_SLOT LLVM_TARGETS LUA_SINGLE_TARGET LUA_TARGETS MONKEYD_PLUGINS NGINX_MODULES_HTTP NGINX_MODULES_MAIL NGINX_MODULES_STREAM OFFICE_IMPLEMENTATION OPENMPI_FABRICS OPENMPI_OFED_FEATURES OPENMPI_RM PERL_FEATURES PHP_TARGETS POSTGRES_TARGETS PYTHON_SINGLE_TARGET PYTHON_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS UWSGI_PLUGINS VIDEO_CARDS VOICEMAIL_STORAGE XTABLES_ADDONS"
 
 # USE_EXPAND variables whose contents are not shown in package manager
 # output. Changes need discussion on gentoo-dev.
@@ -182,3 +182,9 @@ LUA_TARGETS="lua5-1"
 # we care about should match these anyway. See https://wiki.gentoo.org/wiki/Modern_C_porting.
 ac_cv_c_undeclared_builtin_options="none needed"
 gl_cv_compiler_check_decl_option="-Werror=implicit-function-declaration"
+
+# Arsen Arsenović <arsen@gentoo.org> (2024-08-04)
+# Default target values for the Guile ecosystem (see also:
+# guile{,-single}.eclass)
+GUILE_TARGETS="3-0"
+GUILE_SINGLE_TARGET="3-0"
diff --git a/profiles/desc/guile_single_target.desc b/profiles/desc/guile_single_target.desc
new file mode 100644
index 000000000000..95f51d5f0062
--- /dev/null
+++ b/profiles/desc/guile_single_target.desc
@@ -0,0 +1,7 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# This file contains descriptions of GUILE_SINGLE_TARGET USE_EXPAND flags.
+
+2-2 - Build only for GNU Guile 2.2.
+3-0 - Build only for GNU Guile 3.0.
diff --git a/profiles/desc/guile_targets.desc b/profiles/desc/guile_targets.desc
new file mode 100644
index 000000000000..db45f17897a0
--- /dev/null
+++ b/profiles/desc/guile_targets.desc
@@ -0,0 +1,7 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# This file contains descriptions of GUILE_TARGETS USE_EXPAND flags.
+
+2-2 - Build only for GNU Guile 2.2.
+3-0 - Build only for GNU Guile 3.0.
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 5/9] dev-build/make: switch to new guile mechanism
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
                   ` (3 preceding siblings ...)
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 4/9] profiles/base: add guile _TARGETS USE_EXPAND variables Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 6/9] dev-scheme/guile-reader: port to new guile eclasses Arsen Arsenović
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 dev-build/make/make-4.4.1-r100.ebuild | 102 ++++++++++++++++++++++++++
 dev-build/make/make-9999.ebuild       |  14 +++-
 profiles/package.mask                 |   1 +
 3 files changed, 115 insertions(+), 2 deletions(-)
 create mode 100644 dev-build/make/make-4.4.1-r100.ebuild

diff --git a/dev-build/make/make-4.4.1-r100.ebuild b/dev-build/make/make-4.4.1-r100.ebuild
new file mode 100644
index 000000000000..560e26a4ef50
--- /dev/null
+++ b/dev-build/make/make-4.4.1-r100.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/make.asc
+GUILE_COMPAT=( 3-0 2-2 2-0 1-8 )
+inherit flag-o-matic unpacker verify-sig guile-single
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="https://www.gnu.org/software/make/make.html"
+if [[ ${PV} == 9999 ]] ; then
+	EGIT_REPO_URI="https://git.savannah.gnu.org/git/make.git"
+	inherit autotools git-r3
+elif [[ $(ver_cut 3) -ge 90 || $(ver_cut 4) -ge 90 ]] ; then
+	SRC_URI="https://alpha.gnu.org/gnu/make/${P}.tar.lz"
+	SRC_URI+=" verify-sig? ( https://alpha.gnu.org/gnu/make/${P}.tar.lz.sig )"
+else
+	SRC_URI="mirror://gnu/make/${P}.tar.lz"
+	SRC_URI+=" verify-sig? ( mirror://gnu/make/${P}.tar.lz.sig )"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+
+LICENSE="GPL-3+"
+SLOT="0"
+IUSE="doc guile nls static test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="guile? ( ${GUILE_REQUIRED_USE} )"
+
+DEPEND="
+	guile? ( ${GUILE_DEPS} )
+"
+RDEPEND="
+	${DEPEND}
+	nls? ( virtual/libintl )
+"
+BDEPEND="
+	$(unpacker_src_uri_depends)
+	doc? ( virtual/texi2dvi )
+	nls? ( sys-devel/gettext )
+	verify-sig? ( sec-keys/openpgp-keys-make )
+	test? ( dev-lang/perl )
+"
+
+DOCS="AUTHORS NEWS README*"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.4-default-cxx.patch
+)
+
+src_unpack() {
+	if [[ ${PV} == 9999 ]] ; then
+		git-r3_src_unpack
+
+		cd "${S}" || die
+		./bootstrap || die
+	else
+		use verify-sig && verify-sig_verify_detached "${DISTDIR}"/${P}.tar.lz{,.sig}
+		unpacker ${P}.tar.lz
+	fi
+}
+
+src_prepare() {
+	default
+
+	if [[ ${PV} == 9999 ]] ; then
+		eautoreconf
+	fi
+
+	if use guile; then
+		guile-single_src_prepare
+	fi
+}
+
+pkg_setup() {
+	if use guile; then
+		guile-single_pkg_setup
+	fi
+}
+
+src_configure() {
+	use static && append-ldflags -static
+	local myeconfargs=(
+		--program-prefix=g
+		$(use_with guile)
+		$(use_enable nls)
+	)
+	econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+	emake all $(usev doc 'pdf html')
+}
+
+src_install() {
+	use doc && HTML_DOCS=( doc/make.html/. ) DOCS="$DOCS doc/make.pdf"
+	default
+
+	dosym gmake /usr/bin/make
+	dosym gmake.1 /usr/share/man/man1/make.1
+	guile_unstrip_ccache
+}
diff --git a/dev-build/make/make-9999.ebuild b/dev-build/make/make-9999.ebuild
index 6ed0e9b00642..8ef172a0adf5 100644
--- a/dev-build/make/make-9999.ebuild
+++ b/dev-build/make/make-9999.ebuild
@@ -4,7 +4,8 @@
 EAPI=8
 
 VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/make.asc
-inherit flag-o-matic unpacker verify-sig
+GUILE_COMPAT=( 3-0 2-2 2-0 1-8 )
+inherit flag-o-matic unpacker verify-sig guile-single
 
 DESCRIPTION="Standard tool to compile source trees"
 HOMEPAGE="https://www.gnu.org/software/make/make.html"
@@ -24,8 +25,11 @@ LICENSE="GPL-3+"
 SLOT="0"
 IUSE="doc guile nls static test"
 RESTRICT="!test? ( test )"
+REQUIRED_USE="guile? ( ${GUILE_REQUIRED_USE} )"
 
-DEPEND="guile? ( >=dev-scheme/guile-1.8:= )"
+DEPEND="
+	guile? ( ${GUILE_DEPS} )
+"
 RDEPEND="
 	${DEPEND}
 	nls? ( virtual/libintl )
@@ -64,6 +68,12 @@ src_prepare() {
 	fi
 }
 
+pkg_setup() {
+	if use guile; then
+		guile-single_pkg_setup
+	fi
+}
+
 src_configure() {
 	use static && append-ldflags -static
 	local myeconfargs=(
diff --git a/profiles/package.mask b/profiles/package.mask
index 31ac05aee52b..aa2ba7f10877 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -39,6 +39,7 @@
 # Masked until the whole Guile ecosystem is updated.
 dev-scheme/guile:2.2
 dev-scheme/guile:3.0
+>=sys-devel/make-4.4.1-r100
 
 # James Le Cuirot <chewi@gentoo.org> (2024-07-29)
 # Superseded by media-libs/libv4l[utils].
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 6/9] dev-scheme/guile-reader: port to new guile eclasses
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
                   ` (4 preceding siblings ...)
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 5/9] dev-build/make: switch to new guile mechanism Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 7/9] dev-scheme/guile-commonmark: new package, add 0.1.2_pre20240803 Arsen Arsenović
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 .../guile-reader-0.6.3-implicit-fn-decl.patch | 25 +++++++
 .../files/guile-reader-0.6.3-slot.patch       | 66 +++++++++++++++++++
 .../guile-reader-0.6.3-r100.ebuild            | 60 +++++++++++++++++
 profiles/package.mask                         |  1 +
 4 files changed, 152 insertions(+)
 create mode 100644 dev-scheme/guile-reader/files/guile-reader-0.6.3-implicit-fn-decl.patch
 create mode 100644 dev-scheme/guile-reader/files/guile-reader-0.6.3-slot.patch
 create mode 100644 dev-scheme/guile-reader/guile-reader-0.6.3-r100.ebuild

diff --git a/dev-scheme/guile-reader/files/guile-reader-0.6.3-implicit-fn-decl.patch b/dev-scheme/guile-reader/files/guile-reader-0.6.3-implicit-fn-decl.patch
new file mode 100644
index 000000000000..f09f3055c0a6
--- /dev/null
+++ b/dev-scheme/guile-reader/files/guile-reader-0.6.3-implicit-fn-decl.patch
@@ -0,0 +1,25 @@
+From d4ff9b9e4c64f7e60c95676ec74c49b12b20ad3b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@gentoo.org>
+Date: Sat, 3 Aug 2024 18:28:51 +0200
+Subject: [PATCH 1/2] add missing include
+
+fixes an implicit function declaration
+---
+ src/compat.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/compat.c b/src/compat.c
+index 943c7f9..9b15b31 100644
+--- a/src/compat.c
++++ b/src/compat.c
+@@ -21,6 +21,7 @@
+ #endif
+ 
+ #include <libguile.h>
++#include <libguile/deprecation.h>
+ #include <compat.h>
+ #include <string.h>
+ #include <stdio.h>
+-- 
+2.45.2
+
diff --git a/dev-scheme/guile-reader/files/guile-reader-0.6.3-slot.patch b/dev-scheme/guile-reader/files/guile-reader-0.6.3-slot.patch
new file mode 100644
index 000000000000..79df5bebb546
--- /dev/null
+++ b/dev-scheme/guile-reader/files/guile-reader-0.6.3-slot.patch
@@ -0,0 +1,66 @@
+From d75f6155c5ff58ac2b3fee311f7056e01b1b6981 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
+Date: Sat, 3 Aug 2024 18:29:21 +0200
+Subject: [PATCH 2/2] use the guile extension directory for libguile-reader.so
+
+this directory is slotted, and so, allows parallel installation.
+---
+ configure.ac             | 2 ++
+ modules/Makefile.am      | 3 ++-
+ modules/system/reader.in | 2 +-
+ src/Makefile.am          | 2 +-
+ 4 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c34e4dd..2ddd308 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -114,6 +114,8 @@ fi
+ AC_PATH_PROGS([GUILD], [guild guile-tools])
+ GUILE_SITE_DIR
+ 
++AC_SUBST([guileextdir], ["${GUILE_EXTENSION}"])
++
+ clean_LIBS="$LIBS"
+ clean_CFLAGS="$CFLAGS"
+ LIBS="$LIBS $GUILE_LIBS"
+diff --git a/modules/Makefile.am b/modules/Makefile.am
+index 25f2499..b0d4fd4 100644
+--- a/modules/Makefile.am
++++ b/modules/Makefile.am
+@@ -13,7 +13,8 @@ nobase_nodist_guilemodule_DATA =		\
+ 
+ .in.scm:
+ 	$(AM_V_GEN)$(MKDIR_P) `dirname "$@"` ;				\
+-	$(SED) -e 's|[@]libdir[@]|$(libdir)|g' < "$<" > "$@.tmp" ;	\
++	$(SED) -e 's|[@]guileextdir[@]|$(guileextdir)|g'		\
++		< "$<" > "$@.tmp" ;					\
+ 	mv "$@.tmp" "$@"
+ 
+ if HAVE_GUILE2
+diff --git a/modules/system/reader.in b/modules/system/reader.in
+index fbef2ac..cd23ba7 100644
+--- a/modules/system/reader.in
++++ b/modules/system/reader.in
+@@ -58,7 +58,7 @@
+ 
+ (define %libguile-reader
+   (string-append (or (getenv "GUILE_READER_LIBDIR")
+-                     "@libdir@")
++                     "@guileextdir@")
+                  "/libguile-reader"))
+ 
+ (load-extension %libguile-reader "scm_reader_init_bindings")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index e029bac..71294c2 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,4 +1,4 @@
+-lib_LTLIBRARIES = libguile-reader.la
++guileext_LTLIBRARIES = libguile-reader.la
+ libguile_reader_la_SOURCES = reader.c token-readers.c reader-lib.c compat.c
+ libguile_reader_la_LDFLAGS = -module -version-info 1:0:0 $(GUILE_LDFLAGS)
+ 
+-- 
+2.45.2
+
diff --git a/dev-scheme/guile-reader/guile-reader-0.6.3-r100.ebuild b/dev-scheme/guile-reader/guile-reader-0.6.3-r100.ebuild
new file mode 100644
index 000000000000..5374e0aaaa63
--- /dev/null
+++ b/dev-scheme/guile-reader/guile-reader-0.6.3-r100.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GUILE_COMPAT=( 2-2 3-0 )
+inherit	guile autotools
+
+DESCRIPTION="Simple framework for building readers for GNU Guile"
+HOMEPAGE="https://www.nongnu.org/guile-reader/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+REQUIRED_USE="${GUILE_REQUIRED_USE}"
+
+RDEPEND="${GUILE_DEPS}"
+DEPEND="${RDEPEND}"
+BDEPEND="dev-util/gperf"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.6.3-implicit-fn-decl.patch"
+	"${FILESDIR}/${PN}-0.6.3-slot.patch"
+)
+
+src_prepare() {
+	default
+
+	eautoreconf
+
+	guile_bump_sources
+}
+
+configure_one_src() {
+	local -x guile_snarf="${GUILESNARF}"
+	# We don't have lightning packaged and, naturally, guile-reader has
+	# no --with-... for it.  Suppress the automagic.
+	econf \
+		ac_cv_header_lightning_h=no
+}
+
+src_configure() {
+	guile_foreach_impl configure_one_src
+}
+
+compile_one_src() {
+	# Makefile appears to be missing seemingly all dependencies.
+	emake -j1 --shuffle=none
+}
+
+src_compile() {
+	guile_foreach_impl compile_one_src
+}
+
+src_install() {
+	guile_src_install
+
+	find "${ED}" -type f -name '*.la' -delete || die
+}
diff --git a/profiles/package.mask b/profiles/package.mask
index aa2ba7f10877..69cd6efd48cf 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -37,6 +37,7 @@
 # Guile rework masks.  Mask all packages or package versions that are
 # being bumped as part of the Guile reslotting process.
 # Masked until the whole Guile ecosystem is updated.
+>=dev-scheme/guile-reader-0.6.3-r100
 dev-scheme/guile:2.2
 dev-scheme/guile:3.0
 >=sys-devel/make-4.4.1-r100
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 7/9] dev-scheme/guile-commonmark: new package, add 0.1.2_pre20240803
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
                   ` (5 preceding siblings ...)
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 6/9] dev-scheme/guile-reader: port to new guile eclasses Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 8/9] www-apps/haunt: new package, add 0.3.0 Arsen Arsenović
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 dev-scheme/guile-commonmark/Manifest          |  1 +
 .../guile-commonmark-0.1.2_pre20240803.ebuild | 29 +++++++++++++++++++
 dev-scheme/guile-commonmark/metadata.xml      | 15 ++++++++++
 profiles/package.mask                         |  1 +
 4 files changed, 46 insertions(+)
 create mode 100644 dev-scheme/guile-commonmark/Manifest
 create mode 100644 dev-scheme/guile-commonmark/guile-commonmark-0.1.2_pre20240803.ebuild
 create mode 100644 dev-scheme/guile-commonmark/metadata.xml

diff --git a/dev-scheme/guile-commonmark/Manifest b/dev-scheme/guile-commonmark/Manifest
new file mode 100644
index 000000000000..f7934235bcda
--- /dev/null
+++ b/dev-scheme/guile-commonmark/Manifest
@@ -0,0 +1 @@
+DIST guile-commonmark-0.1.2_pre20240803.tar.gz 81148 BLAKE2B 0468e49cb58da59bb2e4ea7d372abcc7d9cbc09d05156d9b276057f42b84cbeb7fbcd61b6f406e4e532f2e834682b943a7365de87a901b385daa582d6fa6c11d SHA512 3c89495f201421b9326b8fbb54b92e554136429f6e2817be5ed99a465ced36f63b2446b46760e4eb303bc03d5d630410492994e1cb593b9c803686d7811c4e3d
diff --git a/dev-scheme/guile-commonmark/guile-commonmark-0.1.2_pre20240803.ebuild b/dev-scheme/guile-commonmark/guile-commonmark-0.1.2_pre20240803.ebuild
new file mode 100644
index 000000000000..dc73ecc8f843
--- /dev/null
+++ b/dev-scheme/guile-commonmark/guile-commonmark-0.1.2_pre20240803.ebuild
@@ -0,0 +1,29 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GUILE_COMPAT=( 2-2 3-0 )
+inherit guile autotools
+
+MY_COMMIT=538ffea25ca69d9f3ee17033534ba03cc27ba468
+
+DESCRIPTION="Implementation of CommonMark for Guile"
+HOMEPAGE="https://github.com/OrangeShark/guile-commonmark"
+SRC_URI="https://github.com/OrangeShark/${PN}/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${MY_COMMIT}"
+
+LICENSE="LGPL-3+"
+SLOT="0"
+KEYWORDS="~amd64"
+REQUIRED_USE="${GUILE_REQUIRED_USE}"
+
+RDEPEND="${GUILE_DEPS}"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+	default
+
+	guile_src_prepare
+	eautoreconf
+}
diff --git a/dev-scheme/guile-commonmark/metadata.xml b/dev-scheme/guile-commonmark/metadata.xml
new file mode 100644
index 000000000000..d66ad790c3d9
--- /dev/null
+++ b/dev-scheme/guile-commonmark/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>arsen@gentoo.org</email>
+    <description>Arsen Arsenović</description>
+  </maintainer>
+  <maintainer type="project">
+    <email>scheme@gentoo.org</email>
+    <description>Gentoo Scheme Project</description>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">https://github.com/OrangeShark/guile-commonmark</remote-id>
+  </upstream>
+</pkgmetadata>
diff --git a/profiles/package.mask b/profiles/package.mask
index 69cd6efd48cf..24f0cbdb5b19 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -37,6 +37,7 @@
 # Guile rework masks.  Mask all packages or package versions that are
 # being bumped as part of the Guile reslotting process.
 # Masked until the whole Guile ecosystem is updated.
+dev-scheme/guile-commonmark
 >=dev-scheme/guile-reader-0.6.3-r100
 dev-scheme/guile:2.2
 dev-scheme/guile:3.0
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 8/9] www-apps/haunt: new package, add 0.3.0
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
                   ` (6 preceding siblings ...)
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 7/9] dev-scheme/guile-commonmark: new package, add 0.1.2_pre20240803 Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 9/9] dev-scheme/slib: add 3c1, port to new guile eclasses Arsen Arsenović
  2024-08-18  9:29 ` [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Sam James
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 profiles/package.mask             |  1 +
 www-apps/haunt/Manifest           |  1 +
 www-apps/haunt/haunt-0.3.0.ebuild | 25 +++++++++++++++++++++++++
 www-apps/haunt/metadata.xml       | 12 ++++++++++++
 4 files changed, 39 insertions(+)
 create mode 100644 www-apps/haunt/Manifest
 create mode 100644 www-apps/haunt/haunt-0.3.0.ebuild
 create mode 100644 www-apps/haunt/metadata.xml

diff --git a/profiles/package.mask b/profiles/package.mask
index 24f0cbdb5b19..02eb6d53fdcd 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -37,6 +37,7 @@
 # Guile rework masks.  Mask all packages or package versions that are
 # being bumped as part of the Guile reslotting process.
 # Masked until the whole Guile ecosystem is updated.
+www-apps/haunt
 dev-scheme/guile-commonmark
 >=dev-scheme/guile-reader-0.6.3-r100
 dev-scheme/guile:2.2
diff --git a/www-apps/haunt/Manifest b/www-apps/haunt/Manifest
new file mode 100644
index 000000000000..e6f735dc61ac
--- /dev/null
+++ b/www-apps/haunt/Manifest
@@ -0,0 +1 @@
+DIST haunt-0.3.0.tar.gz 312441 BLAKE2B a16a8f659bc4444dc3749ef30b86479c666bbeaf4379114d23471930d343f325e26898dba53cc515db06f415e236e3bc5f09916e1a395f21d1d7ed2982d334d1 SHA512 25690aa6c3edfc4d9e93f64f3ebfb6bad8b508c6eadb2e0b3a57f9e79a32930aaec82d19b3b89ea5df51f575e512ca18cfccb71fea421559166dee2e986a5451
diff --git a/www-apps/haunt/haunt-0.3.0.ebuild b/www-apps/haunt/haunt-0.3.0.ebuild
new file mode 100644
index 000000000000..fdccc9f54d6c
--- /dev/null
+++ b/www-apps/haunt/haunt-0.3.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GUILE_COMPAT=( 3-0 2-2 )
+inherit guile-single
+
+DESCRIPTION="Haunt is a simple, functional, hackable static site generator"
+HOMEPAGE="https://dthompson.us/projects/haunt.html"
+SRC_URI="https://files.dthompson.us/releases/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64"
+REQUIRED_USE="${GUILE_REQUIRED_USE}"
+
+RDEPEND="
+	${GUILE_DEPS}
+	$(guile_gen_cond_dep '
+		dev-scheme/guile-reader[${GUILE_MULTI_USEDEP}]
+		dev-scheme/guile-commonmark[${GUILE_MULTI_USEDEP}]
+	')
+"
+DEPEND="${RDEPEND}"
diff --git a/www-apps/haunt/metadata.xml b/www-apps/haunt/metadata.xml
new file mode 100644
index 000000000000..72b4388d62c5
--- /dev/null
+++ b/www-apps/haunt/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>arsen@gentoo.org</email>
+    <description>Arsen Arsenović</description>
+  </maintainer>
+  <maintainer type="project">
+    <email>scheme@gentoo.org</email>
+    <description>Gentoo Scheme Project</description>
+  </maintainer>
+</pkgmetadata>
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-dev] [RFC HELP WANTED 9/9] dev-scheme/slib: add 3c1, port to new guile eclasses
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
                   ` (7 preceding siblings ...)
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 8/9] www-apps/haunt: new package, add 0.3.0 Arsen Arsenović
@ 2024-08-11 22:22 ` Arsen Arsenović
  2024-08-18  9:29 ` [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Sam James
  9 siblings, 0 replies; 11+ messages in thread
From: Arsen Arsenović @ 2024-08-11 22:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Arsen Arsenović

NOTE: dev-scheme/scm (i.e. the scm use flag) is untested currently,
since I can't merge SCM.

Signed-off-by: Arsen Arsenović <arsen@gentoo.org>
---
 dev-scheme/slib/Manifest               |   1 +
 dev-scheme/slib/slib-3.3.1-r100.ebuild | 123 +++++++++++++++++++++++++
 profiles/package.mask                  |   1 +
 3 files changed, 125 insertions(+)
 create mode 100644 dev-scheme/slib/slib-3.3.1-r100.ebuild

diff --git a/dev-scheme/slib/Manifest b/dev-scheme/slib/Manifest
index 39a1c7ce08c0..b505138afa97 100644
--- a/dev-scheme/slib/Manifest
+++ b/dev-scheme/slib/Manifest
@@ -1 +1,2 @@
 DIST slib-3b5.zip 1105432 BLAKE2B ae9a6bb34b318875048fad05403a90342b070770013ecd8b022846dc3c43c708511ce6f8ec2be6da2329b01dcc1ed0a641bf68569fd022bb4e2187e20efac0b0 SHA512 f6ebf163fe34498141ab61b6887a9a5db8f2fe0aef1f6c70a7a5783dde6d1268d7e724bc340b73b36189b09013e7079584e0af74f0876e5ebfa46b53d847923e
+DIST slib-3c1.zip 1108203 BLAKE2B 86c38a6ce6936bd1e8b2e3f52fdd3e2e05ba1bb86a611aca7f66a5d65095c81774444459f23f47dd8d01c808ea40c2052d07587c73ffca010f50f5415b2beaf0 SHA512 a6559c3a58ebadfd9efa52391573af375ff142e21e3eface4df346ca7ba7a66a15883596a7a58f6d7f97143729de5022c04d864d90c8a1b3b158b23fbeac8911
diff --git a/dev-scheme/slib/slib-3.3.1-r100.ebuild b/dev-scheme/slib/slib-3.3.1-r100.ebuild
new file mode 100644
index 000000000000..12b0b2c04c29
--- /dev/null
+++ b/dev-scheme/slib/slib-3.3.1-r100.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+GUILE_COMPAT=( 2-2 3-0 )
+inherit guile
+
+#version magic thanks to masterdriverz and UberLord using bash array instead of tr
+trarr="0abcdefghi"
+MY_PV="$(ver_cut 1)${trarr:$(ver_cut 2):1}$(ver_cut 3)"
+
+DESCRIPTION="Portable Scheme library for all standard Scheme implementations"
+HOMEPAGE="http://people.csail.mit.edu/jaffer/SLIB"
+SRC_URI="http://groups.csail.mit.edu/mac/ftpdir/scm/${PN}-${MY_PV}.zip"
+S="${WORKDIR}"/${PN}
+
+LICENSE="public-domain BSD"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~ia64 ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="gambit scm"
+RESTRICT="mirror"
+REQUIRED_USE="${GUILE_REQUIRED_USE}"
+
+RDEPEND="
+	${GUILE_DEPS}
+	gambit? ( dev-scheme/gambit )
+	scm? ( dev-scheme/scm )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	sys-apps/texinfo
+	app-arch/unzip
+"
+
+DOCS=( ANNOUNCE COPYING FAQ README ChangeLog slib.{txt,html} )
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-3.2.5-fix-paths.patch
+)
+
+src_configure() {
+	./configure \
+		--prefix=/usr \
+		--libdir=/usr/share \
+		|| die
+}
+
+src_compile() {
+	default
+
+	makeinfo -o slib.txt --plaintext --force slib.texi || die
+	makeinfo -o slib.html --html --no-split --force slib.texi || die
+}
+
+_new_catalog() {
+	if [[ ! "${1}" =~ ^(guile|scm)$ ]]; then
+		echo -n "(load \"${ROOT}/usr/share/slib/${1}.init\")" || die
+	fi
+	echo " (require 'new-catalog) (slib:report-version)" || die
+}
+
+guile_generate_catalog() {
+	# FIXME(arsen): we need to also compile the .go files..
+	local gpath="${ED}/$(${GUILE} -c '(display (%library-dir))')"
+	local -x GUILE_IMPLEMENTATION_PATH="${gpath}"
+	assert "Could not determine the library directory"
+	mkdir -p "${gpath}" || die
+	ln -sr "${ED}/usr/share/slib" "${GUILE_IMPLEMENTATION_PATH}/slib" \
+		|| die
+	"${GUILE}" --no-auto-compile \
+			   -L "${gpath}" \
+			   -c "
+		(use-modules (ice-9 slib))
+		(require 'new-catalog)
+	"
+	assert "Failed to generate catalogs for Guile"
+}
+
+src_install() {
+	# core
+	insinto /usr/share/${PN}
+	doins *.{dat,init,ps,scm}
+	exeinto /usr/share/${PN}
+	doexe *.sh
+
+	# bin
+	dodir /usr/bin/
+	dosym -r /usr/share/${PN}/${PN}.sh /usr/bin/${PN}
+
+	# env
+	doenvd "${FILESDIR}"/50slib
+
+	# backwards compatibility
+	dodir /usr/lib/
+	dosym -r /usr/share/${PN}/ /usr/lib/${PN}
+
+	# docs
+	doinfo slib.info
+	doman slib.1
+	einstalldocs
+
+	local -x SCHEME_LIBRARY_PATH="${ED}"/usr/share/slib/
+
+	# catalogs
+	einfo "Updating implementation catalogs.."
+	guile_foreach_impl guile_generate_catalog
+
+	# broken as for now
+	#	if use elk ; then
+	#		echo "$(_new_catalog elk)" | elk -l -
+	#	fi
+
+	if use gambit ; then
+		local -x GAMBIT_IMPLEMENTATION_PATH="${ED}"/usr/share/gambc/
+		mkdir -p "${ED}"/usr/share/gambc || die
+		gsi -e "$(_new_catalog gambit)" || die
+	fi
+
+	if use scm ; then
+		scm -e "$(_new_catalog scm)" || die
+	fi
+}
diff --git a/profiles/package.mask b/profiles/package.mask
index 02eb6d53fdcd..7c1bf7bdd074 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -37,6 +37,7 @@
 # Guile rework masks.  Mask all packages or package versions that are
 # being bumped as part of the Guile reslotting process.
 # Masked until the whole Guile ecosystem is updated.
+>=dev-scheme/slib-3.3.1-r100
 www-apps/haunt
 dev-scheme/guile-commonmark
 >=dev-scheme/guile-reader-0.6.3-r100
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem
  2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
                   ` (8 preceding siblings ...)
  2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 9/9] dev-scheme/slib: add 3c1, port to new guile eclasses Arsen Arsenović
@ 2024-08-18  9:29 ` Sam James
  9 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2024-08-18  9:29 UTC (permalink / raw
  To: Arsen Arsenović; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 666 bytes --]

Arsen Arsenović <arsen@gentoo.org> writes:

> Evening!
>
> This patchset brings Gentoo a new set of ecosystem-style packages à la
> Lua or Python.  Now, the trouble with that is that we already have a
> bunch of Guile packages in the Gentoo repositories:
>
>   ~$ qdepends -Qt dev-scheme/guile | wc -l
>   85
>
> ... and more, probably.
>

The series LGTM. I'd already reviewed it as it was being developed as
well.

I think we should get it in and start the porting work, all masked as we
did with Lua, and then handle the grand unmasking in a coordinated
manner later when everything is ready.

> [...]

(big) thanks for doing this,
sam

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 377 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-08-18  9:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-11 22:22 [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 1/9] guile-utils.eclass: new eclass, common code for guile packages Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 2/9] guile-single.eclass: new eclass, for single-impl " Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 3/9] guile.eclass: new eclass, for guile multi-impl packages Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 4/9] profiles/base: add guile _TARGETS USE_EXPAND variables Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 5/9] dev-build/make: switch to new guile mechanism Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 6/9] dev-scheme/guile-reader: port to new guile eclasses Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 7/9] dev-scheme/guile-commonmark: new package, add 0.1.2_pre20240803 Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 8/9] www-apps/haunt: new package, add 0.3.0 Arsen Arsenović
2024-08-11 22:22 ` [gentoo-dev] [RFC HELP WANTED 9/9] dev-scheme/slib: add 3c1, port to new guile eclasses Arsen Arsenović
2024-08-18  9:29 ` [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox