aboutsummaryrefslogtreecommitdiff
path: root/ports/sqlitecpp
diff options
context:
space:
mode:
authorSvenPStarFinanz <spa@starfinanz.de>2020-10-30 21:29:32 +0100
committerGitHub <noreply@github.com>2020-10-30 13:29:32 -0700
commitfe78675f817144710dd3f602f90f8f93b9dc2754 (patch)
treefd8045b362c3d3f36baeda27cbcd08e3ffcbdfdb /ports/sqlitecpp
parent5d4fb44aca482e593f9d6558699ef7fed119868e (diff)
downloadvcpkg-fe78675f817144710dd3f602f90f8f93b9dc2754.tar.gz
vcpkg-fe78675f817144710dd3f602f90f8f93b9dc2754.zip
[sqlitecpp] Additions for sqlcipher port (#14029)
Diffstat (limited to 'ports/sqlitecpp')
-rw-r--r--ports/sqlitecpp/0001-Find-external-sqlite3.patch16
-rw-r--r--ports/sqlitecpp/0001-unofficial-sqlite3-and-sqlcipher.patch31
-rw-r--r--ports/sqlitecpp/CONTROL5
-rw-r--r--ports/sqlitecpp/portfile.cmake8
-rw-r--r--ports/sqlitecpp/vcpkg.json27
5 files changed, 65 insertions, 22 deletions
diff --git a/ports/sqlitecpp/0001-Find-external-sqlite3.patch b/ports/sqlitecpp/0001-Find-external-sqlite3.patch
deleted file mode 100644
index 5914dc17d..000000000
--- a/ports/sqlitecpp/0001-Find-external-sqlite3.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 9363c0d..0f47f0f 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -227,9 +227,9 @@ if (SQLITECPP_INTERNAL_SQLITE)
- add_subdirectory(sqlite3)
- target_link_libraries(SQLiteCpp PUBLIC sqlite3)
- else (SQLITECPP_INTERNAL_SQLITE)
-- find_package (SQLite3 REQUIRED)
-+ find_package(unofficial-sqlite3 CONFIG)
- message(STATUS "Link to sqlite3 system library")
-- target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
-+ target_link_libraries(SQLiteCpp PRIVATE unofficial::sqlite3::sqlite3)
- if(SQLite3_VERSION VERSION_LESS "3.19")
- set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
- endif()
diff --git a/ports/sqlitecpp/0001-unofficial-sqlite3-and-sqlcipher.patch b/ports/sqlitecpp/0001-unofficial-sqlite3-and-sqlcipher.patch
new file mode 100644
index 000000000..9b3e0e4af
--- /dev/null
+++ b/ports/sqlitecpp/0001-unofficial-sqlite3-and-sqlcipher.patch
@@ -0,0 +1,31 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 85c1061..684205f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -232,16 +232,17 @@ if (SQLITECPP_INTERNAL_SQLITE)
+ add_subdirectory(sqlite3)
+ target_link_libraries(SQLiteCpp PUBLIC sqlite3)
+ else (SQLITECPP_INTERNAL_SQLITE)
+- find_package (SQLite3 REQUIRED)
+- message(STATUS "Link to sqlite3 system library")
+- target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
+- if(SQLite3_VERSION VERSION_LESS "3.19")
+- set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
+- endif()
++ if(NOT SQLITE_HAS_CODEC)
++ find_package(unofficial-sqlite3 CONFIG)
++ message(STATUS "Link to sqlite3 system library")
++ target_link_libraries(SQLiteCpp PRIVATE unofficial::sqlite3::sqlite3)
++ if(SQLite3_VERSION VERSION_LESS "3.19")
++ set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
++ endif()
++ else()
++ # When using the SQLite codec, we need to link against the sqlcipher lib & include <sqlcipher/sqlite3.h>
++ # So this gets the lib & header, and links/includes everything
+
+- # When using the SQLite codec, we need to link against the sqlcipher lib & include <sqlcipher/sqlite3.h>
+- # So this gets the lib & header, and links/includes everything
+- if(SQLITE_HAS_CODEC)
+ # Make PkgConfig optional since Windows doesn't usually have it installed.
+ find_package(PkgConfig QUIET)
+ if(PKG_CONFIG_FOUND)
diff --git a/ports/sqlitecpp/CONTROL b/ports/sqlitecpp/CONTROL
deleted file mode 100644
index a0566c037..000000000
--- a/ports/sqlitecpp/CONTROL
+++ /dev/null
@@ -1,5 +0,0 @@
-Source: sqlitecpp
-Version: 3.1.1
-Build-Depends: sqlite3
-Homepage: https://github.com/SRombauts/SQLiteCpp
-Description: SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.
diff --git a/ports/sqlitecpp/portfile.cmake b/ports/sqlitecpp/portfile.cmake
index 85e4e819e..efeb21450 100644
--- a/ports/sqlitecpp/portfile.cmake
+++ b/ports/sqlitecpp/portfile.cmake
@@ -6,14 +6,20 @@ vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
HEAD_REF master
SHA512 9030b5249c149db8a5b2fe350f71613e4ee91061765a771640ed3ffa7c24aada4000ba884ef91790fdc0f13dc4519038c1edeba64b85b85ac09c3e955a7988a1
PATCHES
- 0001-Find-external-sqlite3.patch
+ 0001-unofficial-sqlite3-and-sqlcipher.patch
fix_dependency.patch
)
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ sqlcipher SQLITE_HAS_CODEC
+)
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
+ ${FEATURE_OPTIONS}
-DSQLITECPP_RUN_CPPLINT=OFF
-DSQLITECPP_RUN_CPPCHECK=OFF
-DSQLITECPP_INTERNAL_SQLITE=OFF
diff --git a/ports/sqlitecpp/vcpkg.json b/ports/sqlitecpp/vcpkg.json
new file mode 100644
index 000000000..c86c7b95e
--- /dev/null
+++ b/ports/sqlitecpp/vcpkg.json
@@ -0,0 +1,27 @@
+{
+ "name": "sqlitecpp",
+ "version-string": "3.1.1",
+ "port-version": 1,
+ "description": "SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.",
+ "homepage": "https://github.com/SRombauts/SQLiteCpp",
+ "default-features": [
+ "sqlite"
+ ],
+ "features": {
+ "sqlcipher": {
+ "description": "Use the sqlcipher port",
+ "dependencies": [
+ {
+ "name": "sqlcipher",
+ "default-features": false
+ }
+ ]
+ },
+ "sqlite": {
+ "description": "Use the (unofficial) sqlite3 port of vcpkg",
+ "dependencies": [
+ "sqlite3"
+ ]
+ }
+ }
+}