diff options
Diffstat (limited to 'pkgs/development/compilers/go/1.22.nix')
-rw-r--r-- | pkgs/development/compilers/go/1.22.nix | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/development/compilers/go/1.22.nix b/pkgs/development/compilers/go/1.22.nix index 6a3cfd39203d5..d3b8982118aeb 100644 --- a/pkgs/development/compilers/go/1.22.nix +++ b/pkgs/development/compilers/go/1.22.nix @@ -37,6 +37,7 @@ let "riscv64" = "riscv64"; "s390x" = "s390x"; "x86_64" = "amd64"; + "wasm32" = "wasm"; }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); # We need a target compiler which is still runnable at build time, @@ -47,11 +48,11 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "go"; - version = "1.22.2"; + version = "1.22.3"; src = fetchurl { url = "https://go.dev/dl/go${finalAttrs.version}.src.tar.gz"; - hash = "sha256-N06oKyiexzjpaCZ8rFnH1f8YD5SSJQJUeEsgROkN9ak="; + hash = "sha256-gGSO80+QMZPXKlnA3/AZ9fmK4MmqE63gsOy/+ZGnb2g="; }; strictDeps = true; @@ -90,7 +91,7 @@ stdenv.mkDerivation (finalAttrs: { ./go_no_vendor_checks-1.22.patch ]; - GOOS = stdenv.targetPlatform.parsed.kernel.name; + GOOS = if stdenv.targetPlatform.isWasi then "wasip1" else stdenv.targetPlatform.parsed.kernel.name; GOARCH = goarch stdenv.targetPlatform; # GOHOSTOS/GOHOSTARCH must match the building system, not the host system. # Go will nevertheless build a for host system that we will copy over in @@ -113,7 +114,8 @@ stdenv.mkDerivation (finalAttrs: { GOARM = toString (lib.intersectLists [ (stdenv.hostPlatform.parsed.cpu.version or "") ] [ "5" "6" "7" ]); GO386 = "softfloat"; # from Arch: don't assume sse2 on i686 - CGO_ENABLED = 1; + # Wasi does not support CGO + CGO_ENABLED = if stdenv.targetPlatform.isWasi then 0 else 1; GOROOT_BOOTSTRAP = if useGccGoBootstrap then goBootstrap else "${goBootstrap}/share/go"; @@ -180,11 +182,11 @@ stdenv.mkDerivation (finalAttrs: { meta = with lib; { changelog = "https://go.dev/doc/devel/release#go${lib.versions.majorMinor finalAttrs.version}"; - description = "The Go Programming language"; + description = "Go Programming language"; homepage = "https://go.dev/"; license = licenses.bsd3; maintainers = teams.golang.members; - platforms = platforms.darwin ++ platforms.linux; + platforms = platforms.darwin ++ platforms.linux ++ platforms.wasi; mainProgram = "go"; }; }) |