Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
3.4 kB · 80 lines
at litex
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081From 944d5467e1655aac20a14325631df6daccaf5804 Mon Sep 17 00:00:00 2001From: Jan Tojnar <jtojnar@gmail.com>Date: Sun, 3 Mar 2019 01:13:46 +0100Subject: [PATCH] Fix building on Nix
./configure.py tries to find dbus-python header in dbus-1 includedirobtained from pkg-config or from --dbus flag. Unfortunately, when supplied,it also uses the flag for locating dbus-1 headers. This fails on Nix,since every package is installed into its own immutable tree so we cannotuse a single directory for both dbus-python and dbus-1. We can fix this byusing pkg-config for finding dbus-python headers too.
Additionally, the build system also tries to install the dbus support moduleto dbus-python tree. Often, it is possible to handle this in pkgconfig as well [1]but unfortunately, dbus-python does not export the moduledir in its pc fileso I have decided to solve this with an extra configure flag.
[1]: https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/--- configure.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/configure.py b/configure.pyindex c6663e4..65e7da7 100644--- a/configure.py+++ b/configure.py@@ -905,6 +905,9 @@ class TargetConfiguration: if opts.pydbusincdir is not None: self.pydbus_inc_dir = opts.pydbusincdir + if opts.pydbusmoduledir is not None:+ self.pydbus_module_dir = opts.pydbusmoduledir+ if opts.pyuicinterpreter is not None: self.pyuic_interpreter = opts.pyuicinterpreter @@ -1191,6 +1194,11 @@ def create_optparser(target_config): metavar="DIR", help="the directory containing the dbus/dbus-python.h header is " "DIR [default: supplied by pkg-config]")+ g.add_option("--dbus-moduledir", dest='pydbusmoduledir', type='string',+ default=None, action='callback', callback=store_abspath,+ metavar="DIR",+ help="the directory where dbus support module will be installed to"+ "DIR [default: obtained from dbus.mainloop python module]") p.add_option_group(g) # Installation.@@ -2277,7 +2285,7 @@ def check_dbus(target_config, verbose): inform("Checking to see if the dbus support module should be built...") - cmd = 'pkg-config --cflags-only-I --libs dbus-1'+ cmd = 'pkg-config --cflags-only-I --libs dbus-1 dbus-python' if verbose: sys.stdout.write(cmd + "\n")@@ -2307,7 +2315,8 @@ def check_dbus(target_config, verbose): inform("The Python dbus module doesn't seem to be installed.") return - target_config.pydbus_module_dir = dbus.mainloop.__path__[0]+ if target_config.pydbus_module_dir == '':+ target_config.pydbus_module_dir = dbus.mainloop.__path__[0] # Try and find dbus-python.h. We don't use pkg-config because it is broken # for dbus-python (at least for versions up to and including v0.81.0).diff --git a/project.py b/project.pyindex fe9fbce..9ae1ca1 100644--- a/project.py+++ b/project.py@@ -261,7 +261,7 @@ del find_qt dbus_lib_dirs = [] dbus_libs = [] - args = ['pkg-config', '--cflags-only-I', '--libs dbus-1']+ args = ['pkg-config', '--cflags-only-I', '--libs dbus-1', 'dbus-python'] for line in self.read_command_pipe(args, fatal=False): for flag in line.strip().split():