diff options
Diffstat (limited to 'vcpkg/ports/sqlpp11')
| -rw-r--r-- | vcpkg/ports/sqlpp11/ddl2cpp_path.patch | 26 | ||||
| -rw-r--r-- | vcpkg/ports/sqlpp11/dependencies.diff | 38 | ||||
| -rw-r--r-- | vcpkg/ports/sqlpp11/fix-miss-header.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/sqlpp11/portfile.cmake | 48 | ||||
| -rw-r--r-- | vcpkg/ports/sqlpp11/vcpkg.json | 44 |
5 files changed, 169 insertions, 0 deletions
diff --git a/vcpkg/ports/sqlpp11/ddl2cpp_path.patch b/vcpkg/ports/sqlpp11/ddl2cpp_path.patch new file mode 100644 index 0000000..ce6228d --- /dev/null +++ b/vcpkg/ports/sqlpp11/ddl2cpp_path.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bb05cd8..4e83094 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -113,7 +113,7 @@ endif() + ### Packaging + install(PROGRAMS ${PROJECT_SOURCE_DIR}/scripts/ddl2cpp + RENAME sqlpp11-ddl2cpp +- DESTINATION ${CMAKE_INSTALL_BINDIR} ++ DESTINATION tools/sqlpp11 + ) + + write_basic_package_version_file(Sqlpp11ConfigVersion.cmake +diff --git a/cmake/configs/Sqlpp11Config.cmake b/cmake/configs/Sqlpp11Config.cmake +index bf340d6..249014d 100644 +--- a/cmake/configs/Sqlpp11Config.cmake ++++ b/cmake/configs/Sqlpp11Config.cmake +@@ -55,7 +55,7 @@ endforeach() + + # Import "ddl2cpp" script + if(NOT TARGET sqlpp11::ddl2cpp) +- get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH) ++ get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../tools/sqlpp11/sqlpp11-ddl2cpp" REALPATH) + if(NOT EXISTS "${sqlpp11_ddl2cpp_location}") + message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.") + endif() diff --git a/vcpkg/ports/sqlpp11/dependencies.diff b/vcpkg/ports/sqlpp11/dependencies.diff new file mode 100644 index 0000000..8edbc99 --- /dev/null +++ b/vcpkg/ports/sqlpp11/dependencies.diff @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bb05cd8..6aff88b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,11 +51,13 @@ set(SQLPP11_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/Sqlpp11 CACHE STRING + + ### Dependencies + if(DEPENDENCY_CHECK AND BUILD_MYSQL_CONNECTOR) +- find_package(MySQL REQUIRED) ++ find_package(MySQL NAMES unofficial-libmysql REQUIRED) ++ add_library(MySQL::MySQL ALIAS unofficial::libmysql::libmysql) + endif() + + if(DEPENDENCY_CHECK AND BUILD_MARIADB_CONNECTOR) +- find_package(MariaDB REQUIRED) ++ find_package(MariaDB NAMES unofficial-libmariadb REQUIRED) ++ add_library(MariaDB::MariaDB ALIAS unofficial::libmariadb) + endif() + + if(DEPENDENCY_CHECK AND BUILD_POSTGRESQL_CONNECTOR) +diff --git a/cmake/configs/Sqlpp11MariaDBConfig.cmake b/cmake/configs/Sqlpp11MariaDBConfig.cmake +index 32a594a..fb63205 100644 +--- a/cmake/configs/Sqlpp11MariaDBConfig.cmake ++++ b/cmake/configs/Sqlpp11MariaDBConfig.cmake +@@ -1,2 +1,2 @@ + include(CMakeFindDependencyMacro) +-find_dependency(MariaDB) +\ No newline at end of file ++find_dependency(unofficial-libmariadb) +diff --git a/cmake/configs/Sqlpp11MySQLConfig.cmake b/cmake/configs/Sqlpp11MySQLConfig.cmake +index 0d2a5b3..53dab6e 100644 +--- a/cmake/configs/Sqlpp11MySQLConfig.cmake ++++ b/cmake/configs/Sqlpp11MySQLConfig.cmake +@@ -1,2 +1,2 @@ + include(CMakeFindDependencyMacro) +-find_dependency(MySQL) +\ No newline at end of file ++find_dependency(unofficial-libmysql) diff --git a/vcpkg/ports/sqlpp11/fix-miss-header.patch b/vcpkg/ports/sqlpp11/fix-miss-header.patch new file mode 100644 index 0000000..556bf33 --- /dev/null +++ b/vcpkg/ports/sqlpp11/fix-miss-header.patch @@ -0,0 +1,13 @@ +diff --git a/include/sqlpp11/mysql/sqlpp_mysql.h b/include/sqlpp11/mysql/sqlpp_mysql.h +index 4257c7a..1408037 100644 +--- a/include/sqlpp11/mysql/sqlpp_mysql.h ++++ b/include/sqlpp11/mysql/sqlpp_mysql.h +@@ -26,7 +26,7 @@ + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#include <mysql.h> ++#include <mysql/mysql.h> + + namespace sqlpp + { diff --git a/vcpkg/ports/sqlpp11/portfile.cmake b/vcpkg/ports/sqlpp11/portfile.cmake new file mode 100644 index 0000000..3095f81 --- /dev/null +++ b/vcpkg/ports/sqlpp11/portfile.cmake @@ -0,0 +1,48 @@ +set(VCPKG_BUILD_TYPE release) # header-only lib
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO rbock/sqlpp11
+ REF ${VERSION}
+ SHA512 8227bc613c9ca279fef8549472da518b81151d1d6e43600617017ebaf359a7c8d0bb7a17c96db232754fc7bc002ad44c4392826857710c18c65e2eb728a97dd5
+ HEAD_REF main
+ PATCHES
+ ddl2cpp_path.patch
+ dependencies.diff
+ fix-miss-header.patch
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ sqlite3 BUILD_SQLITE3_CONNECTOR
+ mariadb BUILD_MARIADB_CONNECTOR
+ mysql BUILD_MYSQL_CONNECTOR
+ postgresql BUILD_POSTGRESQL_CONNECTOR
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_TESTING:BOOL=OFF
+ -DSQLPP11_INSTALL_CMAKEDIR=share/${PORT}
+ -DUSE_SYSTEM_DATE:BOOL=ON
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup()
+
+set(usage "sqlpp11 provides CMake targets:\n")
+if(FEATURES STREQUAL "core")
+ set(usage "This build of sqlpp11 doesn't include any connector.\n(Available via features: sqlite3, mariadb, mysql, postgresql.)\n")
+endif()
+foreach(component IN ITEMS SQLite3 SQLCipher MySQL MariaDB PostgreSQL)
+ string(TOLOWER "${component}" lib)
+ if("${lib}" IN_LIST FEATURES)
+ string(APPEND usage "\n find_package(Sqlpp11 CONFIG REQUIRED COMPONENTS ${component})\n target_link_libraries(main PRIVATE sqlpp11::${lib})\n")
+ endif()
+endforeach()
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage}")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/sqlpp11/vcpkg.json b/vcpkg/ports/sqlpp11/vcpkg.json new file mode 100644 index 0000000..731ef4b --- /dev/null +++ b/vcpkg/ports/sqlpp11/vcpkg.json @@ -0,0 +1,44 @@ +{ + "name": "sqlpp11", + "version": "0.65", + "description": "A type safe embedded domain specific language for SQL queries and results in C++.", + "homepage": "https://github.com/rbock/sqlpp11", + "license": "BSD-2-Clause", + "dependencies": [ + "date", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "mariadb": { + "description": "Use MariaDB connector", + "dependencies": [ + "libmariadb" + ] + }, + "mysql": { + "description": "Use MySQL connector", + "dependencies": [ + "libmysql" + ] + }, + "postgresql": { + "description": "Use PostgreSQL connector", + "dependencies": [ + "libpq" + ] + }, + "sqlite3": { + "description": "Use SQLite3 connector", + "dependencies": [ + "sqlite3" + ] + } + } +} |