Skip to content

Commit

Permalink
Merge branch 'viewer'
Browse files Browse the repository at this point in the history
* viewer:
  Implement BUILD_WIN_STANDALONE option for Windows standalone builds
  Install library dependencies for Windows builds
  Add placeholder input and checkbox tooltips for emv-viewer
  Add CMake display name and description for emv_viewer_runtime component
  Update Github Actions workflow for Fedora builds
  Let emv-viewer use relative data path for MacOS and Windows builds
  Fix whitespace
  Install iso-codes and mcc-codes for MacOS and Windows packages
  Update README
  Fix code signing of targets for MacOS release builds
  Fix packaging for MacOS release builds
  Use self-signed openemv.org code signing certificate for MacOS
  Update MacOS release builds to use MacOS 13
  Update Github Actions
  Upload build directory if Github Action fails
  Improve CMake messages for Qt
  Add icons for emv-viewer
  Add CMake component dependency for emv_viewer_runtime on emv_runtime
  Deploy Qt into MacOS bundle and Windows installer
  Add CPack package generator for DragNDrop on MacOS
  Add CPack package generator for NSIS on Windows
  Update Github Actions for MacOS and Windows release builds
  Fix Qt6 QByteArray to QString conversion for emv-viewer
  Highlight input bytes when clicking tree item in emv-viewer
  Use monospace font for hex data in emv-viewer
  Implement --ber and --tlv options for emv-viewer
  Implement --isocodes-path and --mcc-json options for emv-viewer
  Show description when clicking tree item in emv-viewer
  Improve EmvHighlighter to emphasise tags
  Improve EmvHighlighter to highlight non-hex digits
  Improve EmvHighlighter to avoid unnecessary parsing
  Implement ignore padding checkbox for emv-viewer
  Improve EmvTreeItem rendering of field strings
  Implement EMV decode checkbox for emv-viewer
  Implement EmvTreeView for emv-viewer
  Implement EmvTreeItem for emv-viewer
  Implement basic EMV decoder for emv-viewer
  Implement basic tree view for emv-viewer
  Implement basic EMV highlighter for emv-viewer
  Implement timer to bundle tree view updates for emv-viewer
  Allow emv-viewer links to open using a browser
  Update Github Actions
  Initial layout for emv-viewer sub-project
  • Loading branch information
leonlynch committed Nov 16, 2024
2 parents 586c3c2 + 266013e commit 29a653b
Show file tree
Hide file tree
Showing 40 changed files with 3,583 additions and 36 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/fedora-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
matrix:
include:
- { name: "Fedora 40", fedora_version: 40, deps: "none", build_emv_tool: NO }
- { name: "Fedora 40", fedora_version: 40, deps: "pcsclite", build_emv_tool: YES }
- { name: "Fedora 41", fedora_version: 41, deps: "pcsclite", build_emv_tool: YES }
- { name: "Fedora 40", fedora_version: 40, deps: "pcsclite/qt", build_emv_tool: YES }
- { name: "Fedora 41", fedora_version: 41, deps: "pcsclite/qt", build_emv_tool: YES }

name: ${{ matrix.name }} build (static/debug/${{ matrix.deps }})
runs-on: ubuntu-latest
Expand All @@ -31,6 +31,10 @@ jobs:
if: contains(matrix.deps, 'pcsclite')
run: sudo dnf -y install pcsc-lite-devel

