electrum: optional qt5 and darwin fixes
qt5 is often broken on darwin, and it's a massive closure when there's a curses interface and CLI to use instead.
This commit is contained in:
parent
769f992fbc
commit
36f9da4ec4
@ -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
|
||||||
@ -16,6 +17,15 @@
|
|||||||
let
|
let
|
||||||
version = "3.3.8";
|
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";
|
||||||
@ -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