From 630140899c0ad5f04b87d112580385ef4c61a498 Mon Sep 17 00:00:00 2001 From: Artem Zhurikhin Date: Sun, 3 Jan 2021 01:42:41 +0300 Subject: [PATCH] electrum: update to 4.0.9 - update the patch file - add libbitcoin-secp256k1 dependency Also, update dependencies: - python3-aiohttp_socks: update to 0.5.5 - New package: python3-socks (required by python3-aiohttp_socks since 0.5.4) - New package: python3-bitstring (required by electrum since 4.0.0) --- srcpkgs/electrum/patches/no-certifi.patch | 86 +++++++++++++++-------- srcpkgs/electrum/template | 12 ++-- srcpkgs/python3-aiohttp_socks/template | 9 ++- srcpkgs/python3-bitstring/template | 17 +++++ srcpkgs/python3-socks/template | 13 ++++ 5 files changed, 95 insertions(+), 42 deletions(-) create mode 100644 srcpkgs/python3-bitstring/template create mode 100644 srcpkgs/python3-socks/template diff --git a/srcpkgs/electrum/patches/no-certifi.patch b/srcpkgs/electrum/patches/no-certifi.patch index eb215543b29..e6d9fc628ed 100644 --- a/srcpkgs/electrum/patches/no-certifi.patch +++ b/srcpkgs/electrum/patches/no-certifi.patch @@ -2,28 +2,31 @@ Upstream: No Reason: Avoid certifi dependency diff --git contrib/requirements/requirements.txt contrib/requirements/requirements.txt -index 1159a0469..9e406b56e 100644 +index b935a68..6e8fd25 100644 --- contrib/requirements/requirements.txt +++ contrib/requirements/requirements.txt -@@ -8,4 +8,3 @@ qdarkstyle<2.7 +@@ -4,7 +4,6 @@ qdarkstyle<2.9 aiorpcx>=0.18,<0.19 - aiohttp>=3.3.0 - aiohttp_socks + aiohttp>=3.3.0,<4.0.0 + aiohttp_socks>=0.3 -certifi + bitstring + attrs>=19.2.0 + diff --git electrum/interface.py electrum/interface.py -index b5eac439c..14bbd7ab9 100644 +index 810727e..4c90e0d 100644 --- electrum/interface.py +++ electrum/interface.py -@@ -40,7 +40,6 @@ from aiorpcx import RPCSession, Notification, NetAddress +@@ -42,7 +42,6 @@ from aiorpcx import RPCSession, Notification, NetAddress, NewlineFramer from aiorpcx.curio import timeout_after, TaskTimeout from aiorpcx.jsonrpc import JSONRPC, CodeMessageError from aiorpcx.rawsocket import RSClient -import certifi - from .util import ignore_exceptions, log_exceptions, bfh, SilentTaskGroup - from . import util -@@ -57,7 +56,7 @@ if TYPE_CHECKING: - from .network import Network + from .util import (ignore_exceptions, log_exceptions, bfh, SilentTaskGroup, MySocksProxy, + is_integer, is_non_negative_integer, is_hash256_str, is_hex_str, +@@ -64,7 +63,7 @@ if TYPE_CHECKING: + from .simple_config import SimpleConfig -ca_path = certifi.where() @@ -32,18 +35,18 @@ index b5eac439c..14bbd7ab9 100644 BUCKET_NAME_OF_ONION_SERVERS = 'onion' diff --git electrum/paymentrequest.py electrum/paymentrequest.py -index fedcd1b3a..cba4879c7 100644 +index 2ce0ff2..17048e0 100644 --- electrum/paymentrequest.py +++ electrum/paymentrequest.py -@@ -29,7 +29,6 @@ import traceback - import json - from typing import Optional +@@ -29,7 +29,6 @@ from typing import Optional, List, TYPE_CHECKING + import asyncio + import urllib.parse -import certifi - import urllib.parse import aiohttp -@@ -54,7 +53,7 @@ _logger = get_logger(__name__) + +@@ -58,7 +57,7 @@ _logger = get_logger(__name__) REQUEST_HEADERS = {'Accept': 'application/bitcoin-paymentrequest', 'User-Agent': 'Electrum'} ACK_HEADERS = {'Content-Type':'application/bitcoin-payment','Accept':'application/bitcoin-paymentack','User-Agent':'Electrum'} @@ -52,19 +55,40 @@ index fedcd1b3a..cba4879c7 100644 ca_list = None ca_keyID = None +diff --git electrum/plugins/cosigner_pool/qt.py electrum/plugins/cosigner_pool/qt.py +index 95265c7..28ee95e 100644 +--- electrum/plugins/cosigner_pool/qt.py ++++ electrum/plugins/cosigner_pool/qt.py +@@ -30,7 +30,6 @@ import ssl + + from PyQt5.QtCore import QObject, pyqtSignal + from PyQt5.QtWidgets import QPushButton +-import certifi + + from electrum import util, keystore, ecc, crypto + from electrum import transaction +@@ -49,7 +48,7 @@ if TYPE_CHECKING: + from electrum.gui.qt.main_window import ElectrumWindow + + +-ca_path = certifi.where() ++ca_path = '/etc/ssl/certs/ca-certificates.crt' + ssl_context = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH, cafile=ca_path) + server = ServerProxy('https://cosigner.electrum.org/', allow_none=True, context=ssl_context) + diff --git electrum/util.py electrum/util.py -index 62df080a9..9c96055ba 100644 +index 404e410..305cd9c 100644 --- electrum/util.py +++ electrum/util.py -@@ -44,7 +44,6 @@ import ssl - import aiohttp - from aiohttp_socks import SocksConnector, SocksVer +@@ -51,7 +51,6 @@ import aiohttp + from aiohttp_socks import ProxyConnector, ProxyType + import aiorpcx from aiorpcx import TaskGroup -import certifi + import dns.resolver from .i18n import _ - from .logging import get_logger, Logger -@@ -62,7 +61,7 @@ def inv_dict(d): +@@ -70,7 +69,7 @@ def inv_dict(d): return {v: k for k, v in d.items()} @@ -74,10 +98,10 @@ index 62df080a9..9c96055ba 100644 base_units = {'BTC':8, 'mBTC':5, 'bits':2, 'sat':0} diff --git electrum/x509.py electrum/x509.py -index c38edc77a..1c4065444 100644 +index 78ae26c..a5142aa 100644 --- electrum/x509.py +++ electrum/x509.py -@@ -343,7 +343,5 @@ def load_certificates(ca_path): +@@ -341,7 +341,5 @@ def load_certificates(ca_path): if __name__ == "__main__": @@ -87,20 +111,20 @@ index c38edc77a..1c4065444 100644 + ca_path = '/etc/ssl/certs/ca-certificates.crt' ca_list, ca_keyID = load_certificates(ca_path) diff --git run_electrum run_electrum -index 1f5ee2f03..7891c50f0 100755 +index 3caf118..6564784 100755 --- run_electrum +++ run_electrum -@@ -58,7 +58,6 @@ def check_imports(): +@@ -57,7 +57,6 @@ def check_imports(): + # pure-python dependencies need to be imported here for pyinstaller + try: import dns - import pyaes - import ecdsa - import certifi import qrcode import google.protobuf - import jsonrpclib -@@ -72,7 +71,7 @@ def check_imports(): + import aiorpcx +@@ -69,7 +68,7 @@ def check_imports(): + from google.protobuf import reflection from google.protobuf import descriptor_pb2 - from jsonrpclib import SimpleJSONRPCServer # make sure that certificates are here - assert os.path.exists(certifi.where()) + assert os.path.exists('/etc/ssl/certs/ca-certificates.crt') diff --git a/srcpkgs/electrum/template b/srcpkgs/electrum/template index 5c3016675e5..597f6c59047 100644 --- a/srcpkgs/electrum/template +++ b/srcpkgs/electrum/template @@ -1,13 +1,13 @@ # Template file for 'electrum' pkgname=electrum -version=3.3.8 -revision=2 +version=4.0.9 +revision=1 build_style=python3-module -pycompile_module="electrum electrum_gui electrum_plugins" hostmakedepends="python3-PyQt5-devel-tools python3-setuptools" -depends="python3-aiohttp python3-aiohttp_socks python3-aiorpcx>=0.18<0.19 +depends="python3-aiohttp python3-aiohttp_socks>=0.3 python3-aiorpcx>=0.18<0.19 python3-dnspython python3-ecdsa python3-jsonrpclib python3-protobuf - python3-pyaes python3-pycryptodome python3-PyQt5 python3-qrcode" + python3-pyaes python3-pycryptodome python3-PyQt5 python3-qrcode python3-bitstring + libbitcoin-secp256k1" # Missing optional dependencies: # btchip - BTChip hardware wallet support # trezor - TREZOR hardware wallet support @@ -19,7 +19,7 @@ license="MIT" homepage="https://electrum.org/" # patch doesn't apply for PyPI tarball distfiles="https://github.com/spesmilo/electrum/archive/${version}.tar.gz" -checksum=52addd8c0d08d3cc7cc34015efd67f7396fe30a74ac668b8fb77f6b3b927fd8b +checksum=67e63afe6a9d8944f872500fbf6312a3840f3fa8ebd0c1aadfbba3147d8b3c24 post_install() { sed -i -e 's|electrum %u|electrum|' \ diff --git a/srcpkgs/python3-aiohttp_socks/template b/srcpkgs/python3-aiohttp_socks/template index fa75a54302c..adaec9ead8c 100644 --- a/srcpkgs/python3-aiohttp_socks/template +++ b/srcpkgs/python3-aiohttp_socks/template @@ -1,15 +1,14 @@ # Template file for 'python3-aiohttp_socks' pkgname=python3-aiohttp_socks -version=0.2.2 -revision=3 +version=0.5.5 +revision=1 wrksrc="aiohttp_socks-${version}" build_style=python3-module -pycompile_module="aiohttp_socks" hostmakedepends="python3-setuptools" -depends="python3-aiohttp" +depends="python3-socks" short_desc="SOCKS proxy connector for aiohttp" maintainer="Christian Buschau " license="Apache-2.0" homepage="https://github.com/romis2012/aiohttp-socks" distfiles="${PYPI_SITE}/a/aiohttp_socks/aiohttp_socks-${version}.tar.gz" -checksum=eebd8939a7c3c1e3e7e1b2552c60039b4c65ef6b8b2351efcbdd98290538e310 +checksum=2eb2059756bde34c55bb429541cbf2eba3fd53e36ac80875b461221e2858b04a diff --git a/srcpkgs/python3-bitstring/template b/srcpkgs/python3-bitstring/template new file mode 100644 index 00000000000..c029f423be1 --- /dev/null +++ b/srcpkgs/python3-bitstring/template @@ -0,0 +1,17 @@ +# Template file for 'python3-bitstring' +pkgname=python3-bitstring +version=3.1.7 +revision=1 +wrksrc="bitstring-${version}" +build_style=python3-module +hostmakedepends="python3-setuptools" +short_desc="Simple construction, analysis and modification of binary data" +maintainer="Artem Zhurikhin " +license="MIT" +homepage="https://github.com/scott-griffiths/bitstring" +distfiles="${PYPI_SITE}/b/bitstring/bitstring-${version}.tar.gz" +checksum=fdf3eb72b229d2864fb507f8f42b1b2c57af7ce5fec035972f9566de440a864a + +post_install() { + vlicense LICENSE +} diff --git a/srcpkgs/python3-socks/template b/srcpkgs/python3-socks/template new file mode 100644 index 00000000000..b559f277d93 --- /dev/null +++ b/srcpkgs/python3-socks/template @@ -0,0 +1,13 @@ +# Template file for 'python3-socks' +pkgname=python3-socks +version=1.1.2 +revision=1 +wrksrc="python-socks-${version}" +build_style=python3-module +hostmakedepends="python3-setuptools" +short_desc="Core proxy functionality for Python" +maintainer="Artem Zhurikhin " +license="Apache-2.0" +homepage="https://github.com/romis2012/python-socks" +distfiles="${PYPI_SITE}/p/python-socks/python-socks-${version}.tar.gz" +checksum=fa7513c9293d95d90b1da9e10b84fa53afcb4c0f67e9c141d9f479cde2d8af1a