nix: drop our gomobile in favor of one from nixpkgs
I've created PRs to include gomobile in official nixpkgs: * https://github.com/NixOS/nixpkgs/pull/116747 * https://github.com/NixOS/nixpkgs/pull/131042 Hence I'm removing our own implementation to use that one. Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
5e9c7da96c
commit
a1ede3528f
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
self: super:
|
self: super:
|
||||||
|
|
||||||
let inherit (super) stdenv stdenvNoCC callPackage;
|
let
|
||||||
|
inherit (super) stdenv stdenvNoCC callPackage;
|
||||||
in {
|
in {
|
||||||
# Fix for MacOS
|
# Fix for MacOS
|
||||||
mkShell = super.mkShell.override { stdenv = stdenvNoCC; };
|
mkShell = super.mkShell.override { stdenv = stdenvNoCC; };
|
||||||
|
@ -40,6 +41,9 @@ in {
|
||||||
version = "11.5";
|
version = "11.5";
|
||||||
allowHigher = true;
|
allowHigher = true;
|
||||||
};
|
};
|
||||||
|
gomobile = super.gomobile.override {
|
||||||
|
androidPkgs = self.androidEnvCustom.compose;
|
||||||
|
};
|
||||||
|
|
||||||
# Android environement
|
# Android environement
|
||||||
androidEnvCustom = callPackage ./pkgs/android-sdk { };
|
androidEnvCustom = callPackage ./pkgs/android-sdk { };
|
||||||
|
@ -48,7 +52,6 @@ in {
|
||||||
|
|
||||||
# Custom packages
|
# Custom packages
|
||||||
aapt2 = callPackage ./pkgs/aapt2 { };
|
aapt2 = callPackage ./pkgs/aapt2 { };
|
||||||
gomobile = callPackage ./pkgs/gomobile { };
|
|
||||||
patchMavenSources = callPackage ./pkgs/patch-maven-srcs { };
|
patchMavenSources = callPackage ./pkgs/patch-maven-srcs { };
|
||||||
goMavenResolver = callPackage ./pkgs/go-maven-resolver { };
|
goMavenResolver = callPackage ./pkgs/go-maven-resolver { };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
{ stdenv, lib, fetchgit, buildGo116Module, zlib
|
|
||||||
, makeWrapper, xcodeWrapper, androidPkgs }:
|
|
||||||
|
|
||||||
buildGo116Module {
|
|
||||||
pname = "gomobile";
|
|
||||||
version = "2021-06-14";
|
|
||||||
|
|
||||||
vendorSha256 = "1irgkgv72rakg7snk1bnp10ibr64ykz9l40s59l4fnl63zsh12a0";
|
|
||||||
|
|
||||||
src = fetchgit {
|
|
||||||
rev = "7c8f154d100840bc5828285bb390bbae1cb5a98c";
|
|
||||||
name = "gomobile";
|
|
||||||
url = "https://go.googlesource.com/mobile";
|
|
||||||
sha256 = "1w9mra1mqf60iafp0ywvja5196fjsjyfhvz4yizqq4qkyll5qmj1";
|
|
||||||
};
|
|
||||||
|
|
||||||
subPackages = [ "bind" "cmd/gobind" "cmd/gomobile" ];
|
|
||||||
|
|
||||||
# Fails with: go: cannot find GOROOT directory
|
|
||||||
doCheck = false;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ]
|
|
||||||
++ lib.optional stdenv.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")' \
|
|
||||||
--replace '"io/ioutil"' ""
|
|
||||||
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
|
|
||||||
wrapProgram $out/bin/gomobile \
|
|
||||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib ]}" \
|
|
||||||
--prefix PATH : "${androidPkgs}/bin" \
|
|
||||||
--set ANDROID_NDK_ROOT "${androidPkgs.ndk}" \
|
|
||||||
--set ANDROID_HOME "${androidPkgs.sdk}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "A tool for building and running mobile apps written in Go";
|
|
||||||
homepage = "https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile";
|
|
||||||
license = licenses.bsd3;
|
|
||||||
maintainers = with maintainers; [ jakubgs ];
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue