Merge pull request #64636 from arcnmx/electrum-update
electrum 3.3.8, optional qt, darwin fixes
This commit is contained in:
commit
f8a9a50118
@ -1,4 +1,5 @@
|
|||||||
{ stdenv, fetchurl, fetchFromGitHub, python3, python3Packages, zbar, secp256k1
|
{ stdenv, fetchurl, fetchFromGitHub, python3, python3Packages, zbar, secp256k1
|
||||||
|
, enableQt ? !stdenv.isDarwin
|
||||||
|
|
||||||
|
|
||||||
# for updater.nix
|
# for updater.nix
|
||||||
@ -14,14 +15,23 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "3.3.7";
|
version = "3.3.8";
|
||||||
|
|
||||||
|
libsecp256k1_name =
|
||||||
|
if stdenv.isLinux then "libsecp256k1.so.0"
|
||||||
|
else if stdenv.isDarwin then "libsecp256k1.0.dylib"
|
||||||
|
else "libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||||
|
|
||||||
|
libzbar_name =
|
||||||
|
if stdenv.isLinux then "libzbar.so.0"
|
||||||
|
else "libzbar${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||||
|
|
||||||
# Not provided in official source releases, which are what upstream signs.
|
# Not provided in official source releases, which are what upstream signs.
|
||||||
tests = fetchFromGitHub {
|
tests = fetchFromGitHub {
|
||||||
owner = "spesmilo";
|
owner = "spesmilo";
|
||||||
repo = "electrum";
|
repo = "electrum";
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "1g2kbbsi6k105q6s0la20h12gz8dzka5kdcjbdhs12jqsjfx3lr0";
|
sha256 = "1di8ba77kgapcys0d7h5nx1qqakv3s60c6sp8skw8p69ramsl73c";
|
||||||
|
|
||||||
extraPostFetch = ''
|
extraPostFetch = ''
|
||||||
mv $out ./all
|
mv $out ./all
|
||||||
@ -36,7 +46,7 @@ python3Packages.buildPythonApplication rec {
|
|||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz";
|
url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz";
|
||||||
sha256 = "13ahc4zqpgzmck2r663sqqgz86xsd83r5qqi26mh2vazy1i6pykz";
|
sha256 = "1g00cj1pmckd4xis8r032wmraiv3vd3zc803hnyxa2bnhj8z3bg2";
|
||||||
};
|
};
|
||||||
|
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
@ -56,9 +66,7 @@ python3Packages.buildPythonApplication rec {
|
|||||||
protobuf
|
protobuf
|
||||||
pyaes
|
pyaes
|
||||||
pycryptodomex
|
pycryptodomex
|
||||||
pyqt5
|
|
||||||
pysocks
|
pysocks
|
||||||
qdarkstyle
|
|
||||||
qrcode
|
qrcode
|
||||||
requests
|
requests
|
||||||
tlslite-ng
|
tlslite-ng
|
||||||
@ -70,15 +78,20 @@ python3Packages.buildPythonApplication rec {
|
|||||||
|
|
||||||
# TODO plugins
|
# TODO plugins
|
||||||
# amodem
|
# amodem
|
||||||
];
|
] ++ stdenv.lib.optionals enableQt [ pyqt5 qdarkstyle ];
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
sed -i 's,usr_share = .*,usr_share = "'$out'/share",g' setup.py
|
sed -i 's,usr_share = .*,usr_share = "'$out'/share",g' setup.py
|
||||||
sed -i "s|name = 'libzbar.*'|name='${zbar}/lib/libzbar.so'|" electrum/qrscanner.py
|
substituteInPlace ./electrum/ecc_fast.py \
|
||||||
substituteInPlace ./electrum/ecc_fast.py --replace libsecp256k1.so.0 ${secp256k1}/lib/libsecp256k1.so.0
|
--replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
'';
|
'' + (if enableQt then ''
|
||||||
|
substituteInPlace ./electrum/qrscanner.py \
|
||||||
|
--replace ${libzbar_name} ${zbar}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
|
'' else ''
|
||||||
|
sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt
|
||||||
|
'');
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = stdenv.lib.optionalString stdenv.isLinux ''
|
||||||
# Despite setting usr_share above, these files are installed under
|
# Despite setting usr_share above, these files are installed under
|
||||||
# $out/nix ...
|
# $out/nix ...
|
||||||
mv $out/${python3.sitePackages}/nix/store"/"*/share $out
|
mv $out/${python3.sitePackages}/nix/store"/"*/share $out
|
||||||
@ -123,6 +136,7 @@ python3Packages.buildPythonApplication rec {
|
|||||||
'';
|
'';
|
||||||
homepage = https://electrum.org/;
|
homepage = https://electrum.org/;
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
|
platforms = platforms.all;
|
||||||
maintainers = with maintainers; [ ehmry joachifm np ];
|
maintainers = with maintainers; [ ehmry joachifm np ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user