From 373a790d76b105f8066766f8d05ccd5001b18517 Mon Sep 17 00:00:00 2001
From: MerryMage <MerryMage@users.noreply.github.com>
Date: Mon, 14 Mar 2016 21:23:07 +0000
Subject: [PATCH] OS X: Use dylibbundler to include dylibs required by citra in
 nightly archive

---
 .travis-deps.sh   | 2 +-
 .travis-upload.sh | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.travis-deps.sh b/.travis-deps.sh
index bab90d307d..eb99ead4f1 100755
--- a/.travis-deps.sh
+++ b/.travis-deps.sh
@@ -20,6 +20,6 @@ if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then
     )
 elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
     brew update > /dev/null # silence the very verbose output
-    brew install qt5 sdl2
+    brew install qt5 sdl2 dylibbundler
     gem install xcpretty
 fi
diff --git a/.travis-upload.sh b/.travis-upload.sh
index e508386dd7..d86775cb9b 100755
--- a/.travis-upload.sh
+++ b/.travis-upload.sh
@@ -20,6 +20,9 @@ if [ "$TRAVIS_BRANCH" = "master" ]; then
 
         # move qt libs into app bundle for deployment
         $(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/citra-qt.app"
+
+        # move SDL2 libs into folder for deployment
+        dylibbundler -b -x "${REV_NAME}/citra" -cd -d "${REV_NAME}/libs" -p "@executable_path/libs/"
     fi
 
     ARCHIVE_NAME="${REV_NAME}.tar.xz"