Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/lib3ds/files/, media-libs/lib3ds/
Date: Wed, 02 Oct 2019 20:40:28
Message-Id: 1570048804.82e6b1388337dbb3ccc7ed554d2a2d328ff9ac83.chewi@gentoo
1 commit: 82e6b1388337dbb3ccc7ed554d2a2d328ff9ac83
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 2 20:38:59 2019 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 2 20:40:04 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82e6b138
7
8 media-libs/lib3ds: Restore v1 and apply EAPI 7 plus other fixes
9
10 A bug in qgrep meant I didn't realise this version was in use. As it
11 turns out, media-libs/opencollada's dependency on v2 is bogus.
12
13 Forgot to mention before that I've dropped the freeglut and opengl
14 dependencies because they're not needed at all.
15
16 Package-Manager: Portage-2.3.76, Repoman-2.3.17
17 Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
18
19 media-libs/lib3ds/Manifest | 1 +
20 media-libs/lib3ds/files/lib3ds-1.3.0-mesh.c.patch | 17 ++++
21 .../lib3ds/files/lib3ds-1.3.0-pkgconfig.patch | 94 ++++++++++++++++++++++
22 media-libs/lib3ds/lib3ds-1.3.0-r1.ebuild | 24 ++++++
23 media-libs/lib3ds/lib3ds-1.3.0-r2.ebuild | 31 +++++++
24 5 files changed, 167 insertions(+)
25
26 diff --git a/media-libs/lib3ds/Manifest b/media-libs/lib3ds/Manifest
27 index 3c8d779efec..3fda88065c6 100644
28 --- a/media-libs/lib3ds/Manifest
29 +++ b/media-libs/lib3ds/Manifest
30 @@ -1 +1,2 @@
31 +DIST lib3ds-1.3.0.zip 443675 BLAKE2B 7e9aa3b7d0c74013264430be24b1f8417f5ff7754bd77508fb85fee227c8675c023b6b805b3cda57a1ea3c1bbc7b0fbd37df8ed1c4d00ac295a39ffb0e3c1219 SHA512 7c866ea9721a7a124c25b4962e933a7066ec2e3c7998e5ae2ba93727f19b91bdb103699bada6d1e04b67e0a54b9f58d09382093569114a1846d86bb03821b8ac
32 DIST lib3ds-20080909.zip 427233 BLAKE2B 862a4606206c59e357b0b8805998a497de140b5e80aa3f6f7dd41288ebb1ffc12475b41d5327ee3c619a22c549897b28b444bac5df58192979af5c236859d86f SHA512 ba7166dbd9fb97edc0f5cf0df56747b7e3c5aa1e62334ca995020a6ccd77284abc58e3fba80ec96ecf3765f5ce3121612c9f8c7dfedb2322f1cd2af85d567f87
33
34 diff --git a/media-libs/lib3ds/files/lib3ds-1.3.0-mesh.c.patch b/media-libs/lib3ds/files/lib3ds-1.3.0-mesh.c.patch
35 new file mode 100644
36 index 00000000000..1455660596b
37 --- /dev/null
38 +++ b/media-libs/lib3ds/files/lib3ds-1.3.0-mesh.c.patch
39 @@ -0,0 +1,17 @@
40 +diff -Naur lib3ds-1.3.0.orig/lib3ds/mesh.c lib3ds-1.3.0/lib3ds/mesh.c
41 +--- lib3ds-1.3.0.orig/lib3ds/mesh.c 2007-06-20 19:04:08.000000000 +0200
42 ++++ lib3ds-1.3.0/lib3ds/mesh.c 2010-09-14 06:34:39.987807911 +0200
43 +@@ -87,8 +87,11 @@
44 + faces=lib3ds_io_read_word(io);
45 + for (i=0; i<faces; ++i) {
46 + index=lib3ds_io_read_word(io);
47 +- ASSERT(index<mesh->faces);
48 +- strcpy(mesh->faceL[index].material, name);
49 ++ if (index<mesh->faces) {
50 ++ strncpy(mesh->faceL[index].material, name, 64);
51 ++ } else {
52 ++ // TODO warning
53 ++ }
54 + }
55 + }
56 + break;
57
58 diff --git a/media-libs/lib3ds/files/lib3ds-1.3.0-pkgconfig.patch b/media-libs/lib3ds/files/lib3ds-1.3.0-pkgconfig.patch
59 new file mode 100644
60 index 00000000000..41f658e5311
61 --- /dev/null
62 +++ b/media-libs/lib3ds/files/lib3ds-1.3.0-pkgconfig.patch
63 @@ -0,0 +1,94 @@
64 +diff -uNr lib3ds-1.2.0.orig/lib3ds-config.in lib3ds-1.2.0/lib3ds-config.in
65 +--- lib3ds-1.2.0.orig/lib3ds-config.in 2000-05-23 14:13:08.000000000 +0200
66 ++++ lib3ds-1.2.0/lib3ds-config.in 2007-10-21 06:37:48.000000000 +0200
67 +@@ -1,9 +1,5 @@
68 + #!/bin/sh
69 +
70 +-prefix=@prefix@
71 +-exec_prefix=@exec_prefix@
72 +-exec_prefix_set=no
73 +-
74 + usage()
75 + {
76 + cat <<EOF
77 +@@ -22,6 +18,8 @@
78 + usage 1 1>&2
79 + fi
80 +
81 ++PKG_CONFIG_ARGS=
82 ++
83 + while test $# -gt 0; do
84 + case "$1" in
85 + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
86 +@@ -30,23 +28,23 @@
87 +
88 + case $1 in
89 + --prefix=*)
90 +- prefix=$optarg
91 ++ PKG_CONFIG_ARGS="$PKG_CONFIG_ARGS --define-variable=prefix=$optarg"
92 + if test $exec_prefix_set = no ; then
93 +- exec_prefix=$optarg
94 ++ PKG_CONFIG_ARGS="$PKG_CONFIG_ARGS --define-variable=exec_prefix=$optarg"
95 + fi
96 + ;;
97 + --prefix)
98 + echo_prefix=yes
99 + ;;
100 + --exec-prefix=*)
101 +- exec_prefix=$optarg
102 ++ PKG_CONFIG_ARGS="$PKG_CONFIG_ARGS --define-variable=exec_prefix=$optarg"
103 + exec_prefix_set=yes
104 + ;;
105 + --exec-prefix)
106 + echo_exec_prefix=yes
107 + ;;
108 + --version)
109 +- echo @LIB3DS_VERSION@
110 ++ pkg-config --modversion lib3ds
111 + ;;
112 + --cflags)
113 + echo_cflags=yes
114 +@@ -62,23 +60,18 @@
115 + done
116 +
117 + if test "$echo_prefix" = "yes"; then
118 +- echo $prefix
119 ++ pkg-config $PKG_CONFIG_ARGS --variable=prefix lib3ds
120 + fi
121 +
122 + if test "$echo_exec_prefix" = "yes"; then
123 +- echo $exec_prefix
124 ++ pkg-config $PKG_CONFIG_ARGS --variable=exec_prefix lib3ds
125 + fi
126 +
127 + if test "$echo_cflags" = "yes"; then
128 +- if test @includedir@ != /usr/include ; then
129 +- echo -I@includedir@
130 +- fi
131 ++ pkg-config $PKG_CONFIG_ARGS --cflags lib3ds
132 + fi
133 +
134 + if test "$echo_libs" = "yes"; then
135 +- if test @libdir@ != /usr/lib ; then
136 +- my_linker_flags="-L@libdir@"
137 +- fi
138 +- echo ${my_linker_flags} -l3ds
139 +-fi
140 ++ pkg-config $PKG_CONFIG_ARGS --libs lib3ds
141 ++fi
142 +
143 +diff -uNr lib3ds-1.2.0.orig/lib3ds.pc.in lib3ds-1.2.0/lib3ds.pc.in
144 +--- lib3ds-1.2.0.orig/lib3ds.pc.in 1970-01-01 01:00:00.000000000 +0100
145 ++++ lib3ds-1.2.0/lib3ds.pc.in 2007-10-21 06:23:53.000000000 +0200
146 +@@ -0,0 +1,11 @@
147 ++prefix=@prefix@
148 ++exec_prefix=@exec_prefix@
149 ++libdir=@libdir@
150 ++includedir=@includedir@
151 ++
152 ++Name: lib3ds
153 ++Description: lib3ds
154 ++Version: @VERSION@
155 ++Requires:
156 ++Libs: -L${libdir} -l3ds -lm
157 ++Cflags: -I${includedir}
158
159 diff --git a/media-libs/lib3ds/lib3ds-1.3.0-r1.ebuild b/media-libs/lib3ds/lib3ds-1.3.0-r1.ebuild
160 new file mode 100644
161 index 00000000000..a15221ea080
162 --- /dev/null
163 +++ b/media-libs/lib3ds/lib3ds-1.3.0-r1.ebuild
164 @@ -0,0 +1,24 @@
165 +# Copyright 1999-2019 Gentoo Authors
166 +# Distributed under the terms of the GNU General Public License v2
167 +
168 +EAPI="5"
169 +
170 +inherit autotools-utils
171 +
172 +DESCRIPTION="library for managing 3D-Studio Release 3 and 4 .3DS files"
173 +HOMEPAGE="https://code.google.com/p/lib3ds/"
174 +SRC_URI="https://${PN}.googlecode.com/files/${P}.zip"
175 +
176 +LICENSE="LGPL-2.1"
177 +SLOT="0"
178 +KEYWORDS="amd64 ppc ppc64 x86"
179 +IUSE="static-libs"
180 +
181 +RDEPEND="media-libs/freeglut
182 + virtual/opengl"
183 +DEPEND="${RDEPEND}
184 + app-arch/unzip"
185 +PATCHES=(
186 + "${FILESDIR}"/${P}-pkgconfig.patch
187 + "${FILESDIR}"/${P}-mesh.c.patch
188 +)
189
190 diff --git a/media-libs/lib3ds/lib3ds-1.3.0-r2.ebuild b/media-libs/lib3ds/lib3ds-1.3.0-r2.ebuild
191 new file mode 100644
192 index 00000000000..a6db6a0139e
193 --- /dev/null
194 +++ b/media-libs/lib3ds/lib3ds-1.3.0-r2.ebuild
195 @@ -0,0 +1,31 @@
196 +# Copyright 1999-2019 Gentoo Authors
197 +# Distributed under the terms of the GNU General Public License v2
198 +
199 +EAPI=7
200 +
201 +DESCRIPTION="library for managing 3D-Studio Release 3 and 4 .3DS files"
202 +HOMEPAGE="https://code.google.com/p/lib3ds/"
203 +SRC_URI="https://${PN}.googlecode.com/files/${P}.zip"
204 +LICENSE="LGPL-2.1+"
205 +SLOT="0"
206 +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
207 +IUSE="static-libs"
208 +
209 +BDEPEND="app-arch/unzip"
210 +
211 +PATCHES=(
212 + "${FILESDIR}"/${P}-pkgconfig.patch
213 + "${FILESDIR}"/${P}-mesh.c.patch
214 +)
215 +
216 +src_configure() {
217 + econf $(use_enable static-libs static)
218 +}
219 +
220 +src_install() {
221 + default
222 +
223 + if ! use static-libs; then
224 + rm "${ED}/usr/$(get_libdir)/${PN}.la" || die
225 + fi
226 +}