3
0
Fork 0
forked from mirrors/nixpkgs

Port influxdb-backup to buildGoPackage

This commit is contained in:
Luca Bruno 2015-02-05 10:55:50 +01:00
parent 5e4f771a07
commit d1b3874733
3 changed files with 24 additions and 54 deletions

View file

@ -1,28 +1,22 @@
{ stdenv, lib, go, fetchgit }:
{ lib, goPackages, fetchgit }:
stdenv.mkDerivation rec {
version = "4556edb";
name = "influxdb-backup-${version}";
with goPackages;
src = import ./deps.nix {
inherit stdenv lib fetchgit;
buildGoPackage rec {
rev = "4556edbffa914a8c17fa1fa1564962a33c6c7596";
name = "influxdb-backup-${lib.strings.substring 0 7 rev}";
goPackagePath = "github.com/eckardt/influxdb-backup";
src = fetchgit {
inherit rev;
url = https://github.com/eckardt/influxdb-backup.git;
sha256 = "2928063e6dfe4be7b69c8e72e4d6a5fc557f0c75e9625fadf607d59b8e80e34b";
};
buildInputs = [ go ];
subPackages = [ "influxdb-dump" "influxdb-restore" ];
buildPhase = ''
export GOPATH=$src
go build -v -o influxdb-dump github.com/eckardt/influxdb-backup/influxdb-dump
go build -v -o influxdb-restore github.com/eckardt/influxdb-backup/influxdb-restore
'';
buildInputs = [ eckardt.influxdb-go ];
installPhase = ''
mkdir -p $out/bin
mv influxdb-dump $out/bin
mv influxdb-restore $out/bin
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Backup and Restore for InfluxDB";
homepage = https://github.com/eckardt/influxdb-backup;
maintainers = with maintainers; [ offline ];

View file

@ -1,35 +0,0 @@
# This file was generated by go2nix.
{ stdenv, lib, fetchgit }:
let
goDeps = [
{
root = "github.com/eckardt/influxdb-backup";
src = fetchgit {
url = https://github.com/eckardt/influxdb-backup.git;
rev = "4556edbffa914a8c17fa1fa1564962a33c6c7596";
sha256 = "2928063e6dfe4be7b69c8e72e4d6a5fc557f0c75e9625fadf607d59b8e80e34b";
};
}
{
root = "github.com/eckardt/influxdb-go";
src = fetchgit {
url = https://github.com/eckardt/influxdb-go.git;
rev = "8b71952efc257237e077c5d0672e936713bad38f";
sha256 = "5318c7e1131ba2330c90a1b67855209e41d3c77811b1d212a96525b42d391f6e";
};
}
];
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);
}

View file

@ -435,6 +435,17 @@ let self = _self // overrides; _self = with self; {
};
};
eckardt.influxdb-go = buildGoPackage rec {
rev = "8b71952efc257237e077c5d0672e936713bad38f";
name = "influxdb-go-${stdenv.lib.strings.substring 0 7 rev}";
goPackagePath = "github.com/eckardt/influxdb-go";
src = fetchgit {
inherit rev;
url = "https://${goPackagePath}.git";
sha256 = "5318c7e1131ba2330c90a1b67855209e41d3c77811b1d212a96525b42d391f6e";
};
};
iochan = buildGoPackage rec {
rev = "b584a329b193e206025682ae6c10cdbe03b0cd77";
name = "iochan-${stdenv.lib.strings.substring 0 7 rev}";