[pygobject/setup-py-no-cairo-env-var] setup.py: Make it possible to build without cairo through an env var. See #250



commit eade7e9f7a88175c14023696591c125cc6fd105a
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Tue Nov 13 22:20:15 2018 +0100

    setup.py: Make it possible to build without cairo through an env var. See #250
    
    PYGOBJECT_WITHOUT_PYCAIRO=1 python3 setup.py install
    or with a recent pip:
    PYGOBJECT_WITHOUT_PYCAIRO=1 pip3 install --no-build-isolation pygobject
    
    I don't see a nice way for telling pip not to require pycairo, so this will
    have to do for now.

 setup.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/setup.py b/setup.py
index 7489e1b8..b4aa14c8 100755
--- a/setup.py
+++ b/setup.py
@@ -47,8 +47,10 @@ GI_VERSION_REQUIRED = "1.46.0"
 PYCAIRO_VERSION_REQUIRED = "1.11.1"
 LIBFFI_VERSION_REQUIRED = "3.0"
 
-WITH_CAIRO = True
-"""Set to false if you don't want to build with cairo/pycairo support"""
+WITH_CAIRO = not bool(os.environ.get("PYGOBJECT_WITHOUT_PYCAIRO"))
+"""Set PYGOBJECT_WITHOUT_PYCAIRO if you don't want to build with
+cairo/pycairo support. Note that this option might get removed in the future.
+"""
 
 
 def is_dev_version():


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]