Skip to content

Instantly share code, notes, and snippets.

@carsonmcdonald
Last active September 29, 2023 16:28
Show Gist options
  • Save carsonmcdonald/5379989 to your computer and use it in GitHub Desktop.
Save carsonmcdonald/5379989 to your computer and use it in GitHub Desktop.
Compile libimobiledevice and every it needs in one script.
#!/bin/sh
mkdir installroot
INSTALLROOT=`pwd`/installroot
echo "Downloading and installing pkg-config"
curl -OL http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar xvzf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure --prefix=$INSTALLROOT --with-internal-glib
make
make install
cd ..
echo "Downloading and installing autoconf"
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
tar xzf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=$INSTALLROOT
make
make install
cd ..
export PATH=$PATH:$INSTALLROOT/bin
echo "Downloading and installing automake"
curl -OL http://ftpmirror.gnu.org/automake/automake-1.13.tar.gz
tar xzf automake-1.13.tar.gz
cd automake-1.13
./configure --prefix=$INSTALLROOT
make
make install
cd ..
echo "Downloading and installing libtool"
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
tar xzf libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure --prefix=$INSTALLROOT
make
make install
cd ..
echo "Downloading and installing libxml2"
curl -OL http://xmlsoft.org/sources/libxml2-2.8.0.tar.gz
tar xvzf libxml2-2.8.0.tar.gz
cd libxml2-2.8.0
./configure --prefix=$INSTALLROOT
make
make install
cd ..
echo "Downloading and installing openssl"
curl -OL http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar xvzf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./Configure --prefix=$INSTALLROOT --openssldir=$INSTALLROOT/openssl darwin64-x86_64-cc
make
make install
cd ..
echo "Downloading and installing libplist"
curl -OL http://cgit.sukimashita.com/libplist.git/snapshot/libplist-1.10.tar.gz
tar xvzf libplist-1.10.tar.gz
cd libplist-1.10
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLROOT ..
make
make install
cd ../..
echo "Downloading and installing usbmuxd"
curl -OL http://cgit.sukimashita.com/usbmuxd.git/snapshot/usbmuxd-1.0.8.tar.gz
tar xvzf usbmuxd-1.0.8.tar.gz
cd usbmuxd-1.0.8
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=$INSTALLROOT -DWITH_USBMUXD=NO ..
make
make install
cd ../..
cat > $INSTALLROOT/lib/pkgconfig/libusbmuxd.pc <<EOF
prefix=$INSTALLROOT
exec_prefix=$INSTALLROOT
libdir=$INSTALLROOT/lib
includedir=$INSTALLROOT/include
Name: libusbmuxd
Description: A library to communicate with the usbmux daemon
Version: 1.0.8
Libs: -L$INSTALLROOT/lib -lusbmuxd
Cflags: -I$INSTALLROOT/include
EOF
echo "Downloading and installing libimobiledevice"
curl -OL http://www.libimobiledevice.org/downloads/libimobiledevice-1.1.5.tar.bz2
tar xvjf libimobiledevice-1.1.5.tar.bz2
cd libimobiledevice-1.1.5
NOCONFIGURE=yes PATH=$PATH:$INSTALLROOT/bin/ ./autogen.sh
PKG_CONFIG_PATH=$INSTALLROOT/lib/pkgconfig/ PATH=$PATH:$INSTALLROOT/bin/ ./configure --prefix=$INSTALLROOT
make
make install
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment