Gentoo Archives: gentoo-commits

From: "Wulf Krueger (philantrop)" <philantrop@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/okular/files: kdegraphics-4.0.1-system-libspectre.patch
Date: Thu, 07 Feb 2008 01:00:34
Message-Id: E1JMv7v-00026m-6v@stork.gentoo.org
1 philantrop 08/02/07 01:00:31
2
3 Added: kdegraphics-4.0.1-system-libspectre.patch
4 Log:
5 Added missing patch.
6 (Portage version: 2.1.4.1)
7
8 Revision Changes Path
9 1.1 kde-base/okular/files/kdegraphics-4.0.1-system-libspectre.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/okular/files/kdegraphics-4.0.1-system-libspectre.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/okular/files/kdegraphics-4.0.1-system-libspectre.patch?rev=1.1&content-type=text/plain
13
14 Index: kdegraphics-4.0.1-system-libspectre.patch
15 ===================================================================
16 I got this patch from Fedora.
17
18 References:
19
20 http://tsdgeos.blogspot.com/2008/02/okular-and-libspectre.html
21 http://cvs.fedoraproject.org/viewcvs/rpms/kdegraphics/devel/
22 https://bugs.gentoo.org/show_bug.cgi?id=208617
23
24 Index: cmake/modules/FindLibSpectre.cmake
25 ===================================================================
26 --- cmake/modules/FindLibSpectre.cmake (revision 0)
27 +++ cmake/modules/FindLibSpectre.cmake (revision 768911)
28 @@ -0,0 +1,62 @@
29 +# - Try to find the libspectre PS library
30 +# Once done this will define
31 +#
32 +# LIBSPECTRE_FOUND - system has libspectre
33 +# LIBSPECTRE_INCLUDE_DIR - the libspectre include directory
34 +# LIBSPECTRE_LIBRARY - Link this to use libspectre
35 +#
36 +
37 +# Copyright (c) 2006-2007, Pino Toscano, <pino@×××.org>
38 +# Copyright (c) 2008, Albert Astals Cid, <aacid@×××.org>
39 +#
40 +# Redistribution and use is allowed according to the terms of the BSD license.
41 +# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
42 +
43 +if(LIBSPECTRE_INCLUDE_DIR AND LIBSPECTRE_LIBRARY)
44 +
45 + # in cache already
46 + set(LIBSPECTRE_FOUND TRUE)
47 +
48 +else(LIBSPECTRE_INCLUDE_DIR AND LIBSPECTRE_LIBRARY)
49 +
50 +# use pkg-config to get the directories and then use these values
51 +# in the FIND_PATH() and FIND_LIBRARY() calls
52 +INCLUDE(UsePkgConfig)
53 +
54 +PKGCONFIG(libspectre _SpectreIncDir _SpectreLinkDir _SpectreLinkFlags _SpectreCflags)
55 +
56 +if(_SpectreLinkFlags)
57 + # find again pkg-config, to query it about libspectre version
58 + FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin/ /usr/local/bin )
59 +
60 + # query pkg-config asking for a libspectre >= LIBSPECTRE_MINIMUM_VERSION
61 + EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=${LIBSPECTRE_MINIMUM_VERSION} libspectre RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
62 + if(_return_VALUE STREQUAL "0")
63 + set(LIBSPECTRE_FOUND TRUE)
64 + endif(_return_VALUE STREQUAL "0")
65 +endif(_SpectreLinkFlags)
66 +
67 +if (LIBSPECTRE_FOUND)
68 + set(LIBSPECTRE_LIBRARY ${_SpectreLinkFlags})
69 +
70 + # the cflags for libspectre can contain more than one include path
71 + separate_arguments(_SpectreCflags)
72 + foreach(_includedir ${_SpectreCflags})
73 + string(REGEX REPLACE "-I(.+)" "\\1" _includedir "${_includedir}")
74 + set(LIBSPECTRE_INCLUDE_DIR ${LIBSPECTRE_INCLUDE_DIR} ${_includedir})
75 + endforeach(_includedir)
76 +
77 + set(CMAKE_REQUIRED_INCLUDES)
78 + set(CMAKE_REQUIRED_LIBRARIES)
79 +else (LIBSPECTRE_FOUND)
80 + if (LIBSPECTRE_FIND_REQUIRED)
81 + message(FATAL_ERROR "Could NOT find libspectre")
82 + endif (LIBSPECTRE_FIND_REQUIRED)
83 + message(STATUS "Could not find OPTIONAL package libspectre")
84 +endif (LIBSPECTRE_FOUND)
85 +
86 +# ensure that they are cached
87 +set(LIBSPECTRE_INCLUDE_DIR ${LIBSPECTRE_INCLUDE_DIR} CACHE INTERNAL "The libspectre include path")
88 +set(LIBSPECTRE_LIBRARY ${LIBSPECTRE_LIBRARY} CACHE INTERNAL "The libspectre library")
89 +
90 +endif(LIBSPECTRE_INCLUDE_DIR AND LIBSPECTRE_LIBRARY)
91 Index: okular/generators/spectre/rendererthread.cpp
92 ===================================================================
93 --- okular/generators/spectre/rendererthread.cpp (revision 768910)
94 +++ okular/generators/spectre/rendererthread.cpp (revision 768911)
95 @@ -37,7 +37,7 @@
96
97 void GSRendererThread::setMagnify(double magnify)
98 {
99 - spectre_render_context_set_scale(m_renderContext, magnify);
100 + spectre_render_context_set_scale(m_renderContext, magnify, magnify);
101 }
102
103 void GSRendererThread::setPlatformFonts(bool pfonts)
104 Index: okular/generators/CMakeLists.txt
105 ===================================================================
106 --- okular/generators/CMakeLists.txt (revision 768910)
107 +++ okular/generators/CMakeLists.txt (revision 768911)
108 @@ -1,12 +1,12 @@
109 include (MacroLogFeature)
110
111 -set(LIBGS_MINIMUM_VERSION "8.56")
112 +set(LIBSPECTRE_MINIMUM_VERSION "0.2")
113
114 macro_optional_find_package(Poppler)
115 macro_log_feature(POPPLER_FOUND "Poppler-Qt4" "A PDF rendering library" "http://poppler.freedesktop.org" FALSE "0.5.4" "Support for PDF files in okular.")
116
117 -macro_optional_find_package(LIBGS)
118 -macro_log_feature(LIBGS_FOUND "libgs, Ghostscript libraries" "A PostScript renderining library" "http://www.cs.wisc.edu/~ghost" FALSE "${LIBGS_MINIMUM_VERSION}" "Support for PS files in okular.")
119 +macro_optional_find_package(LibSpectre)
120 +macro_log_feature(LIBSPECTRE_FOUND "libspectre" "A PostScript rendering library" "http://libspectre.freedesktop.org/wiki/" FALSE "${LIBSPECTRE_MINIMUM_VERSION}" "Support for PS files in okular.")
121
122 macro_optional_find_package(CHM)
123 macro_log_feature(CHM_FOUND "CHM" "A library for dealing with Microsoft ITSS/CHM format files" "http://www.jedrea.com/chmlib" FALSE "" "Support CHM files in okular.")
124 @@ -30,9 +30,9 @@
125 add_subdirectory(poppler)
126 endif(POPPLER_FOUND)
127
128 -if(LIBGS_FOUND)
129 +if(LIBSPECTRE_FOUND)
130 add_subdirectory(spectre)
131 -endif(LIBGS_FOUND)
132 +endif(LIBSPECTRE_FOUND)
133
134 add_subdirectory( kimgio )
135
136 --- okular/generators/spectre/CMakeLists.txt
137 +++ okular/generators/spectre/CMakeLists.txt
138 @@ -1,6 +1,7 @@
139 -add_subdirectory( libspectre conf )
140 +add_subdirectory( conf )
141
142 include_directories(
143 + ${LIBSPECTRE_INCLUDE_DIR}
144 ${CMAKE_CURRENT_SOURCE_DIR}/../..
145 ${CMAKE_CURRENT_BINARY_DIR}/../..
146 )
147 @@ -21,7 +22,7 @@
148
149 kde4_add_plugin(okularGenerator_ghostview ${okularGenerator_ghostview_SRCS})
150
151 -target_link_libraries(okularGenerator_ghostview okularcore spectreOkular ${KDE4_KDEUI_LIBRARY})
152 +target_link_libraries(okularGenerator_ghostview okularcore ${LIBSPECTRE_LIBRARY} ${KDE4_KDEUI_LIBRARY})
153
154 install(TARGETS okularGenerator_ghostview DESTINATION ${PLUGIN_INSTALL_DIR})
155
156
157
158
159 --
160 gentoo-commits@l.g.o mailing list