2022-03-31 18:11:26 +00:00
|
|
|
{ version ? "release", lib, fetchFromGitHub, buildGoModule }:
|
2021-01-22 15:24:22 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
versionSpec = rec {
|
|
|
|
release = rec {
|
|
|
|
pname = "bee";
|
2021-02-11 13:32:45 +00:00
|
|
|
version = "0.5.0";
|
2021-01-22 15:24:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2021-02-11 13:32:45 +00:00
|
|
|
sha256 = "sha256-3Oy9RhgMPRFjUs3Dj8XUhAqoxx5BTi32OiK4Y8YEG2Q=";
|
2023-09-13 04:44:46 +00:00
|
|
|
vendorHash = "sha256-w5ZijaK8Adt1ZHPMmXqRWq0v0jdprRKRu03rePtZLXA=";
|
2021-01-22 15:24:22 +00:00
|
|
|
};
|
2021-02-11 13:32:45 +00:00
|
|
|
"0.5.0" = release;
|
2021-01-22 15:24:22 +00:00
|
|
|
"0.4.1" = rec {
|
|
|
|
pname = "bee";
|
|
|
|
version = "0.4.1";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "1bmgbav52pcb5p7cgq9756512fzfqhjybyr0dv538plkqx47mpv7";
|
2023-09-13 04:44:46 +00:00
|
|
|
vendorHash = "sha256-UGxiCXWlIfnhRZZBMYcWXFj77pqvJkb5wOllSdQeaUg=";
|
2021-01-22 15:24:22 +00:00
|
|
|
};
|
|
|
|
}.${version};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
buildGoModule {
|
2023-09-13 04:44:46 +00:00
|
|
|
inherit (versionSpec) pname version vendorHash;
|
2021-01-22 15:24:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ethersphere";
|
|
|
|
repo = "bee";
|
|
|
|
inherit (versionSpec) rev sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
subPackages = [ "cmd/bee" ];
|
|
|
|
|
|
|
|
# no symbol table, no debug info, and pass the commit for the version string
|
2021-08-22 04:29:05 +00:00
|
|
|
ldflags = lib.optionals ( lib.hasAttr "goVersionString" versionSpec)
|
|
|
|
[ "-s" "-w" "-X=github.com/ethersphere/bee.commit=${versionSpec.goVersionString}" ];
|
2021-01-22 15:24:22 +00:00
|
|
|
|
|
|
|
# Mimic the bee Makefile: without disabling CGO, two (transitive and
|
|
|
|
# unused) dependencies would fail to compile.
|
|
|
|
preBuild = ''
|
|
|
|
export CGO_ENABLED=0
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib/systemd/system
|
|
|
|
cp packaging/bee.service $out/lib/systemd/system/
|
|
|
|
cp packaging/bee-get-addr $out/bin/
|
|
|
|
chmod +x $out/bin/bee-get-addr
|
|
|
|
patchShebangs $out/bin/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-01-07 06:42:23 +00:00
|
|
|
homepage = "https://github.com/ethersphere/bee";
|
2021-01-22 15:24:22 +00:00
|
|
|
description = "Ethereum Swarm Bee";
|
|
|
|
longDescription = ''
|
|
|
|
A decentralised storage and communication system for a sovereign digital society.
|
|
|
|
|
|
|
|
Swarm is a system of peer-to-peer networked nodes that create a decentralised storage and communication service. The system is economically self-sustaining due to a built-in incentive system enforced through smart contracts on the Ethereum blockchain.
|
|
|
|
|
|
|
|
Bee is a Swarm node implementation, written in Go.
|
|
|
|
'';
|
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ attila-lendvai ];
|
|
|
|
};
|
|
|
|
}
|