- name: Install Qt5
if: contains(matrix.deps, 'qt')
run: sudo dnf -y install qt5-qtbase-devel

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -45,7 +49,12 @@ jobs:
git describe --always --dirty
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug" -DBUILD_EMV_TOOL=${{ matrix.build_emv_tool }}
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="Debug" \
-DBUILD_EMV_DECODE=YES \
-DBUILD_EMV_TOOL=${{ matrix.build_emv_tool }} \
-DBUILD_EMV_VIEWER=${{ matrix.build_emv_viewer }}
- name: Build
run: cmake --build build
Expand All @@ -68,7 +77,7 @@ jobs:
steps:
- name: Install build tools and dependencies
run: |
sudo dnf -y install git gh cmake gcc g++ boost-devel iso-codes-devel json-c-devel pcsc-lite-devel bash-completion doxygen rpm-build
sudo dnf -y install git gh cmake gcc g++ boost-devel iso-codes-devel json-c-devel pcsc-lite-devel bash-completion doxygen rpm-build qt5-qtbase-devel
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -88,7 +97,16 @@ jobs:
run: echo "GIT_DESCRIBE=$(git describe --always --dirty)" >> $GITHUB_ENV

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=YES -DBUILD_DOCS=YES -DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=YES \
-DBUILD_DOCS=YES \
-DBUILD_EMV_DECODE=YES \
-DBUILD_EMV_TOOL=YES \
-DBUILD_EMV_VIEWER=YES \
-DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE
- name: Build
run: cmake --build build
Expand Down
108 changes: 103 additions & 5 deletions .github/workflows/macos-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ jobs:
fail-fast: false
matrix:
include:
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Debug", lib_type: "static", shared_libs: "NO", deps: "none", fetch_deps: YES, build_emv_tool: NO }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Release", lib_type: "shared", shared_libs: "YES", deps: "pcsclite", fetch_deps: NO, build_emv_tool: YES }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Release", lib_type: "static", shared_libs: "NO", deps: "none", fetch_deps: NO, build_emv_tool: NO }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Debug", lib_type: "shared", shared_libs: "YES", deps: "pcsclite", fetch_deps: YES, build_emv_tool: YES }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Debug", lib_type: "static", shared_libs: "NO", deps: "none", fetch_deps: YES, build_emv_tool: NO, build_emv_viewer: NO }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Debug", lib_type: "shared", shared_libs: "YES", deps: "pcsclite/qt5", fetch_deps: NO, build_emv_tool: YES, build_emv_viewer: YES }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Release", lib_type: "shared", shared_libs: "YES", deps: "pcsclite/qt6", fetch_deps: YES, build_emv_tool: YES, build_emv_viewer: YES }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Release", lib_type: "static", shared_libs: "NO", deps: "none", fetch_deps: NO, build_emv_tool: NO, build_emv_viewer: NO }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Release", lib_type: "shared", shared_libs: "YES", deps: "pcsclite/qt5", fetch_deps: NO, build_emv_tool: YES, build_emv_viewer: YES }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Debug", lib_type: "static", shared_libs: "NO", deps: "pcsclite/qt6", fetch_deps: YES, build_emv_tool: YES, build_emv_viewer: YES }

name: ${{ matrix.name }} (${{ matrix.osx_arch }}) build (${{ matrix.lib_type}}/${{ matrix.build_type }}/${{ matrix.deps }})
runs-on: ${{ matrix.os }}
Expand All @@ -40,16 +42,112 @@ jobs:
brew install pcsc-lite
echo "PKG_CONFIG_PATH=$(brew --prefix pcsc-lite)/lib/pkgconfig" >> $GITHUB_ENV
- name: Install Qt5 using brew
# Homebrew doesn't support universal binaries so only install Qt for arch-specific builds
if: contains(matrix.deps, 'qt5')
run: |
brew install qt@5
echo "QT_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5" >> $GITHUB_ENV
- name: Install Qt6 using brew
# Homebrew doesn't support universal binaries so only install Qt for arch-specific builds
if: contains(matrix.deps, 'qt6')
run: |
brew install qt@6
echo "QT_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure CMake
run: cmake -B build -DCMAKE_OSX_ARCHITECTURES="${{ matrix.osx_arch }}" -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} -DFETCH_ARGP=${{ matrix.fetch_deps }} -DBUILD_EMV_TOOL=${{ matrix.build_emv_tool }}
run: |
cmake -B build \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.osx_arch }}" \
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} \
-DFETCH_ARGP=${{ matrix.fetch_deps }} \
-DBUILD_EMV_DECODE=YES \
-DBUILD_EMV_TOOL=${{ matrix.build_emv_tool }} \
-DBUILD_EMV_VIEWER=${{ matrix.build_emv_viewer }}
- name: Build
run: cmake --build build

- name: Test
run: ctest --test-dir build --output-on-failure

build-macos-release:
name: MacOS 13 (release)
runs-on: macos-13

steps:
- name: Install dependencies
run: |
brew install boost
brew install iso-codes
brew install json-c
brew install pcsc-lite
echo "PKG_CONFIG_PATH=$(brew --prefix pcsc-lite)/lib/pkgconfig" >> $GITHUB_ENV
brew install qt@5
echo "QT_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Get version from git tag
run: echo "GIT_DESCRIBE=$(git describe --always --dirty)" >> $GITHUB_ENV

