Skip to content

Instantly share code, notes, and snippets.

@ratijas
Created February 17, 2016 20:58
Show Gist options
  • Save ratijas/2d4224fcc3fe80a3b7e7 to your computer and use it in GitHub Desktop.
Save ratijas/2d4224fcc3fe80a3b7e7 to your computer and use it in GitHub Desktop.

Revisions

  1. ratijas created this gist Feb 17, 2016.
    65 changes: 65 additions & 0 deletions installXLDVorbisDecoder.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,65 @@
    #!/bin/sh
    # copyright 2016 Ratijas & Mac-J studio
    # WTF Public Licence

    # sadly, XLD still does not support .ogg files decoding out of the box.
    # there's instruction with outdated download link: https://hydrogenaud.io/index.php/topic,81239.0.html,
    # so here we'll recreate all necessary steps needed to patch up your XLD installation.
    # we will need git, svn and Xcode (with command line tools)

    # REWRITE following line if your XLD.app is not at /Applications
    XLD=/Applications/XLD.app

    # exit on any error
    set -e

    # get a copy of project's fork with XLDVorbisDecoder
    rm -rf xld >/dev/null 2>&1 || true
    git clone https://github.com/zwaldowski/xld.git
    cd xld

    # at this point `cd XLDVorbisDecoder && xcodebuild` should fail with error:
    # ld: warning: directory not found for option '-F~/xld/XLDVorbisDecoder/../xld_frameworks'
    # ld: framework not found Ogg
    #
    # so, let's bring Ogg.framework, and Vorbis.framework as well.
    # i managed to found them here: https://github.com/VDrift/vdrift-mac/tree/master/Frameworks
    # but git does not support downloading only particular directory,
    # that's why we will use svn instead.

    mkdir xld_frameworks
    cd xld_frameworks

    svn checkout https://github.com/VDrift/vdrift-mac/trunk/Frameworks/Vorbis.framework
    svn checkout https://github.com/VDrift/vdrift-mac/trunk/Frameworks/Ogg.framework

    # note: if this is your first time using svn with Github, it may ask you to manually
    # verify certificate fingerprint. last time checked, it was:
    # a0:c4:a7:46:00:ed:a7:2d:c0:be:cb:9a:8c:b6:07:ca:58:ee:74:5e
    # if matches, answer with 'p' and <enter>.

    cd ..
    cd XLDVorbisDecoder
    xcodebuild

    # this time you should see ** BUILD SUCCEEDED **

    # install bundle
    cp -r build/Release/XLDVorbisDecoder.bundle "$XLD"/Contents/PlugIns/

    # now, you may try to run XLD, and if you're lucky, you'll see message like this in console:
    # 18.02.16 3:52:12,170 XLD[38126]: Error loading $XLD/Contents/PlugIns/XLDVorbisDecoder.bundle/Contents/MacOS/XLDVorbisDecoder: dlopen($XLD/Contents/PlugIns/XLDVorbisDecoder.bundle/Contents/MacOS/XLDVorbisDecoder, 265): Library not loaded: @executable_path/../Frameworks/Vorbis.framework/Versions/1.3/Vorbis
    # Referenced from: $XLD/Contents/PlugIns/XLDVorbisDecoder.bundle/Contents/MacOS/XLDVorbisDecoder
    # Reason: image not found
    #
    # so, let's fix libraries versions
    cd ..
    cd xld_frameworks

    cp -r Ogg.framework/Versions/1.3 "$XLD"/Contents/Frameworks/Ogg.framework/Versions/1.3
    cp -r Vorbis.framework/Versions/1.3 "$XLD"/Contents/Frameworks/Vorbis.framework/Versions/1.3

    killall XLD >/dev/null 2>&1 || true
    open "$XLD"

    echo "now your XLD should be familiar with decoding .ogg files!"