commit:     800d509ac4529bd6952bed60247756bb7806abee
Author:     Oskari Pirhonen <xxc3ncoredxx <AT> gmail <DOT> com>
AuthorDate: Thu Feb 29 01:46:47 2024 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Sat Mar  2 16:32:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=800d509a

dev-scheme/mit-scheme: "modern" c fix

Use termcap/terminfo provided by ncurses instead of the included ancient
1980's termcap emulation complete with everyone's favorite 1980's flavor
of C.

Closes: https://bugs.gentoo.org/871507
Signed-off-by: Oskari Pirhonen <xxc3ncoredxx <AT> gmail.com>
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 dev-scheme/mit-scheme/mit-scheme-12.1-r1.ebuild | 93 +++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/dev-scheme/mit-scheme/mit-scheme-12.1-r1.ebuild 
b/dev-scheme/mit-scheme/mit-scheme-12.1-r1.ebuild
new file mode 100644
index 000000000000..785388a9f324
--- /dev/null
+++ b/dev-scheme/mit-scheme/mit-scheme-12.1-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs wrapper
+
+DESCRIPTION="Scheme interpreter, compiler, debugger and runtime library"
+HOMEPAGE="https://www.gnu.org/software/mit-scheme/
+       https://savannah.gnu.org/projects/mit-scheme/";
+SRC_URI="https://ftp.gnu.org/gnu/${PN}/stable.pkg/${PV}/${P}-svm1-64le.tar.gz";
+S="${S}"/src
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="amd64"  # Additionally arm64 is officially supported.
+IUSE="blowfish gdbm gui postgres"
+
+BDEPEND="
+       virtual/pkgconfig
+"
+# Use ncurses to avoid ancient emulated termcap from 1980's, bug #871507
+RDEPEND="
+       sys-libs/ncurses
+       blowfish? ( dev-libs/openssl:= )
+       gdbm? ( sys-libs/gdbm:= )
+       gui? ( x11-libs/libX11 )
+       postgres? ( dev-db/postgresql:* )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-11.2-no-Werror.patch
+       "${FILESDIR}"/${PN}-11.2-implicit-int.patch
+)
+
+src_configure() {
+       local termcap
+
+       # ncurses provides termcap via terminfo which is found in "tinfo" when
+       # installed as ncurses[tinfo] and in "ncurses" when installed as
+       # ncurses[-tinfo].
+       if "$(tc-getPKG_CONFIG)" --exists tinfo ; then
+               termcap=tinfo
+       else
+               termcap=ncurses
+       fi
+
+       local -a myconf=(
+               --disable-mcrypt
+               --with-termcap=${termcap}
+               $(use_enable blowfish)
+               $(use_enable gdbm)
+               $(use_enable gui edwin)
+               $(use_enable gui imail)
+               $(use_enable gui x11)
+               $(use_enable postgres pgsql)
+               $(use_with gui x)
+       )
+       econf ${myconf[@]}
+}
+
+src_compile() {
+       # Compile the "microcode" first, bug #879901
+       emake -C microcode
+
+       # Fails with multiple make-jobs, at least it compiles relatively fast.
+       emake -j1
+}
+
+# Tests that theoretically fail (still passes):
+# microcode/test-flonum-except
+# runtime/test-arith
+# runtime/test-flonum
+# runtime/test-flonum.bin
+# runtime/test-flonum.com
+
+src_test() {
+       FAST=y emake check -j1
+}
+
+src_install() {
+       default
+
+       # Create the edwin launcher.
+       use gui && make_wrapper mit-scheme-edwin "mit-scheme --edit"
+
+       # Remove "scheme" symlink to not "discriminate" any other 
implementations.
+       rm "${ED}"/usr/bin/scheme || die
+
+       # Remove libtool files.
+       find "${ED}" -type f -name "*.la" -delete || die
+}

Reply via email to