- name: Prepare keychain
env:
OPENEMV_MACOS_CERT_BASE64: ${{ secrets.OPENEMV_MACOS_CERT_BASE64 }}
OPENEMV_MACOS_CERT_PWD: ${{ secrets.OPENEMV_MACOS_CERT_PWD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: scripts/prepare_macos_keychain.sh

- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DFETCH_ARGP=YES \
-DBUILD_EMV_DECODE=YES \
-DBUILD_EMV_TOOL=YES \
-DBUILD_EMV_VIEWER=YES \
-DBUILD_MACOSX_BUNDLE=YES \
-DCPACK_COMMAND_HDIUTIL="/usr/bin/sudo /usr/bin/hdiutil" \
-DSIGN_MACOSX_BUNDLE=openemv.org
- name: Build
run: cmake --build build

- name: Test
run: ctest --test-dir build --output-on-failure

- name: Package
run: cmake --build build --target package

- name: Clean up keychain
if: ${{ always() }}
run: scripts/cleanup_macos_keychain.sh

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: emv-utils-${{ env.GIT_DESCRIBE }}-macos
path: |
build/emv-utils-*.tar.gz
build/emv-utils-*.dmg
if-no-files-found: error

- name: Upload build directory if failed
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: emv-utils-${{ env.GIT_DESCRIBE }}-macos-build
path: ./
if-no-files-found: error
38 changes: 30 additions & 8 deletions .github/workflows/ubuntu-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ jobs:
fail-fast: false
matrix:
include:
- { name: "Ubuntu 20.04", os: ubuntu-20.04, deps: "none", iso8859: "simple", build_emv_tool: NO }
- { name: "Ubuntu 20.04", os: ubuntu-20.04, deps: "iconv", iso8859: "iconv", build_emv_tool: NO }
- { name: "Ubuntu 20.04", os: ubuntu-20.04, deps: "boost/pcsclite", iso8859: "boost", build_emv_tool: YES }
- { name: "Ubuntu 22.04", os: ubuntu-22.04, deps: "iconv/pcsclite", iso8859: "iconv", build_emv_tool: YES }
- { name: "Ubuntu 24.04", os: ubuntu-24.04, deps: "iconv/pcsclite", iso8859: "iconv", build_emv_tool: YES }
- { name: "Ubuntu 20.04", os: ubuntu-20.04, deps: "none", iso8859: "simple", build_emv_tool: NO, build_emv_viewer: NO }
- { name: "Ubuntu 20.04", os: ubuntu-20.04, deps: "iconv", iso8859: "iconv", build_emv_tool: NO, build_emv_viewer: NO }
- { name: "Ubuntu 20.04", os: ubuntu-20.04, deps: "boost/qt", iso8859: "boost", build_emv_tool: NO, build_emv_viewer: YES }
- { name: "Ubuntu 20.04", os: ubuntu-20.04, deps: "boost/pcsclite", iso8859: "boost", build_emv_tool: YES, build_emv_viewer: NO }
- { name: "Ubuntu 22.04", os: ubuntu-22.04, deps: "iconv/pcsclite", iso8859: "iconv", build_emv_tool: YES, build_emv_viewer: NO }
- { name: "Ubuntu 22.04", os: ubuntu-22.04, deps: "iconv/qt", iso8859: "iconv", build_emv_tool: NO, build_emv_viewer: YES }
- { name: "Ubuntu 24.04", os: ubuntu-24.04, deps: "iconv/pcsclite/qt", iso8859: "iconv", build_emv_tool: YES, build_emv_viewer: YES }

name: ${{ matrix.name }} build (static/debug/${{ matrix.deps }})
runs-on: ${{ matrix.os }}
Expand All @@ -34,14 +36,24 @@ jobs:
if: contains(matrix.deps, 'pcsclite')
run: sudo apt-get install -y libpcsclite-dev

- name: Install Qt5
if: contains(matrix.deps, 'qt')
run: sudo apt-get install -y qtbase5-dev

- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- run: git describe --always --dirty

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug" -DISO8859_IMPL=${{ matrix.iso8859 }} -DBUILD_EMV_TOOL=${{ matrix.build_emv_tool }}
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="Debug" \
-DISO8859_IMPL=${{ matrix.iso8859 }} \
-DBUILD_EMV_DECODE=YES \
-DBUILD_EMV_TOOL=${{ matrix.build_emv_tool }} \
-DBUILD_EMV_VIEWER=${{ matrix.build_emv_viewer }}
- name: Build
run: cmake --build build
Expand All @@ -65,7 +77,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libboost-locale-dev iso-codes libjson-c-dev libpcsclite-dev doxygen
sudo apt-get install -y libboost-locale-dev iso-codes libjson-c-dev libpcsclite-dev doxygen qtbase5-dev
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -81,7 +93,17 @@ jobs:
# intended Ubuntu release. The ppa1 component indicates that this is not
# an official Ubuntu package. The release name component indicates that
# this is for the specific Ubuntu release that has that name.
run: cmake -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=YES -DBUILD_DOCS=YES -DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE -DCPACK_DEBIAN_PACKAGE_RELEASE="0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1"
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=YES \
-DBUILD_DOCS=YES \
-DBUILD_EMV_DECODE=YES \
-DBUILD_EMV_TOOL=YES \
-DBUILD_EMV_VIEWER=YES \
-DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE \
-DCPACK_DEBIAN_PACKAGE_RELEASE="0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1"
- name: Build
run: cmake --build build
Expand Down
Loading

0 comments on commit 29a653b

Please sign in to comment.