Skip to content

Commit

Permalink
Merge pull request #231 from Yubico/pyotherside-actions
Browse files Browse the repository at this point in the history
Bumped pyotherside and python for all OS
  • Loading branch information
fdennis authored Jan 29, 2020
2 parents 85eb2aa + 5b67bf4 commit 9ad2562
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 35 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ name: macOS

on: [push, pull_request]

env:
PYTHON_VER: '3.7.6'
PYTHON_VER_SHORT: '3.7'
PYTHON_VER_SHORT_COMPACT: '37'
PYOTHERSIDE_VER: '1.5.9'

jobs:
build:

runs-on: macOS-10.14
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
Expand All @@ -18,20 +24,20 @@ jobs:
- name: Build custom Python as a framework
run: |
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
tar -xzvf Python-3.7.4.tgz
cd Python-3.7.4
wget https://www.python.org/ftp/python/${PYTHON_VER}/Python-${PYTHON_VER}.tgz
tar -xzvf Python-${PYTHON_VER}.tgz
cd Python-${PYTHON_VER}
./configure CPPFLAGS="-I$(brew --prefix openssl@1.1)/include" LDFLAGS="-L$(brew --prefix openssl@1.1)/lib" MACOSX_DEPLOYMENT_TARGET=10.13 CC=clang --enable-framework --with-openssl=$(brew --prefix openssl@1.1) --enable-optimizations
sudo make altinstall
cd ..
- name: Download, build, install pyotherside QML plugin
run: |
wget https://github.com/thp/pyotherside/archive/1.5.8.tar.gz
tar -xzvf 1.5.8.tar.gz
echo "DEFINES += QT_NO_DEBUG_OUTPUT" >> pyotherside-1.5.8/src/src.pro
cd pyotherside-1.5.8
qmake PYTHON_CONFIG=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
wget https://github.com/thp/pyotherside/archive/${PYOTHERSIDE_VER}.tar.gz
tar -xzvf ${PYOTHERSIDE_VER}.tar.gz
echo "DEFINES += QT_NO_DEBUG_OUTPUT" >> pyotherside-${PYOTHERSIDE_VER}/src/src.pro
cd pyotherside-${PYOTHERSIDE_VER}
qmake PYTHON_CONFIG=/Library/Frameworks/Python.framework/Versions/${PYTHON_VER_SHORT}/bin/python${PYTHON_VER_SHORT}m-config
make
sudo make install
cd ..
Expand Down Expand Up @@ -63,19 +69,19 @@ jobs:
- name: Move python dependencies to site-packages (required by codesign)
run: |
rsync -a ykman-gui/ykman-gui.app/Contents/MacOS/pymodules/* ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/
rsync -a ykman-gui/ykman-gui.app/Contents/MacOS/pymodules/* ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/${PYTHON_VER_SHORT}/lib/python${PYTHON_VER_SHORT}/site-packages/
rm -rf ykman-gui/ykman-gui.app/Contents/MacOS/pymodules
- name: Point pyotherside to relative Python
run: |
sudo install_name_tool -change /Library/Frameworks/Python.framework/Versions/3.7/Python @executable_path/../Frameworks/Python.framework/Versions/3.7/Python ykman-gui/ykman-gui.app/Contents/PlugIns/quick/libpyothersideplugin.dylib
sudo install_name_tool -change /Library/Frameworks/Python.framework/Versions/${PYTHON_VER_SHORT}/Python @executable_path/../Frameworks/Python.framework/Versions/${PYTHON_VER_SHORT}/Python ykman-gui/ykman-gui.app/Contents/PlugIns/quick/libpyothersideplugin.dylib
- name: Point custom Python share objects to relative openssl (from brew)
run: |
sudo install_name_tool -change /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib @executable_path/../Frameworks/libssl.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_hashlib.cpython-37m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib @executable_path/../Frameworks/libssl.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_hashlib.cpython-37m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/${PYTHON_VER_SHORT}/lib/python${PYTHON_VER_SHORT}/lib-dynload/_ssl.cpython-${PYTHON_VER_SHORT_COMPACT}m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib @executable_path/../Frameworks/libssl.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/${PYTHON_VER_SHORT}/lib/python${PYTHON_VER_SHORT}/lib-dynload/_ssl.cpython-${PYTHON_VER_SHORT_COMPACT}m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/${PYTHON_VER_SHORT}/lib/python${PYTHON_VER_SHORT}/lib-dynload/_hashlib.cpython-${PYTHON_VER_SHORT_COMPACT}m-darwin.so
sudo install_name_tool -change /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib @executable_path/../Frameworks/libssl.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/Python.framework/Versions/${PYTHON_VER_SHORT}/lib/python${PYTHON_VER_SHORT}/lib-dynload/_hashlib.cpython-${PYTHON_VER_SHORT_COMPACT}m-darwin.so
sudo install_name_tool -change /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib ykman-gui/ykman-gui.app/Contents/Frameworks/libssl.1.1.dylib
- name: Point ykpers dependencies to relative dylibs
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: windows
name: windows 64bit

on: [push, pull_request]

Expand All @@ -9,7 +9,7 @@ env:
jobs:
build:

runs-on: windows-2019
runs-on: windows-latest

steps:
- uses: actions/checkout@v1
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Download dependencies
run: |
wget https://download.qt.io/official_releases/jom/jom.zip -OutFile jom.zip
wget https://github.com/thp/pyotherside/archive/1.5.3.zip -OutFile pyotherside-1.5.3.zip
wget https://github.com/thp/pyotherside/archive/1.5.9.zip -OutFile pyotherside-1.5.9.zip
wget https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0-win64.zip -OutFile ykpers-1.20.0-win64.zip
wget https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0-win64.zip.sig -OutFile ykpers-1.20.0-win64.zip.sig
wget https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z -OutFile libusb-1.0.22.7z
Expand All @@ -33,7 +33,7 @@ jobs:

- name: Verify checksums of downloaded files
run: |
sha256sum -c ./.github/workflows/windows-libs.sha256sum
sha256sum -c ./.github/workflows/windows-x64-libs.sha256sum
gpg --no-default-keyring --keyring yubico --verify ykpers-1.20.0-win64.zip.sig ykpers-1.20.0-win64.zip
- name: Install swig
Expand All @@ -48,8 +48,8 @@ jobs:

- name: Download and prepare pyotherside
run: |
7z x pyotherside-1.5.3.zip
cd pyotherside-1.5.3
7z x pyotherside-1.5.9.zip
cd pyotherside-1.5.9
(Get-Content .\src\qmldir).replace('pyothersideplugin', 'pyothersideplugin1') | Set-Content .\src\qmldir
Clear-Content python.pri
Add-Content python.pri "PYTHON_CONFIG = python3-config`nQMAKE_LIBS += -LC:\hostedtoolcache\windows\Python\$env:PYTHON_VER\x64\libs -l$env:PYTHON_VER_DIRNAME`nQMAKE_CXXFLAGS += -IC:\hostedtoolcache\windows\Python\$env:PYTHON_VER\x64\include`n"
Expand All @@ -60,7 +60,7 @@ jobs:
run: |
set PATH=D:\a\yubikey-manager-qt\yubikey-manager-qt\5.13.1\msvc2017_64\bin;D:\a\yubikey-manager-qt\yubikey-manager-qt;%PATH%
call C:\"Program Files (x86)\Microsoft Visual Studio"\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x64
cd pyotherside-1.5.3
cd pyotherside-1.5.9
qmake
jom
jom install
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/windows-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
jobs:
build:

runs-on: windows-2019
runs-on: windows-latest

steps:
- uses: actions/checkout@v1
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Download dependencies
run: |
wget https://download.qt.io/official_releases/jom/jom.zip -OutFile jom.zip
wget https://github.com/thp/pyotherside/archive/1.5.3.zip -OutFile pyotherside-1.5.3.zip
wget https://github.com/thp/pyotherside/archive/1.5.9.zip -OutFile pyotherside-1.5.9.zip
wget https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0-win32.zip -OutFile ykpers-1.20.0-win32.zip
wget https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0-win32.zip.sig -OutFile ykpers-1.20.0-win32.zip.sig
wget https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z -OutFile libusb-1.0.22.7z
Expand All @@ -48,8 +48,8 @@ jobs:

- name: Unpack and prepare pyotherside
run: |
7z x pyotherside-1.5.3.zip
cd pyotherside-1.5.3
7z x pyotherside-1.5.9.zip
cd pyotherside-1.5.9
(Get-Content .\src\qmldir).replace('pyothersideplugin', 'pyothersideplugin1') | Set-Content .\src\qmldir
Clear-Content python.pri
Add-Content python.pri "PYTHON_CONFIG = python3-config`nQMAKE_LIBS += -LC:\hostedtoolcache\windows\Python\$env:PYTHON_VER\x86\libs -l$env:PYTHON_VER_DIRNAME`nQMAKE_CXXFLAGS += -IC:\hostedtoolcache\windows\Python\$env:PYTHON_VER\x86\include`n"
Expand All @@ -60,7 +60,7 @@ jobs:
run: |
set PATH=D:\a\yubikey-manager-qt\yubikey-manager-qt\5.13.1\msvc2017\bin;D:\a\yubikey-manager-qt\yubikey-manager-qt;%PATH%
call C:\"Program Files (x86)\Microsoft Visual Studio"\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x86
cd pyotherside-1.5.3
cd pyotherside-1.5.9
qmake
jom
jom install
Expand Down
16 changes: 8 additions & 8 deletions docker/xenial-appimage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ ENV LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRA
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& eval "$(pyenv init -)" \
&& pyenv update \
&& pyenv install --force 3.7.4 \
&& pyenv global 3.7.4 \
&& wget https://github.com/thp/pyotherside/archive/1.5.8.tar.gz \
&& tar -xzvf 1.5.8.tar.gz \
&& echo "DEFINES += QT_NO_DEBUG_OUTPUT" >> pyotherside-1.5.8/src/src.pro \
&& cd pyotherside-1.5.8/src \
&& pyenv install --force 3.8.1 \
&& pyenv global 3.8.1 \
&& wget https://github.com/thp/pyotherside/archive/1.5.9.tar.gz \
&& tar -xzvf 1.5.9.tar.gz \
&& echo "DEFINES += QT_NO_DEBUG_OUTPUT" >> pyotherside-1.5.9/src/src.pro \
&& cd pyotherside-1.5.9/src \
&& qmake \
&& make \
&& make install
COPY . yubikey-manager-qt
RUN mkdir -p yubikey-manager-qt/appDir/usr \
&& eval "$(pyenv init -)" \
&& pyenv global 3.7.4 \
&& pyenv global 3.8.1 \
&& cd yubikey-manager-qt \
&& pip3 install --upgrade pip \
&& pip3 install -r requirements.txt \
&& cp -R /root/.pyenv/versions/3.7.4/* appDir/usr \
&& cp -R /root/.pyenv/versions/3.8.1/* appDir/usr \
&& apt-get download libykpers-1-1 \
&& dpkg -x libykpers*.deb appDir/ \
&& qmake \
Expand Down

0 comments on commit 9ad2562

Please sign in to comment.