From aada1afa2e1bdb363e0b3ba7a48cce574c5c4354 Mon Sep 17 00:00:00 2001 From: Marc Horowitz Date: Wed, 1 Feb 2017 14:10:43 -0800 Subject: [PATCH] Add scripts to fetch external third-party dependencies. Summary: This downloads, uncompresses, and configures folly and its dependencies: boost, double-conversion, and glog. Reviewed By: bestander Differential Revision: D4434066 fbshipit-source-id: 8f9d18448ef139e450a8c45a64d6a066d731ac8f --- ios-cc.sh | 3 +++ ios-install-third-party.sh | 40 ++++++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 44 insertions(+) create mode 100755 ios-cc.sh create mode 100755 ios-install-third-party.sh diff --git a/ios-cc.sh b/ios-cc.sh new file mode 100755 index 000000000..621a75a8a --- /dev/null +++ b/ios-cc.sh @@ -0,0 +1,3 @@ +#!/bin/sh -x + +exec "$(xcrun -find -sdk iphoneos cc)" -arch armv7 -isysroot "$(xcrun -sdk iphoneos --show-sdk-path)" "$@" diff --git a/ios-install-third-party.sh b/ios-install-third-party.sh new file mode 100755 index 000000000..47a8e0eae --- /dev/null +++ b/ios-install-third-party.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +#boostdir="`node ./node_modules/boost-lib/bin/boost-lib download -V 1.57`" +#cd "$boostdir" +#./bootstrap.sh +#./b2 headers + +set -e + +cachedir="$HOME/.rncache" +mkdir -p "$cachedir" + +function fetch_and_unpack () { + file=$1 + url=$2 + cmd=$3 + + if [ ! -f "$cachedir/$file" ]; then + (cd "$cachedir"; curl -J -L -O "$url") + fi + + dir=$(basename "$file" .tar.gz) + if [ ! -d "third-party/$dir" ]; then + (cd third-party; + echo Unpacking "$cachedir/$file"... + tar zxf "$cachedir/$file" + + cd "$dir" + eval "${cmd:-true}") + fi +} + +mkdir -p third-party + +SCRIPTDIR=$(pwd)/$(dirname "$0") + +fetch_and_unpack glog-0.3.4.tar.gz https://github.com/google/glog/archive/v0.3.4.tar.gz "CC='$SCRIPTDIR'/ios-cc.sh CXX='$SCRIPTDIR'/ios-cc.sh ./configure --host arm-apple-darwin" +fetch_and_unpack double-conversion-1.1.1.tar.gz https://github.com/google/double-conversion/archive/v1.1.1.tar.gz +fetch_and_unpack boost_1_57_0.tar.gz https://github.com/react-native-community/boost-for-react-native/releases/download/v1.57.0-1/boost_1_57_0.tar.gz +fetch_and_unpack folly-2016.09.26.00.tar.gz https://github.com/facebook/folly/archive/v2016.09.26.00.tar.gz diff --git a/package.json b/package.json index 37edbd190..4c0373167 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "cli.js", "flow", "init.sh", + "ios-install-third-party.sh", "jest-preset.json", "jest", "lib",