diff options
Diffstat (limited to 'vcpkg/ports/libpqxx')
| -rw-r--r-- | vcpkg/ports/libpqxx/fix_build_with_vs2017.patch | 95 | ||||
| -rw-r--r-- | vcpkg/ports/libpqxx/pkgconfig.diff | 11 | ||||
| -rw-r--r-- | vcpkg/ports/libpqxx/portfile.cmake | 31 | ||||
| -rw-r--r-- | vcpkg/ports/libpqxx/vcpkg.json | 24 |
4 files changed, 161 insertions, 0 deletions
diff --git a/vcpkg/ports/libpqxx/fix_build_with_vs2017.patch b/vcpkg/ports/libpqxx/fix_build_with_vs2017.patch new file mode 100644 index 0000000..1267111 --- /dev/null +++ b/vcpkg/ports/libpqxx/fix_build_with_vs2017.patch @@ -0,0 +1,95 @@ +diff --git a/include/pqxx/internal/header-pre.hxx b/include/pqxx/internal/header-pre.hxx +index 833d583..21b7400 100644 +--- a/include/pqxx/internal/header-pre.hxx ++++ b/include/pqxx/internal/header-pre.hxx +@@ -101,6 +101,11 @@ + // Workarounds for Microsoft Visual C++ + # ifdef _MSC_VER + ++// Workarounds for deprecated attribute syntax error in Visual Studio 2017. ++# if _MSC_VER < 1920 ++# define PQXX_DEPRECATED(MESSAGE) __declspec(deprecated( #MESSAGE )) ++# endif ++ + // Suppress vtables on abstract classes. + # define PQXX_NOVTABLE __declspec(novtable) + +@@ -170,6 +175,10 @@ + # define PQXX_NOVTABLE /* novtable */ + #endif + ++#ifndef PQXX_DEPRECATED ++# define PQXX_DEPRECATED(MESSAGE) [[deprecated( #MESSAGE )]] ++#endif ++ + // C++20: Assume support. + #if defined(PQXX_HAVE_LIKELY) + # define PQXX_LIKELY [[likely]] +diff --git a/include/pqxx/stream_from.hxx b/include/pqxx/stream_from.hxx +index b275a7f..c63a80f 100644 +--- a/include/pqxx/stream_from.hxx ++++ b/include/pqxx/stream_from.hxx +@@ -160,7 +160,7 @@ public: + /** @deprecated Use factories @ref table or @ref raw_table instead. + */ + template<typename Iter> +- [[deprecated("Use transaction_base::stream instead.")]] stream_from( ++ PQXX_DEPRECATED("Use transaction_base::stream instead.") stream_from( + transaction_base &, from_table_t, std::string_view table, + Iter columns_begin, Iter columns_end); + +@@ -168,13 +168,13 @@ public: + /** @deprecated Use factory function @ref query instead. + */ + template<typename Columns> +- [[deprecated("Use transaction_base::stream() instead.")]] stream_from( ++ PQXX_DEPRECATED("Use transaction_base::stream() instead.") stream_from( + transaction_base &tx, from_table_t, std::string_view table, + Columns const &columns); + + #include "pqxx/internal/ignore-deprecated-pre.hxx" + /// @deprecated Use factories @ref table or @ref raw_table instead. +- [[deprecated("Use transaction_base::stream instead.")]] stream_from( ++ PQXX_DEPRECATED("Use transaction_base::stream instead.") stream_from( + transaction_base &tx, std::string_view table) : + stream_from{tx, from_table, table} + {} +@@ -182,14 +182,14 @@ public: + + /// @deprecated Use factories @ref table or @ref raw_table instead. + template<typename Columns> +- [[deprecated("Use transaction_base::stream instead.")]] stream_from( ++ PQXX_DEPRECATED("Use transaction_base::stream instead.") stream_from( + transaction_base &tx, std::string_view table, Columns const &columns) : + stream_from{tx, from_table, table, columns} + {} + + /// @deprecated Use factories @ref table or @ref raw_table instead. + template<typename Iter> +- [[deprecated("Use transaction_base::stream instead.")]] stream_from( ++ PQXX_DEPRECATED("Use transaction_base::stream instead.") stream_from( + transaction_base &, std::string_view table, Iter columns_begin, + Iter columns_end); + +diff --git a/include/pqxx/stream_to.hxx b/include/pqxx/stream_to.hxx +index 281af28..838003d 100644 +--- a/include/pqxx/stream_to.hxx ++++ b/include/pqxx/stream_to.hxx +@@ -248,7 +248,7 @@ public: + * your data fields and the table is explicit in your code, and not hidden + * in an "implicit contract" between your code and your schema. + */ +- [[deprecated("Use table() or raw_table() factory.")]] stream_to( ++ PQXX_DEPRECATED("Use table() or raw_table() factory.") stream_to( + transaction_base &tx, std::string_view table_name) : + stream_to{tx, table_name, ""sv} + {} +@@ -257,7 +257,7 @@ public: + /** @deprecated Use @ref table or @ref raw_table as a factory. + */ + template<typename Columns> +- [[deprecated("Use table() or raw_table() factory.")]] stream_to( ++ PQXX_DEPRECATED("Use table() or raw_table() factory.") stream_to( + transaction_base &, std::string_view table_name, Columns const &columns); + + private: diff --git a/vcpkg/ports/libpqxx/pkgconfig.diff b/vcpkg/ports/libpqxx/pkgconfig.diff new file mode 100644 index 0000000..2662354 --- /dev/null +++ b/vcpkg/ports/libpqxx/pkgconfig.diff @@ -0,0 +1,11 @@ +diff --git a/libpqxx.pc.in b/libpqxx.pc.in +index eb7dcff4..8de4cdd8 100644 +--- a/libpqxx.pc.in ++++ b/libpqxx.pc.in +@@ -6,5 +6,6 @@ includedir=@includedir@ + Name: libpqxx + Description: C++ client API for the PostgreSQL database management system. + Version: @VERSION@ ++Requires.private: libpq + Libs: -L${libdir} -lpqxx + Cflags: -I${includedir} diff --git a/vcpkg/ports/libpqxx/portfile.cmake b/vcpkg/ports/libpqxx/portfile.cmake new file mode 100644 index 0000000..e93ef8b --- /dev/null +++ b/vcpkg/ports/libpqxx/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jtv/libpqxx + REF "${VERSION}" + SHA512 065545fe93bd2f2904f27c891b7ef960b709b7021bbf978e82eeffddd2c7625b7da21a2239987215a0974918ddde5ff400913216a25ac6c590048afc8f309411 + HEAD_REF master + PATCHES + fix_build_with_vs2017.patch + pkgconfig.diff +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DSKIP_BUILD_TEST=ON +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libpqxx) + +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + # Not module from libpq + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") +else() + vcpkg_fixup_pkgconfig() +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/vcpkg/ports/libpqxx/vcpkg.json b/vcpkg/ports/libpqxx/vcpkg.json new file mode 100644 index 0000000..eae6f92 --- /dev/null +++ b/vcpkg/ports/libpqxx/vcpkg.json @@ -0,0 +1,24 @@ +{ + "name": "libpqxx", + "version": "7.10.1", + "description": [ + "The official* C++ client API for PostgreSQL.", + "*) NB https://pqxx.org/libpqxx/faq/" + ], + "homepage": "https://pqxx.org/libpqxx/", + "license": "BSD-3-Clause", + "dependencies": [ + { + "name": "libpq", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |