-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
Showing
35 changed files
with
726 additions
and
97 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,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." |
This file contains 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,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)) |
This file contains 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 |
---|---|---|
@@ -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 |
This file contains 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 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,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) |
This file contains 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,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 |
This file contains 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
Oops, something went wrong.