Magellan Linux

Annotation of /trunk/strigi/patches/strigi-0.5.7-automagic-deps.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 429 - (hide annotations) (download)
Thu Dec 13 23:32:43 2007 UTC (16 years, 5 months ago) by niro
File size: 9387 byte(s)
-strigi automagic deps

1 niro 429 Patch by Evgeny Egorochkin <phreedom.stdin@gmail.com>
2    
3     Index: cmake/MacroFindOptionalDep.cmake
4     ===================================================================
5     --- a/cmake/MacroFindOptionalDep.cmake (revision 0)
6     +++ b/cmake/MacroFindOptionalDep.cmake (revision 0)
7     @@ -0,0 +1,35 @@
8     +# if ON, requested optional deps become required
9     +# if OFF, requested optional deps are linked to if found
10     +
11     +# macro name changed from FIND_OPTIONAL_PACKAGE to FIND_OPTIONAL_DEP due to clash with a macro from KDE4
12     +
13     +OPTION(FORCE_DEPS "Enforce strict dependencies" OFF)
14     +
15     +macro(FIND_OPTIONAL_DEP _package _enabled _found _description)
16     +
17     + if(${_enabled})
18     + if(FORCE_DEPS)
19     + find_package(${_package} REQUIRED)
20     + else(FORCE_DEPS)
21     + find_package(${_package})
22     + endif(FORCE_DEPS)
23     + endif(${_enabled})
24     +
25     + REPORT_OPTIONAL_PACKAGE_STATUS(${_package} ${_enabled} ${_found} ${_description})
26     +
27     +endmacro(FIND_OPTIONAL_DEP)
28     +
29     +
30     +macro(REPORT_OPTIONAL_PACKAGE_STATUS _package _enabled _found _description)
31     +
32     + if(${_enabled})
33     + if(${_found})
34     + MESSAGE("** ${_package} is found. Support for ${_description} is enabled")
35     + else(${_found})
36     + MESSAGE("** ${_package} not found. Support for ${_description} is disabled")
37     + endif(${_found})
38     + else(${_enabled})
39     + MESSAGE("** ${_package} is disabled. No support for ${_description}")
40     + endif(${_enabled})
41     +
42     +endmacro(REPORT_OPTIONAL_PACKAGE_STATUS)
43     \ No newline at end of file
44     Index: src/xsd/CMakeLists.txt
45     ===================================================================
46     --- a/src/xsd/CMakeLists.txt (revision 730316)
47     +++ b/src/xsd/CMakeLists.txt (working copy)
48     @@ -20,7 +20,8 @@
49     endif (LIBXML2_FOUND)
50    
51     # java is required to compile the xsd parser
52     -find_package(Java REQUIRED)
53     +OPTION(ENABLE_REGENERATEXSD "regenerate xsd parser from *.xsd files(not normally required)" ON)
54     +FIND_OPTIONAL_DEP(Java ENABLE_REGENERATEXSD JAVA_COMPILE "generating xsd parser from *.xsd files")
55    
56     # loop over all xsd files, the next line does not work everywhere,
57     # so we dont use it currently
58     @@ -57,4 +58,3 @@
59     target_link_libraries(${XSDNAME}test ${XSDNAME} xmlstream)
60    
61     endforeach (XSDFILE ${XSDFILES})
62     -
63     Index: src/streamanalyzer/endplugins/CMakeLists.txt
64     ===================================================================
65     --- a/src/streamanalyzer/endplugins/CMakeLists.txt (revision 730316)
66     +++ b/src/streamanalyzer/endplugins/CMakeLists.txt (working copy)
67     @@ -22,9 +22,9 @@
68     install(TARGETS ${libname} LIBRARY DESTINATION ${LIB_DESTINATION}/strigi)
69     ENDMACRO(ADD_STRIGIEA)
70    
71     -if(EXIV2_FOUND)
72     +if(Exiv2_FOUND)
73     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
74     include_directories(${EXIV2_INCLUDE_DIR})
75     ADD_STRIGIEA(jpeg jpegendanalyzer.cpp)
76     target_link_libraries(jpeg ${EXIV2_LIBRARIES})
77     -endif(EXIV2_FOUND)
78     +endif(Exiv2_FOUND)
79     Index: src/CMakeLists.txt
80     ===================================================================
81     --- a/src/CMakeLists.txt (revision 730316)
82     +++ b/src/CMakeLists.txt (working copy)
83     @@ -32,7 +32,7 @@
84    
85     if (NOT CLucene_FOUND)
86     message("** No CLucene libraries were found, so Strigi cannot use indexes.")
87     - message("** It is recommended to install CLucene >= 0.9.16.")
88     + message("** It is recommended to install CLucene >= 0.9.16a.")
89     message("** You will still be able to use deepfind, deepgrep and xmlindexer.")
90     endif (NOT CLucene_FOUND)
91    
92     Index: CMakeLists.txt
93     ===================================================================
94     --- a/CMakeLists.txt (revision 730316)
95     +++ b/CMakeLists.txt (working copy)
96     @@ -16,6 +16,7 @@
97     # include general modules
98     include(UsePkgConfig)
99     include(MacroCheckGccVisibility)
100     +include(MacroFindOptionalDep)
101    
102     # compile in debug mode
103     IF(NOT CMAKE_BUILD_TYPE)
104     @@ -67,52 +68,48 @@
105     REMOVE_DEFINITIONS(-fPIC)
106     ENDIF(CMAKE_SYSTEM MATCHES "SunOS-5*.")
107    
108     -OPTION(ENABLE_INOTIFY
109     - "enable inotify support (unstable)"
110     - OFF)
111     +OPTION(ENABLE_INOTIFY "enable inotify support (unstable)" OFF)
112     +OPTION(ENABLE_DBUS "enable dbus support" ON)
113     +OPTION(ENABLE_NEWXESAM "enable new xesam support" OFF)
114     +OPTION(ENABLE_LOG4CXX "enable log4cxx support for advanced logging" OFF)
115     +OPTION(ENABLE_CPPUNIT "enable CppUnit for unit tests" ON)
116     +OPTION(ENABLE_QT4 "enable Qt4 GUI" ON)
117     +OPTION(ENABLE_EXIV2
118     + "enable exiv2 support. This allows you to index EXIF/IPTC metadata." ON)
119    
120     -OPTION(ENABLE_DBUS
121     - "enable dbus support"
122     - ON)
123     +# backends
124     +OPTION(ENABLE_CLUCENE "enable CLucene support (recommended)" ON)
125     +OPTION(ENABLE_HYPERESTRAIER "enable Hyper Estraier support(unreliable)" OFF)
126     +OPTION(ENABLE_SQLITE "enable SQLite support(unreliable)" OFF)
127    
128     -OPTION(ENABLE_NEWXESAM
129     - "enable new xesam support"
130     - OFF)
131     +#OPTION(ENABLE_LIBXML2 "enable libxml2 support" ON)
132     +OPTION(ENABLE_EXPAT "enable expat support" OFF)
133    
134     -OPTION(ENABLE_SQLITE "enable sqlite support" OFF)
135    
136     -OPTION(ENABLE_LOG4CXX
137     - "enable log4cxx support for advanced logging"
138     - OFF)
139     -
140     find_package(ZLIB REQUIRED)
141     find_package(BZip2 REQUIRED)
142     find_package(Threads REQUIRED)
143     find_package(Iconv REQUIRED)
144    
145     # use either expat or libxml2
146     -find_package(Expat)
147     +FIND_OPTIONAL_DEP(Expat ENABLE_EXPAT Expat_FOUND "XML via Expat")
148     +# libxml seems to be required regardless of what because it's used by streamanalyzer
149     +#FIND_OPTIONAL_DEP(LibXml2 ENABLE_LIBXML2 LIBXML2_FOUND "XML via LibXml2")
150     find_package(LibXml2 REQUIRED)
151     +
152     if (NOT LIBXML2_FOUND AND NOT Expat_FOUND)
153     - MESSAGE(FATAL "You need libxml2 or libexpat")
154     + MESSAGE(FATAL_ERROR "You need libxml2 or libexpat")
155     endif (NOT LIBXML2_FOUND AND NOT Expat_FOUND)
156    
157     -find_package(CLucene)
158     -if(NOT CLucene_FOUND)
159     - MESSAGE("Could not find CLucene. Please install CLucene = 0.9.16a (http://clucene.sf.net)")
160     -endif(NOT CLucene_FOUND)
161     +FIND_OPTIONAL_DEP(CLucene ENABLE_CLUCENE CLucene_FOUND "CLucene backend")
162     +FIND_OPTIONAL_DEP(HyperEstraier ENABLE_HYPERESTRAIER HyperEstraier_FOUND "HyperEstraier backend")
163     +FIND_OPTIONAL_DEP(SQLite ENABLE_SQLITE SQLite_FOUND "SQLite backend")
164    
165     -find_package(HyperEstraier)
166     -find_package(Exiv2)
167     -if(ENABLE_SQLITE)
168     - find_package(SQLite)
169     -endif(ENABLE_SQLITE)
170     +FIND_OPTIONAL_DEP(Exiv2 ENABLE_EXIV2 EXIV2_FOUND "indexing of EXIF/IPTC metadata")
171     +
172     #find_package(XAttr)
173     set(QT_MIN_VERSION "4.2.0")
174     -find_package(Qt4)
175     -if (NOT QT4_FOUND)
176     - MESSAGE("** Qt4 was not found. No GUI will be built.")
177     -endif (NOT QT4_FOUND)
178     +FIND_OPTIONAL_DEP(Qt4 ENABLE_QT4 QT4_FOUND "QT4 GUI client")
179    
180     check_include_files(strings.h HAVE_STRINGS_H) # various
181    
182     @@ -129,35 +126,40 @@
183     ELSE(WIN32)
184     include(UsePkgConfig)
185     PKGCONFIG(dbus-1 DBUS_INCLUDE_DIR DBUS_LIBRARY_DIR DBUS_LDFLAGS DBUS_CFLAGS)
186     - if (NOT DBUS_INCLUDE_DIR)
187     - MESSAGE(FATAL_ERROR "Could not find DBus")
188     - endif (NOT DBUS_INCLUDE_DIR)
189    
190     - EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=1.0 dbus-1 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
191     - if(_return_VALUE STREQUAL "0")
192     - message(STATUS "Found dbus-1 release >= 1.0")
193     - else(_return_VALUE STREQUAL "0")
194     - message(STATUS "Found dbus-1 release < 1.0 support for dbus client will be disable")
195     - set(ENABLE_DBUS "OFF")
196     - endif(_return_VALUE STREQUAL "0")
197     + if (DBUS_INCLUDE_DIR)
198     + EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=1.0 dbus-1 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
199     + if(_return_VALUE STREQUAL "0")
200     + message(STATUS "Found dbus-1 release >= 1.0")
201     + set(DBUS_FOUND "ON")
202     + else(_return_VALUE STREQUAL "0")
203     + message(STATUS "Found dbus-1 release < 1.0. Release >=1.0 is needed")
204     + endif(_return_VALUE STREQUAL "0")
205     + endif (DBUS_INCLUDE_DIR)
206    
207     + REPORT_OPTIONAL_PACKAGE_STATUS(DBus-1 ENABLE_DBUS DBUS_FOUND "DBus interface in Strigi daemon")
208     + if(NOT DBUS_FOUND)
209     + set(ENABLE_DBUS "OFF")
210     + if(FORCE_DEPS)
211     + MESSAGE(FATAL_ERROR "Aborting")
212     + endif(FORCE_DEPS)
213     + endif(NOT DBUS_FOUND)
214     +
215     ENDIF(WIN32)
216     ENDIF(ENABLE_DBUS)
217    
218     -find_program (BISON
219     - bison
220     - DOC "Path to bison command, used for xesam userlanguage parser generation"
221     -)
222     +# Don't delete bison section, but only micron seems to need this
223     +#find_program (BISON
224     +# bison
225     +# DOC "Path to bison command, used for xesam userlanguage parser generation")
226    
227     -if (BISON)
228     - MESSAGE (STATUS "Found bison: ${BISON}")
229     -else (BISON)
230     - MESSAGE ("** GNU bison not found. This affects the xesam parser.")
231     -endif (BISON)
232     +#if (BISON)
233     +# MESSAGE (STATUS "Found bison: ${BISON}")
234     +#else (BISON)
235     +# MESSAGE ("** GNU bison not found. This affects the xesam parser.")
236     +#endif (BISON)
237    
238     -if (ENABLE_LOG4CXX)
239     - find_package (Log4cxx)
240     -endif (ENABLE_LOG4CXX)
241     +FIND_OPTIONAL_DEP(Log4cxx ENABLE_LOG4CXX LOG4CXX_FOUND "advanced logging")
242    
243     #
244     # AC_CHECK_LIB(dl, dlopen, DL_LIBRARY="-ldl", DL_LIBRARY="") for cmake by
245     @@ -189,13 +191,10 @@
246    
247     SET (DIRS ${DIRS} src)
248    
249     -find_package(CppUnit)
250     -if (NOT CppUnit_FOUND)
251     - MESSAGE("** CppUnit was not found. Strigi unit tests will not be built.")
252     -else (NOT CppUnit_FOUND)
253     - MESSAGE(STATUS "CppUnit found. Strigi unit tests will be built.")
254     +FIND_OPTIONAL_DEP(CppUnit ENABLE_CPPUNIT CppUnit_FOUND "Strigi unit tests")
255     +if (CppUnit_FOUND)
256     SET (DIRS ${DIRS} tests)
257     -endif (NOT CppUnit_FOUND)
258     +endif (CppUnit_FOUND)
259    
260     ENABLE_TESTING()
261     SUBDIRS (${DIRS})