[ -d "$namenhash" ]
shift
-[ -x "$BASS_ROOT"/build/contrib/detpax/detpax ] ||
- ( cd "$BASS_ROOT"/build/contrib/detpax ; ./build )
-
[ -n "$BASS_NOSYNC" ] || find $namenhash -type f -or -type d -exec $FSYNC {} +
tmp=$(mktemp -d $TMPDIR/$namenhash-mk-pkg.XXXXXX)
chmod -R a-w $namenhash
{
- "$BASS_ROOT"/build/contrib/detpax/detpax -prec skelpkg $namenhash ||
- touch $tmp/tar-pipe-failed
+ [ -z "$NO_DETPAX" ] && cmd="$TAR cf -" || cmd="detpax -prec skelpkg"
+ $cmd $namenhash || touch $tmp/tar-pipe-failed
} |
{ $COMPRESSOR || touch $tmp/tar-pipe-failed ; } |
{ tee $tmp/$namenhash || touch $tmp/tar-pipe-failed ; } |
mv $namenhash.hashes bin.hashes
totar="name name.hashes buildinfo buildinfo.hashes bin.hashes bin"
chmod a-w $totar
-"$BASS_ROOT"/build/contrib/detpax/detpax $totar
+if [ -z "$NO_DETPAX" ] ; then
+ $TAR cf - $totar
+else
+ detpax $totar
+fi
Bunch of scripts for preparing the dependencies required for BASS.
-Make, C compiler are prerequired. Go, goredo, meta4ra, zstd will be built.
+Make, C compiler are prerequired.
+
+There are various steps: Go compiler bootstrapping, zstd, goredo,
+meta4ra, detpax building. All those steps are optional in general.
+You may use different redo implementation. May use different fetcher
+and no deterministic archiver. All of that means no need in Go building
+at all, as no Go-written software will be used. Either touch $step.done
+in your state directory, or just remove unnecessary steps you want to skip.
* Create the state directory, where all your build artefacts will be built:
$ mkdir state
$ cd state
* Start dependencies download process from the Internet:
$ /path/to/prepare-deps/dl
-* If you already have some version of the Go (its 1.4 version is not
- easy to build on modern systems), then you can touch the following
- steps, telling that they should not be done:
- 010-go1.4.3.done
- 020-go1.17.12.done
- 030-go1.20.14.done
- 040-go1.23.5.done
- and symlink your Go to ./go1.4.3, ./go1.17.12, ./go1.20.14, ./go1.23.5
* Start build process itself:
$ /path/to/prepare-deps/do
* Result local/bin should contain only statically built programs, that
#!/bin/sh -e
+ROOT=$(realpath -- $(dirname "$0"))
mkdir -p distfiles
cd distfiles
-ln -f ../../../build/distfiles/go1.4.3.tar.gz go1.4.3.src.tar.gz
-ln -f ../../../build/distfiles/go1.17.12.tar.gz go1.17.12.src.tar.gz
-ln -f ../../../build/distfiles/go1.20.14.tar.gz go1.20.14.src.tar.gz
-ln -f ../../../build/distfiles/go1.23.5.tar.gz go1.23.5.src.tar.gz
-ln -f ../../../build/distfiles/go1.25.6.tar.gz go1.25.6.src.tar.gz
-ln -f ../../../build/distfiles/go1.26.1.tar.gz go1.26.1.src.tar.gz
-ln -f ../../../build/distfiles/goredo-2.9.2.tar.zst
-ln -f ../../../build/distfiles/meta4ra-2.1.0.tar.zst
-ln -f ../../../build/distfiles/zstd-1.5.7.tar.gz
+ln -f $ROOT/../../build/distfiles/dl/go1.4.3.tar.gz go1.4.3.src.tar.gz
+ln -f $ROOT/../../build/distfiles/dl/go1.17.12.tar.gz go1.17.12.src.tar.gz
+ln -f $ROOT/../../build/distfiles/dl/go1.20.14.tar.gz go1.20.14.src.tar.gz
+ln -f $ROOT/../../build/distfiles/dl/go1.23.5.tar.gz go1.23.5.src.tar.gz
+ln -f $ROOT/../../build/distfiles/dl/go1.25.6.tar.gz go1.25.6.src.tar.gz
+ln -f $ROOT/../../build/distfiles/dl/go1.26.1.tar.gz go1.26.1.src.tar.gz
+ln -f $ROOT/../../build/distfiles/dl/goredo-2.9.2.tar.zst
+ln -f $ROOT/../../build/distfiles/dl/meta4ra-2.1.0.tar.zst
+ln -f $ROOT/../../build/distfiles/dl/zstd-1.5.7.tar.gz
--- /dev/null
+cd $ROOT/../../build/contrib/detpax
+./build
+mkdir -p $DIR/local/bin
+mv detpax $DIR/local/bin
A [Index/Concepts] pax-archive\r
A [Index/Concepts] ustar-archive\r
A [Index/Programs] detpax\r
+A [Index/Variables] NO_DETPAX\r
POSIX ustar archive format can not hold more than 8GiB of data and
(very) long filenames. Forced pax usage guarantees compatibility with
variety of OSes. GNU tar's format (also not having limitations above)
-easily could be unreadable on non-GNU systems. BASS uses
+easily could be unreadable on non-GNU systems. By default BASS uses
build/contrib/detpax archiver for creating pax archives in deterministic
-bit-to-bit reproducible way.
+bit-to-bit reproducible way. You can use ordinary $TAR by setting
+NO_DETPAX=1 in configuration file, loosing deterministic behaviour.
As pax/tar does not have any kind of index, as ZIP does, it is crucial
to place the largest "bin" file at the very end of the archive. And that
export BASS_HASHERS="${BASS_HASHERS:-$("$BASS_ROOT"/build/bin/hashers-detect 2>/dev/null)}"
+# NO_DETPAX=1
export FSYNC=${FSYNC:-$(command -v fsync 2>/dev/null || command -v sync)}
export TAR=${TAR:-bsdtar}
COMPRESSOR=${COMPRESSOR:-zstdmt}