Skip to content

Commit 321e11f

Browse files
committed
Update sqlite3 binding for iOS compatibility and improve Python version handling
1 parent 6dd65c7 commit 321e11f

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

www/nodejs-project/patches/sqlite3+4.2.0.patch

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
diff --git a/node_modules/sqlite3/deps/sqlite3.gyp b/node_modules/sqlite3/deps/sqlite3.gyp
2-
index 61b3085..dbdc9ef 100755
3-
--- a/node_modules/sqlite3/deps/sqlite3.gyp
4-
+++ b/node_modules/sqlite3/deps/sqlite3.gyp
5-
@@ -60,7 +60,7 @@
6-
'outputs': [
7-
'<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
8-
],
9-
- 'action': ['<!(node -p "process.env.npm_config_python || \\"python\\"")','./extract.py','./sqlite-autoconf-<@(sqlite_version).tar.gz','<(SHARED_INTERMEDIATE_DIR)']
10-
+ 'action': ['<!(node -p "process.env.npm_config_python || \\"python3\\"")','./extract.py','./sqlite-autoconf-<@(sqlite_version).tar.gz','<(SHARED_INTERMEDIATE_DIR)']
11-
}
12-
],
13-
'direct_dependent_settings': {
141
diff --git a/node_modules/sqlite3/binding.gyp b/node_modules/sqlite3/binding.gyp
15-
index 019df41..c10f85f 100644
2+
index 019df41..2fe3635 100644
163
--- a/node_modules/sqlite3/binding.gyp
174
+++ b/node_modules/sqlite3/binding.gyp
185
@@ -9,6 +9,20 @@
@@ -22,8 +9,8 @@ index 019df41..c10f85f 100644
229
+ ["is_ios==1", {
2310
+ "type": "shared_library",
2411
+ "xcode_settings": {
25-
+ "SDKROOT": "iphoneos",
26-
+ "IPHONEOS_DEPLOYMENT_TARGET": "13.0",
12+
+ "SDKROOT": "<(ios_sdk)",
13+
+ "IPHONEOS_DEPLOYMENT_TARGET": "<(ios_ver)",
2714
+ "OTHER_LDFLAGS": [
2815
+ "-dynamiclib",
2916
+ "-install_name @rpath/node_sqlite3.framework/node_sqlite3",
@@ -81,14 +68,16 @@ index 019df41..c10f85f 100644
8168
]
8269
}
8370
diff --git a/node_modules/sqlite3/deps/common-sqlite.gypi b/node_modules/sqlite3/deps/common-sqlite.gypi
84-
index 13c73ea..2c43b0c 100644
71+
index 13c73ea..7bcaeef 100644
8572
--- a/node_modules/sqlite3/deps/common-sqlite.gypi
8673
+++ b/node_modules/sqlite3/deps/common-sqlite.gypi
87-
@@ -2,12 +2,19 @@
74+
@@ -2,12 +2,21 @@
8875
'variables': {
8976
'sqlite_version%':'3310100',
9077
"toolset%":'',
91-
+ "is_ios%": "<!(python3 -c \"import os; print(1 if os.environ.get('PLATFORM') == 'ios' or os.environ.get('SDKROOT') and 'iPhone' in os.environ.get('SDKROOT') else 0)\")"
78+
+ "is_ios%": "<!(python3 -c \"import os; sdk = os.environ.get('SDKROOT', ''); print(1 if 'iPhone' in sdk or os.environ.get('PLATFORM') == 'ios' else 0)\")",
79+
+ "ios_ver%": "<!(python3 -c \"import os; print(os.environ.get('IPHONEOS_DEPLOYMENT_TARGET', '13.0'))\")",
80+
+ "ios_sdk": "<!(python3 -c \"import os; print('iphonesimulator' if 'iPhoneSimulator' in os.environ.get('SDKROOT', '') else 'iphoneos')\")"
9281
},
9382
'target_defaults': {
9483
'default_configuration': 'Release',
@@ -98,12 +87,25 @@ index 13c73ea..2c43b0c 100644
9887
+ }],
9988
+ ['is_ios==1', {
10089
+ 'xcode_settings': {
101-
+ 'SDKROOT': 'iphoneos',
102-
+ 'IPHONEOS_DEPLOYMENT_TARGET': '13.0'
90+
+ 'SDKROOT': '<(ios_sdk)',
91+
+ 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_ver)'
10392
+ }
10493
}]
10594
],
10695
'configurations': {
96+
diff --git a/node_modules/sqlite3/deps/sqlite3.gyp b/node_modules/sqlite3/deps/sqlite3.gyp
97+
index 61b3085..dbdc9ef 100755
98+
--- a/node_modules/sqlite3/deps/sqlite3.gyp
99+
+++ b/node_modules/sqlite3/deps/sqlite3.gyp
100+
@@ -60,7 +60,7 @@
101+
'outputs': [
102+
'<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
103+
],
104+
- 'action': ['<!(node -p "process.env.npm_config_python || \\"python\\"")','./extract.py','./sqlite-autoconf-<@(sqlite_version).tar.gz','<(SHARED_INTERMEDIATE_DIR)']
105+
+ 'action': ['<!(node -p "process.env.npm_config_python || \\"python3\\"")','./extract.py','./sqlite-autoconf-<@(sqlite_version).tar.gz','<(SHARED_INTERMEDIATE_DIR)']
106+
}
107+
],
108+
'direct_dependent_settings': {
107109
diff --git a/node_modules/sqlite3/lib/sqlite3-binding.js b/node_modules/sqlite3/lib/sqlite3-binding.js
108110
index 065f595..c5bc288 100644
109111
--- a/node_modules/sqlite3/lib/sqlite3-binding.js

0 commit comments

Comments
 (0)