#!/usr/bin/make -f
#export DH_VERBOSE = 1

%:
	dh $@

override_dh_auto_build:
	# web_kbot 前端：Launchpad 源中 npm 包存在依赖冲突，使用源码包内预构建 dist/
	test -f kylin-aiassistant/web_kbot/dist/index.html || (echo "ERROR: web_kbot/dist not found, run 'npm run build' in web_kbot first" && exit 1)
	# huanghe-proposed 仅有 rav1e 0.8，libavcodec60 链接需要 librav1e.so.0
	if ! test -e /usr/lib/x86_64-linux-gnu/librav1e.so.0; then \
		apt-get update && apt-get install -y --no-install-recommends -t huanghe librav1e0 || \
		(echo "ERROR: librav1e.so.0 required by libavcodec60 (Qt WebEngine) is missing" && exit 1); \
	fi
	# Build kylin-aiassistant Qt project
	dh_auto_build

override_dh_shlibdeps:
	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
