aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/realm-core
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/realm-core
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/realm-core')
-rw-r--r--vcpkg/ports/realm-core/UWP_index_set.patch13
-rw-r--r--vcpkg/ports/realm-core/fix-zlib.patch28
-rw-r--r--vcpkg/ports/realm-core/portfile.cmake49
-rw-r--r--vcpkg/ports/realm-core/vcpkg.json24
4 files changed, 114 insertions, 0 deletions
diff --git a/vcpkg/ports/realm-core/UWP_index_set.patch b/vcpkg/ports/realm-core/UWP_index_set.patch
new file mode 100644
index 0000000..372f352
--- /dev/null
+++ b/vcpkg/ports/realm-core/UWP_index_set.patch
@@ -0,0 +1,13 @@
+diff --git a/src/realm/object-store/index_set.hpp b/src/realm/object-store/index_set.hpp
+index d61e78221..a95338967 100644
+--- a/src/realm/object-store/index_set.hpp
++++ b/src/realm/object-store/index_set.hpp
+@@ -387,7 +387,7 @@ inline ChunkedRangeVectorIterator<T> ChunkedRangeVectorIterator<T>::operator--(i
+ }
+
+ template <typename T>
+-#if REALM_WINDOWS && REALM_ARCHITECTURE_ARM64
++#if defined(_MSC_VER) && REALM_ARCHITECTURE_ARM64
+ // Inlining this function crashes msvc when targeting arm64 in as of 19.39.33523
+ __declspec(noinline)
+ #endif
diff --git a/vcpkg/ports/realm-core/fix-zlib.patch b/vcpkg/ports/realm-core/fix-zlib.patch
new file mode 100644
index 0000000..198533d
--- /dev/null
+++ b/vcpkg/ports/realm-core/fix-zlib.patch
@@ -0,0 +1,28 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1d5710f..42ee3c9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -318,7 +318,9 @@ endif()
+ # so for an iOS build it'll use the path from the Device plaform, which is an error on Simulator.
+ # Just use -lz and let Xcode figure it out
+ # Emscripten does provide Zlib, but it doesn't work with find_package and is handled specially
++find_package(ZLIB REQUIRED) # vcpkg zlib, everwhere
+ if(NOT APPLE AND NOT EMSCRIPTEN AND NOT TARGET ZLIB::ZLIB)
++elseif(0)
+ if(WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND REALM_LINUX_TOOLCHAIN))
+ find_package(ZLIB)
+ if (NOT ZLIB_FOUND)
+diff --git a/tools/cmake/RealmConfig.cmake.in b/tools/cmake/RealmConfig.cmake.in
+index e418c86..32af2c0 100644
+--- a/tools/cmake/RealmConfig.cmake.in
++++ b/tools/cmake/RealmConfig.cmake.in
+@@ -21,7 +21,9 @@ find_dependency(Threads)
+ # Don't use find_library(ZLIB) on Apple platforms - it hardcodes the path per platform,
+ # so for an iOS build it'll use the path from the Device plaform, which is an error on Simulator.
+ # Just use -lz and let Xcode figure it out
++find_dependency(ZLIB)
+ if(TARGET Realm::Sync AND NOT APPLE AND NOT TARGET ZLIB::ZLIB)
++elseif(0)
+ if(WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND REALM_LINUX_TOOLCHAIN))
+ find_package(ZLIB)
+ if (NOT ZLIB_FOUND)
diff --git a/vcpkg/ports/realm-core/portfile.cmake b/vcpkg/ports/realm-core/portfile.cmake
new file mode 100644
index 0000000..e52da4a
--- /dev/null
+++ b/vcpkg/ports/realm-core/portfile.cmake
@@ -0,0 +1,49 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO realm/realm-core
+ REF "v${VERSION}"
+ SHA512 41ccf3e53bb1ff6e16a2baf90203984424d3b754973374af4d3767f67227f1223b314921954826ab62d45965a78540b93fc92a0ababd464f19dbaec368175022
+ HEAD_REF master
+ PATCHES
+ UWP_index_set.patch
+ fix-zlib.patch
+)
+
+vcpkg_list(SET REALMCORE_CMAKE_OPTIONS)
+if(VCPKG_TARGET_IS_IOS OR VCPKG_TARGET_IS_OSX)
+ list(APPEND REALMCORE_CMAKE_OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON)
+else()
+ if(VCPKG_TARGET_IS_EMSCRIPTEN)
+ list(APPEND REALMCORE_CMAKE_OPTIONS -DREALM_FORCE_OPENSSL=ON)
+ list(APPEND REALMCORE_CMAKE_OPTIONS -DREALM_ENABLE_SYNC=OFF) # https://github.com/realm/realm-core/issues/7752
+ endif()
+ list(APPEND REALMCORE_CMAKE_OPTIONS -DREALM_USE_SYSTEM_OPENSSL=ON)
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DREALM_BUILD_LIB_ONLY=ON
+ -DREALM_CORE_SUBMODULE_BUILD=OFF
+ -DREALM_NO_TESTS=ON
+ -DREALM_VERSION=${VERSION}
+ -DCMAKE_DISABLE_FIND_PACKAGE_Backtrace=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_BISON=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_FLEX=ON
+ ${REALMCORE_CMAKE_OPTIONS}
+ MAYBE_UNUSED_VARIABLES
+ CMAKE_DISABLE_FIND_PACKAGE_OpenSSL
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME "realm" CONFIG_PATH "share/cmake/Realm")
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/debug/doc"
+ "${CURRENT_PACKAGES_DIR}/doc"
+)
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE" "${SOURCE_PATH}/THIRD-PARTY-NOTICES")
diff --git a/vcpkg/ports/realm-core/vcpkg.json b/vcpkg/ports/realm-core/vcpkg.json
new file mode 100644
index 0000000..7e1cb43
--- /dev/null
+++ b/vcpkg/ports/realm-core/vcpkg.json
@@ -0,0 +1,24 @@
+{
+ "name": "realm-core",
+ "version": "14.10.4",
+ "description": "Realm is a mobile database that runs directly inside phones, tablets or wearables.",
+ "homepage": "https://github.com/realm/realm-core",
+ "license": null,
+ "supports": "!emscripten",
+ "dependencies": [
+ {
+ "name": "openssl",
+ "platform": "!ios & !osx",
+ "version>=": "3.2.0"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "zlib"
+ ]
+}