Skip to content

Commit

Permalink
[sqlpp11,vcpkg-ci-sqlpp11] Fixes, cleanup, test port (microsoft#41128)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Sep 25, 2024
1 parent d1e8683 commit 3d89599
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 59 deletions.
25 changes: 19 additions & 6 deletions ports/sqlpp11/ddl2cpp_path.patch
Original file line number Diff line number Diff line change
@@ -1,13 +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 5c5926f..c25da97 100644
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}/../../scripts/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()
- 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()
23 changes: 23 additions & 0 deletions ports/sqlpp11/dependencies.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb05cd8..6aff88b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,8 @@ 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)
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)
34 changes: 0 additions & 34 deletions ports/sqlpp11/fix_link_sqlite3.patch

This file was deleted.

23 changes: 7 additions & 16 deletions ports/sqlpp11/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
set(VCPKG_BUILD_TYPE release) # header-only lib

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO rbock/sqlpp11
REF ${VERSION}
SHA512 7b48f66e2e229ed046a5b5033acc1be36b0c2790773a81ce9c65fce4a85379d61e87dd0ff214eb4126ce87fe6cf2f314b7e6c54256b600d15d8352d74a8fac0d
HEAD_REF master
HEAD_REF main
PATCHES
ddl2cpp_path.patch
fix_link_sqlite3.patch
dependencies.diff
)

vcpkg_check_features(
Expand All @@ -18,27 +20,16 @@ vcpkg_check_features(
postgresql BUILD_POSTGRESQL_CONNECTOR
)

# Use sqlpp11's own build process
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING:BOOL=OFF
# Use vcpkg as source for the date library
-DSQLPP11_INSTALL_CMAKEDIR=share/${PORT}
-DUSE_SYSTEM_DATE:BOOL=ON
${FEATURE_OPTIONS}
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup()

# Move CMake config files to the right place
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Sqlpp11)

# Delete redundant and unnecessary directories
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib" "${CURRENT_PACKAGES_DIR}/cmake" "${CURRENT_PACKAGES_DIR}/include/date")

# Move python script from bin directory
file(COPY "${CURRENT_PACKAGES_DIR}/bin/sqlpp11-ddl2cpp" DESTINATION "${CURRENT_PACKAGES_DIR}/scripts")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/")

# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
1 change: 1 addition & 0 deletions ports/sqlpp11/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "sqlpp11",
"version": "0.64",
"port-version": 1,
"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",
Expand Down
17 changes: 15 additions & 2 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -571,15 +571,14 @@ liblo:arm64-uwp=fail
liblo:arm64-android=fail
liblo:x64-android=fail
liblo:x64-uwp=fail
# libmariadb conflicts with libmysql
libmariadb:arm-neon-android=fail
libmariadb:arm64-android=fail
libmariadb:arm64-windows = skip
libmariadb:arm64-uwp = skip
libmariadb:x64-android=fail
libmariadb:x64-linux = skip
libmariadb:x64-osx = skip
libmariadb:arm64-osx = skip
libmariadb:x64-uwp = skip
libmariadb:x64-windows = skip
libmariadb:x64-windows-static = skip
libmariadb:x64-windows-static-md=skip
Expand Down Expand Up @@ -1092,6 +1091,7 @@ spdk-isal:x64-linux=skip
spscqueue:arm-neon-android=fail
spscqueue:arm64-android=fail
spscqueue:x64-android=fail
# sqlpp11-connector-mysql: CI issues resolved by overlay port
stormlib:arm64-uwp=fail
stormlib:x64-uwp=fail
stxxl:arm-neon-android=fail
Expand Down Expand Up @@ -1354,6 +1354,19 @@ vcpkg-ci-soci:x64-osx=pass
vcpkg-ci-soci:x64-windows=pass
vcpkg-ci-soci:x64-windows-static=pass
vcpkg-ci-soci:x64-windows-static-md=pass
vcpkg-ci-sqlpp11:arm-neon-android=pass
vcpkg-ci-sqlpp11:arm64-android=pass
vcpkg-ci-sqlpp11:arm64-osx=pass
vcpkg-ci-sqlpp11:arm64-uwp=pass
vcpkg-ci-sqlpp11:arm64-windows=pass
vcpkg-ci-sqlpp11:x64-android=pass
vcpkg-ci-sqlpp11:x64-linux=pass
vcpkg-ci-sqlpp11:x64-osx=pass
vcpkg-ci-sqlpp11:x64-uwp=pass
vcpkg-ci-sqlpp11:x64-windows-static-md=pass
vcpkg-ci-sqlpp11:x64-windows-static=pass
vcpkg-ci-sqlpp11:x64-windows=pass
vcpkg-ci-sqlpp11:x86-windows=pass
vcpkg-ci-wxwidgets:arm64-windows=pass
vcpkg-ci-wxwidgets:x64-linux=pass
vcpkg-ci-wxwidgets:x64-osx=pass
Expand Down
1 change: 1 addition & 0 deletions scripts/test_ports/sqlpp11-connector-mysql/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
26 changes: 26 additions & 0 deletions scripts/test_ports/sqlpp11-connector-mysql/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "sqlpp11-connector-mysql",
"version-string": "ci",
"description": "Overlay for an obsolete empty port in order to unblock sqlpp11 testing: platform-specific choice of testable implementation",
"homepage": "https://github.com/microsoft/vcpkg",
"license": "MIT",
"supports": "!uwp",
"dependencies": [
{
"name": "sqlpp11",
"default-features": false,
"features": [
"mariadb"
],
"platform": "x86 & windows"
},
{
"name": "sqlpp11",
"default-features": false,
"features": [
"mysql"
],
"platform": "!(x86 & windows)"
}
]
}
1 change: 1 addition & 0 deletions scripts/test_ports/vcpkg-ci-sqlpp11/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
36 changes: 36 additions & 0 deletions scripts/test_ports/vcpkg-ci-sqlpp11/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "vcpkg-ci-sqlpp11",
"version-string": "ci",
"description": "Port to force features of sqlpp11 within CI",
"homepage": "https://github.com/microsoft/vcpkg",
"license": "MIT",
"dependencies": [
{
"name": "sqlpp11",
"features": [
"sqlite3"
]
},
{
"name": "sqlpp11",
"features": [
"postgresql"
],
"platform": "!uwp"
},
{
"name": "sqlpp11",
"features": [
"mariadb"
],
"platform": "x86 & windows"
},
{
"name": "sqlpp11",
"features": [
"mysql"
],
"platform": "!android & !uwp & !(x86 & windows)"
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8582,7 +8582,7 @@
},
"sqlpp11": {
"baseline": "0.64",
"port-version": 0
"port-version": 1
},
"sqlpp11-connector-mysql": {
"baseline": "0.61",
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/sqlpp11.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "dcc1169986fc1ff635e7f0a104e1330c9ac3e15f",
"version": "0.64",
"port-version": 1
},
{
"git-tree": "6906f65042fff492746cfe95290e03ea4e89da4a",
"version": "0.64",
Expand Down

0 comments on commit 3d89599

Please sign in to comment.