diff --git a/pkgs/development/compilers/go/1.14.nix b/pkgs/development/compilers/go/1.14.nix index 43ae68ebc15..2720ad6cf0b 100644 --- a/pkgs/development/compilers/go/1.14.nix +++ b/pkgs/development/compilers/go/1.14.nix @@ -4,15 +4,20 @@ , buildPackages , pkgsBuildTarget , fetchpatch +, callPackage }: let inherit (lib) optionals optionalString; + go_bootstrap = callPackage ./bootstrap.nix { + inherit Security; + }; + goBootstrap = runCommand "go-bootstrap" {} '' mkdir $out - cp -rf ${buildPackages.go_bootstrap}/* $out/ + cp -rf ${go_bootstrap}/* $out/ chmod -R u+w $out find $out -name "*.c" -delete cp -rf $out/bin/* $out/share/go/bin/ diff --git a/pkgs/development/compilers/go/1.15.nix b/pkgs/development/compilers/go/1.15.nix index 2f3c420e963..284ddd6451e 100644 --- a/pkgs/development/compilers/go/1.15.nix +++ b/pkgs/development/compilers/go/1.15.nix @@ -4,15 +4,20 @@ , buildPackages , pkgsBuildTarget , fetchpatch +, callPackage }: let inherit (lib) optionals optionalString; + go_bootstrap = callPackage ./bootstrap.nix { + inherit Security; + }; + goBootstrap = runCommand "go-bootstrap" {} '' mkdir $out - cp -rf ${buildPackages.go_bootstrap}/* $out/ + cp -rf ${go_bootstrap}/* $out/ chmod -R u+w $out find $out -name "*.c" -delete cp -rf $out/bin/* $out/share/go/bin/ diff --git a/pkgs/development/compilers/go/2-dev.nix b/pkgs/development/compilers/go/2-dev.nix index 3e09f7c0fad..8b8df28e1b6 100644 --- a/pkgs/development/compilers/go/2-dev.nix +++ b/pkgs/development/compilers/go/2-dev.nix @@ -4,15 +4,20 @@ , buildPackages , pkgsBuildTarget , fetchpatch +, callPackage }: let inherit (lib) optionals optionalString; + go_bootstrap = callPackage ./bootstrap.nix { + inherit Security; + }; + goBootstrap = runCommand "go-bootstrap" {} '' mkdir $out - cp -rf ${buildPackages.go_bootstrap}/* $out/ + cp -rf ${go_bootstrap}/* $out/ chmod -R u+w $out find $out -name "*.c" -delete cp -rf $out/bin/* $out/share/go/bin/ diff --git a/pkgs/development/compilers/go/bootstrap.nix b/pkgs/development/compilers/go/bootstrap.nix new file mode 100644 index 00000000000..12ef9a25a4e --- /dev/null +++ b/pkgs/development/compilers/go/bootstrap.nix @@ -0,0 +1,17 @@ +{ stdenv, srcOnly, fetchurl, callPackage, Security }: + +let +go_bootstrap = if stdenv.isAarch64 then + srcOnly { + name = "go-1.8-linux-arm64-bootstrap"; + src = fetchurl { + url = "https://cache.xor.us/go-1.8-linux-arm64-bootstrap.tar.xz"; + sha256 = "0sk6g03x9gbxk2k1djnrgy8rzw1zc5f6ssw0hbxk6kjr85lpmld6"; + }; + } +else + callPackage ./1.4.nix { + inherit Security; + }; +in + go_bootstrap diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 09700ec4a41..36730983660 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10143,19 +10143,6 @@ in glslang = callPackage ../development/compilers/glslang { }; - go_bootstrap = if stdenv.isAarch64 then - srcOnly { - name = "go-1.8-linux-arm64-bootstrap"; - src = fetchurl { - url = "https://cache.xor.us/go-1.8-linux-arm64-bootstrap.tar.xz"; - sha256 = "0sk6g03x9gbxk2k1djnrgy8rzw1zc5f6ssw0hbxk6kjr85lpmld6"; - }; - } - else - callPackage ../development/compilers/go/1.4.nix { - inherit (darwin.apple_sdk.frameworks) Security; - }; - go_1_14 = callPackage ../development/compilers/go/1.14.nix ({ inherit (darwin.apple_sdk.frameworks) Security Foundation; } // lib.optionalAttrs stdenv.isAarch64 {