summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-03-31 03:20:54 +0000
committerMike Frysinger <vapier@gentoo.org>2007-03-31 03:20:54 +0000
commit91cfb5ea99089fc03611cc200ab83a35de65c2f4 (patch)
treed447a0d8c363648e26f8e2ee0783cd3bc5b77bf5 /media-libs
parentFixed compile issue, bug #163473. (diff)
downloadgentoo-2-91cfb5ea99089fc03611cc200ab83a35de65c2f4.tar.gz
gentoo-2-91cfb5ea99089fc03611cc200ab83a35de65c2f4.tar.bz2
gentoo-2-91cfb5ea99089fc03611cc200ab83a35de65c2f4.zip
Fix strict aliasing violation #172421 by Anssi Grohn.
(Portage version: 2.1.2.2)
Diffstat (limited to 'media-libs')
-rw-r--r--media-libs/lib3ds/ChangeLog11
-rw-r--r--media-libs/lib3ds/files/digest-lib3ds-1.2.0-r13
-rw-r--r--media-libs/lib3ds/files/lib3ds-1.2.0-fix-aliasing.patch33
-rw-r--r--media-libs/lib3ds/files/lib3ds-1.2.0-m4-underquoted.patch11
-rw-r--r--media-libs/lib3ds/lib3ds-1.2.0-r1.ebuild33
5 files changed, 89 insertions, 2 deletions
diff --git a/media-libs/lib3ds/ChangeLog b/media-libs/lib3ds/ChangeLog
index bba482da3f6c..905582cc5dcd 100644
--- a/media-libs/lib3ds/ChangeLog
+++ b/media-libs/lib3ds/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for media-libs/lib3ds
-# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/lib3ds/ChangeLog,v 1.8 2006/07/13 13:57:13 agriffis Exp $
+# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/lib3ds/ChangeLog,v 1.9 2007/03/31 03:20:54 vapier Exp $
+
+*lib3ds-1.2.0-r1 (31 Mar 2007)
+
+ 31 Mar 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/lib3ds-1.2.0-fix-aliasing.patch,
+ +files/lib3ds-1.2.0-m4-underquoted.patch, +lib3ds-1.2.0-r1.ebuild:
+ Fix strict aliasing violation #172421 by Anssi Grohn.
13 Jul 2006; Aron Griffis <agriffis@gentoo.org> lib3ds-1.2.0.ebuild:
Mark 1.2.0 stable on ia64
diff --git a/media-libs/lib3ds/files/digest-lib3ds-1.2.0-r1 b/media-libs/lib3ds/files/digest-lib3ds-1.2.0-r1
new file mode 100644
index 000000000000..14297f0fac32
--- /dev/null
+++ b/media-libs/lib3ds/files/digest-lib3ds-1.2.0-r1
@@ -0,0 +1,3 @@
+MD5 3a7f891d18af0151876b98bc05d3b373 lib3ds-1.2.0.tar.gz 136806
+RMD160 3e0401e36b545c2a54213ecb2ea3216360450562 lib3ds-1.2.0.tar.gz 136806
+SHA256 6204b0fdf308d191bfc650b8a90b96c86c1c6fbfb03f3046f72aedc8bc7686bb lib3ds-1.2.0.tar.gz 136806
diff --git a/media-libs/lib3ds/files/lib3ds-1.2.0-fix-aliasing.patch b/media-libs/lib3ds/files/lib3ds-1.2.0-fix-aliasing.patch
new file mode 100644
index 000000000000..7196badd3a2a
--- /dev/null
+++ b/media-libs/lib3ds/files/lib3ds-1.2.0-fix-aliasing.patch
@@ -0,0 +1,33 @@
+strict aliasing rules say this sort of casting is illegal
+
+http://bugs.gentoo.org/172421
+
+--- lib3ds/io.c
++++ lib3ds/io.c
+@@ -249,6 +249,7 @@
+ {
+ Lib3dsByte b[4];
+ Lib3dsDword d;
++ Lib3dsFloat ret;
+
+ ASSERT(io);
+ lib3ds_io_read(io, b, 4);
+@@ -256,7 +257,8 @@
+ ((Lib3dsDword)b[2] << 16) |
+ ((Lib3dsDword)b[1] << 8) |
+ ((Lib3dsDword)b[0]);
+- return(*((Lib3dsFloat*)&d));
++ memcpy(&ret, &d, sizeof(ret));
++ return ret;
+ }
+
+
+@@ -462,7 +464,7 @@
+ Lib3dsDword d;
+
+ ASSERT(io);
+- d=*((Lib3dsDword*)&l);
++ memcpy(&d, &l, sizeof(d));
+ b[3]=(Lib3dsByte)(((Lib3dsDword)d & 0xFF000000) >> 24);
+ b[2]=(Lib3dsByte)(((Lib3dsDword)d & 0x00FF0000) >> 16);
+ b[1]=(Lib3dsByte)(((Lib3dsDword)d & 0x0000FF00) >> 8);
diff --git a/media-libs/lib3ds/files/lib3ds-1.2.0-m4-underquoted.patch b/media-libs/lib3ds/files/lib3ds-1.2.0-m4-underquoted.patch
new file mode 100644
index 000000000000..ee8c654f650d
--- /dev/null
+++ b/media-libs/lib3ds/files/lib3ds-1.2.0-m4-underquoted.patch
@@ -0,0 +1,11 @@
+--- lib3ds-1.2.0/lib3ds.m4
++++ lib3ds-1.2.0/lib3ds.m4
+@@ -1,7 +1,7 @@
+ dnl
+ dnl AM_PATH_LIB3DS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+ dnl
+-AC_DEFUN(AM_PATH_LIB3DS,
++AC_DEFUN([AM_PATH_LIB3DS],
+ [
+
+ AC_ARG_WITH(lib3ds-prefix,[ --with-lib3ds-prefix=PFX Prefix where lib3ds is installed (optional)],
diff --git a/media-libs/lib3ds/lib3ds-1.2.0-r1.ebuild b/media-libs/lib3ds/lib3ds-1.2.0-r1.ebuild
new file mode 100644
index 000000000000..e02e20161f52
--- /dev/null
+++ b/media-libs/lib3ds/lib3ds-1.2.0-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/lib3ds/lib3ds-1.2.0-r1.ebuild,v 1.1 2007/03/31 03:20:54 vapier Exp $
+
+inherit eutils
+
+DESCRIPTION="overall software library for managing 3D-Studio Release 3 and 4 .3DS files"
+HOMEPAGE="http://lib3ds.sourceforge.net/"
+SRC_URI="mirror://sourceforge/lib3ds/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~ppc ~sparc ~x86"
+IUSE=""
+
+DEPEND="virtual/glut
+ virtual/opengl"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-fix-aliasing.patch #172421
+ epatch "${FILESDIR}"/${P}-m4-underquoted.patch
+ # Add -fPIC only to the .so
+ sed -i -e "s/@CFLAGS@/@CFLAGS@ -fPIC/" lib3ds/Makefile.in || die "sed lib3ds/Makefile.in failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dobin examples/3ds2rib || die
+ newbin examples/player 3dsplayer || die
+ dodoc README AUTHORS
+}