- Install
patch-package:npm install --save-dev patch-package postinstall-postinstall - Modify
boost.podspec:change
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. Pod::Spec.new do |spec| spec.name = 'boost' spec.version = '1.83.0' spec.license = { :type => 'Boost Software License', :file => "LICENSE_1_0.txt" } spec.homepage = 'http://www.boost.org' spec.summary = 'Boost provides free peer-reviewed portable C++ source libraries.' spec.authors = 'Rene Rivera' spec.source = { :http => 'https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2', :sha256 => '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' } # Pinning to the same version as React.podspec. spec.platforms = min_supported_versions spec.requires_arc = false spec.module_name = 'boost' spec.header_dir = 'boost' spec.preserve_path = 'boost' endto
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. Pod::Spec.new do |spec| spec.name = 'boost' spec.version = '1.83.0' spec.license = { :type => 'Boost Software License', :file => "LICENSE_1_0.txt" } spec.homepage = 'http://www.boost.org' spec.summary = 'Boost provides free peer-reviewed portable C++ source libraries.' spec.authors = 'Rene Rivera' # Patched due to issue https://github.com/boostorg/boost/issues/843 spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.83.0/boost_1_83_0.tar.bz2', :sha256 => '6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e' } # Pinning to the same version as React.podspec. spec.platforms = min_supported_versions spec.requires_arc = false spec.module_name = 'boost' spec.header_dir = 'boost' spec.preserve_path = 'boost' end ``` - Create a Patch:
- Run
npx patch-package react-nativeto create a patch file based on your changes. This command generates a patch file in a directory calledpatches/.
- Run
- Apply the Patch Automatically:
- Modify your package.json to apply the patch after installation. Add the following to your scripts section:
"scripts": { "postinstall": "patch-package" } - Now, whenever you run
npm install,patch-packagewill automatically apply the patch to theboost.podspecfile.
- Modify your package.json to apply the patch after installation. Add the following to your scripts section: