2019-01-29 21:21:01 +01:00
#!/bin/bash
set -e
PROJECT_ROOT = " $( dirname " $( readlink -e " $0 " ) " ) /../../.. "
CONTRIB = " $PROJECT_ROOT /contrib "
2019-06-11 20:02:28 +02:00
CONTRIB_APPIMAGE = " $CONTRIB /build-linux/appimage "
2019-01-29 21:21:01 +01:00
DISTDIR = " $PROJECT_ROOT /dist "
2019-06-11 20:02:28 +02:00
BUILDDIR = " $CONTRIB_APPIMAGE /build/appimage "
2019-01-29 21:21:01 +01:00
APPDIR = " $BUILDDIR /electrum.AppDir "
2019-06-11 20:02:28 +02:00
CACHEDIR = " $CONTRIB_APPIMAGE /.cache/appimage "
2022-11-04 05:20:25 +00:00
export DLL_TARGET_DIR = " $CACHEDIR /dlls "
PIP_CACHE_DIR = " $CONTRIB_APPIMAGE /.cache/pip_cache "
2019-01-29 21:21:01 +01:00
2023-03-28 22:34:07 +00:00
. " $CONTRIB " /build_tools_util.sh
git -C " $PROJECT_ROOT " rev-parse 2>/dev/null || fail "Building outside a git clone is not supported."
2020-02-10 19:20:23 +01:00
export GCC_STRIP_BINARIES = "1"
2019-01-29 21:21:01 +01:00
# pinned versions
2025-06-05 13:23:30 +00:00
PYTHON_VERSION = 3.12.11
2025-05-30 16:22:26 +00:00
PY_VER_MAJOR = "3.12" # as it appears in fs paths
2022-04-25 21:04:46 +02:00
PKG2APPIMAGE_COMMIT = "a9c85b7e61a3a883f4a35c41c5decb5af88b6b5d"
2019-01-29 21:21:01 +01:00
2022-09-27 14:55:22 +00:00
VERSION = $( git describe --tags --dirty --always)
2019-01-29 21:21:01 +01:00
APPIMAGE = " $DISTDIR /electrum- $VERSION -x86_64.AppImage "
rm -rf " $BUILDDIR "
2022-11-04 05:20:25 +00:00
mkdir -p " $APPDIR " " $CACHEDIR " " $PIP_CACHE_DIR " " $DISTDIR " " $DLL_TARGET_DIR "
2019-01-29 21:21:01 +01:00
2019-07-19 04:52:26 +02:00
# potential leftover from setuptools that might make pip put garbage in binary
rm -rf " $PROJECT_ROOT /build "
2019-01-29 21:21:01 +01:00
info "downloading some dependencies."
download_if_not_exist " $CACHEDIR /functions.sh " " https://raw.githubusercontent.com/AppImage/pkg2appimage/ $PKG2APPIMAGE_COMMIT /functions.sh "
2022-04-25 21:04:46 +02:00
verify_hash " $CACHEDIR /functions.sh " "8f67711a28635b07ce539a9b083b8c12d5488c00003d6d726c7b134e553220ed"
2019-01-29 21:21:01 +01:00
2025-08-05 14:00:23 +00:00
download_if_not_exist " $CACHEDIR /appimagetool " "https://github.com/AppImage/AppImageKit/releases/download/13/obsolete-appimagetool-x86_64.AppImage"
2021-09-22 16:40:15 +02:00
verify_hash " $CACHEDIR /appimagetool " "df3baf5ca5facbecfc2f3fa6713c29ab9cefa8fd8c1eac5d283b79cab33e4acb"
2025-06-05 13:44:53 +00:00
# TODO migrate to https://github.com/AppImage/appimagetool/releases
# note: we will also have to build AppImage/type2-runtime, as otherwise new appimagetool just downloads "latest" from the internet.
# see https://github.com/AppImage/appimagetool/blob/7cfafc45e5a8e64ad0755870b1001e5d7ffb4e85/README.md#L61
2019-01-29 21:21:01 +01:00
download_if_not_exist " $CACHEDIR /Python- $PYTHON_VERSION .tar.xz " " https://www.python.org/ftp/python/ $PYTHON_VERSION /Python- $PYTHON_VERSION .tar.xz "
2025-06-05 13:23:30 +00:00
verify_hash " $CACHEDIR /Python- $PYTHON_VERSION .tar.xz " "c30bb24b7f1e9a19b11b55a546434f74e739bb4c271a3e3a80ff4380d49f7adb"
2019-01-29 21:21:01 +01:00
info "building python."
2022-11-04 05:20:25 +00:00
tar xf " $CACHEDIR /Python- $PYTHON_VERSION .tar.xz " -C " $CACHEDIR "
2019-01-29 21:21:01 +01:00
(
2022-11-04 05:20:25 +00:00
if [ -f " $CACHEDIR /Python- $PYTHON_VERSION /python " ] ; then
info "python already built, skipping"
exit 0
fi
cd " $CACHEDIR /Python- $PYTHON_VERSION "
2019-06-23 02:47:16 +02:00
LC_ALL = C export BUILD_DATE = $( date -u -d " @ $SOURCE_DATE_EPOCH " "+%b %d %Y" )
LC_ALL = C export BUILD_TIME = $( date -u -d " @ $SOURCE_DATE_EPOCH " "+%H:%M:%S" )
2024-04-18 17:18:44 +00:00
# Patches taken from Ubuntu http://archive.ubuntu.com/ubuntu/pool/main/p/python3.11/python3.11_3.11.6-3.debian.tar.xz
patch -p1 < " $CONTRIB_APPIMAGE /patches/python-3.11-reproducible-buildinfo.diff "
2019-06-23 02:47:16 +02:00
./configure \
2022-09-27 14:55:22 +00:00
--cache-file= " $CACHEDIR /python.config.cache " \
--prefix= " $APPDIR /usr " \
--enable-ipv6 \
--enable-shared \
-q
2022-12-03 22:50:18 +00:00
make " -j $CPU_COUNT " -s || fail "Could not build Python"
2022-11-04 05:20:25 +00:00
)
info "installing python."
(
cd " $CACHEDIR /Python- $PYTHON_VERSION "
2019-06-23 03:21:59 +02:00
make -s install > /dev/null || fail "Could not install Python"
2019-06-23 03:15:33 +02:00
# When building in docker on macOS, python builds with .exe extension because the
# case insensitive file system of macOS leaks into docker. This causes the build
# to result in a different output on macOS compared to Linux. We simply patch
# sysconfigdata to remove the extension.
# Some more info: https://bugs.python.org/issue27631
2022-08-10 21:03:55 +02:00
sed -i -e 's/\.exe//g' " ${ APPDIR } /usr/lib/python ${ PY_VER_MAJOR } " /_sysconfigdata*
2019-01-29 21:21:01 +01:00
)
2025-06-03 18:31:54 +00:00
if ls " $DLL_TARGET_DIR " /libsecp256k1.so.* 1> /dev/null 2>& 1; then
2022-11-04 05:20:25 +00:00
info "libsecp256k1 already built, skipping"
else
" $CONTRIB " /make_libsecp256k1.sh || fail "Could not build libsecp"
fi
2023-02-04 01:36:19 +00:00
cp -f " $DLL_TARGET_DIR " /libsecp256k1.so.* " $APPDIR /usr/lib/ " || fail "Could not copy libsecp to its destination"
2019-01-29 21:21:01 +01:00
2024-01-10 19:06:32 +00:00
if [ -f " $DLL_TARGET_DIR /libzbar.so.0 " ] ; then
info "libzbar already built, skipping"
else
# note: could instead just use the libzbar0 pkg from debian/apt, but that is too old and missing fixes for CVE-2023-40889
" $CONTRIB " /make_zbar.sh || fail "Could not build zbar"
fi
cp -f " $DLL_TARGET_DIR /libzbar.so.0 " " $APPDIR /usr/lib/ " || fail "Could not copy libzbar to its destination"
2019-01-29 21:21:01 +01:00
appdir_python( ) {
2022-09-27 14:55:22 +00:00
env \
PYTHONNOUSERSITE = 1 \
LD_LIBRARY_PATH = " $APPDIR /usr/lib: $APPDIR /usr/lib/x86_64-linux-gnu ${ LD_LIBRARY_PATH + : $LD_LIBRARY_PATH } " \
" $APPDIR /usr/bin/python ${ PY_VER_MAJOR } " " $@ "
2019-01-29 21:21:01 +01:00
}
python = 'appdir_python'
info "installing pip."
" $python " -m ensurepip
2020-12-12 02:52:38 +01:00
break_legacy_easy_install
2019-01-29 21:21:01 +01:00
info "preparing electrum-locale."
(
2025-04-10 17:45:21 +00:00
" $CONTRIB /locale/build_cleanlocale.sh "
2021-03-31 17:00:39 +02:00
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
2025-04-10 17:37:54 +00:00
rm -r " $PROJECT_ROOT /electrum/locale/locale " /*/electrum.po
2019-01-29 21:21:01 +01:00
)
2020-09-08 03:15:42 +02:00
info "Installing build dependencies."
2022-08-06 07:52:03 +02:00
# note: re pip installing from PyPI,
# we prefer compiling C extensions ourselves, instead of using binary wheels,
# hence "--no-binary :all:" flags. However, we specifically allow
2024-09-05 16:20:01 +00:00
# - PyQt6, as it's harder to build from source
2022-08-06 07:52:03 +02:00
# - cryptography, as it's harder to build from source
# - the whole of "requirements-build-base.txt", which includes pip and friends, as it also includes "wheel",
# and I am not quite sure how to break the circular dependence there (I guess we could introduce
# "requirements-build-base-base.txt" with just wheel in it...)
2022-03-26 02:12:12 +01:00
" $python " -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
--cache-dir " $PIP_CACHE_DIR " -r " $CONTRIB /deterministic-build/requirements-build-base.txt "
" $python " -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
2021-03-07 22:12:26 +01:00
--cache-dir " $PIP_CACHE_DIR " -r " $CONTRIB /deterministic-build/requirements-build-appimage.txt "
2020-09-08 03:15:42 +02:00
2025-03-20 16:40:19 +00:00
# opt out of compiling C extensions
export YARL_NO_EXTENSIONS = 1
2025-05-30 17:43:51 +00:00
export FROZENLIST_NO_EXTENSIONS = 1
2025-03-20 16:40:19 +00:00
2024-10-07 16:17:16 +00:00
export ELECTRUM_ECC_DONT_COMPILE = 1
2025-03-20 16:40:19 +00:00
info "installing electrum and its dependencies."
2022-03-26 02:12:12 +01:00
" $python " -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
2021-03-07 22:12:26 +01:00
--cache-dir " $PIP_CACHE_DIR " -r " $CONTRIB /deterministic-build/requirements.txt "
2024-09-05 16:20:01 +00:00
" $python " -m pip install --no-build-isolation --no-dependencies --no-binary :all: --only-binary PyQt6,PyQt6-Qt6,cryptography --no-warn-script-location \
2021-03-07 22:12:26 +01:00
--cache-dir " $PIP_CACHE_DIR " -r " $CONTRIB /deterministic-build/requirements-binaries.txt "
2022-03-26 02:12:12 +01:00
" $python " -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
2021-03-07 22:12:26 +01:00
--cache-dir " $PIP_CACHE_DIR " -r " $CONTRIB /deterministic-build/requirements-hw.txt "
2020-12-08 17:36:03 +01:00
2022-03-26 02:12:12 +01:00
" $python " -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
2021-03-07 22:12:26 +01:00
--cache-dir " $PIP_CACHE_DIR " " $PROJECT_ROOT "
2019-01-29 21:21:01 +01:00
2020-01-22 12:27:17 +01:00
# was only needed during build time, not runtime
" $python " -m pip uninstall -y Cython
2019-01-29 21:21:01 +01:00
info "desktop integration."
cp " $PROJECT_ROOT /electrum.desktop " " $APPDIR /electrum.desktop "
2019-02-07 18:57:25 +01:00
cp " $PROJECT_ROOT /electrum/gui/icons/electrum.png " " $APPDIR /electrum.png "
2019-01-29 21:21:01 +01:00
# add launcher
2019-06-11 20:02:28 +02:00
cp " $CONTRIB_APPIMAGE /apprun.sh " " $APPDIR /AppRun "
2019-01-29 21:21:01 +01:00
info "finalizing AppDir."
(
export PKG2AICOMMIT = " $PKG2APPIMAGE_COMMIT "
. " $CACHEDIR /functions.sh "
cd " $APPDIR "
# copy system dependencies
copy_deps; copy_deps; copy_deps
move_lib
# apply global appimage blacklist to exclude stuff
2022-08-10 21:03:55 +02:00
# move usr/include out of the way to preserve usr/include/python${PY_VER_MAJOR}.
2019-01-29 21:21:01 +01:00
mv usr/include usr/include.tmp
delete_blacklisted
mv usr/include.tmp usr/include
2019-06-23 03:21:59 +02:00
) || fail "Could not finalize AppDir"
2019-01-29 21:21:01 +01:00
2019-07-04 23:35:52 +02:00
info "Copying additional libraries"
(
2020-01-22 18:26:29 +01:00
# On some systems it can cause problems to use the system libusb (on AppImage excludelist)
2019-07-04 23:35:52 +02:00
cp -f /usr/lib/x86_64-linux-gnu/libusb-1.0.so " $APPDIR /usr/lib/libusb-1.0.so " || fail "Could not copy libusb"
2020-01-22 18:26:29 +01:00
# some distros lack libxkbcommon-x11
cp -f /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 " $APPDIR " /usr/lib/x86_64-linux-gnu || fail "Could not copy libxkbcommon-x11"
2021-03-27 20:18:32 +01:00
# some distros lack some libxcb libraries (see https://github.com/Electron-Cash/Electron-Cash/issues/2196)
cp -f /usr/lib/x86_64-linux-gnu/libxcb-* " $APPDIR " /usr/lib/x86_64-linux-gnu || fail "Could not copy libxcb"
2019-07-04 23:35:52 +02:00
)
2019-01-29 21:21:01 +01:00
info "stripping binaries from debug symbols."
2019-03-06 04:53:18 +01:00
# "-R .note.gnu.build-id" also strips the build id
2019-12-17 21:41:17 +01:00
# "-R .comment" also strips the GCC version information
2019-01-29 21:21:01 +01:00
strip_binaries( )
{
2022-09-27 14:55:22 +00:00
chmod u+w -R " $APPDIR "
{
printf '%s\0' " $APPDIR /usr/bin/python ${ PY_VER_MAJOR } "
find " $APPDIR " -type f -regex '.*\.so\(\.[0-9.]+\)?$' -print0
} | xargs -0 --no-run-if-empty --verbose strip -R .note.gnu.build-id -R .comment
2019-01-29 21:21:01 +01:00
}
strip_binaries
remove_emptydirs( )
{
2022-09-27 14:55:22 +00:00
find " $APPDIR " -type d -empty -print0 | xargs -0 --no-run-if-empty rmdir -vp --ignore-fail-on-non-empty
2019-01-29 21:21:01 +01:00
}
remove_emptydirs
info "removing some unneeded stuff to decrease binary size."
2019-06-23 02:56:33 +02:00
rm -rf " $APPDIR " /usr/{ share,include}
2022-08-10 21:03:55 +02:00
PYDIR = " $APPDIR /usr/lib/python ${ PY_VER_MAJOR } "
2019-06-23 02:56:33 +02:00
rm -rf " $PYDIR " /{ test,ensurepip,lib2to3,idlelib,turtledemo}
rm -rf " $PYDIR " /{ ctypes,sqlite3,tkinter,unittest} /test
rm -rf " $PYDIR " /distutils/{ command,tests}
2022-03-27 19:27:55 +02:00
rm -rf " $PYDIR " /config-3.*-x86_64-linux-gnu
2019-06-23 02:56:33 +02:00
rm -rf " $PYDIR " /site-packages/{ opt,pip,setuptools,wheel}
rm -rf " $PYDIR " /site-packages/Cryptodome/SelfTest
rm -rf " $PYDIR " /site-packages/{ psutil,qrcode,websocket} /tests
2024-09-05 16:20:01 +00:00
# rm lots of unused parts of Qt/PyQt. (assuming PyQt 6 layout)
2019-06-23 02:56:33 +02:00
for component in connectivity declarative help location multimedia quickcontrols2 serialport webengine websockets xmlpatterns ; do
2024-09-05 16:20:01 +00:00
rm -rf " $PYDIR " /site-packages/PyQt6/Qt6/translations/qt${ component } _*
rm -rf " $PYDIR " /site-packages/PyQt6/Qt6/resources/qt${ component } _*
2019-05-15 19:04:42 +02:00
done
2024-09-05 16:20:01 +00:00
rm -rf " $PYDIR " /site-packages/PyQt6/Qt6/{ qml,libexec}
rm -rf " $PYDIR " /site-packages/PyQt6/{ pyrcc*.so,pylupdate*.so,uic}
rm -rf " $PYDIR " /site-packages/PyQt6/Qt6/plugins/{ bearer,gamepads,geometryloaders,geoservices,playlistformats,position,renderplugins,sceneparsers,sensors,sqldrivers,texttospeech,webview}
for component in Bluetooth Concurrent Designer Help Location NetworkAuth Nfc Positioning PositioningQuick Qml Quick Sensors SerialPort Sql Test Web Xml Labs ShaderTools SpatialAudio ; do
rm -rf " $PYDIR " /site-packages/PyQt6/Qt6/lib/libQt6${ component } *
rm -rf " $PYDIR " /site-packages/PyQt6/Qt${ component } *
rm -rf " $PYDIR " /site-packages/PyQt6/bindings/Qt${ component } *
2019-06-23 02:56:33 +02:00
done
2024-09-05 16:20:01 +00:00
for component in Qml Quick ; do
rm -rf " $PYDIR " /site-packages/PyQt6/Qt6/lib/libQt6*${ component } .so*
done
rm -rf " $PYDIR " /site-packages/PyQt6/Qt.so
2019-01-29 21:21:01 +01:00
2019-03-06 04:53:18 +01:00
# these are deleted as they were not deterministic; and are not needed anyway
find " $APPDIR " -path '*/__pycache__*' -delete
2022-02-22 17:14:23 +01:00
# although note that *.dist-info might be needed by certain packages...
build: appimage: fix trezor plugin for new trezorlib
- similar to prev commit that fixes it for the pyinstaller builds
- note that .dist-info/RECORD files are still not reproducible for many packages :((((
```
$ cd dist/
$ ./electrum-*-x86_64.AppImage1 --appimage-extract
$ mv squashfs-root/ squashfs-root1/
$ ./electrum-*-x86_64.AppImage2 --appimage-extract
$ mv squashfs-root/ squashfs-root2/
$ $(cd squashfs-root1; find -type f -exec sha256sum '{}' \; > ./../sha256sum1)
$ $(cd squashfs-root2; find -type f -exec sha256sum '{}' \; > ./../sha256sum2)
$ diff sha256sum1 sha256sum2 > d
$ cat d
507c507
< 269a133bd0d3c85265219c14154323ed934ac36ef9b389da609e43788de2bbcd ./usr/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD
---
> d2c08987f207eed8e90476c576eeff67c0809d1bfd35234e583a2dc6895c5ff1 ./usr/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD
518c518
< d08bd76099191932f3cd289c19427ccab51d9c00a6c2e5126c57f83a84ec2246 ./usr/lib/python3.12/site-packages/aiohttp-3.12.4.dist-info/RECORD
---
> 281c5c7e2b28e56134fa8690a2a446e3ebc515f8cb3705cd5d06e83c53812fab ./usr/lib/python3.12/site-packages/aiohttp-3.12.4.dist-info/RECORD
630c630
< 33665bc46c14e2c0f409ef2627170b093f6d7741e9516928928acbeeb717f155 ./usr/lib/python3.12/site-packages/propcache-0.3.1.dist-info/RECORD
---
> 4fddb29289418edb3ec392a09b8efa826333a60cf508055cac809375e497174e ./usr/lib/python3.12/site-packages/propcache-0.3.1.dist-info/RECORD
1497c1497
< f80c1b47d15a7262ab2b81bcfc1f69816961b9f6b0fd3775ee5b5eb40d4b7a5b ./usr/lib/python3.12/site-packages/pyqt6_sip-13.10.2.dist-info/RECORD
---
> 1b8fb8ea4d50d401cd4f6689531ab4922cb064b9caaec1aae6bd885c3a387eca ./usr/lib/python3.12/site-packages/pyqt6_sip-13.10.2.dist-info/RECORD
3108c3108
< ca06bbe1dba05cd647e89411dd301fad15f42d0ff53ac2c509391cf0303c15c4 ./usr/lib/python3.12/site-packages/multidict-6.4.4.dist-info/RECORD
---
> 400741699b95d3c6bde3c64c7a4bb04b26cbdaee437a17b398d202794a1bd4cd ./usr/lib/python3.12/site-packages/multidict-6.4.4.dist-info/RECORD
3233c3233
< f67e8f271725676df296fab7fab72099f3b853905f9ff677b5de261a52412411 ./usr/lib/python3.12/site-packages/hidapi-0.14.0.post4.dist-info/RECORD
---
> f4d43d5e4c3c2aa3e69fa40c7307b23b82ce4c5e4d5fb041a75b11ddc2ed7423 ./usr/lib/python3.12/site-packages/hidapi-0.14.0.post4.dist-info/RECORD
3271c3271
< aaa92bb84d0f56e82832903f1109dd4362c09ea4af0fefe3d0c95509bc0920ed ./usr/lib/python3.12/site-packages/cbor2-5.6.5.dist-info/RECORD
---
> 8a21af0fadf22898266581df9987c97ee737a670bef9d71d5f53427619466b88 ./usr/lib/python3.12/site-packages/cbor2-5.6.5.dist-info/RECORD
```
-----
Example RECORD files:
```
$ diff squashfs-root1/./usr/lib/python3.12/site-packages/aiohttp-3.12.4.dist-info/RECORD squashfs-root2/./usr/lib/python3.12/site-packages/aiohttp-3.12.4.dist-info/RECORD
64c64
< aiohttp/_http_parser.cpython-312-x86_64-linux-gnu.so,sha256=SjcWt8faDDTOxBHetnDdlQU31sPj0Suc8pwY1_UnKkE,2868384
---
> aiohttp/_http_parser.cpython-312-x86_64-linux-gnu.so,sha256=xdf5Uy_NnFLmSmqNmeY7wytgwFdY7pHxZLOFFfl2Aq8,2868384
66c66
< aiohttp/_http_writer.cpython-312-x86_64-linux-gnu.so,sha256=g6PDJVuICGYq8rywuI6XFWLP6tw1KLWLpwSvJODWo18,510280
---
> aiohttp/_http_writer.cpython-312-x86_64-linux-gnu.so,sha256=U_Y0F0oYClrGRIKO_agXtAohjJ_jqfG375vESBZ56CY,510280
80c80
< aiohttp/_websocket/mask.cpython-312-x86_64-linux-gnu.so,sha256=u0PluBaJntMBktyD1AYv267FvbUO6gpj-Nt7erLj3Qg,257384
---
> aiohttp/_websocket/mask.cpython-312-x86_64-linux-gnu.so,sha256=tEnvrEzSPEtaFI8V_Ey08zy4SBmDhnm-QnxTxgDSYM4,257384
85c85
< aiohttp/_websocket/reader_c.cpython-312-x86_64-linux-gnu.so,sha256=wfcclW8jYOTVeLDRPO87dPvOBrtXiqxBsnEbP0yyGpI,1816496
---
> aiohttp/_websocket/reader_c.cpython-312-x86_64-linux-gnu.so,sha256=jfey8U3MSIp04r0bG_a1TFkIKSzMQ-FLSAWD3nY4wgg,1816496
```
```
$ diff squashfs-root1/./usr/lib/python3.12/site-packages/hidapi-0.14.0.post4.dist-info/RECORD squashfs-root2/./usr/lib/python3.12/site-packages/hidapi-0.14.0.post4.dist-info/RECORD
1c1
< hid.cpython-312-x86_64-linux-gnu.so,sha256=JefmLwo-XKZZmno3PBdmHnREed0Yw7IaPYCI2k1UmbM,1152024
---
> hid.cpython-312-x86_64-linux-gnu.so,sha256=38htTAcIC4nnTPIIjD0jkdtdwtGyWlBIhQwQ-g0K0iI,1152024
12c12
< hidraw.cpython-312-x86_64-linux-gnu.so,sha256=dJ4kVI0jXUj_Ba2cMcAL7Wjy8fkO21VPbhAmR-5n30Y,1156768
---
> hidraw.cpython-312-x86_64-linux-gnu.so,sha256=7908Jgbg7A-3JRtfKabPr_WJkMIjYgd5pX78_Yajo54,1156768
```
-----
error at runtime:
```
22.51 | E | plugins.trezor.trezor | error importing trezor plugin deps
Traceback (most recent call last):
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/importlib/metadata/__init__.py", line 397, in from_name
return next(cls.discover(name=name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/site-packages/electrum/plugins/trezor/trezor.py", line 29, in <module>
from .clientbase import TrezorClientBase, RecoveryDeviceInputMethod
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/site-packages/electrum/plugins/trezor/clientbase.py", line 18, in <module>
import trezorlib.device
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/site-packages/trezorlib/device.py", line 27, in <module>
from slip10 import SLIP10
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/site-packages/slip10/__init__.py", line 6, in <module>
__version__ = importlib.metadata.version(__package__ or __name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/importlib/metadata/__init__.py", line 889, in version
return distribution(distribution_name).version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/importlib/metadata/__init__.py", line 862, in distribution
return Distribution.from_name(distribution_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/importlib/metadata/__init__.py", line 399, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for slip10
```
2025-06-05 18:12:54 +00:00
# e.g. slip10 uses importlib that needs it
for f in " $PYDIR " /site-packages/slip10-*.dist-info; do mv " $f " " $( echo " $f " | sed s/\. dist-info/\. dist-info2/) " ; done
2019-06-23 02:56:33 +02:00
rm -rf " $PYDIR " /site-packages/*.dist-info/
rm -rf " $PYDIR " /site-packages/*.egg-info/
build: appimage: fix trezor plugin for new trezorlib
- similar to prev commit that fixes it for the pyinstaller builds
- note that .dist-info/RECORD files are still not reproducible for many packages :((((
```
$ cd dist/
$ ./electrum-*-x86_64.AppImage1 --appimage-extract
$ mv squashfs-root/ squashfs-root1/
$ ./electrum-*-x86_64.AppImage2 --appimage-extract
$ mv squashfs-root/ squashfs-root2/
$ $(cd squashfs-root1; find -type f -exec sha256sum '{}' \; > ./../sha256sum1)
$ $(cd squashfs-root2; find -type f -exec sha256sum '{}' \; > ./../sha256sum2)
$ diff sha256sum1 sha256sum2 > d
$ cat d
507c507
< 269a133bd0d3c85265219c14154323ed934ac36ef9b389da609e43788de2bbcd ./usr/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD
---
> d2c08987f207eed8e90476c576eeff67c0809d1bfd35234e583a2dc6895c5ff1 ./usr/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD
518c518
< d08bd76099191932f3cd289c19427ccab51d9c00a6c2e5126c57f83a84ec2246 ./usr/lib/python3.12/site-packages/aiohttp-3.12.4.dist-info/RECORD
---
> 281c5c7e2b28e56134fa8690a2a446e3ebc515f8cb3705cd5d06e83c53812fab ./usr/lib/python3.12/site-packages/aiohttp-3.12.4.dist-info/RECORD
630c630
< 33665bc46c14e2c0f409ef2627170b093f6d7741e9516928928acbeeb717f155 ./usr/lib/python3.12/site-packages/propcache-0.3.1.dist-info/RECORD
---
> 4fddb29289418edb3ec392a09b8efa826333a60cf508055cac809375e497174e ./usr/lib/python3.12/site-packages/propcache-0.3.1.dist-info/RECORD
1497c1497
< f80c1b47d15a7262ab2b81bcfc1f69816961b9f6b0fd3775ee5b5eb40d4b7a5b ./usr/lib/python3.12/site-packages/pyqt6_sip-13.10.2.dist-info/RECORD
---
> 1b8fb8ea4d50d401cd4f6689531ab4922cb064b9caaec1aae6bd885c3a387eca ./usr/lib/python3.12/site-packages/pyqt6_sip-13.10.2.dist-info/RECORD
3108c3108
< ca06bbe1dba05cd647e89411dd301fad15f42d0ff53ac2c509391cf0303c15c4 ./usr/lib/python3.12/site-packages/multidict-6.4.4.dist-info/RECORD
---
> 400741699b95d3c6bde3c64c7a4bb04b26cbdaee437a17b398d202794a1bd4cd ./usr/lib/python3.12/site-packages/multidict-6.4.4.dist-info/RECORD
3233c3233
< f67e8f271725676df296fab7fab72099f3b853905f9ff677b5de261a52412411 ./usr/lib/python3.12/site-packages/hidapi-0.14.0.post4.dist-info/RECORD
---
> f4d43d5e4c3c2aa3e69fa40c7307b23b82ce4c5e4d5fb041a75b11ddc2ed7423 ./usr/lib/python3.12/site-packages/hidapi-0.14.0.post4.dist-info/RECORD
3271c3271
< aaa92bb84d0f56e82832903f1109dd4362c09ea4af0fefe3d0c95509bc0920ed ./usr/lib/python3.12/site-packages/cbor2-5.6.5.dist-info/RECORD
---
> 8a21af0fadf22898266581df9987c97ee737a670bef9d71d5f53427619466b88 ./usr/lib/python3.12/site-packages/cbor2-5.6.5.dist-info/RECORD
```
-----
Example RECORD files:
```
$ diff squashfs-root1/./usr/lib/python3.12/site-packages/aiohttp-3.12.4.dist-info/RECORD squashfs-root2/./usr/lib/python3.12/site-packages/aiohttp-3.12.4.dist-info/RECORD
64c64
< aiohttp/_http_parser.cpython-312-x86_64-linux-gnu.so,sha256=SjcWt8faDDTOxBHetnDdlQU31sPj0Suc8pwY1_UnKkE,2868384
---
> aiohttp/_http_parser.cpython-312-x86_64-linux-gnu.so,sha256=xdf5Uy_NnFLmSmqNmeY7wytgwFdY7pHxZLOFFfl2Aq8,2868384
66c66
< aiohttp/_http_writer.cpython-312-x86_64-linux-gnu.so,sha256=g6PDJVuICGYq8rywuI6XFWLP6tw1KLWLpwSvJODWo18,510280
---
> aiohttp/_http_writer.cpython-312-x86_64-linux-gnu.so,sha256=U_Y0F0oYClrGRIKO_agXtAohjJ_jqfG375vESBZ56CY,510280
80c80
< aiohttp/_websocket/mask.cpython-312-x86_64-linux-gnu.so,sha256=u0PluBaJntMBktyD1AYv267FvbUO6gpj-Nt7erLj3Qg,257384
---
> aiohttp/_websocket/mask.cpython-312-x86_64-linux-gnu.so,sha256=tEnvrEzSPEtaFI8V_Ey08zy4SBmDhnm-QnxTxgDSYM4,257384
85c85
< aiohttp/_websocket/reader_c.cpython-312-x86_64-linux-gnu.so,sha256=wfcclW8jYOTVeLDRPO87dPvOBrtXiqxBsnEbP0yyGpI,1816496
---
> aiohttp/_websocket/reader_c.cpython-312-x86_64-linux-gnu.so,sha256=jfey8U3MSIp04r0bG_a1TFkIKSzMQ-FLSAWD3nY4wgg,1816496
```
```
$ diff squashfs-root1/./usr/lib/python3.12/site-packages/hidapi-0.14.0.post4.dist-info/RECORD squashfs-root2/./usr/lib/python3.12/site-packages/hidapi-0.14.0.post4.dist-info/RECORD
1c1
< hid.cpython-312-x86_64-linux-gnu.so,sha256=JefmLwo-XKZZmno3PBdmHnREed0Yw7IaPYCI2k1UmbM,1152024
---
> hid.cpython-312-x86_64-linux-gnu.so,sha256=38htTAcIC4nnTPIIjD0jkdtdwtGyWlBIhQwQ-g0K0iI,1152024
12c12
< hidraw.cpython-312-x86_64-linux-gnu.so,sha256=dJ4kVI0jXUj_Ba2cMcAL7Wjy8fkO21VPbhAmR-5n30Y,1156768
---
> hidraw.cpython-312-x86_64-linux-gnu.so,sha256=7908Jgbg7A-3JRtfKabPr_WJkMIjYgd5pX78_Yajo54,1156768
```
-----
error at runtime:
```
22.51 | E | plugins.trezor.trezor | error importing trezor plugin deps
Traceback (most recent call last):
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/importlib/metadata/__init__.py", line 397, in from_name
return next(cls.discover(name=name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/site-packages/electrum/plugins/trezor/trezor.py", line 29, in <module>
from .clientbase import TrezorClientBase, RecoveryDeviceInputMethod
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/site-packages/electrum/plugins/trezor/clientbase.py", line 18, in <module>
import trezorlib.device
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/site-packages/trezorlib/device.py", line 27, in <module>
from slip10 import SLIP10
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/site-packages/slip10/__init__.py", line 6, in <module>
__version__ = importlib.metadata.version(__package__ or __name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/importlib/metadata/__init__.py", line 889, in version
return distribution(distribution_name).version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/importlib/metadata/__init__.py", line 862, in distribution
return Distribution.from_name(distribution_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/.mount_electrteDkNu/usr/lib/python3.12/importlib/metadata/__init__.py", line 399, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for slip10
```
2025-06-05 18:12:54 +00:00
for f in " $PYDIR " /site-packages/slip10-*.dist-info2; do mv " $f " " $( echo " $f " | sed s/\. dist-info2/\. dist-info/) " ; done
2019-03-06 04:53:18 +01:00
2019-03-11 05:21:37 +01:00
find -exec touch -h -d '2000-11-11T11:11:11+00:00' { } +
2019-03-06 04:53:18 +01:00
2019-01-29 21:21:01 +01:00
info "creating the AppImage."
(
cd " $BUILDDIR "
2019-07-10 20:26:25 +02:00
cp " $CACHEDIR /appimagetool " " $CACHEDIR /appimagetool_copy "
# zero out "appimage" magic bytes, as on some systems they confuse the linker
sed -i 's|AI\x02|\x00\x00\x00|' " $CACHEDIR /appimagetool_copy "
chmod +x " $CACHEDIR /appimagetool_copy "
" $CACHEDIR /appimagetool_copy " --appimage-extract
2021-09-22 16:40:15 +02:00
# We build a small wrapper for mksquashfs that removes the -mkfs-time option
# as it conflicts with SOURCE_DATE_EPOCH.
mv " $BUILDDIR /squashfs-root/usr/lib/appimagekit/mksquashfs " " $BUILDDIR /squashfs-root/usr/lib/appimagekit/mksquashfs_orig "
cat > " $BUILDDIR /squashfs-root/usr/lib/appimagekit/mksquashfs " << EOF
2019-06-23 02:40:29 +02:00
#!/bin/sh
2021-09-22 16:40:15 +02:00
args = \$ ( echo "\$@" | sed -e 's/-mkfs-time 0//' )
" $BUILDDIR /squashfs-root/usr/lib/appimagekit/mksquashfs_orig " \$ args
2019-06-23 02:40:29 +02:00
EOF
2021-09-22 16:40:15 +02:00
chmod +x " $BUILDDIR /squashfs-root/usr/lib/appimagekit/mksquashfs "
env VERSION = " $VERSION " ARCH = x86_64 ./squashfs-root/AppRun --no-appstream --verbose " $APPDIR " " $APPIMAGE "
2019-01-29 21:21:01 +01:00
)
info "done."
ls -la " $DISTDIR "
sha256sum " $DISTDIR " /*