mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-29 00:27:49 +03:00
Port etcdctl to buildGoPackage
This commit is contained in:
parent
a594f0bcd5
commit
0e94ed144d
@ -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";
|
version = "0.4.5";
|
||||||
name = "etcdctl-${version}";
|
name = "etcdctl-${version}";
|
||||||
|
goPackagePath = "github.com/coreos/etcdctl";
|
||||||
src = import ./deps.nix {
|
src = fetchFromGitHub {
|
||||||
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
|
owner = "coreos";
|
||||||
|
repo = "etcdctl";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "1kbri59ppil52v7s992q8r6i1zk9lac0s2w00z2lsgc9w1z59qs0";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ go ];
|
meta = with lib; {
|
||||||
|
|
||||||
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; {
|
|
||||||
description = "A simple command line client for etcd";
|
description = "A simple command line client for etcd";
|
||||||
homepage = http://coreos.com/using-coreos/etcd/;
|
homepage = http://coreos.com/using-coreos/etcd/;
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
|
@ -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);
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user