Skip to content

Commit

Permalink
Release 0.4.0
Browse files Browse the repository at this point in the history
- Update CLI version to ykman 0.5.0
- Now requires ykman version >= 0.5.0

New features:

- Now differentiates between disabled and unavailable features
- Added `--log-level` CLI option with same function as `--log-level` option to `ykman` version 0.5.0; see `ykman --help` for usage

Bugfixes:

- Made main view and Configure Connections dialog respond to resizing window
  • Loading branch information
emlun committed Dec 15, 2017
2 parents 94b48bf + 4296445 commit 9caa948
Show file tree
Hide file tree
Showing 35 changed files with 726 additions and 97 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ Makefile*
qrc_*.cpp
moc_*.cpp
ykman-cli/ykman
ykman-gui/moc_predefs.h
ykman-gui/ykman-gui
ykman-gui/ykman-gui.app/
ykman-cli/pymodules/
ykman-gui/pymodules/
.vagrant/
/VERSION
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]
then
docker build -t xenial -f docker/xenial/Dockerfile .
docker build -t ykman-xenial -f vendor/yubikey-manager/docker/xenial/Dockerfile vendor/yubikey-manager
id=$(docker create ykman-xenial)
docker cp $id:/yubikey-manager-debian-packages.tar.gz ykman-deb.tar.gz
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
Expand All @@ -31,7 +33,6 @@ before_install:
# Patch PyOtherSide to not be built with debug output
echo "DEFINES += QT_NO_DEBUG_OUTPUT" >> vendor/pyotherside/src/src.pro
fi
- pip install --upgrade pip
install:
- |
Expand All @@ -46,7 +47,6 @@ install:
eval "$(pyenv init -)"
env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang" pyenv install $PY_VERSION
pyenv global system $PY_VERSION
pip install --upgrade pip
# Build and install PyOtherside
cd vendor/pyotherside
qmake
Expand All @@ -55,6 +55,7 @@ install:
cd ../../
qmake
fi
- pip install --upgrade pip
# Install linting tools
- sudo pip install pre-commit flake8

Expand All @@ -69,7 +70,8 @@ script:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]
then
docker run xenial
docker build -t ykman-qt-xenial -f docker/xenial/Dockerfile .
docker run --rm -t ykman-qt-xenial
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
Expand Down Expand Up @@ -126,7 +128,7 @@ after_success:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]
then
id=$(docker create xenial)
id=$(docker create ykman-qt-xenial)
docker cp $id:/yubikey-manager-qt-debian-packages.tar.gz deploy/yubikey-manager-qt-$TRAVIS_BRANCH-deb.tar.gz
fi
Expand Down
9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
* Version 0.4.0
** Update CLI version to ykman 0.5.0
** Now requires ykman version >= 0.5.0
** Features:
*** Now differentiates between disabled and unavailable features
*** Added `--log-level` CLI option with same function as `--log-level` option to `ykman` version 0.5.0; see `ykman --help` for usage
** Bugfixes:
*** Made main view and Configure Connections dialog respond to resizing window

* Version 0.3.2 (released 2017-10-26)
** Update CLI version to ykman 0.4.6
** Enable NSSupportsAutomaticGraphicsSwitching in OS X
Expand Down
17 changes: 12 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ environment:
LIBU2F_HOST_VERSION: "1.1.3"
YKPERS_VERSION: "1.18.0"
LIBUSB_VERSION: "1.0.21"
PY_VERSION: "3.6.2"
PY_VERSION: "3.6.3"

init:
# Needed for jom to work.
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
# Add python and Qt to PATH
- set PATH=%PATH%;C:\Python36\Scripts;C:\Qt\5.9\msvc2015\bin;C:\Qt\Tools\QtCreator\bin;
- set PATH=C:\Python36;C:\Python36\Scripts;C:\Qt\5.9\msvc2015\bin;C:\Qt\Tools\QtCreator\bin;%PATH%
- python --version

install:
# Submodules are not cloned by default
Expand All @@ -37,12 +38,18 @@ install:
- cd %APPVEYOR_BUILD_FOLDER%

