diff options
Diffstat (limited to 'pkgs/development/compilers/go/gox.nix')
-rw-r--r-- | pkgs/development/compilers/go/gox.nix | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/development/compilers/go/gox.nix b/pkgs/development/compilers/go/gox.nix new file mode 100644 index 00000000000..da40b7570fe --- /dev/null +++ b/pkgs/development/compilers/go/gox.nix @@ -0,0 +1,54 @@ +{ stdenv, lib, go, fetchFromGitHub }: + +let + goDeps = [ + { + root = "github.com/mitchellh/gox"; + src = fetchFromGitHub { + owner = "mitchellh"; + repo = "gox"; + rev = "c7329055e2aeb253a947e5cc876586ff4ca19199"; + sha256 = "0zhb88jjxqn3sdc4bpzvajqvgi9igp5gk03q12gaksaxhy2wl4jy"; + }; + } + { + root = "github.com/mitchellh/iochan"; + src = fetchFromGitHub { + owner = "mitchellh"; + repo = "iochan"; + rev = "b584a329b193e206025682ae6c10cdbe03b0cd77"; + sha256 = "1fcwdhfci41ibpng2j4c1bqfng578cwzb3c00yw1lnbwwhaq9r6b"; + }; + } + ]; + sources = 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); + }; +in + +stdenv.mkDerivation rec { + name = "gox"; + + src = sources; + + propagatedBuildInputs = [ go ]; + + installPhase = '' + mkdir -p $out/bin + export GOPATH=$src + go build -v -o $out/bin/gox github.com/mitchellh/gox + ''; + + meta = with lib; { + description = "A simple, no-frills tool for Go cross compilation that behaves a lot like standard go build"; + homepage = https://github.com/mitchellh/gox; + maintainers = with maintainers; [ cstrahan ]; + platforms = platforms.unix; + }; +} |