1 |
commit: 11f6c152a7176c8a835f4d781b50539c69a9ccbb |
2 |
Author: Marty E. Plummer <hanetzer <AT> protonmail <DOT> com> |
3 |
AuthorDate: Fri Jan 5 06:15:44 2018 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 8 16:35:20 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11f6c152 |
7 |
|
8 |
dev-libs/libyaml: fix dll build on mingw-w64. |
9 |
|
10 |
includes the following patches: |
11 |
|
12 |
https://github.com/yaml/libyaml/commit/119b7b6adfa72552d6dc7eb03f402ff5cf8f9fa6 |
13 |
https://github.com/yaml/libyaml/pull/85 |
14 |
|
15 |
Former is upstreamed, the latter is a pending PR. Without these changes a |
16 |
shared library/dll cannot be created on mingw-w64. Latter patch is applied also |
17 |
to the generated Makefile.in in order to prevent the need for eautoreconf. |
18 |
|
19 |
Package-Manager: Portage-2.3.19, Repoman-2.3.6 |
20 |
Closes: https://github.com/gentoo/gentoo/pull/6752 |
21 |
|
22 |
.../files/libyaml-0.1.7-mingw-no-undefined.patch | 32 +++++++++++++++ |
23 |
dev-libs/libyaml/libyaml-0.1.7-r1.ebuild | 48 ++++++++++++++++++++++ |
24 |
2 files changed, 80 insertions(+) |
25 |
|
26 |
diff --git a/dev-libs/libyaml/files/libyaml-0.1.7-mingw-no-undefined.patch b/dev-libs/libyaml/files/libyaml-0.1.7-mingw-no-undefined.patch |
27 |
new file mode 100644 |
28 |
index 00000000000..5e0ef524941 |
29 |
--- /dev/null |
30 |
+++ b/dev-libs/libyaml/files/libyaml-0.1.7-mingw-no-undefined.patch |
31 |
@@ -0,0 +1,32 @@ |
32 |
+--- a/include/yaml.h |
33 |
++++ b/include/yaml.h |
34 |
+@@ -26,7 +26,9 @@ extern "C" { |
35 |
+ |
36 |
+ /** The public API declaration. */ |
37 |
+ |
38 |
+-#ifdef _WIN32 |
39 |
++#if defined(__MINGW32__) |
40 |
++# define YAML_DECLARE(type) type |
41 |
++#elif defined(WIN32) |
42 |
+ # if defined(YAML_DECLARE_STATIC) |
43 |
+ # define YAML_DECLARE(type) type |
44 |
+ # elif defined(YAML_DECLARE_EXPORT) |
45 |
+--- a/src/Makefile.am |
46 |
++++ b/src/Makefile.am |
47 |
+@@ -1,4 +1,4 @@ |
48 |
+ AM_CPPFLAGS = -I$(top_srcdir)/include |
49 |
+ lib_LTLIBRARIES = libyaml.la |
50 |
+ libyaml_la_SOURCES = yaml_private.h api.c reader.c scanner.c parser.c loader.c writer.c emitter.c dumper.c |
51 |
+-libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) |
52 |
++libyaml_la_LDFLAGS = -no-undefined -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) |
53 |
+--- a/src/Makefile.in |
54 |
++++ b/src/Makefile.in |
55 |
+@@ -312,7 +312,7 @@ top_srcdir = @top_srcdir@ |
56 |
+ AM_CPPFLAGS = -I$(top_srcdir)/include |
57 |
+ lib_LTLIBRARIES = libyaml.la |
58 |
+ libyaml_la_SOURCES = yaml_private.h api.c reader.c scanner.c parser.c loader.c writer.c emitter.c dumper.c |
59 |
+-libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) |
60 |
++libyaml_la_LDFLAGS = -no-undefined -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) |
61 |
+ all: all-am |
62 |
+ |
63 |
+ .SUFFIXES: |
64 |
|
65 |
diff --git a/dev-libs/libyaml/libyaml-0.1.7-r1.ebuild b/dev-libs/libyaml/libyaml-0.1.7-r1.ebuild |
66 |
new file mode 100644 |
67 |
index 00000000000..8e168bc585d |
68 |
--- /dev/null |
69 |
+++ b/dev-libs/libyaml/libyaml-0.1.7-r1.ebuild |
70 |
@@ -0,0 +1,48 @@ |
71 |
+# Copyright 1999-2018 Gentoo Foundation |
72 |
+# Distributed under the terms of the GNU General Public License v2 |
73 |
+ |
74 |
+EAPI=6 |
75 |
+ |
76 |
+inherit libtool |
77 |
+ |
78 |
+MY_P="${P/lib}" |
79 |
+ |
80 |
+DESCRIPTION="YAML 1.1 parser and emitter written in C" |
81 |
+HOMEPAGE="http://pyyaml.org/wiki/LibYAML" |
82 |
+SRC_URI="http://pyyaml.org/download/${PN}/${MY_P}.tar.gz" |
83 |
+ |
84 |
+LICENSE="MIT" |
85 |
+SLOT="0" |
86 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
87 |
+IUSE="doc static-libs test" |
88 |
+ |
89 |
+S="${WORKDIR}/${MY_P}" |
90 |
+PATCHES=( |
91 |
+ "${FILESDIR}/${PN}-0.1.7-mingw-no-undefined.patch" |
92 |
+) |
93 |
+ |
94 |
+src_prepare() { |
95 |
+ default |
96 |
+ |
97 |
+ # conditionally remove tests |
98 |
+ if ! use test; then |
99 |
+ sed -i -e 's: tests::g' Makefile* || die |
100 |
+ fi |
101 |
+ |
102 |
+ elibtoolize # for FreeMiNT |
103 |
+} |
104 |
+ |
105 |
+src_configure() { |
106 |
+ econf $(use_enable static-libs static) |
107 |
+} |
108 |
+ |
109 |
+src_install() { |
110 |
+ use doc && HTML_DOCS=( doc/html/. ) |
111 |
+ default |
112 |
+ |
113 |
+ find "${D}" -name '*.la' -delete || die |
114 |
+ |
115 |
+ docinto examples |
116 |
+ dodoc tests/example-*.c |
117 |
+ docompress -x /usr/share/doc/${PF}/examples |
118 |
+} |