before_build:
# Fix problem with symbolic link
- rm .\vendor\yubikey-manager\ykman\yubicommon
- xcopy /i /e .\vendor\yubikey-manager\vendor\yubicommon\yubicommon .\vendor\yubikey-manager\ykman\yubicommon
# Clean up dirt from installing pyotherside
- git -C vendor/pyotherside reset --hard
- git -C vendor/pyotherside clean -dfx

build_script:

- qmake yubikey-manager-qt.pro
- qmake -o ykman-gui\Makefile ykman-gui\ykman-gui.pro

# Fix problem with symbolic link
- rm .\vendor\yubikey-manager\ykman\yubicommon
- xcopy /i /e .\vendor\yubikey-manager\vendor\yubicommon\yubicommon .\vendor\yubikey-manager\ykman\yubicommon
- jom

after_build:
Expand Down
26 changes: 26 additions & 0 deletions build-windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
SET "PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\x86"
SET "PATH=%PATH%;C:\Program Files (x86)\NSIS"

SET "ZIPFILE=%1"
SET "VERSION=%2"

echo "Deleting Z:\ykman-gui\release\"

Z:
rm -rf Z:\ykman-gui\release

echo "Extracting %ZIPFILE% to Z:\ykman-gui\release\"

7z -oykman-gui\release x "%ZIPFILE%"

echo "Signing executables"

signtool sign /fd SHA256 /t http://timestamp.verisign.com/scripts/timstamp.dll ykman-gui\release\ykman.exe
signtool sign /fd SHA256 /t http://timestamp.verisign.com/scripts/timstamp.dll ykman-gui\release\ykman-gui.exe

echo "Making installer"
makensis -D"VERSION=%VERSION%" resources\win\win-installer.nsi
signtool sign /fd SHA256 /t http://timestamp.verisign.com/scripts/timstamp.dll yubikey-manager-qt-%VERSION%-win.exe


echo "Please also sign the installer with PGP."
95 changes: 95 additions & 0 deletions compute-version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/usr/bin/python3
# Compute version number from Git tags in current working directory
#
# - If the current commit has a tag starting with "yubioath-desktop-":
# - The rest of that tag is the version number.
# - If this version number has only two parts (X.Y), append ".0".
#
# - If the current commit does not have a tag:
# - Find the closest ancestor commit with a tag starting with
# "yubioath-desktop-", and use the rest of the tag as the version number.
# - If this version number has three parts ending with zero (X.Y.0), remove
# the ".0".
# - Append ".Z-gCOMMIT", where Z is the number of commits since the tagged
# ancestor commit and COMMIT is the short commit ID of the current commit
# - This will always be different from the latest tagged version number, and
# will always be a prerelease version because of the "-gCOMMIT" suffix
#
# - Finally, if the repository has uncommitted or untracked changes, append
# "-dirty".
# - For the VERSIONINFO in the Windows resource file, reformat the version
# number "X.Y.Z[-gCOMMIT][-dirty]" to 4 numeric parts:
# - Discard the "-gCOMMIT" and "-dirty" suffixes if present
# - If the "-dirty" suffix was present, append ".0".
# - If the "-dirty" suffix was not present, append ".1".

import argparse
import os
import re
import subprocess
import sys


def compute_version(tag_prefix=None):
git_result = subprocess.run(
['git', 'describe',
'--tags',
'--dirty=-dirty',
] + (
['--match=%s*' % tag_prefix] if tag_prefix else []
),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True
)

if git_result.returncode is not 0:
raise ChildProcessError(git_result.stderr)

git_version = git_result.stdout.strip()

if tag_prefix:
# Remove tag prefix
git_version = re.sub(r'^' + tag_prefix, '', git_version)

# If version starts with 'X.Y-Z-g*', and X, Y and Z are numeric, reformat
# it to 'X.Y.Z-g*'
git_version = re.sub(
r'^([0-9]+\.[0-9]+)-([0-9]+)(-g.*)$', r'\1.\2\3',
git_version
)

# If version starts with 'X.Y.0-Z-g*', and X, Y and Z are numeric, reformat
# it to 'X.Y.Z-g*'
git_version = re.sub(
r'^([0-9]+\.[0-9]+)\.0-([0-9]+)(-g.*)$', r'\1.\2\3',
git_version
)

# If version is plain 'X.Y', append '.0'
git_version = re.sub(
r'^([0-9]+\.[0-9]+)(-dirty)?$', r'\1.0\2',
git_version
)

