From 1cbe9558972f1bb93d01d6fe857dc79570de1b46 Mon Sep 17 00:00:00 2001 From: Otto Sabart Date: Sun, 19 May 2024 21:00:00 +0200 Subject: [PATCH] joinmarket: 0.9.10 -> 0.9.11 --- pkgs/joinmarket/default.nix | 12 +-- pkgs/python-packages/bencoderpyx/default.nix | 2 +- pkgs/python-packages/chromalog/default.nix | 2 +- pkgs/python-packages/default.nix | 6 +- pkgs/python-packages/jmbase/default.nix | 28 ----- pkgs/python-packages/jmbitcoin/default.nix | 27 ----- pkgs/python-packages/jmclient/default.nix | 67 ------------ pkgs/python-packages/jmdaemon/default.nix | 33 ------ pkgs/python-packages/joinmarket/default.nix | 103 +++++++++++++++++++ 9 files changed, 110 insertions(+), 170 deletions(-) delete mode 100644 pkgs/python-packages/jmbase/default.nix delete mode 100644 pkgs/python-packages/jmbitcoin/default.nix delete mode 100644 pkgs/python-packages/jmclient/default.nix delete mode 100644 pkgs/python-packages/jmdaemon/default.nix create mode 100644 pkgs/python-packages/joinmarket/default.nix diff --git a/pkgs/joinmarket/default.nix b/pkgs/joinmarket/default.nix index 1b430dc..1e27c05 100644 --- a/pkgs/joinmarket/default.nix +++ b/pkgs/joinmarket/default.nix @@ -1,19 +1,16 @@ { stdenv, lib, fetchFromGitHub, python3, nbPython3PackagesJoinmarket }: let - version = "0.9.10"; + version = "0.9.11"; src = fetchFromGitHub { owner = "joinmarket-org"; repo = "joinmarket-clientserver"; rev = "v${version}"; - hash = "sha256-uNweI7VKC16CFn8MNOAvadcSnTjK/Fznfy4qctM5PR8="; + hash = "sha256-sYHhhp9BZz8udJuVAfwdt474OQPiye2ae5DOn5v5yEQ="; }; runtimePackages = with nbPython3PackagesJoinmarket; [ - joinmarketbase - joinmarketclient - joinmarketbitcoin - joinmarketdaemon + joinmarket matplotlib # for ob-watcher ]; @@ -35,7 +32,6 @@ stdenv.mkDerivation { cp scripts/joinmarketd.py "$out/bin/joinmarketd" cpBin add-utxo.py - cpBin convert_old_wallet.py cpBin receive-payjoin.py cpBin sendpayment.py cpBin sendtomany.py @@ -62,7 +58,7 @@ stdenv.mkDerivation { description = "Bitcoin CoinJoin implementation"; homepage = "https://github.com/JoinMarket-Org/joinmarket-clientserver"; license = licenses.gpl3Only; - maintainers = with maintainers; [ nixbitcoin ]; + maintainers = with maintainers; [ seberm nixbitcoin ]; platforms = platforms.unix; }; } diff --git a/pkgs/python-packages/bencoderpyx/default.nix b/pkgs/python-packages/bencoderpyx/default.nix index ff773aa..afbe399 100644 --- a/pkgs/python-packages/bencoderpyx/default.nix +++ b/pkgs/python-packages/bencoderpyx/default.nix @@ -16,7 +16,7 @@ buildPythonPackageWithDepsCheck rec { meta = with lib; { description = "A fast bencode implementation in Cython"; homepage = "https://github.com/whtsky/bencoder.pyx"; - maintainers = with maintainers; [ nixbitcoin ]; + maintainers = with maintainers; [ seberm nixbitcoin ]; license = licenses.bsd3; }; } diff --git a/pkgs/python-packages/chromalog/default.nix b/pkgs/python-packages/chromalog/default.nix index 5a125c1..4aaedbf 100644 --- a/pkgs/python-packages/chromalog/default.nix +++ b/pkgs/python-packages/chromalog/default.nix @@ -18,7 +18,7 @@ buildPythonPackageWithDepsCheck rec { meta = with lib; { description = "Enhance Python with colored logging"; homepage = "https://github.com/freelan-developers/chromalog"; - maintainers = with maintainers; [ nixbitcoin ]; + maintainers = with maintainers; [ seberm nixbitcoin ]; license = licenses.mit; }; } diff --git a/pkgs/python-packages/default.nix b/pkgs/python-packages/default.nix index 33e8d40..b984f4e 100644 --- a/pkgs/python-packages/default.nix +++ b/pkgs/python-packages/default.nix @@ -3,7 +3,6 @@ rec { pyPkgsOverrides = self: super: let inherit (self) callPackage; clightningPkg = pkg: callPackage pkg { inherit (nbPkgs.pinned) clightning; }; - joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src; }; in { txzmq = callPackage ./txzmq {}; @@ -20,10 +19,7 @@ rec { runes = callPackage ./runes {}; sha256 = callPackage ./sha256 {}; - joinmarketbase = joinmarketPkg ./jmbase; - joinmarketclient = joinmarketPkg ./jmclient; - joinmarketbitcoin = joinmarketPkg ./jmbitcoin; - joinmarketdaemon = joinmarketPkg ./jmdaemon; + joinmarket = callPackage ./joinmarket { inherit (nbPkgs.joinmarket) version src; }; ## Specific versions of packages that already exist in nixpkgs diff --git a/pkgs/python-packages/jmbase/default.nix b/pkgs/python-packages/jmbase/default.nix deleted file mode 100644 index 7f8d13a..0000000 --- a/pkgs/python-packages/jmbase/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ version, src, lib, buildPythonPackageWithDepsCheck, fetchurl, future, twisted, service-identity, chromalog, txtorcon, pyaes }: - -buildPythonPackageWithDepsCheck rec { - pname = "joinmarketbase"; - inherit version src; - - postUnpack = "sourceRoot=$sourceRoot/jmbase"; - - propagatedBuildInputs = [ future twisted service-identity chromalog txtorcon pyaes ]; - - patchPhase = '' - sed -i 's|twisted==22.4.0|twisted==23.8.0|' setup.py - sed -i 's|service-identity==21.1.0|service-identity==23.1.0|' setup.py - ''; - - # Has no tests - doCheck = false; - - pythonImportsCheck = [ - "jmbase" - ]; - - meta = with lib; { - homepage = "https://github.com/Joinmarket-Org/joinmarket-clientserver"; - maintainers = with maintainers; [ nixbitcoin ]; - license = licenses.gpl3; - }; -} diff --git a/pkgs/python-packages/jmbitcoin/default.nix b/pkgs/python-packages/jmbitcoin/default.nix deleted file mode 100644 index 5c72ed6..0000000 --- a/pkgs/python-packages/jmbitcoin/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ version, src, lib, buildPythonPackageWithDepsCheck, fetchurl, python-bitcointx, joinmarketbase, pytestCheckHook }: - -buildPythonPackageWithDepsCheck rec { - pname = "joinmarketbitcoin"; - inherit version src; - - postUnpack = "sourceRoot=$sourceRoot/jmbitcoin"; - - propagatedBuildInputs = [ python-bitcointx ]; - - checkInputs = [ joinmarketbase ]; - - nativeCheckInputs = [ - pytestCheckHook - ]; - - patchPhase = '' - substituteInPlace setup.py \ - --replace "'python-bitcointx==1.1.3'" "'python-bitcointx==1.1.4'" - ''; - - meta = with lib; { - homepage = "https://github.com/Joinmarket-Org/joinmarket-clientserver"; - maintainers = with maintainers; [ nixbitcoin ]; - license = licenses.gpl3; - }; -} diff --git a/pkgs/python-packages/jmclient/default.nix b/pkgs/python-packages/jmclient/default.nix deleted file mode 100644 index 617c678..0000000 --- a/pkgs/python-packages/jmclient/default.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ - pipBuildHook -, version -, src -, lib -, buildPythonPackageWithDepsCheck -, argon2_cffi -, autobahn -, bencoderpyx -, configparser -, fetchurl -, future -, joinmarketbase -, joinmarketbitcoin -, joinmarketdaemon -, klein -, mnemonic -, pyjwt -, werkzeug -}: - -buildPythonPackageWithDepsCheck rec { - pname = "joinmarketclient"; - inherit version src; - - postUnpack = "sourceRoot=$sourceRoot/jmclient"; - - propagatedBuildInputs = [ - argon2_cffi - autobahn - bencoderpyx - configparser - future - joinmarketbase - joinmarketbitcoin - joinmarketdaemon - klein - mnemonic - pyjwt - werkzeug - ]; - - patchPhase = '' - substituteInPlace setup.py \ - --replace "'klein==20.6.0'" "'klein>=20.6.0'" - substituteInPlace setup.py \ - --replace "'argon2_cffi==21.3.0'" "'argon2_cffi==23.1.0'" - substituteInPlace setup.py \ - --replace "'pyjwt==2.4.0'" "'pyjwt==2.8.0'" - substituteInPlace setup.py \ - --replace "'werkzeug==2.2.3'" "'werkzeug==2.3.8'" - ''; - - # The unit tests can't be run in a Nix build environment - doCheck = false; - - pythonImportsCheck = [ - "jmclient" - ]; - - meta = with lib; { - description = "Client library for Bitcoin coinjoins"; - homepage = "https://github.com/Joinmarket-Org/joinmarket-clientserver"; - maintainers = with maintainers; [ nixbitcoin ]; - license = licenses.gpl3; - }; -} diff --git a/pkgs/python-packages/jmdaemon/default.nix b/pkgs/python-packages/jmdaemon/default.nix deleted file mode 100644 index 5a6f720..0000000 --- a/pkgs/python-packages/jmdaemon/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ version, src, lib, buildPythonPackageWithDepsCheck, fetchurl, txtorcon, cryptography, pyopenssl, libnacl, joinmarketbase }: - -buildPythonPackageWithDepsCheck rec { - pname = "joinmarketdaemon"; - inherit version src; - - postUnpack = "sourceRoot=$sourceRoot/jmdaemon"; - - propagatedBuildInputs = [ txtorcon cryptography pyopenssl libnacl joinmarketbase ]; - - patchPhase = '' - substituteInPlace setup.py \ - --replace "'txtorcon==22.0.0'" "'txtorcon==23.5.0'" - substituteInPlace setup.py \ - --replace "'libnacl==1.8.0'" "'libnacl==2.1.0'" - substituteInPlace setup.py \ - --replace "'cryptography==41.0.2" "'cryptography==41.0.3" - ''; - - # The unit tests can't be run in a Nix build environment - doCheck = false; - - pythonImportsCheck = [ - "jmdaemon" - ]; - - meta = with lib; { - description = "Client library for Bitcoin coinjoins"; - homepage = "https://github.com/Joinmarket-Org/joinmarket-clientserver"; - maintainers = with maintainers; [ nixbitcoin ]; - license = licenses.gpl3; - }; -} diff --git a/pkgs/python-packages/joinmarket/default.nix b/pkgs/python-packages/joinmarket/default.nix new file mode 100644 index 0000000..3f4b009 --- /dev/null +++ b/pkgs/python-packages/joinmarket/default.nix @@ -0,0 +1,103 @@ +{ version +, src +, lib +, buildPythonPackageWithDepsCheck +, pythonOlder +, pythonAtLeast +, pytestCheckHook +, setuptools +, fetchurl +, chromalog +, cryptography +, service-identity +, twisted +, txtorcon +, python-bitcointx +, argon2_cffi +, autobahn +, bencoderpyx +, klein +, mnemonic +, pyjwt +, werkzeug +, libnacl +, pyopenssl +}: + +buildPythonPackageWithDepsCheck rec { + pname = "joinmarket"; + inherit version src; + format = "pyproject"; + + # Since v0.9.11, Python older than v3.8 is not supported. Python v3.12 is + # still not supported. + disabled = (pythonOlder "3.8") || (pythonAtLeast "3.12"); + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + # base jm packages + chromalog + cryptography + service-identity + twisted + txtorcon + + # jmbitcoin + python-bitcointx + + # jmclient + argon2_cffi + autobahn + bencoderpyx + klein + mnemonic + pyjwt + werkzeug + + # jmdaemon + libnacl + pyopenssl + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'txtorcon==23.11.0' 'txtorcon==23.5.0' \ + --replace-fail 'twisted==23.10.0' 'twisted==23.8.0' \ + --replace-fail 'service-identity==21.1.0' 'service-identity==23.1.0' \ + --replace-fail 'cryptography==41.0.6' 'cryptography==41.0.3' + + # Modify pyproject.toml to include only specific modules. Do not include 'jmqtui'. + sed -i '/^\[tool.setuptools.packages.find\]/a include = ["jmbase", "jmbitcoin", "jmclient", "jmdaemon"]' pyproject.toml + ''; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ + "test/jmbase/" + "test/jmbitcoin/" + "test/jmdaemon/test_enc_wrapper.py" + + # Other tests require preconfigured bitcoind and miniircd + # https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/master/docs/TESTING.md + # "test/jmclient/" + # "test/jmdaemon/" + ]; + + pythonImportsCheck = [ + "jmbase" + "jmbitcoin" + "jmclient" + "jmdaemon" + ]; + + meta = with lib; { + homepage = "https://github.com/Joinmarket-Org/joinmarket-clientserver"; + maintainers = with maintainers; [ seberm nixbitcoin ]; + license = licenses.gpl3; + }; +}