From 93885afd50ff1a1408e1785dceffb01ff648c7d9 Mon Sep 17 00:00:00 2001 From: Be Date: Wed, 22 Sep 2021 15:00:06 -0500 Subject: [libdjinterop] update to 0.16.0 (#20136) * [libdjinterop] update to 0.16.0 * [sqlite3] add pkgconfig file Linux distributions typically use the SQLite autoconf package, but this port uses the SQLite amalgamation package with a custom CMakeLists.txt so the port needs to take care of installing the pkgconfig file. --- ports/sqlite3/CMakeLists.txt | 8 ++++++++ ports/sqlite3/portfile.cmake | 9 ++++++++- ports/sqlite3/sqlite3.pc.in | 11 +++++++++++ ports/sqlite3/vcpkg.json | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 ports/sqlite3/sqlite3.pc.in (limited to 'ports/sqlite3') diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 6250eb711..7c1099bdb 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -63,3 +63,11 @@ install( install(FILES sqlite3.h sqlite3ext.h DESTINATION include CONFIGURATIONS Release) install(EXPORT unofficial-sqlite3-targets NAMESPACE unofficial::sqlite3:: FILE unofficial-sqlite3-targets.cmake DESTINATION share/unofficial-sqlite3) + +if(UNIX) + set(PKGCONFIG_LIBS_PRIVATE "-lm -ldl -lpthread") +else() + set(PKGCONFIG_LIBS_PRIVATE "") +endif() +configure_file(sqlite3.pc.in sqlite3.pc @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sqlite3.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index d843ee537..329b1dbd5 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,4 +1,6 @@ +# Be sure to update both of these versions together. set(SQLITE_VERSION 3360000) +set(PKGCONFIG_VERSION 3.36.0) set(SQLITE_HASH 5c18f158a599b1e91d95c91de3aa5c5de52f986845ad0cb49dfd56b650587e55e24d469571b5b864229b870d0eaf85d78893f61ef950b95389cb41692be37f58) vcpkg_download_distfile(ARCHIVE @@ -15,6 +17,7 @@ vcpkg_extract_source_archive_ex( ) file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/sqlite3.pc.in" DESTINATION "${SOURCE_PATH}") vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES @@ -26,7 +29,9 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS ${FEATURE_OPTIONS} + OPTIONS + ${FEATURE_OPTIONS} + -DPKGCONFIG_VERSION=${PKGCONFIG_VERSION} OPTIONS_DEBUG -DSQLITE3_SKIP_TOOLS=ON ) @@ -46,6 +51,8 @@ configure_file( @ONLY ) +vcpkg_fixup_pkgconfig() + if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sqlite3.h" "# define SQLITE_API\n" "# define SQLITE_API __declspec(dllimport)\n") endif() diff --git a/ports/sqlite3/sqlite3.pc.in b/ports/sqlite3/sqlite3.pc.in new file mode 100644 index 000000000..d265632d1 --- /dev/null +++ b/ports/sqlite3/sqlite3.pc.in @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: SQLite +Description: SQL database engine +Version: @PKGCONFIG_VERSION@ +Libs: -L${libdir} -lsqlite3 +Libs.private: @PKGCONFIG_LIBS_PRIVATE@ +Cflags: -I${includedir} diff --git a/ports/sqlite3/vcpkg.json b/ports/sqlite3/vcpkg.json index f5054f6f8..d998070e0 100644 --- a/ports/sqlite3/vcpkg.json +++ b/ports/sqlite3/vcpkg.json @@ -1,6 +1,7 @@ { "name": "sqlite3", "version": "3.36.0", + "port-version": 1, "description": "SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.", "homepage": "https://sqlite.org/", "dependencies": [ -- cgit v1.2.3