diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2016-10-29 05:18:16 +0200 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2016-10-29 05:18:16 +0200 |
commit | 2d934fdffb66ec60b9cd05d6e67a219e8db319e1 (patch) | |
tree | 7a9ed4e795b0ceff95bf6b9bf628543a316a73a5 /pkgs/development/go-modules | |
parent | ff04adf871189b47f13f574aa0f2a0ca0877aca6 (diff) |
buildGoPackage: introduce extraSrcPaths option
This option adds support for including sources from existing gopaths into
the gopath of the package to build.
Diffstat (limited to 'pkgs/development/go-modules')
-rw-r--r-- | pkgs/development/go-modules/generic/default.nix | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index d4d2790b2a3c..e076c6ca90ed 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -1,4 +1,4 @@ -{ go, govers, parallel, lib, fetchgit, fetchhg }: +{ go, govers, parallel, lib, fetchgit, fetchhg, rsync }: { name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}, preFixup ? "" @@ -17,6 +17,10 @@ # Extra sources to include in the gopath , extraSrcs ? [ ] +# Extra gopaths containing src subfolder +# with sources to include in the gopath +, extraSrcPaths ? [ ] + # go2nix dependency file , goDeps ? null @@ -86,6 +90,9 @@ go.stdenv.mkDerivation ( mv goPath/* "go/src/${goPackagePath}" rmdir goPath + '') + (lib.optionalString (extraSrcPaths != []) '' + ${rsync}/bin/rsync -a ${lib.concatMapStrings (p: "${p}/src") extraSrcPaths} go + '') + '' export GOPATH=$NIX_BUILD_TOP/go:$GOPATH |