From 7cf299790809b764fea822f90c320005ebf9dcb9 Mon Sep 17 00:00:00 2001 From: Gabriel B Motta Date: Fri, 30 Jul 2021 12:45:44 -0400 Subject: [PATCH 1/8] MAINT: change ubuntu runners to 18.04 - might need to udate qt version --- .github/workflows/buildqtbinaries.yml | 2 +- .github/workflows/coverity.yml | 2 +- .github/workflows/pullrequest.yml | 44 +++++++++++++-------------- .github/workflows/release.yml | 10 +++--- .github/workflows/testci.yml | 40 ++++++++++++------------ 5 files changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/buildqtbinaries.yml b/.github/workflows/buildqtbinaries.yml index 3ab89d42a29..586f43141c4 100644 --- a/.github/workflows/buildqtbinaries.yml +++ b/.github/workflows/buildqtbinaries.yml @@ -8,7 +8,7 @@ on: jobs: GenerateLinuxStaticBinaries: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 steps: - name: Clone repository diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index e88b5edf6ad..95e1d6b06ca 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -5,7 +5,7 @@ on: jobs: ScanLinux: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 steps: - name: Clone repository uses: actions/checkout@v2 diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 776048a7e85..5fab67e72e5 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -14,7 +14,7 @@ jobs: max-parallel: 3 matrix: qt: [5.10.1] - os: [ubuntu-16.04, macos-latest, windows-2016] + os: [ubuntu-18.04, macos-latest, windows-2016] steps: - name: Clone repository @@ -29,7 +29,7 @@ jobs: git submodule update --init applications/mne_scan/plugins/brainflowboard/brainflow git submodule update --init applications/mne_scan/plugins/lsladapter/liblsl - name: Install Qt (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') uses: jurplel/install-qt-action@v2 with: version: ${{ matrix.qt }} @@ -56,7 +56,7 @@ jobs: cmake -G "Visual Studio 15 2017" -A x64 -DMSVC_RUNTIME=dynamic -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_INSTALL_PREFIX="$env:GITHUB_WORKSPACE\applications\mne_scan\plugins\brainflowboard\brainflow\installed" .. cmake --build . --target install --config Release - name: Compile BrainFlow submodule (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | cd applications/mne_scan/plugins/brainflowboard/brainflow mkdir build @@ -73,7 +73,7 @@ jobs: cmake .. -G "Visual Studio 15 2017" -A x64 cmake --build . --config Release --target install - name: Compile LSL submodule (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | cd applications/mne_scan/plugins/lsladapter/liblsl mkdir build @@ -82,7 +82,7 @@ jobs: make make install - name: Configure and compile MNE-CPP (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | qmake -r MNECPP_CONFIG+=noTests MNECPP_CONFIG+=withBrainFlow MNECPP_CONFIG+=withLsl MNECPP_CONFIG+=withAppBundles make -j4 @@ -94,7 +94,7 @@ jobs: Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } } qmake -r MNECPP_CONFIG+=noTests MNECPP_CONFIG+=withBrainFlow MNECPP_CONFIG+=withLsl jom -j4 - - name: Deploy binaries + - name: Deploy binaries run: | ./tools/deployment/deploy.bat dynamic pack @@ -106,7 +106,7 @@ jobs: max-parallel: 3 matrix: qt: [5.15.2] - os: [ubuntu-16.04, macos-latest, windows-2019] + os: [ubuntu-18.04, macos-latest, windows-2019] steps: - name: Clone repository @@ -121,7 +121,7 @@ jobs: git submodule update --init applications/mne_scan/plugins/brainflowboard/brainflow git submodule update --init applications/mne_scan/plugins/lsladapter/liblsl - name: Install Qt (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') uses: jurplel/install-qt-action@v2 with: version: ${{ matrix.qt }} @@ -148,7 +148,7 @@ jobs: cmake -G "Visual Studio 16 2019" -A x64 -DMSVC_RUNTIME=dynamic -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_INSTALL_PREFIX="$env:GITHUB_WORKSPACE\applications\mne_scan\plugins\brainflowboard\brainflow\installed" .. cmake --build . --target install --config Release - name: Compile BrainFlow submodule (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | cd applications/mne_scan/plugins/brainflowboard/brainflow mkdir build @@ -165,7 +165,7 @@ jobs: cmake .. -G "Visual Studio 16 2019" -A x64 cmake --build . --config Release --target install - name: Compile LSL submodule (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | cd applications/mne_scan/plugins/lsladapter/liblsl mkdir build @@ -174,7 +174,7 @@ jobs: make make install - name: Configure and compile MNE-CPP (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | qmake -r MNECPP_CONFIG+=noTests MNECPP_CONFIG+=withBrainFlow MNECPP_CONFIG+=withLsl MNECPP_CONFIG+=withAppBundles make -j4 @@ -189,7 +189,7 @@ jobs: - name: Deploy binaries run: | ./tools/deployment/deploy.bat dynamic pack - + QtStatic: runs-on: ${{ matrix.os }} @@ -197,7 +197,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - os: [ubuntu-16.04, macos-latest, windows-2019] + os: [ubuntu-18.04, macos-latest, windows-2019] steps: - name: Clone repository @@ -208,12 +208,12 @@ jobs: python-version: '3.7' architecture: 'x64' - name: Install OpenGL (Linux) - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' run: | sudo apt-get update -q sudo apt-get install build-essential libgl1-mesa-dev - name: Install Qt (Linux) - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' run: | # Download the pre-built static version of Qt, which was created with the generateBinaries.yml workflow wget -O qt5_5152_static_binaries_linux.tar.gz https://www.dropbox.com/s/cm50t5fl62rspdl/qt5_5152_static_binaries_linux.tar.gz?dl=1 @@ -238,7 +238,7 @@ jobs: expand-archive -path "jom.zip" echo "D:\a\mne-cpp\mne-cpp\jom" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Configure and compile MNE-CPP (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | ../Qt5_binaries/bin/qmake -r MNECPP_CONFIG+=noTests MNECPP_CONFIG+=static make -j4 @@ -261,7 +261,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - os: [ubuntu-16.04, macos-latest, windows-2019] + os: [ubuntu-18.04, macos-latest, windows-2019] steps: - name: Clone repository @@ -274,11 +274,11 @@ jobs: python-version: '3.7' architecture: 'x64' - name: Install Codecov - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' run: | sudo pip install codecov - name: Install Qt (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') uses: jurplel/install-qt-action@v2 with: version: 5.15.2 @@ -297,7 +297,7 @@ jobs: expand-archive -path "jom.zip" echo "D:\a\mne-cpp\mne-cpp\jom" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Configure and compile MNE-CPP (Linux) - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' run: | qmake -r MNECPP_CONFIG+=withCodeCov MNECPP_CONFIG+=noApplications MNECPP_CONFIG+=noExamples make -j4 @@ -315,7 +315,7 @@ jobs: qmake -r MNECPP_CONFIG+=noApplications MNECPP_CONFIG+=noExamples jom -j4 - name: Run tests (Linux) - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} QTEST_FUNCTION_TIMEOUT: 900000 @@ -335,7 +335,7 @@ jobs: ./tools/testing/test_win.ps1 Doxygen: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 steps: - name: Clone repository diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8283198124..a0ea4be57a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ on: jobs: CreateRelease: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 steps: - name: Clone repository @@ -55,7 +55,7 @@ jobs: hub release create -m "Development Builds" dev_build --prerelease LinuxStatic: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 needs: CreateRelease steps: @@ -239,7 +239,7 @@ jobs: overwrite: true LinuxDynamic: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 needs: CreateRelease steps: @@ -435,7 +435,7 @@ jobs: Tests: # Only run for dev releases if: endsWith(github.ref, 'main') == true - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 needs: CreateRelease steps: @@ -468,7 +468,7 @@ jobs: ./tools/testing/test_linux_codecov Doxygen: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 needs: CreateRelease steps: diff --git a/.github/workflows/testci.yml b/.github/workflows/testci.yml index 6561be6d520..aeafc4e844a 100644 --- a/.github/workflows/testci.yml +++ b/.github/workflows/testci.yml @@ -14,7 +14,7 @@ jobs: max-parallel: 3 matrix: qt: [5.10.1] - os: [ubuntu-16.04, macos-latest, windows-2016] + os: [ubuntu-18.04, macos-latest, windows-2016] steps: - name: Clone repository @@ -29,7 +29,7 @@ jobs: git submodule update --init applications/mne_scan/plugins/brainflowboard/brainflow git submodule update --init applications/mne_scan/plugins/lsladapter/liblsl - name: Install Qt (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') uses: jurplel/install-qt-action@v2 with: version: ${{ matrix.qt }} @@ -56,7 +56,7 @@ jobs: cmake -G "Visual Studio 15 2017" -A x64 -DMSVC_RUNTIME=dynamic -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_INSTALL_PREFIX="$env:GITHUB_WORKSPACE\applications\mne_scan\plugins\brainflowboard\brainflow\installed" .. cmake --build . --target install --config Release - name: Compile BrainFlow submodule (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | cd applications/mne_scan/plugins/brainflowboard/brainflow mkdir build @@ -73,7 +73,7 @@ jobs: cmake .. -G "Visual Studio 15 2017" -A x64 cmake --build . --config Release --target install - name: Compile LSL submodule (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | cd applications/mne_scan/plugins/lsladapter/liblsl mkdir build @@ -82,7 +82,7 @@ jobs: make make install - name: Configure and compile MNE-CPP (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | qmake -r MNECPP_CONFIG+=noTests MNECPP_CONFIG+=withBrainFlow MNECPP_CONFIG+=withLsl MNECPP_CONFIG+=withAppBundles make -j4 @@ -106,7 +106,7 @@ jobs: max-parallel: 3 matrix: qt: [5.15.2] - os: [ubuntu-16.04, macos-latest, windows-2019] + os: [ubuntu-18.04, macos-latest, windows-2019] steps: - name: Clone repository @@ -121,7 +121,7 @@ jobs: git submodule update --init applications/mne_scan/plugins/brainflowboard/brainflow git submodule update --init applications/mne_scan/plugins/lsladapter/liblsl - name: Install Qt (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') uses: jurplel/install-qt-action@v2 with: version: ${{ matrix.qt }} @@ -148,7 +148,7 @@ jobs: cmake -G "Visual Studio 16 2019" -A x64 -DMSVC_RUNTIME=dynamic -DCMAKE_SYSTEM_VERSION=8.1 -DCMAKE_INSTALL_PREFIX="$env:GITHUB_WORKSPACE\applications\mne_scan\plugins\brainflowboard\brainflow\installed" .. cmake --build . --target install --config Release - name: Compile BrainFlow submodule (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | cd applications/mne_scan/plugins/brainflowboard/brainflow mkdir build @@ -165,7 +165,7 @@ jobs: cmake .. -G "Visual Studio 16 2019" -A x64 cmake --build . --config Release --target install - name: Compile LSL submodule (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | cd applications/mne_scan/plugins/lsladapter/liblsl mkdir build @@ -174,7 +174,7 @@ jobs: make make install - name: Configure and compile MNE-CPP (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | qmake -r MNECPP_CONFIG+=noTests MNECPP_CONFIG+=withBrainFlow MNECPP_CONFIG+=withLsl MNECPP_CONFIG+=withAppBundles make -j4 @@ -197,7 +197,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - os: [ubuntu-16.04, macos-latest, windows-2019] + os: [ubuntu-18.04, macos-latest, windows-2019] steps: - name: Clone repository @@ -208,12 +208,12 @@ jobs: python-version: '3.7' architecture: 'x64' - name: Install OpenGL (Linux) - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' run: | sudo apt-get update -q sudo apt-get install build-essential libgl1-mesa-dev - name: Install Qt (Linux) - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' run: | # Download the pre-built static version of Qt, which was created with the generateBinaries.yml workflow wget -O qt5_5152_static_binaries_linux.tar.gz https://www.dropbox.com/s/ilwo7mu9muk48mf/qt5_5152_static_binaries_linux.tar.gz?dl=1 @@ -238,7 +238,7 @@ jobs: expand-archive -path "jom.zip" echo "D:\a\mne-cpp\mne-cpp\jom" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Configure and compile MNE-CPP (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') run: | ../Qt5_binaries/bin/qmake -r MNECPP_CONFIG+=noTests MNECPP_CONFIG+=static make -j4 @@ -261,7 +261,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - os: [ubuntu-16.04, macos-latest, windows-2019] + os: [ubuntu-18.04, macos-latest, windows-2019] steps: - name: Clone repository @@ -274,11 +274,11 @@ jobs: python-version: '3.7' architecture: 'x64' - name: Install Codecov - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' run: | sudo pip install codecov - name: Install Qt (Linux|MacOS) - if: (matrix.os == 'ubuntu-16.04') || (matrix.os == 'macos-latest') + if: (matrix.os == 'ubuntu-18.04') || (matrix.os == 'macos-latest') uses: jurplel/install-qt-action@v2 with: version: 5.15.0 @@ -297,7 +297,7 @@ jobs: expand-archive -path "jom.zip" echo "D:\a\mne-cpp\mne-cpp\jom" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Configure and compile MNE-CPP (Linux) - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' run: | qmake -r MNECPP_CONFIG+=withCodeCov MNECPP_CONFIG+=noApplications MNECPP_CONFIG+=noExamples make -j4 @@ -315,7 +315,7 @@ jobs: qmake -r MNECPP_CONFIG+=noApplications MNECPP_CONFIG+=noExamples jom -j4 - name: Run tests (Linux) - if: matrix.os == 'ubuntu-16.04' + if: matrix.os == 'ubuntu-18.04' env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} QTEST_FUNCTION_TIMEOUT: 900000 @@ -335,7 +335,7 @@ jobs: ./tools/testing/test_win.ps1 Doxygen: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 steps: - name: Clone repository From 6269ddc72bebdba83b1551f740d6cd82ab26dc8c Mon Sep 17 00:00:00 2001 From: Gabriel B Motta Date: Fri, 30 Jul 2021 13:46:17 -0400 Subject: [PATCH 2/8] MAINT: upd qt version min to 5.12.5 --- .github/workflows/coverity.yml | 4 ++-- .github/workflows/pullrequest.yml | 2 +- .github/workflows/testci.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 95e1d6b06ca..ea58e8935b6 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -17,7 +17,7 @@ jobs: - name: Install Qt uses: jurplel/install-qt-action@v2 with: - version: 5.10.1 + version: 5.12.5 modules: qtcharts - name: Coverity scripts run: | @@ -58,7 +58,7 @@ jobs: --form version=$SHA \ --form description="Github Actions build" \ $UPLOAD_URL) - echo "$response" + echo "$response" status_code=$(echo "$response" | sed -n '$p') env: COVTOKEN: ${{ secrets.COVERITY_TOKEN }} diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 5fab67e72e5..9e8b4d22201 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - qt: [5.10.1] + qt: [5.12.5] os: [ubuntu-18.04, macos-latest, windows-2016] steps: diff --git a/.github/workflows/testci.yml b/.github/workflows/testci.yml index aeafc4e844a..f1fb0aed424 100644 --- a/.github/workflows/testci.yml +++ b/.github/workflows/testci.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false max-parallel: 3 matrix: - qt: [5.10.1] + qt: [5.12.5] os: [ubuntu-18.04, macos-latest, windows-2016] steps: @@ -189,7 +189,7 @@ jobs: - name: Deploy binaries run: | ./tools/deployment/deploy.bat dynamic pack - + QtStatic: runs-on: ${{ matrix.os }} From 7df9ef44d4b302cb468354dee784136426464ee6 Mon Sep 17 00:00:00 2001 From: Gabriel B Motta Date: Fri, 30 Jul 2021 15:56:30 -0400 Subject: [PATCH 3/8] MAINT: apt get missing library --- .github/workflows/pullrequest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 9e8b4d22201..b7f97bbed88 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -211,7 +211,7 @@ jobs: if: matrix.os == 'ubuntu-18.04' run: | sudo apt-get update -q - sudo apt-get install build-essential libgl1-mesa-dev + sudo apt-get install build-essential libgl1-mesa-dev libicu55 - name: Install Qt (Linux) if: matrix.os == 'ubuntu-18.04' run: | From 896ac86dd815be732e0b79fbddab99442957fa66 Mon Sep 17 00:00:00 2001 From: Gabriel B Motta Date: Fri, 30 Jul 2021 16:02:03 -0400 Subject: [PATCH 4/8] MAINT: add repo --- .github/workflows/pullrequest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index b7f97bbed88..6a37e02b4b2 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -210,6 +210,7 @@ jobs: - name: Install OpenGL (Linux) if: matrix.os == 'ubuntu-18.04' run: | + sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" sudo apt-get update -q sudo apt-get install build-essential libgl1-mesa-dev libicu55 - name: Install Qt (Linux) From d038ab1fd46c16ef7d921802353eae94a57da402 Mon Sep 17 00:00:00 2001 From: Gabriel B Motta Date: Fri, 30 Jul 2021 16:50:02 -0400 Subject: [PATCH 5/8] MAINT: build qt statically on ubuntu 18 --- .github/workflows/pullrequest.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 6a37e02b4b2..9ca16d83aa2 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -216,10 +216,20 @@ jobs: - name: Install Qt (Linux) if: matrix.os == 'ubuntu-18.04' run: | - # Download the pre-built static version of Qt, which was created with the generateBinaries.yml workflow - wget -O qt5_5152_static_binaries_linux.tar.gz https://www.dropbox.com/s/cm50t5fl62rspdl/qt5_5152_static_binaries_linux.tar.gz?dl=1 - mkdir ../Qt5_binaries - tar xvzf qt5_5152_static_binaries_linux.tar.gz -C ../ -P + cd .. + git clone https://code.qt.io/qt/qt5.git -b 5.15.2 + cd qt5 + ./init-repository -f --module-subset=qtbase,qtcharts,qtsvg,qt3d + # Create shadow build folder + cd .. + mkdir qt5_shadow + cd qt5_shadow + # Configure Qt5 + ../qt5/configure -static -release -prefix "../Qt5_binaries" -skip webengine -nomake tools -nomake tests -nomake examples -no-dbus -no-ssl -no-pch -opensource -confirm-license -bundled-xcb-xinput -qt-libpng -qt-pcre + make module-qtbase module-qtsvg module-qtcharts module-qt3d -j4 + make install -j4 + cd .. + cd mne-cpp - name: Install Qt (MacOS) if: matrix.os == 'macos-latest' run: | From 44937beeaeee13a42fd50b1b246c310bf7a50c20 Mon Sep 17 00:00:00 2001 From: juangpc Date: Mon, 2 Aug 2021 17:58:44 -0400 Subject: [PATCH 6/8] rename deploy multiplatform script --- tools/deployment/{deploy.bat => deploy.sh.bat} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/deployment/{deploy.bat => deploy.sh.bat} (100%) mode change 100755 => 100644 diff --git a/tools/deployment/deploy.bat b/tools/deployment/deploy.sh.bat old mode 100755 new mode 100644 similarity index 100% rename from tools/deployment/deploy.bat rename to tools/deployment/deploy.sh.bat From 89ad71ff2d6fcb683efc47e06b6230da6cb83627 Mon Sep 17 00:00:00 2001 From: juangpc Date: Mon, 2 Aug 2021 17:59:03 -0400 Subject: [PATCH 7/8] rename deploy script extension --- .github/workflows/pullrequest.yml | 6 +++--- .github/workflows/release.yml | 12 ++++++------ .github/workflows/testci.yml | 6 +++--- doc/gh-pages/pages/development/buildguide.md | 2 +- .../pages/development/buildguide_dynamic.md | 2 +- doc/gh-pages/pages/development/ci_deployment.md | 14 +++++++------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 9ca16d83aa2..cb0d99f8a40 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -96,7 +96,7 @@ jobs: jom -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat dynamic pack + ./tools/deployment/deploy.sh.bat dynamic pack MaxQtDynamic: runs-on: ${{ matrix.os }} @@ -188,7 +188,7 @@ jobs: jom -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat dynamic pack + ./tools/deployment/deploy.sh.bat dynamic pack QtStatic: runs-on: ${{ matrix.os }} @@ -263,7 +263,7 @@ jobs: jom -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat static pack + ./tools/deployment/deploy.sh.bat static pack Tests: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0ea4be57a7..b452857aa8a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,7 +94,7 @@ jobs: make install -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat static pack + ./tools/deployment/deploy.sh.bat static pack - name: Deploy binaries with stable release on Github if: endsWith(github.ref, 'main') == false uses: svenstaro/upload-release-action@v1-release @@ -149,7 +149,7 @@ jobs: make install -j - name: Deploy binaries run: | - ./tools/deployment/deploy.bat static pack + ./tools/deployment/deploy.sh.bat static pack - name: Deploy binaries with stable release on Github if: endsWith(github.ref, 'main') == false uses: svenstaro/upload-release-action@v1-release @@ -218,7 +218,7 @@ jobs: jom -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat static pack + ./tools/deployment/deploy.sh.bat static pack - name: Deploy binaries with stable release on Github if: endsWith(github.ref, 'main') == false uses: svenstaro/upload-release-action@v1-release @@ -281,7 +281,7 @@ jobs: make -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat dynamic pack + ./tools/deployment/deploy.sh.bat dynamic pack - name: Deploy binaries with stable release on Github if: endsWith(github.ref, 'main') == false uses: svenstaro/upload-release-action@v1-release @@ -343,7 +343,7 @@ jobs: make -j4 - name: Deploy binaries (MacOS) run: | - ./tools/deployment/deploy.bat dynamic pack + ./tools/deployment/deploy.sh.bat dynamic pack - name: Deploy binaries with stable release on Github if: endsWith(github.ref, 'main') == false uses: svenstaro/upload-release-action@v1-release @@ -412,7 +412,7 @@ jobs: jom -j4 - name: Deploy binaries (Windows) run: | - ./tools/deployment/deploy.bat dynamic pack + ./tools/deployment/deploy.sh.bat dynamic pack - name: Deploy binaries with stable release on Github if: endsWith(github.ref, 'main') == false uses: svenstaro/upload-release-action@v1-release diff --git a/.github/workflows/testci.yml b/.github/workflows/testci.yml index f1fb0aed424..c9cfe1fc5e5 100644 --- a/.github/workflows/testci.yml +++ b/.github/workflows/testci.yml @@ -96,7 +96,7 @@ jobs: jom -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat dynamic pack + ./tools/deployment/deploy.sh.bat dynamic pack MaxQtDynamic: runs-on: ${{ matrix.os }} @@ -188,7 +188,7 @@ jobs: jom -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat dynamic pack + ./tools/deployment/deploy.sh.bat dynamic pack QtStatic: runs-on: ${{ matrix.os }} @@ -252,7 +252,7 @@ jobs: jom -j4 - name: Deploy binaries run: | - ./tools/deployment/deploy.bat static pack + ./tools/deployment/deploy.sh.bat static pack Tests: runs-on: ${{ matrix.os }} diff --git a/doc/gh-pages/pages/development/buildguide.md b/doc/gh-pages/pages/development/buildguide.md index cb8e8ad34cf..d090baaff36 100644 --- a/doc/gh-pages/pages/development/buildguide.md +++ b/doc/gh-pages/pages/development/buildguide.md @@ -8,6 +8,6 @@ nav_order: 6 The following guides show you how to build the dynamically and statically linked version of MNE-CPP from source. After building the project you will be able to run the different applications that are part of the project. These will appear as executable files with different extensions, depending on your operating system. -You can run the compiled applications within QtCreator application (this is the recommended tool also for development and building processes), by pressing the Run button. However, if you want to run directly from within a different command-line tool or through the operating system itself, you will have to resolve all the Qt-related dependencies by generating Qt libraries. MNE-CPP provides a useful automatic deployment script which is saved in ```tools/deployment```. For more information about this script see the [Continous Integration](ci_deployment.md) section. Briefly, run the script ```deploy.bat``` with either ```dynamic``` or ```static``` as input argument to specify the linkage to be used. This way all the necessary Qt-related dependencies will be solved and the applications readily available for execution in all contexts. +You can run the compiled applications within QtCreator application (this is the recommended tool also for development and building processes), by pressing the Run button. However, if you want to run directly from within a different command-line tool or through the operating system itself, you will have to resolve all the Qt-related dependencies by generating Qt libraries. MNE-CPP provides a useful automatic deployment script which is saved in ```tools/deployment```. For more information about this script see the [Continous Integration](ci_deployment.md) section. Briefly, run the script ```deploy.sh.bat``` with either ```dynamic``` or ```static``` as input argument to specify the linkage to be used. This way all the necessary Qt-related dependencies will be solved and the applications readily available for execution in all contexts. |**Please note:** We recommend building the dynamically linked version for developing purposes.| diff --git a/doc/gh-pages/pages/development/buildguide_dynamic.md b/doc/gh-pages/pages/development/buildguide_dynamic.md index 971cd8b4082..1784ebffa35 100644 --- a/doc/gh-pages/pages/development/buildguide_dynamic.md +++ b/doc/gh-pages/pages/development/buildguide_dynamic.md @@ -81,7 +81,7 @@ make -j8 # On Linux and MacOS ### Running Applications -Once built, applications can be run from within QtCreator using the run button on the bottom left side. To instead run applications from the command line, first execute the ```deploy.bat``` script in ```tools/deployment```. For more information about this script, see our [Continuous Integration documentation](ci_deployment.md). Once this is done, applications can be executed normally from the command line. +Once built, applications can be run from within QtCreator using the run button on the bottom left side. To instead run applications from the command line, first execute the ```deploy.sh.bat``` script in ```tools/deployment```. For more information about this script, see our [Continuous Integration documentation](ci_deployment.md). Once this is done, applications can be executed normally from the command line. ## Test the Build diff --git a/doc/gh-pages/pages/development/ci_deployment.md b/doc/gh-pages/pages/development/ci_deployment.md index 3011afdc370..85744f22026 100644 --- a/doc/gh-pages/pages/development/ci_deployment.md +++ b/doc/gh-pages/pages/development/ci_deployment.md @@ -19,30 +19,30 @@ MNE-CPP depends on [Qt](https://www.qt.io/){:target="_blank" rel="noopener"} and ### Windows The `WinDynamic` workflow run in [release.yml](https://github.com/mne-tools/mne-cpp/blob/main/.github/workflows/release.yml){:target="_blank" rel="noopener"} is configured to exclude examples as well as tests. Next to `mne-cpp/lib` the MNE-CPP libraries are also copied to the `mne-cpp/bin` folder. This is performed in the libraries' .pro files. -Dependency solving for libraries and executables is done via the `windeployqt` tool, which is officially developed and maintained by Qt. Calling `windeployqt` is performed in the [deploy.bat](https://github.com/mne-tools/mne-cpp/blob/main/tools/deployment/deploy.bat){:target="_blank" rel="noopener"} file with `dynamic` as first argument. `windeployqt` is called on the MNE Scan .exe and the Disp3D .dll file. Disp3D is the most top level library and links against all needed Qt modules. MNE Scan links against all relevant Qt modules application wise. Subsequently, Qt and all needed system libraries reside in the `mne-cpp/bin` folder. +Dependency solving for libraries and executables is done via the `windeployqt` tool, which is officially developed and maintained by Qt. Calling `windeployqt` is performed in the [deploy.sh.bat](https://github.com/mne-tools/mne-cpp/blob/main/tools/deployment/deploy.sh.bat){:target="_blank" rel="noopener"} file with `dynamic` as first argument. `windeployqt` is called on the MNE Scan .exe and the Disp3D .dll file. Disp3D is the most top level library and links against all needed Qt modules. MNE Scan links against all relevant Qt modules application wise. Subsequently, Qt and all needed system libraries reside in the `mne-cpp/bin` folder. The no longer needed folder `mne-cpp/bin/mne-cpp-test-data`is deleted before packaging. The folder `mne-cpp/bin` is compressed to a .zip file and uploaded as release asset to the corresponding GitHub release. ### Linux The `LinuxDynamic` workflow run in [release.yml](https://github.com/mne-tools/mne-cpp/blob/main/.github/workflows/release.yml){:target="_blank" rel="noopener"} is configured to exclude examples as well as tests. The `RPATH` is specified in the executable's .pro file in order to link to the libraries in `mne-cpp/lib`. -Dependency solving for libraries and executables is done via the [linuxdeployqt](https://github.com/probonopd/linuxdeployqt){:target="_blank" rel="noopener"} tool. Calling `linuxdeployqt` is performed in the [deploy.bat](https://github.com/mne-tools/mne-cpp/blob/main/tools/deployment/deploy.bat){:target="_blank" rel="noopener"} script (Remember that in unix/linux environments, the extension of a file has no special meaning, being just part of the filename). +Dependency solving for libraries and executables is done via the [linuxdeployqt](https://github.com/probonopd/linuxdeployqt){:target="_blank" rel="noopener"} tool. Calling `linuxdeployqt` is performed in the [deploy.sh.bat](https://github.com/mne-tools/mne-cpp/blob/main/tools/deployment/deploy.sh.bat){:target="_blank" rel="noopener"} script (Remember that in unix/linux environments, the extension of a file has no special meaning, being just part of the filename). The, no longer needed, folder `mne-cpp/bin/mne-cpp-test-data` is deleted before packaging. The folders `mne-cpp/bin`, `mne-cpp/lib`, `mne-cpp/plugins`, `mne-cpp/translations` are compressed to a .tar.gz file and uploaded as release assets to the corresponding GitHub release. ### MacOS The `MacOSDynamic` workflow run in [release.yml](https://github.com/mne-tools/mne-cpp/blob/main/.github/workflows/release.yml){:target="_blank" rel="noopener"} is configured to exclude examples as well as tests. All applications are build as .app bundles using the `withAppBundles` configuration flag. -Dependency solving for libraries and executables is done via the `macdeployqt` tool, which is officially developed and maintained by Qt. Calling `macdeployqt` is performed in the [deploy_macos](https://github.com/mne-tools/mne-cpp/blob/main/tools/deployment/deploy.bat){:target="_blank" rel="noopener"} file. All MNE-CPP libraries are manually copied to the .app's `Contents/Frameworks` folder. The resource and applications' plugins folders are copied to the corresponding `mne-cpp/bin/.app/` folders. +Dependency solving for libraries and executables is done via the `macdeployqt` tool, which is officially developed and maintained by Qt. Calling `macdeployqt` is performed in the [deploy_macos](https://github.com/mne-tools/mne-cpp/blob/main/tools/deployment/deploy.sh.bat){:target="_blank" rel="noopener"} file. All MNE-CPP libraries are manually copied to the .app's `Contents/Frameworks` folder. The resource and applications' plugins folders are copied to the corresponding `mne-cpp/bin/.app/` folders. The, no longer needed, folders `mne-cpp/bin/mne-cpp-test-data`, `mne-cpp/bin/mne_scan_plugins`, `mne-cpp/bin/mne_analyze_plugins`, `mne-cpp/bin/mne_rt_server_plugins` and `mne-cpp/bin/resources` are deleted before packaging. The folder `mne-cpp/bin` is compressed to a .tar.gz file and uploaded as release assets to the corresponding GitHub release. ## Static Builds -The information above corresponds to deploying the dynamically build version of MNE-CPP. In case of static deployment the process differs a bit. See the [deploy.bat](https://github.com/mne-tools/mne-cpp/blob/main/tools/deployment/deploy.bat){:target="_blank" rel="noopener"} file. +The information above corresponds to deploying the dynamically build version of MNE-CPP. In case of static deployment the process differs a bit. See the [deploy.sh.bat](https://github.com/mne-tools/mne-cpp/blob/main/tools/deployment/deploy.sh.bat){:target="_blank" rel="noopener"} file. -## Deployment script `deploy.bat` -The script used by MNE-CPP to perform the deployment in the three platforms to which MNE-CPP is compiled is the same `deploy.bat` file, which is inside `tools/deployment` folder. The script will run in all platforms and generate the necesary libraries for the correct execution of any of the project's applications. This script can be run from anywhere in the file system, but do not change the script's location within the project's folder structure, since it depends on it for a correct execution. ```deploy.bat``` takes two input arguments: the first argument specifies the type of linkage to use in the project's applications. The second argument specifies if a compressed folder (zip, tar, ...) should be created with all the necessary files to run the project's application. -The way this is achieved is by writing `deploy.bat` in a way in which different operating systems running the same script will actually execute different parts of it. If you take a look at its contents it is easy to identify the parts executed by each operating system because they are marked with comments. +## Deployment script `deploy.sh.bat` +The script used by MNE-CPP to perform the deployment in the three platforms to which MNE-CPP is compiled is the same `deploy.sh.bat` file, which is inside `tools/deployment` folder. The script will run in all platforms and generate the necesary libraries for the correct execution of any of the project's applications. This script can be run from anywhere in the file system, but do not change the script's location within the project's folder structure, since it depends on it for a correct execution. ```deploy.sh.bat``` takes two input arguments: the first argument specifies the type of linkage to use in the project's applications. The second argument specifies if a compressed folder (zip, tar, ...) should be created with all the necessary files to run the project's application. +The way this is achieved is by writing `deploy.sh.bat` in a way in which different operating systems running the same script will actually execute different parts of it. If you take a look at its contents it is easy to identify the parts executed by each operating system because they are marked with comments. Independently of the type of linkage needed during the deployment, the script is just one script which depends on a couple of input arguments. A first input argument accepts either ```dynamic``` or ```static``` in order to decide which type of linkage to perform. If empty, the linkage option will be set to ```dynamic```. This script can be useful during development. Since it allows a developer to solve the dependencies a particular MNE-CPP application might have by providing the necessary libraries. For this reasons the script has a second input argument. If the second input argument is ```pack``` the script will generate the above mentioned zip/tar file with the binary executable files and libraries needed for a correct execution. \ No newline at end of file From bf6b8ebec8c2065408427e225f40c7aa4d92c747 Mon Sep 17 00:00:00 2001 From: juangpc Date: Tue, 3 Aug 2021 01:57:31 -0400 Subject: [PATCH 8/8] add new build script --- tools/deployment/build.sh.bat | 451 ++++++++++++++++++++++++++++++++++ 1 file changed, 451 insertions(+) create mode 100644 tools/deployment/build.sh.bat diff --git a/tools/deployment/build.sh.bat b/tools/deployment/build.sh.bat new file mode 100644 index 00000000000..c478becd89f --- /dev/null +++ b/tools/deployment/build.sh.bat @@ -0,0 +1,451 @@ +:;# This script performs generates and copies the necesary library dependencies for running qt-projects both for +:;# dynamic and for staic builds. +:;# +:;# This file is part of the MNE-CPP project. For more information visit: https://mne-cpp.github.io/ +:;# +:;# This script is based on an open-source cross-platform script template. +:;# For more information you can visit: https://github.com/juangpc/multiplatform_bash_cmd +:;# + +:</dev/null 2>&1 + pwd -P + )" + BASE_PATH=${SCRIPT_PATH}/../.. + + if [ -z ${LINK_OPTION} ]; then + LINK_OPTION=dynamic + fi + + if [[ ${LINK_OPTION} == dynamic ]]; then + + cd ${BASE_PATH} + + # Call macdeployqt on all .app bundles in the bin folder + for f in ./bin/*.app; do $Qt5_DIR/bin/macdeployqt $f ; done + + # Solve for dependencies for mne_scan.app bundle + cp -a bin/mne_scan_plugins/. bin/mne_scan.app/Contents/MacOS/mne_scan_plugins + cp -a bin/resources/. bin/mne_scan.app/Contents/MacOS/resources + cp -a applications/mne_scan/plugins/brainflowboard/brainflow/installed/lib/. bin/mne_scan.app/Contents/Frameworks + cp -a applications/mne_scan/plugins/lsladapter/liblsl/build/install/lib/. bin/mne_scan.app/Contents/Frameworks + cp -a lib/. bin/mne_scan.app/Contents/Frameworks + # cp -a $Qt5_DIR/plugins/renderers/. bin/mne_scan.app/Contents/PlugIns/renderers + + # Solve for dependencies for mne_analyze.app bundle + cp -a bin/mne_analyze_plugins/. bin/mne_analyze.app/Contents/MacOS/mne_analyze_plugins + cp -a bin/resources/. bin/mne_analyze.app/Contents/MacOS/resources + cp -a lib/. bin/mne_analyze.app/Contents/Frameworks + # cp -a $Qt5_DIR/plugins/renderers/. bin/mne_analyze.app/Contents/PlugIns/renderers + + # Solve for dependencies for mne_rt_server.app bundle + cp -a bin/mne_rt_server_plugins/. bin/mne_rt_server.app/Contents/MacOS/mne_rt_server_plugins + cp -a bin/resources/. bin/mne_rt_server.app/Contents/MacOS/resources + cp -a lib/. bin/mne_rt_server.app/Contents/Frameworks + + # Solve for dependencies for mne_forward_solution.app bundle + cp -a bin/resources/. bin/mne_forward_solution.app/Contents/MacOS/resources + cp -a lib/. bin/mne_forward_solution.app/Contents/Frameworks + + # Solve for dependencies for mne_dipole_fit.app bundle + cp -a bin/resources/. bin/mne_dipole_fit.app/Contents/MacOS/resources + cp -a lib/. bin/mne_dipole_fit.app/Contents/Frameworks + + # Solve for dependencies for mne_anonymize.app bundle + cp -a bin/resources/. bin/mne_anonymize.app/Contents/MacOS/resources + cp -a lib/. bin/mne_anonymize.app/Contents/Frameworks + + + if [[ ${PACK_OPTION} == pack ]]; then + + # Delete folders which we do not want to ship + rm -r bin/mne-cpp-test-data + rm -r bin/mne_scan_plugins + rm -r bin/mne_analyze_plugins + rm -r bin/mne_rt_server_plugins + rm -r bin/resources + + # Creating archive of all macos deployed applications + tar cfvz mne-cpp-macos-dynamic-x86_64.tar.gz bin/. + fi + + + elif [[ ${LINK_OPTION} == static ]]; then + + cd ${BASE_PATH} + + # This script needs to be run from the top level mne-cpp repo folder + # Solve for dependencies for mne_scan.app bundle + cp -a bin/resources/. bin/mne_scan.app/Contents/MacOS/resources + + # Solve for dependencies for mne_analyze.app bundle + cp -a bin/resources/. bin/mne_analyze.app/Contents/MacOS/resources + + # Solve for dependencies for mne_rt_server.app bundle + cp -a bin/resources/. bin/mne_rt_server.app/Contents/MacOS/resources + + # Solve for dependencies for mne_forward_solution.app bundle + cp -a bin/resources/. bin/mne_forward_solution.app/Contents/MacOS/resources + + # Solve for dependencies for mne_dipole_fit.app bundle + cp -a bin/resources/. bin/mne_dipole_fit.app/Contents/MacOS/resources + + # Solve for dependencies for mne_anonymize.app bundle + cp -a bin/resources/. bin/mne_anonymize.app/Contents/MacOS/resources + + if [[ ${PACK_OPTION} == pack ]]; then + # Delete folders which we do not want to ship + rm -r bin/mne-cpp-test-data + rm -r bin/mne_scan_plugins + rm -r bin/mne_analyze_plugins + rm -r bin/mne_rt_server_plugins + rm -r bin/resources + + # Creating archive of all macos deployed applications + tar cfvz mne-cpp-macos-static-x86_64.tar.gz bin/. + fi + + else + echo "Input argument link_option is invalid." + echo "Input argument link_option is set to ${LINK_OPTION}." + echo "Use: static or dynamic" + fi + + # ############## MAC SECTION ENDS ###################### + # ###################################################### + +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + + # ###################################################### + # ############## LINUX SECTION ######################### + + cloneRepo() + { + local REPO= + local FOLDER= + local CLONE_SUBMODULES=FALSE + + while [[ $# -gt 0 ]] + do + key="$1" + case $key in + --repo) + REPO=$2 + shift + shift + ;; + --cdIntoFolder) + FOLDER=$2 + shift + shift + ;; + --clone-submodules) + CLONE_SUBMODULES=TRUE + shift + ;; + esac + done + + if [[ -z $REPO ]]; then + exit 1 + else + printf '\nCloning repository.' + git clone $REPO + printf '\nCloning repository OK.\n' + fi + + if [[ ! -z $FOLDER ]]; then + printf CD into ${FOLDER} + cd $FOLDER + fi + + if [[ $CLONE_SUBMODULES == TRUE ]]; then + printf 'Cloning submodules\n' + git submodule update --init applications/mne_scan/plugins/brainflowboard/brainflow + git submodule update --init applications/mne_scan/plugins/lsladapter/liblsl + fi + + } + + installQt() + { + sudo apt-get install build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev -y + + } + + BuildBrainFlowSubmodule() + { + + } + + BuildLSLSubmodule() + { + + } + + BuildMNECPP() + { + + } + + + #parse input arguments + LINK_OPTION= + QT_VERSION= + PACK_OPTION=FALSE + CLONE_SUBMODULES=FALSE + SCRIPT_PATH="$( + cd "$(dirname "$0")" >/dev/null 2>&1 + pwd -P + )" + BASE_PATH=${SCRIPT_PATH}/../.. + + while [[ $# -gt 0 ]] + do + key="$1" + case $key in + --link) + LINK_OPTION=$2 + shift + shift + ;; + --QTversion) + QT_VERSION=$2 + shift + shift + ;; + --pack) + PACK_OPTION=TRUE + shift + ;; + --clone_submodules) + CLONE_SUBMODULES=TRUE + shift + ;; + esac + done + + if [ -z ${QT_VERSION} ]; then + printf '\nInput argument with the Qt version is undefined. \nUse, for example: $ bash ./pullrequest.sh.bat 5.12.5 pack\n' + printf 'in order to compile that qt version and pack the resulting folder in a tar file.\n\n\n' + fi + + + if [[ ${PACK_OPTION} == TRUE ]]; then + printf 'Pero que paisaaa!\n' + fi + + if [[ ${LINK_OPTION} == dynamic ]]; then + + #Clone repository + # cloneRepo --repo https://github.com/mne-tools/mne-cpp.git --cdIntoFolder mne-cpp --clone-submodules + cloneRepo --cdIntoFolder mne-cpp --clone-submodules + + #install python 3.8 + #sudo apt-get install python3.8 --yes + + #Install Qt + # installQt + + # sudo apt-get update + # sudo apt-get install build-essential libgl1-mesa-dev libicu55 + + + # #install jom only windows. + # # installjom + + # BuildBrainFlowSubmodule + + # BuildLSLSubmodule + + # BuildMNECPP + + fi + + + + + + + + + + + + # # Copy additional brainflow libs + # cp -a ${BASE_PATH}/applications/mne_scan/plugins/brainflowboard/brainflow/installed/lib/. ${BASE_PATH}/lib/ + + # # Copy additional LSL libs + # cp -a ${BASE_PATH}/applications/mne_scan/plugins/lsladapter/liblsl/build/install/lib/. ${BASE_PATH}/lib/ + + # # Install some additional packages so linuxdeployqt can find them + # sudo apt-get update + # sudo apt-get install libxkbcommon-x11-0 + # sudo apt-get install libxcb-icccm4 + # sudo apt-get install libxcb-image0 + # sudo apt-get install libxcb-keysyms1 + # sudo apt-get install libxcb-render-util0 + # sudo apt-get install libbluetooth3 + # sudo apt-get install libxcb-xinerama0 + # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/ + + # cd ${BASE_PATH} + + # # Downloading linuxdeployqt from continious release + # wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" + # sudo chmod a+x linuxdeployqt-continuous-x86_64.AppImage + + # # Creating a directory for linuxdeployqt to create results + # sudo mkdir -p -m777 mne-cpp + + # # Copying built data to folder for easy packaging + # cp -r ${BASE_PATH}/bin ${BASE_PATH}/lib ${BASE_PATH}/mne-cpp/ + + # # linuxdeployqt uses mne_scan and mne_analyze binary to resolve dependencies + # cd ${BASE_PATH}/mne-cpp + # ../linuxdeployqt-continuous-x86_64.AppImage bin/mne_scan -verbose2 -extra-plugins=renderers + # ../linuxdeployqt-continuous-x86_64.AppImage bin/mne_analyze -verbose2 -extra-plugins=renderers + + # # Manually copy in the libxcb-xinerama library which is needed by plugins/platforms/libxcb.so + # cp /usr/lib/x86_64-linux-gnu/libxcb-xinerama.so.0 ${BASE_PATH}/mne-cpp/lib/ + + # if [[ ${PACK_OPTION} == pack ]]; then + # echo + # echo ldd ./bin/mne_scan + # ldd ./bin/mne_scan + + # echo + # echo ldd ./plugins/platforms/libqxcb.so + # ldd ./plugins/platforms/libqxcb.so + + # # Delete folders which we do not want to ship + # rm -r bin/mne-cpp-test-data + + # # Creating archive of everything in current directory + # tar cfvz ../mne-cpp-linux-dynamic-x86_64.tar.gz ./* + # fi + # rm -fr mne-cpp + + + # elif [[ ${LINK_OPTION} == static ]]; then + + # cd ${BASE_PATH} + + # sudo apt-get update + # sudo apt-get install libxkbcommon-x11-0 + # sudo apt-get install libxcb-icccm4 + # sudo apt-get install libxcb-image0 + # sudo apt-get install libxcb-keysyms1 + # sudo apt-get install libxcb-render-util0 + # sudo apt-get install libbluetooth3 + # sudo apt-get install libxcb-xinerama0 + # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/ + + # # Downloading linuxdeployqt from continious release + # wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" + # sudo chmod a+x linuxdeployqt-continuous-x86_64.AppImage + + # # Creating a directory for linuxdeployqt to create results + # sudo mkdir -p -m777 mne-cpp + + # # Copying built data to folder for easy packaging + # cp -r ./bin ./lib mne-cpp/ + + # # linuxdeployqt uses mne_scan and mne_analyze binary to resolve dependencies + # cd mne-cpp + # ../linuxdeployqt-continuous-x86_64.AppImage bin/mne_scan -verbose2 -extra-plugins=renderers + # ../linuxdeployqt-continuous-x86_64.AppImage bin/mne_analyze -verbose2 -extra-plugins=renderers + + # echo + # echo ldd ./bin/mne_scan + # ldd ./bin/mne_scan + + # # Delete folders which we do not want to ship + # rm -r bin/mne_rt_server_plugins + # rm -r bin/mne-cpp-test-data + # rm -r bin/mne_scan_plugins + # rm -r bin/mne_analyze_plugins + + # if [[ ${PACK_OPTION} == pack ]]; then + # # Creating archive of everything in the bin directory + # tar cfvz ../mne-cpp-linux-static-x86_64.tar.gz bin/. lib/. + # fi + + # rm -fr mne-cpp + + # else + # echo "Input argument link_option is invalid." + # echo "Input argument link_option is set to ${LINK_OPTION}." + # echo "Use: static or dynamic" + # fi + + # ############## LINUX SECTION ENDS #################### + # ###################################################### + +fi + +exit 0 +