Skip to content

Commit 6a7e47d

Browse files
committed
replace the fancy python script with a simple patch
1 parent f033074 commit 6a7e47d

File tree

5 files changed

+30
-405
lines changed

5 files changed

+30
-405
lines changed

cmake/external/firestore.cmake

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ if(TARGET firestore)
1818
return()
1919
endif()
2020

21-
if(${CMAKE_VERSION} VERSION_LESS "3.12")
22-
include(FindPythonInterp)
23-
set(MY_PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}")
24-
else()
25-
find_package(Python3 COMPONENTS Interpreter REQUIRED)
26-
set(MY_PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
27-
endif()
28-
2921
# If the format of the line below changes, then be sure to update
3022
# https://github.com/firebase/firebase-cpp-sdk/blob/fd054fa016/.github/workflows/update-dependencies.yml#L81
3123
set(version CocoaPods-9.1.0)
@@ -46,11 +38,7 @@ function(GetReleasedDep)
4638
BUILD_COMMAND ""
4739
INSTALL_COMMAND ""
4840
TEST_COMMAND ""
49-
PATCH_COMMAND
50-
${MY_PYTHON_EXECUTABLE}
51-
${CMAKE_CURRENT_LIST_DIR}/firestore_patch.py
52-
--leveldb-version-from
53-
${CMAKE_CURRENT_LIST_DIR}/leveldb.cmake
41+
PATCH_COMMAND patch -Np1 -i ${CMAKE_CURRENT_LIST_DIR}/firestore.patch.txt
5442
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
5543
)
5644
endfunction()
@@ -71,11 +59,7 @@ function(GetTag t)
7159
BUILD_COMMAND ""
7260
INSTALL_COMMAND ""
7361
TEST_COMMAND ""
74-
PATCH_COMMAND
75-
${MY_PYTHON_EXECUTABLE}
76-
${CMAKE_CURRENT_LIST_DIR}/firestore_patch.py
77-
--leveldb-version-from
78-
${CMAKE_CURRENT_LIST_DIR}/leveldb.cmake
62+
PATCH_COMMAND patch -Np1 -i ${CMAKE_CURRENT_LIST_DIR}/firestore.patch.txt
7963
HTTP_HEADER "${EXTERNAL_PROJECT_HTTP_HEADER}"
8064
)
8165
endfunction()

cmake/external/firestore.patch.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/cmake/external/leveldb.cmake b/cmake/external/leveldb.cmake
2+
index 920bf2928..c5c9cc7ee 100644
3+
--- a/cmake/external/leveldb.cmake
4+
+++ b/cmake/external/leveldb.cmake
5+
@@ -24,7 +24,10 @@ if(TARGET leveldb)
6+
return()
7+
endif()
8+
9+
-set(version 1.22)
10+
+# This version must be kept in sync with cmake/external/leveldb.cmake
11+
+# in the firebase-cpp-sdk. If this version ever changes then make sure
12+
+# to update leveldb.cmake in the firebase-cpp-sdk accordingly.
13+
+set(version 1.23)
14+
15+
ExternalProject_Get_property(snappy SOURCE_DIR)
16+
set(snappy_source_dir "${SOURCE_DIR}")
17+
@@ -39,7 +42,7 @@ ExternalProject_Add(
18+
DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
19+
DOWNLOAD_NAME leveldb-${version}.tar.gz
20+
URL https://github.com/google/leveldb/archive/${version}.tar.gz
21+
- URL_HASH SHA256=55423cac9e3306f4a9502c738a001e4a339d1a38ffbee7572d4a07d5d63949b2
22+
+ URL_HASH SHA256=9a37f8a6174f09bd622bc723b55881dc541cd50747cbd08831c2a82d620f6d76
23+
24+
PREFIX ${PROJECT_BINARY_DIR}
25+

cmake/external/firestore_patch.py

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)