summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-12-29 10:49:28 +0000
committerSam James <sam@gentoo.org>2024-12-29 10:51:36 +0000
commita4cda180db47d0ef76d223f4ea66296eb5f18179 (patch)
tree6e804748e54bf8d4b06a3eb32ab22b4ad95605be /dev-scheme/guile-lib
parentmedia-libs/netpbm: update live ebuild (diff)
downloadgentoo-a4cda180db47d0ef76d223f4ea66296eb5f18179.tar.gz
gentoo-a4cda180db47d0ef76d223f4ea66296eb5f18179.tar.bz2
gentoo-a4cda180db47d0ef76d223f4ea66296eb5f18179.zip
dev-scheme/guile-lib: add 0.2.8.1
This includes Zack Weinberg's patch to fix tests w/ guile-3.0, which I've only applied for 3.0. But in the course of spending a while to get the ebuild working with two impls and only patching one, I found that 2-2 was clearly not cared for upstream anymore as I hit two different issues and one of them had an unreplied-to patch on the ML, so I gave up. Just declare compat w/ 3-0 and worry about older later for this version on the offchance someone requests it. Closes: https://bugs.gentoo.org/877785 Closes: https://bugs.gentoo.org/941404 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-scheme/guile-lib')
-rw-r--r--dev-scheme/guile-lib/Manifest1
-rw-r--r--dev-scheme/guile-lib/files/guile-lib-0.2.8.1-guile3-primes.patch26
-rw-r--r--dev-scheme/guile-lib/guile-lib-0.2.8.1.ebuild75
3 files changed, 102 insertions, 0 deletions
diff --git a/dev-scheme/guile-lib/Manifest b/dev-scheme/guile-lib/Manifest
index 79e0ca6f32e4..e8eeffb05288 100644
--- a/dev-scheme/guile-lib/Manifest
+++ b/dev-scheme/guile-lib/Manifest
@@ -1 +1,2 @@
DIST guile-lib-0.2.7.tar.gz 451202 BLAKE2B d8420a718697611443a40af089aad6e1d48390e5bef764f84955beeec8d6346066547d73c30898b96e727d4f470df6a032438067240bba8b25058bc65b85d9fa SHA512 d27d1398f81172e4488c5ac5c2d076baeeeaa12fa19d83a87faf0767c255b79f8eb24438950da3865e797299be90f7dc1dcc964076d53df9cab5925a61ad0d1f
+DIST guile-lib-0.2.8.1.tar.gz 461345 BLAKE2B 10fe6a3c93ffd09fd92ad43b7cdd5cf949e3f9f11ce2aebd3c28b5227345041ee4a15c8bf1bb26c5a12423fbde65e950707bd0f43ee5787e4fe2853c6c56f4f9 SHA512 655c559c19beb008016fb3f313184c0da83f6dad53987045648cdb84bbca05f839b1a31c3cd12727510f51511c7d248d16438d87113cf8e99134925a2ad64312
diff --git a/dev-scheme/guile-lib/files/guile-lib-0.2.8.1-guile3-primes.patch b/dev-scheme/guile-lib/files/guile-lib-0.2.8.1-guile3-primes.patch
new file mode 100644
index 000000000000..bca9dd1e80ca
--- /dev/null
+++ b/dev-scheme/guile-lib/files/guile-lib-0.2.8.1-guile3-primes.patch
@@ -0,0 +1,26 @@
+# Note that this patch requires >=guile-3, so we apply it conditionally.
+# https://lists.gnu.org/archive/html/guile-devel/2024-05/msg00012.html
+#
+# Fix compile and test failures due to bitvector API change.
+# https://bugs.gentoo.org/877785
+--- a/src/math/primes.scm 2024-05-23 19:26:16.757865343 -0400
++++ b/src/math/primes.scm 2024-05-23 19:28:20.797358650 -0400
+@@ -114,7 +114,7 @@
+ (set! prime:prime-sqr (* nexp nexp))
+ (set! prime:sieve (make-bitvector nexp #f))
+ (for-each (lambda (prime)
+- (bitvector-set! prime:sieve prime #t))
++ (bitvector-set-bit! prime:sieve prime))
+ primes)
+ (set! prime:products (reverse (cons comp comps))))
+ (else
+@@ -132,7 +132,7 @@
+ There is a slight chance, @code{(expt 2 (- prime:trials))}, that a
+ composite will return @code{#t}."
+ (set! n (abs n))
+- (cond ((< n (bitvector-length prime:sieve)) (bitvector-ref prime:sieve n))
++ (cond ((< n (bitvector-length prime:sieve)) (bitvector-bit-set? prime:sieve n))
+ ((even? n) #f)
+ ((primes-gcd? n prime:products) #f)
+ ((< n prime:prime-sqr) #t)
+
diff --git a/dev-scheme/guile-lib/guile-lib-0.2.8.1.ebuild b/dev-scheme/guile-lib/guile-lib-0.2.8.1.ebuild
new file mode 100644
index 000000000000..faa78a97f1a3
--- /dev/null
+++ b/dev-scheme/guile-lib/guile-lib-0.2.8.1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# 2-2 could be made to work but a few tests fail and nobody seems
+# to care about it (patches had no reply on ML).
+GUILE_COMPAT=( 3-0 )
+inherit guile
+
+DESCRIPTION="An accumulation place for pure-scheme Guile modules"
+HOMEPAGE="http://www.nongnu.org/guile-lib/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+REQUIRED_USE="${GUILE_REQUIRES_USE}"
+
+RDEPEND="${GUILE_DEPS}"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ guile_src_prepare
+ sed -i -e 's/"guile"/(getenv "GUILE")/' unit-tests/os.process.scm || die
+ guile_copy_sources
+
+ # Only apply this patch for 3.0 (bug #877785)
+ if use guile_targets_3-0 ; then
+ cd "${WORKDIR}"/${P}-3.0 || die
+ eapply "${FILESDIR}"/${PN}-0.2.8.1-guile3-primes.patch
+ fi
+}
+
+src_configure() {
+ _guile_configure() {
+ cd "${WORKDIR}"/${P}-${GUILE_CURRENT_VERSION} || die
+ ECONF_SOURCE="${WORKDIR}"/${P}-${GUILE_CURRENT_VERSION}
+ econf --with-guile-site=yes
+ }
+
+ guile_foreach_impl _guile_configure
+}
+
+src_compile() {
+ _guile_compile() {
+ cd "${WORKDIR}"/${P}-${GUILE_CURRENT_VERSION} || die
+ sed -i -e "s:exec guile:exec ${GUILE}:" doc/make-texinfo.scm || die
+ emake
+ }
+
+ guile_foreach_impl _guile_compile
+}
+
+src_test() {
+ _guile_test() {
+ cd "${WORKDIR}"/${P}-${GUILE_CURRENT_VERSION} || die
+ emake check
+ }
+
+ guile_foreach_impl _guile_test
+}
+
+src_install() {
+ _guile_install() {
+ cd "${WORKDIR}"/${P}-${GUILE_CURRENT_VERSION} || die
+ emake DESTDIR="${SLOTTED_D}" install
+ }
+
+ einstalldocs
+ guile_foreach_impl _guile_install
+ guile_merge_roots
+ guile_unstrip_ccache
+}