Makefile
.PHONY: check todo-gate smoke install restart package translations compile-translations update
PACKAGE_FILES := metadata.json contents docs/codexbar-plasma-overview.png docs/codexbar-plasma-codex.png docs/codexbar-plasma-usage-spend.png docs/codexbar-plasma-sessions.png docs/codexbar-plasma-panel-standard.png docs/codexbar-plasma-panel-minimal.png docs/codexbar-plasma-tour.gif scripts/update-widget.sh scripts/check-cli-update.py scripts/manage-cli.py scripts/lib/cli_release.py scripts/lib/managed_cli.py LICENSE NOTICE.md README.md CHANGELOG.md
# Override on distros where Qt6 ships QML modules elsewhere (e.g. Debian/Ubuntu
# multiarch: make check QML_IMPORT_DIR=/usr/lib/x86_64-linux-gnu/qt6/qml).
QMLLINT ?= /usr/lib/qt6/bin/qmllint
# Empty when dpkg-architecture is absent: the `uname -m`-linux-gnu candidate
# below already covers that case, while a raw `uname -m` fallback would build
# a dead `/usr/lib/<arch>/qt6/qml` candidate that never exists.
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || true)
QML_IMPORT_DIR ?= $(or $(wildcard /usr/lib/qt6/qml),$(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/qt6/qml),$(wildcard /usr/lib/$(shell uname -m)-linux-gnu/qt6/qml),$(firstword $(wildcard /usr/lib/*-linux-gnu/qt6/qml)),/usr/lib/qt6/qml)
# CI explicitly enables import warnings so the portable fallback in
# test_qml_hardening.sh cannot hide missing Plasma modules.
QMLLINT_FLAGS ?= --unqualified disable
check:
python3 scripts/changelog.py
scripts/test_shellcheck.sh
scripts/test_feature_parity.sh
scripts/test_refresh_nonce.sh
scripts/test_process_lifecycle.sh
scripts/test_ui_regressions.sh
scripts/test_provider_icons.sh
scripts/test_security_regressions.sh
scripts/test_update_widget.sh
scripts/test_theme_boundaries.sh
scripts/test_i18n_catalog.sh
scripts/test_cli_descriptor_contract.sh
scripts/test_qml_logic.sh
python3 -m unittest discover -s tests -p 'test_*.py'
scripts/test_qml_hardening.sh
xmllint --noout contents/config/main.xml
jq . metadata.json >/dev/null
@if command -v kpackagetool6 >/dev/null 2>&1; then \
kpackagetool6 --appstream-metainfo . | xmllint --noout -; \
else \
echo "kpackagetool6 not found; skipping appstream metainfo check"; \
fi
todo-gate:
python3 scripts/todo_gate.py $(GATE_ARGS)
smoke:
python3 scripts/smoke_popup.py $(SMOKE_ARGS)
install: package
kpackagetool6 -t Plasma/Applet -u dist/codexbar-plasma.plasmoid || kpackagetool6 -t Plasma/Applet -i dist/codexbar-plasma.plasmoid
restart:
systemctl --user restart plasma-plasmashell.service
update:
scripts/update-widget.sh --install
translations:
scripts/update_translations.sh
compile-translations:
python3 scripts/compile_translations.py
package:
mkdir -p dist
rm -f dist/codexbar-plasma.plasmoid dist/codexbar-plasma.plasmoid.sha256
@if find $(PACKAGE_FILES) -type l -print -quit | grep -q .; then \
echo "refusing to package symlinks from PACKAGE_FILES" >&2; \
find $(PACKAGE_FILES) -type l -print >&2; \
exit 1; \
fi
$(MAKE) compile-translations
@if command -v cmake >/dev/null 2>&1; then \
cmake -E tar cf dist/codexbar-plasma.plasmoid --format=zip $(PACKAGE_FILES); \
elif command -v zip >/dev/null 2>&1; then \
zip -qr dist/codexbar-plasma.plasmoid $(PACKAGE_FILES); \
elif command -v python3 >/dev/null 2>&1; then \
python3 -m zipfile -c dist/codexbar-plasma.plasmoid $(PACKAGE_FILES); \
else \
echo "missing required command: cmake, zip, or python3" >&2; \
exit 127; \
fi
@command -v sha256sum >/dev/null 2>&1 || { \
echo "missing required command: sha256sum" >&2; \
exit 127; \
}
cd dist && sha256sum codexbar-plasma.plasmoid > codexbar-plasma.plasmoid.sha256