summary refs log tree commit diff
path: root/pkgs/stdenv/linux/bootstrap/powerpc/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/stdenv/linux/bootstrap/powerpc/default.nix')
-rw-r--r--pkgs/stdenv/linux/bootstrap/powerpc/default.nix64
1 files changed, 58 insertions, 6 deletions
diff --git a/pkgs/stdenv/linux/bootstrap/powerpc/default.nix b/pkgs/stdenv/linux/bootstrap/powerpc/default.nix
index d3569362b6c5..4ad8bc93e442 100644
--- a/pkgs/stdenv/linux/bootstrap/powerpc/default.nix
+++ b/pkgs/stdenv/linux/bootstrap/powerpc/default.nix
@@ -1,9 +1,61 @@
-{
-  bash = ./bash;
-  bzip2 = ./bzip2;
-  cp = ./cp;
-  curl = ./curl.bz2;
-  tar = ./tar.bz2;
+let
+  fetch = { file, sha256 }:
+    let
+      nixFetchurl = import <nix/fetchurl.nix>;
+      args = {
+        url = "file://${builtins.toString ./.}/${file}";
+        inherit sha256;
+        executable = true;
+      };
+    in if (builtins.functionArgs nixFetchurl) ? executable
+      then nixFetchurl args
+      else derivation {
+        name = file;
+        builder = "/bin/sh";
+
+        system = builtins.currentSystem;
+
+        args = [ "-c" "echo $message; exit 1" ];
+
+        message = ''
+          Sorry, this version of nix cannot download all of the bootstrap tools.
+          Please download ${args.url}, make it executable, add it to the store
+          with `nix-store --add', and try again.
+        '';
+
+        outputHashAlgo = "sha256";
+
+        outputHash = args.sha256;
+
+        outputHashMode = "recursive";
+
+        preferLocalBuild = true;
+      };
+in {
+  bash = fetch {
+    file = "bash";
+    sha256 = "0zss8im6hbx6z2i2wxn1554kd7ggdqdli4xk39cy5fchlnz9bqpp";
+  };
+
+  bzip2 = fetch {
+    file = "bzip2";
+    sha256 = "01ylj8x7albv6k9sqx2h1prsazh4d8y22nga0pwai2bnns0q9qdg";
+  };
+
+  cp = fetch {
+    file = "cp";
+    sha256 = "0d7xbzrv22bxgw7w9b03rakirna5zfvr9gzwm7ichd2fh634hvgl";
+  };
+
+  curl = fetch {
+    file = "curl.bz2";
+    sha256 = "17c25dfslw3qkjlcmihpbhn3x4kj9pgkslizv89ggnki7iiy4jgh";
+  };
+
+  tar = fetch {
+    file = "tar.bz2";
+    sha256 = "132ylqwz02hw5njqx7wvj4sxpcrllx8b8b3a00rlv6iad671ayyr";
+  };
 
   staticToolsURL = {
     url = http://tarballs.nixos.org/stdenv-linux/powerpc/r9828/static-tools.tar.bz2;