From 5e091757657b0dea0a0988f47ad1aa45190f238d Mon Sep 17 00:00:00 2001 From: Matthew Sackman Date: Thu, 27 Feb 2014 19:11:08 +0100 Subject: [PATCH] add serfdom (close #1672) --- lib/maintainers.nix | 1 + pkgs/servers/serfdom/default.nix | 101 +++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 104 insertions(+) create mode 100644 pkgs/servers/serfdom/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 195e77b58204..7bef639ca7c7 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -44,6 +44,7 @@ matejc = "Matej Cotman "; modulistic = "Pablo Costa "; mornfall = "Petr Ročkai "; + msackman = "Matthew Sackman "; ocharles = "Oliver Charles "; offline = "Jaka Hudoklin "; orbitz = "Malcolm Matalka "; diff --git a/pkgs/servers/serfdom/default.nix b/pkgs/servers/serfdom/default.nix new file mode 100644 index 000000000000..13c878888e29 --- /dev/null +++ b/pkgs/servers/serfdom/default.nix @@ -0,0 +1,101 @@ +{ stdenv, fetchurl, fetchgit, go, lib }: + +let + goDeps = [ + { + dir = "github.com/hashicorp"; + name = "serf"; + rev = "21113c8207d8e02b7ff738c9be80fcaabf67251d"; + sha256 = "10lmgb0caffp0x02nriahyfq9p6qkhr8carfq38m8cjxqxs2v0nk"; + } + { + dir = "github.com/armon"; + name = "go-metrics"; + rev = "8ceaed1d0bc3a25db6e65e79ee4f895013313c17"; + sha256 = "1yzajmx26br4812m9gz4v7qj6fcmhg4a9jz9l3i20hh2x06srmpg"; + } + { + dir = "github.com/hashicorp"; + name = "logutils"; + rev = "8e0820fe7ac5eb2b01626b1d99df47c5449eb2d8"; + sha256 = "184lnn7x1v3xvj6zz1rg9s0252wkkd59kij2iyrrm7y80bym2jys"; + } + { + dir = "github.com/hashicorp"; + name = "memberlist"; + rev = "825ad4aca57c7323e8dadde149bfdec9d9621ffe"; + sha256 = "0mm0hm2kncafq5ml58ki7ilh3b47ni0w19n50ilahhhm4lsfry7z"; + } + { + dir = "github.com/ugorji"; + name = "go"; + rev = "cdeae7b76625959e4164eab9eb303087a794f2cc"; + sha256 = "0pcjlbhp6vxnksy12rav6c8bvi2v010407l5hibxqdvnampvhlkb"; + } + { + dir = "github.com/mitchellh"; + name = "cli"; + rev = "69f0b65ce53b27f729b1b807b88dc88007f41dd3"; + sha256 = "0hnnqd8vg5ca2hglkrj141ba2akdh7crl2lsrgz8d6ipw6asszx3"; + } + { + dir = "github.com/armon"; + name = "mdns"; + rev = "17be83de467449f38a8395c30534a9cf0c03e5ea"; + sha256 = "1fhb6vldclgdx9aqqh1gl87cl5sw3nbq9b7mibkljhbk3cdajyxn"; + } + { + dir = "github.com/miekg"; + name = "dns"; + rev = "5eec7f362c392f0a7eaadea69b13667d665feb82"; + sha256 = "0irlzhd78qmn3lyfbkxmwajv0mm6jp6x0cg7hb9hyj6d01ynlv09"; + } + { + dir = "github.com/mitchellh"; + name = "mapstructure"; + rev = "57bb2fa7a7e00b26c80e4c4b0d4f15a210d94039"; + sha256 = "13lvd5vw8y6h5zl3samkrb7237kk778cky7k7ys1cm46mfd957zy"; + } + ]; + createGoPathCmds = + lib.concatStrings + (map (desc: + let + fetched = fetchgit { url = "https://${desc.dir}/${desc.name}"; + inherit (desc) rev sha256; }; + in '' + mkdir -p $GOPATH/src/${desc.dir} + ln -s ${fetched} $GOPATH/src/${desc.dir}/${desc.name} + '') goDeps); +in + stdenv.mkDerivation rec { + version = "0.4.1"; + name = "serfdom-${version}"; + + src = fetchurl { + url = "https://github.com/hashicorp/serf/archive/v${version}.tar.gz"; + sha256 = "0f4fxhw2r31ks9rs9h3wx9lsymnp8szk0gzggvibwhl2bm6kn6d8"; + }; + + buildInputs = [ go ]; + + buildPhase = '' + mkdir $TMPDIR/go + export GOPATH=$TMPDIR/go + ${createGoPathCmds} + go build -v -o bin/serf + ''; + + installPhase = '' + ensureDir $out/bin + cp bin/serf $out/bin + ''; + + meta = with stdenv.lib; { + description = "Serf is a service discovery and orchestration tool that is decentralized, highly available, and fault tolerant"; + homepage = http://www.serfdom.io/; + license = licenses.mpl20; + maintainers = [ maintainers.msackman ]; + platforms = platforms.linux; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ae6742ebd2f2..bbfaee4dafd7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6396,6 +6396,8 @@ let libunwind = null; }); + serfdom = callPackage ../servers/serfdom { }; + shishi = callPackage ../servers/shishi { }; sipwitch = callPackage ../servers/sip/sipwitch { };