Skip to content

Commit

Permalink
joinmarket: 0.9.10 -> 0.9.11
Browse files Browse the repository at this point in the history
  • Loading branch information
seberm committed May 19, 2024
1 parent ae97ef7 commit e11147a
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 170 deletions.
14 changes: 6 additions & 8 deletions pkgs/joinmarket/default.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
{ 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
];

pythonEnv = python3.withPackages (_: runtimePackages);
in
stdenv.mkDerivation {
pname = "joinmarket";
format = "pyproject";
inherit version src;

buildInputs = [ pythonEnv ];
Expand All @@ -35,14 +33,14 @@ 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
cpBin tumbler.py
cpBin wallet-tool.py
cpBin yg-privacyenhanced.py
cpBin genwallet.py
cpBin bond-calculator.py
chmod +x -R "$out/bin"
patchShebangs "$out/bin"
Expand All @@ -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;
};
}
5 changes: 3 additions & 2 deletions pkgs/joinmarket/get-sha256.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 4 additions & 5 deletions pkgs/python-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand All @@ -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

Expand All @@ -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;
Expand Down
28 changes: 0 additions & 28 deletions pkgs/python-packages/jmbase/default.nix

This file was deleted.

27 changes: 0 additions & 27 deletions pkgs/python-packages/jmbitcoin/default.nix

This file was deleted.

67 changes: 0 additions & 67 deletions pkgs/python-packages/jmclient/default.nix

This file was deleted.

33 changes: 0 additions & 33 deletions pkgs/python-packages/jmdaemon/default.nix

This file was deleted.

119 changes: 119 additions & 0 deletions pkgs/python-packages/joinmarket/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}

0 comments on commit e11147a

Please sign in to comment.