summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAttila Lendvai <attila@lendvai.name>2021-01-22 16:24:22 +0100
committerAttila Lendvai <attila@lendvai.name>2021-02-01 10:55:01 +0100
commit0dc5f1f6d66c128a777b00e9a49a806d32d17c6f (patch)
treec5c29e0c0619e9aa8265e20a3c3e3fbc551e9096
parent4543b333456ce78e1957724c7889be5b3bccc38c (diff)
bee: init at 0.4.2
-rw-r--r--pkgs/applications/networking/bee/bee.nix77
-rw-r--r--pkgs/top-level/all-packages.nix8
2 files changed, 85 insertions, 0 deletions
diff --git a/pkgs/applications/networking/bee/bee.nix b/pkgs/applications/networking/bee/bee.nix
new file mode 100644
index 000000000000..5ffff9187500
--- /dev/null
+++ b/pkgs/applications/networking/bee/bee.nix
@@ -0,0 +1,77 @@
+{ version ? "release", stdenv, lib, fetchFromGitHub, buildGoModule, coreutils }:
+
+let
+
+ versionSpec = rec {
+ unstable = rec {
+ pname = "bee-unstable";
+ version = "2021-01-30";
+ rev = "824636a2c2629c329ab10275cef6a0b7395343ad";
+ goVersionString = "g" + builtins.substring 0 7 rev; # this seems to be some kind of standard of git describe...
+ sha256 = "0ly1yqjq29arbak8lchdradf39l5bmxpbfir6ljjc7nyqdxz0sxg";
+ vendorSha256 = "0w1db7xpissdpf8i5bb96z92zbasj5x9kk3kcisxn0dwla6n55n3";
+ };
+ release = rec {
+ pname = "bee";
+ version = "0.4.2";
+ rev = "refs/tags/v${version}";
+ sha256 = "1jg7aivsgdb9bm87dlmwpf1g6gla8j6v55xmzs8h5xmwqcybbmag";
+ vendorSha256 = "0w1db7xpissdpf8i5bb96z92zbasj5x9kk3kcisxn0dwla6n55n3";
+ };
+ "0.4.2" = release;
+ "0.4.1" = rec {
+ pname = "bee";
+ version = "0.4.1";
+ rev = "refs/tags/v${version}";
+ sha256 = "1bmgbav52pcb5p7cgq9756512fzfqhjybyr0dv538plkqx47mpv7";
+ vendorSha256 = "0j393va4jrg9q3wlc9mgkbpgnn2w2s3k2hcn8phzj8d5fl4n4v2h";
+ };
+ }.${version};
+
+in
+
+buildGoModule {
+ inherit (versionSpec) pname version vendorSha256;
+
+ src = fetchFromGitHub {
+ owner = "ethersphere";
+ repo = "bee";
+ inherit (versionSpec) rev sha256;
+ };
+
+ nativeBuildInputs = [ coreutils ];
+
+ subPackages = [ "cmd/bee" ];
+
+ # no symbol table, no debug info, and pass the commit for the version string
+ buildFlags = lib.optionalString ( lib.hasAttr "goVersionString" versionSpec)
+ "-ldflags -s -ldflags -w -ldflags -X=github.com/ethersphere/bee.commit=${versionSpec.goVersionString}";
+
+ # 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; {
+ homepage = "https://swarm.ethereum.org/";
+ 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 ];
+ };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 5c2e5225ece6..e72c391cc682 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2908,6 +2908,14 @@ in
beanstalkd = callPackage ../servers/beanstalkd { };
+ bee = callPackage ../applications/networking/bee/bee.nix {
+ version = "release";
+ };
+
+ bee-unstable = bee.override {
+ version = "unstable";
+ };
+
beets = callPackage ../tools/audio/beets {
pythonPackages = python3Packages;
};