Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (76 loc) · 4.54 KB
/
Copy pathMakefile
File metadata and controls
84 lines (76 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
WAVES_APP_NAME = "Waves"
WAVES_VERSION=`grep -m 1 '__version__' waves/waves_ui/__init__.py | tr -d ' "' | cut -d'=' -f2`
app_path_dist = "dist"
# Oldest macOS the bundle can run on: the most demanding file shipped inside
# decides this, in practice the PySide6 wheels (see the note in pyproject.toml).
# The locked 6.11.1 really requires macOS 15 (its wheel tag lies, issue #14),
# so 15.0 is the default; CI's legacy macOS legs overlay pyside6 6.9.3 and
# override this to 12.0 via the environment (hence ?=) for the "_legacy"
# bundles. The value is declared in Info.plist so an unsupported system shows
# a clear "requires macOS N" dialog instead of a silent Dock bounce, and CI's
# "Assert macOS version floor" step fails any build containing a file that
# demands something newer than the flavor's declared floor.
WAVES_MACOS_MIN ?= 15.0
.PHONY: install
install: ## Install the poetry environment and install the pre-commit hooks
@echo "🚀 Creating virtual environment using pyenv and poetry"
@poetry install --all-extras --with dev
@poetry run pre-commit install
@poetry shell
.PHONY: check
check: ## Run code quality tools.
@echo "🚀 Checking Poetry lock file consistency with 'pyproject.toml': Running poetry lock --check"
@poetry check --lock
@echo "🚀 Linting code: Running pre-commit"
@poetry run pre-commit run -a
@echo "🚀 Checking for obsolete dependencies: Running deptry"
@poetry run deptry .
.PHONY: test
test: ## Test the code with pytest
@echo "🚀 Testing code: Running pytest"
@poetry run pytest --doctest-modules
.PHONY: star-history
star-history: ## Copy the star-history chart from the public repo into this tree
@bash tools/sync_star_history.sh
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: gui-waves
gui-waves: ## Build the Waves QML app (standalone). On macOS this yields dist/waves.app
@# Qt 6.11 ships Qt.labs.assetdownloader as a static library only, which
@# Nuitka cannot process (see tools/prune_static_qml_plugins.py). Prune it
@# from the build virtualenv first; a no-op on Qt versions without it.
@poetry run python tools/prune_static_qml_plugins.py
@# MACOSX_DEPLOYMENT_TARGET: without it, everything Nuitka compiles inherits
@# the build host's own macOS version as its floor, and CI's "Assert macOS
@# version floor" step rejects the bundle. Harmless on Linux/Windows.
@MACOSX_DEPLOYMENT_TARGET=$(WAVES_MACOS_MIN) poetry run python -m nuitka \
--macos-app-version=$(WAVES_VERSION) \
--file-version=$(WAVES_VERSION) \
--product-version=$(WAVES_VERSION) \
--macos-app-name=$(WAVES_APP_NAME) \
--output-filename=$(WAVES_APP_NAME) \
--product-name=$(WAVES_APP_NAME) \
waves.py
@# Strip the Qt modules the QML UI never loads (chiefly a ~210 MB bundled
@# Chromium), see tools/trim_qt_bundle.sh, which auto-detects the per-OS
@# bundle layout (waves.app on macOS, waves.dist on Linux/Windows).
@if [ -d "$(app_path_dist)/waves.app" ]; then \
bash tools/trim_qt_bundle.sh "$(app_path_dist)/waves.app"; \
echo "🔐 Declaring network/removable volume access so macOS shows a persistable consent prompt (no Full Disk Access needed)"; \
plutil -replace NSNetworkVolumesUsageDescription -string "Waves saves your downloads to the folder you choose, which can live on a network share (NAS/SMB)." "$(app_path_dist)/waves.app/Contents/Info.plist"; \
plutil -replace NSRemovableVolumesUsageDescription -string "Waves saves your downloads to the folder you choose, which can live on an external drive." "$(app_path_dist)/waves.app/Contents/Info.plist"; \
echo "🧱 Declaring the macOS floor so older systems get a clear dialog instead of a silent bounce"; \
plutil -replace LSMinimumSystemVersion -string "$(WAVES_MACOS_MIN)" "$(app_path_dist)/waves.app/Contents/Info.plist"; \
echo "🔏 Re-sealing macOS bundle (trim + plist edit broke Nuitka's ad-hoc signature)"; \
codesign --force --deep --sign - "$(app_path_dist)/waves.app"; \
elif [ -d "$(app_path_dist)/waves.dist" ]; then \
bash tools/trim_qt_bundle.sh "$(app_path_dist)/waves.dist"; \
fi
# Per-OS aliases used by CI (release-or-test-build.yml). The build + trim already
# happens in gui-waves; CI zips the result (macOS = waves.app, Linux/Windows =
# waves.dist). They exist as named entry points so each matrix leg reads clearly.
.PHONY: gui-waves-linux
gui-waves-linux: gui-waves ## Build + trim the Waves app (Linux); artifact is dist/waves.dist
.PHONY: gui-waves-windows
gui-waves-windows: gui-waves ## Build + trim the Waves app (Windows); artifact is dist/waves.dist