Skip to content

Instantly share code, notes, and snippets.

@hewigovens
Forked from rpetrich/install-sdk
Last active December 13, 2015 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hewigovens/4965333 to your computer and use it in GitHub Desktop.
Save hewigovens/4965333 to your computer and use it in GitHub Desktop.
#!/bin/sh
SDK=`dirname $0`
SCRIPT=`basename $0`
SDKPARENT=`dirname $SDK`
DEVROOT=`xcode-select --print-path`
SDKVER=`xcodebuild -showsdks | grep iphoneos | awk '{print $2}' | tail -n 1`
SDKROOT="$DEVROOT/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$SDKVER.sdk"
SDKsROOT="$DEVROOT/Platforms/iPhoneOS.platform/Developer/SDKs"
PLATFORM=`uname -sp`
if [ "$PLATFORM" = "Darwin i386" -o "$PLATFORM" = "Darwin x86_64" ]; then
echo "iPhone Toolchain installer script by rpetrich"
echo ""
if [ "$SDKPARENT" != "$SDKsROOT" -a "`pwd`" != "$SDKsROOT" ] ; then
echo "$SDK is not a valid iPhone SDK. Move this script to $SDKROOT"
else
echo "Be sure you have installed APT7 and OpenSSH and have closed Cydia before continuing!"
/bin/echo -n "iPhone IP Address: "
read ADDRESS
pushd $SDKROOT
tar -cvz - . 2> /dev/null | ssh root@$ADDRESS "(mkdir -p /var/sdk && cd /var/sdk && tar xvpzf - && ./$SCRIPT)"
popd
fi
elif [ "$PLATFORM" = "Darwin arm" ]; then
pushd /var/sdk/usr/lib
ln -fs libgcc_s.1.dylib libgcc_s.10.5.dylib
ln -fs dylib1.o dylib1.10.5.o
ln -fs crt1.o crt1.10.5.o
ln -fs libstdc++.6.0.9.dylib libstdc++.6.dylib
ln -fs libstdc++.6.0.9.dylib libstdc++.dylib
ln -fs libobjc.A.dylib libobjc.dylib
ln -fs libSystem.B.dylib libSystem.dylib
popd
ln -fs /usr/include/substrate.h /var/sdk/usr/include/substrate.h
apt-get -y install curl git make ldid less com.ericasadun.utilities nano adv-cmds top rsync file-cmds inetutils
curl -L http://apt.saurik.com/cydia/debs/libgcc_4.2-20080410-1-6_iphoneos-arm.deb -o libgcc.deb
dpkg -i libgcc.deb
rm libgcc.deb
apt-get -y install csu iphone-gcc coreutils cycript
else
echo "Unknown OS and architecture!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment