public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Arsen Arsenović" <arsen@gentoo.org>
Subject: [gentoo-dev] [RFC HELP WANTED 9/9] dev-scheme/slib: add 3c1, port to new guile eclasses
Date: Mon, 12 Aug 2024 00:22:54 +0200	[thread overview]
Message-ID: <20240811231742.942813-10-arsen@gentoo.org> (raw)
In-Reply-To: <20240811231742.942813-1-arsen@gentoo.org>

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



  parent reply	other threads:[~2024-08-11 23:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Arsen Arsenović [this message]
2024-08-18  9:29 ` [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240811231742.942813-10-arsen@gentoo.org \
    --to=arsen@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox