blob: 6e1ef10f91a07492af26a14bb6688773c1d802ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/usr/bin/env sh
# Build the library (with its reader, ocda-read) and the writer, in both languages.
#
# Each project is its own flake and builds on its own. The writer's flakes lock
# the published library; here they are given the copy at $OCDA_LIB with
# --override-input, so that the library run and the library built into the
# writer are the same one. Where that fails, the build falls back to the lock.
set -e
. "$(dirname "$0")/config.sh"
build() { # <directory> [flake output]
dir=$1; out=${2:-}
printf '%-44s' "$(basename "$(dirname "$dir")")/$(basename "$dir") ${out}"
if ( cd "$dir" && nix build ${out:+"$out"} \
--override-input ocda-lib "path:$OCDA_LIB" >/dev/null 2>&1 ) \
|| ( cd "$dir" && nix build ${out:+"$out"} >/dev/null 2>&1 )
then echo ok
else echo FAILED; failed=1
fi
}
failed=0
# the library's programs: ocda-read, ocda-dump and ocda-agree, one build, one
# result/bin. Built as two, into the one result link, the second replaced the
# first, and the dump this pipeline reads was not there.
build "$OCDA_LIB/dlang"
build "$OCDA_LIB/gleam"
build "$WRITERS/dlang"
build "$WRITERS/gleam"
exit $failed
|