Skip to content

Instantly share code, notes, and snippets.

@dineshshetty
Created October 24, 2017 20:37

Revisions

  1. dineshshetty revised this gist Oct 24, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-libimobiledevice-dns.sh
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ urllist=('https://github.com/libimobiledevice/libplist.git' \

    flags=();
    libstoinstall=("$@");
    # for theurl in "${urllist[@]}"; do git clone "$theurl"; done # Comment this if all the required folders already exist and you are running the script again
    for theurl in "${urllist[@]}"; do git clone "$theurl"; done # Comment this if all the required folders already exist and you are running the script again


    if [ "${#libstoinstall[@]}" == 0 ]; then
  2. dineshshetty created this gist Oct 24, 2017.
    58 changes: 58 additions & 0 deletions install-libimobiledevice-dns.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@
    #!/bin/bash

    # Script by dns
    # Script to install libimobiledevice on MacOS seamlessly
    # Install these first before running the script -> brew install automake usbmuxd make autoconf libtool pkg-config gcc openssl gnutls libgcrypt

    # to fix fatal error: 'openssl/ssl.h' file not found errors run the below commands
    # ln -s /usr/local/Cellar/openssl/1.0.2l/include/openssl /usr/local/lib/
    # cp /usr/local/opt/openssl/include/openssl/* /usr/local/opt/openssl/include/
    # brew link --force openssl
    # ln -s /usr/local/Cellar/openssl/1.0.2l/include/openssl /usr/local/include/openssl


    # to fix ideviceinstaller.c ssize_t errors make the below changes
    # In the specified file ideviceinstaller.c, change while (zfsize < zs.size) { to —— while (zfsize < (unsigned) zs.size) {
    # In the specified file ideviceinstaller.c, comment out fprintf(stderr, "Error: wrote only %d of %" PRIi64 "\n", total, amount);

    set -e;

    export LIBTOOLIZE='glibtoolize';
    export openssl_CFLAGS='-I/usr/local/opt/' # changed it from openssl_CFLAGS=' ' to fix errors
    export openssl_LIBS='-lssl -lcrypto'
    #export LIBTOOL='libtool';

    urllist=('https://github.com/libimobiledevice/libplist.git' \
    'https://github.com/libimobiledevice/libusbmuxd.git' \
    'https://github.com/libimobiledevice/libimobiledevice.git' \
    'https://github.com/libimobiledevice/libirecovery.git' \
    'https://github.com/libimobiledevice/idevicerestore.git' \
    'https://github.com/libimobiledevice/ideviceinstaller.git');

    flags=();
    libstoinstall=("$@");
    # for theurl in "${urllist[@]}"; do git clone "$theurl"; done # Comment this if all the required folders already exist and you are running the script again


    if [ "${#libstoinstall[@]}" == 0 ]; then
    libstoinstall=('libplist' 'libusbmuxd' 'libimobiledevice' 'libirecovery' 'idevicerestore' 'ideviceinstaller');
    fi;
    cd "$(dirname "$0")";
    for library in "${libstoinstall[@]}"; do
    cd "$library";
    NOCONFIGURE=1 ./autogen.sh;
    cd ..;
    rm -rf "$library-build";
    mkdir "$library-build";
    cd "$library-build";
    if [ "$library" == 'libimobiledevice' ]; then
    flags+=('--disable-openssl');
    ldflags+=('-lgpg-error');
    elif [ "$library" == 'ideviceinstaller' ]; then
    cflags+=('-Wno-error=format' '-Wno-error=sign-compare' '--disable-openssl' );
    fi;
    "${PWD:0:${#PWD}-6}/configure" --prefix="$HOME/local/dist" --enable-static --disable-shared --disable-openssl "${flags[@]}" PKG_CONFIG_PATH="$HOME/local/dist/lib/pkgconfig";
    make install;
    cd ..;
    done;
    exit 0;