/[gentoo-x86]/app-text/podofo/podofo-0.9.1.ebuild
Gentoo

Contents of /app-text/podofo/podofo-0.9.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Thu Feb 28 15:03:15 2013 UTC (5 years, 3 months ago) by zmedico
Branch: MAIN
Changes since 1.11: +3 -3 lines
Use tc-getPKG_CONFIG.

(Portage version: 2.2.0_alpha163_p21/cvs/Linux i686, signed Manifest commit with key 0xFDE8EF85AE5719A3)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-text/podofo/podofo-0.9.1.ebuild,v 1.11 2013/02/27 08:45:03 zmedico Exp $
4
5 EAPI=2
6 inherit cmake-utils flag-o-matic multilib toolchain-funcs
7
8 DESCRIPTION="PoDoFo is a C++ library to work with the PDF file format."
9 HOMEPAGE="http://sourceforge.net/projects/podofo/"
10 SRC_URI="mirror://sourceforge/podofo/${P}.tar.gz"
11
12 LICENSE="GPL-2 LGPL-2.1"
13 SLOT="0"
14 KEYWORDS="amd64 hppa ppc ppc64 ~sparc x86"
15 IUSE="+boost debug test"
16
17 RDEPEND="dev-lang/lua
18 dev-libs/openssl
19 media-libs/fontconfig
20 media-libs/freetype:2
21 virtual/jpeg
22 >=media-libs/libpng-1.4:0
23 media-libs/tiff:0
24 sys-libs/zlib"
25 DEPEND="${RDEPEND}
26 virtual/pkgconfig
27 boost? ( dev-util/boost-build )
28 test? ( dev-util/cppunit )"
29
30 DOCS="AUTHORS ChangeLog TODO"
31
32 src_prepare() {
33 local x sed_args
34
35 sed -i \
36 -e "s:LIBDIRNAME \"lib\":LIBDIRNAME \"$(get_libdir)\":" \
37 CMakeLists.txt || die
38
39 # Use pkg-config to find headers for bug #459404.
40 sed_args=
41 for x in $($(tc-getPKG_CONFIG) --cflags freetype2) ; do
42 [[ ${x} == -I* ]] || continue
43 x=${x#-I}
44 if [[ -f ${x}/ft2build.h ]] ; then
45 sed_args+=" -e s:/usr/include/\\r\$:${x}:"
46 elif [[ -f ${x}/freetype/config/ftheader.h ]] ; then
47 sed_args+=" -e s:/usr/include/freetype2\\r\$:${x}:"
48 fi
49 done
50 [[ -n ${sed_args} ]] && \
51 { sed -i ${sed_args} cmake/modules/FindFREETYPE.cmake || die; }
52
53 # Bug #439784: Add missing unistd include for close() and unlink().
54 sed -i 's:^#include <stdio.h>$:#include <unistd.h>\n\0:' -i \
55 test/unit/TestUtils.cpp || die
56
57 # TODO: fix these test cases
58 # ColorTest.cpp:62:Assertion
59 # Test name: ColorTest::testDefaultConstructor
60 # expected exception not thrown
61 # - Expected: PdfError
62 sed -e 's:CPPUNIT_TEST( testDefaultConstructor ://\0:' \
63 -e 's:CPPUNIT_TEST( testGreyConstructor ://\0:' \
64 -e 's:CPPUNIT_TEST( testRGBConstructor ://\0:' \
65 -e 's:CPPUNIT_TEST( testCMYKConstructor ://\0:' \
66 -e 's:CPPUNIT_TEST( testColorSeparationAllConstructor ://\0:' \
67 -e 's:CPPUNIT_TEST( testColorSeparationNoneConstructor ://\0:' \
68 -e 's:CPPUNIT_TEST( testColorSeparationConstructor ://\0:' \
69 -e 's:CPPUNIT_TEST( testColorCieLabConstructor ://\0:' \
70 -i test/unit/ColorTest.h || die
71
72 # ColorTest.cpp:42:Assertion
73 # Test name: ColorTest::testHexNames
74 # assertion failed
75 # - Expression: static_cast<int>(rgb.GetGreen() * 255.0) == 0x0A
76 sed -e 's:CPPUNIT_TEST( testHexNames ://\0:' \
77 -i test/unit/ColorTest.h || die
78
79 # Bug #352125: test failure, depending on installed fonts
80 # ##Failure Location unknown## : Error
81 # Test name: FontTest::testFonts
82 # uncaught exception of type PoDoFo::PdfError
83 # - ePdfError_UnsupportedFontFormat
84 sed -e 's:CPPUNIT_TEST( testFonts ://\0:' \
85 -i test/unit/FontTest.h || die
86
87 # Bug #407015: fix to compile with Lua 5.2
88 if has_version '>=dev-lang/lua-5.2' ; then
89 sed -e 's: lua_open(: luaL_newstate(:' \
90 -e 's: luaL_getn(: lua_rawlen(:' -i \
91 tools/podofocolor/luaconverter.cpp \
92 tools/podofoimpose/planreader_lua.cpp || die
93 fi
94 }
95
96 src_configure() {
97
98 # Bug #381359: undefined reference to `PoDoFo::PdfVariant::DelayedLoadImpl()'
99 filter-flags -fvisibility-inlines-hidden
100
101 mycmakeargs+=(
102 "-DPODOFO_BUILD_SHARED=1"
103 "-DPODOFO_HAVE_JPEG_LIB=1"
104 "-DPODOFO_HAVE_PNG_LIB=1"
105 "-DPODOFO_HAVE_TIFF_LIB=1"
106 "-DWANT_FONTCONFIG=1"
107 "-DUSE_STLPORT=0"
108 $(cmake-utils_use_want boost)
109 $(cmake-utils_use_has test CPPUNIT)
110 )
111
112 cmake-utils_src_configure
113 }
114
115 src_test() {
116 cd "${CMAKE_BUILD_DIR}"/test/unit
117 ./podofo-test --selftest || die "self test failed"
118 }

  ViewVC Help
Powered by ViewVC 1.1.20