From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IgSFX-0004ex-Hx for garchives@archives.gentoo.org; Fri, 12 Oct 2007 21:40:52 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l9CLUr26009683; Fri, 12 Oct 2007 21:30:53 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id l9CLUp9I009630 for ; Fri, 12 Oct 2007 21:30:51 GMT Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id E7D1965842 for ; Fri, 12 Oct 2007 21:30:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -2.121 X-Spam-Level: X-Spam-Status: No, score=-2.121 required=5.5 tests=[AWL=0.478, BAYES_00=-2.599] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1op-I7gPz66U for ; Fri, 12 Oct 2007 21:30:44 +0000 (UTC) Received: from panadol.lugroma.org (panadol.lugroma.org [194.242.232.30]) by smtp.gentoo.org (Postfix) with ESMTP id DECE9653D2 for ; Fri, 12 Oct 2007 21:30:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by panadol.lugroma.org (Postfix) with ESMTP id 1E26A316CE0 for ; Fri, 12 Oct 2007 23:30:36 +0200 (CEST) Received: from panadol.lugroma.org ([127.0.0.1]) by localhost (panadol.lugroma.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FhXdAAeP7Ml2 for ; Fri, 12 Oct 2007 23:30:33 +0200 (CEST) Received: from blackhole.universe.org (88-149-149-198.dynamic.ngi.it [88.149.149.198]) by panadol.lugroma.org (Postfix) with ESMTP id D3100316766 for ; Fri, 12 Oct 2007 23:30:30 +0200 (CEST) Received: by blackhole.universe.org (Postfix, from userid 1000) id ED829300EE; Fri, 12 Oct 2007 23:30:31 +0200 (CEST) Date: Fri, 12 Oct 2007 23:30:31 +0200 From: Stelian Ionescu To: Gentoo Lisp mailing list Subject: [gentoo-lisp] common-lisp.eclass cleanup Message-ID: <20071012213031.GA710952@universe.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Lisp mail X-BeenThere: gentoo-lisp@gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rS8CxjVDS/+yyDmU" Content-Disposition: inline User-Agent: mutt-ng/devel-r804 (Linux) X-Archives-Salt: 900ba7ff-b2b8-4b9f-a719-92678e2dca63 X-Archives-Hash: a877d34064ffafd3c2784e2b4f339ddf --rS8CxjVDS/+yyDmU Content-Type: multipart/mixed; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=utf8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 ) 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=3D"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 --=20 Stelian Ionescu a.k.a. fe[nl]ix Quidquid latine dictum sit, altum videtur. --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=utf8 Content-Disposition: attachment; filename="common-lisp-2.eclass" # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # # Author Matthew Kennedy # # 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: *** --1yeeQ81UyVL57Vl7-- --rS8CxjVDS/+yyDmU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iD8DBQFHD+d3jWsER8+9ASURAhJcAKCDnTbiXnRBe2u2AMHQk3gAjb7oVACdEFe4 sjywoB7R/hVlMD5G/tjXFig= =Dsz+ -----END PGP SIGNATURE----- --rS8CxjVDS/+yyDmU-- -- gentoo-lisp@gentoo.org mailing list