Skip to content

Instantly share code, notes, and snippets.

@PoomSmart
Forked from JohnCoates/commands.sh
Created July 8, 2018 11:09
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 PoomSmart/3a04fdc2607e6df1c1ec3f1d9d9fb488 to your computer and use it in GitHub Desktop.
Save PoomSmart/3a04fdc2607e6df1c1ec3f1d9d9fb488 to your computer and use it in GitHub Desktop.
THEOS on Windows 10 with Linux subsystem
# Turn on Developer Mode
# Open Settings -> Update and Security -> For developers
# Don't reboot yet
# Run in powershell administrator:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
# accept reboot
## Install Ubuntu
# run in powershell administrator:
lxrun /install /y
bash
apt-get update
sudo apt-get install -y build-essential git unzip libio-compress-perl
sudo git clone --recursive git://github.com/theos/theos.git /opt/theos
cd /opt/theos/toolchain
sudo wget https://developer.angelxwind.net/Linux/ios-toolchain_clang%2bllvm%2bld64_latest_linux_x86_64.zip -O LinuxToolchain.zip
sudo unzip LinuxToolchain.zip && sudo rm -f LinuxToolchain.zip
sudo rm -rf /opt/theos/sdks/
git clone https://github.com/theos/sdks /opt/theos/sdks
# Add $THEOS
echo export THEOS="/opt/theos" >> ~/.bashrc
echo export PATH="\$THEOS/bin:\$PATH" >> ~/.bashrc
echo alias theos="\$THEOS/bin/nic.pl" >> ~/.bashrc
echo "umask 0022" >> ~/.bashrc
source ~/.bashrc
# install newer libstdc++
cd /tmp
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.10_amd64.deb -O libstdc++.deb
dpkg-deb -x libstdc++.deb libstdc++
cp libstdc++/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 /usr/lib/x86_64-linux-gnu/
cd /usr/lib/x86_64-linux-gnu/
ln -sf libstdc++.so.6.0.21 libstdc++.so.6
# fix fakeroot
sudo sed -i 's/\$(FAKEROOT) -r/fakeroot-tcp/g' /opt/theos/makefiles/package/deb.mk
## References
# https://docs.microsoft.com/en-us/windows/wsl/install-win10
# https://docs.microsoft.com/en-us/windows/wsl/install-win10#for-anniversary-update-and-creators-update-install-using-lxrun
# https://github.com/Akebu/Theos-on-WSL#workaround-for-fakeroot
# http://bbs.iosre.com/t/windows-10-theos/7139
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment