summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2014-06-24 15:20:21 -0700
committerJohn Wiegley <johnw@newartisans.com>2014-06-24 15:20:21 -0700
commitff4c3444bc593e11a27466a49b8098fa0e2204ce (patch)
treefb4346f6c5c71d987c3d64546976b81ed8c2566f /pkgs/development/tools
parent6cc6b6f6eabbc371e888141bfe63f4eed795c74b (diff)
parent70ce3ee861347d05b0f9e96a4f3c508d96e87e58 (diff)
downloadnixlib-ff4c3444bc593e11a27466a49b8098fa0e2204ce.tar
nixlib-ff4c3444bc593e11a27466a49b8098fa0e2204ce.tar.gz
nixlib-ff4c3444bc593e11a27466a49b8098fa0e2204ce.tar.bz2
nixlib-ff4c3444bc593e11a27466a49b8098fa0e2204ce.tar.lz
nixlib-ff4c3444bc593e11a27466a49b8098fa0e2204ce.tar.xz
nixlib-ff4c3444bc593e11a27466a49b8098fa0e2204ce.tar.zst
nixlib-ff4c3444bc593e11a27466a49b8098fa0e2204ce.zip
Merge pull request #3063 from cstrahan/etcdctl
add etcdctl package
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/etcdctl/default.nix30
-rw-r--r--pkgs/development/tools/etcdctl/deps.nix27
2 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/development/tools/etcdctl/default.nix b/pkgs/development/tools/etcdctl/default.nix
new file mode 100644
index 000000000000..a37ef26f5412
--- /dev/null
+++ b/pkgs/development/tools/etcdctl/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  version = "0.4.3";
+  name = "etcdctl-${version}";
+
+  src = import ./deps.nix {
+    inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
+  };
+
+  buildInputs = [ go ];
+
+  buildPhase = ''
+    export GOPATH=$src
+    go build -v -o etcdctl github.com/coreos/etcdctl
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    mv etcdctl $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A simple command line client for etcd";
+    homepage = http://coreos.com/using-coreos/etcd/;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/tools/etcdctl/deps.nix b/pkgs/development/tools/etcdctl/deps.nix
new file mode 100644
index 000000000000..98bdda95a433
--- /dev/null
+++ b/pkgs/development/tools/etcdctl/deps.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
+
+let
+  goDeps = [
+    {
+      root = "github.com/coreos/etcdctl";
+      src = fetchFromGitHub {
+        owner = "coreos";
+        repo = "etcdctl";
+        rev = "061135b2a02797a6b3c2b6c01183517c1bc76a2c";
+        sha256 = "1hl9cz9ygr2k4d67qj9q1xj0n64b28qjy5sv7zylgg9h9ag2j2p4";
+      };
+    }
+  ];
+
+in
+
+stdenv.mkDerivation rec {
+  name = "go-deps";
+
+  buildCommand =
+    lib.concatStrings
+      (map (dep: ''
+              mkdir -p $out/src/`dirname ${dep.root}`
+              ln -s ${dep.src} $out/src/${dep.root}
+            '') goDeps);
+}