### this file is sourced not run

PKGBUILD=1
PKGARCH=x86_64

# source: step

################
#  Git Master  #
################

PKGVER=1.18.2.62 # Nth commit after tag x.y.z (read N in GitHub Last Release page)
hash=ea18ac4fa094213e92ec31b687efc8054d2876b6
hash7=${hash#???????} hash7=${hash%"$hash7"}
TARBALL=chafa-$PKGVER-${hash7}.tar.gz
SRC_URL=https://github.com/hpjansson/chafa/archive/${hash}.tar.gz
MD5SUM=4c66e4a36c7aaaef6421677a88104f5d

####################
#  GitHub Release  #
####################

# PKGVER=1.18.2
# TARBALL=chafa-$PKGVER.tar.xz
# SRC_URL=https://github.com/hpjansson/chafa/releases/download/${PKGVER}/$TARBALL
# MD5SUM=0

BUNDLE=

SLACKREQ='glib freetype2 libjpeg-turbo librsvg libwebp libavif'
SLACKDESC="chafa: chafa $PKGVER (terminal image graphics)
chafa:
chafa: Terminal graphics for the 21st century. Chafa is a command-line utility and
chafa: library that converts image data, including animated GIFs, into graphics
chafa: formats or ANSI/Unicode character art suitable for display in a terminal.
chafa:
chafa:
chafa: https://github.com/hpjansson/chafa
chafa: https://hpjansson.org/chafa
chafa:
chafa:
"
SLACKSUG=''

### default pkg_download
### default pkg_prepare
### prepare
# pkg_prepare() {
# 	pkg_prepare_default &&
# 	cd tmp/chafa-* &&
# 	patch -Np1 -i ../pkg/patches/fix_makefile_am_for_zsh_completion.patch
# }
### default pkg_package
### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS --disable-static"
	cd /tmp/chafa-* &&
	NOCONFIGURE=1 ./autogen.sh $CONFFLAGS &&
	pkg_build_autoconf &&
	make -C tools/completions \
		install-bash-completion \
		install-fish-completion \
		install-zsh-completion \
		&&
	pkg_build_slackdesc
}
