diff --git a/pkgs/development/tools/etcdctl/default.nix b/pkgs/development/tools/etcdctl/default.nix index a2236f6c843f..5fea6012ccfb 100644 --- a/pkgs/development/tools/etcdctl/default.nix +++ b/pkgs/development/tools/etcdctl/default.nix @@ -1,26 +1,19 @@ -{ stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }: +{ lib, goPackages, fetchFromGitHub }: -stdenv.mkDerivation rec { +with goPackages; + +buildGoPackage rec { version = "0.4.5"; name = "etcdctl-${version}"; - - src = import ./deps.nix { - inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub; + goPackagePath = "github.com/coreos/etcdctl"; + src = fetchFromGitHub { + owner = "coreos"; + repo = "etcdctl"; + rev = "v${version}"; + sha256 = "1kbri59ppil52v7s992q8r6i1zk9lac0s2w00z2lsgc9w1z59qs0"; }; - buildInputs = [ go ]; - - buildPhase = '' - export GOPATH=$src - go build -v -o etcdctl github.com/coreos/etcdctl - ''; - - installPhase = '' - mkdir -p $out/bin - mv etcdctl $out/bin - ''; - - meta = with stdenv.lib; { + meta = with lib; { description = "A simple command line client for etcd"; homepage = http://coreos.com/using-coreos/etcd/; license = licenses.asl20; diff --git a/pkgs/development/tools/etcdctl/deps.nix b/pkgs/development/tools/etcdctl/deps.nix deleted file mode 100644 index c76a162f193b..000000000000 --- a/pkgs/development/tools/etcdctl/deps.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ stdenv, lib, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }: - -let - goDeps = [ - { - root = "github.com/coreos/etcdctl"; - src = fetchFromGitHub { - owner = "coreos"; - repo = "etcdctl"; - rev = "a1b38c93245542e340971189750baef7a55d306e"; - sha256 = "1kbri59ppil52v7s992q8r6i1zk9lac0s2w00z2lsgc9w1z59qs0"; - }; - } - ]; - -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); -}