Skip to content

Commit 7e8c8bc

Browse files
committed
https://github.com/boostorg/boost/issues/843#issuecomment-1872943124
1 parent dc2f526 commit 7e8c8bc

File tree

1 file changed

+214
-0
lines changed

1 file changed

+214
-0
lines changed

App/patches/react-native+0.71.10.patch

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,217 @@ index 06a6afa..1a25823 100644
1313
left: 10,
1414
right: 10,
1515
position: 'absolute',
16+
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
17+
new file mode 100644
18+
index 0000000..361f5fb
19+
--- /dev/null
20+
+++ b/node_modules/react-native/scripts/.packager.env
21+
@@ -0,0 +1 @@
22+
+export RCT_METRO_PORT=8081
23+
diff --git a/node_modules/react-native/sdks/hermes/hermes-engine.podspec b/node_modules/react-native/sdks/hermes/hermes-engine.podspec
24+
new file mode 100644
25+
index 0000000..b800547
26+
--- /dev/null
27+
+++ b/node_modules/react-native/sdks/hermes/hermes-engine.podspec
28+
@@ -0,0 +1,143 @@
29+
+# Copyright (c) Meta Platforms, Inc. and affiliates.
30+
+#
31+
+# This source code is licensed under the MIT license found in the
32+
+# LICENSE file in the root directory of this source tree.
33+
+
34+
+require "json"
35+
+require_relative "./hermes-utils.rb"
36+
+
37+
+react_native_path = File.join(__dir__, "..", "..")
38+
+
39+
+# Whether Hermes is built for Release or Debug is determined by the PRODUCTION envvar.
40+
+build_type = ENV['PRODUCTION'] == "1" ? :release : :debug
41+
+
42+
+# package.json
43+
+package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
44+
+version = package['version']
45+
+
46+
+# sdks/.hermesversion
47+
+hermestag_file = File.join(react_native_path, "sdks", ".hermesversion")
48+
+isInCI = ENV['REACT_NATIVE_CI'] === 'true'
49+
+
50+
+source = {}
51+
+git = "https://github.com/facebook/hermes.git"
52+
+
53+
+isInMain = version.include?('1000.0.0')
54+
+isNightly = version.start_with?('0.0.0-')
55+
+
56+
+if ENV.has_key?('HERMES_ENGINE_TARBALL_PATH')
57+
+ if !File.exist?(ENV['HERMES_ENGINE_TARBALL_PATH'])
58+
+ abort "[Hermes] HERMES_ENGINE_TARBALL_PATH is set, but points to a non-existing file: \"#{ENV['HERMES_ENGINE_TARBALL_PATH']}\"\nIf you don't want to use tarball, run `unset HERMES_ENGINE_TARBALL_PATH`"
59+
+ end
60+
+end
61+
+
62+
+if ENV.has_key?('HERMES_ENGINE_TARBALL_PATH')
63+
+ Pod::UI.puts "[Hermes] Using pre-built Hermes binaries from local path: #{ENV['HERMES_ENGINE_TARBALL_PATH']}".yellow if Object.const_defined?("Pod::UI")
64+
+ source[:http] = "file://#{ENV['HERMES_ENGINE_TARBALL_PATH']}"
65+
+elsif isInMain
66+
+ Pod::UI.puts '[Hermes] Installing hermes-engine may take slightly longer, building Hermes compiler from source...'.yellow if Object.const_defined?("Pod::UI")
67+
+ source[:git] = git
68+
+ source[:commit] = `git ls-remote https://github.com/facebook/hermes main | cut -f 1`.strip
69+
+elsif isNightly
70+
+ Pod::UI.puts '[Hermes] Nightly version, download pre-built for Hermes'.yellow if Object.const_defined?("Pod::UI")
71+
+ destination_path = download_nightly_hermes(react_native_path, version)
72+
+ # set tarball as hermes engine
73+
+ source[:http] = "file://#{destination_path}"
74+
+elsif File.exist?(hermestag_file) && isInCI
75+
+ Pod::UI.puts '[Hermes] Detected that you are on a React Native release branch, building Hermes from source but fetched from tag...'.yellow if Object.const_defined?("Pod::UI")
76+
+ hermestag = File.read(hermestag_file).strip
77+
+ source[:git] = git
78+
+ source[:tag] = hermestag
79+
+else
80+
+ # Sample url from Maven:
81+
+ # https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.71.0/react-native-artifacts-0.71.0-hermes-ios-debug.tar.gz
82+
+ source[:http] = "https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/#{version}/react-native-artifacts-#{version}-hermes-ios-#{build_type.to_s}.tar.gz"
83+
+end
84+
+
85+
+Pod::Spec.new do |spec|
86+
+ spec.name = "hermes-engine"
87+
+ spec.version = version
88+
+ spec.summary = "Hermes is a small and lightweight JavaScript engine optimized for running React Native."
89+
+ spec.description = "Hermes is a JavaScript engine optimized for fast start-up of React Native apps. It features ahead-of-time static optimization and compact bytecode."
90+
+ spec.homepage = "https://hermesengine.dev"
91+
+ spec.license = package['license']
92+
+ spec.author = "Facebook"
93+
+ spec.source = source
94+
+ spec.platforms = { :osx => "10.13", :ios => "12.4" }
95+
+
96+
+ spec.preserve_paths = '**/*.*'
97+
+ spec.source_files = ''
98+
+
99+
+ spec.xcconfig = {
100+
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
101+
+ "CLANG_CXX_LIBRARY" => "compiler-default"
102+
+ }.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {})
103+
+
104+
+ if source[:http] then
105+
+
106+
+ spec.subspec 'Pre-built' do |ss|
107+
+ ss.preserve_paths = ["destroot/bin/*"].concat(build_type == :debug ? ["**/*.{h,c,cpp}"] : [])
108+
+ ss.source_files = "destroot/include/**/*.h"
109+
+ ss.exclude_files = ["destroot/include/jsi/jsi/JSIDynamic.{h,cpp}", "destroot/include/jsi/jsi/jsilib-*.{h,cpp}"]
110+
+ ss.header_mappings_dir = "destroot/include"
111+
+ ss.ios.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework"
112+
+ ss.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework"
113+
+ end
114+
+
115+
+ elsif source[:git] then
116+
+
117+
+ spec.subspec 'Hermes' do |ss|
118+
+ ss.source_files = ''
119+
+ ss.public_header_files = 'API/hermes/*.h'
120+
+ ss.header_dir = 'hermes'
121+
+ end
122+
+
123+
+ spec.subspec 'JSI' do |ss|
124+
+ ss.source_files = ''
125+
+ ss.public_header_files = 'API/jsi/jsi/*.h'
126+
+ ss.header_dir = 'jsi'
127+
+ end
128+
+
129+
+ spec.subspec 'Public' do |ss|
130+
+ ss.source_files = ''
131+
+ ss.public_header_files = 'public/hermes/Public/*.h'
132+
+ ss.header_dir = 'hermes/Public'
133+
+ end
134+
+
135+
+ hermesc_path = ""
136+
+
137+
+ if ENV.has_key?('HERMES_OVERRIDE_HERMESC_PATH') && File.exist?(ENV['HERMES_OVERRIDE_HERMESC_PATH']) then
138+
+ hermesc_path = ENV['HERMES_OVERRIDE_HERMESC_PATH']
139+
+ else
140+
+ # Keep hermesc_path synchronized with .gitignore entry.
141+
+ ENV['REACT_NATIVE_PATH'] = react_native_path
142+
+ hermesc_path = "${REACT_NATIVE_PATH}/sdks/hermes-engine/build_host_hermesc"
143+
+ # NOTE: Prepare command is not run if the pod is not downloaded.
144+
+ spec.prepare_command = ". #{react_native_path}/sdks/hermes-engine/utils/build-hermesc-xcode.sh #{hermesc_path}"
145+
+ end
146+
+
147+
+ spec.user_target_xcconfig = {
148+
+ 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/hermes-engine/destroot/Library/Frameworks/iphoneos" ' +
149+
+ '"$(PODS_ROOT)/hermes-engine/destroot/Library/Frameworks/iphonesimulator" ' +
150+
+ '"$(PODS_ROOT)/hermes-engine/destroot/Library/Frameworks/macosx" ' +
151+
+ '"$(PODS_ROOT)/hermes-engine/destroot/Library/Frameworks/catalyst"',
152+
+ 'OTHER_LDFLAGS' => '-framework "hermes"',
153+
+ 'HERMES_CLI_PATH' => "#{hermesc_path}/bin/hermesc"
154+
+ }
155+
+
156+
+ spec.script_phases = [
157+
+ {
158+
+ :name => 'Build Hermes',
159+
+ :script => <<-EOS
160+
+ . ${PODS_ROOT}/../.xcode.env
161+
+ export CMAKE_BINARY=${CMAKE_BINARY:-#{%x(command -v cmake | tr -d '\n')}}
162+
+ . ${REACT_NATIVE_PATH}/sdks/hermes-engine/utils/build-hermes-xcode.sh #{version} #{hermesc_path}/ImportHermesc.cmake
163+
+ EOS
164+
+ },
165+
+ {
166+
+ :name => 'Copy Hermes Framework',
167+
+ :script => ". ${REACT_NATIVE_PATH}/sdks/hermes-engine/utils/copy-hermes-xcode.sh"
168+
+ }
169+
+ ]
170+
+ end
171+
+end
172+
diff --git a/node_modules/react-native/sdks/hermes/hermes-utils.rb b/node_modules/react-native/sdks/hermes/hermes-utils.rb
173+
new file mode 100644
174+
index 0000000..0842496
175+
--- /dev/null
176+
+++ b/node_modules/react-native/sdks/hermes/hermes-utils.rb
177+
@@ -0,0 +1,26 @@
178+
+# Copyright (c) Meta Platforms, Inc. and affiliates.
179+
+#
180+
+# This source code is licensed under the MIT license found in the
181+
+# LICENSE file in the root directory of this source tree.
182+
+
183+
+require 'net/http'
184+
+require 'rexml/document'
185+
+
186+
+# This function downloads the nightly prebuilt version of Hermes based on the passed version
187+
+# and save it in the node_module/react_native/sdks/downloads folder
188+
+# It then returns the path to the hermes tarball
189+
+#
190+
+# Parameters
191+
+# - react_native_path: the path to the React Native folder in node modules. It is used as root path to store the Hermes tarball
192+
+# - version: the version of React Native that requires the Hermes tarball
193+
+# Returns: the path to the downloaded Hermes tarball
194+
+def download_nightly_hermes(react_native_path, version)
195+
+ params = "r=snapshots\&g=com.facebook.react\&a=react-native-artifacts\&c=hermes-ios-debug\&e=tar.gz\&v=#{version}-SNAPSHOT"
196+
+ tarball_url = "http://oss.sonatype.org/service/local/artifact/maven/redirect\?#{params}"
197+
+
198+
+ destination_folder = "#{react_native_path}/sdks/downloads"
199+
+ destination_path = "#{destination_folder}/hermes-ios.tar.gz"
200+
+
201+
+ `mkdir -p "#{destination_folder}" && curl "#{tarball_url}" -Lo "#{destination_path}"`
202+
+ return destination_path
203+
+end
204+
diff --git a/node_modules/react-native/third-party-podspecs/boost.podspec b/node_modules/react-native/third-party-podspecs/boost.podspec
205+
index 3d9331c..8cd4a8a 100644
206+
--- a/node_modules/react-native/third-party-podspecs/boost.podspec
207+
+++ b/node_modules/react-native/third-party-podspecs/boost.podspec
208+
@@ -5,16 +5,17 @@
209+
210+
Pod::Spec.new do |spec|
211+
spec.name = 'boost'
212+
- spec.version = '1.76.0'
213+
+ spec.version = '1.83.0'
214+
spec.license = { :type => 'Boost Software License', :file => "LICENSE_1_0.txt" }
215+
spec.homepage = 'http://www.boost.org'
216+
spec.summary = 'Boost provides free peer-reviewed portable C++ source libraries.'
217+
spec.authors = 'Rene Rivera'
218+
- spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2',
219+
- :sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }
220+
+ # Patched due to issue https://github.com/boostorg/boost/issues/843
221+
+ spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.bz2',
222+
+ :sha256 => '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' }
223+
224+
# Pinning to the same version as React.podspec.
225+
- spec.platforms = { :ios => '11.0' }
226+
+ spec.platforms = min_supported_versions
227+
spec.requires_arc = false
228+
229+
spec.module_name = 'boost'

0 commit comments

Comments
 (0)