Skip to content

Commit

Permalink
dev-scheme/gauche: new upstream release
Browse files Browse the repository at this point in the history
Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Akinori Hattori <[email protected]>
  • Loading branch information
hattya committed Jan 26, 2021
1 parent f82ee55 commit 63c1a2e
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-scheme/gauche/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST Gauche-0.9.10.tgz 7701616 BLAKE2B ecffc8cbffdbbea53a52468bcc190c57eede51ade78ccafd323299458f333794cc613bbfa11090d261993908020ccf8d42c2142da5996e1e55188f28e03cc28b SHA512 f014ec00903fc91b90da8dbdaace04a64d12695c631e923d5cdca3574aaf6701374f5adbed20c395881b047bb5a448352614d4ce7f16b6e38f69382bf8e66ed0
DIST Gauche-0.9.9.tgz 7244347 BLAKE2B 843fe0c7341c7020ad9130edfc41f02eeda0bc2e1f8983f83faf443f69073e132a9a2f37e6a6260334ab9aacc3e976a2df68d4c43f17f6ea07531c14e783efec SHA512 ff6fdc80bd14c4a5dc57b5a6ac9558078a557cd30c2efe98146c3817a7830ef2b3f5bb6184ce6b8ac9b1b9cb636f041643fa761b2f99e6dd0602e13e7928e210
56 changes: 56 additions & 0 deletions dev-scheme/gauche/files/gauche-0.9.10-srfi-134.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
commit 8582c68d127b0127f15e1a7f74265e3c0e9f3d87
Author: Shiro Kawai <[email protected]>
Date: Tue Dec 22 10:34:09 2020 -1000

Incorporate upstream fixes

https://github.com/scheme-requests-for-implementation/srfi-134/commit/2bfd4b585c8140c25f4fdd9adef84ab3ceca67b3

