From b272fbb0e5a4692544ce7b2a1062f45013251739 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 4 Jul 2021 11:31:31 +0200 Subject: scripts: Add arch check to mkvenv --- scripts/mkvenv.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scripts') diff --git a/scripts/mkvenv.py b/scripts/mkvenv.py index ba31638d8..d5cd5f5d7 100755 --- a/scripts/mkvenv.py +++ b/scripts/mkvenv.py @@ -30,6 +30,7 @@ import os.path import shutil import venv as pyvenv import subprocess +import platform from typing import List, Optional, Tuple, Dict, Union sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) @@ -224,6 +225,20 @@ def install_pyqt_binary(venv_dir: pathlib.Path, version: str) -> None: utils.print_title("Installing PyQt from binary") utils.print_col("No proprietary codec support will be available in " "qutebrowser.", 'bold') + + supported_archs = { + 'linux': {'x86_64'}, + 'win32': {'x86', 'AMD64'}, + 'darwin': {'x86_64'}, + } + if sys.platform not in supported_archs: + utils.print_error(f"{sys.platform} is not a supported platform by PyQt5 binary " + "packages, this will most likely fail.") + elif platform.machine() not in supported_archs[sys.platform]: + utils.print_error( + f"{platform.machine()} is not a supported architecture for PyQt5 binaries " + f"on {sys.platform}, this will most likely fail.") + pip_install(venv_dir, '-r', pyqt_requirements_file(version), '--only-binary', 'PyQt5,PyQtWebEngine') -- cgit v1.2.3-54-g00ecf