44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
# This file was generated by go2nix.
|
|
{ stdenv, lib, goPackages, fetchgit, fetchhg, fetchbzr, fetchsvn }:
|
|
|
|
with builtins;
|
|
with goPackages;
|
|
|
|
let
|
|
depToSrc = jsonDep:
|
|
{
|
|
inherit (jsonDep) goPackagePath;
|
|
src = if jsonDep.fetch.type == "git" then
|
|
fetchgit {
|
|
inherit (jsonDep.fetch) url rev sha256;
|
|
}
|
|
else {};
|
|
};
|
|
|
|
importGodeps = { depsFile, filterPackages ? [] }:
|
|
let
|
|
deps = lib.importJSON depsFile;
|
|
external = filter (d: d ? include) deps;
|
|
direct = filter (d: d ? goPackagePath && (length filterPackages == 0 || elem d.goPackagePath filterPackages)) deps;
|
|
in
|
|
concatLists (map importGodeps (map (d: { depsFile = ./. + d.include; filterPackages = d.packages; }) external)) ++ (map depToSrc direct);
|
|
|
|
godeps = importGodeps { depsFile = ./deps.json; };
|
|
in
|
|
|
|
buildGoPackage rec {
|
|
name = "gawp-${version}";
|
|
version = "20160121-${stdenv.lib.strings.substring 0 7 rev}";
|
|
rev = "5db2d8faa220e8d6eaf8677354bd197bf621ff7f";
|
|
|
|
goPackagePath = "github.com/martingallagher/gawp";
|
|
|
|
src = fetchgit {
|
|
inherit rev;
|
|
url = "https://github.com/martingallagher/gawp";
|
|
sha256 = "0r4bp4w3s9rkmg3cz9jb7d6ngh7vfj31p9kbim6mhilxvmgjk4ly";
|
|
};
|
|
|
|
extraSrcs = godeps;
|
|
}
|