--- /dev/null
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit common-lisp-3 eutils
+
+DESCRIPTION="A collection of public domain utilities."
+HOMEPAGE="http://common-lisp.net/project/alexandria/"
+if [[ ${PV} == 9999* ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://gitlab.common-lisp.net/alexandria/alexandria.git"
+else
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="doc"
+
+DEPEND="doc? ( sys-apps/texinfo )"
+RDEPEND=""
+
+src_prepare() {
+ eapply "${FILESDIR}/${PN}-fix-docstrings.patch"
+ eapply_user
+}
+
+src_compile() {
+ use doc && emake -C doc
+}
+
+src_install() {
+ common-lisp-install-sources -t all *.lisp LICENCE
+ common-lisp-install-asdf
+ dodoc README AUTHORS
+ use doc && doinfo doc/${PN}.info && dodoc doc/{"${PN}.html","${PN}.pdf"}
+}
--- /dev/null
+diff -Nuar a/doc/docstrings.lisp b/doc/docstrings.lisp
+--- a/doc/docstrings.lisp 2016-12-11 00:04:21.272877121 +0100
++++ b/doc/docstrings.lisp 2016-12-11 00:05:03.752876882 +0100
+@@ -718,7 +718,7 @@
+ ;; sbcl.texinfo defines macros that expand @&key and friends to &key.
+ (mapcar (lambda (name)
+ (if (member name lambda-list-keywords)
+- (format nil "@~A" name)
++ (format nil "~A" name)
+ name))
+ (lambda-list doc)))))
+
+@@ -833,11 +833,11 @@
+ (flet ((macro (name)
+ (let ((string (string-downcase name)))
+ (format *texinfo-output* "@macro ~A~%~A~%@end macro~%" string string))))
+- (macro '&allow-other-keys)
+- (macro '&optional)
+- (macro '&rest)
+- (macro '&key)
+- (macro '&body)))
++ (macro 'allow-other-keys)
++ (macro 'optional)
++ (macro 'rest)
++ (macro 'key)
++ (macro 'body)))
+
+ (defun generate-includes (directory packages &key (base-package :cl-user))
+ "Create files in `directory' containing Texinfo markup of all
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>common-lisp@gentoo.org</email>
+ <name>Gentoo Common Lisp Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Alexandria is a project and a library.
+
+ As a project Alexandria's goal is to reduce duplication of effort and
+ improve portability of Common Lisp code according to its own
+ idiosyncratic and rather conservative aesthetic. What this actually
+ means is open to debate, but each project member has a veto on all
+ project activities, so a degree of conservativism is inevitable.
+
+ As a library Alexandria is one of the means by which the project
+ strives for its goals. Alexandria is a collection of portable public
+ domain utilities that meet the following constraints:
+
+ * Utilities, not extensions: Alexandria will not contain conceptual
+ extensions to Common Lisp, instead limiting itself to tools and
+ utilities that fit well within the framework of standard ANSI Common
+ Lisp. Test-frameworks, system definitions, logging facilities,
+ serialization layers, etc. are all outside the scope of Alexandria
+ as a library, though well within the scope of Alexandria as a project.
+ * Conservative: Alexandria limits itself to what project members
+ consider conservative utilities. Alexandria does not and will not
+ include anaphoric constructs, loop-like binding macros, etc.
+ * Portable: Alexandria limits itself to portable parts of Common
+ Lisp. Even apparently conservative and usefull functions remain
+ outside the scope of Alexandria if they cannot be implemented
+ portably. Portability is here defined as portable within a
+ conforming implementation: implementation bugs are not considered
+ portability issues.
+ * Team player: Alexandria will not (initially, at least) subsume
+ or provide functionality for which good-quality special-purpose
+ packages exist, like split-sequence. Instead, third party packages
+ such as that may be "blessed".
+ </longdescription>
+ <upstream>
+ <remote-id type="gitlab">alexandria/alexandria</remote-id>
+ </upstream>
+</pkgmetadata>