joinmarket: add pkg and local dependencies

This commit is contained in:
nixbitcoin
2019-08-05 09:50:55 +02:00
parent a9c163c624
commit f00d1d24c5
14 changed files with 331 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
{ lib, buildPythonPackage, fetchurl, secp256k1, openssl }:
buildPythonPackage rec {
pname = "python-bitcointx";
version = "1.1.1";
src = fetchurl {
url = "https://github.com/Simplexum/${pname}/archive/${pname}-v${version}.tar.gz";
sha256 = "35edd694473517508367338888633954eaa91b2622b3caada8fd3030ddcacba2";
};
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; {
description = "Interface to Bitcoin transaction data structures";
homepage = "https://github.com/Simplexum/python-bitcointx";
maintainers = with maintainers; [ nixbitcoin ];
license = licenses.gpl3;
};
}

View File

@@ -0,0 +1,24 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p git gnupg
set -euo pipefail
TMPDIR="$(mktemp -d -p /tmp)"
trap "rm -rf $TMPDIR" EXIT
cd $TMPDIR
echo "Fetching latest release"
git clone https://github.com/simplexum/python-bitcointx 2> /dev/null
cd python-bitcointx
latest=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest release is ${latest}"
# GPG verification
export GNUPGHOME=$TMPDIR
echo "Fetching Dimitry Pethukov's Key"
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys B17A35BBA187395784E2A6B32301D26BDC15160D 2> /dev/null
echo "Verifying latest release"
git verify-commit ${latest}
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)"