node-sword-interface 1.0.73 → 1.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.gyp CHANGED
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "variables": {
3
- # Detect if we are building for iOS by checking an env var
4
- "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)\")"
3
+ # 1. Detect if we are on iOS
4
+ "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)\")",
5
+
6
+ # 2. Get the deployment target (e.g., '15.0') from env, default to '13.0'
7
+ "ios_ver%": "<!(python3 -c \"import os; print(os.environ.get('IPHONEOS_DEPLOYMENT_TARGET', '13.0'))\")",
8
+
9
+ # 3. Construct the full target triple dynamically
10
+ "ios_target": "<!(python3 -c \"import os; ver = os.environ.get('IPHONEOS_DEPLOYMENT_TARGET', '13.0'); suffix = '-simulator' if 'iPhoneSimulator' in os.environ.get('SDKROOT', '') else ''; print(f'arm64-apple-ios{ver}{suffix}')\")"
5
11
  },
6
12
  "targets": [
7
13
  {
@@ -11,7 +17,7 @@
11
17
  ["is_ios==1", {
12
18
  "xcode_settings": {
13
19
  "SDKROOT": "iphoneos",
14
- "IPHONEOS_DEPLOYMENT_TARGET": "13.0"
20
+ "IPHONEOS_DEPLOYMENT_TARGET": "<(ios_ver)"
15
21
  },
16
22
  'actions': [
17
23
  {
@@ -19,7 +25,7 @@
19
25
  'message': 'Building sword library for iOS...',
20
26
  'inputs': [],
21
27
  'outputs': ['sword_build/libsword.a'],
22
- 'action': ['./scripts/build_sword.sh', '--ios'],
28
+ 'action': ['./scripts/build_sword.sh', '--ios', '<(ios_target)', '<(ios_ver)'],
23
29
  }
24
30
  ]
25
31
  }],
@@ -112,14 +118,18 @@
112
118
  ],
113
119
  "xcode_settings": {
114
120
  "SDKROOT": "iphoneos",
115
- "IPHONEOS_DEPLOYMENT_TARGET": "13.0",
116
- "SUPPORTED_PLATFORMS": "iphonesimulator iphoneos",
117
- # This ensures the binary is built for the current active destination
121
+ "IPHONEOS_DEPLOYMENT_TARGET": "<(ios_ver)",
118
122
  "ONLY_ACTIVE_ARCH": "YES",
123
+ "OTHER_CFLAGS": [
124
+ "-target <(ios_target)"
125
+ ],
119
126
  "OTHER_LDFLAGS": [
120
127
  "-dynamiclib",
121
128
  "-install_name @rpath/node_sword_interface.framework/node_sword_interface",
122
- "-undefined dynamic_lookup"
129
+ "-undefined dynamic_lookup",
130
+ "-Wl,-bind_at_load",
131
+ "-all_load",
132
+ "-target <(ios_target)"
123
133
  ],
124
134
  "MACH_O_TYPE": "mh_dylib",
125
135
  "PRODUCT_TYPE": "com.apple.product-type.framework"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-sword-interface",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "description": "Javascript (N-API) interface to SWORD library",
5
5
  "keywords": [
6
6
  "C++",
@@ -83,14 +83,26 @@ elif [ "$1" = "--ios" ] ; then
83
83
  git clone https://github.com/karlkleinpaste/biblesync.git
84
84
  git -C biblesync checkout 2.1.0
85
85
 
86
+ IOS_TARGET="$2"
87
+ IOS_VER="$3"
88
+
89
+ if [ -z "$IOS_VER" ]; then
90
+ IOS_VER="13.0"
91
+ fi
92
+
93
+ SYSROOT="iphoneos"
94
+ if echo "$IOS_TARGET" | grep -q "simulator"; then
95
+ SYSROOT="iphonesimulator"
96
+ fi
97
+
86
98
  cd sword_build
87
99
 
88
100
  cmake -DCMAKE_SYSTEM_NAME=iOS \
89
101
  -DLIBSWORD_LIBRARY_TYPE=Static \
90
102
  -DCMAKE_CXX_STANDARD=11 \
91
103
  -DCMAKE_OSX_ARCHITECTURES="arm64" \
92
- -DCMAKE_OSX_SYSROOT=iphoneos \
93
- -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
104
+ -DCMAKE_OSX_SYSROOT=$SYSROOT \
105
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=$IOS_VER \
94
106
  -DCMAKE_BUILD_TYPE=$SWORD_BUILD_TYPE \
95
107
  -DNODYNCAST=1 \
96
108
  -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \