diff options
Diffstat (limited to 'vcpkg/ports/libodb')
| -rw-r--r-- | vcpkg/ports/libodb/CMakeLists.txt | 47 | ||||
| -rw-r--r-- | vcpkg/ports/libodb/config.unix.h.in | 20 | ||||
| -rw-r--r-- | vcpkg/ports/libodb/fix-linux.patch | 94 | ||||
| -rw-r--r-- | vcpkg/ports/libodb/odbConfig.cmake | 10 | ||||
| -rw-r--r-- | vcpkg/ports/libodb/portfile.cmake | 55 | ||||
| -rw-r--r-- | vcpkg/ports/libodb/vcpkg.json | 13 |
6 files changed, 239 insertions, 0 deletions
diff --git a/vcpkg/ports/libodb/CMakeLists.txt b/vcpkg/ports/libodb/CMakeLists.txt new file mode 100644 index 0000000..a49175a --- /dev/null +++ b/vcpkg/ports/libodb/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.0) +project(libodb VERSION 2.4.0 LANGUAGES CXX) +set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)") +configure_file(config.unix.h.in + ${CMAKE_CURRENT_SOURCE_DIR}/odb/details/config.h COPYONLY) + +file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + *.cxx) +if (WIN32) + list(FILTER libodb_src EXCLUDE REGEX /posix/.*) +elseif (UNIX) + list(FILTER libodb_src EXCLUDE REGEX /win32/.*) +endif() + +add_library(libodb ${libodb_src}) +target_include_directories(libodb + PUBLIC + $<INSTALL_INTERFACE:include> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> + +) +if(BUILD_SHARED_LIBS) + target_compile_definitions(libodb PRIVATE + -DLIBODB_DYNAMIC_LIB) +else() + target_compile_definitions(libodb PRIVATE + -DLIBODB_STATIC_LIB) +endif() +install(TARGETS libodb EXPORT odb_libodbConfig + COMPONENT libodb + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) +if(LIBODB_INSTALL_HEADERS) +install(DIRECTORY odb DESTINATION include/ + COMPONENT libodb + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hxx" + PATTERN "*.ixx" + PATTERN "*.txx" +) +endif() +install(EXPORT odb_libodbConfig NAMESPACE odb:: COMPONENT libodb DESTINATION share/odb) +export(TARGETS libodb NAMESPACE odb:: FILE odb_libodbConfig.cmake) diff --git a/vcpkg/ports/libodb/config.unix.h.in b/vcpkg/ports/libodb/config.unix.h.in new file mode 100644 index 0000000..4df77c5 --- /dev/null +++ b/vcpkg/ports/libodb/config.unix.h.in @@ -0,0 +1,20 @@ +/* odb/details/config.h. Generated from config.h.in by configure. */ +/* file : odb/details/config.h.in + * copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* This file is automatically processed by configure. */ + +#ifndef ODB_DETAILS_CONFIG_H +#define ODB_DETAILS_CONFIG_H + +/* #undef ODB_THREADS_NONE */ +#define ODB_THREADS_POSIX 1 +/* #undef ODB_THREADS_WIN32 */ +#define ODB_THREADS_TLS_KEYWORD 1 +/* #undef ODB_THREADS_TLS_DECLSPEC */ + +/* #undef LIBODB_STATIC_LIB */ + +#endif /* ODB_DETAILS_CONFIG_H */ diff --git a/vcpkg/ports/libodb/fix-linux.patch b/vcpkg/ports/libodb/fix-linux.patch new file mode 100644 index 0000000..9a2f2ea --- /dev/null +++ b/vcpkg/ports/libodb/fix-linux.patch @@ -0,0 +1,94 @@ +diff --git a/odb/details/shared-ptr/base.cxx b/odb/details/shared-ptr/base.cxx +index b95797b..6cf8ed7 100644 +--- a/odb/details/shared-ptr/base.cxx ++++ b/odb/details/shared-ptr/base.cxx +@@ -54,7 +54,7 @@ namespace odb + } + + void* +-operator new (size_t n, odb::details::share s) throw (std::bad_alloc) ++operator new (size_t n, odb::details::share s) + { + if (s == odb::details::shared) + { +@@ -74,7 +74,7 @@ operator new (size_t n, odb::details::share s) throw (std::bad_alloc) + } + + void +-operator delete (void* p, odb::details::share s) throw () ++operator delete (void* p, odb::details::share s) + { + // This version of operator delete is only called when the c-tor + // fails. In this case there is no object and we can just free the +diff --git a/odb/details/shared-ptr/base.hxx b/odb/details/shared-ptr/base.hxx +index 4a38945..1c951a8 100644 +--- a/odb/details/shared-ptr/base.hxx ++++ b/odb/details/shared-ptr/base.hxx +@@ -35,10 +35,10 @@ namespace odb + } + + LIBODB_EXPORT void* +-operator new (std::size_t, odb::details::share) throw (std::bad_alloc); ++operator new (std::size_t, odb::details::share); + + LIBODB_EXPORT void +-operator delete (void*, odb::details::share) throw (); ++operator delete (void*, odb::details::share); + + namespace odb + { +@@ -62,16 +62,16 @@ namespace odb + _ref_count () const; + + void* +- operator new (std::size_t) throw (std::bad_alloc); ++ operator new (std::size_t); + + void* +- operator new (std::size_t, share) throw (std::bad_alloc); ++ operator new (std::size_t, share); + + void +- operator delete (void*, share) throw (); ++ operator delete (void*, share); + + void +- operator delete (void*) throw (); ++ operator delete (void*); + + struct refcount_callback + { +diff --git a/odb/details/shared-ptr/base.ixx b/odb/details/shared-ptr/base.ixx +index 9bf7c94..e03ea86 100644 +--- a/odb/details/shared-ptr/base.ixx ++++ b/odb/details/shared-ptr/base.ixx +@@ -64,25 +64,25 @@ namespace odb + } + + inline void* shared_base:: +- operator new (std::size_t n) throw (std::bad_alloc) ++ operator new (std::size_t n) + { + return ::operator new (n); + } + + inline void* shared_base:: +- operator new (std::size_t n, share) throw (std::bad_alloc) ++ operator new (std::size_t n, share) + { + return ::operator new (n); + } + + inline void shared_base:: +- operator delete (void* p, share) throw () ++ operator delete (void* p, share) + { + ::operator delete (p); + } + + inline void shared_base:: +- operator delete (void* p) throw () ++ operator delete (void* p) + { + ::operator delete (p); + } diff --git a/vcpkg/ports/libodb/odbConfig.cmake b/vcpkg/ports/libodb/odbConfig.cmake new file mode 100644 index 0000000..f3037bd --- /dev/null +++ b/vcpkg/ports/libodb/odbConfig.cmake @@ -0,0 +1,10 @@ +set(_supported_components libodb sqlite mysql pgsql) + +foreach(_comp ${odb_FIND_COMPONENTS}) + if(NOT ";${_supported_components};" MATCHES _comp) + set(odb_FOUND False) + set(odb_NOTFOUND_MESSAGE "Unsupported component: ${_comp}") + endif() + include("${CMAKE_CURRENT_LIST_DIR}/odb_${_comp}Config.cmake") +endforeach() +set(odb_FOUND True)
\ No newline at end of file diff --git a/vcpkg/ports/libodb/portfile.cmake b/vcpkg/ports/libodb/portfile.cmake new file mode 100644 index 0000000..3bfc23c --- /dev/null +++ b/vcpkg/ports/libodb/portfile.cmake @@ -0,0 +1,55 @@ +include(CMakePackageConfigHelpers) + +vcpkg_download_distfile(ARCHIVE + URLS "http://www.codesynthesis.com/download/odb/2.4/libodb-2.4.0.tar.gz" + FILENAME "libodb-2.4.0.tar.gz" + SHA512 f1311458634695eb6ba307ebfd492e3b260e7beb06db1c5c46df58c339756be4006322cdc4e42d055bf5b2ad14ce4656ddcafcc4e16c282034db8a77d255c3eb +) + +vcpkg_extract_source_archive( + SOURCE_PATH + ARCHIVE "${ARCHIVE}" + PATCHES + fix-linux.patch +) +file(REMOVE "${SOURCE_PATH}/version") + +file(COPY + "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" + "${CMAKE_CURRENT_LIST_DIR}/config.unix.h.in" + DESTINATION "${SOURCE_PATH}") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DCMAKE_CXX_STANDARD=11 # 17 removes 'auto_ptr' + OPTIONS_DEBUG + -DLIBODB_INSTALL_HEADERS=OFF +) + +vcpkg_cmake_install() +if(NOT VCPKG_BUILD_TYPE) + file(READ "${CURRENT_PACKAGES_DIR}/debug/share/odb/odb_libodbConfig-debug.cmake" LIBODB_DEBUG_TARGETS) + string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" LIBODB_DEBUG_TARGETS "${LIBODB_DEBUG_TARGETS}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/odb/odb_libodbConfig-debug.cmake" "${LIBODB_DEBUG_TARGETS}") +endif() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/odbConfig.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/odb") +write_basic_package_version_file("${CURRENT_PACKAGES_DIR}/share/odb/odbConfigVersion.cmake" + VERSION 2.4.0 + COMPATIBILITY SameMajorVersion +) + +set(LIBODB_HEADER_PATH "${CURRENT_PACKAGES_DIR}/include/odb/details/export.hxx") +file(READ "${LIBODB_HEADER_PATH}" LIBODB_HEADER) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + string(REPLACE "#ifdef LIBODB_STATIC_LIB" "#if 1" LIBODB_HEADER "${LIBODB_HEADER}") +else() + string(REPLACE "#ifdef LIBODB_STATIC_LIB" "#if 0" LIBODB_HEADER "${LIBODB_HEADER}") +endif() +file(WRITE "${LIBODB_HEADER_PATH}" "${LIBODB_HEADER}") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/libodb/vcpkg.json b/vcpkg/ports/libodb/vcpkg.json new file mode 100644 index 0000000..f4e4148 --- /dev/null +++ b/vcpkg/ports/libodb/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "libodb", + "version": "2.4.0", + "port-version": 12, + "description": "ODB library, base runtime for the ODB ORM solution", + "homepage": "https://www.codesynthesis.com/products/odb/", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |