Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haveno: init #311314

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions build.log

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions pkgs/applications/blockchains/haveno/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{ lib, stdenv, fetchFromGitHub, jdk, jre, gradle, bash, coreutils, substituteAll, nixosTests, fetchpatch, writeText, makeDesktopItem, ... }:

Check failure on line 1 in pkgs/applications/blockchains/haveno/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `bash` is not used

Check failure on line 1 in pkgs/applications/blockchains/haveno/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `coreutils` is not used

Check failure on line 1 in pkgs/applications/blockchains/haveno/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `fetchpatch` is not used

Check failure on line 1 in pkgs/applications/blockchains/haveno/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `jre` is not used

Check failure on line 1 in pkgs/applications/blockchains/haveno/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `nixosTests` is not used

Check failure on line 1 in pkgs/applications/blockchains/haveno/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `substituteAll` is not used

Check failure on line 1 in pkgs/applications/blockchains/haveno/default.nix

View workflow job for this annotation

GitHub Actions / exp-nixf-tidy-check

sema-def-not-used

definition `writeText` is not used

# Refer to https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/gradle.section.md for packaging details

stdenv.mkDerivation rec {
pname = "haveno";
version = "1.0.10";

src = fetchFromGitHub {
owner = "haveno-dex";
repo = "haveno";
rev = version;
hash = "sha256-DGpnDyCrelGpyQ8RPhHu7WlQEcNyRHblr8IAUFGVL+A=";
};

nativeBuildInputs = [ gradle jdk ];

mitmCache = gradle.fetchDeps {
inherit pname;
data = ./deps.json;
};

desktopItem = makeDesktopItem {
name = "Haveno";
desktopName = "Haveno";
exec = "haveno";
icon = "haveno";
# REVIEW(Krey): Propose which category this should be using
categories = [ "Game" ];
};

gradleFlags = [
# TODO(Krey): Is this needed?
"-Dorg.gradle.java.home=${jdk}"

"-Dfile.encoding=utf-8"
];

# REVIEW(Krey): No idea what this should be set to
# gradleBuildTask = "shadowJar";

# will run the gradleCheckTask (defaults to "test")
doCheck = true;

# TODO(Krey): Implementation blocked by https://github.com/haveno-dex/haveno/issues/1206
# installPhase = ''
# mkdir -p $out/{bin,share/haveno}
# cp build/libs/haveno-all.jar $out/share/haveno

# makeWrapper ${jre}/bin/java $out/bin/haveno \
# --add-flags "-jar $out/share/haveno/haveno-all.jar"

# cp ${src}/haveno.1 $out/share/man/man1
# '';

meta = {
description = "A decentralized monero exchange network";
homepage = "https://haveno.exchange";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ juaningan emmanuelrosa ];
platforms = with lib.platforms; linux;
# changelog = "";
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryBytecode # mitm cache
];
};
}
21 changes: 21 additions & 0 deletions pkgs/applications/blockchains/haveno/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq gnused gnupg common-updater-scripts

set -eu -o pipefail

version="$(curl -s https://api.github.com/repos/bisq-network/bisq/releases| jq '.[] | {name,prerelease} | select(.prerelease==false) | limit(1;.[])' | sed 's/[\"v]//g' | head -n 1)"
depname="Bisq-64bit-$version.deb"
src="https://github.com/bisq-network/bisq/releases/download/v$version/$depname"
signature="$src.asc"

pushd $(mktemp -d --suffix=-bisq-updater)
export GNUPGHOME=$PWD/gnupg
mkdir -m 700 -p "$GNUPGHOME"
curl -L -o "$depname" -- "$src"
curl -L -o signature.asc -- "$signature"
curl https://bisq.network/pubkey/E222AA02.asc | gpg --import
gpg --batch --verify signature.asc "$depname"
sha256=$(nix-prefetch-url --type sha256 "file://$PWD/$depname")
popd

update-source-version bisq-desktop "$version" "$sha256"
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35259,6 +35259,8 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) CoreData IOKit PCSC;
};

haveno = callPackage ../applications/blockchains/haveno { };

monero-gui = libsForQt5.callPackage ../applications/blockchains/monero-gui { };

napari = with python3Packages; toPythonApplication napari;
Expand Down
Loading