···
-
{ stdenv, lib, fetchgit, buildGoModule, zlib, makeWrapper, xcodeenv, androidenv
-
, xcodeWrapperArgs ? { }
-
, xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs
-
, withAndroidPkgs ? true
-
, androidPkgs ? androidenv.composeAndroidPackages {
ndkVersion = "22.1.7171670";
···
sha256 = "sha256-AOR/p+DW83f2+BOxm2rFXBCrotcIyunK3UzQ/dnauWY=";
-
subPackages = [ "bind" "cmd/gobind" "cmd/gomobile" ];
# Fails with: go: cannot find GOROOT directory
-
nativeBuildInputs = [ makeWrapper ]
-
++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodeWrapper ];
# Prevent a non-deterministic temporary directory from polluting the resulting object files
···
ln -s $src $out/src/golang.org/x/mobile
-
for bin in $(ls $out/bin); do
-
wrapProgram $out/bin/$bin \
-
--suffix GOPATH : $out \
-
'' + lib.optionalString withAndroidPkgs ''
-
--prefix PATH : "${androidPkgs.androidsdk}/bin" \
-
--set-default ANDROID_HOME "${androidPkgs.androidsdk}/libexec/android-sdk" \
-
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}"
description = "Tool for building and running mobile apps written in Go";
···
+
xcodeWrapperArgs ? { },
+
xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs,
+
withAndroidPkgs ? true,
+
androidPkgs ? androidenv.composeAndroidPackages {
ndkVersion = "22.1.7171670";
···
sha256 = "sha256-AOR/p+DW83f2+BOxm2rFXBCrotcIyunK3UzQ/dnauWY=";
# Fails with: go: cannot find GOROOT directory
+
nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodeWrapper ];
# Prevent a non-deterministic temporary directory from polluting the resulting object files
···
ln -s $src $out/src/golang.org/x/mobile
+
for bin in $(ls $out/bin); do
+
wrapProgram $out/bin/$bin \
+
--suffix GOPATH : $out \
+
+ lib.optionalString withAndroidPkgs ''
+
--prefix PATH : "${androidPkgs.androidsdk}/bin" \
+
--set-default ANDROID_HOME "${androidPkgs.androidsdk}/libexec/android-sdk" \
+
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}"
description = "Tool for building and running mobile apps written in Go";