Skip to content

Commit

Permalink
Revert "Merge pull request #33819 from facebook/tido/fix-pod-install-…
Browse files Browse the repository at this point in the history
…0.69"

This reverts commit f880373, reversing
changes made to 3310ccd.
  • Loading branch information
fortmarek committed May 20, 2022
1 parent f880373 commit 06ec3aa
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,11 @@ def use_react_native_codegen!(spec, options={})

def downloadAndConfigureHermesSource(react_native_path)
hermes_tarball_base_url = "https://github.com/facebook/hermes/tarball/"

sdks_dir = Pod::Config.instance.installation_root.join(react_native_path, "sdks")
download_dir = sdks_dir.join("download")
hermes_dir = sdks_dir.join("hermes")
hermes_tag_file = sdks_dir.join(".hermesversion")

hermes_dir.mkpath
download_dir.mkpath
sdks_dir = "#{react_native_path}/sdks"
download_dir = "#{sdks_dir}/download"
hermes_dir = "#{sdks_dir}/hermes"
hermes_tag_file = "#{sdks_dir}/.hermesversion"
system("mkdir -p #{hermes_dir} #{download_dir}")

if (File.exist?(hermes_tag_file))
hermes_tag = File.read(hermes_tag_file).strip
Expand All @@ -683,19 +680,19 @@ def downloadAndConfigureHermesSource(react_native_path)

hermes_tarball_url = hermes_tarball_base_url + hermes_tag
hermes_tag_sha = %x[git ls-remote https://github.com/facebook/hermes #{hermes_tag} | cut -f 1].strip
hermes_tarball_path = download_dir.join("hermes-#{hermes_tag_sha}.tar.gz")
hermes_tarball_path = "#{download_dir}/hermes-#{hermes_tag_sha}.tar.gz"

if (!File.exist?(hermes_tarball_path))
Pod::UI.puts "[Hermes] Downloading Hermes source code..."
system("curl #{hermes_tarball_url} -Lo #{hermes_tarball_path.to_s}")
system("curl #{hermes_tarball_url} -Lo #{hermes_tarball_path}")
end
Pod::UI.puts "[Hermes] Extracting Hermes tarball (#{hermes_tag_sha.slice(0,6)})"
system("tar -zxf #{hermes_tarball_path.to_s} --strip-components=1 --directory #{hermes_dir.to_s}")
system("tar -zxf #{hermes_tarball_path} --strip-components=1 --directory #{hermes_dir}")

# TODO: Integrate this temporary hermes-engine.podspec into the actual one located in facebook/hermes
FileUtils.cp(sdks_dir.join("hermes-engine.podspec"), hermes_dir.join("hermes-engine.podspec"))
system("cp #{sdks_dir}/hermes-engine.podspec #{hermes_dir}/hermes-engine.podspec")

hermes_dir.relative_path_from(Pod::Config.instance.installation_root).to_s
hermes_dir
end

# This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon (M1) machines.
Expand Down

0 comments on commit 06ec3aa

Please sign in to comment.