diff options
Diffstat (limited to '.travis-upload.sh')
| -rwxr-xr-x | .travis-upload.sh | 139 |
1 files changed, 0 insertions, 139 deletions
diff --git a/.travis-upload.sh b/.travis-upload.sh deleted file mode 100755 index edf195f7d..000000000 --- a/.travis-upload.sh +++ /dev/null | |||
| @@ -1,139 +0,0 @@ | |||
| 1 | GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" | ||
| 2 | GITREV="`git show -s --format='%h'`" | ||
| 3 | mkdir -p artifacts | ||
| 4 | |||
| 5 | if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then | ||
| 6 | REV_NAME="citra-linux-${GITDATE}-${GITREV}" | ||
| 7 | ARCHIVE_NAME="${REV_NAME}.tar.xz" | ||
| 8 | COMPRESSION_FLAGS="-cJvf" | ||
| 9 | mkdir "$REV_NAME" | ||
| 10 | |||
| 11 | cp build/src/citra/citra "$REV_NAME" | ||
| 12 | cp build/src/citra_qt/citra-qt "$REV_NAME" | ||
| 13 | elif [ "$TRAVIS_OS_NAME" = "osx" ]; then | ||
| 14 | REV_NAME="citra-osx-${GITDATE}-${GITREV}" | ||
| 15 | ARCHIVE_NAME="${REV_NAME}.tar.gz" | ||
| 16 | COMPRESSION_FLAGS="-czvf" | ||
| 17 | mkdir "$REV_NAME" | ||
| 18 | |||
| 19 | cp build/src/citra/citra "$REV_NAME" | ||
| 20 | cp -r build/src/citra_qt/citra-qt.app "$REV_NAME" | ||
| 21 | |||
| 22 | # move qt libs into app bundle for deployment | ||
| 23 | $(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/citra-qt.app" | ||
| 24 | |||
| 25 | # move SDL2 libs into folder for deployment | ||
| 26 | dylibbundler -b -x "${REV_NAME}/citra" -cd -d "${REV_NAME}/libs" -p "@executable_path/libs/" | ||
| 27 | |||
| 28 | # Make the changes to make the citra-qt app standalone (i.e. not dependent on the current brew installation). | ||
| 29 | # To do this, the absolute references to each and every QT framework must be re-written to point to the local frameworks | ||
| 30 | # (in the Contents/Frameworks folder). | ||
| 31 | # The "install_name_tool" is used to do so. | ||
| 32 | |||
| 33 | # Coreutils is a hack to coerce Homebrew to point to the absolute Cellar path (symlink dereferenced). i.e: | ||
| 34 | # ls -l /usr/local/opt/qt5:: /usr/local/opt/qt5 -> ../Cellar/qt5/5.6.1-1 | ||
| 35 | # grealpath ../Cellar/qt5/5.6.1-1:: /usr/local/Cellar/qt5/5.6.1-1 | ||
| 36 | brew install coreutils | ||
| 37 | |||
| 38 | REV_NAME_ALT=$REV_NAME/ | ||
| 39 | # grealpath is located in coreutils, there is no "realpath" for OS X :( | ||
| 40 | QT_BREWS_PATH=$(grealpath "$(brew --prefix qt5)") | ||
| 41 | BREW_PATH=$(brew --prefix) | ||
| 42 | QT_VERSION_NUM=5 | ||
| 43 | |||
| 44 | $BREW_PATH/opt/qt5/bin/macdeployqt "${REV_NAME_ALT}citra-qt.app" \ | ||
| 45 | -executable="${REV_NAME_ALT}citra-qt.app/Contents/MacOS/citra-qt" | ||
| 46 | |||
| 47 | # These are the files that macdeployqt packed into Contents/Frameworks/ - we don't want those, so we replace them. | ||
| 48 | declare -a macos_libs=("QtCore" "QtWidgets" "QtGui" "QtOpenGL" "QtPrintSupport") | ||
| 49 | |||
| 50 | for macos_lib in "${macos_libs[@]}" | ||
| 51 | do | ||
| 52 | SC_FRAMEWORK_PART=$macos_lib.framework/Versions/$QT_VERSION_NUM/$macos_lib | ||
| 53 | # Replace macdeployqt versions of the Frameworks with our own (from /usr/local/opt/qt5/lib/) | ||
| 54 | cp "$BREW_PATH/opt/qt5/lib/$SC_FRAMEWORK_PART" "${REV_NAME_ALT}citra-qt.app/Contents/Frameworks/$SC_FRAMEWORK_PART" | ||
| 55 | |||
| 56 | # Replace references within the embedded Framework files with "internal" versions. | ||
| 57 | for macos_lib2 in "${macos_libs[@]}" | ||
| 58 | do | ||
| 59 | # Since brew references both the non-symlinked and symlink paths of QT5, it needs to be duplicated. | ||
| 60 | # /usr/local/Cellar/qt5/5.6.1-1/lib and /usr/local/opt/qt5/lib both resolve to the same files. | ||
| 61 | # So the two lines below are effectively duplicates when resolved as a path, but as strings, they aren't. | ||
| 62 | RM_FRAMEWORK_PART=$macos_lib2.framework/Versions/$QT_VERSION_NUM/$macos_lib2 | ||
| 63 | install_name_tool -change \ | ||
| 64 | $QT_BREWS_PATH/lib/$RM_FRAMEWORK_PART \ | ||
| 65 | @executable_path/../Frameworks/$RM_FRAMEWORK_PART \ | ||
| 66 | "${REV_NAME_ALT}citra-qt.app/Contents/Frameworks/$SC_FRAMEWORK_PART" | ||
| 67 | install_name_tool -change \ | ||
| 68 | "$BREW_PATH/opt/qt5/lib/$RM_FRAMEWORK_PART" \ | ||
| 69 | @executable_path/../Frameworks/$RM_FRAMEWORK_PART \ | ||
| 70 | "${REV_NAME_ALT}citra-qt.app/Contents/Frameworks/$SC_FRAMEWORK_PART" | ||
| 71 | done | ||
| 72 | done | ||
| 73 | |||
| 74 | # Handles `This application failed to start because it could not find or load the Qt platform plugin "cocoa"` | ||
| 75 | # Which manifests itself as: | ||
| 76 | # "Exception Type: EXC_CRASH (SIGABRT) | Exception Codes: 0x0000000000000000, 0x0000000000000000 | Exception Note: EXC_CORPSE_NOTIFY" | ||
| 77 | # There may be more dylibs needed to be fixed... | ||
| 78 | declare -a macos_plugins=("Plugins/platforms/libqcocoa.dylib") | ||
| 79 | |||
| 80 | for macos_lib in "${macos_plugins[@]}" | ||
| 81 | do | ||
| 82 | install_name_tool -id @executable_path/../$macos_lib "${REV_NAME_ALT}citra-qt.app/Contents/$macos_lib" | ||
| 83 | for macos_lib2 in "${macos_libs[@]}" | ||
| 84 | do | ||
| 85 | RM_FRAMEWORK_PART=$macos_lib2.framework/Versions/$QT_VERSION_NUM/$macos_lib2 | ||
| 86 | install_name_tool -change \ | ||
| 87 | $QT_BREWS_PATH/lib/$RM_FRAMEWORK_PART \ | ||
| 88 | @executable_path/../Frameworks/$RM_FRAMEWORK_PART \ | ||
| 89 | "${REV_NAME_ALT}citra-qt.app/Contents/$macos_lib" | ||
| 90 | install_name_tool -change \ | ||
| 91 | "$BREW_PATH/opt/qt5/lib/$RM_FRAMEWORK_PART" \ | ||
| 92 | @executable_path/../Frameworks/$RM_FRAMEWORK_PART \ | ||
| 93 | "${REV_NAME_ALT}citra-qt.app/Contents/$macos_lib" | ||
| 94 | done | ||
| 95 | done | ||
| 96 | |||
| 97 | for macos_lib in "${macos_libs[@]}" | ||
| 98 | do | ||
| 99 | # Debugging info for Travis-CI | ||
| 100 | otool -L "${REV_NAME_ALT}citra-qt.app/Contents/Frameworks/$macos_lib.framework/Versions/$QT_VERSION_NUM/$macos_lib" | ||
| 101 | done | ||
| 102 | |||
| 103 | # Make the citra-qt.app application launch a debugging terminal. | ||
| 104 | # Store away the actual binary | ||
| 105 | mv ${REV_NAME_ALT}citra-qt.app/Contents/MacOS/citra-qt ${REV_NAME_ALT}citra-qt.app/Contents/MacOS/citra-qt-bin | ||
| 106 | |||
| 107 | cat > ${REV_NAME_ALT}citra-qt.app/Contents/MacOS/citra-qt <<EOL | ||
| 108 | #!/usr/bin/env bash | ||
| 109 | cd "\`dirname "\$0"\`" | ||
| 110 | chmod +x citra-qt-bin | ||
| 111 | open citra-qt-bin --args "\$@" | ||
| 112 | EOL | ||
| 113 | # Content that will serve as the launching script for citra (within the .app folder) | ||
| 114 | |||
| 115 | # Make the launching script executable | ||
| 116 | chmod +x ${REV_NAME_ALT}citra-qt.app/Contents/MacOS/citra-qt | ||
| 117 | |||
| 118 | fi | ||
| 119 | |||
| 120 | # Copy documentation | ||
| 121 | cp license.txt "$REV_NAME" | ||
| 122 | cp README.md "$REV_NAME" | ||
| 123 | |||
| 124 | tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME" | ||
| 125 | |||
| 126 | # Find out what release we are building | ||
| 127 | if [ -z $TRAVIS_TAG ]; then | ||
| 128 | RELEASE_NAME=head | ||
| 129 | else | ||
| 130 | RELEASE_NAME=$(echo $TRAVIS_TAG | cut -d- -f1) | ||
| 131 | fi | ||
| 132 | |||
| 133 | mv "$REV_NAME" $RELEASE_NAME | ||
| 134 | |||
| 135 | 7z a "$REV_NAME.7z" $RELEASE_NAME | ||
| 136 | |||
| 137 | # move the compiled archive into the artifacts directory to be uploaded by travis releases | ||
| 138 | mv "$ARCHIVE_NAME" artifacts/ | ||
| 139 | mv "$REV_NAME.7z" artifacts/ | ||