yafetch/plugin/hooks/pre-install-source
Ari Archer 60e692786c
make baz plugin compatible with the upcomming baz api
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2023-02-20 04:45:09 +02:00

26 lines
640 B
Bash

#!/usr/bin/env sh
baz_log 'setting up CC'
case "$CC" in
'' | cc | gcc | clang) export CC="${CC:-clang}" ;;
*) error 'failed to set CC -- invalid CC (gcc/clang)' ;;
esac
baz_log 'checking dependencies'
baz_use lua "$CC" pkg-config make strip nproc
if [ -f Makefile ]; then
baz_log 'cleaning up'
make clean
rm -- Makefile
fi
baz_log 'configuring'
chmod a+rx ./configure
./configure --use-warnings --use-"$CC" --use-lto --use-optimise --use-pedantic --use-werror \
--use-strip --use-extreme-strip --use-march
baz_log 'Installing'
make -j"$(nproc --all)"
mkdir -p -- "$BAZP_SRC/commands"
mv -- yafetch "$BAZP_SRC/commands"