diff --git a/lib/data/ideque.scm b/lib/data/ideque.scm
index 484ca52b4..e4894e2d0 100644
--- a/lib/data/ideque.scm
+++ b/lib/data/ideque.scm
@@ -231,12 +231,12 @@
(define (%ideque-drop dq n) ; n is within the range
(match-let1 ($ <ideque> lenf f lenr r) dq
(if (<= n lenf)
- (check n (drop f n) lenr r)
+ (check (- lenf n) (drop f n) lenr r)
(let1 lenr. (- lenr (- n lenf))
(check 0 '() lenr. (take r lenr.))))))

(define (%check-length dq n)
- (unless (<= 0 n (- (ideque-length dq) 1))
+ (unless (<= 0 n (ideque-length dq))
(error "argument is out of range:" n)))

;; API [srfi-134]
diff --git a/test/include/ideque-tests.scm b/test/include/ideque-tests.scm
index 63f3f73a0..5e4c9e023 100644
--- a/test/include/ideque-tests.scm
+++ b/test/include/ideque-tests.scm
@@ -50,6 +50,12 @@
(test-assert (ideque-empty? (ideque-remove-back (ideque 1))))
(test 0 (ideque-front (ideque-add-front (ideque 1 2 3) 0)))
(test 0 (ideque-back (ideque-add-back (ideque 1 2 3) 0)))
+ ;; loss of front ideque
+ (let ((id (ideque #f #f #f #f #f #f #f #f #f #f #f #f #f #f #f #f #f #f)))
+ (set! id (ideque-remove-front (ideque-add-back id 1)))
+ (set! id (ideque-remove-front (ideque-add-back id 1)))
+ (set! id (ideque-remove-front (ideque-add-back id 1)))
+ (test #f (ideque-front (ideque-take-right id 12))))
)

(test-group "ideque/other-accessors"
@@ -63,7 +69,11 @@
(map ideque->list xs))))
lis)))
(check 'ideque-take ideque-take take 7)
+ (test '(1 2 3 4) (ideque->list (ideque-take (ideque 1 2 3 4) 4)))
+ (test '(1 2 3 4) (ideque->list (ideque-take-right (ideque 1 2 3 4) 4)))
(check 'ideque-drop ideque-drop drop 6)
+ (test '() (ideque->list (ideque-drop (ideque 1 2 3 4) 4)))
+ (test '() (ideque->list (ideque-drop-right (ideque 1 2 3 4) 4)))
(check 'ideque-split-at ideque-split-at split-at 8)
;; out-of-range conditions
(test-error (ideque->list (ideque-take (ideque 1 2 3 4 5 6 7) 10)))
27 changes: 27 additions & 0 deletions dev-scheme/gauche/files/gauche-0.9.10-sys-ctermid.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
commit f3b4beb18f256e733a4c699e96118d47a2191b74
Author: Shiro Kawai <[email protected]>
Date: Wed Dec 23 16:22:10 2020 -1000

Fix sys-ctermid out-of-extent memory access bug

https://github.com/shirok/Gauche/issues/740

diff --git a/src/libsys.scm b/src/libsys.scm
index f253c08a4..7f433c184 100644
--- a/src/libsys.scm
+++ b/src/libsys.scm
@@ -460,11 +460,11 @@
(define-cproc sys-mkdtemp (template::<string>) Scm_SysMkdtemp)

;; ctermid
-(define-cproc sys-ctermid () ::<const-cstring>
+(define-cproc sys-ctermid ()
(.if "defined(GAUCHE_WINDOWS)"
- (return "CON")
+ (return '"CON")
(let* ([buf::(.array char [(+ L_ctermid 1)])])
- (return (ctermid buf)))))
+ (return (SCM_MAKE_STR_COPYING (ctermid buf))))))

;;---------------------------------------------------------------------
;; stdlib.h
31 changes: 31 additions & 0 deletions dev-scheme/gauche/files/gauche-xz-info.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- a/lib/gauche/interactive/info.scm
+++ b/lib/gauche/interactive/info.scm
@@ -113,7 +113,8 @@
:paths (get-info-paths)
:pred (^p (or (file-is-readable? p)
(file-is-readable? #"~|p|.gz")
- (file-is-readable? #"~|p|.bz2")))))
+ (file-is-readable? #"~|p|.bz2")
+ (file-is-readable? #"~|p|.xz")))))

(define (handle-ambiguous-name entry-name)
(let* ([keys (map x->string (hash-table-keys (~ (get-info)'index)))]
--- a/lib/text/info.scm
+++ b/lib/text/info.scm
@@ -67,6 +67,7 @@

;; Find bzip2 location
(define bzip2 (find-file-in-paths "bzip2"))
+(define xz (find-file-in-paths "xz"))

(cond-expand
[gauche.sys.zlib]
@@ -90,6 +91,8 @@
(with-input-from-process #"~gzip -c -d ~|file|.gz" thunk)])]
[(and bzip2 (file-exists? #"~|file|.bz2"))
(with-input-from-process #"~bzip2 -c -d ~|file|.bz2" thunk)]
+ [(and xz (file-exists? #"~|file|.xz"))
+ (with-input-from-process #"~xz -c -d ~|file|.xz" thunk)]
[else (error "can't find info file" file)]))
(with-input-from-info
(^[]
63 changes: 63 additions & 0 deletions dev-scheme/gauche/gauche-0.9.10.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"

inherit autotools

MY_P="${P^g}"

DESCRIPTION="A Unix system friendly Scheme Interpreter"
HOMEPAGE="http://practical-scheme.net/gauche/"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz"

LICENSE="BSD"
SLOT="0/$(ver_cut 1-2)7"
KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="ipv6 libressl mbedtls test"
RESTRICT="!test? ( test )"

RDEPEND="sys-libs/gdbm
mbedtls? ( net-libs/mbedtls:= )"
DEPEND="${RDEPEND}
test? (
!libressl? ( dev-libs/openssl:0 )
libressl? ( dev-libs/libressl:0 )
)"
S="${WORKDIR}/${MY_P}"

PATCHES=(
"${FILESDIR}"/${PN}-ext-ldflags.patch
"${FILESDIR}"/${PN}-gauche.m4.patch
"${FILESDIR}"/${PN}-info.patch
"${FILESDIR}"/${PN}-rfc.tls.patch
"${FILESDIR}"/${PN}-xz-info.patch
"${FILESDIR}"/${P}-srfi-134.patch
"${FILESDIR}"/${P}-sys-ctermid.patch
)
DOCS=( AUTHORS ChangeLog HACKING.adoc README.adoc )

src_prepare() {
default
use ipv6 && sed -i "s/ -4//" ext/tls/ssltest-mod.scm

eautoconf
}

src_configure() {
econf \
$(use_enable ipv6) \
--with-ca-bundle="${EPREFIX}"/etc/ssl/certs/ca-certificates.crt \
--with-libatomic-ops=no \
--with-slib="${EPREFIX}"/usr/share/slib \
--with-tls=axtls$(usex mbedtls ',mbedtls' '')
}

src_test() {
emake -j1 -s check
}

src_install() {
emake DESTDIR="${D}" install-pkg install-doc
einstalldocs
}

0 comments on commit 63c1a2e

Please sign in to comment.