return git_version


if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Compute version number from Git tags',
add_help=True
)
parser.add_argument('-f', '--version-file',
action='store', dest='version_file',
help='Read version from VERSION_FILE if it exists')
parser.add_argument('tag_prefix',
action='store',
help='Prefix for git tags eligible as version tags')
args = parser.parse_args()

if args.version_file is not None and os.path.isfile(args.version_file):
with open(args.version_file) as f:
sys.stdout.write(f.read())
else:
print(compute_version(tag_prefix=args.tag_prefix))
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
yubikey-manager-qt (0.3.0~ppa1) xenial; urgency=low
yubikey-manager-qt (0.4.0) xenial; urgency=low

* Build for ppa

-- Dag Heyman <dag@yubico.com> Fri, 18 Nov 2016 14:14:54 +0100
-- Emil Lundberg <emil@yubico.com> Fri, 15 Dec 2017 15:36:55 +0100
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Build-Depends: debhelper (>= 9),
qml-module-qtquick-dialogs,
qml-module-io-thp-pyotherside,
libqt5svg5-dev,
yubikey-manager
yubikey-manager (>= 0.5.0~pre1)
Homepage: https://developers.yubico.com/yubikey-manager-qt/

Package: yubikey-manager-qt
Expand Down
74 changes: 74 additions & 0 deletions dev-util/build-mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash

# Exit on error
set -e

# Add qmake to PATH
export PATH="/usr/local/opt/qt/bin:$PATH"
PY_VERSION="3.6.3"
APP_DIR=ykman-gui/ykman-gui.app

VERSION=${TRAVIS_BRANCH:-$(python3 compute-version.py yubikey-manager-qt-)}

qmake
make

mkdir -p deploy/

# Exctract all user facing strings and create a textfile with them for deployment.
lupdate ykman-gui/ykman-gui.pro -ts ykman-gui.ts
cp ykman-gui.ts deploy/yubikey-manager-qt-$VERSION-strings.xml
macdeployqt "${APP_DIR}"/ -qmldir=ykman-gui/qml/

# Copy needed dylibs
find /usr/local/Cellar/json-c/ -name '*.dylib' -exec cp '{}' "${APP_DIR}"/Contents/Frameworks/ ';'
find /usr/local/Cellar/ykpers/ -name '*.dylib' -exec cp '{}' "${APP_DIR}"/Contents/Frameworks/ ';'
find /usr/local/Cellar/libyubikey/ -name '*.dylib' -exec cp '{}' "${APP_DIR}"/Contents/Frameworks/ ';'
find /usr/local/Cellar/hidapi/ -name '*.dylib' -exec cp '{}' "${APP_DIR}"/Contents/Frameworks/ ';'
find /usr/local/Cellar/libu2f-host/ -name '*.dylib' -exec cp '{}' "${APP_DIR}"/Contents/Frameworks/ ';'
find /usr/local/Cellar/libusb/ -name '*.dylib' -exec cp '{}' "${APP_DIR}"/Contents/Frameworks/ ';'
find /usr/local/Cellar/openssl/1.0.2m -name '*.dylib' -exec cp '{}' "${APP_DIR}"/Contents/Frameworks/ ';'

# Copy Python framework
cp -an ~/.pyenv/versions/$PY_VERSION/Python.framework "${APP_DIR}"/Contents/Frameworks/
find "${APP_DIR}"/Contents/Frameworks/Python.framework -name '*.pyc' -delete
find "${APP_DIR}"/Contents/Frameworks/Python.framework -name '__pycache__' -delete

