go: minor cleanup

This commit is contained in:
zowoq 2022-08-04 13:40:29 +10:00
parent eec7444d4b
commit 6f38b43c8c
3 changed files with 24 additions and 39 deletions

View file

@ -17,13 +17,9 @@
, runtimeShell , runtimeShell
, buildPackages , buildPackages
, pkgsBuildTarget , pkgsBuildTarget
, callPackage , threadsCross
, threadsCross ? null # for MinGW
}: }:
# threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
let let
go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { }; go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { };
@ -36,19 +32,19 @@ let
''; '';
goarch = platform: { goarch = platform: {
"i686" = "386";
"x86_64" = "amd64";
"aarch64" = "arm64"; "aarch64" = "arm64";
"arm" = "arm"; "arm" = "arm";
"armv5tel" = "arm"; "armv5tel" = "arm";
"armv6l" = "arm"; "armv6l" = "arm";
"armv7l" = "arm"; "armv7l" = "arm";
"i686" = "386";
"mips" = "mips"; "mips" = "mips";
"mips64el" = "mips64le";
"mipsel" = "mipsle"; "mipsel" = "mipsle";
"powerpc64le" = "ppc64le";
"riscv64" = "riscv64"; "riscv64" = "riscv64";
"s390x" = "s390x"; "s390x" = "s390x";
"powerpc64le" = "ppc64le"; "x86_64" = "amd64";
"mips64el" = "mips64le";
}.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}");
# We need a target compiler which is still runnable at build time, # We need a target compiler which is still runnable at build time,
@ -57,7 +53,6 @@ let
isCross = stdenv.buildPlatform != stdenv.targetPlatform; isCross = stdenv.buildPlatform != stdenv.targetPlatform;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "go"; pname = "go";
version = "1.17.13"; version = "1.17.13";
@ -80,7 +75,7 @@ stdenv.mkDerivation rec {
depsBuildTarget = lib.optional isCross targetCC; depsBuildTarget = lib.optional isCross targetCC;
depsTargetTarget = lib.optional (threadsCross != null) threadsCross; depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross;
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
@ -283,10 +278,10 @@ stdenv.mkDerivation rec {
disallowedReferences = [ goBootstrap ]; disallowedReferences = [ goBootstrap ];
meta = with lib; { meta = with lib; {
homepage = "https://go.dev/";
description = "The Go Programming language"; description = "The Go Programming language";
homepage = "https://go.dev/";
license = licenses.bsd3; license = licenses.bsd3;
maintainers = teams.golang.members; maintainers = teams.golang.members;
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.darwin ++ platforms.linux;
}; };
} }

View file

@ -18,13 +18,9 @@
, runtimeShell , runtimeShell
, buildPackages , buildPackages
, pkgsBuildTarget , pkgsBuildTarget
, callPackage , threadsCross
, threadsCross ? null # for MinGW
}: }:
# threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
let let
go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { }; go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { };
@ -37,19 +33,19 @@ let
''; '';
goarch = platform: { goarch = platform: {
"i686" = "386";
"x86_64" = "amd64";
"aarch64" = "arm64"; "aarch64" = "arm64";
"arm" = "arm"; "arm" = "arm";
"armv5tel" = "arm"; "armv5tel" = "arm";
"armv6l" = "arm"; "armv6l" = "arm";
"armv7l" = "arm"; "armv7l" = "arm";
"i686" = "386";
"mips" = "mips"; "mips" = "mips";
"mips64el" = "mips64le";
"mipsel" = "mipsle"; "mipsel" = "mipsle";
"powerpc64le" = "ppc64le";
"riscv64" = "riscv64"; "riscv64" = "riscv64";
"s390x" = "s390x"; "s390x" = "s390x";
"powerpc64le" = "ppc64le"; "x86_64" = "amd64";
"mips64el" = "mips64le";
}.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}");
# We need a target compiler which is still runnable at build time, # We need a target compiler which is still runnable at build time,
@ -58,7 +54,6 @@ let
isCross = stdenv.buildPlatform != stdenv.targetPlatform; isCross = stdenv.buildPlatform != stdenv.targetPlatform;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "go"; pname = "go";
version = "1.18.4"; version = "1.18.4";
@ -81,7 +76,7 @@ stdenv.mkDerivation rec {
depsBuildTarget = lib.optional isCross targetCC; depsBuildTarget = lib.optional isCross targetCC;
depsTargetTarget = lib.optional (threadsCross != null) threadsCross; depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross;
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
@ -288,10 +283,10 @@ stdenv.mkDerivation rec {
disallowedReferences = [ goBootstrap ]; disallowedReferences = [ goBootstrap ];
meta = with lib; { meta = with lib; {
homepage = "https://go.dev/";
description = "The Go Programming language"; description = "The Go Programming language";
homepage = "https://go.dev/";
license = licenses.bsd3; license = licenses.bsd3;
maintainers = teams.golang.members; maintainers = teams.golang.members;
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.darwin ++ platforms.linux;
}; };
} }

View file

@ -17,13 +17,9 @@
, runtimeShell , runtimeShell
, buildPackages , buildPackages
, pkgsBuildTarget , pkgsBuildTarget
, callPackage , threadsCross
, threadsCross ? null # for MinGW
}: }:
# threadsCross is just for MinGW
assert threadsCross != null -> stdenv.targetPlatform.isWindows;
let let
go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { }; go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { };
@ -36,19 +32,19 @@ let
''; '';
goarch = platform: { goarch = platform: {
"i686" = "386";
"x86_64" = "amd64";
"aarch64" = "arm64"; "aarch64" = "arm64";
"arm" = "arm"; "arm" = "arm";
"armv5tel" = "arm"; "armv5tel" = "arm";
"armv6l" = "arm"; "armv6l" = "arm";
"armv7l" = "arm"; "armv7l" = "arm";
"i686" = "386";
"mips" = "mips"; "mips" = "mips";
"mips64el" = "mips64le";
"mipsel" = "mipsle"; "mipsel" = "mipsle";
"powerpc64le" = "ppc64le";
"riscv64" = "riscv64"; "riscv64" = "riscv64";
"s390x" = "s390x"; "s390x" = "s390x";
"powerpc64le" = "ppc64le"; "x86_64" = "amd64";
"mips64el" = "mips64le";
}.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}");
# We need a target compiler which is still runnable at build time, # We need a target compiler which is still runnable at build time,
@ -57,7 +53,6 @@ let
isCross = stdenv.buildPlatform != stdenv.targetPlatform; isCross = stdenv.buildPlatform != stdenv.targetPlatform;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "go"; pname = "go";
version = "1.19"; version = "1.19";
@ -80,7 +75,7 @@ stdenv.mkDerivation rec {
depsBuildTarget = lib.optional isCross targetCC; depsBuildTarget = lib.optional isCross targetCC;
depsTargetTarget = lib.optional (threadsCross != null) threadsCross; depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross;
hardeningDisable = [ "all" ]; hardeningDisable = [ "all" ];
@ -276,10 +271,10 @@ stdenv.mkDerivation rec {
disallowedReferences = [ goBootstrap ]; disallowedReferences = [ goBootstrap ];
meta = with lib; { meta = with lib; {
homepage = "https://go.dev/";
description = "The Go Programming language"; description = "The Go Programming language";
homepage = "https://go.dev/";
license = licenses.bsd3; license = licenses.bsd3;
maintainers = teams.golang.members; maintainers = teams.golang.members;
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.darwin ++ platforms.linux;
}; };
} }