2023-02-07 04:00:37 +08:00
|
|
|
string(REGEX REPLACE "^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)" "\\1,0\\2,0\\3,0\\4," SQLITE_VERSION "${VERSION}.0")
|
|
|
|
string(REGEX REPLACE "^([0-9]+),0*([0-9][0-9]),0*([0-9][0-9]),0*([0-9][0-9])," "\\1\\2\\3\\4" SQLITE_VERSION "${SQLITE_VERSION}")
|
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2024-01-24 03:46:26 +08:00
|
|
|
URLS "https://sqlite.org/2024/sqlite-autoconf-${SQLITE_VERSION}.tar.gz"
|
|
|
|
FILENAME "sqlite-autoconf-${SQLITE_VERSION}.zip"
|
2024-02-22 01:24:20 +08:00
|
|
|
SHA512 c6bd4eaa67cada28528d1ac31aec1662c0a11048247a1bb148c1842fb0252934e2096843b56fea94bfb96c4eaaa598ec70ac31f2a5e910388f24f152b9fc4211
|
2023-02-07 04:00:37 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
|
|
|
ARCHIVE "${ARCHIVE}"
|
|
|
|
PATCHES
|
|
|
|
fix-arm-uwp.patch
|
|
|
|
add-config-include.patch
|
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
set(SQLITE_API "__declspec(dllimport)")
|
|
|
|
else()
|
|
|
|
set(SQLITE_API "__attribute__((visibility(\"default\")))")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(SQLITE_API "")
|
|
|
|
endif()
|
|
|
|
|
2023-07-11 08:17:37 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
fts5 SQLITE_ENABLE_FTS5
|
|
|
|
math SQLITE_ENABLE_MATH_FUNCTIONS
|
|
|
|
zlib WITH_ZLIB
|
|
|
|
INVERTED_FEATURES
|
|
|
|
tool SQLITE3_SKIP_TOOLS
|
|
|
|
)
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS none # only using the script-mode side-effects
|
2023-02-07 04:00:37 +08:00
|
|
|
FEATURES
|
2023-04-03 11:49:05 +08:00
|
|
|
dbstat SQLITE_ENABLE_DBSTAT_VTAB
|
2023-02-07 04:00:37 +08:00
|
|
|
fts3 SQLITE_ENABLE_FTS3
|
|
|
|
fts4 SQLITE_ENABLE_FTS4
|
|
|
|
memsys3 SQLITE_ENABLE_MEMSYS3
|
|
|
|
memsys5 SQLITE_ENABLE_MEMSYS5
|
|
|
|
limit SQLITE_ENABLE_UPDATE_DELETE_LIMIT
|
|
|
|
rtree SQLITE_ENABLE_RTREE
|
|
|
|
session SQLITE_ENABLE_SESSION
|
|
|
|
session SQLITE_ENABLE_PREUPDATE_HOOK
|
2024-03-05 17:34:51 +08:00
|
|
|
snapshot SQLITE_ENABLE_SNAPSHOT
|
2023-02-07 04:00:37 +08:00
|
|
|
omit-load-extension SQLITE_OMIT_LOAD_EXTENSION
|
|
|
|
geopoly SQLITE_ENABLE_GEOPOLY
|
2023-12-28 15:58:43 +08:00
|
|
|
soundex SQLITE_SOUNDEX
|
2023-06-14 13:53:09 +08:00
|
|
|
INVERTED_FEATURES
|
|
|
|
json1 SQLITE_OMIT_JSON
|
2023-02-07 04:00:37 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
set(SQLITE_OS_WIN "1")
|
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
|
|
set(SQLITE_OS_WINRT "1")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(SQLITE_OS_UNIX "1")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/sqlite3.pc.in" DESTINATION "${SOURCE_PATH}")
|
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/sqlite3-vcpkg-config.h.in" "${SOURCE_PATH}/sqlite3-vcpkg-config.h" @ONLY)
|
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
-DPKGCONFIG_VERSION=${VERSION}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DSQLITE3_SKIP_TOOLS=ON
|
2023-11-09 01:42:58 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
SQLITE_ENABLE_FTS5
|
|
|
|
SQLITE_ENABLE_MATH_FUNCTIONS
|
2023-02-07 04:00:37 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT})
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
|
2023-04-26 13:54:48 +08:00
|
|
|
if("tool" IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES sqlite3 DESTINATION "${CURRENT_PACKAGES_DIR}/tools" AUTO_CLEAN)
|
2023-02-07 04:00:37 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake"
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2023-06-14 13:53:09 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2023-02-07 04:00:37 +08:00
|
|
|
|
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|