# Move pymodules from app bundle to site-packages, to be accepted by codesign
mv "${APP_DIR}"/Contents/MacOS/pymodules/* "${APP_DIR}"/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ || echo 'Failure, but continuing anyway...'
rm -rf "${APP_DIR}"/Contents/MacOS/pymodules

# Add cli executable
cp ykman-cli/ykman "${APP_DIR}"/Contents/MacOS/

# Add pymodules from cli
cp -rn ykman-cli/pymodules/ "${APP_DIR}"/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/


# Fix Python library path (macdeployqtfix fails to do this when running locally)
install_name_tool -change /usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/Python @executable_path/../Frameworks/Python.framework/Versions/3.6/Python "${APP_DIR}"/Contents/PlugIns/quick/libpyothersideplugin.dylib

# Fix dylib writable permissions
find "${APP_DIR}" -name '*.dylib' -exec chmod u+w {} \;

# Fix stuff that macdeployqt does incorrectly.
python macdeployqtfix/macdeployqtfix.py "${APP_DIR}"/Contents/MacOS/ykman-gui /usr/local/Cellar/python3/$PY_VERSION/Frameworks
python macdeployqtfix/macdeployqtfix.py "${APP_DIR}"/Contents/MacOS/ykman /usr/local/Cellar/python3/$PY_VERSION/Frameworks

# Fix linking for PyOtherSide
install_name_tool -change ~/.pyenv/versions/$PY_VERSION/Python.framework/Versions/3.6/Python @executable_path/../Frameworks/Python.framework/Versions/3.6/Python "${APP_DIR}"/Contents/Resources/qml/io/thp/pyotherside/libpyothersideplugin.dylib

# Fix linking for Python _ssl
install_name_tool -change /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib @executable_path/../Frameworks/libcrypto.1.0.0.dylib "${APP_DIR}"/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so
install_name_tool -change /usr/local/opt/openssl/lib/libssl.1.0.0.dylib @executable_path/../Frameworks/libssl.1.0.0.dylib "${APP_DIR}"/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so

# Fix linking for Python _hashlib
install_name_tool -change /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib @executable_path/../Frameworks/libcrypto.1.0.0.dylib "${APP_DIR}"/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_hashlib.cpython-36m-darwin.so
install_name_tool -change /usr/local/opt/openssl/lib/libssl.1.0.0.dylib @executable_path/../Frameworks/libssl.1.0.0.dylib "${APP_DIR}"/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_hashlib.cpython-36m-darwin.so

# Copy .app to deploy dir
tar -czf deploy/yubikey-manager-qt-$VERSION.app.tar "${APP_DIR}"

# Test ykman-cli in .app bundle
cp ykman-cli/test.py "${APP_DIR}"/Contents/MacOS/
(cd "${APP_DIR}"/Contents/MacOS && ./test.py)
31 changes: 31 additions & 0 deletions dev-util/setup-mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Exit on error
set -e

PY_VERSION="3.6.2"
export MACOSX_DEPLOYMENT_TARGET=10.9

brew update
# Patch PyOtherSide to not be built with debug output
echo "DEFINES += QT_NO_DEBUG_OUTPUT" >> vendor/pyotherside/src/src.pro
pip3 install --upgrade pip

git clone https://github.com/aurelien-rainone/macdeployqtfix.git
brew install qt5 swig ykpers libyubikey hidapi libu2f-host libusb pyenv

# Add qmake to PATH
export PATH="/usr/local/opt/qt/bin:$PATH"

# Build Python 3 with --enable-framework, to be able to distribute it in a .app bundle
brew upgrade pyenv
eval "$(pyenv init -)"
env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang" pyenv install $PY_VERSION
pyenv global system $PY_VERSION
pip3 install --upgrade pip

# Build and install PyOtherside
cd vendor/pyotherside
qmake
make
sudo make install
cd ../../
qmake
11 changes: 8 additions & 3 deletions docker/xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ RUN apt-get install -qq \
qml-module-io-thp-pyotherside \
python3-pip \
python3-dev \
locales \
yubikey-manager
locales
RUN pip3 install --upgrade pip
COPY . yubikey-manager-qt
RUN tar xfa yubikey-manager-qt/ykman-deb.tar.gz
# Make sure .deb files exist
RUN ls /deb/python3-yubikey-manager_*.deb
RUN ls /deb/yubikey-manager_*.deb
RUN dpkg -i /deb/python3-yubikey-manager_*.deb; exit 0
RUN dpkg -i /deb/yubikey-manager_*.deb; exit 0
RUN apt-get install -f -qq
RUN cd yubikey-manager-qt && qmake -qt=qt5 && make
RUN cd yubikey-manager-qt && debuild -us -uc
RUN mkdir /deb
RUN mv /yubikey-manager-qt_* /deb
RUN cd / && tar czf yubikey-manager-qt-debian-packages.tar.gz deb
RUN locale-gen en_US.UTF-8
Expand Down
Loading

0 comments on commit 9caa948

Please sign in to comment.