mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
12d4e7567c
Fully enable pycairo support by exporting PYCAIRO=true and using pkg-config to locate the pycairo library (with included patch). The patch restores the use of pkg-config to find pycairo. This code was present upstream, but commented out; it has been re-enabled and modified to support both pycairo and py3cairo (the python3 version of pycairo).
19 lines
1009 B
Diff
19 lines
1009 B
Diff
diff --git a/setup.py b/setup.py
|
|
index 82a31d733..1c876a553 100755
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -228,10 +228,9 @@ extra_comp_args = list(filter(lambda arg: arg != "-fvisibility=hidden", extra_co
|
|
if os.environ.get("PYCAIRO", "false") == "true":
|
|
try:
|
|
extra_comp_args.append('-DHAVE_PYCAIRO')
|
|
- print("-I%s/include/pycairo".format(sys.exec_prefix))
|
|
- extra_comp_args.append("-I{0}/include/pycairo".format(sys.exec_prefix))
|
|
- #extra_comp_args.extend(check_output(["pkg-config", '--cflags', 'pycairo']).strip().split(' '))
|
|
- #linkflags.extend(check_output(["pkg-config", '--libs', 'pycairo']).strip().split(' '))
|
|
+ pycairo_name = 'py3cairo' if PYTHON3 else 'pycairo'
|
|
+ extra_comp_args.extend(check_output(["pkg-config", '--cflags', pycairo_name]).strip().split(' '))
|
|
+ linkflags.extend(check_output(["pkg-config", '--libs', pycairo_name]).strip().split(' '))
|
|
except:
|
|
raise Exception("Failed to find compiler options for pycairo")
|
|
|