summaryrefslogtreecommitdiffstats
path: root/pkgs/stdenv/freebsd
diff options
context:
space:
mode:
authorjanus <janus@xn--kn-1ia.guru>2015-12-24 02:04:18 +0000
committerjanus <janus@xn--kn-1ia.guru>2016-01-01 17:01:13 +0000
commit3c8f0a92d35a4c9fffb4c6bfb1fcfe75dbefa0d1 (patch)
tree285c729294f59bf6e96f231186845adabe5dee48 /pkgs/stdenv/freebsd
parentcbcab5521b6247845a54ab36279fb1fee95b36d3 (diff)
FreeBSD: improve bootstrapping, re-enable bdb for heimdal
Diffstat (limited to 'pkgs/stdenv/freebsd')
-rw-r--r--pkgs/stdenv/freebsd/default.nix6
-rw-r--r--pkgs/stdenv/freebsd/trivial-bootstrap.sh29
2 files changed, 23 insertions, 12 deletions
diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix
index 5455c3d8fb95..3c4e2bb97661 100644
--- a/pkgs/stdenv/freebsd/default.nix
+++ b/pkgs/stdenv/freebsd/default.nix
@@ -11,7 +11,7 @@ rec {
inherit system;
name = "trivial-bootstrap-tools";
- builder = "/bin/sh";
+ builder = "/usr/local/bin/bash";
args = [ ./trivial-bootstrap.sh ];
mkdir = "/bin/mkdir";
@@ -23,8 +23,8 @@ rec {
name = "stdenv-freebsd-boot-1";
inherit system config;
- initialPath = null;
- shell = "foo";
+ initialPath = [ "/" "/usr" ];
+ shell = "${bootstrapTools}/bin/bash";
fetchurlBoot = null;
cc = null;
};
diff --git a/pkgs/stdenv/freebsd/trivial-bootstrap.sh b/pkgs/stdenv/freebsd/trivial-bootstrap.sh
index 1dc59ea7dbc7..fbff4575e5a4 100644
--- a/pkgs/stdenv/freebsd/trivial-bootstrap.sh
+++ b/pkgs/stdenv/freebsd/trivial-bootstrap.sh
@@ -1,3 +1,7 @@
+set -e
+set -o nounset
+set -o pipefail
+
echo Building the trivial bootstrap environment...
echo
echo Needed FreeBSD packages:
@@ -6,15 +10,22 @@ echo findutils gcpio gawk gnugrep coreutils bash gsed gtar gmake xar binutils gp
$mkdir -p $out/bin
ln () {
- if test "x$2" != x -a -f "$out/bin/$2"; then
- echo "$2 exists"
- exit 1;
- fi;
+ if [ ! -z "${2:-}" ]; then
+ if [ -f "$out/bin/$2" ]; then
+ echo "$2 exists"
+ exit 1
+ fi
+ fi
if test ! -f "$1"; then
echo Target "$2" does not exist
- exit 1;
+ exit 1
+ fi
+ # TODO: check that destination directory exists
+ if [ ! -z "${2:-}" ]; then
+ $ln -s "$1" "$out/bin/$2"
+ else
+ $ln -s "$1" "$out/bin/"
fi
- $ln -s "$1" "$out/bin/$2"
}
ln /usr/local/bin/bash
@@ -76,16 +87,16 @@ ln /usr/local/bin/gcomm comm
ln /usr/local/bin/gcpio cpio
ln /usr/local/bin/curl curl
ln /usr/local/bin/gfind find
-ln /usr/local/bin/grep grep #other grep is in /usr/bin
+ln /usr/local/bin/grep grep # other grep is in /usr/bin
ln /usr/bin/gzip
ln /usr/bin/gunzip
ln /usr/bin/zcat
ln /usr/local/bin/ghead head
-ln /usr/bin/tail tail
+ln /usr/bin/tail tail # note that we are not using gtail!!!
ln /usr/local/bin/guniq uniq
ln /usr/bin/less less
ln /usr/local/bin/gtrue true
-# ln /usr/bin/diff diff
+# ln /usr/bin/diff diff # we are using gdiff (see above)
ln /usr/local/bin/egrep egrep
ln /usr/local/bin/fgrep fgrep
ln /usr/local/bin/gpatch patch