From df8f19320b3a37521a7f93a578bf31c81f885238 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Fri, 22 May 2020 19:35:49 -0500 Subject: [PATCH] Bring back CI changes and macOS support --- .github/labeler.yml | 8 +++++ .gitignore | 4 +++ .gitlab-ci.yml | 69 ++++++++++++++++++++++++++++--------- .travis.yml | 22 ++++++++---- scripts/configure_ubuntu.sh | 6 ++-- scripts/macos_build.sh | 2 +- scripts/macos_post_build.sh | 4 ++- scripts/wasabi_program.sh | 2 +- scripts/windows/Dockerfile | 11 ++++-- src/hardware_functions.cpp | 4 +++ src/path_functions.cpp | 2 ++ 11 files changed, 104 insertions(+), 30 deletions(-) create mode 100644 .github/labeler.yml mode change 100644 => 100755 scripts/macos_post_build.sh diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..56c4cc7 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,8 @@ +translation: + - resource/translations/* + +content: + - base/**/* + +good_luck: + - src/courtroom.cpp diff --git a/.gitignore b/.gitignore index 1adb744..3f8b3ae 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.dll *.so *.pro.autosave +*.pro.user base_override.h .DS_Store @@ -21,6 +22,7 @@ debug/ Makefile* object_script* +/android/gradle* /Attorney_Online_remake_resource.rc /attorney_online_remake_plugin_import.cpp @@ -31,3 +33,5 @@ discord/ moc* /Attorney_Online_CC_resource.rc /attorney_online_cc_plugin_import.cpp + +*.autosave diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0f68fe5..e9685de 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,9 @@ cache: paths: - lib/ +variables: + DEBIAN_FRONTEND: noninteractive + before_script: - echo Current working directory is $(pwd) @@ -22,22 +25,24 @@ build linux x86_64: - apt-get update - > apt-get install --no-install-recommends -y qt5-default qtmultimedia5-dev - clang make git sudo curl ca-certificates pkg-config upx unzip + clang make git sudo curl ca-certificates pkg-config upx unzip xz-utils + - git submodule init + - git submodule update # Print versions - qmake --version - clang --version # Extract BASS - - mkdir bass - - cd bass - - curl http://www.un4seen.com/files/bass24-linux.zip -o bass.zip - - unzip bass.zip - - cp x64/libbass.so ../lib - - curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip - - unzip bassopus.zip - - cp x64/libbassopus.so ../lib - - cd .. + #- mkdir bass + #- cd bass + #- curl http://www.un4seen.com/files/bass24-linux.zip -o bass.zip + #- unzip bass.zip + #- cp x64/libbass.so ../lib + #- curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip + #- unzip bassopus.zip + #- cp x64/libbassopus.so ../lib + #- cd .. # Extract Discord RPC - mkdir discord-rpc @@ -56,7 +61,7 @@ build linux x86_64: - cd .. # Build - - qmake -spec linux-clang + - qmake -spec linux-clang "DEFINES += DISCORD QTAUDIO" - make -j4 # Post-processing @@ -75,6 +80,11 @@ build windows i686: # Install dependencies - apt-get update - apt-get install --no-install-recommends -y make curl ca-certificates upx unzip + - git submodule init + - git submodule update + + # Print versions + - /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake --version # Extract BASS - mkdir bass @@ -87,8 +97,19 @@ build windows i686: - cp bassopus.dll ../lib - cd .. + # Extract QtApng + # - mkdir qtapng + # - cd qtapng + # - curl -L https://github.com/Skycoder42/QtApng/releases/download/1.1.2-2/qtapng_mingw73_32_5.13.0.zip -o apng.zip + # - unzip apng.zip + # - mkdir ../lib/imageformats + # - cp mingw73_32/plugins/imageformats/qapng.dll ../lib/imageformats/ + # - cd .. + + - ls lib + # Build - - /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake + - /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake "DEFINES += DISCORD BASSAUDIO" - make -j4 # Post-processing @@ -124,7 +145,7 @@ deploy linux x86_64: - *deploy_misc # Platform-specific - - cp -a ../lib/*.so . + - cp -a ../lib/* . - cp -a ../bin/Attorney_Online . - echo "#!/bin/sh" >> ./run.sh - echo "LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH ./Attorney_Online" >> ./run.sh @@ -158,6 +179,8 @@ deploy windows i686: # Platform-specific - cp -a ../lib/*.dll . + - mkdir imageformats + - 'cp -a ../lib/imageformats/*.dll imageformats/ || :' - cp -a ../bin/Attorney_Online.exe . # Zipping @@ -190,11 +213,17 @@ publish linux x86_64: - deploy linux x86_64 when: manual script: + - apt-get update + - apt-get install --no-install-recommends -y git nodejs npm awscli + - cd scripts + - npm install + - cd .. + - cd zip - - ../scripts/wasabi.sh + - ../scripts/wasabi_program.sh variables: MANIFEST: program_linux_x86_64.json - ARTIFACT_SUFFIX: _linux_x64.tar.xz + ARTIFACT_SUFFIX: linux_x64.tar.xz publish windows i686: image: ubuntu @@ -203,8 +232,14 @@ publish windows i686: - deploy windows i686 when: manual script: + - apt-get update + - apt-get install --no-install-recommends -y git nodejs npm awscli + - cd scripts + - npm install + - cd .. + - cd zip - - ../scripts/wasabi.sh + - ../scripts/wasabi_program.sh variables: MANIFEST: program_winnt_i386.json - ARTIFACT_SUFFIX: _windows_x86.zip + ARTIFACT_SUFFIX: windows_x86.zip diff --git a/.travis.yml b/.travis.yml index 4243b3b..dbd19cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,21 @@ language: cpp os: osx - addons: - homebrew: - packages: - - qt5 + homebrew: + update: true + packages: + - qt5 script: - - ./scripts/macos_build.sh - - ./scripts/macos_post_build.sh +- "./scripts/macos_build.sh" +- "./scripts/macos_post_build.sh" + +deploy: + provider: releases + api_key: + secure: mZCNwnqKeqJP5CqgYOanYnr/KHydxueGPRhvGLpY0Pop7MiH3CIHMN5dhHbtgJvE5GGMR4xUIEhPpmkCEJw7YiPREMqT4mkV4DR531ZLB3t/FizyvIwXuP6jFwzTofZ51qHfBpcurVc9sMFeD9Pw+rLTTgIiXL2sZxUUXc8U+ZZug1lYndgcO6P00fUJd6V9lyFQUGmbSca97YbG6KuCym0fEpyRnMqzKLjYsUUo8UKRBADtmD822O6z2FSldNZDn45Mkx0MYfHWyT5hzTb7WGa+DrTB/0un1HqqsNPlb/ahjrFQQNR2qd7HNGZa+Mvwi6egTDug+k15x8lbkacUoi34U1eFq9LSTYm8dSO5g23I1OvGvjTCkDj1jOLPqB99XlbAJ0E/9Jzw7wtlLaAzvFzTj/B63TQnO3IsgHBWR14CZlf05WMOFf2irwl+kL6ktspIHnlGgaiWYYrKeAt7QJAXiQOdYDz6SaWVC6TyOE/SszXRU6xFotmCjkP2irM5yGE8SUw2uIzKjD9uG0ZXtbLcdQEFD316+qglqFTCjnKsRfbtQs2u5spZPsZSdsOZCbLfNIn0GSTFRymFsK6gsvji8AD8AZo0zcOZ/7NMVC6A8RnF3Ve+vU/xljhsIOxoLZDvZPia7WozdV99xmnepWBwkuoQs/K0xmWcnLZDcb0= + file: "../bin/Attorney_Online_mac_x86_64.zip" + draft: true + on: + tags: true + repo: AttorneyOnline/AO2-Client diff --git a/scripts/configure_ubuntu.sh b/scripts/configure_ubuntu.sh index 1f9b8e8..280dfdf 100755 --- a/scripts/configure_ubuntu.sh +++ b/scripts/configure_ubuntu.sh @@ -7,11 +7,13 @@ set -eu ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" -cd ${ROOT_DIR} +cd "${ROOT_DIR}" + #need some openGL stuff sudo apt install libgl1-mesa-dev - +#install curl incase of fresh vm +sudo apt install curl mkdir tmp cd tmp diff --git a/scripts/macos_build.sh b/scripts/macos_build.sh index 22e2d45..efb7653 100755 --- a/scripts/macos_build.sh +++ b/scripts/macos_build.sh @@ -30,4 +30,4 @@ tar -xvf apng.tar.xz cp clang_64/plugins/imageformats/libqapng.dylib ../lib cd .. -qmake && make -j2 +/usr/local/opt/qt/bin/qmake && make -j2 diff --git a/scripts/macos_post_build.sh b/scripts/macos_post_build.sh old mode 100644 new mode 100755 index 50acb40..df1475c --- a/scripts/macos_post_build.sh +++ b/scripts/macos_post_build.sh @@ -13,10 +13,12 @@ ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" cd ${ROOT_DIR} # This thing basically does all the work -macdeployqt ../bin/Attorney_Online.app +/usr/local/opt/qt/bin/macdeployqt ../bin/Attorney_Online.app # Need to add the dependencies cp ../lib/* ../bin/Attorney_Online.app/Contents/Frameworks # libbass has a funny path for some reason, just use rpath install_name_tool -change @loader_path/libbass.dylib @rpath/libbass.dylib ../bin/Attorney_Online.app/Contents/MacOS/Attorney_Online + +zip -r -9 ../bin/Attorney_Online_mac_x86_64.zip ../bin/ \ No newline at end of file diff --git a/scripts/wasabi_program.sh b/scripts/wasabi_program.sh index 41e2e35..37feac6 100755 --- a/scripts/wasabi_program.sh +++ b/scripts/wasabi_program.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Updates the specified program manifest to a new archive and version # and uploads the new archive and manifest to S3/Wasabi. # diff --git a/scripts/windows/Dockerfile b/scripts/windows/Dockerfile index f4f1a83..b9a12d6 100644 --- a/scripts/windows/Dockerfile +++ b/scripts/windows/Dockerfile @@ -10,5 +10,12 @@ RUN /opt/mxe/usr/bin/${TARGET_SPEC}-cmake .. -DCMAKE_INSTALL_PREFIX=/opt/mxe/usr RUN /opt/mxe/usr/bin/${TARGET_SPEC}-cmake --build . --config Release --target install WORKDIR ../.. -# NOTE: Do not build QtApng statically! libpng contains a self-test entry point that -# takes precedence for some reason over the final build's entry point. +# Build QtApng statically +RUN git clone https://github.com/Skycoder42/QtApng +WORKDIR QtApng +# libpng contains a self-test entry point that takes precedence for some reason +# over the final build's entry point. +RUN sed -i "s/^main(/libpng_main(/g" src/3rdparty/libpng/src/pngtest.c +RUN /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake +RUN make && make install +WORKDIR .. \ No newline at end of file diff --git a/src/hardware_functions.cpp b/src/hardware_functions.cpp index c898aef..82b4f0c 100644 --- a/src/hardware_functions.cpp +++ b/src/hardware_functions.cpp @@ -49,6 +49,10 @@ QString get_hdid() } #elif defined __APPLE__ + +#include +#include + QString get_hdid() { CFStringRef serial; diff --git a/src/path_functions.cpp b/src/path_functions.cpp index 811ca76..10c8ae5 100644 --- a/src/path_functions.cpp +++ b/src/path_functions.cpp @@ -30,6 +30,8 @@ QString AOApplication::get_base_path() QString external_storage = getenv("EXTERNAL_STORAGE"); base_path = external_storage + "/AO2/"; } +#elif defined(__APPLE__) + base_path = applicationDirPath() + "/../../../base/"; #else base_path = applicationDirPath() + "/base/"; #endif