-
Notifications
You must be signed in to change notification settings - Fork 30
build: add build instructions for Linux, MacOS and Windows #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
svenzik
wants to merge
1
commit into
main
Choose a base branch
from
WE2-1045
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,70 +257,83 @@ The extension's native app in `main.mm` is a thin adapter layer on top of the Qt | |
|
|
||
| You can examine the files in the `.github/workflows/` directory to see how continuous integration build environment has been set up for different operating systems. | ||
|
|
||
| ### Ubuntu Linux | ||
| ### Ubuntu Linux setup | ||
|
|
||
| Run all commands starting from `RUN apt-get update` from the following | ||
| `Dockerfile`: | ||
| Install dependecies | ||
|
|
||
| https://github.com/mrts/docker-qt-cmake-gtest-valgrind-ubuntu/blob/master/Dockerfile | ||
| apt update | ||
| apt install --no-install-recommends -y lsb-release build-essential devscripts debhelper pkg-config cmake libpcsclite-dev libssl-dev libgtest-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools | ||
|
|
||
| ### Windows | ||
| ### Linux Building and testing | ||
|
|
||
| git clone --recurse-submodules git@github.com:web-eid/web-eid-app.git | ||
| cd web-eid-app | ||
| ./build.sh | ||
| ./test.sh | ||
| ./build/src/app/web-eid -c get-signing-certificate '{"origin":"https://ria.ee"}' | ||
|
|
||
| ### Windows setup | ||
|
|
||
| - Download Visual Studio 2022 community installer from https://visualstudio.microsoft.com/ install _Visual Studio_ | ||
| with description "The most comprehensive IDE for .NET and C++ developers on Windows...". During installation choose components: | ||
|
|
||
| - NET desktop development | ||
| - Desktop development with C++ | ||
|
|
||
| - After install has finished, open Developer Command Prompt for VS 2022 and run commands given below | ||
| - If Nuget does not contain api.nuget.org as source, please add (https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source#examples) | ||
|
|
||
| dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org | ||
|
|
||
| - Download Visual Studio 2019 community installer from https://visualstudio.microsoft.com/ and install _Desktop C++ Development_ | ||
| - Install WIX toolset | ||
|
|
||
| dotnet tool install --global wix --version 5.0.0 | ||
| wix extension -g add WixToolset.UI.wixext/5.0.0 | ||
| wix extension -g add WixToolset.Util.wixext/5.0.0 | ||
| wix extension -g add WixToolset.Bal.wixext/5.0.0 | ||
| dotnet tool install --global wix --version 6.0.1 | ||
| wix extension -g add WixToolset.UI.wixext/6.0.1 | ||
| wix extension -g add WixToolset.Util.wixext/6.0.1 | ||
| wix extension -g add WixToolset.BootstrapperApplications.wixext/6.0.1 | ||
|
|
||
| - Download and install Git for Windows from https://git-scm.com/download/win | ||
| - Download and install CMake from https://cmake.org/download/ | ||
| - Install _vcpkg_ by running the following commands in Powershell: | ||
|
|
||
| git clone https://github.com/microsoft/vcpkg.git C:\vcpkg | ||
| cd C:\vcpkg | ||
| .\bootstrap-vcpkg.bat | ||
| .\vcpkg integrate install | ||
|
|
||
| - Install _Google Test_ and _OpenSSL_ with _vcpkg_: | ||
|
|
||
| .\vcpkg install --recurse --triplet x64-windows --clean-after-build gtest openssl | ||
|
|
||
| - Install _Qt_ with the official [_Qt Online Installer_](https://www.qt.io/download-qt-installer), | ||
| choose _Custom installation > Qt 6.6.3 > MSVC 2019 64-bit_. | ||
|
|
||
| ### macOS | ||
|
|
||
| - Install _Homebrew_ if not already installed: | ||
|
|
||
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | ||
|
|
||
| - Install _CMake_, _Google Test_, _OpenSSL_ and _Qt_ with _Homebrew_: | ||
|
|
||
| brew install cmake web-eid/gtest/gtest openssl qt@6 node | ||
|
|
||
| - Create symlink to _OpenSSL_ location and setup environment variables required | ||
| by _CMake_: | ||
|
|
||
| export OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 | ||
| export QT_DIR=/usr/local/opt/qt6/lib/cmake/Qt6 | ||
|
|
||
| ## Building and testing | ||
|
|
||
| git clone --recurse-submodules git@github.com:web-eid/web-eid-app.git | ||
| cd web-eid-app | ||
| ./build.sh | ||
| ./test.sh | ||
| ./build/src/app/web-eid -c get-signing-certificate '{"origin":"https://ria.ee"}' | ||
|
|
||
| ### Building and testing in Windows | ||
| - Install _Google Test_ and _OpenSSL_ with _vcpkg_. In order to install openssl version 1.* create a file C:\vcpkg\vpkg.json with content | ||
|
|
||
| { | ||
| "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | ||
| "builtin-baseline": "a62ce77d56ee07513b4b67de1ec2daeaebfae51a", | ||
| "dependencies": [ | ||
| "gtest", | ||
| "openssl" | ||
| ], | ||
| "overrides": [ | ||
| { | ||
| "name": "openssl", | ||
| "version": "1.1.1n" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OpenSSL 3.0 is minimum supported |
||
| } | ||
| ] | ||
| } | ||
|
|
||
| - Install packages: | ||
|
|
||
| .\vcpkg install --recurse --triplet x64-windows --clean-after-build --vcpkg-root C:\vcpkg | ||
|
|
||
| - Install _Qt_ with the official [_Qt Online Installer_](https://www.qt.io/download-qt-installer). | ||
| Installer requires you to create an account or log in with existing one. | ||
|
|
||
| Choose _Custom installation > Qt 6.9.3 > MSVC 2022 64-bit_. | ||
| Do not add cmake or ninja or any other component as they are already installed with Visual Studio 2022. | ||
|
|
||
| ### Windows building and testing | ||
|
|
||
| Use _Powershell_ to run the following commands to build the project. | ||
|
|
||
| - Set the _Qt_ installation directory variable: | ||
|
|
||
| $QT_ROOT = "C:\Qt\6.2.4\msvc2019_64" | ||
| $QT_ROOT = "C:\Qt\6.9.3\msvc2022_64" | ||
|
|
||
| - Set the _vcpkg_ installation directory variable: | ||
|
|
||
|
|
@@ -351,6 +364,25 @@ Optionally, WIX Toolset v3 is required for the installer, and the WIX environmen | |
|
|
||
| ctest -V -C ${BUILD_TYPE} --test-dir build | ||
|
|
||
| ### macOS setup | ||
|
|
||
| - Install _Homebrew_ if not already installed: | ||
|
|
||
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | ||
|
|
||
| - Install _CMake_, _Google Test_, _OpenSSL_ and _Qt_ with _Homebrew_: | ||
|
|
||
| brew install cmake gtest openssl@1.1 qt@6 node | ||
|
|
||
| ### macOS building and testing | ||
|
|
||
| git clone --recurse-submodules git@github.com:web-eid/web-eid-app.git | ||
| cd web-eid-app | ||
| ./build.zsh | ||
| ./test.sh | ||
| ./build/src/app/web-eid.app/Contents/MacOS/web-eid -c get-signing-certificate '{"origin":"https://ria.ee"}' | ||
|
|
||
|
|
||
| ## Adding and updating translations | ||
|
|
||
| You can use the free [Qt Linguist application](https://doc.qt.io/qt-5/qtlinguist-index.html) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #!zsh | ||
|
|
||
| set -e | ||
| set -u | ||
|
|
||
| BUILD_TYPE=RelWithDebInfo | ||
| BUILD_DIR=build | ||
| BUILD_NUMBER=1234 | ||
| OPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| GTest_ROOT=$(brew --prefix gtest) | ||
| CMAKE_BUILD_PARALLEL_LEVEL=3 | ||
| QT_QPA_PLATFORM=offscreen | ||
| MACOSX_DEPLOYMENT_TARGET=12.0 | ||
|
|
||
| - Create symlink to _OpenSSL_ location and setup environment variables required | ||
| by _CMake_: | ||
|
|
||
| export OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 | ||
| export QT_DIR=/usr/local/opt/qt6/lib/cmake/Qt6 | ||
| export QT_QPA_PLATFORM=offscreen | ||
|
|
||
| # For creating installers, you need to use signing certificates issued by Apple | ||
| # SIGNCERT=<apple developer certificate name> | ||
|
|
||
| if [[ ${1:-} == 'clean' ]]; then | ||
| echo -n Cleaning... | ||
| cmake --build build --target clean | ||
| rm -rf build | ||
| echo DONE | ||
| fi | ||
|
|
||
| if [[ -n "$SIGNCERT" ]]; then | ||
| cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -B ${BUILD_DIR} -DSIGNCERT="${SIGNCERT}" -S . | ||
| else | ||
| cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -B ${BUILD_DIR} -S . | ||
| fi | ||
|
|
||
| cmake --build ${BUILD_DIR} --config ${BUILD_TYPE} # -- VERBOSE=1 | ||
|
|
||
| # Uncomment in case SIGNCERT is set and you want to create installers | ||
| # To create web-eid installer for MacOS: build/src/app/web-eid*.dmg | ||
| # To create web-eid-webextension installer for firefox and chrome: build/src/app/web-eid*.pkg | ||
| # cmake --build ${BUILD_DIR} --config ${BUILD_TYPE} --target installer | ||
|
|
||
| # To create web-eid-webextension installer for safari build/src/mac/web-eid-safari_*.pkg | ||
| # cmake --build ${BUILD_DIR} --config ${BUILD_TYPE} --target installer-safari | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think git is also installed by visual studio