Permalink
Browse files

use PDL for non-core resolver plugins

  • Loading branch information...
1 parent 051aa3f commit e0a49b8098e5bad97b617a3e7e88c8dd935f73a9 @RJ committed Mar 8, 2009
Showing with 2,890 additions and 501 deletions.
  1. +21 −46 playdar-daemon/CMakeLists.txt
  2. BIN playdar-daemon/deps/pdl-0.3.0/AUTHORS
  3. +167 −0 playdar-daemon/deps/pdl-0.3.0/CMakeLists.txt
  4. +13 −0 playdar-daemon/deps/pdl-0.3.0/ChangeLog
  5. +265 −0 playdar-daemon/deps/pdl-0.3.0/Doxyfile
  6. +4 −0 playdar-daemon/deps/pdl-0.3.0/INSTALL
  7. +24 −0 playdar-daemon/deps/pdl-0.3.0/LICENSE
  8. 0 playdar-daemon/deps/pdl-0.3.0/NEWS
  9. +1 −0 playdar-daemon/deps/pdl-0.3.0/README
  10. +7 −0 playdar-daemon/deps/pdl-0.3.0/TESTING
  11. +1 −0 playdar-daemon/deps/pdl-0.3.0/TODO
  12. +191 −0 playdar-daemon/deps/pdl-0.3.0/doc/Introduction.html
  13. +76 −0 playdar-daemon/deps/pdl-0.3.0/doc/Readme.html
  14. +92 −0 playdar-daemon/deps/pdl-0.3.0/include/DynamicClass.hpp
  15. +136 −0 playdar-daemon/deps/pdl-0.3.0/include/DynamicLibrary.hpp
  16. +94 −0 playdar-daemon/deps/pdl-0.3.0/include/DynamicLibraryManager.hpp
  17. +176 −0 playdar-daemon/deps/pdl-0.3.0/include/DynamicLoader.hpp
  18. +75 −0 playdar-daemon/deps/pdl-0.3.0/include/LoaderException.hpp
  19. +84 −0 playdar-daemon/deps/pdl-0.3.0/include/platform.h
  20. +226 −0 playdar-daemon/deps/pdl-0.3.0/src/DynamicLibrary.cpp
  21. +142 −0 playdar-daemon/deps/pdl-0.3.0/src/DynamicLibraryManager.cpp
  22. +89 −0 playdar-daemon/deps/pdl-0.3.0/src/DynamicLoader.cpp
  23. +66 −0 playdar-daemon/deps/pdl-0.3.0/src/LoaderException.cpp
  24. +45 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestClass1.cpp
  25. +63 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestClass1.hpp
  26. +45 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestClass2.cpp
  27. +63 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestClass2.hpp
  28. +127 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestDynamicLibrary.cpp
  29. +96 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestDynamicLibraryManager.cpp
  30. +80 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestDynamicLoader.cpp
  31. +53 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestInterface.hpp
  32. +71 −0 playdar-daemon/deps/pdl-0.3.0/tests/TestLoaderException.cpp
  33. +42 −0 playdar-daemon/deps/pdl-0.3.0/tests/UnitTest.hpp
  34. +0 −1 playdar-daemon/playdar.kdevelop.filelist
  35. BIN playdar-daemon/playdar.kdevelop.pcs
  36. +2 −78 playdar-daemon/playdar.kdevses
  37. +3 −1 playdar-daemon/src/playdar/main.cpp
  38. +49 −0 playdar-daemon/src/resolvers/darknet/CMakeLists.txt
  39. +8 −17 playdar-daemon/src/resolvers/darknet/rs_darknet.cpp
  40. +14 −8 playdar-daemon/src/resolvers/darknet/rs_darknet.h
  41. +49 −0 playdar-daemon/src/resolvers/gateway_script/CMakeLists.txt
  42. +4 −0 playdar-daemon/src/resolvers/gateway_script/README.txt
  43. +13 −8 playdar-daemon/src/resolvers/{rs_http_gateway_script.cpp → gateway_script/gateway_script.cpp}
  44. +7 −3 playdar-daemon/src/resolvers/{rs_http_gateway_script.h → gateway_script/gateway_script.h}
  45. +2 −2 playdar-daemon/src/resolvers/lan/CMakeLists.txt
  46. +71 −7 playdar-daemon/src/resolvers/resolver.cpp
  47. +3 −0 playdar-daemon/src/resolvers/resolver.h
  48. +16 −4 playdar-daemon/src/resolvers/resolver_service.h
  49. +4 −1 playdar-daemon/src/resolvers/rs_http_playdar.h
  50. +0 −273 playdar-daemon/src/resolvers/rs_lan_udp.cpp
  51. +0 −47 playdar-daemon/src/resolvers/rs_lan_udp.h
  52. +5 −3 playdar-daemon/src/resolvers/rs_local_library.cpp
  53. +5 −2 playdar-daemon/src/resolvers/rs_local_library.h
