Hi,

currently the cmake pygtk check in gnuradio-3.6.0 requires
X session, otherwise it silently fails. This prevents
building on distribution buildsystems. Output snip
(with increased verbosity) follows:

-- Python checking for pygtk >= 2.10.0
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 64, 
in <module>
    _init()
  File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 52, 
in _init
    _gtk.init_check()
RuntimeError: could not open display
-- Python checking for pygtk >= 2.10.0 - not found

Attached patch is port from gnuradio-3.5 autotools check,
it seems to fix the problem for me

regards

Jaroslav

diff -up gnuradio-3.6.0/cmake/Modules/GrPython.cmake.orig gnuradio-3.6.0/cmake/Modules/GrPython.cmake
--- gnuradio-3.6.0/cmake/Modules/GrPython.cmake.orig	2012-04-21 21:00:33.000000000 +0200
+++ gnuradio-3.6.0/cmake/Modules/GrPython.cmake	2012-04-23 15:13:49.227149681 +0200
@@ -76,12 +76,11 @@ macro(GR_PYTHON_CHECK_MODULE desc mod cm
     execute_process(
         COMMAND ${PYTHON_EXECUTABLE} -c "
 #########################################
-try: import ${mod}
-except:
-    try: ${mod}
-    except: exit(-1)
-try: assert ${cmd}
-except: exit(-1)
+try:
+    import ${mod}
+    assert ${cmd}
+except ImportError, AssertionError: exit(-1)
+except: pass
 #########################################"
         RESULT_VARIABLE ${have}
     )
_______________________________________________
Patch-gnuradio mailing list
Patch-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/patch-gnuradio

Reply via email to