From 06095dd1850a9044e1a62bbe8adc0780853f170f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Aug 2023 16:07:23 -0700 Subject: [PATCH] hsd: use buildNpmPackage --- pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 65 ------------------- pkgs/development/node-packages/overrides.nix | 3 - pkgs/tools/misc/hsd/default.nix | 42 ++++++++++++ pkgs/top-level/all-packages.nix | 2 + 6 files changed, 45 insertions(+), 69 deletions(-) create mode 100644 pkgs/tools/misc/hsd/default.nix diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 707426d2c22c..659da294d8dd 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -69,6 +69,7 @@ mapAliases { glob = pkgs.node-glob; # added 2023-08-18 inherit (pkgs) graphqurl; # added 2023-08-19 gtop = pkgs.gtop; # added 2023-07-31 + inherit (pkgs) hsd; # added 2023-08-19 inherit (pkgs) html-minifier; # added 2023-08-19 inherit (pkgs) htmlhint; # added 2023-08-19 hueadm = pkgs.hueadm; # added 2023-07-31 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index be3b1826e120..fc20a7e253eb 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -146,7 +146,6 @@ , "gulp-cli" , "he" , "http-server" -, "hsd" , "hs-airdrop" , "hs-client" , "ijavascript" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index f73e03a6be10..07e1ada73e84 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -90929,71 +90929,6 @@ in bypassCache = true; reconstructLock = true; }; - hsd = nodeEnv.buildNodePackage { - name = "hsd"; - packageName = "hsd"; - version = "6.0.0"; - src = fetchurl { - url = "https://registry.npmjs.org/hsd/-/hsd-6.0.0.tgz"; - sha512 = "pl57FtFzrzL2jSsiOru/WvHLlhZuwM+wskme/d6S96tpj5kOmp8zJaNsZ9bpXZBIawtrM6+hZvRaNvE4pegbLg=="; - }; - dependencies = [ - sources."bcfg-0.2.1" - (sources."bcrypto-5.4.0" // { - dependencies = [ - sources."bufio-1.0.7" - ]; - }) - sources."bcurl-0.2.0" - sources."bdb-1.4.0" - sources."bdns-0.1.5" - sources."bevent-0.1.5" - sources."bfile-0.2.3" - (sources."bfilter-1.0.5" // { - dependencies = [ - sources."bufio-1.0.7" - ]; - }) - sources."bheep-0.1.5" - sources."binet-0.3.7" - sources."blgr-0.2.0" - sources."blru-0.1.6" - sources."blst-0.1.5" - sources."bmutex-0.1.6" - (sources."bns-0.15.0" // { - dependencies = [ - sources."bufio-1.0.7" - ]; - }) - sources."brq-0.1.8" - sources."bs32-0.1.6" - sources."bsert-0.0.12" - sources."bsock-0.1.9" - sources."bsocks-0.2.6" - sources."btcp-0.1.5" - sources."budp-0.1.6" - sources."buffer-map-0.0.7" - sources."bufio-1.2.0" - sources."bupnp-0.2.6" - sources."bval-0.1.8" - sources."bweb-0.2.0" - sources."goosig-0.10.0" - sources."loady-0.0.5" - sources."mrmr-0.1.10" - sources."n64-0.2.10" - sources."unbound-0.4.3" - sources."urkel-1.0.3" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "Cryptocurrency bike-shed"; - homepage = "https://github.com/handshake-org/hsd"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; hs-airdrop = nodeEnv.buildNodePackage { name = "hs-airdrop"; packageName = "hs-airdrop"; diff --git a/pkgs/development/node-packages/overrides.nix b/pkgs/development/node-packages/overrides.nix index 4b94a320362e..b6d6aa9e6e38 100644 --- a/pkgs/development/node-packages/overrides.nix +++ b/pkgs/development/node-packages/overrides.nix @@ -118,9 +118,6 @@ final: prev: { ''; }; - hsd = prev.hsd.override { - buildInputs = [ final.node-gyp-build pkgs.unbound ]; - }; ijavascript = prev.ijavascript.override (oldAttrs: { preRebuild = '' diff --git a/pkgs/tools/misc/hsd/default.nix b/pkgs/tools/misc/hsd/default.nix new file mode 100644 index 000000000000..ebbba1de07d8 --- /dev/null +++ b/pkgs/tools/misc/hsd/default.nix @@ -0,0 +1,42 @@ +{ lib +, stdenv +, buildNpmPackage +, fetchFromGitHub +, python3 +, unbound +, darwin +}: + +buildNpmPackage rec { + pname = "hsd"; + version = "6.0.0"; + + src = fetchFromGitHub { + owner = "handshake-org"; + repo = "hsd"; + rev = "v${version}"; + hash = "sha256-4dWCCybhcdrkLFqUVTajRMnhzNgjpXUN2a+TNIi+Dqo="; + }; + + npmDepsHash = "sha256-ZbBu9hnRsC9LrHozny3OlHhgcDbp6ACjXRV4UHneHQc="; + + nativeBuildInputs = [ + python3 + ] ++ lib.optionals stdenv.isDarwin [ + darwin.cctools + ]; + + buildInputs = [ + unbound + ]; + + dontNpmBuild = true; + + meta = { + changelog = "https://github.com/handshake-org/hsd/blob/${src.rev}/CHANGELOG.md"; + description = "Implementation of the Handshake protocol"; + homepage = "https://github.com/handshake-org/hsd"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ d-xo ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8f9b93adf075..b0f2a3212da0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1833,6 +1833,8 @@ with pkgs; hostmux = callPackage ../tools/misc/hostmux { }; + hsd = callPackage ../tools/misc/hsd { }; + httm = darwin.apple_sdk_11_0.callPackage ../tools/filesystems/httm { }; hyperpotamus = callPackage ../tools/misc/hyperpotamus { };