From a1f9d3975d27373066ea9ca9d4f33f01ce5634a1 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 14 Jul 2014 17:06:49 -0400 Subject: [PATCH] Strigi: add working recipe. --- app-misc/strigi/patches/strigi-0.7.5.patch | 105 ++++++++++++++++++++ app-misc/strigi/patches/strigi-0.7.8.patch | 40 -------- app-misc/strigi/strigi-0.7.5.recipe | 106 +++++++++++++++++++++ 3 files changed, 211 insertions(+), 40 deletions(-) create mode 100644 app-misc/strigi/patches/strigi-0.7.5.patch delete mode 100644 app-misc/strigi/patches/strigi-0.7.8.patch create mode 100644 app-misc/strigi/strigi-0.7.5.recipe diff --git a/app-misc/strigi/patches/strigi-0.7.5.patch b/app-misc/strigi/patches/strigi-0.7.5.patch new file mode 100644 index 000000000..68a3ace59 --- /dev/null +++ b/app-misc/strigi/patches/strigi-0.7.5.patch @@ -0,0 +1,105 @@ +From 963443070677dc28be0edba24053dede8560fb2e Mon Sep 17 00:00:00 2001 +From: Augustin Cavalier +Date: Mon, 14 Jul 2014 16:33:25 -0400 +Subject: [PATCH] Fix Strigi on Haiku. + +--- + libstreamanalyzer/lib/saxeventanalyzer.cpp | 2 +- + strigiclient/lib/CMakeLists.txt | 1 - + strigiclient/lib/searchclient/CMakeLists.txt | 4 +++- + strigidaemon/CMakeLists.txt | 2 +- + strigidaemon/bin/daemon/eventlistener/eventlistenerqueue.cpp | 2 +- + strigidaemon/bin/daemon/strigithread.cpp | 3 ++- + 6 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/libstreamanalyzer/lib/saxeventanalyzer.cpp b/libstreamanalyzer/lib/saxeventanalyzer.cpp +index 1e5b386..d37857c 100644 +--- a/libstreamanalyzer/lib/saxeventanalyzer.cpp ++++ b/libstreamanalyzer/lib/saxeventanalyzer.cpp +@@ -27,7 +27,7 @@ + #include + + #ifndef LIBXML_THREAD_ENABLED +-#error Strigi needs a thread safe version of libxml2 ++#warning Strigi needs a thread safe version of libxml2 + #endif + + using namespace Strigi; +diff --git a/strigiclient/lib/CMakeLists.txt b/strigiclient/lib/CMakeLists.txt +index ba07497..c5be26d 100644 +--- a/strigiclient/lib/CMakeLists.txt ++++ b/strigiclient/lib/CMakeLists.txt +@@ -1,4 +1,3 @@ + if(NOT WIN32) + add_subdirectory(htmlgui) + endif(NOT WIN32) +-add_subdirectory(searchclient) +diff --git a/strigiclient/lib/searchclient/CMakeLists.txt b/strigiclient/lib/searchclient/CMakeLists.txt +index 9ddce18..061f481 100644 +--- a/strigiclient/lib/searchclient/CMakeLists.txt ++++ b/strigiclient/lib/searchclient/CMakeLists.txt +@@ -1,4 +1,6 @@ +-add_subdirectory(qtdbus) ++if(ENABLE_DBUS) ++ add_subdirectory(qtdbus) ++endif(ENABLE_DBUS) + # disable searchclient for now + if(NOT WIN32) + add_subdirectory(filterwidget) +diff --git a/strigidaemon/CMakeLists.txt b/strigidaemon/CMakeLists.txt +index 759b72c..53d774a 100644 +--- a/strigidaemon/CMakeLists.txt ++++ b/strigidaemon/CMakeLists.txt +@@ -115,7 +115,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LibSearchClientConfig.cmake + DESTINATION ${LIB_DESTINATION}/libsearchclient) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "") + add_executable(strigidaemon dummy.cpp) +-target_link_libraries(strigidaemon libstrigidaemon) ++target_link_libraries(strigidaemon libstrigidaemon network) + install(TARGETS strigidaemon + RUNTIME DESTINATION bin) + # library +diff --git a/strigidaemon/bin/daemon/eventlistener/eventlistenerqueue.cpp b/strigidaemon/bin/daemon/eventlistener/eventlistenerqueue.cpp +index 9fcdcb1..88dae45 100644 +--- a/strigidaemon/bin/daemon/eventlistener/eventlistenerqueue.cpp ++++ b/strigidaemon/bin/daemon/eventlistener/eventlistenerqueue.cpp +@@ -27,7 +27,7 @@ + #include + #include + +-#if defined(__SUNPRO_CC) ++#if defined(__SUNPRO_CC) || defined(__HAIKU__) + #include + #endif + +diff --git a/strigidaemon/bin/daemon/strigithread.cpp b/strigidaemon/bin/daemon/strigithread.cpp +index f2ddaed..ce87f70 100644 +--- a/strigidaemon/bin/daemon/strigithread.cpp ++++ b/strigidaemon/bin/daemon/strigithread.cpp +@@ -30,7 +30,6 @@ + #include + #include + #include +-#include + + // define two enums and a constant for use of ioprio + enum { +@@ -107,6 +106,7 @@ threadstarter(void *d) { + param.sched_priority = 0; + StrigiThread* thread = static_cast(d); + ++#ifndef __HAIKU__ + #ifndef __APPLE__ + if (thread->getPriority() > 0) { + #ifndef SCHED_BATCH +@@ -138,6 +138,7 @@ threadstarter(void *d) { + #endif + } + #endif ++#endif + + // start the actual work + thread->run(0); +-- +1.8.3.4 + diff --git a/app-misc/strigi/patches/strigi-0.7.8.patch b/app-misc/strigi/patches/strigi-0.7.8.patch deleted file mode 100644 index 8b6d07c7a..000000000 --- a/app-misc/strigi/patches/strigi-0.7.8.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- strigi-0.7.8-orig/strigidaemon/CMakeLists.txt 2013-01-25 17:49:35.005767168 +0000 -+++ strigi-0.7.8/strigidaemon/CMakeLists.txt 2013-02-13 00:55:35.019660800 +0000 -@@ -126,6 +126,6 @@ - DESTINATION ${LIB_DESTINATION}/cmake/LibSearchClient) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "") - add_executable(strigidaemon dummy.cpp) --target_link_libraries(strigidaemon libstrigidaemon) -+target_link_libraries(strigidaemon libstrigidaemon network) - install(TARGETS strigidaemon - RUNTIME DESTINATION bin) - ---- strigi-0.7.8-orig/strigidaemon/bin/daemon/strigithread.cpp 2013-01-25 17:49:35.020971520 +0000 -+++ strigi-0.7.8/strigidaemon/bin/daemon/strigithread.cpp 2013-02-13 00:52:47.447741952 +0000 -@@ -30,7 +30,9 @@ - #include - #include - #include -+#ifndef __HAIKU__ - #include -+#endif - - // define two enums and a constant for use of ioprio - enum { -@@ -108,6 +110,7 @@ - StrigiThread* thread = static_cast(d); - - #ifndef __APPLE__ -+#ifndef __HAIKU__ - if (thread->getPriority() > 0) { - // renice the thread - int r = setpriority(PRIO_PROCESS, 0, thread->getPriority()); -@@ -139,7 +142,7 @@ - #endif - } - #endif -- -+#endif - // start the actual work - thread->run(0); - STRIGI_LOG_DEBUG(string("strigi.daemon.") + thread->name + ".threadstarter", "end of thread"); diff --git a/app-misc/strigi/strigi-0.7.5.recipe b/app-misc/strigi/strigi-0.7.5.recipe new file mode 100644 index 000000000..caee36691 --- /dev/null +++ b/app-misc/strigi/strigi-0.7.5.recipe @@ -0,0 +1,106 @@ +SUMMARY="Desktop search daemon." +DESCRIPTION="Strigi is a desktop search daemon, which is operating \ +system-independent and desktop-independent. Strigi's goals are to be fast, \ +use a small amount of RAM, and use flexible backends and plug-ins. Like most \ +desktop search systems, Strigi can extract information from files, such as \ +the length of an audio clip, the contents of a document, or the resolution \ +of a picture; plugins determine what filetypes it is capable of handling." +HOMEPAGE="http://strigi.sourceforge.net" +SRC_URI="http://downloads.sourceforge.net/project/strigi/strigi/strigi-0.7.5.tar.bz2" +CHECKSUM_SHA256="111f5e3ede171292302b906418af0175445ca01958d40fb54879f80620b5189b" +REVISION="1" +LICENSE="GNU LGPL v2.1" +COPYRIGHT="2011 Jos van den Oever" +ARCHITECTURES="x86" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +fi + +SECONDARY_ARCHITECTURES="x86" + +PATCHES="strigi-0.7.5.patch" + +PROVIDES=" + strigi${secondaryArchSuffix} = $portVersion + lib:libstreamanalyzer$secondaryArchSuffix = $portVersion + lib:libstreams$secondaryArchSuffix = $portVersion + lib:libsearchclient$secondaryArchSuffix = $portVersion + lib:libstrigihtmlgui$secondaryArchSuffix = $portVersion + cmd:deepfind + cmd:deepgrep + cmd:rdfindexer + cmd:strigicmd + cmd:strigidaemon + cmd:xmlindexer + " + +REQUIRES=" + haiku${secondaryArchSuffix} >= $haikuVersion + lib:libz$secondaryArchSuffix + lib:libbz2$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + lib:libxml2$secondaryArchSuffix + cmd:perl + " + +BUILD_PREREQUIRES=" + cmd:cmake + cmd:pkg_config$secondaryArchSuffix + cmd:perl + cmd:make + cmd:g++${secondaryArchSuffix} + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + devel:libz$secondaryArchSuffix + devel:libbz2$secondaryArchSuffix + devel:libiconv$secondaryArchSuffix + devel:libxml2$secondaryArchSuffix + " + +PROVIDES_devel=" + strigi${secondaryArchSuffix}_devel = $portVersion + devel:libstreamanalyzer$secondaryArchSuffix = $portVersion + devel:libstreams$secondaryArchSuffix = $portVersion + devel:libsearchclient$secondaryArchSuffix = $portVersion + devel:libstrigihtmlgui$secondaryArchSuffix = $portVersion + " + +REQUIRES_devel=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + " + +BUILD() +{ + cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_DBUS=off + make $jobArgs +} + +INSTALL() +{ + make install + + # Clean up after CMake + mkdir -p $includeDir + mkdir -p $libDir + + mkdir -p $developLibDir/pkgconfig/ + mv -f $prefix/lib/pkgconfig/* $developLibDir/pkgconfig/ + rm -rf $prefix/lib/pkgconfig/ + + mv -f $prefix/lib/*.so* $libDir + cp -rf $prefix/include/* $includeDir/ + rm -rf $prefix/include/ + + prepareInstalledDevelLibs \ + libstreamanalyzer \ + libstreams \ + libsearchclient \ + libstrigihtmlgui + packageEntries devel \ + $developDir +}