Last active
September 26, 2024 22:38
-
-
Save Lessica/c2d7bfcc3b9edb364b83387ad7785302 to your computer and use it in GitHub Desktop.
Build script for idevicerestore and all its dependencies for macOS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Tested on macOS 12.0 / Xcode 13.3 / Homebrew 3.4.6-60-ge1c1157 | |
# yum install python python-devel | |
# echo '[group_kdesig-cmake3_EPEL] | |
# name=Copr repo for cmake3_EPEL owned by @kdesig | |
# baseurl=https://copr-be.cloud.fedoraproject.org/results/@kdesig/cmake3_EPEL/epel-7-$basearch/ | |
# type=rpm-md | |
# skip_if_unavailable=True | |
# gpgcheck=1 | |
# gpgkey=https://copr-be.cloud.fedoraproject.org/results/@kdesig/cmake3_EPEL/pubkey.gpg | |
# repo_gpgcheck=0 | |
# enabled=1 | |
# enabled_metadata=1' >> /etc/yum.repos.d/cmake3.repo | |
# yum install cmake3 | |
mkdir BuildFutureRestore | |
cd BuildFutureRestore | |
brew install make cmake automake autoconf libtool pkg-config curl openssl readline | |
echo 'export PKG_CONFIG_PATH="/usr/local/opt/curl/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc | |
echo 'export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc | |
echo 'export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc | |
# echo 'export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc | |
source ~/.zshrc | |
git clone https://github.com/libimobiledevice/libplist.git | |
cd libplist | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/lib/libplist* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libplist* | |
cd .. | |
git clone --recursive https://github.com/nih-at/libzip.git | |
cd libzip | |
# CFLAGS="-mmacosx-version-min=11.0" cmake . -DBUILD_SHARED_LIBS=off -DENABLE_ZSTD=off -DENABLE_GNUTLS=off -DENABLE_MBEDTLS=off -DOPENSSL_CRYPTO_LIBRARY=$HOME/Projects/BuildVNCServer/Build-OpenSSL-cURL/archive/libcurl-7.80.0-openssl-1.1.1l-nghttp2-1.46.0/lib/MacOS/libcrypto.a -DOPENSSL_INCLUDE_DIR=$HOME/Projects/BuildVNCServer/Build-OpenSSL-cURL/archive/libcurl-7.80.0-openssl-1.1.1l-nghttp2-1.46.0/include | |
CFLAGS="-mmacosx-version-min=11.0" cmake . -DBUILD_SHARED_LIBS=off | |
# cmake3 . | |
# ln -s /usr/local/lib64/libzip.so.5.0 /lib64/libzip.so | |
# ln -s /usr/local/lib64/libzip.so.5.0 /lib64/libzip.so.5 | |
sudo rm -f /usr/local/lib/libzip* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libzip* | |
cd .. | |
git clone --recursive https://github.com/tihmstar/libgeneral.git | |
cd libgeneral | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/lib/libgeneral* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libgeneral* | |
cd .. | |
git clone --recursive https://github.com/libimobiledevice/libimobiledevice-glue.git | |
cd libimobiledevice-glue | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/lib/libimobiledevice-glue* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libimobiledevice-glue* | |
cd .. | |
git clone --recursive https://github.com/tihmstar/libfragmentzip.git | |
cd libfragmentzip | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/lib/libfragmentzip* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libfragmentzip* | |
cd .. | |
git clone --recursive https://github.com/libimobiledevice/libirecovery.git | |
cd libirecovery | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/lib/libirecovery* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libirecovery* | |
cd .. | |
git clone --recursive https://github.com/tihmstar/tsschecker.git | |
cd tsschecker | |
# CFLAGS="-mmacosx-version-min=11.0" LDFLAGS="-L$HOME/Projects/BuildVNCServer/Build-OpenSSL-cURL/archive/libcurl-7.80.0-openssl-1.1.1l-nghttp2-1.46.0/lib/MacOS -lnghttp2 -framework SystemConfiguration -framework Security" ./autogen.sh --enable-static --disable-shared | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/bin/tsschecker | |
make clean | |
make -j8 | |
sudo make install | |
otool -L /usr/local/bin/tsschecker | |
cd .. | |
git clone --recursive https://github.com/tihmstar/img4tool.git | |
cd img4tool | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/bin/img4tool | |
make clean | |
make -j8 | |
sudo make install | |
otool -L /usr/local/bin/img4tool | |
cd .. | |
git clone --recursive https://github.com/libimobiledevice/libusbmuxd.git | |
cd libusbmuxd | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/lib/libusbmuxd* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libusbmuxd* | |
cd .. | |
git clone --recursive https://github.com/libimobiledevice/libimobiledevice.git | |
cd libimobiledevice | |
CFLAGS="-mmacosx-version-min=11.0" ./autogen.sh --enable-static --disable-shared | |
# sudo rm -f /usr/local/lib/libimobiledevice* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libimobiledevice* | |
cd .. | |
git clone --recursive https://github.com/libusb/libusb.git | |
cd libusb | |
CFLAGS="-mmacosx-version-min=11.0" LDFLAGS="-framework CoreFoundation -framework Security -framework IOKit" ./autogen.sh --enable-static --disable-shared | |
# sudo rm -f /usr/local/lib/libusb* | |
make clean | |
make -j8 | |
sudo make install | |
ls /usr/local/lib/libusb* | |
cd .. | |
git clone --recursive https://github.com/libimobiledevice/usbmuxd.git | |
cd usbmuxd | |
CFLAGS="-mmacosx-version-min=11.0" LDFLAGS="-framework CoreFoundation -framework Security -framework IOKit" ./autogen.sh --enable-static --disable-shared | |
sudo rm -f /usr/local/sbin/usbmuxd | |
make clean | |
make -j8 | |
sudo make install | |
otool -L /usr/local/sbin/usbmuxd | |
cd .. | |
# ln -s /usr/local/lib/pkgconfig/libplist-2.0.pc /usr/local/lib/pkgconfig/libplist.pc | |
# ln -s /usr/local/lib/pkgconfig/libplist++-2.0.pc /usr/local/lib/pkgconfig/libplist++.pc | |
# ln -s /usr/local/lib/pkgconfig/libirecovery-1.0.pc /usr/local/lib/pkgconfig/libirecovery.pc | |
# ln -s /usr/local/lib/pkgconfig/libusbmuxd-2.0.pc /usr/local/lib/pkgconfig/libusbmuxd.pc | |
# ln -s /usr/local/lib/pkgconfig/libimobiledevice-glue-1.0.pc /usr/local/lib/pkgconfig/libimobiledevice-glue.pc | |
# ln -s /usr/local/lib/pkgconfig/libimobiledevice-1.0.pc /usr/local/lib/pkgconfig/libimobiledevice.pc | |
# echo 'export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.zshrc | |
# source ~/.zshrc | |
git clone --recursive https://github.com/tihmstar/idevicerestore.git | |
cd idevicerestore | |
CFLAGS="-mmacosx-version-min=11.0" LDFLAGS="-L$HOME/Projects/BuildVNCServer/Build-OpenSSL-cURL/archive/libcurl-7.80.0-openssl-1.1.1l-nghttp2-1.46.0/lib/MacOS -lnghttp2 -llzma -lbz2 -framework SystemConfiguration -framework Security" ./autogen.sh --enable-static --disable-shared | |
make clean | |
make -j8 | |
sudo make install | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script is deprecated. See another gist: https://gist.github.com/Lessica/97c3ee0172bf8e24820b71dfe44d53b3