Skip to content

Commit

Permalink
Build Electrum-Ltc-Satochip v4.0.9-0.12 with Satochip v0.12 support
Browse files Browse the repository at this point in the history
- bump pysatochip lib to v0.12.3
- add support for new features: label & card authenticity
- Update dockerfile for windows & linux
- Update python to v3.8.8 (windows)
- Update pyscard to v2.0.0 & use Pypi repository
  • Loading branch information
Toporin committed Aug 10, 2021
1 parent 9d29da1 commit 88124c3
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 73 deletions.
36 changes: 27 additions & 9 deletions contrib/build-linux/appimage/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
# Note: we deliberately use an old Ubuntu LTS as base image.
# from https://docs.appimage.org/introduction/concepts.html :
# "[AppImages] should be built on the oldest possible system, allowing them to run on newer system[s]"
FROM ubuntu:16.04@sha256:a4fc0c40360ff2224db3a483e5d80e9164fe3fdce2a8439d2686270643974632

ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -q && \
apt-get install -qy \
git=1:2.7.4-0ubuntu1.9 \
git=1:2.7.4-0ubuntu1.10 \
wget=1.17.1-1ubuntu1.5 \
make=4.1-6 \
autotools-dev=20150820.1 \
autoconf=2.69-9 \
libtool=2.4.6-0.1 \
autopoint=0.19.7-2ubuntu3.1 \
xz-utils=5.1.1alpha+20120614-2ubuntu2 \
libssl-dev=1.0.2g-1ubuntu4.18 \
libssl1.0.0=1.0.2g-1ubuntu4.18 \
openssl=1.0.2g-1ubuntu4.18 \
libssl-dev=1.0.2g-1ubuntu4.19 \
libssl1.0.0=1.0.2g-1ubuntu4.19 \
openssl=1.0.2g-1ubuntu4.19 \
zlib1g-dev=1:1.2.8.dfsg-2ubuntu4.3 \
libffi-dev=3.2.1-4 \
libncurses5-dev=6.0+20160213-1ubuntu1 \
libpcsclite-dev=1.8.14-1ubuntu1.16.04.1 \
swig=3.0.8-0ubuntu3 \
libsqlite3-dev=3.11.0-1ubuntu1.5 \
libusb-1.0-0-dev=2:1.0.20-1 \
libudev-dev=229-4ubuntu21.29 \
libudev-dev=229-4ubuntu21.31 \
gettext=0.19.7-2ubuntu3.1 \
libzbar0=0.10+doc-10ubuntu1 \
libdbus-1-3=1.10.6-1ubuntu3.6 \
libxkbcommon-x11-0=0.5.0-1ubuntu2.1 \
libc6-dev=2.23-0ubuntu11.2 \
libpcsclite-dev \
swig \
libxcb1=1.11.1-1ubuntu1 \
libxcb-xinerama0=1.11.1-1ubuntu1 \
libxcb-randr0=1.11.1-1ubuntu1 \
libxcb-render0=1.11.1-1ubuntu1 \
libxcb-shm0=1.11.1-1ubuntu1 \
libxcb-shape0=1.11.1-1ubuntu1 \
libxcb-sync1=1.11.1-1ubuntu1 \
libxcb-xfixes0=1.11.1-1ubuntu1 \
libxcb-xkb1=1.11.1-1ubuntu1 \
libxcb-icccm4=0.4.1-1ubuntu1 \
libxcb-image0=0.4.0-1build1 \
libxcb-keysyms1=0.4.0-1 \
libxcb-util1=0.4.0-0ubuntu3 \
libxcb-render-util0=0.3.9-1 \
libx11-xcb1=2:1.6.3-1ubuntu2.2 \
libc6-dev=2.23-0ubuntu11.3 \
&& \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y && \
apt-get clean
apt-get clean
55 changes: 32 additions & 23 deletions contrib/build-wine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
FROM ubuntu:18.04@sha256:b58746c8a89938b8c9f5b77de3b8cf1fe78210c696ab03a1442e235eea65d84f
FROM ubuntu:20.04@sha256:c95a8e48bf88e9849f3e0f723d9f49fa12c5a00cfc6e60d2bc99d87555295e4c

ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

RUN dpkg --add-architecture i386 && \
apt-get update -q && \
apt-get install -qy \
wget=1.19.4-1ubuntu2.2 \
gnupg2=2.2.4-1ubuntu1.3 \
dirmngr=2.2.4-1ubuntu1.3 \
python3-software-properties=0.96.24.32.1 \
software-properties-common=0.96.24.32.1
wget=1.20.3-1ubuntu1 \
gnupg2=2.2.19-3ubuntu2.1 \
dirmngr=2.2.19-3ubuntu2.1 \
python3-software-properties=0.98.9.2 \
software-properties-common=0.98.9.2 \
&& \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y && \
apt-get clean

