forked from EdgeApp/edge-react-gui
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpostinstall.sh
executable file
·41 lines (31 loc) · 1.67 KB
/
postinstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
mkdir -p temp
# The `usb` module doesn't properly install on some boxes:
mkdir -p node_modules/usb
touch node_modules/usb/index.js
# Remove inclusion of c++_shared.so library since we are using jsc-android which already includes it
sed "s/\,[[:space:]]'-DANDROID_STL=c++_shared'//g" ./node_modules/react-native-fast-crypto/android/build.gradle > temp/build.gradle
mv temp/build.gradle ./node_modules/react-native-fast-crypto/android/build.gradle
# Force xcode build script to out map files
sed "s/--reset-cache/--reset-cache --sourcemap-output ios-release.bundle.map/g" node_modules/react-native/scripts/react-native-xcode.sh > temp/react-native-xcode.sh
mv temp/react-native-xcode.sh node_modules/react-native/scripts/react-native-xcode.sh
chmod 755 node_modules/react-native/scripts/react-native-xcode.sh
# Disable minification
# Macs don't have `sed -i`, so we use a temporary file for the sed output:
#sed -e 's/minify:.*,/minify: false,/' ./node_modules/react-native/local-cli/bundle/buildBundle.js > buildBundle.js
#mv buildBundle.js ./node_modules/react-native/local-cli/bundle/buildBundle.js
# TODO: Remove the minification hack once the CLI accepts a --minify parameter.
# See: https://github.com/facebook/react-native/pull/16456
# Set up CocoaPods on iOS:
unamestr=`uname`
if [[ "$unamestr" == 'Darwin' ]]; then
# Copy missing podspecs:
for package in $(ls ios/podspecs | sed s/.podspec//); do
cp ios/podspecs/$package.podspec node_modules/$package/$package.podspec
done
# Install the dependencies:
(cd ios; pod install)
fi
# Apply patches
patch -f ./node_modules/react-native/React/Views/RCTFont.mm ./patches/RCTFont.patch || true
node ./scripts/makeNativeHeaders.js