13 DBUS_NAME_BASE
= 'org.ladish'
16 # these variables are mandatory ('/' are converted automatically)
20 def display_msg(conf
, msg
="", status
= None, color
= None):
22 conf
.check_message_1(msg
)
23 conf
.check_message_2(status
, color
)
25 Utils
.pprint('NORMAL', msg
)
27 def display_raw_text(conf
, text
, color
= 'NORMAL'):
28 Utils
.pprint(color
, text
, sep
= '')
30 def display_line(conf
, text
, color
= 'NORMAL'):
31 Utils
.pprint(color
, text
, sep
= os
.linesep
)
40 opt
.tool_options('compiler_cc')
41 opt
.tool_options('compiler_cxx')
42 opt
.tool_options('boost')
43 opt
.tool_options('python')
44 opt
.add_option('--enable-pkg-config-dbus-service-dir', action
='store_true', default
=False, help='force D-Bus service install dir to be one returned by pkg-config')
45 opt
.add_option('--enable-liblash', action
='store_true', default
=False, help='Build LASH compatibility library')
46 opt
.add_option('--enable-pylash', action
='store_true', default
=False, help='Build python bindings for LASH compatibility library')
47 opt
.add_option('--debug', action
='store_true', default
=False, dest
='debug', help="Build debuggable binaries")
48 opt
.add_option('--doxygen', action
='store_true', default
=False, help='Enable build of doxygen documentation')
49 opt
.add_option('--distnodeps', action
='store_true', default
=False, help="When creating distribution tarball, don't package git submodules")
51 def add_cflag(conf
, flag
):
52 conf
.env
.append_unique('CXXFLAGS', flag
)
53 conf
.env
.append_unique('CCFLAGS', flag
)
55 def add_linkflag(conf
, flag
):
56 conf
.env
.append_unique('LINKFLAGS', flag
)
58 def check_gcc_optimizations_enabled(flags
):
59 gcc_optimizations_enabled
= False
61 if len(flag
) < 2 or flag
[0] != '-' or flag
[1] != 'O':
64 gcc_optimizations_enabled
= True;
66 gcc_optimizations_enabled
= flag
[2] != '0';
67 return gcc_optimizations_enabled
69 def create_service_taskgen(bld
, target
, opath
, binary
):
70 obj
= bld
.new_task_gen('subst')
71 obj
.source
= os
.path
.join('daemon', 'dbus.service.in')
73 obj
.dict = {'dbus_object_path': opath
,
74 'daemon_bin_path': os
.path
.join(bld
.env
['PREFIX'], 'bin', binary
)}
75 obj
.install_path
= bld
.env
['DBUS_SERVICES_DIR'] + os
.path
.sep
76 obj
.fun
= misc
.subst_func
78 def _get_python_variables(python_exe
,variables
,imports
=['import sys']):
82 program
.append("print(repr(%s))"%v
)
83 os_env
=dict(os
.environ
)
85 del os_env
['MACOSX_DEPLOYMENT_TARGET']
88 proc
=Utils
.pproc
.Popen([python_exe
,"-c",'\n'.join(program
)],stdout
=Utils
.pproc
.PIPE
,env
=os_env
)
89 output
=proc
.communicate()[0].split("\n")
91 if Options
.options
.verbose
:
92 warn("Python program to extract python configuration variables failed:\n%s"%'\n'.join(["line %03i: %s"%(lineno
+1,line
)for lineno
,line
in enumerate(program
)]))
100 return_values
.append(None)
101 elif s
[0]=="'"and s
[-1]=="'":
102 return_values
.append(s
[1:-1])
104 return_values
.append(int(s
))
109 conf
.check_tool('compiler_cc')
110 conf
.check_tool('compiler_cxx')
111 conf
.check_tool('boost')
112 conf
.check_tool('python')
113 #conf.check_tool('ParallelDebug')
115 conf
.env
['LIB_DL'] = ['dl']
120 errmsg
= "not installed, see http://jackaudio.org/",
121 args
= '--cflags --libs')
125 atleast_version
= '1.0.0',
127 errmsg
= "not installed, see http://dbus.freedesktop.org/",
128 args
= '--cflags --libs')
130 dbus_dir
= conf
.check_cfg(package
='dbus-1', args
='--variable=session_bus_services_dir', msg
="Retrieving D-Bus services dir")
134 dbus_dir
= dbus_dir
.strip()
135 conf
.env
['DBUS_SERVICES_DIR_REAL'] = dbus_dir
137 if Options
.options
.enable_pkg_config_dbus_service_dir
:
138 conf
.env
['DBUS_SERVICES_DIR'] = dbus_dir
140 conf
.env
['DBUS_SERVICES_DIR'] = os
.path
.join(os
.path
.normpath(conf
.env
['PREFIX']), 'share', 'dbus-1', 'services')
142 conf
.env
['LIBDIR'] = os
.path
.join(os
.path
.normpath(conf
.env
['PREFIX']), 'lib')
144 conf
.env
['BUILD_DOXYGEN_DOCS'] = Options
.options
.doxygen
149 errmsg
= "not installed, see http://e2fsprogs.sourceforge.net/",
150 args
= '--cflags --libs')
153 header_name
='expat.h',
155 errmsg
= "not installed, see http://expat.sourceforge.net/")
157 conf
.env
['LIB_EXPAT'] = ['expat']
161 if build_gui
and not conf
.check_cfg(
162 package
= 'glib-2.0',
164 errmsg
= "not installed, see http://www.gtk.org/",
165 args
= '--cflags --libs'):
168 if build_gui
and not conf
.check_cfg(
169 package
= 'dbus-glib-1',
171 errmsg
= "not installed, see http://dbus.freedesktop.org/",
172 args
= '--cflags --libs'):
175 if build_gui
and not conf
.check_cfg(
176 package
= 'gtk+-2.0',
178 atleast_version
= '2.20.0',
179 errmsg
= "not installed, see http://www.gtk.org/",
180 args
= '--cflags --libs'):
183 if build_gui
and not conf
.check_cfg(
184 package
= 'flowcanvas',
186 atleast_version
= '0.6.4',
187 errmsg
= "not installed, see http://drobilla.net/software/flowcanvas/",
188 args
= '--cflags --libs'):
192 # We need the boost headers package (e.g. libboost-dev)
193 # shared_ptr.hpp and weak_ptr.hpp
194 build_gui
= conf
.check_boost(errmsg
="not found, see http://boost.org/")
196 conf
.env
['BUILD_GLADISH'] = build_gui
198 conf
.env
['BUILD_LIBLASH'] = Options
.options
.enable_liblash
199 conf
.env
['BUILD_PYLASH'] = Options
.options
.enable_pylash
200 if conf
.env
['BUILD_PYLASH'] and not conf
.env
['BUILD_LIBLASH']:
201 conf
.fatal("pylash build was requested but liblash was not")
202 conf
.env
['BUILD_PYLASH'] = False
203 if conf
.env
['BUILD_PYLASH']:
204 conf
.check_python_version()
205 #print conf.env['PYTHONDIR']
206 python
= conf
.env
['PYTHON']
208 pymajmin
= '.'.join(conf
.env
['PYTHON_VERSION'].split('.')[:2])
210 v
='prefix SO SYSLIBS LDFLAGS SHLIBS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET'.split()
211 (python_prefix
,python_SO
,python_SYSLIBS
,python_LDFLAGS
,python_SHLIBS
,python_LIBDIR
,python_LIBPL
,INCLUDEPY
,Py_ENABLE_SHARED
,python_MACOSX_DEPLOYMENT_TARGET
)=_get_python_variables(python
,["get_config_var('%s')"%x for x
in v
],['from distutils.sysconfig import get_config_var'])
213 conf
.fatal("Python development headers not found (-v for details).")
214 conf
.log
.write("""Configuration returned from %r:
223 Py_ENABLE_SHARED = %r
224 MACOSX_DEPLOYMENT_TARGET = %r
225 """%(python
,python_prefix
,python_SO
,python_SYSLIBS
,python_LDFLAGS
,python_SHLIBS
,python_LIBDIR
,python_LIBPL
,INCLUDEPY
,Py_ENABLE_SHARED
,python_MACOSX_DEPLOYMENT_TARGET
))
227 conf
.env
['pyext_PATTERN'] = '%s' + python_SO
229 for pattern
in 'python%s-config', 'python-config-%s':
230 python_config
= conf
.find_program(pattern
% pymajmin
, var
= 'PYTHON_CONFIG')
233 #print conf.env['PYTHON_CONFIG']
234 for incstr
in Utils
.cmd_output("%s --includes" % (conf
.env
['PYTHON_CONFIG'])).strip().split():
235 if (incstr
.startswith('-I') or incstr
.startswith('/I')):
237 if incstr
not in includes
:
238 includes
.append(incstr
)
239 conf
.log
.write("Include path for Python extensions ""(found via python-config --includes): %r\n"%(includes
,))
240 conf
.env
['CPPPATH_PYEXT'] = includes
241 conf
.env
['CPPPATH_PYEMBED'] = includes
244 if not python_config
:
245 conf
.log
.write("Include path for Python extensions ""(found via distutils module): %r\n"%(INCLUDEPY
,))
246 conf
.env
['CPPPATH_PYEXT'] = [INCLUDEPY
]
247 conf
.env
['CPPPATH_PYEMBED'] = [INCLUDEPY
]
249 conf
.env
['BUILD_WERROR'] = not RELEASE
250 if conf
.env
['BUILD_WERROR']:
251 add_cflag(conf
, '-Wall')
252 add_cflag(conf
, '-Werror')
253 # for pre gcc-4.4, enable optimizations so use of uninitialized variables gets detected
255 is_gcc
= conf
.env
['CC_NAME'] == 'gcc'
258 for n
in conf
.env
['CC_VERSION']:
259 gcc_ver
.append(int(n
))
260 if gcc_ver
[0] < 4 or gcc_ver
[1] < 4:
261 #print "optimize force enable is required"
262 if not check_gcc_optimizations_enabled(conf
.env
['CCFLAGS']):
263 if Options
.options
.debug
:
264 print "C optimization must be forced in order to enable -Wuninitialized"
265 print "However this will not be made because debug compilation is enabled"
267 print "C optimization forced in order to enable -Wuninitialized"
268 conf
.env
.append_unique('CCFLAGS', "-O")
272 conf
.env
['BUILD_DEBUG'] = Options
.options
.debug
273 if conf
.env
['BUILD_DEBUG']:
274 add_cflag(conf
, '-g')
275 add_cflag(conf
, '-O0')
276 add_linkflag(conf
, '-g')
278 conf
.define('DATA_DIR', os
.path
.normpath(os
.path
.join(conf
.env
['PREFIX'], 'share', APPNAME
)))
279 conf
.define('PACKAGE_VERSION', VERSION
)
280 conf
.define('DBUS_NAME_BASE', DBUS_NAME_BASE
)
281 conf
.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE
.replace('.', '/'))
282 conf
.define('BASE_NAME', APPNAME
)
283 conf
.define('_GNU_SOURCE', 1)
284 conf
.write_config_header('config.h')
288 display_msg(conf
, "==================")
289 version_msg
= APPNAME
+ "-" + VERSION
291 if os
.access('version.h', os
.R_OK
):
292 data
= file('version.h').read()
293 m
= re
.match(r
'^#define GIT_VERSION "([^"]*)"$', data
)
295 version_msg
+= " exported from " + m
.group(1)
296 elif os
.access('.git', os
.R_OK
):
297 version_msg
+= " git revision will checked and eventually updated during build"
299 display_msg(conf
, version_msg
)
302 display_msg(conf
, "Install prefix", conf
.env
['PREFIX'], 'CYAN')
304 display_msg(conf
, 'Build gladish', yesno(conf
.env
['BUILD_GLADISH']))
305 display_msg(conf
, 'Build liblash', yesno(Options
.options
.enable_liblash
))
306 display_msg(conf
, 'Build pylash', yesno(conf
.env
['BUILD_PYLASH']))
307 display_msg(conf
, 'Treat warnings as errors', yesno(conf
.env
['BUILD_WERROR']))
308 display_msg(conf
, 'Debuggable binaries', yesno(conf
.env
['BUILD_DEBUG']))
309 display_msg(conf
, 'Build doxygen documentation', yesno(conf
.env
['BUILD_DOXYGEN_DOCS']))
311 if conf
.env
['DBUS_SERVICES_DIR'] != conf
.env
['DBUS_SERVICES_DIR_REAL']:
313 display_line(conf
, "WARNING: D-Bus session services directory as reported by pkg-config is", 'RED')
314 display_raw_text(conf
, "WARNING:", 'RED')
315 display_line(conf
, conf
.env
['DBUS_SERVICES_DIR_REAL'], 'CYAN')
316 display_line(conf
, 'WARNING: but service file will be installed in', 'RED')
317 display_raw_text(conf
, "WARNING:", 'RED')
318 display_line(conf
, conf
.env
['DBUS_SERVICES_DIR'], 'CYAN')
319 display_line(conf
, 'WARNING: You may need to adjust your D-Bus configuration after installing ladish', 'RED')
320 display_line(conf
, 'WARNING: You can override dbus service install directory', 'RED')
321 display_line(conf
, 'WARNING: with --enable-pkg-config-dbus-service-dir option to this script', 'RED')
323 display_msg(conf
, 'C compiler flags', repr(conf
.env
['CCFLAGS']))
324 display_msg(conf
, 'C++ compiler flags', repr(conf
.env
['CXXFLAGS']))
326 if not conf
.env
['BUILD_GLADISH']:
328 display_line(conf
, "WARNING: The GUI frontend will not built", 'RED')
333 daemon
= bld
.new_task_gen('cc', 'program')
334 daemon
.target
= 'ladishd'
335 daemon
.includes
= "build/default" # XXX config.h version.h and other generated files
336 daemon
.uselib
= 'DBUS-1 UUID EXPAT'
337 daemon
.ver_header
= 'version.h'
338 daemon
.env
.append_value("LINKFLAGS", ["-lutil", "-ldl", "-Wl,-E"])
359 'studio_jack_conf.c',
364 'cmd_rename_studio.c',
366 'cmd_start_studio.c',
368 'cmd_unload_studio.c',
370 'cmd_change_app_state.c',
374 'cmd_save_project.c',
375 'cmd_unload_project.c',
376 'cmd_load_project.c',
386 daemon
.source
.append(os
.path
.join("daemon", source
))
396 daemon
.source
.append(os
.path
.join("proxies", source
))
406 daemon
.source
.append(os
.path
.join("dbus", source
))
413 daemon
.source
.append(os
.path
.join("common", source
))
415 daemon
.source
.append(os
.path
.join("alsapid", "helper.c"))
417 # process dbus.service.in -> ladish.service
418 create_service_taskgen(bld
, DBUS_NAME_BASE
+ '.service', DBUS_NAME_BASE
, daemon
.target
)
420 #####################################################
422 jmcore
= bld
.new_task_gen('cc', 'program')
423 jmcore
.target
= 'jmcore'
424 jmcore
.includes
= "build/default" # XXX config.h version.h and other generated files
425 jmcore
.uselib
= 'DBUS-1 JACK'
426 jmcore
.defines
= ['LOG_OUTPUT_STDOUT']
427 jmcore
.source
= ['jmcore.c']
437 jmcore
.source
.append(os
.path
.join("dbus", source
))
439 create_service_taskgen(bld
, DBUS_NAME_BASE
+ '.jmcore.service', DBUS_NAME_BASE
+ ".jmcore", jmcore
.target
)
441 #####################################################
443 ladiconfd
= bld
.new_task_gen('cc', 'program')
444 ladiconfd
.target
= 'ladiconfd'
445 ladiconfd
.includes
= "build/default" # XXX config.h version.h and other generated files
446 ladiconfd
.uselib
= 'DBUS-1'
447 ladiconfd
.defines
= ['LOG_OUTPUT_STDOUT']
448 ladiconfd
.source
= ['conf.c']
454 ladiconfd
.source
.append(os
.path
.join("common", source
))
464 ladiconfd
.source
.append(os
.path
.join("dbus", source
))
466 create_service_taskgen(bld
, DBUS_NAME_BASE
+ '.conf.service', DBUS_NAME_BASE
+ ".conf", ladiconfd
.target
)
468 #####################################################
470 alsapid
= bld
.new_task_gen('cc', 'shlib')
471 alsapid
.target
= 'alsapid'
472 alsapid
.uselib
= 'DL'
473 alsapid
.source
= [os
.path
.join("alsapid", 'lib.c'), os
.path
.join("alsapid", "helper.c")]
475 #####################################################
477 if bld
.env
['BUILD_LIBLASH']:
478 liblash
= bld
.new_task_gen('cc', 'shlib')
479 liblash
.includes
= "build/default" # XXX config.h version.h and other generated files
480 liblash
.uselib
= 'DBUS-1'
481 liblash
.target
= 'lash'
482 liblash
.vnum
= "1.1.1"
483 liblash
.defines
= ['LOG_OUTPUT_STDOUT']
484 liblash
.source
= [os
.path
.join("lash_compat", "liblash", 'lash.c'), os
.path
.join("common", "catdup.c")]
486 bld
.install_files('${PREFIX}/include/lash', 'lash_compat/liblash/lash/*.h')
488 # process lash-1.0.pc.in -> lash-1.0.pc
489 obj
= bld
.new_task_gen('subst')
490 obj
.source
= [os
.path
.join("lash_compat", 'lash-1.0.pc.in')]
491 obj
.target
= 'lash-1.0.pc'
492 obj
.dict = {'prefix': bld
.env
['PREFIX'],
493 'exec_prefix': bld
.env
['PREFIX'],
494 'libdir': bld
.env
['LIBDIR'],
495 'includedir': os
.path
.normpath(bld
.env
['PREFIX'] + '/include'),
497 obj
.install_path
= '${LIBDIR}/pkgconfig/'
498 obj
.fun
= misc
.subst_func
500 #####################################################
502 if bld
.env
['BUILD_PYLASH']:
503 pylash
= bld
.new_task_gen('cc', 'shlib', 'pyext')
504 pylash
.target
= '_lash'
505 pylash
.uselib_local
= 'lash'
507 pylash
.install_path
= bld
.env
['PYTHONDIR']
513 pylash
.source
.append(os
.path
.join("lash_compat", "pylash", source
))
515 bld
.install_files(bld
.env
['PYTHONDIR'], os
.path
.join("lash_compat", "pylash", "lash.py"))
517 # pkgpyexec_LTLIBRARIES = _lash.la
518 # INCLUDES = $(PYTHON_INCLUDES)
519 # _lash_la_LDFLAGS = -module -avoid-version ../liblash/liblash.la
520 # _lash_la_SOURCES = lash.c lash.h lash_wrap.c
521 # pkgpyexec_SCRIPTS = lash.py
522 # CLEANFILES = lash_wrap.c lash.py lash.pyc zynjacku.defs
523 # EXTRA_DIST = test.py lash.i lash.py
524 # lash_wrap.c lash.py: lash.i lash.h
525 # swig -o lash_wrap.c -I$(top_srcdir) -python $(top_srcdir)/$(subdir)/lash.i
527 #####################################################
529 if bld
.env
['BUILD_GLADISH']:
530 gladish
= bld
.new_task_gen('cxx', 'program')
531 gladish
.features
.append('cc')
532 gladish
.target
= 'gladish'
533 gladish
.defines
= ['LOG_OUTPUT_STDOUT']
534 gladish
.includes
= "build/default" # XXX config.h version.h and other generated files
535 gladish
.uselib
= 'DBUS-1 DBUS-GLIB-1 FLOWCANVAS'
541 'load_project_dialog.c',
542 'save_project_dialog.c',
549 'create_room_dialog.c',
567 gladish
.source
.append(os
.path
.join("gui", source
))
574 'app_supervisor_proxy.c',
578 gladish
.source
.append(os
.path
.join("proxies", source
))
584 gladish
.source
.append(os
.path
.join("dbus", source
))
589 gladish
.source
.append(os
.path
.join("common", source
))
591 # GtkBuilder UI definitions (XML)
592 bld
.install_files(bld
.env
['DATA_DIR'], 'gui/gladish.ui')
594 bld
.install_files('${PREFIX}/bin', 'ladish_control', chmod
=0755)
596 # 'Desktop' file (menu entry, icon, etc)
597 bld
.install_files('${PREFIX}/share/applications/', 'gui/gladish.desktop', chmod
=0644)
600 icon_sizes
= ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256']
601 for icon_size
in icon_sizes
:
602 bld
.path
.ant_glob('art/' + icon_size
+ '/apps/*.png')
603 bld
.install_files('${PREFIX}/share/icons/hicolor/' + icon_size
+ '/apps/', 'art/' + icon_size
+ '/apps/gladish.png')
606 for status
in ["down", "unloaded", "started", "stopped", "warning", "error"]:
607 status_images
.append("art/status_" + status
+ ".png")
609 bld
.install_files(bld
.env
['DATA_DIR'], status_images
)
610 bld
.install_files(bld
.env
['DATA_DIR'], "art/ladish-logo-128x128.png")
611 bld
.install_files(bld
.env
['DATA_DIR'], ["COPYING", "AUTHORS", "README", "NEWS"])
613 if bld
.env
['BUILD_DOXYGEN_DOCS'] == True:
614 html_docs_source_dir
= "build/default/html"
615 if Options
.commands
['clean']:
616 if os
.access(html_docs_source_dir
, os
.R_OK
):
617 Utils
.pprint('CYAN', "Removing doxygen generated documentation...")
618 shutil
.rmtree(html_docs_source_dir
)
619 Utils
.pprint('CYAN', "Removing doxygen generated documentation done.")
620 elif Options
.commands
['build']:
621 if not os
.access(html_docs_source_dir
, os
.R_OK
):
622 os
.popen("doxygen").read()
624 Utils
.pprint('CYAN', "doxygen documentation already built.")
627 source_root
= os
.path
.dirname(Utils
.g_module
.root_path
)
628 if 'relpath' in os
.path
.__all
__:
629 source_root
= os
.path
.relpath(source_root
)
631 paths
+= " " + os
.path
.join(source_root
, "common")
632 paths
+= " " + os
.path
.join(source_root
, "dbus")
633 paths
+= " " + os
.path
.join(source_root
, "proxies")
634 paths
+= " " + os
.path
.join(source_root
, "daemon")
635 paths
+= " " + os
.path
.join(source_root
, "gui")
636 paths
+= " " + os
.path
.join(source_root
, "example-apps")
637 paths
+= " " + os
.path
.join(source_root
, "lib")
638 paths
+= " " + os
.path
.join(source_root
, "lash_compat", "liblash")
639 paths
+= " " + os
.path
.join(source_root
, "lash_compat", "liblash", "lash")
643 '''build tag files for GNU global'''
644 cmd
= "find %s -mindepth 1 -maxdepth 1 -name '*.[ch]' -print | gtags --statistics -f -" % get_tags_dirs()
645 #print("Running: %s" % cmd)
649 '''build TAGS file using etags'''
650 cmd
= "find %s -mindepth 1 -maxdepth 1 -name '*.[ch]' -print | etags -" % get_tags_dirs()
651 #print("Running: %s" % cmd)
653 os
.system("stat -c '%y' TAGS")
656 #print repr(Options.options)
657 if Options
.options
.distnodeps
:
658 shutil
.rmtree('laditools')
659 shutil
.rmtree('flowcanvas')
660 shutil
.rmtree('jack2')
661 shutil
.rmtree('a2jmidid')
662 nodist_files
= ['.gitmodules', 'GTAGS', 'GRTAGS', 'GPATH', 'GSYMS'] # waf does not ignore these file
663 for nodist_file
in nodist_files
:
664 if os
.access(nodist_file
, os
.F_OK
):
665 os
.remove(nodist_file
)
666 shutil
.copy('../build/default/version.h', "./")
669 from Constants
import RUN_ME
670 from TaskGen
import feature
, after
675 def process_git(self
):
676 if getattr(self
, 'ver_header', None):
677 tsk
= self
.create_task('git_ver')
678 tsk
.set_outputs(self
.path
.find_or_declare(self
.ver_header
))
680 # needs some help with implicit dependencies
681 # http://code.google.com/p/waf/issues/detail?id=732
682 tg
= self
.bld
.name_to_obj('ladishd', self
.env
)
683 if id(tg
) != id(self
):
686 if x
.inputs
and x
.inputs
[0].name
== 'main.c' and x
.inputs
[0].parent
.name
== 'daemon':
690 header
= self
.outputs
[0].abspath(self
.env
)
691 if os
.access('../version.h', os
.R_OK
):
692 shutil
.copy('../version.h', header
)
693 data
= file(header
).read()
694 m
= re
.match(r
'^#define GIT_VERSION "([^"]*)"$', data
)
696 self
.ver
= m
.group(1)
697 Utils
.pprint('BLUE', "tarball from git revision " + self
.ver
)
702 if os
.access('../.git', os
.R_OK
):
703 self
.ver
= commands
.getoutput("LANG= git rev-parse HEAD").splitlines()[0]
704 if commands
.getoutput("LANG= git diff-index --name-only HEAD").splitlines():
707 Utils
.pprint('BLUE', "git revision " + self
.ver
)
711 fi
= open(header
, 'w')
712 fi
.write('#define GIT_VERSION "%s"\n' % self
.ver
)
715 cls
= Task
.task_type_from_func('git_ver', vars=[], func
=git_ver
, color
='BLUE')
719 cls
.runnable_status
= always
722 sg
= Utils
.h_list(self
.ver
)
723 node
= self
.outputs
[0]
724 variant
= node
.variant(self
.env
)
725 self
.generator
.bld
.node_sigs
[variant
][node
.id] = sg
726 cls
.post_run
= post_run
730 old_refill
= Runner
.Parallel
.refill_task_list
731 def refill_task_list(self
):
733 self
.outstanding
.sort(cmp=lambda a
, b
: cmp(b
.__class
__.__name
__, a
.__class
__.__name
__))
734 Runner
.Parallel
.refill_task_list
= refill_task_list