RUN apt-get update -q && \
apt-get install -qy \
git=1:2.17.1-1ubuntu0.7 \
p7zip-full=16.02+dfsg-6 \
make=4.1-9.1ubuntu1 \
mingw-w64=5.0.3-1 \
mingw-w64-tools=5.0.3-1 \
win-iconv-mingw-w64-dev=0.0.8-2 \
apt-get install -qy \
git=1:2.25.1-1ubuntu3 \
p7zip-full=16.02+dfsg-7build1 \
make=4.2.1-1.2 \
mingw-w64=7.0.0-2 \
mingw-w64-tools=7.0.0-2 \
win-iconv-mingw-w64-dev=0.0.8-3 \
autotools-dev=20180224.1 \
autoconf=2.69-11 \
autopoint=0.19.8.1-6ubuntu0.3 \
libtool=2.4.6-2 \
gettext=0.19.8.1-6
autoconf=2.69-11.1 \
autopoint=0.19.8.1-10build1 \
libtool=2.4.6-14 \
gettext=0.19.8.1-10build1 \
&& \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y && \
apt-get clean

RUN wget -nc https://dl.winehq.org/wine-builds/Release.key && \
echo "c51bcb8cc4a12abfbd7c7660eaf90f49674d15e222c262f27e6c96429111b822 Release.key" | sha256sum -c - && \
Expand All @@ -36,11 +45,11 @@ RUN wget -nc https://dl.winehq.org/wine-builds/Release.key && \
apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ && \
apt-get update -q && \
apt-get install -qy \
wine-stable-amd64:amd64=4.0.3~bionic \
wine-stable-i386:i386=4.0.3~bionic \
wine-stable:amd64=4.0.3~bionic \
winehq-stable:amd64=4.0.3~bionic

RUN rm -rf /var/lib/apt/lists/* && \
wine-stable-amd64:amd64=6.0.0~focal-1 \
wine-stable-i386:i386=6.0.0~focal-1 \
wine-stable:amd64=6.0.0~focal-1 \
winehq-stable:amd64=6.0.0~focal-1 \
&& \
rm -rf /var/lib/apt/lists/* && \
apt-get autoremove -y && \
apt-get clean
2 changes: 1 addition & 1 deletion contrib/build-wine/deterministic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ binaries += [('C:/tmp/libusb-1.0.dll', '.')]
binaries += [('C:/tmp/libzbar-0.dll', '.')]

# pyscard binaries for Satochip
binaries += [('C:/python*/Lib/site-packages/smartcard/scard/_scard.cp37-win32.pyd', '.')] #satochip
binaries += [('C:/python*/Lib/site-packages/smartcard/scard/_scard.cp38-win32.pyd', '.')] #satochip

datas = [
(home+'electrum_ltc/*.json', 'electrum_ltc'),
Expand Down
22 changes: 12 additions & 10 deletions contrib/build-wine/prepare-wine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ LIBUSB_REPO="https://github.com/libusb/libusb.git"
LIBUSB_COMMIT="e782eeb2514266f6738e242cdcb18e3ae1ed06fa"
# ^ tag v1.0.23

PYINSTALLER_REPO="https://github.com/SomberNight/pyinstaller.git"
PYINSTALLER_COMMIT="6e455b2c1208465742484436009bfb1e1baf2e01"
# PYINSTALLER_REPO="https://github.com/SomberNight/pyinstaller.git"
# PYINSTALLER_COMMIT="6e455b2c1208465742484436009bfb1e1baf2e01"
# ^ tag 4.0, plus a custom commit that fixes cross-compilation with MinGW
PYINSTALLER_REPO='https://github.com/EchterAgo/pyinstaller.git'
PYINSTALLER_COMMIT=d6f3d02365ba68ffc84169c56c292701f346110e # Version 4.2 + a patch to drop an unused .rc file

# pyscard prebuilt binaries for Satochip
# PYSCARD_FILENAME=pyscard-1.9.9-cp36-cp36m-win32.whl # python 3.6, 32-bit
# PYSCARD_URL=https://github.com/cculianu/Electron-Cash-Build-Tools/releases/download/v1.0/pyscard-1.9.9-cp36-cp36m-win32.whl
# PYSCARD_SHA256=99d2b450f322f9ed9682fd2a99d95ce781527e371006cded38327efca8158fe7
PYSCARD_FILENAME=pyscard-1.9.9-cp37-cp37m-win32.whl # python 3.7, 32-bit
PYSCARD_URL=https://ci.appveyor.com/api/buildjobs/f9cmce4j8hkau9n4/artifacts/dist/pyscard-1.9.9-cp37-cp37m-win32.whl
PYSCARD_SHA256=3f7d52dd6694dd369b02e797fe1a3e39b63cf1d1c4b5fc0e1341aafa24f87e7a
# PYSCARD_FILENAME=pyscard-1.9.9-cp37-cp37m-win32.whl # python 3.7, 32-bit
# PYSCARD_URL=https://ci.appveyor.com/api/buildjobs/f9cmce4j8hkau9n4/artifacts/dist/pyscard-1.9.9-cp37-cp37m-win32.whl
# PYSCARD_SHA256=3f7d52dd6694dd369b02e797fe1a3e39b63cf1d1c4b5fc0e1341aafa24f87e7a

PYTHON_VERSION=3.7.9
PYTHON_VERSION=3.8.8

## These settings probably don't need change
export WINEPREFIX=/opt/wine64
Expand Down Expand Up @@ -78,10 +80,10 @@ $PYTHON -m pip install --no-dependencies --no-warn-script-location -r "$CONTRIB"


#Satochip install pyscard
info "Installing pyscard..."
download_if_not_exist $PYSCARD_FILENAME "$PYSCARD_URL"
verify_hash $PYSCARD_FILENAME "$PYSCARD_SHA256"
$PYTHON -m pip install "$CACHEDIR/$PYSCARD_FILENAME"
# info "Installing pyscard..."
# download_if_not_exist $PYSCARD_FILENAME "$PYSCARD_URL"
# verify_hash $PYSCARD_FILENAME "$PYSCARD_SHA256"
# $PYTHON -m pip install "$CACHEDIR/$PYSCARD_FILENAME"
info "Installing NSIS."
download_if_not_exist "$CACHEDIR/$NSIS_FILENAME" "$NSIS_URL"
verify_hash "$CACHEDIR/$NSIS_FILENAME" "$NSIS_SHA256"
Expand Down
23 changes: 14 additions & 9 deletions contrib/deterministic-build/requirements-hw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,20 @@ pyaes==1.6.1 \
pycparser==2.20 \
--hash=sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0 \
--hash=sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705
pysatochip==0.11.4 \
--hash=sha256:89ac8b7936c51c96a3fe4a7b4c602a4a4b20ea36a935cc43c268ddcbbd90203e \
--hash=sha256:263ff36484bd697999db1762dbd12e9fb89122b224f68065aed37dfbaa2920ca
pyscard==1.9.9 \
--hash=sha256:6620a74f58d5fa9076544263bb4e42c946eb20f315c896d14a7e5743d5431469 \
--hash=sha256:a047738c58d05b4dab15aa9c99fbd92f8d0670900de89c68bec247a422f8d8c7 \
--hash=sha256:c213a94585a48f8f1ff3c36c06fa3a162d2fd7f2c89240ac632bd38a3fa5df9b \
--hash=sha256:e6bde541990183858740793806b1c7f4e798670519ae4c96145f35d5d7944c20 \
--hash=sha256:99d2b450f322f9ed9682fd2a99d95ce781527e371006cded38327efca8158fe7
pyopenssl==20.0.0 \
--hash=sha256:898aefbde331ba718570244c3b01dcddb1b31a3b336613436a45e52e27d9a82d \
--hash=sha256:92f08eccbd73701cf744e8ffd6989aa7842d48cbe3fea8a7c031c5647f590ac5
pysatochip==0.12.3 \
--hash=sha256:b062fd0d86449f342515f141a11207e4c6665d5da31394ec48aa055869f51d0b \
--hash=sha256:24db358a65c0402c299c0c62efcfbbfc98e494181cd30d3996949ac667d5b4d4
pyscard==2.0.0 \
--hash=sha256:2abc34387ce5d1567a1052edc47797c1288739b51b664468d34ca77c9a3b05c2 \
--hash=sha256:59cb506e8e793c397f3014f0933752df8d00c97c9f3a3385698e77213423962f \
--hash=sha256:60dbc52f00da90e3428e987679723588598579a7c3c757e9937cecd6e381ddd2 \
--hash=sha256:6d6ddcf57f97b0899b952c1c0746177c4b4b52af2ca47eb4d6bd0b9096530181 \
--hash=sha256:73945cd5a8c6e2e4982ba24d70fdba9e1b4ca68b82169337f4733823f7b49fb6 \
--hash=sha256:852a4e354bb82cc1f68afb204349ca68ea6c5332242644a80651a5c62bb1ab5f \
--hash=sha256:b364d9d9186e793c1c4709eb72a4d29e09067d36ca463b2c2abd995bd1055779
requests==2.25.0 \
--hash=sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8 \
--hash=sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998
Expand Down
2 changes: 1 addition & 1 deletion contrib/requirements/requirements-hw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ hidapi
trezor[hidapi]>=0.12.0
safet>=0.1.5
pyscard>=1.9.9
pysatochip >=0.11.3
pysatochip >=0.12.3
keepkey>=6.3.1
btchip-python>=0.1.30
ckcc-protocol>=0.7.7
Expand Down
Loading

0 comments on commit 88124c3

Please sign in to comment.