diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-10-26 18:20:52 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-10-26 18:20:52 +0000 |
| commit | d5f704aeefcddf84c928c77f138968554a171262 (patch) | |
| tree | e45e0b633ed2c05601a4df303834c61e26f5d16f /dev-python/QtPy | |
| parent | 9a0841c3944fd373914688bfeb12dc0a1b32fa6e (diff) | |
| download | baldeagleos-repo-d5f704aeefcddf84c928c77f138968554a171262.tar.gz baldeagleos-repo-d5f704aeefcddf84c928c77f138968554a171262.tar.xz baldeagleos-repo-d5f704aeefcddf84c928c77f138968554a171262.zip | |
Adding metadata
Diffstat (limited to 'dev-python/QtPy')
| -rw-r--r-- | dev-python/QtPy/QtPy-2.4.1-r1.ebuild (renamed from dev-python/QtPy/QtPy-2.4.1.ebuild) | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/dev-python/QtPy/QtPy-2.4.1.ebuild b/dev-python/QtPy/QtPy-2.4.1-r1.ebuild index 0c98479e289c..d36ab42148c6 100644 --- a/dev-python/QtPy/QtPy-2.4.1.ebuild +++ b/dev-python/QtPy/QtPy-2.4.1-r1.ebuild @@ -157,18 +157,45 @@ src_prepare() { sed -i -e 's:--cov=qtpy --cov-report=term-missing::' pytest.ini || die # Disable Qt for Python implementations that are not selected if ! use pyqt5; then - sed -i -e '/from PyQt5.QtCore import/,/)/c\ \ \ \ \ \ \ \ raise ImportError #/' qtpy/__init__.py || die - fi - if ! use pyqt6; then - sed -i -e '/from PyQt6.QtCore import/,/)/c\ \ \ \ \ \ \ \ raise ImportError #/' qtpy/__init__.py || die + sed \ + -e '/from PyQt5.QtCore import/,/)/c\ \ \ \ \ \ \ \ raise ImportError #/' \ + -e '/if "PyQt5" in sys.modules:/,/"pyqt5"/c\' \ + -i qtpy/__init__.py || die + + # We need to ensure the first option is an 'if' not 'elif' + sed -e 's/elif "PySide2" in sys.modules:/if "PySide2" in sys.modules:/g' -i qtpy/__init__.py || die fi if ! use pyside2; then - sed -i -e "s/from PySide2 import/raise ImportError #/" qtpy/__init__.py || die - sed -i -e "s/from PySide2.QtCore import/raise ImportError #/" qtpy/__init__.py || die + sed \ + -e "s/from PySide2 import/raise ImportError #/" \ + -e "s/from PySide2.QtCore import/raise ImportError #/" \ + -e '/if "PySide2" in sys.modules:/,/"pyside2"/c\' \ + -i qtpy/__init__.py || die + + if ! use pyqt5; then + sed \ + -e 's/elif "PyQt6" in sys.modules:/if "PyQt6" in sys.modules:/g' \ + -i qtpy/__init__.py || die + fi + fi + if ! use pyqt6; then + sed \ + -e '/from PyQt6.QtCore import/,/)/c\ \ \ \ \ \ \ \ raise ImportError #/' \ + -e '/if "PyQt6" in sys.modules:/,/"pyqt6"/c\' \ + -i qtpy/__init__.py || die + + if ! use pyqt5 && ! use pyside2; then + sed \ + -e 's/elif "PySide6" in sys.modules:/if "PySide6" in sys.modules:/g' \ + -i qtpy/__init__.py || die + fi fi if ! use pyside6; then - sed -i -e "s/from PySide6 import/raise ImportError #/" qtpy/__init__.py || die - sed -i -e "s/from PySide6.QtCore import/raise ImportError #/" qtpy/__init__.py || die + sed \ + -e "s/from PySide6 import/raise ImportError #/" \ + -e "s/from PySide6.QtCore import/raise ImportError #/" \ + -e '/if "PySide6" in sys.modules:/,/"pyside6"/c\' \ + -i qtpy/__init__.py || die fi } |
