public inbox for gentoo-lisp@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-lisp] common-lisp.eclass cleanup
@ 2007-10-12 21:30 Stelian Ionescu
  2007-10-13 10:05 ` Marijn Schouten (hkBst)
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Stelian Ionescu @ 2007-10-12 21:30 UTC (permalink / raw
  To: Gentoo Lisp mailing list


[-- Attachment #1.1: Type: text/plain, Size: 2013 bytes --]

hello, I've attached a cleaned up version of common-lisp.eclass. The
purpose of this change is to remove dependency on
dev-lisp/common-lisp-controller and to help reduce code duplication in
ebuilds.

I'll try to explain how CL packages work:

1) a CL package installs exactly one directory under
/usr/share/common-lisp/source. This is contained in the variable
$CLPACKAGE and it defaults to $PN. Exception: app-emacs/slime installs a
package named "swank"

2) a CL package contains one or more ASDF files(.asd). The variable
$CLSYSTEMS contains the names of those systems and defaults to $PN
because in the simplest case there is only one .asd
The .asd files usually are contained in the toplevel of the source
directory and get symlinked into /usr/share/common-lisp/systems

3) in order to find the systems, ASDF must be aware of the
/usr/share/common-lisp/systems directory, which must be added to the
list contained in the variable asdf:*central-registry*;
dev-lisp/gentoo-init takes care of setting up everything for the user

4) to load a system, one must start a Lisp and eval
(asdf:oos 'asdf:load-op <system>)


The eclass has three explicit "public" functions:

1) common-lisp-install(): must receive at least one argument. It installs
files or directories(recursively) into /usr/share/common-lisp/source

2) common-lisp-system-symlink(): when called with no arguments, it
installs the systems contained in $CLSYSTEMS. The system names must be
relative paths. Example: CLSYSTEMS="foo1 foo2 src/bar"
When called with some arguments, it installs those systems, ignoring
$CLSYSTEMS

3) do-debian-credits(): taken from common-lisp-common.eclass, since I've
dropped the inheritance on it

and an exported function, common-lisp_src_install, which is sufficient
for a good share of CL packages in the tree


if there are no objections, I'll commit the eclass next evening - Oct. 13

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.

[-- Attachment #1.2: common-lisp-2.eclass --]
[-- Type: text/plain, Size: 1900 bytes --]

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Author Matthew Kennedy <mkennedy@gentoo.org>
#
# This eclass supports the installation of Common Lisp libraries

inherit eutils

CLSOURCEROOT=${ROOT}/usr/share/common-lisp/source/
CLSYSTEMROOT=${ROOT}/usr/share/common-lisp/systems/

CLPACKAGE=${PN}
CLSYSTEMS=${PN}

DEPEND="virtual/commonlisp"

EXPORT_FUNCTIONS src_install

common-lisp-install() {
	if [ $# == 0 ]; then
		die "common-lisp-install must receive at least one argument"
	fi
	for thing in "$@"; do
		insinto "${CLSOURCEROOT}/${CLPACKAGE}/$(dirname "${thing}")"
		doins -r "$(basename "${thing}")"
	done
}

common-lisp-install-single-system() {
	if [ $# != 1 ]; then
		die "common-lisp-install-single-system must receive exactly one argument"
	fi
    [ ! -f "${S}/$1".asd ] && die "ASDF file $1 does not exist"
	dosym "${CLSOURCEROOT}/${CLPACKAGE}/$1.asd" \
		"${CLSYSTEMROOT}/$(basename $1).asd"
}

common-lisp-system-symlink() {
	dodir "${CLSYSTEMROOT}"
	# if no arguments received, default to
	# the contents of ${CLSYSTEMS}
	if [ $# -eq 0 ]; then
		for package in ${CLSYSTEMS} ; do
			common-lisp-install-single-system "${package}"
		done
	else
		for package in "$@" ; do
			common-lisp-install-single-system "${package}"
		done
	fi
}

common-lisp_src_install() {
	common-lisp-install *.{lisp,asd}
	common-lisp-system-symlink
	dodoc LICENCE* LICENSE* COPYING* COPYRIGHT README HEADER TODO \
		CHANGELOG ChangeLog BUGS CONTRIBUTORS *NEWS 2> /dev/null
}

# Many of our Common Lisp ebuilds are either inspired by, or actually
# use packages and files from the Debian project's archives.

do-debian-credits() {
	docinto debian
	for i in copyright README.Debian changelog; do
		test -f $i && dodoc "${S}"/debian/${i}
	done
	docinto .
}

# Local Variables: ***
# mode: shell-script ***
# tab-width: 4 ***
# End: ***

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2007-10-18 17:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12 21:30 [gentoo-lisp] common-lisp.eclass cleanup Stelian Ionescu
2007-10-13 10:05 ` Marijn Schouten (hkBst)
2007-10-13 11:30   ` Stelian Ionescu
2007-10-15 10:04     ` Marijn Schouten (hkBst)
2007-10-15 13:39       ` Stelian Ionescu
2007-10-13 10:07 ` Marijn Schouten (hkBst)
2007-10-13 10:48   ` Stelian Ionescu
2007-10-15  8:45 ` Christian Faulhammer
2007-10-15 13:14   ` Stelian Ionescu
2007-10-15 22:28   ` Stelian Ionescu
2007-10-16 11:04     ` Marijn Schouten (hkBst)
2007-10-16 11:27       ` Christian Faulhammer
2007-10-18 14:46       ` Stelian Ionescu
2007-10-18 17:15         ` Marijn Schouten (hkBst)

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