2022-05-05 18:43:09 +00:00
|
|
|
{ stdenv, lib, fetchurl, applyPatches, fetchpatch, python3, nbPythonPackageOverrides, pkgs }:
|
2019-08-05 07:50:55 +00:00
|
|
|
|
|
|
|
let
|
2022-05-27 09:06:14 +00:00
|
|
|
version = "0.9.6";
|
2022-02-22 13:49:19 +00:00
|
|
|
src = applyPatches {
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/JoinMarket-Org/joinmarket-clientserver/archive/v${version}.tar.gz";
|
2022-05-27 09:06:14 +00:00
|
|
|
sha256 = "040qj3abqkk74zyi5yav1ijlh5cmd49wlymald2lzk35adnx804g";
|
2022-02-22 13:49:19 +00:00
|
|
|
};
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2022-05-27 09:06:14 +00:00
|
|
|
# https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1264
|
|
|
|
name = "use-twisted-22.4.0";
|
|
|
|
url = "https://patch-diff.githubusercontent.com/raw/JoinMarket-Org/joinmarket-clientserver/pull/1264.patch";
|
|
|
|
sha256 = "1nlyhc5myph9239d5zczsl4jan4qj4ggy0l1f39jv0ihjbjhcks5";
|
2022-02-22 13:49:19 +00:00
|
|
|
})
|
|
|
|
];
|
2019-08-05 07:50:55 +00:00
|
|
|
};
|
|
|
|
|
2022-05-05 18:43:09 +00:00
|
|
|
pyPkgs = (python3.override {
|
|
|
|
packageOverrides = (self: super: let
|
|
|
|
overrides = nbPythonPackageOverrides self super;
|
|
|
|
in
|
|
|
|
overrides // {
|
|
|
|
cryptography = overrides.cryptography_3_3_2;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}).pkgs;
|
|
|
|
|
|
|
|
runtimePackages = with pyPkgs; [
|
2019-08-05 07:50:55 +00:00
|
|
|
joinmarketbase
|
|
|
|
joinmarketclient
|
|
|
|
joinmarketbitcoin
|
|
|
|
joinmarketdaemon
|
2021-01-17 12:24:57 +00:00
|
|
|
matplotlib # for ob-watcher
|
2019-08-05 07:50:55 +00:00
|
|
|
];
|
|
|
|
|
2020-11-12 17:07:38 +00:00
|
|
|
pythonEnv = python3.withPackages (_: runtimePackages);
|
2019-08-05 07:50:55 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "joinmarket";
|
2020-10-18 15:41:45 +00:00
|
|
|
inherit version src;
|
2019-08-05 07:50:55 +00:00
|
|
|
|
|
|
|
buildInputs = [ pythonEnv ];
|
|
|
|
|
2021-01-01 12:57:35 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2019-08-05 07:50:55 +00:00
|
|
|
|
|
|
|
# add-utxo.py -> bin/jm-add-utxo
|
|
|
|
cpBin() {
|
2021-01-01 12:57:35 +00:00
|
|
|
cp scripts/$1 $out/bin/jm-''${1%.py}
|
2019-08-05 07:50:55 +00:00
|
|
|
}
|
2021-01-01 12:57:35 +00:00
|
|
|
|
|
|
|
cp scripts/joinmarketd.py $out/bin/joinmarketd
|
2019-08-05 07:50:55 +00:00
|
|
|
cpBin add-utxo.py
|
|
|
|
cpBin convert_old_wallet.py
|
|
|
|
cpBin receive-payjoin.py
|
|
|
|
cpBin sendpayment.py
|
|
|
|
cpBin sendtomany.py
|
|
|
|
cpBin tumbler.py
|
|
|
|
cpBin wallet-tool.py
|
|
|
|
cpBin yg-privacyenhanced.py
|
2020-10-18 15:41:45 +00:00
|
|
|
cpBin genwallet.py
|
2019-08-05 07:50:55 +00:00
|
|
|
|
|
|
|
chmod +x -R $out/bin
|
|
|
|
patchShebangs $out/bin
|
2021-01-17 12:24:57 +00:00
|
|
|
|
2021-08-12 13:29:19 +00:00
|
|
|
## ob-watcher
|
|
|
|
obw=$out/libexec/joinmarket-ob-watcher
|
|
|
|
install -D scripts/obwatch/ob-watcher.py $obw/ob-watcher
|
|
|
|
patchShebangs $obw/ob-watcher
|
|
|
|
ln -s $obw/ob-watcher $out/bin/jm-ob-watcher
|
|
|
|
|
2021-03-09 16:48:25 +00:00
|
|
|
# These files must be placed in the same dir as ob-watcher
|
2021-08-12 13:29:19 +00:00
|
|
|
cp -r scripts/obwatch/{orderbook.html,sybil_attack_calculations.py,vendor} $obw
|
2019-08-05 07:50:55 +00:00
|
|
|
'';
|
2021-12-14 18:51:23 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Bitcoin CoinJoin implementation";
|
|
|
|
homepage = "https://github.com/JoinMarket-Org/joinmarket-clientserver";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ nixbitcoin ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2019-08-05 07:50:55 +00:00
|
|
|
}
|