@@ -5,21 +5,25 @@ SET(CMAKE_MODULE_PATH "CMakeModules")
FIND_PACKAGE(Taglib 1.5.0 REQUIRED)
FIND_PACKAGE(Boost 1.35 REQUIRED COMPONENTS filesystem system regex thread program_options)
FIND_PACKAGE(OsspUuid)
-FIND_PACKAGE(UriParser 0.7.0)
+#FIND_PACKAGE(Uriparser 0.7.0)
FIND_PACKAGE(Sqlite3)
-INCLUDE_DIRECTORIES(${URIPARSER_INCLUDE_DIR}
+INCLUDE_DIRECTORIES(#${URIPARSER_INCLUDE_DIR}
${OSSPUUID_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${TAGLIB_INCLUDES}
+ /usr/local/include
src
deps/moost_http/include # our httpd server, from erikf's moost
deps/sqlite3pp-read-only # cpp wrapper for sqlite api
deps/json_spirit_v3.00 # json parser, using boost spirit
- deps/boost.process # x-platform spawn processes and manage stdin/out
+ deps/pdl-0.3.0/include # x-platform dynamic loading of libraries
)
+LINK_DIRECTORIES(/usr/local/lib) # for uriparser
+
+
SET(CMAKE_VERBOSE_MAKEFILE ON)
INCLUDE(InstallRequiredSystemLibraries)
@@ -55,29 +59,36 @@ ADD_EXECUTABLE( playdar
src/resolvers/resolver.cpp
src/resolvers/resolver_service.cpp
src/resolvers/rs_local_library.cpp
- src/resolvers/rs_lan_udp.cpp
- src/resolvers/rs_http_gateway_script.cpp
- src/resolvers/darknet/rs_darknet.cpp
- src/resolvers/darknet/servent.cpp
src/library/library.cpp
src/playdar/playdar_request_handler.cpp
+ src/playdar/main.cpp
+
+ # sqlite wrapper:
deps/sqlite3pp-read-only/sqlite3pp.cpp
+
+ # json parser:
deps/json_spirit_v3.00/json_spirit/json_spirit_reader.cpp
deps/json_spirit_v3.00/json_spirit/json_spirit_value.cpp
deps/json_spirit_v3.00/json_spirit/json_spirit_writer.cpp
- src/playdar/main.cpp
+
# moost http:
deps/moost_http/src/http/filesystem_request_handler.cpp
deps/moost_http/src/http/mime_types.cpp
deps/moost_http/src/http/reply.cpp
deps/moost_http/src/http/request_parser.cpp
- )
+ # Portable Dynamic Loader:
+ deps/pdl-0.3.0/src/DynamicLibrary.cpp
+ deps/pdl-0.3.0/src/DynamicLibraryManager.cpp
+ deps/pdl-0.3.0/src/DynamicLoader.cpp
+ deps/pdl-0.3.0/src/LoaderException.cpp
+ )
TARGET_LINK_LIBRARIES( playdar
${TAGLIB_LIBRARIES} # LGPL/MPL
${SQLITE3_LIBRARIES} # public domain
- ${URIPARSER_LIBRARIES} # BSD
+ #${URIPARSER_LIBRARIES} # BSD
+ uriparser
${OSSPUUID_LIBRARIES} # BSD-like
${Boost_REGEX_LIBRARY} # Boost license
${Boost_SYSTEM_LIBRARY}
@@ -86,42 +97,6 @@ TARGET_LINK_LIBRARIES( playdar
${Boost_PROGRAM_OPTIONS_LIBRARY}
)
-#cui18n icuuc icudata icuio #TODO ;)
-
-
INSTALL(TARGETS scanner RUNTIME DESTINATION bin)
INSTALL(TARGETS playdar RUNTIME DESTINATION bin)
-
-
-########### CPack
-# this isn't really working properly yet
-
-SET(CPACK_GENERATOR "DEB") # "DEB;TGZ;TBZ"...;TGZ;TZ")
-
-SET(CPACK_PACKAGE_VERSION "0.1.0")
-SET(CPACK_PACKAGE_VERSION_MAJOR "0")
-SET(CPACK_PACKAGE_VERSION_MINOR "1")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
-
-SET(CPACK_DEBIAN_PACKAGE_NAME "playdar")
-SET(CPACK_DEBIAN_PACKAGE_DEPENDS "sqlite3 (>=3), libtag1-dev (>=1.5), liburiparser1 (>=0.6), liburiparser-dev (>=0.6), libossp-uuid-dev (>=1.5), libossp-uuid15 (>=1.5)")
-SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "rj@playdar.org")
-SET(CPACK_DEBIAN_PACKAGE_SECTION "utils")
-
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Playdar - the music content resolver service")
-
-SET(CPACK_PACKAGE_VENDOR "www.playdar.org")
-SET(CPACK_PACKAGE_DESCRIPTION_FILE "README.txt")
-SET(CPACK_RESOURCE_FILE_LICENSE "LICENSE.txt")
-SET(CPACK_RESOURCE_FILE_WELCOME "README.txt")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Playdar ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
-SET(CPACK_SOURCE_PACKAGE_FILE_NAME "playdar-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
-SET(CPACK_SYSTEM_NAME "linux-i686")
-
-#IF(UNIX)
-# SET(CPACK_STRIP_FILES "bin/playdar;bin/scanner")
-# SET(CPACK_SOURCE_STRIP_FILES "")
-# SET(CPACK_PACKAGE_EXECUTABLES "playdar" "scanner")
-#ENDIF(UNIX)
-INCLUDE(CPack)
Binary file not shown.
@@ -0,0 +1,167 @@
+# ################################################################################
+# Project name
+#
+
+PROJECT(PDL)
+
+# ################################################################################
+# Project version
+#
+
+SET(PDL_VERSION_MAJOR 0)
+SET(PDL_VERSION_MINOR 3)
+SET(PDL_VERSION_PATCH 0)
+
+# ################################################################################
+# CMake version check
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.4.2 FATAL_ERROR)
+
+# ################################################################################
+# Check Includes
+#
+
+INCLUDE(CheckIncludeFiles)
+INCLUDE(CheckCXXSourceCompiles)
+
+INCLUDE_DIRECTORIES(include)
+
+# ################################################################################
+# Check libraries
+#
+
+IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+
+#DL_LIBRARY
+FIND_LIBRARY(DL_LIBRARY
+ NAMES dl
+ PATHS /opt/lib /usr/lib /usr/local/lib
+ DOC "Can't find DL library")
+
+ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+
+# ################################################################################
+# Compiler settings
+#
+
+IF(WIN32)
+ IF(NOT UNIX)
+ IF(NOT BORLAND)
+ IF(NOT MINGW )
+ SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
+ ENDIF(NOT MINGW )
+ ENDIF(NOT BORLAND)
+ ENDIF(NOT UNIX)
+ENDIF(WIN32)
+
+IF("${CMAKE_COMPILER_IS_GNUCXX}" MATCHES "1")
+SET(CMAKE_CXX_FLAGS "${CXX_FLAGS} -Wall -O3 -funroll-loops -pedantic -Wno-long-long")
+#SET(CMAKE_CXX_FLAGS "${CXX_FLAGS} -Wall -O3 -funroll-loops -pedantic -Wno-long-long -D_DEBUG")
+#SET(CMAKE_CXX_FLAGS "${CXX_FLAGS} -Wall -Wno-long-long -Weffc++ -pedantic -Wno-long-long -g")
+#SET(CMAKE_CXX_FLAGS "${CXX_FLAGS} -Wall -Wno-long-long -pedantic -Wno-long-long -g")
+ENDIF("${CMAKE_COMPILER_IS_GNUCXX}" MATCHES "1")
+
+# ################################################################################
+# Library source
+#
+
+SET(LIBSRC src/DynamicLibrary.cpp
+ src/DynamicLibraryManager.cpp
+ src/DynamicLoader.cpp
+ src/LoaderException.cpp )
+
+# ################################################################################
+# Library binary
+#
+
+ADD_LIBRARY( pdl SHARED ${LIBSRC} )
+IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+TARGET_LINK_LIBRARIES( pdl c ${DL_LIBRARY})
+ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+SET_TARGET_PROPERTIES( pdl PROPERTIES OUTPUT_NAME pdl )
+SET_TARGET_PROPERTIES( pdl PROPERTIES LINKER_LANGUAGE CXX )
+SET_TARGET_PROPERTIES( pdl PROPERTIES DEFINE_SYMBOL PDL_EXPORT )
+SET_TARGET_PROPERTIES( pdl PROPERTIES COMPILE_FLAGS -DPDL_SHARED )
+SET_TARGET_PROPERTIES( pdl PROPERTIES VERSION ${PDL_VERSION_MAJOR}.${PDL_VERSION_MINOR}.${PDL_VERSION_PATCH}
+ SOVERSION ${PDL_VERSION_MAJOR} )
+
+ADD_LIBRARY( pdl-st STATIC ${LIBSRC} )
+IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+TARGET_LINK_LIBRARIES( pdl-st c ${DL_LIBRARY} )
+ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+SET_TARGET_PROPERTIES( pdl-st PROPERTIES OUTPUT_NAME pdl-st )
+SET_TARGET_PROPERTIES( pdl-st PROPERTIES LINKER_LANGUAGE CXX )
+SET_TARGET_PROPERTIES( pdl-st PROPERTIES VERSION ${PDL_VERSION_MAJOR}.${PDL_VERSION_MINOR}.${PDL_VERSION_PATCH}
+ SOVERSION ${PDL_VERSION_MAJOR} )
+
+# ################################################################################
+# Installation
+
+# Install headers
+INSTALL( FILES include/platform.h
+ include/DynamicClass.hpp
+ include/DynamicLoader.hpp
+ include/LoaderException.hpp
+ DESTINATION include/pdl)
+
+# Install binaries
+INSTALL( TARGETS pdl
+ pdl-st
+ DESTINATION lib )
+
+
+# ################################################################################
+# Test suite
+#
+
+ENABLE_TESTING()
+
+# Test libraries
+ADD_LIBRARY( test_module1 SHARED tests/TestClass1.cpp )
+SET_TARGET_PROPERTIES( test_module1 PROPERTIES OUTPUT_NAME test_module1 )
+ADD_LIBRARY( test_module2 SHARED tests/TestClass2.cpp )
+SET_TARGET_PROPERTIES( test_module2 PROPERTIES OUTPUT_NAME test_module2 )
+
+# Test LoaderException class
+ADD_EXECUTABLE( TestLoaderException tests/TestLoaderException.cpp
+ ${LIBSRC} )
+IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+TARGET_LINK_LIBRARIES( TestLoaderException ${DL_LIBRARY})
+ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+ADD_TEST( TestLoaderException TestLoaderException )
+
+# Test DynamicLibrary class
+ADD_EXECUTABLE( TestDynamicLibrary tests/TestDynamicLibrary.cpp
+ ${LIBSRC} )
+IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+TARGET_LINK_LIBRARIES( TestDynamicLibrary ${DL_LIBRARY})
+ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+IF (WIN32)
+ADD_TEST( TestDynamicLibrary TestDynamicLibrary test_module1.dll )
+ELSE (WIN32)
+ADD_TEST( TestDynamicLibrary TestDynamicLibrary ./libtest_module1 )
+ENDIF (WIN32)
+
+# Test DynamicLibraryManager class
+ADD_EXECUTABLE( TestDynamicLibraryManager tests/TestDynamicLibraryManager.cpp
+ ${LIBSRC} )
+IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+TARGET_LINK_LIBRARIES( TestDynamicLibraryManager ${DL_LIBRARY})
+ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+IF (WIN32)
+ADD_TEST( TestDynamicLibraryManager TestDynamicLibraryManager test_module1.dll test_module2.dll )
+ELSE (WIN32)
+ADD_TEST( TestDynamicLibraryManager TestDynamicLibraryManager ./libtest_module1 ./libtest_module2 )
+ENDIF (WIN32)
+
+# Test DynamicLoader class
+ADD_EXECUTABLE( TestDynamicLoader tests/TestDynamicLoader.cpp )
+TARGET_LINK_LIBRARIES( TestDynamicLoader pdl )
+IF (WIN32)
+ADD_TEST( TestDynamicLoader1 TestDynamicLoader test_module1.dll MyTestClass1 MyTestClass2 )
+ADD_TEST( TestDynamicLoader2 TestDynamicLoader test_module2.dll MyTestClass3 MyTestClass4 )
+ELSE (WIN32)
+ADD_TEST( TestDynamicLoader1 TestDynamicLoader ./libtest_module1 MyTestClass1 MyTestClass2 )
+ADD_TEST( TestDynamicLoader2 TestDynamicLoader ./libtest_module2 MyTestClass3 MyTestClass4 )
+ENDIF (WIN32)
@@ -0,0 +1,13 @@
+Thu Aug 16 11:27:00 2007 Igor Semenov <igor@progz.ru>
+
+ * PDL: initial release:
+ Developed and tested on Windows XP, FreeBSD 6.2 and Debian 2.6
+
+Thu Aug 21 15:40:00 2007 Igor Semenov <igor@progz.ru>
+ * Added Doxygen documentation
+
+Fri Sep 15 00:46:00 2007 Igor Semenov <igor@progz.ru>
+ * Added Readme.html and Introduction.html
+
+Fri Nov 16 14:10:00 2007 Igor Semenov <igor@progz.ru>
+ * Several small changes. Release 0.2.
Oops, something went wrong.

0 comments on commit e0a49b8

Please sign in to comment.