Gentoo Archives: gentoo-commits

From: Akinori Hattori <hattya@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-scheme/gauche/, dev-scheme/gauche/files/
Date: Tue, 29 Nov 2016 10:19:18
Message-Id: 1480414638.5d11e566d57fd1102c27a9a7628a6d5b788c050d.hattya@gentoo
1 commit: 5d11e566d57fd1102c27a9a7628a6d5b788c050d
2 Author: Akinori Hattori <hattya <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 29 10:17:18 2016 +0000
4 Commit: Akinori Hattori <hattya <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 29 10:17:18 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d11e566
7
8 dev-scheme/gauche: fix build
9
10 Gentoo-Bug: 600976
11
12 Package-Manager: portage-2.3.0
13
14 dev-scheme/gauche/files/gauche-0.9.5-main.patch | 116 ------------------------
15 dev-scheme/gauche/gauche-0.9.5.ebuild | 22 +++--
16 2 files changed, 12 insertions(+), 126 deletions(-)
17
18 diff --git a/dev-scheme/gauche/files/gauche-0.9.5-main.patch b/dev-scheme/gauche/files/gauche-0.9.5-main.patch
19 deleted file mode 100644
20 index 20f7070..00000000
21 --- a/dev-scheme/gauche/files/gauche-0.9.5-main.patch
22 +++ /dev/null
23 @@ -1,116 +0,0 @@
24 -commit 97196adb9dab30e7ab610daf4cc486bfc01ed403
25 -Author: Shiro Kawai <shiro@×××.org>
26 -Date: Mon Oct 17 11:00:44 2016 -1000
27 -
28 - Fix main.c to call 'main' proc properly
29 -
30 - https://github.com/shirok/Gauche/issues/244
31 -
32 -diff --git a/src/core.c b/src/core.c
33 -index 923d116..fc01211 100644
34 ---- a/src/core.c
35 -+++ b/src/core.c
36 -@@ -653,9 +653,14 @@ void Scm_SimpleMain(int argc, const char *argv[],
37 - ScmModule *user = Scm_UserModule();
38 - ScmObj mainproc = Scm_GlobalVariableRef(user, SCM_SYMBOL(SCM_INTERN("main")), 0);
39 - if (SCM_PROCEDUREP(mainproc)) {
40 -- ScmObj r = Scm_ApplyRec1(mainproc, args);
41 -- if (SCM_INTP(r)) Scm_Exit(SCM_INT_VALUE(r));
42 -- else Scm_Exit(70);
43 -+ static ScmObj run_main_proc = SCM_UNDEFINED;
44 -+ SCM_BIND_PROC(run_main_proc, "run-main", Scm_GaucheInternalModule());
45 -+ SCM_ASSERT(SCM_PROCEDUREP(run_main_proc));
46 -+
47 -+ ScmEvalPacket epak;
48 -+ int r = Scm_Apply(run_main_proc, SCM_LIST2(mainproc, args), &epak);
49 -+ SCM_ASSERT(r == 1 && SCM_INTP(epak.results[0]));
50 -+ Scm_Exit(SCM_INT_VALUE(epak.results[0]));
51 - } else {
52 - Scm_Exit(70);
53 - }
54 -diff --git a/src/libeval.scm b/src/libeval.scm
55 -index 2a2c1fc..279fd7f 100644
56 ---- a/src/libeval.scm
57 -+++ b/src/libeval.scm
58 -@@ -370,6 +370,17 @@
59 - (loop1)))))
60 -
61 - ;;;
62 -+;;; Kick 'main' procedure
63 -+;;; Returns an integer suitable for the exit code.
64 -+;;; This is mainly to display proper stack trace in case 'main'
65 -+;;; raises an error.
66 -+(select-module gauche.internal)
67 -+(define (run-main main args)
68 -+ (guard (e [else (report-error e) 70])
69 -+ (let1 r (main args)
70 -+ (if (fixnum? r) r 70))))
71 -+
72 -+;;;
73 - ;;; Macros
74 - ;;;
75 -
76 -diff --git a/src/main.c b/src/main.c
77 -index 46223a6..55660c9 100644
78 ---- a/src/main.c
79 -+++ b/src/main.c
80 -@@ -502,22 +502,14 @@ int execute_script(const char *scriptfile, ScmObj args)
81 - SCM_BINDING_STAY_IN_MODULE);
82 - }
83 - if (SCM_PROCEDUREP(mainproc)) {
84 --#if 0 /* Temporarily turned off due to the bug that loses stack traces. */
85 -+ static ScmObj run_main_proc = SCM_UNDEFINED;
86 -+ SCM_BIND_PROC(run_main_proc, "run-main", Scm_GaucheInternalModule());
87 -+ SCM_ASSERT(SCM_PROCEDUREP(run_main_proc));
88 -+
89 - ScmEvalPacket epak;
90 -- int r = Scm_Apply(mainproc, SCM_LIST1(args), &epak);
91 -- if (r > 0) {
92 -- ScmObj res = epak.results[0];
93 -- if (SCM_INTP(res)) return SCM_INT_VALUE(res);
94 -- else return 70; /* EX_SOFTWARE, see SRFI-22. */
95 -- } else {
96 -- Scm_ReportError(epak.exception);
97 -- return 70; /* EX_SOFTWARE, see SRFI-22. */
98 -- }
99 --#else
100 -- ScmObj r = Scm_ApplyRec1(mainproc, args);
101 -- if (SCM_INTP(r)) return SCM_INT_VALUE(r);
102 -- else return 70;
103 --#endif
104 -+ int r = Scm_Apply(run_main_proc, SCM_LIST2(mainproc, args), &epak);
105 -+ SCM_ASSERT(r == 1 && SCM_INTP(epak.results[0]));
106 -+ return SCM_INT_VALUE(epak.results[0]);
107 - }
108 - return 0;
109 - }
110 -diff --git a/test/scripts.scm b/test/scripts.scm
111 -index 44bb44b..4e6777b 100644
112 ---- a/test/scripts.scm
113 -+++ b/test/scripts.scm
114 -@@ -58,6 +58,25 @@
115 - (process-output->string '("./gosh" "-ftest" "test.o")))
116 - (delete-files "test.o")))
117 -
118 -+;; This caused assertion failure in 0.9.5, because 'main' was called
119 -+;; via Scm_ApplyRec without base VM running.
120 -+;; See https://github.com/shirok/Gauche/issues/244
121 -+(test* "proper error handling of 'main'" "ok"
122 -+ (unwind-protect
123 -+ (begin
124 -+ (delete-files "test.o")
125 -+ (with-output-to-file "test.o"
126 -+ (^[]
127 -+ (write
128 -+ '(use gauche.partcont))
129 -+ (write
130 -+ '(define (main args)
131 -+ (reset (shift k (call-with-input-file "gauche.h" k)))
132 -+ (print 'ok)
133 -+ 0))))
134 -+ (process-output->string '("./gosh" "-ftest" "test.o")))
135 -+ (delete-files "test.o")))
136 -+
137 - ;;=======================================================================
138 - (test-section "gauche-config")
139 -
140
141 diff --git a/dev-scheme/gauche/gauche-0.9.5.ebuild b/dev-scheme/gauche/gauche-0.9.5.ebuild
142 index 2e6fe55..b4bd7c8 100644
143 --- a/dev-scheme/gauche/gauche-0.9.5.ebuild
144 +++ b/dev-scheme/gauche/gauche-0.9.5.ebuild
145 @@ -25,17 +25,19 @@ DEPEND="${RDEPEND}
146 )"
147 S="${WORKDIR}/${MY_P}"
148
149 +PATCHES=(
150 + "${FILESDIR}"/${PN}-rpath.patch
151 + "${FILESDIR}"/${PN}-gauche.m4.patch
152 + "${FILESDIR}"/${PN}-ext-ldflags.patch
153 + "${FILESDIR}"/${PN}-xz-info.patch
154 + "${FILESDIR}"/${PN}-rfc.tls.patch
155 + "${FILESDIR}"/${P}-libressl.patch
156 + "${FILESDIR}"/${P}-bsd.patch
157 + "${FILESDIR}"/${P}-unicode.patch
158 +)
159 +
160 src_prepare() {
161 - epatch "${FILESDIR}"/${PN}-rpath.patch
162 - epatch "${FILESDIR}"/${PN}-gauche.m4.patch
163 - epatch "${FILESDIR}"/${PN}-ext-ldflags.patch
164 - epatch "${FILESDIR}"/${PN}-xz-info.patch
165 - epatch "${FILESDIR}"/${PN}-rfc.tls.patch
166 - epatch "${FILESDIR}"/${P}-libressl.patch
167 - epatch "${FILESDIR}"/${P}-bsd.patch
168 - epatch "${FILESDIR}"/${P}-main.patch
169 - epatch "${FILESDIR}"/${P}-unicode.patch
170 - eapply_user
171 + default
172
173 use ipv6 && sed -i "s/ -4//" ext/tls/ssltest-mod.scm