From e11147a254bb60c9d8d327ba1c3b4d0ff80de973 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 | 14 +-- pkgs/joinmarket/get-sha256.sh | 5 +- pkgs/python-packages/default.nix | 9 +- 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 | 119 ++++++++++++++++++++ 8 files changed, 132 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 9d6fa3aba..1a6ded702 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 ]; @@ -21,6 +18,7 @@ let in stdenv.mkDerivation { pname = "joinmarket"; + format = "pyproject"; inherit version src; buildInputs = [ pythonEnv ]; @@ -35,7 +33,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 @@ -43,6 +40,7 @@ stdenv.mkDerivation { cpBin wallet-tool.py cpBin yg-privacyenhanced.py cpBin genwallet.py + cpBin bond-calculator.py chmod +x -R "$out/bin" patchShebangs "$out/bin" @@ -61,7 +59,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 ]; platforms = platforms.unix; }; } diff --git a/pkgs/joinmarket/get-sha256.sh b/pkgs/joinmarket/get-sha256.sh index 6314778d2..5fef55f7f 100755 --- a/pkgs/joinmarket/get-sha256.sh +++ b/pkgs/joinmarket/get-sha256.sh @@ -6,9 +6,10 @@ newVersion=$(curl -s "https://api.github.com/repos/joinmarket-org/joinmarket-cli # Fetch release and GPG-verify the content hash tmpdir=$(mktemp -d /tmp/joinmarket-verify-gpg.XXX) -repo=$tmpdir/repo +repo="${tmpdir}/repo" git clone --depth 1 --branch "${newVersion}" -c advice.detachedHead=false https://github.com/joinmarket-org/joinmarket-clientserver "$repo" -export GNUPGHOME=$tmpdir +export GNUPGHOME="$tmpdir" + echo "Fetching Adam Gibson's key" gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 2B6FC204D9BF332D062B461A141001A1AF77F20B 2> /dev/null echo "Fetch Kristaps Kaupe's key" diff --git a/pkgs/python-packages/default.nix b/pkgs/python-packages/default.nix index 33e8d404d..0709ef3e8 100644 --- a/pkgs/python-packages/default.nix +++ b/pkgs/python-packages/default.nix @@ -3,7 +3,7 @@ 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; }; + joinmarketPkg = pkg: callPackage pkg { inherit (nbPkgs.joinmarket) version src format; }; in { txzmq = callPackage ./txzmq {}; @@ -20,10 +20,7 @@ rec { runes = callPackage ./runes {}; sha256 = callPackage ./sha256 {}; - joinmarketbase = joinmarketPkg ./jmbase; - joinmarketclient = joinmarketPkg ./jmclient; - joinmarketbitcoin = joinmarketPkg ./jmbitcoin; - joinmarketdaemon = joinmarketPkg ./jmdaemon; + joinmarket = joinmarketPkg ./joinmarket; ## Specific versions of packages that already exist in nixpkgs @@ -35,6 +32,8 @@ rec { # This was the case for NixOS <= 23.05. # TODO-EXTERNAL: Remove when this is resolved: # https://github.com/NixOS/nixpkgs/issues/253131 + + # TODO: issue closed? check if this can be removed buildPythonPackageWithDepsCheck = attrs: self.buildPythonPackage (attrs // { dontUsePypaInstall = true; diff --git a/pkgs/python-packages/jmbase/default.nix b/pkgs/python-packages/jmbase/default.nix deleted file mode 100644 index 7f8d13a71..000000000 --- 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 5c72ed6ae..000000000 --- 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 617c6781b..000000000 --- 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 5a6f7209b..000000000 --- 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 000000000..9b1a69d55 --- /dev/null +++ b/pkgs/python-packages/joinmarket/default.nix @@ -0,0 +1,119 @@ +{ version +, src +, format +, lib + +# TODO: Is it necessary to use this deps check? +#, buildPythonPackageWithDepsCheck +, buildPythonPackage +, pythonOlder +, pythonAtLeast +, pythonRelaxDepsHook +, pytestCheckHook +, setuptools +, fetchurl +, chromalog +, cryptography +, service-identity +, twisted +, txtorcon +, python-bitcointx +, argon2_cffi +, autobahn +, bencoderpyx +, klein +, mnemonic +, pyjwt +, werkzeug +, libnacl +, pyopenssl +}: + +#buildPythonPackageWithDepsCheck rec { +buildPythonPackage rec { + pname = "joinmarket"; + inherit version src format; + + # From v0.9.11, the Python older than v3.8 is not supported. Python v3.12 is + # still not supported. + disabled = (pythonOlder "3.8") || (pythonAtLeast "3.13"); + + nativeBuildInputs = [ + setuptools + pythonRelaxDepsHook + ]; + + 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 + + ]; + + # FIXME: Try to use twisted and service-identity from nixpkgs-23.11 (there are lower stable versions)? + # E.g. alternative approach + #postPatch = '' + # substituteInPlace pyproject.toml \ + # --replace-warn 'twisted==23.10.0' 'twisted==24.3.0' \ + # --replace-warn 'service-identity==21.1.0' 'service-identity==24.1.0' \ + # --replace-warn 'cryptography==41.0.6' 'cryptography==42.0.5' + #''; + pythonRelaxDeps = [ + "twisted" + "service-identity" + "cryptography" + ]; + + # Modify pyproject.toml to include only specific modules. Do not include 'jmqtui'. + postPatch = '' + sed -i '/^\[tool.setuptools.packages.find\]/a include = ["jmbase", "jmbitcoin", "jmclient", "jmdaemon"]' pyproject.toml + ''; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + # The unit tests can't be run in a Nix build environment + doCheck = false; + + # TODO: Only enable tests for jmbitcoin + #doCheck = true; + #disabledTestPaths = [ + # "test/" + #]; + #pytestFlagsArray = [ + # "-k 'jmbitcoin'" + #]; + + pythonImportsCheck = [ + "jmbase" + "jmclient" + "jmbitcoin" + "jmdaemon" + ]; + + meta = with lib; { + homepage = "https://github.com/Joinmarket-Org/joinmarket-clientserver"; + maintainers = with maintainers; [ seberm ]; + license = licenses.gpl3; + }; +}