···
1
-
{ stdenv, lib, fetchgit, buildGoModule, zlib, makeWrapper, xcodeenv, androidenv
2
-
, xcodeWrapperArgs ? { }
3
-
, xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs
4
-
, withAndroidPkgs ? true
5
-
, androidPkgs ? androidenv.composeAndroidPackages {
10
+
xcodeWrapperArgs ? { },
11
+
xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs,
12
+
withAndroidPkgs ? true,
13
+
androidPkgs ? androidenv.composeAndroidPackages {
ndkVersion = "22.1.7171670";
···
sha256 = "sha256-AOR/p+DW83f2+BOxm2rFXBCrotcIyunK3UzQ/dnauWY=";
23
-
subPackages = [ "bind" "cmd/gobind" "cmd/gomobile" ];
# Fails with: go: cannot find GOROOT directory
28
-
nativeBuildInputs = [ makeWrapper ]
29
-
++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodeWrapper ];
41
+
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
48
-
for bin in $(ls $out/bin); do
49
-
wrapProgram $out/bin/$bin \
50
-
--suffix GOPATH : $out \
51
-
'' + lib.optionalString withAndroidPkgs ''
52
-
--prefix PATH : "${androidPkgs.androidsdk}/bin" \
53
-
--set-default ANDROID_HOME "${androidPkgs.androidsdk}/libexec/android-sdk" \
55
-
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}"
61
+
for bin in $(ls $out/bin); do
62
+
wrapProgram $out/bin/$bin \
63
+
--suffix GOPATH : $out \
65
+
+ lib.optionalString withAndroidPkgs ''
66
+
--prefix PATH : "${androidPkgs.androidsdk}/bin" \
67
+
--set-default ANDROID_HOME "${androidPkgs.androidsdk}/libexec/android-sdk" \
70
+
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}"
description = "Tool for building and running mobile apps written in Go";