diff options
author | 2013-01-09 23:38:23 +0000 | |
---|---|---|
committer | 2013-01-09 23:38:23 +0000 | |
commit | e62a69b2ae3965f51ff3b08060823501ebc955ca (patch) | |
tree | ed1f6b9e9d0dc855665ed6b82f0e48005d13a5ff /media-libs | |
parent | Add arm for ChromiumOS. (diff) | |
download | gentoo-2-e62a69b2ae3965f51ff3b08060823501ebc955ca.tar.gz gentoo-2-e62a69b2ae3965f51ff3b08060823501ebc955ca.tar.bz2 gentoo-2-e62a69b2ae3965f51ff3b08060823501ebc955ca.zip |
Update to EAPI=4. Add IUSE=static-libs support. Respect $PKG_CONFIG. Use $CXX to link rather than $CC -lstdc++ since that does not work for everything. Respect $CXXFLAGS when linking.
(Portage version: 2.2.0_alpha144/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)
Diffstat (limited to 'media-libs')
-rw-r--r-- | media-libs/freeimage/ChangeLog | 13 | ||||
-rw-r--r-- | media-libs/freeimage/files/freeimage-3.15.3-r1-unbundling.patch | 313 | ||||
-rw-r--r-- | media-libs/freeimage/freeimage-3.15.3-r1.ebuild | 92 |
3 files changed, 415 insertions, 3 deletions
diff --git a/media-libs/freeimage/ChangeLog b/media-libs/freeimage/ChangeLog index 6c814d62decf..08f6a8320e96 100644 --- a/media-libs/freeimage/ChangeLog +++ b/media-libs/freeimage/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for media-libs/freeimage -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/freeimage/ChangeLog,v 1.19 2012/07/24 11:50:26 tupone Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/freeimage/ChangeLog,v 1.20 2013/01/09 23:38:23 vapier Exp $ + +*freeimage-3.15.3-r1 (09 Jan 2013) + + 09 Jan 2013; Mike Frysinger <vapier@gentoo.org> + +files/freeimage-3.15.3-r1-unbundling.patch, +freeimage-3.15.3-r1.ebuild: + Update to EAPI=4. Add IUSE=static-libs support. Respect $PKG_CONFIG. Use + $CXX to link rather than $CC -lstdc++ since that does not work for everything. + Respect $CXXFLAGS when linking. 24 Jul 2012; Tupone Alfredo <tupone@gentoo.org> freeimage-3.15.3.ebuild: Add depend on pkgconfig. Bug #427676 by Julian Ospald @@ -77,4 +85,3 @@ +files/freeimage-3.9.3-build.patch, +metadata.xml, +freeimage-3.9.3.ebuild: Initial commit, bug #165938 - diff --git a/media-libs/freeimage/files/freeimage-3.15.3-r1-unbundling.patch b/media-libs/freeimage/files/freeimage-3.15.3-r1-unbundling.patch new file mode 100644 index 000000000000..f0a4ef887871 --- /dev/null +++ b/media-libs/freeimage/files/freeimage-3.15.3-r1-unbundling.patch @@ -0,0 +1,313 @@ +--- Makefile.gnu ++++ Makefile.gnu +@@ -11,7 +11,14 @@ + # Converts cr/lf to just lf + DOS2UNIX = dos2unix + +-LIBRARIES = -lstdc++ ++PKG_CONFIG ?= $(PKG_CONFIG) ++LIBRARIES = -lmng -ljpeg \ ++ $(shell $(PKG_CONFIG) --libs libpng) \ ++ $(shell $(PKG_CONFIG) --libs libtiff-4) \ ++ $(shell $(PKG_CONFIG) --libs zlib) \ ++ $(shell $(PKG_CONFIG) --libs libopenjpeg) \ ++ $(shell $(PKG_CONFIG) --libs OpenEXR) \ ++ $(shell $(PKG_CONFIG) --libs libraw) + + MODULES = $(SRCS:.c=.o) + MODULES := $(MODULES:.cpp=.o) +@@ -64,13 +71,15 @@ + $(AR) r $@ $(MODULES) + + $(SHAREDLIB): $(MODULES) +- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) ++ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) + + install: + install -d $(INCDIR) $(INSTALLDIR) +- install -m 644 -o root -g root $(HEADER) $(INCDIR) +- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR) +- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR) ++ install -m 644 $(HEADER) $(INCDIR) ++ifneq ($(STATICLIB),) ++ install -m 644 $(STATICLIB) $(INSTALLDIR) ++endif ++ install -m 755 $(SHAREDLIB) $(INSTALLDIR) + ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME) + ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME) + # ldconfig +--- Source/FreeImage/J2KHelper.cpp ++++ Source/FreeImage/J2KHelper.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include <openjpeg.h> + + /** + Divide an integer by a power of 2 and round upwards +--- Source/FreeImage/PluginEXR.cpp ++++ Source/FreeImage/PluginEXR.cpp +@@ -22,16 +22,16 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../OpenEXR/IlmImf/ImfIO.h" +-#include "../OpenEXR/Iex/Iex.h" +-#include "../OpenEXR/IlmImf/ImfOutputFile.h" +-#include "../OpenEXR/IlmImf/ImfInputFile.h" +-#include "../OpenEXR/IlmImf/ImfRgbaFile.h" +-#include "../OpenEXR/IlmImf/ImfChannelList.h" +-#include "../OpenEXR/IlmImf/ImfRgba.h" +-#include "../OpenEXR/IlmImf/ImfArray.h" +-#include "../OpenEXR/IlmImf/ImfPreviewImage.h" +-#include "../OpenEXR/Half/half.h" ++#include <ImfIO.h> ++#include <Iex.h> ++#include <ImfOutputFile.h> ++#include <ImfInputFile.h> ++#include <ImfRgbaFile.h> ++#include <ImfChannelList.h> ++#include <ImfRgba.h> ++#include <ImfArray.h> ++#include <ImfPreviewImage.h> ++#include <half.h> + + + // ========================================================== +--- Source/FreeImage/PluginJ2K.cpp ++++ Source/FreeImage/PluginJ2K.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include <openjpeg.h> + + // ========================================================== + // Plugin Interface +--- Source/FreeImage/PluginJP2.cpp ++++ Source/FreeImage/PluginJP2.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include <openjpeg.h> + + // ========================================================== + // Plugin Interface +--- Source/FreeImage/PluginPNG.cpp ++++ Source/FreeImage/PluginPNG.cpp +@@ -37,8 +37,8 @@ + + // ---------------------------------------------------------- + +-#include "../ZLib/zlib.h" +-#include "../LibPNG/png.h" ++#include <zlib.h> ++#include <png.h> + + // ---------------------------------------------------------- + +--- Source/transupp.c ++++ Source/transupp.c +@@ -15,8 +15,7 @@ + /* Although this file really shouldn't have access to the library internals, + * it's helpful to let it call jround_up() and jcopy_block_row(). + */ +-#define JPEG_INTERNALS +- ++#include <jerror.h> + #include "jinclude.h" + #include "jpeglib.h" + #include "transupp.h" /* My own external interface */ +--- Source/FreeImage/ZLibInterface.cpp ++++ Source/FreeImage/ZLibInterface.cpp +@@ -19,10 +19,10 @@ + // Use at your own risk! + // ========================================================== + +-#include "../ZLib/zlib.h" ++#include <zlib.h> + #include "FreeImage.h" + #include "Utilities.h" +-#include "../ZLib/zutil.h" /* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */ ++#define OS_CODE 0x03 + + /** + Compresses a source buffer into a target buffer, using the ZLib library. +--- Source/FreeImage/PluginG3.cpp ++++ Source/FreeImage/PluginG3.cpp +@@ -20,7 +20,7 @@ + // Use at your own risk! + // ========================================================== + +-#include "../LibTIFF4/tiffiop.h" ++#include "tiffiop.h" + + #include "FreeImage.h" + #include "Utilities.h" +--- Source/FreeImage/PluginJPEG.cpp ++++ Source/FreeImage/PluginJPEG.cpp +@@ -35,11 +35,15 @@ + #undef FAR + #include <setjmp.h> + +-#include "../LibJPEG/jinclude.h" +-#include "../LibJPEG/jpeglib.h" +-#include "../LibJPEG/jerror.h" ++#include <string.h> ++#include <stdio.h> ++#include <jconfig.h> ++#include <jpeglib.h> ++#include <jerror.h> + } + ++#define SIZEOF(object) ((size_t) sizeof(object)) ++ + #include "FreeImage.h" + #include "Utilities.h" + +--- Source/FreeImageToolkit/JPEGTransform.cpp ++++ Source/FreeImageToolkit/JPEGTransform.cpp +@@ -25,10 +25,11 @@ + #undef FAR + #include <setjmp.h> + +-#include "../LibJPEG/jinclude.h" +-#include "../LibJPEG/jpeglib.h" +-#include "../LibJPEG/jerror.h" +-#include "../LibJPEG/transupp.h" ++#include <string.h> ++#include <stdio.h> ++#include <jpeglib.h> ++#include <jerror.h> ++#include "transupp.h" + } + + #include "FreeImage.h" +--- Makefile.fip ++++ Makefile.fip +@@ -11,7 +11,14 @@ + # Converts cr/lf to just lf + DOS2UNIX = dos2unix + +-LIBRARIES = -lstdc++ ++PKG_CONFIG ?= pkg-config ++LIBRARIES = -lmng -ljpeg \ ++ $(shell $(PKG_CONFIG) --libs libpng) \ ++ $(shell $(PKG_CONFIG) --libs libtiff-4) \ ++ $(shell $(PKG_CONFIG) --libs zlib) \ ++ $(shell $(PKG_CONFIG) --libs libopenjpeg) \ ++ $(shell $(PKG_CONFIG) --libs OpenEXR) \ ++ $(shell $(PKG_CONFIG) --libs libraw) + + MODULES = $(SRCS:.c=.o) + MODULES := $(MODULES:.cpp=.o) +@@ -65,14 +72,18 @@ + $(AR) r $@ $(MODULES) + + $(SHAREDLIB): $(MODULES) +- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) ++ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) + + install: + install -d $(INCDIR) $(INSTALLDIR) +- install -m 644 -o root -g root $(HEADER) $(INCDIR) +- install -m 644 -o root -g root $(HEADERFIP) $(INCDIR) +- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR) +- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR) ++ install -m 644 $(HEADER) $(INCDIR) ++ install -m 644 $(HEADERFIP) $(INCDIR) ++ifneq ($(STATICLIB),) ++ install -m 644 $(STATICLIB) $(INSTALLDIR) ++endif ++ install -m 755 $(SHAREDLIB) $(INSTALLDIR) ++ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME) ++ ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME) + + clean: + rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME) +--- Makefile.srcs ++++ Makefile.srcs +@@ -88,6 +88,7 @@ + Source/FreeImageToolkit/MultigridPoissonSolver.cpp \ + Source/FreeImageToolkit/Rescale.cpp \ + Source/FreeImageToolkit/Resize.cpp \ ++ Source/transupp.c + INCLS = \ + Source/FreeImage.h \ + Source/CacheFile.h \ +@@ -116,3 +117,9 @@ + -ISource \ + -ISource/Metadata \ + -ISource/FreeImageToolkit \ ++ $(shell $(PKG_CONFIG) --cflags-only-I libpng) \ ++ $(shell $(PKG_CONFIG) --cflags-only-I libtiff-4) \ ++ $(shell $(PKG_CONFIG) --cflags-only-I zlib) \ ++ $(shell $(PKG_CONFIG) --cflags-only-I libopenjpeg) \ ++ $(shell $(PKG_CONFIG) --cflags-only-I OpenEXR) \ ++ $(shell $(PKG_CONFIG) --cflags-only-I libraw) +--- Source/FreeImage/PluginRAW.cpp ++++ Source/FreeImage/PluginRAW.cpp +@@ -19,7 +19,7 @@ + // Use at your own risk! + // ========================================================== + +-#include "../LibRawLite/libraw/libraw.h" ++#include <libraw.h> + + #include "FreeImage.h" + #include "Utilities.h" +--- Source/Metadata/XTIFF.cpp ++++ Source/Metadata/XTIFF.cpp +@@ -29,7 +29,7 @@ + #pragma warning (disable : 4786) // identifier was truncated to 'number' characters + #endif + +-#include "../LibTIFF4/tiffiop.h" ++#include "tiffiop.h" + + #include "FreeImage.h" + #include "Utilities.h" +--- Source/FreeImage/PluginTIFF.cpp ++++ Source/FreeImage/PluginTIFF.cpp +@@ -37,9 +37,9 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibTIFF4/tiffiop.h" ++#include "tiffiop.h" + #include "../Metadata/FreeImageTag.h" +-#include "../OpenEXR/Half/half.h" ++#include <half.h> + + #include "FreeImageIO.h" + #include "PSDParser.h" +--- Source/tiffiop.h ++++ Source/tiffiop.h +@@ -30,7 +30,9 @@ + * ``Library-private'' definitions. + */ + +-#include "tif_config.h" ++#include <tiffconf.h> ++#define HAVE_SEARCH_H ++#define HAVE_FCNTL_H + + #ifdef HAVE_FCNTL_H + # include <fcntl.h> +--- fipMakefile.srcs ++++ fipMakefile.srcs +@@ -94,7 +94,8 @@ + Wrapper/FreeImagePlus/src/fipMultiPage.cpp \ + Wrapper/FreeImagePlus/src/fipTag.cpp \ + Wrapper/FreeImagePlus/src/fipWinImage.cpp \ +- Wrapper/FreeImagePlus/src/FreeImagePlus.cpp ++ Wrapper/FreeImagePlus/src/FreeImagePlus.cpp \ ++ Source/transupp.c + INCLUDE = -I. \ + -ISource \ + -ISource/Metadata \ diff --git a/media-libs/freeimage/freeimage-3.15.3-r1.ebuild b/media-libs/freeimage/freeimage-3.15.3-r1.ebuild new file mode 100644 index 000000000000..215b720d128e --- /dev/null +++ b/media-libs/freeimage/freeimage-3.15.3-r1.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/freeimage/freeimage-3.15.3-r1.ebuild,v 1.1 2013/01/09 23:38:23 vapier Exp $ + +EAPI="4" + +inherit toolchain-funcs eutils multilib + +MY_PN=FreeImage +MY_PV=${PV//.} +MY_P=${MY_PN}${MY_PV} + +DESCRIPTION="Image library supporting many formats" +HOMEPAGE="http://freeimage.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip + mirror://sourceforge/${PN}/${MY_P}.pdf" + +LICENSE="|| ( GPL-2 FIPL-1.0 )" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="static-libs" + +RDEPEND="sys-libs/zlib + media-libs/libpng + media-libs/libmng + virtual/jpeg + media-libs/openjpeg + media-libs/tiff + media-libs/libraw + media-libs/openexr" +DEPEND="${RDEPEND} + virtual/pkgconfig + app-arch/unzip" + +S="${WORKDIR}"/${MY_PN} + +src_prepare() { + cd Source + cp LibJPEG/{transupp.c,transupp.h,jinclude.h} . \ + || die "Failed copying jpeg utility files" + cp LibTIFF4/{tiffiop,tif_dir}.h . \ + || die "Failed copying private libtiff files" + rm -rf LibPNG LibMNG LibOpenJPEG ZLib OpenEXR LibRawLite LibTIFF4 LibJPEG \ + || die "Removing bundled libraries" + cd .. + edos2unix Makefile.{gnu,fip,srcs} fipMakefile.srcs */*.h */*/*.cpp + sed -i \ + -e "s:/./:/:g" \ + -e "s: ./: :g" \ + -e 's: Source: \\\n\tSource:g' \ + -e 's: Wrapper: \\\n\tWrapper:g' \ + -e 's: Examples: \\\n\tExamples:g' \ + -e 's: TestAPI: \\\n\tTestAPI:g' \ + -e 's: -ISource: \\\n\t-ISource:g' \ + -e 's: -IWrapper: \\\n\t-IWrapper:g' \ + Makefile.srcs \ + fipMakefile.srcs \ + || die "sed 1 Failed" + sed -i \ + -e "/LibJPEG/d" \ + -e "/LibPNG/d" \ + -e "/LibTIFF/d" \ + -e "/Source\/ZLib/d" \ + -e "/LibOpenJPEG/d" \ + -e "/OpenEXR/d" \ + -e "/LibRawLite/d" \ + -e "/LibMNG/d" \ + Makefile.srcs \ + fipMakefile.srcs \ + || die "sed 1 Failed" + epatch "${FILESDIR}"/${PF}-unbundling.patch +} + +foreach_make() { + local m + for m in Makefile.{gnu,fip} ; do + emake -f ${m} $(usex static-libs '' STATICLIB=) "$@" + done +} + +src_compile() { + tc-export AR PKG_CONFIG + foreach_make \ + CXX="$(tc-getCXX) -fPIC" \ + CC="$(tc-getCC) -fPIC" \ + ${MY_PN} +} + +src_install() { + foreach_make install DESTDIR="${ED}" INSTALLDIR="${ED}"/usr/$(get_libdir) + dodoc Whatsnew.txt "${DISTDIR}"/${MY_P}.pdf +} |