diff --git a/pkgs/development/mobile/gomobile/default.nix b/pkgs/development/mobile/gomobile/default.nix index caeb524af94e0..cc56271ee9d36 100644 --- a/pkgs/development/mobile/gomobile/default.nix +++ b/pkgs/development/mobile/gomobile/default.nix @@ -1,33 +1,81 @@ { - lib, - fetchFromGitHub, + # stdenv, + # lib, + fetchgit, buildGoModule, - gitUpdater, + # zlib, + # makeWrapper, + # xcodeenv, + # androidenv, + # xcodeWrapperArgs ? { }, + # xcodeWrapper ? xcodeenv.composeXcodeWrapper xcodeWrapperArgs, + # withAndroidPkgs ? true, + # androidsdk ? ( + # (androidenv.composeAndroidPackages { + # includeNDK = true; + # }).androidsdk + # ), }: -let - pname = "cast-text"; - version = "0.1.3"; - src = fetchFromGitHub { - owner = "piqoni"; - repo = "cast-text"; - rev = "v${version}"; - hash = "sha256-PU0haunPF2iAHehRT76wHXsdv5oWiBH7xVJUkQbr4QU="; - }; -in buildGoModule { - inherit pname version src; + pname = "gomobile"; + version = "0-unstable-2024-11-08"; - vendorHash = "sha256-rTrV8qzGHNNC8wTLJVerOHwFjjCGQmVuHOnBJxuYMAk="; + vendorHash = "sha256-xTl8Hd1+GHRrUb5ktl1XkQa18HsHIeEvnujrcK0E1eU="; - passthru.updateScript = gitUpdater { - rev-prefix = "v"; + src = fetchgit { + rev = "fa514ef75a0ffd7d89e1b4c9b45485f7bb39cf83"; + name = "gomobile"; + url = "https://go.googlesource.com/mobile"; + hash = "sha256-vuh6Rw27WA0BId+8JUqZdNCrvUH2sorvv15eIK/GFj0="; }; - meta = { - description = "Zero latency, easy-to-use full-text news terminal reader"; - homepage = "https://github.com/piqoni/cast-text"; - license = with lib.licenses; [ mit ]; - maintainers = with lib.maintainers; [ aucub ]; - platforms = lib.platforms.all; - }; + # subPackages = [ + # "bind" + # "cmd/gobind" + # "cmd/gomobile" + # ]; + + # # Fails with: go: cannot find GOROOT directory + # doCheck = false; + + # nativeBuildInputs = [ makeWrapper ]; # ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodeWrapper ]; + + # # Prevent a non-deterministic temporary directory from polluting the resulting object files + # postPatch = '' + # substituteInPlace cmd/gomobile/env.go --replace \ + # 'tmpdir, err = ioutil.TempDir("", "gomobile-work-")' \ + # 'tmpdir = filepath.Join(os.Getenv("NIX_BUILD_TOP"), "gomobile-work")' + # substituteInPlace cmd/gomobile/init.go --replace \ + # 'tmpdir, err = ioutil.TempDir(gomobilepath, "work-")' \ + # 'tmpdir = filepath.Join(os.Getenv("NIX_BUILD_TOP"), "work")' + # ''; + + # # Necessary for GOPATH when using gomobile. + # postInstall = '' + # mkdir -p $out/src/golang.org/x + # ln -s $src $out/src/golang.org/x/mobile + # ''; + + # postFixup = + # '' + # for bin in $(ls $out/bin); do + # wrapProgram $out/bin/$bin \ + # --suffix GOPATH : $out \ + # '' + # + lib.optionalString withAndroidPkgs '' + # --prefix PATH : "${androidsdk}/bin" \ + # --set-default ANDROID_HOME "${androidsdk}/libexec/android-sdk" \ + # '' + # + '' + # --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" + # done + # ''; + + # meta = { + # description = "Tool for building and running mobile apps written in Go"; + # homepage = "https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile"; + # mainProgram = "gomobile"; + # license = lib.licenses.bsd3; + # maintainers = with lib.maintainers; [ jakubgs ]; + # }; }