Files
silo-calc/Makefile
Zoe Forbes 13b56fd1b0 initial: LibreOffice Calc Silo extension (extracted from silo monorepo)
LibreOffice Calc extension for Silo PLM integration. Uses shared
silo-client package (submodule) for API communication.

Changes from monorepo version:
- SiloClient class removed from client.py, replaced with CalcSiloSettings
  adapter + factory function wrapping silo_client.SiloClient
- silo_calc_component.py adds silo-client to sys.path
- Makefile build-oxt copies silo_client into .oxt for self-contained packaging
- All other modules unchanged
2026-02-06 11:24:13 -06:00

53 lines
1.8 KiB
Makefile

.PHONY: build-oxt install uninstall install-dev test clean help
# Build .oxt extension package (self-contained with silo_client)
build-oxt:
@echo "Building silo-calc.oxt..."
@rm -rf _oxt_build && mkdir _oxt_build
@cp -r pythonpath description META-INF *.py *.xml *.xcu _oxt_build/
@cp -r silo-client/silo_client _oxt_build/pythonpath/silo_client
@cd _oxt_build && zip -r ../silo-calc.oxt . -x '*.pyc' '*__pycache__/*'
@rm -rf _oxt_build
@echo "Built silo-calc.oxt"
# Install extension system-wide (requires unopkg)
install: build-oxt
unopkg add --shared silo-calc.oxt 2>/dev/null || unopkg add silo-calc.oxt
@echo "Installed silo-calc extension. Restart LibreOffice to load."
# Uninstall extension
uninstall:
unopkg remove io.kindredsystems.silo.calc 2>/dev/null || true
@echo "Uninstalled silo-calc extension."
# Development install: symlink into user extensions dir
install-dev:
@CALC_EXT_DIR="$${HOME}/.config/libreoffice/4/user/extensions"; \
if [ -d "$$CALC_EXT_DIR" ]; then \
rm -rf "$$CALC_EXT_DIR/silo-calc"; \
ln -sf $(PWD) "$$CALC_EXT_DIR/silo-calc"; \
echo "Symlinked to $$CALC_EXT_DIR/silo-calc"; \
else \
echo "LibreOffice extensions dir not found at $$CALC_EXT_DIR"; \
echo "Try: make install (uses unopkg)"; \
fi
@echo "Restart LibreOffice to load the Silo Calc extension"
# Run Python tests
test:
python3 -m unittest tests/test_basics.py -v
# Clean build artifacts
clean:
rm -f silo-calc.oxt
rm -rf _oxt_build
help:
@echo "silo-calc targets:"
@echo " build-oxt - Build .oxt extension package"
@echo " install - Install extension (uses unopkg)"
@echo " install-dev - Symlink for development"
@echo " uninstall - Remove extension"
@echo " test - Run Python tests"
@echo " clean - Remove build artifacts"