diff options
Diffstat (limited to 'games/anki/files')
-rw-r--r-- | games/anki/files/patch-build_configure_src_python.rs | 43 | ||||
-rw-r--r-- | games/anki/files/patch-build_ninja__gen_src_archives.rs | 25 | ||||
-rw-r--r-- | games/anki/files/patch-package.json | 8 | ||||
-rw-r--r-- | games/anki/files/patch-pylib_tools_hookslib.py | 36 | ||||
-rw-r--r-- | games/anki/files/patch-qt_pyproject.toml | 21 |
5 files changed, 116 insertions, 17 deletions
diff --git a/games/anki/files/patch-build_configure_src_python.rs b/games/anki/files/patch-build_configure_src_python.rs new file mode 100644 index 000000000000..af1d0427fe17 --- /dev/null +++ b/games/anki/files/patch-build_configure_src_python.rs @@ -0,0 +1,43 @@ +Depend on PYTHON_BINARY as well if OFFLINE_BUILD is used to let us specify the +current Python interpreter that is used in the system. + +Otherwise the build emits following error message during the creation of +the Python wheels: + +[...] +FAILED: /wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/wheels/aqt-25.7.2-py3-none-any.whl +/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/rust/release/runner run --env="UV_PROJECT_ENVIRONMENT=/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/pyenv" --env="A +NKI_WHEEL_TAG=py3-none-any" /usr/local/bin/uv build --wheel --out-dir=/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/wheels/ --project=qt + × Failed to build `/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/qt` + ╰─▶ No interpreter found for Python 3.13.5 in virtual environments, managed + installations, or search path + Failed with code Some(2): /usr/local/bin/uv build --wheel --out-dir=/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/wheels/ --project=qt +[...] + +The environment variables UV_NO_BUILD_ISOLATION=1 and UV_OFFLINE=1 are also +required to run "uv" in offline mode and to make use of the Python packages +outside of the pseudo-venv. + +--- build/configure/src/python.rs.orig 2025-07-07 16:49:54 UTC ++++ build/configure/src/python.rs +@@ -119,11 +119,19 @@ impl BuildAction for BuildWheel { + + impl BuildAction for BuildWheel { + fn command(&self) -> &str { +- "$uv build --wheel --out-dir=$out_dir --project=$project_dir" ++ if std::env::var("OFFLINE_BUILD").is_ok() && std::env::var("PYTHON_BINARY").is_ok() { ++ "$uv build --python=$python_binary --wheel --out-dir=$out_dir --project=$project_dir" ++ } else { ++ "$uv build --wheel --out-dir=$out_dir --project=$project_dir" ++ } + } + + fn files(&mut self, build: &mut impl FilesHandle) { + if std::env::var("OFFLINE_BUILD").ok().as_deref() == Some("1") { ++ let python_binary = ++ std::env::var("PYTHON_BINARY").expect("PYTHON_BINARY must be set in OFFLINE_BUILD mode"); ++ build.add_variable("python_binary", python_binary); ++ + let uv_path = + std::env::var("UV_BINARY").expect("UV_BINARY must be set in OFFLINE_BUILD mode"); + build.add_inputs("uv", inputs![uv_path]); diff --git a/games/anki/files/patch-build_ninja__gen_src_archives.rs b/games/anki/files/patch-build_ninja__gen_src_archives.rs index 79252c6151fe..f731257913ed 100644 --- a/games/anki/files/patch-build_ninja__gen_src_archives.rs +++ b/games/anki/files/patch-build_ninja__gen_src_archives.rs @@ -12,18 +12,17 @@ Since the latter is already bypassed by setting the environment variables other parts of the code for now. It probably makes sense to have a generic variable (e.g. "Self::FreeBSD") -for all FreeBSD architectures that is used in conjunction with NO_BUNDLE, -NO_VENV, OFFLINE_BUILD and OFFLINE_YARNCACHE to allow building on FreeBSD -(and preferably other BSDs) persistently. +for all FreeBSD architectures that is used in conjunction with OFFLINE_BUILD +to allow building on FreeBSD (and preferably other BSDs) persistently. ---- build/ninja_gen/src/archives.rs.orig 2023-03-31 02:32:25 UTC +--- build/ninja_gen/src/archives.rs.orig 2025-06-13 08:38:15 UTC +++ build/ninja_gen/src/archives.rs -@@ -39,6 +39,8 @@ impl Platform { - let os = std::env::consts::OS; - let arch = std::env::consts::ARCH; - match (os, arch) { -+ ("freebsd", "x86_64") => Self::LinuxX64, -+ ("freebsd", "aarch64") => Self::LinuxArm, - ("linux", "x86_64") => Self::LinuxX64, - ("linux", "aarch64") => Self::LinuxArm, - ("macos", "x86_64") => Self::MacX64, +@@ -34,6 +34,8 @@ impl Platform { + let os = std::env::consts::OS; + let arch = std::env::consts::ARCH; + match (os, arch) { ++ ("freebsd", "x86_64") => Self::LinuxX64, ++ ("freebsd", "aarch64") => Self::LinuxArm, + ("linux", "x86_64") => Self::LinuxX64, + ("linux", "aarch64") => Self::LinuxArm, + ("macos", "x86_64") => Self::MacX64, diff --git a/games/anki/files/patch-package.json b/games/anki/files/patch-package.json index 15fa082c49ea..c757400518fa 100644 --- a/games/anki/files/patch-package.json +++ b/games/anki/files/patch-package.json @@ -9,13 +9,13 @@ If this is important to you, please consider supporting Rollup to make a native at Object.<anonymous> (/wrkdirs/usr/ports/games/anki/work/anki-24.06.2/out/node_modules/rollup/dist/native.js:38:8) [...] ---- package.json.orig 2025-01-26 14:20:58 UTC +--- package.json.orig 2025-07-04 08:49:17 UTC +++ package.json -@@ -80,6 +80,7 @@ +@@ -81,6 +81,7 @@ }, "resolutions": { "canvas": "npm:empty-npm-package@1.0.0", + "rollup": "npm:@rollup/wasm-node", - "cookie": "0.7.0" + "cookie": "0.7.0", + "vite": "6" }, - "browserslist": [ diff --git a/games/anki/files/patch-pylib_tools_hookslib.py b/games/anki/files/patch-pylib_tools_hookslib.py new file mode 100644 index 000000000000..53a3f6d62d79 --- /dev/null +++ b/games/anki/files/patch-pylib_tools_hookslib.py @@ -0,0 +1,36 @@ +Skip code formatting with "ruff" on FreeBSD 15.0-CURRENT (observed with +n278368-5c9b1c7e5f27) to prevent following error: + +[...] +FAILED: /wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/qt/_aqt/hooks.py +/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/rust/release/runner run /wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/pyenv/bin/python qt/tools/genhooks_gui.py /wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/qt/_aqt/hooks.py +<jemalloc>: jemalloc_tsd.c:190: Failed assertion: "!tsd_in_nominal_list(tsd)" +Traceback (most recent call last): + File "/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/qt/tools/genhooks_gui.py", line 1381, in <module> + write_file(path, hooks, prefix, suffix) + File "/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/pylib/tools/hookslib.py", line 208, in write_file + subprocess.run([sys.executable, "-m", "ruff", "format", "-q", path], check=True) + File "/usr/local/lib/python3.11/subprocess.py", line 571, in run + raise CalledProcessError(retcode, process.args, + subprocess.CalledProcessError: Command '['/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/pyenv/bin/python', '-m', 'ruff', 'format', '-q', '/wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/qt/_aqt/hooks.py']' died with <Signals.SIGABRT: 6>. + Failed with code Some(1): /wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/pyenv/bin/python qt/tools/genhooks_gui.py /wrkdirs/usr/ports/games/anki/work/anki-25.07.2/out/qt/_aqt/hooks.py +[...] + +--- pylib/tools/hookslib.py.orig 2025-07-09 11:37:00 UTC ++++ pylib/tools/hookslib.py +@@ -7,6 +7,7 @@ from __future__ import annotations + + from __future__ import annotations + ++import platform + import subprocess + import sys + from dataclasses import dataclass +@@ -205,4 +206,6 @@ def write_file(path: str, hooks: list[Hook], prefix: s + + with open(path, "wb") as file: + file.write(code.encode("utf8")) +- subprocess.run([sys.executable, "-m", "ruff", "format", "-q", path], check=True) ++ ++ if not (platform.system() == 'FreeBSD' and platform.release() == '15.0-CURRENT'): ++ subprocess.run([sys.executable, "-m", "ruff", "format", "-q", path], check=True) diff --git a/games/anki/files/patch-qt_pyproject.toml b/games/anki/files/patch-qt_pyproject.toml new file mode 100644 index 000000000000..230d2f62b318 --- /dev/null +++ b/games/anki/files/patch-qt_pyproject.toml @@ -0,0 +1,21 @@ +Relax version requirements for several PyQt6 components. + +--- qt/pyproject.toml.orig 2025-07-05 14:16:12 UTC ++++ qt/pyproject.toml +@@ -45,11 +45,11 @@ qt = [ + "pyqt6_sip==13.10.2", + ] + qt = [ +- "pyqt6==6.8.0", +- "pyqt6-qt6==6.8.1", +- "pyqt6-webengine==6.8.0", +- "pyqt6-webengine-qt6==6.8.1", +- "pyqt6_sip==13.10.2", ++ "pyqt6", ++ "pyqt6-qt6", ++ "pyqt6-webengine", ++ "pyqt6-webengine-qt6", ++ "pyqt6_sip", + ] + + [tool.uv] |