Merge pull request #221010 from emmanuelrosa/update-sparrow

sparrow: 1.7.1 -> 1.7.3
This commit is contained in:
Weijia Wang 2023-03-23 15:46:32 +02:00 committed by GitHub
commit a2207e4a07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 25 deletions

View File

@ -20,11 +20,11 @@
let
pname = "sparrow";
version = "1.7.1";
version = "1.7.3";
src = fetchurl {
url = "https://github.com/sparrowwallet/${pname}/releases/download/${version}/${pname}-${version}-x86_64.tar.gz";
sha256 = "0q31b4ncvbhr9gb47wplphg43pwlg5vpd1b12qiidqlrkgm2vjy8";
sha256 = "sha256-/tKct73v0zWAjY4kTllnb/+SB/8ENgVl8Yh/LErKTxY=";
};
launcher = writeScript "sparrow" ''
@ -156,24 +156,6 @@ let
ln -s ${hwi}/bin/hwi $out/modules/com.sparrowwallet.sparrow/native/linux/x64/hwi
'';
};
# To use the udev rules for connected hardware wallets,
# add "pkgs.sparrow" to "services.udev.packages" and add user accounts to the user group "plugdev".
udev-rules = stdenv.mkDerivation {
name = "sparrow-udev";
src = let version = "2.0.2"; in
fetchurl {
url = "https://github.com/bitcoin-core/HWI/releases/download/${version}/hwi-${version}.tar.gz";
sha256 = "sha256-di1fRsMbwpHcBFNTCVivfxpwhUoUKLA3YTnJxKq/jHM=";
};
installPhase = ''
mkdir -p $out/etc/udev/rules.d
cp -a hwilib/udev/* $out/etc/udev/rules.d
rm $out/etc/udev/rules.d/README.md
'';
};
in
stdenv.mkDerivation rec {
inherit pname version src;
@ -186,8 +168,9 @@ stdenv.mkDerivation rec {
icon = pname;
desktopName = "Sparrow Bitcoin Wallet";
genericName = "Bitcoin Wallet";
categories = [ "Finance" ];
categories = [ "Finance" "Network" ];
mimeTypes = [ "application/psbt" "application/bitcoin-transaction" "x-scheme-handler/bitcoin" "x-scheme-handler/auth47" "x-scheme-handler/lightning" ];
startupWMClass = "Sparrow";
})
];
@ -217,8 +200,8 @@ stdenv.mkDerivation rec {
mkdir -p $out/share/icons
ln -s ${sparrow-icons}/hicolor $out/share/icons
mkdir -p $out/etc/udev
ln -s ${udev-rules}/etc/udev/rules.d $out/etc/udev/rules.d
mkdir -p $out/etc/udev/rules.d
cp ${hwi}/lib/python*/site-packages/hwilib/udev/*.rules $out/etc/udev/rules.d
runHook postInstall
'';

View File

@ -0,0 +1,30 @@
{ lib
, buildFHSUserEnv
, sparrow-unwrapped
}:
buildFHSUserEnv {
name = "sparrow";
runScript = "${sparrow-unwrapped}/bin/sparrow";
targetPkgs = pkgs: with pkgs; [
sparrow-unwrapped
pcsclite
];
multiPkgs = pkgs: with pkgs; [
pcsclite
];
extraInstallCommands = ''
mkdir -p $out/share
ln -s ${sparrow-unwrapped}/share/applications $out/share
ln -s ${sparrow-unwrapped}/share/icons $out/share
mkdir -p $out/etc/udev
ln -s ${sparrow-unwrapped}/etc/udev/rules.d $out/etc/udev/rules.d
'';
meta = sparrow-unwrapped.meta;
}

View File

@ -12314,8 +12314,13 @@ with pkgs;
sozu = callPackage ../servers/sozu { };
sparrow = callPackage ../applications/blockchains/sparrow {
openimajgrabber = callPackage ../applications/blockchains/sparrow/openimajgrabber.nix { };
sparrow-unwrapped = callPackage ../applications/blockchains/sparrow {
openimajgrabber = callPackage ../applications/blockchains/sparrow/openimajgrabber.nix {};
openjdk = openjdk.override { enableJavaFX = true; };
};
sparrow = callPackage ../applications/blockchains/sparrow/fhsenv.nix {
buildFHSUserEnv = buildFHSUserEnvBubblewrap;
};
sparsehash = callPackage ../development/libraries/sparsehash { };