2006-03-01 14:15:33 +02:00
|
|
|
source common.sh
|
|
|
|
|
2004-06-18 21:09:32 +03:00
|
|
|
echo "NIX_STORE_DIR=$NIX_STORE_DIR NIX_DB_DIR=$NIX_DB_DIR"
|
|
|
|
|
2004-05-04 15:15:30 +03:00
|
|
|
test -n "$TEST_ROOT"
|
|
|
|
if test -d "$TEST_ROOT"; then
|
|
|
|
chmod -R u+w "$TEST_ROOT"
|
|
|
|
rm -rf "$TEST_ROOT"
|
|
|
|
fi
|
|
|
|
mkdir "$TEST_ROOT"
|
|
|
|
|
|
|
|
mkdir "$NIX_STORE_DIR"
|
2005-02-01 19:50:48 +02:00
|
|
|
mkdir "$NIX_LOCALSTATE_DIR"
|
2005-02-18 10:40:52 +02:00
|
|
|
mkdir -p "$NIX_LOG_DIR"/drvs
|
2004-05-04 15:15:30 +03:00
|
|
|
mkdir "$NIX_STATE_DIR"
|
|
|
|
mkdir "$NIX_DB_DIR"
|
2005-02-15 11:39:12 +02:00
|
|
|
mkdir "$NIX_CONF_DIR"
|
2004-05-04 15:15:30 +03:00
|
|
|
|
2005-01-25 19:08:52 +02:00
|
|
|
mkdir $NIX_BIN_DIR
|
2011-10-11 00:32:34 +03:00
|
|
|
ln -s $TOP/src/nix-store/nix-store $NIX_BIN_DIR/
|
|
|
|
ln -s $TOP/src/nix-instantiate/nix-instantiate $NIX_BIN_DIR/
|
|
|
|
ln -s $TOP/src/nix-hash/nix-hash $NIX_BIN_DIR/
|
|
|
|
ln -s $TOP/src/nix-env/nix-env $NIX_BIN_DIR/
|
|
|
|
ln -s $TOP/src/nix-worker/nix-worker $NIX_BIN_DIR/
|
2010-11-17 17:30:07 +02:00
|
|
|
ln -s $TOP/src/bsdiff-*/bsdiff $NIX_BIN_DIR/
|
|
|
|
ln -s $TOP/src/bsdiff-*/bspatch $NIX_BIN_DIR/
|
2005-01-25 19:08:52 +02:00
|
|
|
ln -s $TOP/scripts/nix-prefetch-url $NIX_BIN_DIR/
|
2006-03-01 15:49:12 +02:00
|
|
|
ln -s $TOP/scripts/nix-build $NIX_BIN_DIR/
|
2006-09-21 21:54:08 +03:00
|
|
|
ln -s $TOP/scripts/nix-pull $NIX_BIN_DIR/
|
2011-10-11 00:32:34 +03:00
|
|
|
mkdir -p $NIX_BIN_DIR/nix/substituters
|
2011-10-11 00:11:08 +03:00
|
|
|
ln -s $NIX_BZIP2 $NIX_BIN_DIR/nix/
|
2011-10-11 00:32:34 +03:00
|
|
|
ln -s $TOP/scripts/copy-from-other-stores.pl $NIX_BIN_DIR/nix/substituters
|
2005-01-25 19:08:52 +02:00
|
|
|
|
2005-02-15 11:39:12 +02:00
|
|
|
cat > "$NIX_CONF_DIR"/nix.conf <<EOF
|
|
|
|
gc-keep-outputs = false
|
|
|
|
gc-keep-derivations = false
|
|
|
|
env-keep-derivations = false
|
2010-02-24 15:12:57 +02:00
|
|
|
fsync-metadata = false
|
2005-02-15 11:39:12 +02:00
|
|
|
EOF
|
|
|
|
|
2007-12-14 16:15:30 +02:00
|
|
|
# An uberhack for Mac OS X 10.5: download-using-manifests uses Perl,
|
|
|
|
# and Perl links against Darwin's libutil.dylib (in /usr/lib), but
|
|
|
|
# when running "make check", the libtool wrapper script around the Nix
|
|
|
|
# binaries sets DYLD_LIBRARY_PATH so that Perl finds Nix's (completely
|
|
|
|
# different) libutil --- so it barfs. So generate a shell wrapper
|
|
|
|
# around download-using-manifests that clears DYLD_LIBRARY_PATH.
|
2011-10-11 00:32:34 +03:00
|
|
|
cat > $NIX_BIN_DIR/nix/substituters/download-using-manifests.pl <<EOF
|
2007-12-14 16:15:30 +02:00
|
|
|
#! $SHELL -e
|
|
|
|
export DYLD_LIBRARY_PATH=
|
2012-01-11 18:58:49 +02:00
|
|
|
exec "$top_builddir/libtool" --mode=execute \
|
|
|
|
-dlopen "$top_builddir/perl/libNixStore.la" \
|
|
|
|
"$top_builddir/scripts/download-using-manifests.pl" "\$@"
|
2007-12-14 16:15:30 +02:00
|
|
|
EOF
|
2011-10-11 00:32:34 +03:00
|
|
|
chmod +x $NIX_BIN_DIR/nix/substituters/download-using-manifests.pl
|
2008-07-18 23:03:12 +03:00
|
|
|
|
2004-05-04 15:15:30 +03:00
|
|
|
# Initialise the database.
|
2011-10-11 00:32:34 +03:00
|
|
|
nix-store --init
|
2004-05-04 15:15:30 +03:00
|
|
|
|
|
|
|
# Did anything happen?
|
2010-02-18 18:51:27 +02:00
|
|
|
test -e "$NIX_DB_DIR"/db.sqlite
|
2008-12-03 18:15:38 +02:00
|
|
|
|
|
|
|
echo 'Hello World' > ./dummy
|