summaryrefslogtreecommitdiff
path: root/dev-scheme/slib
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-scheme/slib
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-scheme/slib')
-rw-r--r--dev-scheme/slib/Manifest13
-rw-r--r--dev-scheme/slib/files/50slib1
-rw-r--r--dev-scheme/slib/files/slib-3.2.2-fix-texinfo.awk123
-rw-r--r--dev-scheme/slib/files/slib-3.2.5-fix-makefile-guile.patch23
-rw-r--r--dev-scheme/slib/files/slib-3.2.5-fix-paths.patch42
-rw-r--r--dev-scheme/slib/metadata.xml16
-rw-r--r--dev-scheme/slib/slib-3.2.1.ebuild129
-rw-r--r--dev-scheme/slib/slib-3.2.2.ebuild130
-rw-r--r--dev-scheme/slib/slib-3.2.5-r1.ebuild122
9 files changed, 599 insertions, 0 deletions
diff --git a/dev-scheme/slib/Manifest b/dev-scheme/slib/Manifest
new file mode 100644
index 000000000000..d8d3b74dc953
--- /dev/null
+++ b/dev-scheme/slib/Manifest
@@ -0,0 +1,13 @@
+AUX 50slib 39 SHA256 c997087437fa40be31d52cd86749d4345319f7197ba65cfb3c3c2bf9530b579c SHA512 e454fbcd8e4516b363a94055a0dde09f3cd5fa61babb0c6510ba6dcb50ddc123bb89ec8657171cc1d05fa5ebf5a1691b9425d3397c88617c9d2288770ff8a29b WHIRLPOOL 70636e9ec6bd241bdc5f1bddb913ad41ceb3edc2e733a83428bbb4c9b7a49f575b35151a7eb49b3f5633506168c7508573b435ae7e2f52dda331cfd6bc7e74f1
+AUX slib-3.2.2-fix-texinfo.awk 1615 SHA256 109f38798a407b596c66f17280893bc3963eff395e1204ff435bf67134a33204 SHA512 793b50b9678e5d29465e29fc00348df0357310cb10b5a9446397a11f21c30d885a6bbc92577ebd7c9ae82ac07081baa08692a80c4d0b0738020f01c57a7e128e WHIRLPOOL effc213044202e982c1ca91cb33de4ec247b64c63be03689fb3a6dbc5fdeb8a4ac10411a3e4491680126081af3adbbb526bd3ff2da4d70f45058049dee934834
+AUX slib-3.2.5-fix-makefile-guile.patch 882 SHA256 56896f6a29643ce9cf656bef587b7ae8aefdd311d04d29109d6b65f57474e303 SHA512 74997578edd5472f084a3b899c4e11b67432a4776bce6a19cbd4300316bf413f38374711a9a5cd3c10cd6cac01cb6d337d6f2ad18236bc4747c0bccf88948e3a WHIRLPOOL 48cc3ee3fb3f074405a5690dc09c6c2bdf3eee857403418c47b5b3899ed9021b5c9dcd8c0c01d1a27ae9d18a5b5096db8d9372f0013a10f566c9d7bf1848d9f6
+AUX slib-3.2.5-fix-paths.patch 1627 SHA256 0136081287f437697a71d700a974d7c1720520eb9498e76d1ebd2affcde1456c SHA512 bdd667f20ca0ef57707a4df379186b58ef5ffab38e61a7e8e4ef697d7a90ebbafa8e4ca1f887d87520290656f2445fe1a9f4bd4e22634587908f70059dde0f30 WHIRLPOOL caf0b4523d4b9bda63f30d21002860346492457b332e5e980c32a1123891d640eb0a0a9ce4b29ecd0cd783a8bd0e3065fc9d5e164360e6e91db246de931571f8
+DIST slib-3b1.zip 1063227 SHA256 8e3ec24d51be03ebb7357ad9a2f3554056b86dafbc9e48d1d491aeda1efa566f SHA512 28eb997a094cfb0a97eb924ed7bd965bb094db773343529f1593446b507908ccdec3086c6ce0b6b938a9742ed84bd8f5f36b14911296549660cc4b301f84c977 WHIRLPOOL 5c5a20fca0ad605d3ade593449071ca3afdc47522b1158c3e013477811a3720e82ed742873de7b75c0354fa456725090357c214c7b638110b2438e874b3e242d
+DIST slib-3b2.zip 1067021 SHA256 b1cb9c1b7c888e32918ebdd8fca80d9c875024b064bc6989e4700905873bcae8 SHA512 199b5ddaffd1213dd144dc7f60de020029586babc83f702830d95a0d387c4f1aad9fcbe1603c0f8d4351e0ec1650fad745fd463a56c3bb86394e81eadae6afd5 WHIRLPOOL d31902c7780d528a1a130d5d8f3f77692b033a7227d6cf398a67829dcc8ad20976f55d7ac60b3ba7376ff4fd246b042f842674d05f10287799e24413d783da10
+DIST slib-3b5.tar.gz 987735 SHA256 ea26e5170c6db6d6c69e4aaf91e9b1c9619174fc92d5dc63c71fff2a935e51ba SHA512 e5d1210b70cd882cd5e810b3c4102d6060ec82fb2093f472bf31b597f6273e0a02f4d35a82c4b5c8cdc3f8b2c7b9e498fa3e35c7f265fa864cd9dc50e7a874c8 WHIRLPOOL 2d962de080e2786c72bfa4fa9bb2c907f1e3cc934cdb696a22f117e5733abfc49e176c9731841dbb0f735cfd59fd6c0bdbb1706c3510b8fc3d3f886afacdc5fb
+EBUILD slib-3.2.1.ebuild 3861 SHA256 bba5a5a5b4a3e5aa65277c4ae6fedb6628df1c45b903ab95f6deb06b59d2304c SHA512 032eddda11b6d5f196f7ebc77f5cd0c3d0c33489470e1bfb9b3a7f1ae744c2dcc3e6229c475efcd45be86e7ff206f80c225e2494430a3ead2fb4702600347462 WHIRLPOOL 246ff88d0306f682f29380ab054920c026c534512299e11f271a59c3073926245fc618f6e92c51556c37f571d4aa96973a8c1c8d5c27e84deecdec5bc9ad36ea
+EBUILD slib-3.2.2.ebuild 4050 SHA256 6a7f63f8b997247bb39ca0952efc4c53014d0d7920e009ee544582bd3b2d7cbc SHA512 d44ec1a0e70ee5170d79c9e0c403c632cbee43f9d443070bbe45de98ec4cc8c09f3b9027734f9138528b54b1b9710728e87cef5f94951e1e39f69409e2318757 WHIRLPOOL 2600059d6fff9f8cb2df4fdd6a747c7206756be23f18757d839ed9048bfc944b59275985cc6caf40822c5e343308af281a30ff93fa85604e413651dfed366987
+EBUILD slib-3.2.5-r1.ebuild 2774 SHA256 8bb022ad347c4bd4e3927ee7c6c16a43005b0977eed92992f3bc814edb8166ce SHA512 9da8a5d0c95a12adbb3150ec1b5942043e2330e544b567f43d3bd49cacf50b983cb7730952a0135c6d5f078efa6eaf458e1e5e8e1bb942fe7867a019f6e1f28a WHIRLPOOL 17e7e14853a0bb4135c7687b2608898c7ca63ace05ad995511aa65bdc703c3a23ede50974dd6609810997a732d93699cbf659c10e86171b16b54737f2ccf2cd9
+MISC ChangeLog 5017 SHA256 39a8d20f986aebaf57bf51dd2c5eaedca142d9d481accf14d9f231a17cc34979 SHA512 55f0cefd8be5085387bfdd8f536da241ab3e14e97b69bf3440552b53b4c7be9e97bb597e73a72ee8b7ec83162d31c73f6b762bc2c58acaa6e58987fd3f0eb6c7 WHIRLPOOL a9c88a1b1f1bdba0dd22b3255791de502898cfd65d40fdfc8fecb0e2a3685f7ba44ec7e67f14251d71c60eaf4222c987e2d082948cc9b45b38769da9e7cf1bc6
+MISC ChangeLog-2015 8690 SHA256 e7fdfc234f5c507718f68369d36ba91c4ca6f1311ce6fa1fe9e75eab97df6df4 SHA512 73b8d95a979bc47f93a571adc0f1166ea8c90b0b41dc2d75253d152f74fba8e4af8f1813ddbc68100932cb8b032b813d322758d1360a93686804502a1f03b22b WHIRLPOOL abfca707bc1a9cd657c45a223010bd6eae10ce9882db750fd7ff1c723ad86cc460a0b9da24ff4be2815322def8f06a93b0c5374bd7fa142d8f60c71d6869d77e
+MISC metadata.xml 580 SHA256 59e6d5c9b931bce6c2549996b42ae724ec2e83c96e02e3abb9d512da1df98c9f SHA512 5b75cfc410ff0ec6a324590f69001ac38410e963df6490695abb85132168cd37ccf685b9281026eea2fc82e59340fccecde58887aa3b64f88003970b979d5807 WHIRLPOOL 82db5dd3b879bf1e18fc542e6af9af7df7606cbef1032c5488e7a4017818fe22d51a3b854fa921823fa6a5143e241482ec3fb8ca8cd1e79f4d93da570c4e3700
diff --git a/dev-scheme/slib/files/50slib b/dev-scheme/slib/files/50slib
new file mode 100644
index 000000000000..072862ed0b83
--- /dev/null
+++ b/dev-scheme/slib/files/50slib
@@ -0,0 +1 @@
+SCHEME_LIBRARY_PATH="/usr/share/slib/"
diff --git a/dev-scheme/slib/files/slib-3.2.2-fix-texinfo.awk b/dev-scheme/slib/files/slib-3.2.2-fix-texinfo.awk
new file mode 100644
index 000000000000..6bc3ce8e177b
--- /dev/null
+++ b/dev-scheme/slib/files/slib-3.2.2-fix-texinfo.awk
@@ -0,0 +1,123 @@
+# Fixes Texinfo input to compile with Texinfo 5 or later
+#
+# Written by Sebastian Pipping <sebastian@pipping.org>
+# Licensed under CC0 1.0 Universal Public Domain Dedication
+# https://creativecommons.org/publicdomain/zero/1.0/
+#
+# Version 0_p20150813_p0418
+
+BEGIN {
+ inside_deffn = 0
+ inside_defmac = 0
+ inside_defop = 0
+ inside_deftp = 0
+ inside_defun = 0
+}
+
+/^@deffn / {
+ if (inside_deffn) {
+ print "@end deffn"
+ }
+ inside_deffn = 1
+}
+
+/^@deffnx / {
+ if (inside_deffn) {
+ print "@end deffn"
+ }
+ sub(/^@deffnx/, "@deffn")
+ inside_deffn = 1
+}
+
+/^@defmac / {
+ if (inside_defmac) {
+ print "@end defmac"
+ }
+ inside_defmac = 1
+}
+
+/^@defmacx / {
+ if (inside_defmac) {
+ print "@end defmac"
+ }
+ sub(/^@defmacx/, "@defmac")
+ inside_defmac = 1
+}
+
+/^@defop / {
+ if (inside_defop) {
+ print "@end defop"
+ }
+ inside_defop = 1
+}
+
+/^@defopx / {
+ if (inside_defop) {
+ print "@end defop"
+ }
+ sub(/^@defopx/, "@defop")
+ inside_defop = 1
+}
+
+/^@deftp / {
+ if (inside_deftp) {
+ print "@end deftp"
+ }
+ inside_deftp = 1
+}
+
+/^@deftpx / {
+ if (inside_deftp) {
+ print "@end deftp"
+ }
+ sub(/^@deftpx/, "@deftp")
+ inside_deftp = 1
+}
+
+/^@defun / {
+ if (inside_defun) {
+ print "@end defun"
+ }
+ inside_defun = 1
+}
+
+/^@defunx / {
+ if (inside_defun) {
+ print "@end defun"
+ }
+ sub(/^@defunx/, "@defun")
+ inside_defun = 1
+}
+
+/^@end deffn/ {
+ inside_deffn = 0
+}
+
+/^@end defmac/ {
+ inside_defmac = 0
+}
+
+/^@end defop/ {
+ inside_defop = 0
+}
+
+/^@end deftp/ {
+ inside_deftp = 0
+}
+
+/^@end defun/ {
+ inside_defun = 0
+}
+
+/^@subsubsection/ {
+ if (inside_deffn) {
+ print "@end deffn"
+ print $0
+ print "@deffn {Dummy} Dummy"
+ next
+ }
+}
+
+{
+ print
+}
diff --git a/dev-scheme/slib/files/slib-3.2.5-fix-makefile-guile.patch b/dev-scheme/slib/files/slib-3.2.5-fix-makefile-guile.patch
new file mode 100644
index 000000000000..4617b4e780cb
--- /dev/null
+++ b/dev-scheme/slib/files/slib-3.2.5-fix-makefile-guile.patch
@@ -0,0 +1,23 @@
+--- slib-3b5/~Makefile 2016-10-10 23:54:01.461733550 +0200
++++ slib-3b5/Makefile 2016-10-10 23:59:33.806035867 +0200
+@@ -13,9 +13,9 @@ SHELL = /bin/sh
+ INSTALL = install
+ INSTALL_PROGRAM = ${INSTALL}
+ INSTALL_DATA = ${INSTALL} -m 644
+-INSTALL_INFO = ginstall-info
++INSTALL_INFO = install-info
+
+-SCHEME = scm
++SCHEME = guile
+ CHPAT = $(HOME)/bin/chpat
+ MAKEDEV = $(MAKE) -f $(HOME)/makefile.dev
+ TEXI2HTML = /usr/local/bin/texi2html -split -verbose
+@@ -183,7 +183,7 @@ slib.html: slib.texi
+ $(MAKEINFO) --html --no-split --no-warn --force $<
+
+ slib-$(VERSION).info: slib.texi version.txi $(txifiles) $(texifiles)
+- $(MAKEINFO) $< --no-warn --no-split -o slib-$(VERSION).info
++ $(MAKEINFO) $< --no-warn --no-split --force -o slib-$(VERSION).info
+ slib.info: slib-$(VERSION).info
+ if [ -f $(prevdocsdir)slib.info ];\
+ then infobar $(prevdocsdir)slib.info slib-$(VERSION).info \
diff --git a/dev-scheme/slib/files/slib-3.2.5-fix-paths.patch b/dev-scheme/slib/files/slib-3.2.5-fix-paths.patch
new file mode 100644
index 000000000000..9a373c14d733
--- /dev/null
+++ b/dev-scheme/slib/files/slib-3.2.5-fix-paths.patch
@@ -0,0 +1,42 @@
+--- slib-3b5/~RScheme.init 2016-10-10 23:05:39.117046443 +0200
++++ slib-3b5/RScheme.init 2016-10-10 23:06:47.242857550 +0200
+@@ -52,7 +52,7 @@
+ ;; Use this path if your scheme does not support GETENV
+ ;; or if SCHEME_LIBRARY_PATH is not set.
+ (case (software-type)
+- ((unix) "/usr/lib/slib/")
++ ((unix) "/usr/share/slib/")
+ ((vms) "lib$scheme:")
+ ((ms-dos) "C:\\SLIB\\")
+ (else "")))))
+--- slib-3b5/~gambit.init 2016-10-10 23:05:20.939634454 +0200
++++ slib-3b5/gambit.init 2016-10-10 23:07:46.571968697 +0200
+@@ -38,7 +38,7 @@
+ (let ((impl-path
+ (or (getenv "GAMBIT_IMPLEMENTATION_PATH")
+ (case (software-type)
+- ((unix) "/usr/local/share/gambc/")
++ ((unix) "/usr/share/gambc/")
+ ((vms) "scheme$src:")
+ ((ms-dos) "C:\\scheme\\")
+ ((windows) "c:/scheme/")
+@@ -65,7 +65,7 @@
+ ;; Use this path if your scheme does not support GETENV
+ ;; or if SCHEME_LIBRARY_PATH is not set.
+ (case (software-type)
+- ((unix) "/usr/local/lib/slib/")
++ ((unix) "/usr/share/slib/")
+ ((macos) (string-append (implementation-vicinity) "slib:"))
+ ((amiga) "dh0:scm/Library/")
+ ((vms) "lib$scheme:")
+--- slib-3b5/~guile-2.init 2016-10-10 23:05:46.531807087 +0200
++++ slib-3b5/guile-2.init 2016-10-10 23:08:00.154538349 +0200
+@@ -199,7 +199,7 @@
+ (define implementation-vicinity
+ (cond ((getenv "GUILE_IMPLEMENTATION_PATH")
+ => (lambda (path) (lambda () path)))
+- (else %site-dir)))
++ (else %library-dir)))
+
+ ;;; (library-vicinity) should be defined to be the pathname of the
+ ;;; directory where files of Scheme library functions reside.
diff --git a/dev-scheme/slib/metadata.xml b/dev-scheme/slib/metadata.xml
new file mode 100644
index 000000000000..def1d63fae27
--- /dev/null
+++ b/dev-scheme/slib/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>scheme@gentoo.org</email>
+ <name>Gentoo Scheme Project</name>
+ </maintainer>
+ <longdescription lang="en">
+SLIB is a portable scheme library meant to provide compatibiliy and
+utility functions for all standard scheme implementations.
+ </longdescription>
+ <use>
+ <flag name="scm">Support for scm scheme implementation</flag>
+ <flag name="gambit">Support for gambit scheme implementation</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-scheme/slib/slib-3.2.1.ebuild b/dev-scheme/slib/slib-3.2.1.ebuild
new file mode 100644
index 000000000000..318985c33d5b
--- /dev/null
+++ b/dev-scheme/slib/slib-3.2.1.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit versionator eutils
+
+#version magic thanks to masterdriverz and UberLord using bash array instead of tr
+trarr="0abcdefghi"
+MY_PV="$(get_version_component_range 1)${trarr:$(get_version_component_range 2):1}$(get_version_component_range 3)"
+
+MY_P=${PN}-${MY_PV}
+S=${WORKDIR}/${PN}
+DESCRIPTION="library providing functions for Scheme implementations"
+SRC_URI="http://swiss.csail.mit.edu/ftpdir/scm/${MY_P}.zip"
+
+HOMEPAGE="http://swiss.csail.mit.edu/~jaffer/SLIB"
+
+SLOT="0"
+LICENSE="public-domain BSD"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~sparc ~x86"
+IUSE="" #test"
+
+#unzip for unpacking
+RDEPEND=""
+DEPEND="app-arch/unzip"
+# test? ( dev-scheme/scm )"
+
+INSTALL_DIR="/usr/share/slib/"
+
+src_unpack() {
+ unpack ${A}; cd "${S}"
+
+# cp Makefile Makefile.old
+
+ sed "s:prefix = /usr/local/:prefix = ${D}/usr/:" -i Makefile
+ sed 's:libdir = $(exec_prefix)lib/:libdir = $(exec_prefix)share/:' -i Makefile
+ sed 's:man1dir = $(prefix)man/:man1dir = $(prefix)/share/man/:' -i Makefile
+ sed 's:infodir = $(prefix)info/:infodir = $(prefix)share/info/:' -i Makefile
+
+ sed 's:echo SCHEME_LIBRARY_PATH=$(libslibdir) >> $(bindir)slib:echo SCHEME_LIBRARY_PATH=/usr/share/slib/ >> $(bindir)slib:' -i Makefile
+
+# diff -u Makefile.old Makefile
+
+ sed 's:(lambda () "/usr/local/share/gambc/")):(lambda () "/usr/share/gambit")):' -i gambit.init
+}
+
+src_compile() {
+ emake || die "make failed"
+}
+
+#slib needs scm for tests, but scm needs slib so we can't depend on it
+src_test() {
+ if has_version dev-scheme/scm; then
+ make test || die "Make test failed. See above for details."
+ else
+ einfo "Skipping test, because dev-scheme/scm is not installed."
+ fi
+}
+
+src_install() {
+ emake infoz || die "infoz failed"
+ emake install || die "install failed"
+
+ dodoc ANNOUNCE ChangeLog FAQ README
+ dodir /usr/share/gambit/
+ more_install
+}
+
+more_install() {
+ dosym ${INSTALL_DIR} /usr/share/guile/slib # link from guile dir
+ dosym ${INSTALL_DIR} /usr/lib/slib
+ dodir /etc/env.d/ && echo "SCHEME_LIBRARY_PATH=\"${INSTALL_DIR}\"" > "${D}"/etc/env.d/50slib
+
+ mkdir "${S}"/installers
+ pushd installers; make_installers; popd
+ dosbin installers/*
+}
+
+pkg_postinst() {
+ [ "${ROOT}" == "/" ] && pkg_config
+}
+
+IMPLEMENTATIONS="bigloo drscheme elk gambit guile scm" # mit-scheme
+
+pkg_config() {
+ for impl in ${IMPLEMENTATIONS}; do
+ install_slib ${impl}
+# echo '(slib:report-version)' | slib ${impl}
+ done
+}
+
+make_load_expression() {
+ echo "(load \\\"${INSTALL_DIR}$1.init\\\")"
+}
+
+make_installers()
+{
+ PROGRAM="(require 'new-catalog) (slib:report-version)"
+
+ bigloo_install_command="bigloo -s -eval \"(begin "$(make_load_expression bigloo)" ${PROGRAM} (exit))\""
+ drscheme_install_command="mzscheme -vme \"(begin $(make_load_expression mzscheme) ${PROGRAM})\""
+ elk_install_command="echo \"$(make_load_expression elk) ${PROGRAM}\" | elk -l -"
+ gambit_install_command="gambit-interpreter -e \"$(make_load_expression gambit) ${PROGRAM}\""
+# guile_install_command="guile -c \"$(make_load_expression guile) ${PROGRAM}\""
+ guile_install_command="guile -c \"(use-modules (ice-9 slib)) ${PROGRAM}\""
+ #variable names may not contain hyphens (-)
+ mitscheme_install_command="echo \"(set! load/suppress-loading-message? #t) $(make_load_expression mitscheme) ${PROGRAM}\" | mit-scheme --batch-mode"
+ echo ${mitscheme_install_command}
+ scm_install_command="scm -e \"${PROGRAM}\""
+
+ for impl in ${IMPLEMENTATIONS}; do
+ command_var=${impl//-/}_install_command
+ make_installer ${impl} "${!command_var}"
+ done
+}
+
+make_installer() {
+ echo $2 > install_slib_for_${1//-/}
+}
+
+install_slib() {
+ if has_version dev-scheme/$1; then
+ script=install_slib_for_${1//-/}
+ einfo "Registering slib with $1..."
+# echo running: $(cat /usr/sbin/${script})
+ $script
+ else
+ einfo "$1 not installed, not registering..."
+ fi
+}
diff --git a/dev-scheme/slib/slib-3.2.2.ebuild b/dev-scheme/slib/slib-3.2.2.ebuild
new file mode 100644
index 000000000000..58e87bf28255
--- /dev/null
+++ b/dev-scheme/slib/slib-3.2.2.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="3"
+
+inherit versionator eutils
+
+#version magic thanks to masterdriverz and UberLord using bash array instead of tr
+trarr="0abcdefghi"
+MY_PV="$(get_version_component_range 1)${trarr:$(get_version_component_range 2):1}$(get_version_component_range 3)"
+
+MY_P=${PN}-${MY_PV}
+S=${WORKDIR}/${PN}
+DESCRIPTION="library providing functions for Scheme implementations"
+SRC_URI="http://swiss.csail.mit.edu/ftpdir/scm/${MY_P}.zip"
+
+HOMEPAGE="http://swiss.csail.mit.edu/~jaffer/SLIB"
+
+SLOT="0"
+LICENSE="public-domain BSD"
+KEYWORDS="alpha amd64 ia64 ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
+IUSE="" #test"
+
+#unzip for unpacking
+RDEPEND=""
+DEPEND="app-arch/unzip"
+# test? ( dev-scheme/scm )"
+
+INSTALL_DIR="/usr/share/slib/"
+
+_fix_txi_file() {
+ local inplace_filename="${1}"
+ local tempfile="$(emktemp)"
+ awk -f "${FILESDIR}"/slib-3.2.2-fix-texinfo.awk < "${inplace_filename}" > "${tempfile}"
+ mv "${tempfile}" "${inplace_filename}" || die
+}
+
+src_prepare() {
+ sed "s:prefix = /usr/local/:prefix = ${ED}/usr/:" -i Makefile || die
+ sed 's:libdir = $(exec_prefix)lib/:libdir = $(exec_prefix)share/:' -i Makefile || die
+ sed 's:man1dir = $(prefix)man/:man1dir = $(prefix)/share/man/:' -i Makefile || die
+ sed 's:infodir = $(prefix)info/:infodir = $(prefix)share/info/:' -i Makefile || die
+
+ sed 's:echo SCHEME_LIBRARY_PATH=$(libslibdir) >> $(bindir)slib:echo SCHEME_LIBRARY_PATH='"${EPREFIX}"'/usr/share/slib/ >> $(bindir)slib:' -i Makefile || die
+
+# diff -u Makefile.old Makefile
+
+ sed 's:(lambda () "/usr/local/share/gambc/")):(lambda () "'"${EPREFIX}"'/usr/share/gambit")):' -i gambit.init || die
+
+ einfo "Fixing Texinfo files..."
+ for i in *.txi *.texi ; do
+ _fix_txi_file "${i}" || die
+ done
+}
+
+src_compile() {
+ emake || die "make failed"
+}
+
+src_install() {
+ emake infoz || die "infoz failed"
+ emake install || die "install failed"
+
+ dodoc ANNOUNCE ChangeLog FAQ README || die
+ dodir /usr/share/gambit/
+ more_install
+}
+
+more_install() {
+ dosym ${INSTALL_DIR} /usr/share/guile/slib # link from guile dir
+ dosym ${INSTALL_DIR} /usr/lib/slib
+ dodir /etc/env.d/ && echo "SCHEME_LIBRARY_PATH=\"${EPREFIX}${INSTALL_DIR}\"" > "${ED}"/etc/env.d/50slib
+
+ mkdir "${S}"/installers
+ pushd installers; make_installers; popd
+ dosbin installers/* || die
+}
+
+pkg_postinst() {
+ [ "${ROOT}" == "/" ] && pkg_config
+}
+
+IMPLEMENTATIONS="bigloo drscheme elk gambit guile scm" # mit-scheme
+
+pkg_config() {
+ for impl in ${IMPLEMENTATIONS}; do
+ install_slib ${impl}
+# echo '(slib:report-version)' | slib ${impl}
+ done
+}
+
+make_load_expression() {
+ echo "(load \\\"${EPREFIX}${INSTALL_DIR}$1.init\\\")"
+}
+
+make_installers()
+{
+ PROGRAM="(require 'new-catalog) (slib:report-version)"
+
+ bigloo_install_command="bigloo -s -eval \"(begin "$(make_load_expression bigloo)" ${PROGRAM} (exit))\""
+ drscheme_install_command="mzscheme -vme \"(begin $(make_load_expression mzscheme) ${PROGRAM})\""
+ elk_install_command="echo \"$(make_load_expression elk) ${PROGRAM}\" | elk -l -"
+ gambit_install_command="gambit-interpreter -e \"$(make_load_expression gambit) ${PROGRAM}\""
+# guile_install_command="guile -c \"$(make_load_expression guile) ${PROGRAM}\""
+ guile_install_command="guile -c \"(use-modules (ice-9 slib)) ${PROGRAM}\""
+ #variable names may not contain hyphens (-)
+ mitscheme_install_command="echo \"(set! load/suppress-loading-message? #t) $(make_load_expression mitscheme) ${PROGRAM}\" | mit-scheme --batch-mode"
+ echo ${mitscheme_install_command}
+ scm_install_command="scm -e \"${PROGRAM}\""
+
+ for impl in ${IMPLEMENTATIONS}; do
+ command_var=${impl//-/}_install_command
+ make_installer ${impl} "${!command_var}"
+ done
+}
+
+make_installer() {
+ echo $2 > install_slib_for_${1//-/}
+}
+
+install_slib() {
+ if has_version dev-scheme/$1; then
+ script=install_slib_for_${1//-/}
+ einfo "Registering slib with $1..."
+# echo running: $(cat "${EPREFIX}"/usr/sbin/${script})
+ $script
+ else
+ einfo "$1 not installed, not registering..."
+ fi
+}
diff --git a/dev-scheme/slib/slib-3.2.5-r1.ebuild b/dev-scheme/slib/slib-3.2.5-r1.ebuild
new file mode 100644
index 000000000000..fc19b1b316e7
--- /dev/null
+++ b/dev-scheme/slib/slib-3.2.5-r1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit versionator
+
+#version magic thanks to masterdriverz and UberLord using bash array instead of tr
+trarr="0abcdefghi"
+MY_PV="$(get_version_component_range 1)${trarr:$(get_version_component_range 2):1}$(get_version_component_range 3)"
+
+DESCRIPTION="Portable Scheme library for all standard Scheme implementations"
+HOMEPAGE="http://people.csail.mit.edu/jaffer/SLIB"
+SRC_URI="http://swiss.csail.mit.edu/ftpdir/scm/${PN}-${MY_PV}.tar.gz"
+
+RESTRICT="mirror"
+
+LICENSE="public-domain BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
+IUSE="gambit scm"
+
+RDEPEND="
+ >=sys-apps/texinfo-5.0
+ >=dev-scheme/guile-1.8.8:=
+ gambit? ( dev-scheme/gambit )
+ scm? ( dev-scheme/scm )"
+DEPEND="${RDEPEND}"
+
+DOCS=( ANNOUNCE COPYING FAQ README ChangeLog slib.{txt,html} )
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-paths.patch"
+ "${FILESDIR}/${P}-fix-makefile-guile.patch"
+)
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+src_configure() {
+ ./configure \
+ --prefix=/usr \
+ --libdir=/usr/share || die
+}
+
+src_compile() {
+ default
+
+ makeinfo -o slib.txt --plaintext --force slib.texi || die
+ makeinfo -o slib.html --html --no-split --force slib.texi || die
+}
+
+src_install() {
+ # core
+ dodir /usr/share/${PN}
+ insinto /usr/share/${PN}
+ doins *.{dat,init,ps,scm,sh}
+
+ # permissions
+ local i
+ for i in "${ED%/}"/usr/share/${PN}/*.sh ; do
+ fperms +x /usr/share/${PN}/$(basename "$i")
+ done
+
+ # bin
+ dodir /usr/bin/
+ dosym /usr/share/${PN}/${PN}.sh /usr/bin/${PN}
+
+ # env
+ doenvd "${FILESDIR}/50slib"
+
+ # docs
+ doinfo slib.info
+ doman slib.1
+
+ # guile
+ if has_version '=dev-scheme/guile-2.0*'; then
+ dodir /usr/share/guile/2.0
+ dosym /usr/share/${PN}/ /usr/share/guile/2.0/${PN}
+ else
+ dodir /usr/share/guile/1.8
+ dosym /usr/share/${PN}/ /usr/share/guile/1.8/${PN}
+ fi
+
+ # backwards compatibility
+ dodir /usr/lib/
+ dosym /usr/share/${PN}/ /usr/lib/${PN}
+}
+
+_new_catalog() {
+ if [[ ! "$1" =~ ^(guile|scm)$ ]]; then
+ echo -n "(load \"${ROOT}/usr/share/slib/$1.init\")" || die
+ fi
+ echo " (require 'new-catalog) (slib:report-version)" || die
+}
+
+pkg_postinst() {
+ local SCHEME_LIBRARY_PATH=/usr/share/slib/
+
+ # catalogs
+ einfo "Updating implementation catalogs.."
+ guile -c "(use-modules (ice-9 slib)) $(_new_catalog guile)" |& grep -i '^slib' || die
+
+ # broken as for now
+ # if use elk ; then
+ # echo "$(_new_catalog elk)" | elk -l -
+ # fi
+
+ if use gambit ; then
+ gsi -e "$(_new_catalog gambit)" || die
+ fi
+
+ if use scm ; then
+ scm -e "$(_new_catalog scm)" || die
+ fi
+}
+
+pkg_postrm() {
+ for impl in 'guile/*' gambc scm; do
+ rm -f "${ROOT}/usr/"lib*/${impl}/slibcat \
+ "${ROOT}/usr/share/"${impl}/slibcat || die
+ done
+}