summaryrefslogtreecommitdiff
path: root/dev-scheme/c-wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'dev-scheme/c-wrapper')
-rw-r--r--dev-scheme/c-wrapper/Manifest7
-rw-r--r--dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild45
-rw-r--r--dev-scheme/c-wrapper/files/c-wrapper-closure.patch10
-rw-r--r--dev-scheme/c-wrapper/files/c-wrapper-gcc-5.patch45
-rw-r--r--dev-scheme/c-wrapper/files/c-wrapper-gentoo.patch51
-rw-r--r--dev-scheme/c-wrapper/files/c-wrapper-glibc-2.25.patch13
-rw-r--r--dev-scheme/c-wrapper/metadata.xml8
7 files changed, 179 insertions, 0 deletions
diff --git a/dev-scheme/c-wrapper/Manifest b/dev-scheme/c-wrapper/Manifest
new file mode 100644
index 000000000000..60192b34c424
--- /dev/null
+++ b/dev-scheme/c-wrapper/Manifest
@@ -0,0 +1,7 @@
+AUX c-wrapper-closure.patch 205 BLAKE2B b633bbf97b3d76ab58b9a332ddc56f976b54f9eb3df0b235e7784e27141dda051e5d637839bf3be49c580845ad6898d9d526169abb14e6329642105dd5416c11 SHA512 284f08b6a8164d129dfe5e26500ca4946c037d0661614dfcab7caf4d5ce189ee299dbb70fa6a4d0f2ec5b0fdf9f1926891d07ce019fade329a0909c10586c790
+AUX c-wrapper-gcc-5.patch 1883 BLAKE2B 089f5b8427b13ff6ca8d9c9b5181724f691bfbf58cfd84b365a5cdc36efc9ea2582e973887d4da30e2ce52a91e5a1d0a6d9461a7b4d31b886c699e7805827969 SHA512 9c6d588f9246f5e80e1639ecadb0b4e1be1a1fe85ba4163592fa74dfec30dca2c61934d072f880fb031aad506387e463a8d399058ad45934bd4c7b16289bef07
+AUX c-wrapper-gentoo.patch 2015 BLAKE2B fedf622537151079df07aaa1091fe377b1e1ee8ebf95a4c8b290ca983376211e6897ddb14c8d3c8f38fc1a23073d5282c447b8e8d66578235b17bb3cddce76f1 SHA512 4184d3a4953478ff19374ff230bd7376eb8a8d7d90e1e91b1903b30af49f124d18b816639024a9b54a7099965ea2c5c8244ca64a7ce4db8f3fde32cbc13578d3
+AUX c-wrapper-glibc-2.25.patch 727 BLAKE2B 0c0dce0bfb78a92ff4c2cf6176a7b7de129e143737be897a074f06f88b6923915ec36a9e3ddb5410010c662e8e11bb17b89742349c2a01a3066c1c49c08cc57a SHA512 769c92156395f121d8ba3776904c279c5b97f791f7606b74c682264430ed71f1af31ce8655286cae7dfebb75ea8addc2fb304a87eb5972314c5ab082700921ee
+DIST c-wrapper-0.6.1.tgz 843981 BLAKE2B af28cf60eebe0da32c90c030bfdae4457d20731c31220f7eaac33291ea1be104a7aab11fad0560fe6e3d36a5d3afafbd8795fddd633e0c26be226c29012afbc9 SHA512 a03a4d57d112d2c23dac3716bae081e3e6f02dcef261bd8dd518ed8519b43e28f9e61a36f7584b2bcb1762112c128d0b698cda422cc0c9d1190cbf7502ea04b0
+EBUILD c-wrapper-0.6.1-r1.ebuild 834 BLAKE2B beeabb062993090ba0d462be5302682b28d1b8e9ac985fdaa4a5a225627eaa6930d3385d2bde19b5103ae1e51ca1a799f2f455c562e0b4ee5ec875c30ad0733f SHA512 067e958eee7fa751a79e8fd38cd57094fd212762966f4ba68a0e9ae5ede7ab4eaa2629941f57c01d464df3638f6386e567ff0097120148ccdba0ca095d750c5a
+MISC metadata.xml 248 BLAKE2B e581d975884f924f92f81a803547379276565617c24d86f893c0186a4793c1167a36cbd8083261a10ce99839b9e5b5dd29f237bebb644eaef29ced562c9c6310 SHA512 62ab121be05f0603fe52b26ac612943b049bc527ff73401e6ed427622fcfd7f07cf3fabae90ac9e30297692ec4188b1a8bdc1f9104e30d6ed4032a96ffd77cf2
diff --git a/dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild b/dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild
new file mode 100644
index 000000000000..cd0348a0133a
--- /dev/null
+++ b/dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit autotools
+
+DESCRIPTION="Foreign function interface for C and Objective-C libraries"
+HOMEPAGE="http://www.koguro.net/prog/c-wrapper/"
+SRC_URI="http://www.koguro.net/prog/${PN}/${P}.tgz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 x86"
+IUSE="examples"
+
+RDEPEND="dev-scheme/gauche
+ virtual/libffi"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-closure.patch
+ "${FILESDIR}"/${PN}-gcc-5.patch
+ "${FILESDIR}"/${PN}-gentoo.patch
+ "${FILESDIR}"/${PN}-glibc-2.25.patch
+)
+HTML_DOCS=( doc/${PN}-ref{e,j}.html )
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_test() {
+ emake -j1 -s check
+}
+
+src_install() {
+ default
+
+ if use examples; then
+ docompress -x /usr/share/doc/${PF}/examples
+ dodoc -r examples
+ fi
+}
diff --git a/dev-scheme/c-wrapper/files/c-wrapper-closure.patch b/dev-scheme/c-wrapper/files/c-wrapper-closure.patch
new file mode 100644
index 000000000000..24be1d052fd7
--- /dev/null
+++ b/dev-scheme/c-wrapper/files/c-wrapper-closure.patch
@@ -0,0 +1,10 @@
+--- a/src/closure_alloc.c
++++ b/src/closure_alloc.c
+@@ -100,6 +100,7 @@
+ ++(node->n);
+ return;
+ }
++ node = node->next;
+ }
+
+ node = malloc(sizeof(FreeNode));
diff --git a/dev-scheme/c-wrapper/files/c-wrapper-gcc-5.patch b/dev-scheme/c-wrapper/files/c-wrapper-gcc-5.patch
new file mode 100644
index 000000000000..091b1e2da105
--- /dev/null
+++ b/dev-scheme/c-wrapper/files/c-wrapper-gcc-5.patch
@@ -0,0 +1,45 @@
+--- a/src/c-parser.c
++++ b/src/c-parser.c
+@@ -1668,6 +1668,7 @@
+ {
+ static ScmObj trigger_line = SCM_FALSE;
+ ScmObj line_str;
++ ScmObj regexp = Scm_RegComp(SCM_STRING(SCM_MAKE_STR_IMMUTABLE("^#\\s+\\d+\\s+\"<stdin>\"")), 0);
+
+ /* skip the first line '# 1 "<stdin>"' */
+ Scm_ReadLineUnsafe(SCM_PORT(in));
+@@ -1682,16 +1683,26 @@
+ }
+ }
+
+- while (!SCM_EOFP(line_str = Scm_ReadLineUnsafe(SCM_PORT(in)))) {
+- if (SCM_NULLP(macro_list)) {
++ line_str = SCM_NIL;
++ while (!SCM_NULLP(macro_list)) {
++ ScmObj body_str = line_str;
++ if (SCM_NULLP(body_str)
++ && SCM_EOFP(body_str = Scm_ReadLineUnsafe(SCM_PORT(in)))) {
+ Scm_Error("[bug] lost macro body");
+- } else {
+- ScmObj pos_name_args = SCM_CDAR(macro_list);
+- macro_list = SCM_CDR(macro_list);
+- Scm_FilenameSet(SCM_CAAR(pos_name_args));
+- Scm_LineNumberSet(SCM_INT_VALUE(SCM_CDAR(pos_name_args)));
+- parse_macro_body(SCM_CADR(pos_name_args), SCM_CDDR(pos_name_args), line_str);
+ }
++ while (!SCM_EOFP(line_str = Scm_ReadLineUnsafe(SCM_PORT(in)))
++ && SCM_REGMATCHP(Scm_RegExec(SCM_REGEXP(regexp), SCM_STRING(line_str)))) {
++ if (SCM_EOFP(line_str = Scm_ReadLineUnsafe(SCM_PORT(in)))) {
++ Scm_Error("[bug] unexpected EOF while parsing macro body");
++ }
++ body_str = Scm_StringAppend2(SCM_STRING(body_str), SCM_STRING(line_str));
++ line_str = SCM_NIL;
++ }
++ ScmObj pos_name_args = SCM_CDAR(macro_list);
++ macro_list = SCM_CDR(macro_list);
++ Scm_FilenameSet(SCM_CAAR(pos_name_args));
++ Scm_LineNumberSet(SCM_INT_VALUE(SCM_CDAR(pos_name_args)));
++ parse_macro_body(SCM_CADR(pos_name_args), SCM_CDDR(pos_name_args), body_str);
+ }
+
+ SCM_RETURN(SCM_UNDEFINED);
diff --git a/dev-scheme/c-wrapper/files/c-wrapper-gentoo.patch b/dev-scheme/c-wrapper/files/c-wrapper-gentoo.patch
new file mode 100644
index 000000000000..e94d55fa0d21
--- /dev/null
+++ b/dev-scheme/c-wrapper/files/c-wrapper-gentoo.patch
@@ -0,0 +1,51 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,6 +53,7 @@
+
+ dnl Check for libraries
+ dnl Add your macro calls to check required libraries, if you have any.
++PKG_CHECK_MODULES([FFI], [libffi])
+
+ dnl Platform-dependent configuration.
+ AC_ARG_ENABLE(objc, [ --enable-objc turn on Objective-C support])
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -20,9 +20,10 @@
+ GAUCHE_PACKAGE = @GAUCHE_PACKAGE@
+ INSTALL = @GAUCHE_INSTALL@
+
+-CPPFLAGS = -I./libffi/include -DGAUCHE_API_0_8_8 @CPPFLAGS@
++CPPFLAGS = -DGAUCHE_API_0_8_8 @FFI_CFLAGS@ @CPPFLAGS@
++CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+-LIBS = libffi/.libs/libffi.a @LIBS@
++LIBS = @FFI_LIBS@ @LIBS@
+
+ YACC = @YACC@
+
+@@ -38,7 +39,7 @@
+ SCMFILES =
+ HEADERS =
+
+-TARGET = libffi/.libs/libffi.a $(ARCHFILES)
++TARGET = $(ARCHFILES)
+ GENERATED = libffi
+ CONFIG_GENERATED = libffi/Makefile Makefile cwcompile
+
+@@ -62,13 +63,13 @@
+ cd libffi; $(MAKE)
+
+ c-ffi.$(SOEXT): $(ffi_SRCS)
+- $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS)" --verbose c-ffi $(ffi_SRCS)
++ $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --cflags="$(CFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS)" --verbose c-ffi $(ffi_SRCS)
+
+ c-lex.$(SOEXT): $(clex_SRCS)
+- $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS)" --verbose c-lex $(clex_SRCS)
++ $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --cflags="$(CFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS)" --verbose c-lex $(clex_SRCS)
+
+ c-parser.$(SOEXT): $(cparser_SRCS) y.tab.c
+- $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS) $(cparser_LIBS)" --verbose c-parser $(cparser_SRCS)
++ $(GAUCHE_PACKAGE) compile --cppflags="$(CPPFLAGS)" --cflags="$(CFLAGS)" --ldflags="$(LDFLAGS)" --libs="$(LIBS) $(cparser_LIBS)" --verbose c-parser $(cparser_SRCS)
+
+ c-grammar.y: c-grammar.scm genyacc.scm
+ $(GOSH) genyacc.scm --outfile=c-grammar.y $<
diff --git a/dev-scheme/c-wrapper/files/c-wrapper-glibc-2.25.patch b/dev-scheme/c-wrapper/files/c-wrapper-glibc-2.25.patch
new file mode 100644
index 000000000000..0776b255bbac
--- /dev/null
+++ b/dev-scheme/c-wrapper/files/c-wrapper-glibc-2.25.patch
@@ -0,0 +1,13 @@
+--- a/lib/c-wrapper/c-parser.scm
++++ b/lib/c-wrapper/c-parser.scm
+@@ -1115,7 +1115,9 @@
+ (raise e))))
+ (call-with-gcc-io include-dirs headers options
+ (lambda (in out)
+- (let ((macro-list (queue->list (macro-queue))))
++ (let ((macro-list (filter (lambda (m)
++ (not (string-prefix? "__glibc_macro_warning" (car m))))
++ (queue->list (macro-queue)))))
+ (for-each (lambda (macro-def)
+ (display (car macro-def) out)
+ (newline out))
diff --git a/dev-scheme/c-wrapper/metadata.xml b/dev-scheme/c-wrapper/metadata.xml
new file mode 100644
index 000000000000..7ffc4339bc56
--- /dev/null
+++ b/dev-scheme/c-wrapper/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>hattya@gentoo.org</email>
+ <name>Akinori Hattori</name>
+ </maintainer>
+</pkgmetadata>