--- /dev/null
+DIST ecl-21.2.1_p20221211.tar.gz 8039002 BLAKE2B 3ef801b9aff621c7229d0f7902371021ff1a841bae2e69d0e51875f9b38b98e386ffaeba67aa5e952060c0ca0025863fe8f37a0b0b01a4e0dd0984c743dce74a SHA512 f9f42826754af15940bbe0c6385ee0d8c1e90ada077f20e37be098a2369113a343e527dca24be7080c0fc78272eb6c03fe70bdd61aa798a767dfe87e29db55fe
--- /dev/null
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit readme.gentoo-r1
+
+MY_P=ecl-${PV}
+DESCRIPTION="ECL is an embeddable Common Lisp implementation"
+HOMEPAGE="https://common-lisp.net/project/ecl/"
+COMMIT="7175e592bddf0a612c8f1e17a5a2dc7659223b60"
+SRC_URI="https://gitlab.com/embeddable-common-lisp/ecl/-/archive/${COMMIT}/ecl-${COMMIT}.tar.gz
+ -> ecl-${PV}.tar.gz"
+S="${WORKDIR}/ecl-${COMMIT}"
+
+LICENSE="BSD-2 LGPL-2.1+"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="cxx debug emacs gengc precisegc cpu_flags_x86_sse +threads +unicode X"
+# test phase only works if ecls already installed #516876
+RESTRICT="test"
+
+RDEPEND="dev-libs/gmp:0=
+ dev-libs/libffi:=
+ dev-libs/libatomic_ops
+ >=dev-libs/boehm-gc-7.1[threads?]
+ >=dev-lisp/asdf-2.33-r3:="
+DEPEND="${RDEPEND}
+ app-text/texi2html
+ emacs? ( >=app-editors/emacs-23.1:* >=app-eselect/eselect-emacs-1.12 )"
+
+DOCS=( README.md CHANGELOG )
+
+# We don't need the ldflags patch since upstream fixed the makefile
+# to respect LDFLAGS.
+PATCHES=(
+ "${FILESDIR}/${PN}-16.1.3-headers-gentoo.patch"
+ "${FILESDIR}/${PN}-16.1.3-build.patch"
+ "${FILESDIR}/${PN}-21.2.1-donotcompressinfo.patch"
+)
+
+src_prepare() {
+ default
+ cp "${EPREFIX}"/usr/share/common-lisp/source/asdf/build/asdf.lisp contrib/asdf/ || die
+}
+
+src_configure() {
+ econf \
+ --enable-gmp=system \
+ --enable-boehm=system \
+ --with-dffi \
+ --enable-libatomic=system \
+ --with-defsystem \
+ $(use_with cxx) \
+ $(use_enable gengc) \
+ $(use_enable precisegc) \
+ $(use_with debug debug-cflags) \
+ $(use_with cpu_flags_x86_sse sse) \
+ $(use_enable threads) \
+ $(use_enable unicode) \
+ $(use_with X x)
+}
+
+src_compile() {
+ if use emacs; then
+ local ETAGS=$(eselect --brief etags list | sed -ne '/emacs/{p;q}')
+ [[ -n ${ETAGS} ]] || die "No etags implementation found"
+ pushd build > /dev/null || die
+ emake ETAGS=${ETAGS} TAGS
+ popd > /dev/null || die
+ else
+ touch build/TAGS
+ fi
+
+ emake
+}
+
+src_install() {
+ default
+
+ readme.gentoo_create_doc
+ pushd build/doc > /dev/null || die
+ newman ecl.man ecl.1
+ newman ecl-config.man ecl-config.1
+ popd > /dev/null || die
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
--- /dev/null
+-*- outline -*-
+
+Gentoo GNU/Linux specific notes for ECL
+---------------------------------------
+
+ * The Gentoo port includes a patch to ECL's installed header file (ech.h) so
+ that TRUE and FALSE are not redefined if they're already included from
+ elsewhere. This makes it easier to use ECL with other software which defines
+ those C preprocesser symbols (eg. glib-2.0).
+
+If you encounter any problems or have suggestions, use https://bugs.gentoo.org/.
+Please don't bother the upstream authors unless you are absolutely certain it is
+not Gentoo-related.
--- /dev/null
+diff -r -U2 ecl-16.1.3.orig/src/c/printer/write_sse.d ecl-16.1.3/src/c/printer/write_sse.d
+--- ecl-16.1.3.orig/src/c/printer/write_sse.d 2016-12-19 17:25:00.000000000 +0700
++++ ecl-16.1.3/src/c/printer/write_sse.d 2016-12-19 19:20:01.863563607 +0700
+@@ -13,4 +13,6 @@
+ */
+
++#include <ecl/config.h>
++
+ #ifdef ECL_SSE2
+ #include <ecl/ecl.h>
--- /dev/null
+diff -r -U2 ecl-16.1.3.orig/src/h/object.h ecl-16.1.3/src/h/object.h
+--- ecl-16.1.3.orig/src/h/object.h 2016-12-19 17:25:00.000000000 +0700
++++ ecl-16.1.3/src/h/object.h 2016-12-19 19:22:21.147557750 +0700
+@@ -26,6 +26,11 @@
+ */
+
++#ifndef TRUE
+ #define TRUE 1 /* boolean true value */
++#endif
++
++#ifndef FALSE
+ #define FALSE 0 /* boolean false value */
++#endif
+
+ #if !defined(__cplusplus) && !defined(bool)
--- /dev/null
+diff --git a/src/doc/Makefile.in b/src/doc/Makefile.in
+index 5660f41..c2aadbe 100644
+--- a/src/doc/Makefile.in
++++ b/src/doc/Makefile.in
+@@ -15,7 +15,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_DATA = @INSTALL_DATA@
+ INSTALL_INFO = @INSTALL_INFO@
+ mkinstalldirs = $(top_srcdir)/bdwgc/install-sh -d
+-INFO_FILE = ecl.info.gz
++INFO_FILE = ecl.info
+ MAKEINFO = @MAKEINFO@
+ MANUAL_MAKE_TARGET = @MANUAL_MAKE_TARGET@
+ MANUAL_INSTALL_TARGET = @MANUAL_INSTALL_TARGET@
+diff --git a/src/doc/manual/Makefile b/src/doc/manual/Makefile
+index f82c287..2ff67e0 100644
+--- a/src/doc/manual/Makefile
++++ b/src/doc/manual/Makefile
+@@ -5,15 +5,14 @@ FILES= *.txi */*.txi figures/*
+ all: pdf info html
+
+ pdf: manual.pdf
+-info: ecl.info.gz
++info: ecl.info
+ html: html/index.html
+
+ manual.pdf: $(FILES)
+ texi2pdf manual.txi
+
+-ecl.info.gz: $(FILES)
++ecl.info: $(FILES)
+ $(MAKEINFO) --no-split manual.txi
+- gzip < ecl.info > ecl.info.gz
+
+ html/index.html: $(FILES)
+ $(MAKEINFO) --html --css-include=ecl.css --split=section manual.txi
--- /dev/null
+https://bugs.gentoo.org/723162
+
+--- ecl-21.2.1/src/c/Makefile.in
++++ ecl-21.2.1/src/c/Makefile.in
+@@ -104,7 +104,7 @@
+
+ $(DPP): $(srcdir)/dpp.c $(srcdir)/symbols_list.h
+ if test -f ../CROSS-DPP; then touch dpp; else \
+- $(TRUE_CC) -I$(srcdir) -I@true_builddir@ -I./ $(srcdir)/dpp.c @CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@ -o $@ ; \
++ $(TRUE_CC) -I$(srcdir) -I@true_builddir@ -I./ $(srcdir)/dpp.c @CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@ @LDFLAGS@ -o $@ ; \
+ fi
+
+ $(OBJS): $(DPP)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>common-lisp@gentoo.org</email>
+ <name>Gentoo Common Lisp Project</name>
+ </maintainer>
+ <longdescription>
+ ECL (Embeddable Common Lisp) is an implementation of the Common Lisp language as
+ described in the X3J13 Ansi specification, featuring CLOS (Common Lisp Object
+ System), conditions, loops, etc, plus a translator to C, which can produce
+ standalone executables.
+ </longdescription>
+ <use>
+ <flag name="gengc">Use generational garbage collection (experimental)</flag>
+ <flag name="precisegc">Use type information during garbage collection (experimental)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">ecls</remote-id>
+ </upstream>
+</pkgmetadata>