diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 3f27bedf..54bf17df 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -github: [alzy, cpyarger] +github: [cpyarger] diff --git a/.github/workflows/CI Build and release.yml b/.github/workflows/CI Build and release.yml new file mode 100644 index 00000000..d5cc5408 --- /dev/null +++ b/.github/workflows/CI Build and release.yml @@ -0,0 +1,507 @@ +name: 'CI Multiplatform Build' + +on: + push: + paths-ignore: + - 'docs/**' + pull_request: + paths-ignore: + - '**.md' + +env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true +jobs: + windows: + name: 'Windows 32+64bit' + runs-on: [windows-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true + env: + QT_VERSION: '5.10.1' + WINDOWS_DEPS_VERSION: '2017' + CMAKE_GENERATOR: "Visual Studio 16 2019" + CMAKE_SYSTEM_VERSION: "10.0" + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + steps: + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.0 + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-midi + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-midi git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-midi + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisite: QT' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - + 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT" + - name: 'Install prerequisite: Pre-built OBS dependencies' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C - + 7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}\cmbuild\deps" + - name: 'Restore OBS 32-bit build v${{ env.OBS_GIT_TAG }} from cache' + id: build-cache-obs-32 + uses: actions/cache@v1 + env: + CACHE_NAME: 'build-cache-obs-32' + with: + path: ${{ github.workspace }}/obs-studio/build32 + key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }} + restore-keys: | + ${{ runner.os }}-${{ env.CACHE_NAME }}- + - name: 'Configure OBS 32-bit' + if: steps.build-cache-obs-32.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir .\build32 + cd .\build32 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + - name: 'Build OBS-Studio 32-bit' + if: steps.build-cache-obs-32.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + msbuild /m /p:Configuration=RelWithDebInfo .\build32\libobs\libobs.vcxproj + msbuild /m /p:Configuration=RelWithDebInfo .\build32\UI\obs-frontend-api\obs-frontend-api.vcxproj + - name: 'Restore OBS 64-bit build v${{ env.OBS_GIT_TAG }} from cache' + id: build-cache-obs-64 + uses: actions/cache@v1 + env: + CACHE_NAME: 'build-cache-obs-64' + with: + path: ${{ github.workspace }}/obs-studio/build64 + key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }} + restore-keys: | + ${{ runner.os }}-${{ env.CACHE_NAME }}- + - name: 'Configure OBS 64-bit' + if: steps.build-cache-obs-64.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir .\build64 + cd .\build64 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + - name: 'Build OBS-Studio 64-bit' + if: steps.build-cache-obs-64.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + msbuild /m /p:Configuration=RelWithDebInfo .\build64\libobs\libobs.vcxproj + msbuild /m /p:Configuration=RelWithDebInfo .\build64\UI\obs-frontend-api\obs-frontend-api.vcxproj + - name: 'Configure obs-midi 64-bit' + working-directory: ${{ github.workspace }}/obs-midi + run: | + mkdir .\build64 + cd .\build64 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build64\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build64\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" .. + - name: 'Configure obs-midi 32-bit' + working-directory: ${{ github.workspace }}/obs-midi + run: | + mkdir .\build32 + cd .\build32 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build32\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build32\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" .. + - name: 'Build obs-midi 64-bit' + working-directory: ${{ github.workspace }}/obs-midi + run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-midi.sln + - name: 'Build obs-midi 32-bit' + working-directory: ${{ github.workspace }}/obs-midi + run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-midi.sln + - name: 'Set release filename' + shell: bash + run: | + FILENAME="obs-midi-${{ env.GIT_HASH }}-Windows" + echo "::set-env name=WIN_FILENAME::$FILENAME" + - name: 'Package obs-midi' + working-directory: ${{ github.workspace }}/obs-midi + run: | + mkdir package + cd package + 7z a "${{ env.WIN_FILENAME }}.zip" "..\release\*" + iscc ..\installer\installer.iss /O. /F"${{ env.WIN_FILENAME }}-Installer" + - name: 'Publish ${{ env.WIN_FILENAME }}.zip' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-Windows' + path: ${{ github.workspace }}/obs-midi/package/*.zip + - name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-Windows-Installer' + path: ${{ github.workspace }}/obs-midi/package/*.exe + ubuntu64: + name: "Linux/Ubuntu 64-bit" + runs-on: [ubuntu-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-midi + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-midi git info' + working-directory: ${{ github.workspace }}/obs-midi + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisites (Apt)' + shell: bash + run: | + sudo dpkg --add-architecture amd64 + sudo apt-get -qq update + sudo apt-get install -y \ + build-essential \ + checkinstall \ + cmake \ + libasound2-dev \ + libavcodec-dev \ + libavdevice-dev \ + libavfilter-dev \ + libavformat-dev \ + libavutil-dev \ + libcurl4-openssl-dev \ + libfdk-aac-dev \ + libfontconfig-dev \ + libfreetype6-dev \ + libgl1-mesa-dev \ + libjack-jackd2-dev \ + libjansson-dev \ + libluajit-5.1-dev \ + libpulse-dev \ + libqt5x11extras5-dev \ + libspeexdsp-dev \ + libswresample-dev \ + libswscale-dev \ + libudev-dev \ + libv4l-dev \ + libva-dev \ + libvlc-dev \ + libx11-dev \ + libx264-dev \ + libx11-xcb-dev \ + libx11-xcb1 \ + libxcb-randr0-dev \ + libxcb-shm0-dev \ + libxcb-xinerama0-dev \ + libxcomposite-dev \ + libxinerama-dev \ + libmbedtls-dev \ + pkg-config \ + python3-dev \ + qtbase5-dev \ + libqt5svg5-dev \ + swig + - name: 'Configure OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + mkdir ./build + cd ./build + cmake -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + set -e + cd ./build + make -j4 libobs obs-frontend-api + - name: 'Install OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + cd ./build + sudo cp ./libobs/libobs.so /usr/lib + sudo cp ./UI/obs-frontend-api/libobs-frontend-api.so /usr/lib + sudo mkdir -p /usr/include/obs + sudo cp ../UI/obs-frontend-api/obs-frontend-api.h /usr/include/obs/obs-frontend-api.h + - name: 'Configure obs-midi' + working-directory: ${{ github.workspace }}/obs-midi + shell: bash + run: | + mkdir ./build + cd ./build + cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build obs-midi' + working-directory: ${{ github.workspace }}/obs-midi + shell: bash + run: | + set -e + cd ./build + make -j4 + - name: 'Set release filename' + shell: bash + run: | + FILENAME="obs-midi-${{ env.GIT_HASH }}-1_amd64.deb" + echo "::set-env name=LINUX_FILENAME::$FILENAME" + - name: 'Package ${{ env.LINUX_FILENAME }}' + if: success() + working-directory: ${{ github.workspace }}/obs-midi + shell: bash + run: | + VERSION="${{ env.GIT_HASH }}" + cd ./build + sudo checkinstall -y --type=debian --fstrans=no -nodoc \ + --backup=no --deldoc=yes --install=no --pkgname=obs-midi --pkgversion=$VERSION \ + --pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \ + --pkgsource="${{ github.event.repository.html_url }}" \ + --requires="obs-studio,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \ + --pakdir="../package" + sudo chmod ao+r ../package/* + cd - + - name: 'Publish ${{ env.LINUX_FILENAME }}' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-linux' + path: '${{ github.workspace }}/obs-midi/package/*.deb' + macos64: + name: "macOS 64-bit" + runs-on: [macos-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true + env: + MACOS_DEPS_VERSION: '2020-04-18' + QT_VERSION: '5.14.1' + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-midi + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-midi git info' + working-directory: ${{ github.workspace }}/obs-midi + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install Deps' + shell: bash + working-directory: ${{ github.workspace }}/obs-midi + run: | + ./CI/install-dependencies-macos.sh + echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> /Users/runner/.bash_profile + echo ::set-env name=LDFLAGS="-L/usr/local/opt/qt/lib" + echo ::set-env name=CPPFLAGS="-I/usr/local/opt/qt/include" + echo ::set-env name=PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig" + echo ::set-env name=PATH="/usr/local/opt/qt/bin:$PATH" + - name: 'Install prerequisite: Pre-built OBS dependencies' + shell: bash + run: | + curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz + tar -xf ${{ github.workspace }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp" + - name: 'Configure OBS Studio' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir build + cd build + cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake .. + - name: 'Build OBS Studio libraries' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + set -e + cd ./build + make -j4 libobs obs-frontend-api + - name: 'Configure obs-midi' + working-directory: ${{ github.workspace }}/obs-midi + shell: bash + run: | + mkdir build + cd build + cmake -DQTDIR=/usr/local/Cellar/qt/${{ env.QT_VERSION }} -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DLIBOBS_LIB=${{ github.workspace }}/obs-studio/libobs -DOBS_FRONTEND_LIB="${{ github.workspace }}/obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build obs-midi' + working-directory: ${{ github.workspace }}/obs-midi + shell: bash + run: | + set -e + cd ./build + make -j4 + - name: 'Install prerequisite: Packages app' + if: success() + shell: bash + run: | + curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg + sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target / + - name: 'Set release filename' + if: success() + shell: bash + run: | + FILENAME_UNSIGNED="obs-midi-${{ env.GIT_HASH }}-macOS-Unsigned.pkg" + FILENAME="obs-midi-${{ env.GIT_HASH }}-macOS.pkg" + echo "::set-env name=MAC_FILENAME_UNSIGNED::$FILENAME_UNSIGNED" + echo "::set-env name=MAC_FILENAME::$FILENAME" + + - name: 'Fix linked dynamic library paths' + if: success() + working-directory: ${{ github.workspace }}/obs-midi + shell: bash + run: | + install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./build/obs-midi.so + install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./build/obs-midi.so + install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-midi.so + echo "Dependencies for obs-midi" + otool -L ./build/obs-midi.so + - name: 'package file' + if: success() + working-directory: ./obs-midi + shell: bash + run: | + set -e + packagesbuild ./CI/macos/obs-midi.pkgproj + mv ./release/obs-midi.pkg ./release/${{ env.MAC_FILENAME_UNSIGNED }} + - name: 'Publish ${{ env.MAC_FILENAME }} artifact' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-macOS' + path: ${{ github.workspace }}/obs-midi/release/*.pkg + + make-release: + name: 'Create and upload release' + runs-on: [ubuntu-latest] + needs: [windows, ubuntu64, macos64] + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-midi + - name: 'Get obs-midi git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-midi + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Get the version' + shell: bash + id: get_version + run: | + echo ::set-env name=TAG_VERSION::${GITHUB_REF/refs\/tags\//} + - name: 'Create Release' + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: tag-${{ env.GIT_HASH }} + body_path: ${{ github.workspace }}/obs-midi/docs/releasehead.md + release_name: obs-midi ALPHA 2 ${{ env.GIT_HASH }} + draft: false + prerelease: true + - name: 'Download release artifacts' + uses: actions/download-artifact@v2-preview + - name: 'Upload Windows .zip artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-Windows/obs-midi-${{ env.GIT_HASH }}-Windows.zip + asset_name: obs-midi-${{ env.GIT_HASH }}-Windows.zip + asset_content_type: application/zip + - name: 'Upload Windows .exe artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH}}-Windows-Installer/obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe + asset_name: obs-midi-${{ env.GIT_HASH }}-Windows-Installer.exe + asset_content_type: application/zip + - name: 'check out directories' + shell: bash + working-directory: ${{ github.workspace }}/obs-midi + run: | + cd ${{ github.workspace }} + ls -la + echo "linux" + ls -la ${{ github.workspace }}/${{ env.GIT_HASH }}-linux + echo "macos" + ls -la ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS + mv ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/*.deb ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/obs-midi-${{ env.GIT_HASH }}-1_amd64.deb + - name: 'Upload macOS artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-macOS/obs-midi-${{ env.GIT_HASH }}-macOS-Unsigned.pkg + asset_name: obs-midi-${{ env.GIT_HASH }}-macOS-Unsigned.pkg + asset_content_type: application/octet-stream + - name: 'Upload Linux artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.GIT_HASH }}-linux/obs-midi-${{ env.GIT_HASH }}-1_amd64.deb + asset_name: obs-midi-${{ env.GIT_HASH }}-1_amd64.deb + asset_content_type: application/octet-stream diff --git a/CI/install-dependencies-macos.sh b/CI/install-dependencies-macos.sh index 835f312c..8b7025ed 100755 --- a/CI/install-dependencies-macos.sh +++ b/CI/install-dependencies-macos.sh @@ -5,38 +5,46 @@ OSTYPE=$(uname) if [ "${OSTYPE}" != "Darwin" ]; then - echo "[obs-midi - Error] macOS install dependencies script can be run on Darwin-type OS only." + echo "[obs-websocket - Error] macOS install dependencies script can be run on Darwin-type OS only." exit 1 fi HAS_BREW=$(type brew 2>/dev/null) if [ "${HAS_BREW}" = "" ]; then - echo "[obs-midi - Error] Please install Homebrew (https://www.brew.sh/) to build obs-midi on macOS." + echo "[obs-websocket - Error] Please install Homebrew (https://www.brew.sh/) to build obs-websocket on macOS." exit 1 fi # OBS Studio deps -echo "[obs-midi] Updating Homebrew.." +echo "[obs-websocket] Updating Homebrew.." brew update >/dev/null -echo "[obs-midi] Checking installed Homebrew formulas.." +echo "[obs-websocket] Checking installed Homebrew formulas.." BREW_PACKAGES=$(brew list) -BREW_DEPENDENCIES="speexdsp ccache swig mbedtls" +BREW_DEPENDENCIES="jack speexdsp ccache swig mbedtls" for DEPENDENCY in ${BREW_DEPENDENCIES}; do if echo "${BREW_PACKAGES}" | grep -q "^${DEPENDENCY}\$"; then - echo "[obs-midi] Upgrading OBS-Studio dependency '${DEPENDENCY}'.." + echo "[obs-websocket] Upgrading OBS-Studio dependency '${DEPENDENCY}'.." brew upgrade ${DEPENDENCY} 2>/dev/null else - echo "[obs-midi] Installing OBS-Studio dependency '${DEPENDENCY}'.." + echo "[obs-websocket] Installing OBS-Studio dependency '${DEPENDENCY}'.." brew install ${DEPENDENCY} 2>/dev/null fi done -# qtmidis deps -echo "[obs-midi] Installing obs-midi dependency 'QT 5.10.1'.." - +# qtwebsockets deps +echo "[obs-websocket] Installing obs-websocket dependency 'QT 5.10.1'.." +tap akeru-inc/tap +brew install jack +brew install speexdsp +brew install cmake +brew install freetype +brew install fdk-aac brew install ./CI/macos/qt.rb +brew install ./CI/macos/swig.rb +brew install akeru-inc/tap/xcnotary + # Pin this version of QT5 to avoid `brew upgrade` # upgrading it to incompatible version @@ -50,7 +58,7 @@ brew pin qt HAS_PACKAGES=$(type packagesbuild 2>/dev/null) if [ "${HAS_PACKAGES}" = "" ]; then - echo "[obs-midi] Installing Packaging app (might require password due to 'sudo').." + echo "[obs-websocket] Installing Packaging app (might require password due to 'sudo').." curl -o './Packages.pkg' --retry-connrefused -s --retry-delay 1 'https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg' sudo installer -pkg ./Packages.pkg -target / fi diff --git a/CI/macos/Brewfile b/CI/macos/Brewfile index 65281546..f3aa898c 100644 --- a/CI/macos/Brewfile +++ b/CI/macos/Brewfile @@ -4,7 +4,7 @@ brew "speexdsp" brew "cmake" brew "freetype" brew "fdk-aac" -brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb" +brew "./qt.rb" brew "swig", link: false -brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb" +brew "./swig.rb" brew "akeru-inc/tap/xcnotary" diff --git a/CI/macos/qt.rb b/CI/macos/qt.rb index 4405a240..e1362e15 100755 --- a/CI/macos/qt.rb +++ b/CI/macos/qt.rb @@ -3,45 +3,25 @@ class Qt < Formula desc "Cross-platform application and UI framework" homepage "https://www.qt.io/" - url "https://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" - mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" - sha256 "05ffba7b811b854ed558abf2be2ddbd3bb6ddd0b60ea4b5da75d277ac15e740a" - head "https://code.qt.io/qt/qt5.git", :branch => "5.10", :shallow => false + url "https://download.qt.io/official_releases/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" + mirror "https://mirrors.dotsrc.org/qtproject/archive/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" + mirror "https://mirrors.ocf.berkeley.edu/qt/archive/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" + sha256 "6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8" + + head "https://code.qt.io/qt/qt5.git", :branch => "dev", :shallow => false bottle do - sha256 "8b4bad005596a5f8790150fe455db998ac2406f4e0f04140d6656205d844d266" => :high_sierra - sha256 "9c488554935fb573554a4e36d36d3c81e47245b7fefc4b61edef894e67ba1740" => :sierra - sha256 "c0407afba5951df6cc4c6f6c1c315972bd41c99cecb4e029919c4c15ab6f7bdc" => :el_capitan + cellar :any + sha256 "e40589965586f2c1132da117aca2e0cf12f3ea4bb1029d26b4b0819d8aae3bd5" => :catalina + sha256 "149a1c2d2af7afda9910e1d4e3956c27ffa31ea511a8320930abf7a9079d0330" => :mojave + sha256 "69a7f1ad615f78735b6635da1b1fab5e4eea57dd9be560c695f82b796457870a" => :high_sierra end keg_only "Qt 5 has CMake issues when linked" - option "with-docs", "Build documentation" - option "with-examples", "Build examples" - option "without-proprietary-codecs", "Don't build with proprietary codecs (e.g. mp3)" - - # OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference - # configuration and thus untested in practice. Builds on OS X 10.7 have been - # reported to fail: . - # depends_on :macos => :mountain_lion - depends_on "pkg-config" => :build depends_on :xcode => :build - depends_on "mysql" => :optional - depends_on "postgresql" => :optional - - # Restore `.pc` files for framework-based build of Qt 5 on OS X. This - # partially reverts merged - # between the 5.5.1 and 5.6.0 releases. (Remove this as soon as feasible!) - # - # Core formulae known to fail without this patch (as of 2016-10-15): - # * gnuplot (with `--with-qt` option) - # * mkvtoolnix (with `--with-qt` option, silent build failure) - # * poppler (with `--with-qt` option) - patch do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/e8fe6567/qt5/restore-pc-files.patch" - sha256 "48ff18be2f4050de7288bddbae7f47e949512ac4bcd126c2f504be2ac701158b" - end + depends_on :macos => :sierra def install args = %W[ @@ -54,41 +34,19 @@ def install -qt-libjpeg -qt-freetype -qt-pcre + -nomake examples -nomake tests -no-rpath -pkg-config -dbus-runtime + -proprietary-codecs ] - args << "-nomake" << "examples" if build.without? "examples" - - if build.with? "mysql" - args << "-plugin-sql-mysql" - (buildpath/"brew_shim/mysql_config").write <<~EOS - #!/bin/sh - if [ x"$1" = x"--libs" ]; then - mysql_config --libs | sed "s/-lssl -lcrypto//" - else - exec mysql_config "$@" - fi - EOS - chmod 0755, "brew_shim/mysql_config" - args << "-mysql_config" << buildpath/"brew_shim/mysql_config" - end - - args << "-plugin-sql-psql" if build.with? "postgresql" - args << "-proprietary-codecs" if build.with? "proprietary-codecs" - system "./configure", *args system "make" ENV.deparallelize system "make", "install" - if build.with? "docs" - system "make", "docs" - system "make", "install_docs" - end - # Some config scripts will only find Qt in a "Frameworks" folder frameworks.install_symlink Dir["#{lib}/*.framework"] @@ -108,9 +66,9 @@ def install end def caveats; <<~EOS - We agreed to the Qt opensource license for you. + We agreed to the Qt open source license for you. If this is unacceptable you should uninstall. - EOS + EOS end test do @@ -127,7 +85,6 @@ def caveats; <<~EOS (testpath/"main.cpp").write <<~EOS #include #include - int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); @@ -142,4 +99,4 @@ def caveats; <<~EOS assert_predicate testpath/"main.o", :exist? system "./hello" end -end \ No newline at end of file +end diff --git a/CI/macos/swig.rb b/CI/macos/swig.rb new file mode 100644 index 00000000..9b27d69b --- /dev/null +++ b/CI/macos/swig.rb @@ -0,0 +1,56 @@ + +class Swig < Formula + desc "Generate scripting interfaces to C/C++ code" + homepage "http://www.swig.org/" + url "https://downloads.sourceforge.net/project/swig/swig/swig-3.0.12/swig-3.0.12.tar.gz" + sha256 "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d" + + bottle do + sha256 "7307b4ffe3222715b2206e6477c5e3022881a730eb95a717d41a3df8e6e20455" => :mojave + sha256 "c0e2656fd10d57281280d20ce8bf9a060cf8714f4283dd1dfde383b3688d9ed1" => :high_sierra + sha256 "68cb1b6bc898f2a1bd39ae24dd0235f68ffa56d04ba8cd4424835335202977d1" => :sierra + sha256 "37bf242aad0c18317cdaef66218483c04fa57e091b7c7f9d72089f5002881338" => :el_capitan + sha256 "3443dbf17f78be0cecb5419772c71bb418caa91763590072224c196a57317717" => :yosemite + end + + head do + url "https://github.com/swig/swig.git" + + depends_on "autoconf" => :build + depends_on "automake" => :build + end + + depends_on "pcre" + + def install + system "./autogen.sh" if build.head? + system "./configure", "--disable-dependency-tracking", + "--prefix=#{prefix}" + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~EOS + int add(int x, int y) + { + return x + y; + } + EOS + (testpath/"test.i").write <<~EOS + %module test + %inline %{ + extern int add(int x, int y); + %} + EOS + (testpath/"run.rb").write <<~EOS + require "./test" + puts Test.add(1, 1) + EOS + system "#{bin}/swig", "-ruby", "test.i" + system ENV.cc, "-c", "test.c" + system ENV.cc, "-c", "test_wrap.c", "-I#{MacOS.sdk_path}/System/Library/Frameworks/Ruby.framework/Headers/" + system ENV.cc, "-bundle", "-undefined", "dynamic_lookup", "test.o", "test_wrap.o", "-o", "test.bundle" + assert_equal "2", shell_output("/usr/bin/ruby run.rb").strip + end +end diff --git a/CMakeLists.txt b/CMakeLists.txt index fdee5d3e..12942d8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,26 @@ -cmake_minimum_required(VERSION 3.10) -# Change obs-plugintemplate to your plugin's name in a machine-readable format -# (e.g.: obs-myawesomeplugin) and set -project(obs-midi VERSION 0.2.4) +cmake_minimum_required(VERSION 3.5) +project(obs-midi VERSION 0.9.0) -# Replace `Your Name Here` with the name (yours or your organization's) you want -# to see as the author of the plugin (in the plugin's metadata itself and in the installers) -set(PLUGIN_AUTHOR "Alzy") +set(CMAKE_PREFIX_PATH "${QTDIR}") +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) -# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS releases -# (used both in the installer and when submitting the installer for notarization) -set(MACOS_BUNDLEID "com.example.obs-midi") +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Replace `me@contoso.com` with the maintainer email address you want to put in Linux packages -set(LINUX_MAINTAINER_EMAIL "alfredo@seriousbusiness.la") +add_definitions(-DASIO_STANDALONE) -if(WIN32) - set(MODULE_DESCRIPTION "OBS MIDI module") +if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") + set(CMAKE_CXX_FLAGS "-mfpu=neon") endif() +if (WIN32 OR APPLE) + include(external/FindLibObs.cmake) +endif() + +find_package(LibObs REQUIRED) +find_package(Qt5 REQUIRED COMPONENTS Core Widgets) # Version bits execute_process( COMMAND git rev-parse --abbrev-ref HEAD @@ -50,35 +53,6 @@ set(obs-midi_DEPS RtMidi17) include_directories(src/RtMidi17) -set(plugin_ui - src/forms/settings-dialog.ui -) -if (NOT ${isAzure}) -qt5_wrap_ui(plugin_ui_headers ${plugin_ui}) -endif() -# OBS MIDI -set(CMAKE_PREFIX_PATH "${QTDIR}") -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -add_definitions(-DASIO_STANDALONE) -if (${isAzure}) - if (WIN32 OR APPLE) - include(external/FindLibObs.cmake) - endif() - find_package(LibObs REQUIRED) -endif() -if (APPLE) - include(external/FindLibObs.cmake) - find_package(LibObs REQUIRED) -endif() - -find_package(Qt5 REQUIRED COMPONENTS Core Widgets) - include_directories( "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" SYSTEM @@ -87,7 +61,7 @@ include_directories( "${CMAKE_SOURCE_DIR}/UI") set(obs-midi_SOURCES - src/utils.cpp + src/utils.cpp src/config.cpp src/midi-agent.cpp src/device-manager.cpp @@ -95,9 +69,7 @@ set(obs-midi_SOURCES src/forms/settings-dialog.cpp src/obs-midi.cpp src/events.cpp - src/rpc/RpcEvent.cpp - -) + src/rpc/RpcEvent.cpp) list(APPEND obs-midi_HEADERS src/utils.h @@ -108,141 +80,122 @@ list(APPEND obs-midi_HEADERS src/forms/settings-dialog.h src/obs-midi.h src/events.h - src/rpc/RpcEvent.h -) - + src/rpc/RpcEvent.h) add_library(obs-midi MODULE - ${obs-midi_SOURCES} - ${obs-midi_HEADERS} - ${plugin_ui_headers}) + ${obs-midi_SOURCES} + ${obs-midi_HEADERS}) -if(WIN32 OR LINUX) - if (${isAzure}) +include_directories( + "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" + ${Qt5Core_INCLUDES} + ${Qt5Widgets_INCLUDES} + "${CMAKE_SOURCE_DIR}/deps/asio/asio/include") +target_link_libraries(obs-midi + "${OBS_FRONTEND_LIB}" + ${obs-midi_DEPS} + Qt5::Core + Qt5::Widgets + libobs) +# --- Windows-specific build settings and tasks --- +if(WIN32) + if(NOT DEFINED OBS_FRONTEND_LIB) + set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library") + message(FATAL_ERROR "Could not find OBS Frontend API's library !") + endif() - target_link_libraries(obs-midi - "${OBS_FRONTEND_LIB}" - ${obs-midi_DEPS} - Qt5::Core - Qt5::Widgets - libobs) + if(MSVC) + # Enable Multicore Builds and disable FH4 (to not depend on VCRUNTIME140_1.DLL) + add_definitions(/MP /d2FH4-) + endif() + + add_definitions(-D_WEBSOCKETPP_CPP11_STL_) + + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(ARCH_NAME "64bit") + set(OBS_BUILDDIR_ARCH "build64") else() - target_link_libraries(obs-midi - obs-frontend-api - ${obs-midi_DEPS} - Qt5::Core - Qt5::Widgets - libobs) - endif() -else() - target_link_libraries(obs-midi - "${OBS_FRONTEND_LIB}" - ${obs-midi_DEPS} - Qt5::Core - Qt5::Widgets - libobs) -endif() -if (${isAzure}) -# --- Windows-specific build settings and tasks --- - - if(WIN32) - if(NOT DEFINED OBS_FRONTEND_LIB) - set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library") - message(FATAL_ERROR "Could not find OBS Frontend API's library !") - endif() - - if(MSVC) - # Enable Multicore Builds and disable FH4 (to not depend on VCRUNTIME140_1.DLL) - add_definitions(/MP /d2FH4-) - endif() - - - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(ARCH_NAME "64bit") - set(OBS_BUILDDIR_ARCH "build64") - else() - set(ARCH_NAME "32bit") - set(OBS_BUILDDIR_ARCH "build32") - endif() - - include_directories( - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/UI" - ) - - target_link_libraries(obs-midi - "${OBS_FRONTEND_LIB}") - - # --- Release package helper --- - # The "release" folder has a structure similar OBS' one on Windows - set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release") - add_custom_command(TARGET obs-midi POST_BUILD - # If config is Release, package release files - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E make_directory - "${RELEASE_DIR}/data/obs-plugins/obs-midi" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") - - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory - "${PROJECT_SOURCE_DIR}/data" - "${RELEASE_DIR}/data/obs-plugins/obs-midi") + set(ARCH_NAME "32bit") + set(OBS_BUILDDIR_ARCH "build32") + endif() - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy - "$" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") - - # In Release mode, copy Qt image format plugins - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy - "${QTDIR}/plugins/imageformats/qjpeg.dll" - "${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll") - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy - "${QTDIR}/plugins/imageformats/qjpeg.dll" - "${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll") - - # If config is RelWithDebInfo, package release files - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E make_directory - "${RELEASE_DIR}/data/obs-plugins/obs-midi" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") - - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory - "${PROJECT_SOURCE_DIR}/data" - "${RELEASE_DIR}/data/obs-plugins/obs-midi") + include_directories( + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/UI" + ) - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + target_link_libraries(obs-midi + "${OBS_FRONTEND_LIB}") + + # --- Release package helper --- + # The "release" folder has a structure similar OBS' one on Windows + set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release") + + add_custom_command(TARGET obs-midi POST_BUILD + # If config is Release, package release files + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E make_directory + "${RELEASE_DIR}/data/obs-plugins/obs-midi" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory + "${PROJECT_SOURCE_DIR}/data" + "${RELEASE_DIR}/data/obs-plugins/obs-midi") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "$" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + # In Release mode, copy Qt image format plugins + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy + "${QTDIR}/plugins/imageformats/qjpeg.dll" + "${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll") + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy + "${QTDIR}/plugins/imageformats/qjpeg.dll" + "${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll") + + # If config is RelWithDebInfo, package release files + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E make_directory + "${RELEASE_DIR}/data/obs-plugins/obs-midi" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy_directory + "${PROJECT_SOURCE_DIR}/data" + "${RELEASE_DIR}/data/obs-plugins/obs-midi") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "$" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + "$" + "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + + # Copy to obs-studio dev environment for immediate testing + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy "$" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") - COMMAND if $==1 ("${CMAKE_COMMAND}" -E copy + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy "$" - "${RELEASE_DIR}/obs-plugins/${ARCH_NAME}") - - # Copy to obs-studio dev environment for immediate testing - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy - "$" - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") - - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy - "$" - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") - - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E make_directory - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-midi") - - COMMAND if $==1 ( - "${CMAKE_COMMAND}" -E copy_directory - "${PROJECT_SOURCE_DIR}/data" - "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-midi") - ) - # --- End of sub-section --- + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/obs-plugins/${ARCH_NAME}") + + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E make_directory + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-midi") + + COMMAND if $==1 ( + "${CMAKE_COMMAND}" -E copy_directory + "${PROJECT_SOURCE_DIR}/data" + "${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$/data/obs-plugins/obs-midi") + ) + # --- End of sub-section --- - endif() - # --- End of section --- endif() -# -- End of if AZURE +# --- End of section --- # --- Linux-specific build settings and tasks --- if(UNIX AND NOT APPLE) @@ -253,12 +206,17 @@ if(UNIX AND NOT APPLE) file(GLOB locale_files data/locale/*.ini) + set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + if(${USE_UBUNTU_FIX}) - install(TARGETS obs-midi - LIBRARY DESTINATION "/usr/lib/obs-plugins") + install(TARGETS obs-midi LIBRARY + DESTINATION "/usr/lib/obs-plugins" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) endif() - install(TARGETS obs-midi - LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") + install(TARGETS obs-midi LIBRARY + DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) install(FILES ${locale_files} DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/obs-midi/locale") @@ -268,21 +226,9 @@ endif() # -- OS X specific build settings and tasks -- if(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fvisibility=default") + set(CMAKE_SKIP_RPATH TRUE) set_target_properties(obs-midi PROPERTIES PREFIX "") target_link_libraries(obs-midi "${OBS_FRONTEND_LIB}") endif() # -- End of section -- - - - -# -- Fixes issue where plugin isn't copied to rundir plugins directory on local build -- -if(WIN32) - if (${isAzure}) - else () - install_obs_plugin_with_data(obs-midi data) - endif() -endif() - -set_target_properties(obs-midi PROPERTIES FOLDER "plugins/obs-midi") -set_target_properties(RtMidi17 PROPERTIES FOLDER "plugins/obs-midi") diff --git a/README.md b/README.md index 90d6d872..8e5fd8a1 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,7 @@ Use MIDI devices to trigger events in OBS and visa versa. # Status -- WIP -## Windows -[![Build Status](https://dev.azure.com/cpyarger0055/OBS-Midi/_apis/build/status/OBS-Midi?branchName=master&jobName=Build_Windows)](https://dev.azure.com/cpyarger0055/OBS-Midi/_build/latest?definitionId=5&branchName=master) -## macOS -[![Build Status](https://dev.azure.com/cpyarger0055/OBS-Midi/_apis/build/status/OBS-Midi?branchName=master&jobName=Build_macOS)](https://dev.azure.com/cpyarger0055/OBS-Midi/_build/latest?definitionId=5&branchName=master) -## Linux -[![Build Status](https://dev.azure.com/cpyarger0055/OBS-Midi/_apis/build/status/OBS-Midi?branchName=master&jobName=Build_Linux)](https://dev.azure.com/cpyarger0055/OBS-Midi/_build/latest?definitionId=5&branchName=master) +![CI Multiplatform Build](https://github.com/cpyarger/obs-midi/workflows/CI%20Multiplatform%20Build/badge.svg) # Installing diff --git a/docs/releasehead.md b/docs/releasehead.md new file mode 100644 index 00000000..898d269b --- /dev/null +++ b/docs/releasehead.md @@ -0,0 +1,13 @@ +# OBS-MIDI +Use MIDI devices to trigger events in OBS and visa versa. + +# More information + +Take a look at the base repo for More information + +# Currently a WIP +Windows and Linux are tested working. Mac has not been tested + # Special thanks to the following projects + * [RTMidi17](https://github.com/jcelerier/RtMidi17) An amazing modernized RTMIDI library + * [OBSWebsocket](https://github.com/Palakis/obs-websocket/) from which much code was borrowed for interfacing with obs + * [MIDItoOBS](https://github.com/lebaston100/MIDItoOBS) Where I got my start playing with this