Skip to content

Instantly share code, notes, and snippets.

@JohnCoates
Last active May 6, 2021 22:00
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save JohnCoates/ea7b8002b77ab7c1c758384e55538603 to your computer and use it in GitHub Desktop.
Save JohnCoates/ea7b8002b77ab7c1c758384e55538603 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.4_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
@LacertosusRepo
Copy link

Line 33, the link is broken to download libstdc++, here is another official link: http://ubuntu.mirrors.tds.net/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.10_amd64.deb

@shayshtern
Copy link

so after that how to start working?

@arthurdapaz
Copy link

arthurdapaz commented Jul 31, 2018

Answering @shayshtern, you just type: "theos" on a desired working folder.

I, myself, create a folder on my linux home:

# mkdir ~/tweaks
then:
# cd ~/tweaks
# theos

@arthurdapaz
Copy link

Does anyone knows how to fix the SDKs issues? That doesn't compile the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment