Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-lisp
Navigation:
Lists: gentoo-lisp: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: Gentoo-Lisp Mailing list <gentoo-lisp@g.o>
From: Cyprien Nicolas <c.nicolas@...>
Subject: SLOTting dev-scheme/guile
Date: Wed, 31 Aug 2011 15:10:54 +0200
Hello fellows,

I just pushed to our overlay [1] an update to three guile ebuilds in
order to support SLOTs via app-admin/eselect-guile, which was pushed along.

I attach the diffs to the three modified ebuilds and the eselect module
for review.

The commit diff can be found at:
http://git.overlays.gentoo.org/gitweb/?p=proj/lisp.git;a=commitdiff;h=8409eb91bf10a18080d33cb0c69797335f5aeec9

I have tested the slotting on my machines for a few weeks, but as I'm
not a guile user, I might have missed some issues, that why the
guile-1.8.8-r2 and guile-2.0.1 ebuilds are still masked.

guile-999 is *not* SLOTted 2.2 as I have file collisions on
libguilereadline-v-18.{la,so{,.18{,0.0}}}.
I'm planning to ask upstream about that (plus the fact that guile-tools
in 999 ignore --program-suffix= configure option).

I now that guile-2.0.2 has been released, but I haven't tested the
SLOTting with that version yet, so I prefer to stick to a version I
tried for a while (actually I started to slot guile months ago).

Current issue with guile-2.0.1 haven't changed, they were reported by
Marijn in package.mask:
# - Broken emacs support (ulm has promised to look)
# - doesn't build when boehm-gc is built without threads

Last, there are several QA issues (reported by repoman) about the
current status of guile-2 and guile-999 ebuilds, those are trivial and
non-critical ones, but I didn't wanted to fix them at the same time. I
wanted the diff to only show the SLOTting-related changes.


Thanks for your interest in the Gentoo Lisp project,

--
Cyprien
Fulax on #gentoo-lisp

1: http://git.overlays.gentoo.org/gitweb/?p=proj/lisp.git;a=summary
--- a/guile-1.8.8-r1.ebuild	2011-07-09 13:31:12.000000000 +0200
+++ b/guile-1.8.8-r2.ebuild	2011-08-31 14:36:22.000000000 +0200
@@ -10,11 +10,12 @@
 SRC_URI="mirror://gnu/guile/${P}.tar.gz"
 
 LICENSE="LGPL-2.1"
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
 IUSE="networking +regex discouraged +deprecated emacs nls debug-freelist debug-malloc debug +threads"
 RESTRICT="!regex? ( test )"
 
 DEPEND="
+	app-admin/eselect-guile
 	>=dev-libs/gmp-4.1
 	>=sys-devel/libtool-1.5.6
 	sys-devel/gettext
@@ -39,6 +40,8 @@
 
 	#will fail for me if posix is disabled or without modules -- hkBst
 	econf \
+		--program-suffix="-${MAJOR}" \
+		--infodir="${EPREFIX}"/usr/share/info/guile-${MAJOR} \
 		--disable-error-on-warning \
 		--disable-static \
 		--enable-posix \
@@ -69,13 +72,17 @@
 }
 
 src_install() {
-	einstall || die "install failed"
+	einstall infodir="${ED}"/usr/share/info/guile-${MAJOR} || die "install failed"
+
+	# Maybe there is a proper way to do this? Symlink handled by eselect
+	mv "${ED}"/usr/share/aclocal/guile.m4 "${ED}"/usr/share/aclocal/guile-${MAJOR}.m4 || die "rename of guile.m4 failed"
 
 	dodoc AUTHORS ChangeLog GUILE-VERSION HACKING NEWS README THANKS || die
 
-	# texmacs needs this, closing bug #23493
-	dodir /etc/env.d
-	echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile
+	# Now handled by app-admin/eselect-guile
+	## texmacs needs this, closing bug #23493
+	#dodir /etc/env.d
+	#echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile
 
 	# necessary for registering slib, see bug 206896
 	keepdir /usr/share/guile/site
@@ -89,10 +96,12 @@
 pkg_postinst() {
 	[ "${EROOT}" == "/" ] && pkg_config
 	use emacs && elisp-site-regen
+	eselect guile update ifunset
 }
 
 pkg_postrm() {
 	use emacs && elisp-site-regen
+	eselect guile update ifunset
 }
 
 pkg_config() {
--- a/guile-2.0.1.ebuild	2011-04-29 13:57:13.000000000 +0200
+++ b/guile-2.0.1.ebuild	2011-04-30 11:15:41.000000000 +0200
@@ -14,6 +14,7 @@
 IUSE="networking +regex +deprecated emacs nls debug-malloc debug +threads"
 
 DEPEND="
+	app-admin/eselect-guile
 	dev-libs/gmp
 	>=sys-devel/libtool-1.5.6
 	sys-devel/gettext
@@ -33,6 +34,8 @@
 
 	#will fail for me if posix is disabled or without modules -- hkBst
 	econf \
+		--program-suffix="-${MAJOR}" \
+		--infodir="${EPREFIX}"/usr/share/info/guile-${MAJOR} \
 		--disable-error-on-warning \
 		--disable-static \
 		--enable-posix \
@@ -61,13 +64,17 @@
 }
 
 src_install() {
-	einstall || die "install failed"
+	einstall infodir="${ED}"/usr/share/info/guile-${MAJOR} || die "install failed"
+
+	# Maybe there is a proper way to do this? Symlink handled by eselect
+	mv "${ED}"/usr/share/aclocal/guile.m4 "${ED}"/usr/share/aclocal/guile-${MAJOR}.m4 || die "rename of guile.m4 failed"
 
 	dodoc AUTHORS ChangeLog GUILE-VERSION HACKING NEWS README THANKS || die
 
-	# texmacs needs this, closing bug #23493
-	dodir /etc/env.d
-	echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile
+	# Replaced by app-admin/eselect-guile
+	## texmacs needs this, closing bug #23493
+	#dodir /etc/env.d
+	#echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile
 
 	# necessary for registering slib, see bug 206896
 	keepdir /usr/share/guile/site
@@ -81,10 +88,12 @@
 pkg_postinst() {
 	[ "${EROOT}" == "/" ] && pkg_config
 	use emacs && elisp-site-regen
+	eselect guile update ifunset
 }
 
 pkg_postrm() {
 	use emacs && elisp-site-regen
+	eselect guile update ifunset
 }
 
 pkg_config() {
--- a/guile-999.ebuild	2011-04-28 10:20:33.000000000 +0200
+++ b/guile-999.ebuild	2011-08-31 14:34:56.000000000 +0200
@@ -19,6 +19,7 @@
 IUSE="networking +regex +deprecated emacs nls debug-malloc debug +threads"
 
 DEPEND="
+	app-admin/eselect-guile
 	dev-libs/gmp
 	>=sys-devel/libtool-1.5.6
 	sys-devel/gettext
@@ -29,8 +30,9 @@
 	emacs? ( virtual/emacs )"
 RDEPEND="${DEPEND}"
 
+# Not 2.2; File colisions with 2.0 on libguilereadline-v-18
 SLOT="2"
-MAJOR="2.0"
+MAJOR="2.2"
 
 src_prepare() {
 	# for live ebuilds
@@ -45,6 +47,8 @@
 
 	#will fail for me if posix is disabled or without modules -- hkBst
 	econf \
+		--program-suffix="-${MAJOR}" \
+		--infodir="${EPREFIX}"/usr/share/info/guile-${MAJOR} \
 		--disable-error-on-warning \
 		--disable-static \
 		--enable-posix \
@@ -73,13 +77,17 @@
 }
 
 src_install() {
-	einstall || die "install failed"
+	einstall infodir="${ED}"/usr/share/info/guile-${MAJOR} || die "install failed"
+
+	# Maybe there is a proper way to do this? Symlink handled by eselect
+	mv "${ED}"/usr/share/aclocal/guile.m4 "${ED}"/usr/share/aclocal/guile-${MAJOR}.m4 || die "rename of guile.m4 failed"
 
 	dodoc AUTHORS ChangeLog GUILE-VERSION HACKING NEWS README THANKS || die
 
-	# texmacs needs this, closing bug #23493
-	dodir /etc/env.d
-	echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile
+	# Replaced by app-admin/eselect-guile
+	## texmacs needs this, closing bug #23493
+	#dodir /etc/env.d
+	#echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile
 
 	# necessary for registering slib, see bug 206896
 	keepdir /usr/share/guile/site
@@ -93,10 +101,12 @@
 pkg_postinst() {
 	[ "${EROOT}" == "/" ] && pkg_config
 	use emacs && elisp-site-regen
+	eselect guile update ifunset
 }
 
 pkg_postrm() {
 	use emacs && elisp-site-regen
+	eselect guile update ifunset
 }
 
 pkg_config() {
@@ -108,4 +118,4 @@
 
 _pkg_prerm() {
 	rm -f "${EROOT}"/usr/share/guile/site/slibcat
-}
\ No newline at end of file
+}
# Copyright 2005-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: $
#
# DOCUMENTATION
# Following actions possible
# * show		do_show()
# * list		do_list()
# * set			do_set()
# * update		do_update()
# * clean       do_clean()
#
# Behaviour:
# do_show():
#	Checks if /usr/bin/guile is a link and if the target exists,
#	if yes, it outputs the currently linked Guile version.
#	If it is no symlink, the user is told so, the same if there is
#	no /usr/bin/guile or the target does not exist.
# do_list(): List all available versions of GNU Guile
# do_set(): Set a version to be target of the symlink.
# do_update(): Set the target to the highest version available
#	(optionally: only if not set)
# do_clean(): Remove all set symlinks (for pkg_prerm)

DESCRIPTION="Manage /usr/bin/guile* versions"
MAINTAINER="scheme@g.o"
SVN_DATE='$Date: $'
VERSION=$(svn_date_to_version "${SVN_DATE}")

BINARYLIST="guile-snarf guile-config guile-tools guile"
MANPAGELIST="guile"

find_targets() {
	# Return the list of available Guile binaries
	local j
	for j in "${EROOT}"/usr/bin/guile-[0-9]*; do
		[[ -f ${j} ]] && basename ${j}
	done
}

remove_envfile() {
	# When cleaning symlinks this takes care of the info documentation settings
	rm -f "${EROOT}/etc/env.d/50guile"
}

# Define GUILE_LOAD_PATH environment variable in env file
set_envfile() {
	echo "GUILE_LOAD_PATH=${EPREFIX}/usr/share/guile/$1" >"${EROOT}/etc/env.d/50guile"
	[[ -d ${EROOT}/usr/share/info/guile-$1 ]] || return 1
	echo "INFOPATH=${EPREFIX}/usr/share/info/guile-$1" >>"${EROOT}/etc/env.d/50guile"
}

remove_symlinks() {
	# Remove existing symlinks to binaries, man pages,
	# m4 file, and the env file (own function)
	local f
	for f in ${BINARYLIST}; do
		rm -f "${EROOT}/usr/bin/${f}"
	done
	for f in ${MANPAGELIST}; do
		rm -f "${EROOT}"/usr/share/man/man1/${f}.1*
	done
	rm -f "${EROOT}"/usr/share/aclocal/guile.m4
	remove_envfile
}

set_bin_symlinks() {
	# Set symlinks to binaries in /usr/bin/
	local target=${1} f
	for f in ${BINARYLIST}; do
		# set symlink only if target binary actually exists
		if [[ -f ${EROOT}/usr/bin/${f}-${target} ]]; then
			ln -s "${f}-${target}" "${EROOT}/usr/bin/${f}" || die \
				"Couldn't set ${f}-${target} ${EROOT}/usr/bin/${f} symlink"
		fi
	done
}

set_m4_symlinks() {
	# Set symlink to guile.m4
	local target=${1}
	if [[ -f ${EROOT}/usr/share/aclocal/guile-${target}.m4 ]]; then
		ln -s "guile-${target}.m4" "${EROOT}"/usr/share/aclocal/guile.m4 \
			|| die "Couldn't set guile-${target}.m4 guile.m4 symlink"
	fi
}

set_man_symlinks() {
	# Set symlinks to man pages
	local target=${1} extension f i
	for f in ${MANPAGELIST}; do
		for i in "${EROOT}"/usr/share/man/man1/${f}-${target}.1*; do
			if [[ -f ${i} ]]; then
				# target file exists; determine compress extension
				extension=${i##*/${f}-${target}.1}
				ln -s "${f}-${target}.1${extension}" \
					"${EROOT}/usr/share/man/man1/${f}.1${extension}"
			fi
		done
	done
}

set_symlinks() {
	# Set symlinks to binaries and man pages, update info path
	local target=$1 targets major
	# target may be specified by its name or its index
	if is_number "${target}"; then
		# numeric index, find the target's name
		targets=( $(find_targets) )
		[[ ${target} -ge 1 && ${target} -le ${#targets[@]} ]] \
			|| die -q "Number out of range: ${1}"
		target=${targets[target-1]}
	fi

	# is the target valid, i.e. does a Guile binary with this name exist?
	[[ -f ${EROOT}/usr/bin/${target} ]] \
		|| die -q "Target \"${1}\" doesn't appear to be valid!"

	echo "Switching guile to ${target} ..."
	remove_symlinks || die -q "Couldn't remove existing symlink"

	major=${target#guile-}
	set_bin_symlinks "${major}"
	set_m4_symlinks  "${major}"
	set_man_symlinks "${major}"
	set_envfile "${major}"

	# update /etc/profile.env from /etc/env.d files
	do_action env update noldconfig

	return 0
}

test_for_root() {
	# checks if the user has rights to modify /usr/bin/
	[[ -w ${EROOT}/usr/bin ]] || die -q "You need root privileges!"
}

### show action ###

describe_show() {
	echo "Show the current target of the Guile symlink"
}

do_show() {
	[[ $# -gt 0 ]] && die -q "Too many parameters"

	write_list_start "Current target of Guile symlink:"
	if [[ -L ${EROOT}/usr/bin/guile && -e ${EROOT}/usr/bin/guile ]]; then
		write_kv_list_entry \
			"$(basename "$(readlink "${EROOT}/usr/bin/guile")")" ""
	elif [[ -e ${EROOT}/usr/bin/guile ]]; then
		write_kv_list_entry \
			"(not a symlink or target of symlink does not exist)" ""
	else
		write_kv_list_entry "(unset)" ""
	fi
}

### list action ###

describe_list() {
	echo "List available Guile symlink targets"
}

do_list() {
	[[ $# -gt 0 ]] && die -q "Too many parameters"

	local i targets
	targets=( $(find_targets) )

	for (( i = 0; i < ${#targets[@]}; i++ )); do
		# Highlight the currently chosen version
		[[ ${targets[i]} = \
			$(basename "$(readlink "${EROOT}/usr/bin/guile")") ]] \
			&& targets[i]=$(highlight_marker "${targets[i]}")
	done
	write_list_start "Available Guile symlink targets:"
	write_numbered_list -m "(none found)" "${targets[@]}"
}

### set action ###

describe_set() {
	echo "Set a new Guile symlink"
}

describe_set_options() {
	echo "target : Target name or number (from 'list' action)"
}

describe_set_parameters() {
	echo "<target>"
}

do_set() {
	[[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to"
	[[ $# -gt 1 ]] && die -q "Too many parameters"
	test_for_root

	if [[ -e ${EROOT}/usr/bin/guile && ! -L ${EROOT}/usr/bin/guile ]]; then
		die -q "${EROOT}/usr/bin/guile exists but is not a symlink"
	fi

	set_symlinks "${1}" || die -q "Couldn't set a new symlink"
}

### update action ###

describe_update() {
	echo "Automatically update the Guile symlink"
}

describe_update_options() {
	echo "ifunset : Do not override currently set version"
}

do_update() {
	[[ -z $1 || $1 = ifunset || $1 = --if-unset ]] || die -q "Usage error"
	[[ $# -gt 1 ]] && die -q "Too many parameters"
	test_for_root

	if [[ -L ${EROOT}/usr/bin/guile ]]; then
		# this is not redundant: "update" is called in pkg_postrm() of guile
		# and should clean up any dead symlinks if no valid target exists
		remove_symlinks || die -q "Couldn't remove existing symlink"
	elif [[ -e ${EROOT}/usr/bin/guile ]]; then
		die -q "${EROOT}/usr/bin/guile exists but is not a symlink"
	fi

	local targets=( $(find_targets) )
	if [[ ${#targets[@]} -gt 0 ]]; then
		set_symlinks "${targets[${#targets[@]}-1]}" \
			|| die -q "Couldn't set a new symlink"
	fi
}

### Clean action
describe_clean() {
	echo "Remove any existing symlinks"
}

do_clean() {
	remove_symlinks
}
Attachment:
signature.asc (OpenPGP digital signature)
Navigation:
Lists: gentoo-lisp: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Invitation to connect on LinkedIn
Next by thread:
dev-scheme/racket-5.2
Previous by date:
Invitation to connect on LinkedIn
Next by date:
dev-scheme/racket-5.2


Updated May 02, 2012

Summary: Archive of the gentoo-lisp mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.