Skip to content

Commit

Permalink
python-bitcointx: 1.1.3 -> 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
erikarvstedt committed Dec 14, 2023
1 parent 1c07c5f commit 85bbdb8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
16 changes: 1 addition & 15 deletions pkgs/python-packages/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
nbPkgs: python3:
let
# Ignore eval error:
# `OpenSSL 1.1 is reaching its end of life on 2023/09/11 and cannot
# be supported through the NixOS 23.05 release cycle.`
# TODO-EXTERNAL: consider removing when
# https://github.com/Simplexum/python-bitcointx/issues/76 and
# https://github.com/JoinMarket-Org/joinmarket-clientserver#1451 are resolved.
openssl_1_1 = python3.pkgs.pkgs.openssl_1_1.overrideAttrs (old: {
meta = builtins.removeAttrs old.meta [ "knownVulnerabilities" ];
});
in
rec {
pyPkgsOverrides = self: super: let
inherit (self) callPackage;
Expand All @@ -30,10 +19,7 @@ rec {
# Packages only used by joinmarket
bencoderpyx = callPackage ./bencoderpyx {};
chromalog = callPackage ./chromalog {};
python-bitcointx = callPackage ./python-bitcointx {
inherit (nbPkgs) secp256k1;
openssl = openssl_1_1;
};
python-bitcointx = callPackage ./python-bitcointx { inherit (nbPkgs) secp256k1; };
runes = callPackage ./runes {};
sha256 = callPackage ./sha256 {};

Expand Down
5 changes: 5 additions & 0 deletions pkgs/python-packages/jmbitcoin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ buildPythonPackageWithDepsCheck rec {
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 ];
Expand Down
14 changes: 7 additions & 7 deletions pkgs/python-packages/python-bitcointx/default.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{ lib, buildPythonPackageWithDepsCheck, fetchurl, secp256k1, openssl }:
{ lib, buildPythonPackageWithDepsCheck, fetchFromGitHub, secp256k1 }:

buildPythonPackageWithDepsCheck rec {
pname = "python-bitcointx";
version = "1.1.3";
version = "1.1.4";

src = fetchurl {
url = "https://github.com/Simplexum/${pname}/archive/${pname}-v${version}.tar.gz";
sha256 = "f0f487c29619df0e94a04f6deb3dc950ff9954c072017bd3eda90f73c24f0953";
src = fetchFromGitHub {
owner = "Simplexum";
repo = "python-bitcointx";
rev = "python-bitcointx-v${version}";
hash = "sha256-y8/cyLQr3GbpYqCg8LKTfyL0OX7eIo5AxjdFTWTqHmk=";
};

patchPhase = ''
for path in core/secp256k1.py tests/test_load_secp256k1.py; do
substituteInPlace "bitcointx/$path" \
--replace "ctypes.util.find_library('secp256k1')" "'${secp256k1}/lib/libsecp256k1.so'"
done
substituteInPlace bitcointx/core/key.py \
--replace "ctypes.util.find_library('ssl')" "'${openssl.out}/lib/libssl.so'"
'';

meta = with lib; {
Expand Down
8 changes: 5 additions & 3 deletions pkgs/python-packages/python-bitcointx/get-sha256.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cd "$TMPDIR"
echo "Fetching latest release"
git clone https://github.com/simplexum/python-bitcointx 2> /dev/null
cd python-bitcointx
latest=python-bitcointx-v1.1.3
latest=python-bitcointx-v1.1.4
echo "Latest release is ${latest}"

# GPG verification
Expand All @@ -19,6 +19,8 @@ gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys B17A35BBA187395784E2A6B3
echo "Verifying latest release"
git verify-commit "$latest"

git checkout -q "tags/$latest"
rm -rf .git

echo "tag: $latest"
# The prefix option is necessary because GitHub prefixes the archive contents in this format
echo "sha256: $(git archive --format tar.gz --prefix=python-bitcointx-"$latest"/ "$latest" | sha256sum | cut -d\ -f1)"
nix hash path .

0 comments on commit 85bbdb8

Please sign in to comment.