== Project outline

YubiKey Manager is a Qt5 application written in QML that uses the plugin PyOtherSide to enable
the backend logic to be written in Python 3. The python library yubikey-manager is needed to
communicate with the YubiKey, and may be installed from pip or other package managers.
If a specific version (or branch or commit) is needed for development, point to that version
in requirements.txt

== Working with the code

=== Install dependencies

It's assumed a Python environment with pip is installed.

==== Windows
Install https://www.qt.io/download[Qt5]. Build and install the Qt5 plugin http://pyotherside.readthedocs.io/en/latest/#building-pyotherside[PyOtherSide].
Make sure the http://www.swig.org/[swig] executable is in your PATH.

==== macOS

    $ brew install python3 swig qt
    # Allow access to qmake - see https://superuser.com/a/1153338/104372
    $ brew link qt --force

Build and install the Qt5 plugin http://pyotherside.readthedocs.io/en/latest/#building-pyotherside[PyOtherSide].

==== Linux (Debian-based distributions)

    $ sudo add-apt-repository -y ppa:yubico/stable
    $ sudo apt update
    $ sudo apt install \
      libqt5svg5-dev \
      python3-yubikey-manager \
      qml-module-io-thp-pyotherside \
      qml-module-qt-labs-calendar \
      qml-module-qt-labs-folderlistmodel \
      qml-module-qt-labs-platform \
      qml-module-qt-labs-settings \
      qml-module-qtgraphicaleffects \
      qml-module-qtquick-controls2 \
      qml-module-qtquick-dialogs \
      qml-module-qtquick-layouts \
      qml-module-qtquick-window2 \
      qml-module-qtquick2 \
      qt5-default \
      qtbase5-dev \
      qtdeclarative5-dev \
      qtquickcontrols2-5-dev

==== Linux (Fedora 29)

    $ sudo dnf install make python \
      libyubikey python3-yubikey-manager \
      qt5-devel qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtquickcontrols2-devel \
      qt5-qtquickcontrols qt5-qtgraphicaleffects pyotherside

=== Setup the repository

    $ git clone https://github.com/Yubico/yubikey-manager-qt.git
    $ cd yubikey-manager-qt

=== Compile the app

On Windows, macOS & Debian-based Linux distributions:

    $ qmake && make

On Fedora 29:

    $ qmake-qt5 && make

=== Run the app

    $ ./ykman-gui/ykman-gui

=== Code Style & Linting

This project uses http://flake8.pycqa.org/[Flake8] (for the python parts) and qmllint
(for the QML parts) for code style with a http://pre-commit.com/[pre-commit] hook.

To use these:

    $ pip install pre-commit flake8
    $ pre-commit install

=== Packaging

For third-party packaging, use the source releases and signatures available https://developers.yubico.com/yubikey-manager-qt/Releases/[here].
