From 0e94ed144d3bba2bfe45dc961897154a38354ac4 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Wed, 4 Feb 2015 13:49:49 +0100 Subject: Port etcdctl to buildGoPackage --- pkgs/development/tools/etcdctl/default.nix | 29 +++++++++++------------------ pkgs/development/tools/etcdctl/deps.nix | 27 --------------------------- 2 files changed, 11 insertions(+), 45 deletions(-) delete mode 100644 pkgs/development/tools/etcdctl/deps.nix (limited to 'pkgs/development') diff --git a/pkgs/development/tools/etcdctl/default.nix b/pkgs/development/tools/etcdctl/default.nix index a2236f6c843..5fea6012ccf 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 c76a162f193..00000000000 --- 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); -} -- cgit 1.4.1