aboutsummaryrefslogtreecommitdiff
path: root/ports/mongo-c-driver
diff options
context:
space:
mode:
Diffstat (limited to 'ports/mongo-c-driver')
-rw-r--r--ports/mongo-c-driver/0001_cmake.patch43
-rw-r--r--ports/mongo-c-driver/CONTROL4
-rw-r--r--ports/mongo-c-driver/portfile.cmake28
3 files changed, 75 insertions, 0 deletions
diff --git a/ports/mongo-c-driver/0001_cmake.patch b/ports/mongo-c-driver/0001_cmake.patch
new file mode 100644
index 000000000..a2f9087e7
--- /dev/null
+++ b/ports/mongo-c-driver/0001_cmake.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b3fc5b9..5a106ca 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -20,7 +20,6 @@ option(ENABLE_EXPERIMENTAL_FEATURES
+
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/build/cmake)
+
+-include(InstallRequiredSystemLibraries)
+ include(FindBSON REQUIRED)
+
+ if (NOT (ENABLE_SSL STREQUAL DARWIN
+@@ -563,7 +562,7 @@ install(
+ )
+ install(
+ FILES ${HEADERS}
+- DESTINATION "include/libmongoc-${MONGOC_API_VERSION}"
++ DESTINATION "include"
+ )
+
+ # Define pkg-config files
+diff --git a/build/cmake/FindBSON.cmake b/build/cmake/FindBSON.cmake
+index 4ac39ea..bf6ecab 100644
+--- a/build/cmake/FindBSON.cmake
++++ b/build/cmake/FindBSON.cmake
+@@ -11,7 +11,7 @@ endif ()
+
+ find_path(BSON_INCLUDE_DIR
+ NAMES
+- libbson-1.0/bson.h
++ bson.h
+ HINTS
+ ${BSON_ROOT_DIR}
+ ${_BSON_INCLUDEDIR}
+@@ -19,8 +19,6 @@ find_path(BSON_INCLUDE_DIR
+ include
+ )
+
+-set(BSON_INCLUDE_DIR "${BSON_INCLUDE_DIR}/libbson-1.0")
+-
+ if(WIN32 AND NOT CYGWIN)
+ if(MSVC)
+ find_library(BSON
diff --git a/ports/mongo-c-driver/CONTROL b/ports/mongo-c-driver/CONTROL
new file mode 100644
index 000000000..b0cec868c
--- /dev/null
+++ b/ports/mongo-c-driver/CONTROL
@@ -0,0 +1,4 @@
+Source: mongo-c-driver
+Version: 1.4.2
+Build-Depends: libbson
+Description: Client library written in C for MongoDB. \ No newline at end of file
diff --git a/ports/mongo-c-driver/portfile.cmake b/ports/mongo-c-driver/portfile.cmake
new file mode 100644
index 000000000..81f0d10a7
--- /dev/null
+++ b/ports/mongo-c-driver/portfile.cmake
@@ -0,0 +1,28 @@
+include(${CMAKE_TRIPLET_FILE})
+include(vcpkg_common_functions)
+find_program(POWERSHELL powershell)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-c-driver-1.4.2)
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://github.com/mongodb/mongo-c-driver/releases/download/1.4.2/mongo-c-driver-1.4.2.tar.gz"
+ FILENAME "mongo-c-driver-1.4.2.tar.gz"
+ SHA512 402b9d0f2ae957a07336c9a6d971440472acef8e17a3ba5e89635ca454a13d4b7cf5f9b71151ed6182c012efb5fac6684acfc00443c6bca07cdd04b9f7eddaeb
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ -DBSON_ROOT_DIR=${CURRENT_PACKAGES_DIR}/../libbson_${TARGET_TRIPLET}
+)
+
+vcpkg_install_cmake()
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/COPYING ${CURRENT_PACKAGES_DIR}/share/mongo-c-driver/copyright) \ No newline at end of file