From 6f38b43c8c84c800f93465b2241156419fd4fd52 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:40:29 +1000 Subject: [PATCH] go: minor cleanup --- pkgs/development/compilers/go/1.17.nix | 21 ++++++++------------- pkgs/development/compilers/go/1.18.nix | 21 ++++++++------------- pkgs/development/compilers/go/1.19.nix | 21 ++++++++------------- 3 files changed, 24 insertions(+), 39 deletions(-) diff --git a/pkgs/development/compilers/go/1.17.nix b/pkgs/development/compilers/go/1.17.nix index 69e5779d8f0d..d1dd64eca153 100644 --- a/pkgs/development/compilers/go/1.17.nix +++ b/pkgs/development/compilers/go/1.17.nix @@ -17,13 +17,9 @@ , runtimeShell , buildPackages , pkgsBuildTarget -, callPackage -, threadsCross ? null # for MinGW +, threadsCross }: -# threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; - let go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { }; @@ -36,19 +32,19 @@ let ''; goarch = platform: { - "i686" = "386"; - "x86_64" = "amd64"; "aarch64" = "arm64"; "arm" = "arm"; "armv5tel" = "arm"; "armv6l" = "arm"; "armv7l" = "arm"; + "i686" = "386"; "mips" = "mips"; + "mips64el" = "mips64le"; "mipsel" = "mipsle"; + "powerpc64le" = "ppc64le"; "riscv64" = "riscv64"; "s390x" = "s390x"; - "powerpc64le" = "ppc64le"; - "mips64el" = "mips64le"; + "x86_64" = "amd64"; }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); # We need a target compiler which is still runnable at build time, @@ -57,7 +53,6 @@ let isCross = stdenv.buildPlatform != stdenv.targetPlatform; in - stdenv.mkDerivation rec { pname = "go"; version = "1.17.13"; @@ -80,7 +75,7 @@ stdenv.mkDerivation rec { depsBuildTarget = lib.optional isCross targetCC; - depsTargetTarget = lib.optional (threadsCross != null) threadsCross; + depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross; hardeningDisable = [ "all" ]; @@ -283,10 +278,10 @@ stdenv.mkDerivation rec { disallowedReferences = [ goBootstrap ]; meta = with lib; { - homepage = "https://go.dev/"; description = "The Go Programming language"; + homepage = "https://go.dev/"; license = licenses.bsd3; maintainers = teams.golang.members; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.darwin ++ platforms.linux; }; } diff --git a/pkgs/development/compilers/go/1.18.nix b/pkgs/development/compilers/go/1.18.nix index 8fef944094b1..489ed133c611 100644 --- a/pkgs/development/compilers/go/1.18.nix +++ b/pkgs/development/compilers/go/1.18.nix @@ -18,13 +18,9 @@ , runtimeShell , buildPackages , pkgsBuildTarget -, callPackage -, threadsCross ? null # for MinGW +, threadsCross }: -# threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; - let go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { }; @@ -37,19 +33,19 @@ let ''; goarch = platform: { - "i686" = "386"; - "x86_64" = "amd64"; "aarch64" = "arm64"; "arm" = "arm"; "armv5tel" = "arm"; "armv6l" = "arm"; "armv7l" = "arm"; + "i686" = "386"; "mips" = "mips"; + "mips64el" = "mips64le"; "mipsel" = "mipsle"; + "powerpc64le" = "ppc64le"; "riscv64" = "riscv64"; "s390x" = "s390x"; - "powerpc64le" = "ppc64le"; - "mips64el" = "mips64le"; + "x86_64" = "amd64"; }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); # We need a target compiler which is still runnable at build time, @@ -58,7 +54,6 @@ let isCross = stdenv.buildPlatform != stdenv.targetPlatform; in - stdenv.mkDerivation rec { pname = "go"; version = "1.18.4"; @@ -81,7 +76,7 @@ stdenv.mkDerivation rec { depsBuildTarget = lib.optional isCross targetCC; - depsTargetTarget = lib.optional (threadsCross != null) threadsCross; + depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross; hardeningDisable = [ "all" ]; @@ -288,10 +283,10 @@ stdenv.mkDerivation rec { disallowedReferences = [ goBootstrap ]; meta = with lib; { - homepage = "https://go.dev/"; description = "The Go Programming language"; + homepage = "https://go.dev/"; license = licenses.bsd3; maintainers = teams.golang.members; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.darwin ++ platforms.linux; }; } diff --git a/pkgs/development/compilers/go/1.19.nix b/pkgs/development/compilers/go/1.19.nix index fc2855251e03..f5b511633465 100644 --- a/pkgs/development/compilers/go/1.19.nix +++ b/pkgs/development/compilers/go/1.19.nix @@ -17,13 +17,9 @@ , runtimeShell , buildPackages , pkgsBuildTarget -, callPackage -, threadsCross ? null # for MinGW +, threadsCross }: -# threadsCross is just for MinGW -assert threadsCross != null -> stdenv.targetPlatform.isWindows; - let go_bootstrap = buildPackages.callPackage ./bootstrap116.nix { }; @@ -36,19 +32,19 @@ let ''; goarch = platform: { - "i686" = "386"; - "x86_64" = "amd64"; "aarch64" = "arm64"; "arm" = "arm"; "armv5tel" = "arm"; "armv6l" = "arm"; "armv7l" = "arm"; + "i686" = "386"; "mips" = "mips"; + "mips64el" = "mips64le"; "mipsel" = "mipsle"; + "powerpc64le" = "ppc64le"; "riscv64" = "riscv64"; "s390x" = "s390x"; - "powerpc64le" = "ppc64le"; - "mips64el" = "mips64le"; + "x86_64" = "amd64"; }.${platform.parsed.cpu.name} or (throw "Unsupported system: ${platform.parsed.cpu.name}"); # We need a target compiler which is still runnable at build time, @@ -57,7 +53,6 @@ let isCross = stdenv.buildPlatform != stdenv.targetPlatform; in - stdenv.mkDerivation rec { pname = "go"; version = "1.19"; @@ -80,7 +75,7 @@ stdenv.mkDerivation rec { depsBuildTarget = lib.optional isCross targetCC; - depsTargetTarget = lib.optional (threadsCross != null) threadsCross; + depsTargetTarget = lib.optional stdenv.targetPlatform.isWindows threadsCross; hardeningDisable = [ "all" ]; @@ -276,10 +271,10 @@ stdenv.mkDerivation rec { disallowedReferences = [ goBootstrap ]; meta = with lib; { - homepage = "https://go.dev/"; description = "The Go Programming language"; + homepage = "https://go.dev/"; license = licenses.bsd3; maintainers = teams.golang.members; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.darwin ++ platforms.linux; }; }