gladish: rename "Run..." menu entries to "New Application..."
[ladish.git] / wscript
blob7212abc7f99923d4ddf27da0b191710889dfdd1a
1 #! /usr/bin/env python
2 # encoding: utf-8
4 import os
5 import Options
6 import Utils
7 import shutil
8 import re
9 import waflib
10 from waflib.Scripting import Dist
12 parallel_debug = False
14 APPNAME='ladish'
15 VERSION='0.3-rc'
16 DBUS_NAME_BASE = 'org.ladish'
17 RELEASE = False
19 # these variables are mandatory ('/' are converted automatically)
20 top = '.'
21 out = 'build'
23 from Logs import pprint
25 def display_msg(conf, msg="", status = None, color = None):
26 if status:
27 conf.msg(msg, status, color)
28 else:
29 pprint('NORMAL', msg)
31 def display_raw_text(conf, text, color = 'NORMAL'):
32 pprint(color, text, sep = '')
34 def display_line(conf, text, color = 'NORMAL'):
35 pprint(color, text, sep = os.linesep)
37 def yesno(bool):
38 if bool:
39 return "yes"
40 else:
41 return "no"
43 def options(opt):
44 opt.load('compiler_c')
45 opt.load('compiler_cxx')
46 opt.load('boost')
47 opt.load('python')
48 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')
49 opt.add_option('--enable-liblash', action='store_true', default=False, help='Build LASH compatibility library')
50 opt.add_option('--enable-pylash', action='store_true', default=False, help='Build python bindings for LASH compatibility library')
51 opt.add_option('--debug', action='store_true', default=False, dest='debug', help="Build debuggable binaries")
52 opt.add_option('--doxygen', action='store_true', default=False, help='Enable build of doxygen documentation')
53 opt.add_option('--distnodeps', action='store_true', default=False, help="When creating distribution tarball, don't package git submodules")
54 opt.add_option('--distname', type='string', default=None, help="Name for the distribution tarball")
55 opt.add_option('--distsuffix', type='string', default="", help="String to append to the distribution tarball name")
56 opt.add_option('--tagdist', action='store_true', default=False, help='Create of git tag for distname')
57 if parallel_debug:
58 opt.load('parallel_debug')
60 def add_cflag(conf, flag):
61 conf.env.append_unique('CXXFLAGS', flag)
62 conf.env.append_unique('CFLAGS', flag)
64 def add_linkflag(conf, flag):
65 conf.env.append_unique('LINKFLAGS', flag)
67 def check_gcc_optimizations_enabled(flags):
68 gcc_optimizations_enabled = False
69 for flag in flags:
70 if len(flag) < 2 or flag[0] != '-' or flag[1] != 'O':
71 continue
72 if len(flag) == 2:
73 gcc_optimizations_enabled = True;
74 else:
75 gcc_optimizations_enabled = flag[2] != '0';
76 return gcc_optimizations_enabled
78 def create_service_taskgen(bld, target, opath, binary):
79 bld(
80 features = 'subst', # the feature 'subst' overrides the source/target processing
81 source = os.path.join('daemon', 'dbus.service.in'), # list of string or nodes
82 target = target, # list of strings or nodes
83 install_path = bld.env['DBUS_SERVICES_DIR'] + os.path.sep,
84 # variables to use in the substitution
85 dbus_object_path = opath,
86 daemon_bin_path = os.path.join(bld.env['PREFIX'], 'bin', binary))
88 def configure(conf):
89 conf.load('compiler_c')
90 conf.load('compiler_cxx')
91 conf.load('boost')
92 conf.load('python')
93 conf.load('intltool')
94 if parallel_debug:
95 conf.load('parallel_debug')
97 # dladdr() is used by daemon/sigsegv.c
98 # dlvsym() is used by the alsapid library
99 conf.check_cc(msg="Checking for libdl", lib=['dl'], uselib_store='DL')
101 # forkpty() is used by ladishd
102 conf.check_cc(msg="Checking for libutil", lib=['util'], uselib_store='UTIL')
104 conf.check_cfg(
105 package = 'jack',
106 mandatory = True,
107 errmsg = "not installed, see http://jackaudio.org/",
108 args = '--cflags --libs')
110 conf.check_cfg(
111 package = 'dbus-1',
112 atleast_version = '1.0.0',
113 mandatory = True,
114 errmsg = "not installed, see http://dbus.freedesktop.org/",
115 args = '--cflags --libs')
117 dbus_dir = conf.check_cfg(package='dbus-1', args='--variable=session_bus_services_dir', msg="Retrieving D-Bus services dir")
118 if not dbus_dir:
119 return
121 dbus_dir = dbus_dir.strip()
122 conf.env['DBUS_SERVICES_DIR_REAL'] = dbus_dir
124 if Options.options.enable_pkg_config_dbus_service_dir:
125 conf.env['DBUS_SERVICES_DIR'] = dbus_dir
126 else:
127 conf.env['DBUS_SERVICES_DIR'] = os.path.join(os.path.normpath(conf.env['PREFIX']), 'share', 'dbus-1', 'services')
129 conf.env['LIBDIR'] = os.path.join(os.path.normpath(conf.env['PREFIX']), 'lib')
131 conf.env['BUILD_DOXYGEN_DOCS'] = Options.options.doxygen
133 conf.check_cfg(
134 package = 'uuid',
135 mandatory = True,
136 errmsg = "not installed, see http://e2fsprogs.sourceforge.net/",
137 args = '--cflags --libs')
139 conf.check(
140 header_name='expat.h',
141 mandatory = True,
142 errmsg = "not installed, see http://expat.sourceforge.net/")
144 conf.env['LIB_EXPAT'] = ['expat']
146 build_gui = True
148 if build_gui and not conf.check_cfg(
149 package = 'glib-2.0',
150 mandatory = False,
151 errmsg = "not installed, see http://www.gtk.org/",
152 args = '--cflags --libs'):
153 build_gui = False
155 if build_gui and not conf.check_cfg(
156 package = 'dbus-glib-1',
157 mandatory = False,
158 errmsg = "not installed, see http://dbus.freedesktop.org/",
159 args = '--cflags --libs'):
160 build_gui = False
162 if build_gui and not conf.check_cfg(
163 package = 'gtk+-2.0',
164 mandatory = False,
165 atleast_version = '2.20.0',
166 errmsg = "not installed, see http://www.gtk.org/",
167 args = '--cflags --libs'):
168 build_gui = False
170 if build_gui and not conf.check_cfg(
171 package = 'flowcanvas',
172 mandatory = False,
173 atleast_version = '0.6.4',
174 errmsg = "not installed, see http://drobilla.net/software/flowcanvas/",
175 args = '--cflags --libs'):
176 build_gui = False
178 if build_gui:
179 # We need the boost headers package (e.g. libboost-dev)
180 # shared_ptr.hpp and weak_ptr.hpp
181 build_gui = conf.check_boost(errmsg="not found, see http://boost.org/")
183 conf.env['BUILD_GLADISH'] = build_gui
185 conf.env['BUILD_LIBLASH'] = Options.options.enable_liblash
186 conf.env['BUILD_PYLASH'] = Options.options.enable_pylash
187 if conf.env['BUILD_PYLASH'] and not conf.env['BUILD_LIBLASH']:
188 conf.fatal("pylash build was requested but liblash was not")
189 conf.env['BUILD_PYLASH'] = False
190 if conf.env['BUILD_PYLASH']:
191 conf.check_python_version()
192 conf.check_python_headers()
194 conf.env['BUILD_WERROR'] = not RELEASE
195 if conf.env['BUILD_WERROR']:
196 add_cflag(conf, '-Wall')
197 add_cflag(conf, '-Werror')
198 # for pre gcc-4.4, enable optimizations so use of uninitialized variables gets detected
199 try:
200 is_gcc = conf.env['CC_NAME'] == 'gcc'
201 if is_gcc:
202 gcc_ver = []
203 for n in conf.env['CC_VERSION']:
204 gcc_ver.append(int(n))
205 if gcc_ver[0] < 4 or gcc_ver[1] < 4:
206 #print "optimize force enable is required"
207 if not check_gcc_optimizations_enabled(conf.env['CFLAGS']):
208 if Options.options.debug:
209 print "C optimization must be forced in order to enable -Wuninitialized"
210 print "However this will not be made because debug compilation is enabled"
211 else:
212 print "C optimization forced in order to enable -Wuninitialized"
213 conf.env.append_unique('CFLAGS', "-O")
214 except:
215 pass
217 conf.env['BUILD_DEBUG'] = Options.options.debug
218 if conf.env['BUILD_DEBUG']:
219 add_cflag(conf, '-g')
220 add_cflag(conf, '-O0')
221 add_linkflag(conf, '-g')
223 conf.env['DATA_DIR'] = os.path.normpath(os.path.join(conf.env['PREFIX'], 'share', APPNAME))
224 conf.env['LOCALE_DIR'] = os.path.normpath(os.path.join(conf.env['PREFIX'], 'share', 'locale'))
226 # write some parts of the configure environment to the config.h file
227 conf.define('DATA_DIR', conf.env['DATA_DIR'])
228 conf.define('LOCALE_DIR', conf.env['LOCALE_DIR'])
229 conf.define('PACKAGE_VERSION', VERSION)
230 conf.define('DBUS_NAME_BASE', DBUS_NAME_BASE)
231 conf.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE.replace('.', '/'))
232 conf.define('BASE_NAME', APPNAME)
233 conf.define('_GNU_SOURCE', 1)
234 conf.write_config_header('config.h')
236 display_msg(conf)
238 display_msg(conf, "==================")
239 version_msg = APPNAME + "-" + VERSION
241 if os.access('version.h', os.R_OK):
242 data = file('version.h').read()
243 m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
244 if m != None:
245 version_msg += " exported from " + m.group(1)
246 elif os.access('.git', os.R_OK):
247 version_msg += " git revision will checked and eventually updated during build"
249 display_msg(conf, version_msg)
251 display_msg(conf)
252 display_msg(conf, "Install prefix", conf.env['PREFIX'], 'CYAN')
254 display_msg(conf, 'Build gladish', yesno(conf.env['BUILD_GLADISH']))
255 display_msg(conf, 'Build liblash', yesno(Options.options.enable_liblash))
256 display_msg(conf, 'Build pylash', yesno(conf.env['BUILD_PYLASH']))
257 display_msg(conf, 'Treat warnings as errors', yesno(conf.env['BUILD_WERROR']))
258 display_msg(conf, 'Debuggable binaries', yesno(conf.env['BUILD_DEBUG']))
259 display_msg(conf, 'Build doxygen documentation', yesno(conf.env['BUILD_DOXYGEN_DOCS']))
261 if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS_SERVICES_DIR_REAL']:
262 display_msg(conf)
263 display_line(conf, "WARNING: D-Bus session services directory as reported by pkg-config is", 'RED')
264 display_raw_text(conf, "WARNING:", 'RED')
265 display_line(conf, conf.env['DBUS_SERVICES_DIR_REAL'], 'CYAN')
266 display_line(conf, 'WARNING: but service file will be installed in', 'RED')
267 display_raw_text(conf, "WARNING:", 'RED')
268 display_line(conf, conf.env['DBUS_SERVICES_DIR'], 'CYAN')
269 display_line(conf, 'WARNING: You may need to adjust your D-Bus configuration after installing ladish', 'RED')
270 display_line(conf, 'WARNING: You can override dbus service install directory', 'RED')
271 display_line(conf, 'WARNING: with --enable-pkg-config-dbus-service-dir option to this script', 'RED')
273 display_msg(conf, 'C compiler flags', repr(conf.env['CFLAGS']))
274 display_msg(conf, 'C++ compiler flags', repr(conf.env['CXXFLAGS']))
276 if not conf.env['BUILD_GLADISH']:
277 display_msg(conf)
278 display_line(conf, "WARNING: The GUI frontend will not built", 'RED')
280 display_msg(conf)
282 def git_ver(self):
283 bld = self.generator.bld
284 header = self.outputs[0].abspath()
285 if os.access('./version.h', os.R_OK):
286 header = os.path.join(os.getcwd(), out, "version.h")
287 shutil.copy('./version.h', header)
288 data = file(header).read()
289 m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
290 if m != None:
291 self.ver = m.group(1)
292 pprint('BLUE', "tarball from git revision " + self.ver)
293 else:
294 self.ver = "tarball"
295 return
297 if bld.srcnode.find_node('.git'):
298 self.ver = bld.cmd_and_log("LANG= git rev-parse HEAD", quiet=waflib.Context.BOTH).splitlines()[0]
299 if bld.cmd_and_log("LANG= git diff-index --name-only HEAD", quiet=waflib.Context.BOTH).splitlines():
300 self.ver += "-dirty"
302 pprint('BLUE', "git revision " + self.ver)
303 else:
304 self.ver = "unknown"
306 fi = open(header, 'w')
307 fi.write('#define GIT_VERSION "%s"\n' % self.ver)
308 fi.close()
310 def build(bld):
311 if not bld.env['DATA_DIR']:
312 raise "DATA_DIR is emtpy"
314 bld(rule=git_ver, target='version.h', update_outputs=True, always=True, ext_out=['.h'])
316 daemon = bld.program(source = [], features = 'c cprogram', includes = [bld.path.get_bld()])
317 daemon.target = 'ladishd'
318 daemon.uselib = 'DBUS-1 UUID EXPAT DL UTIL'
319 daemon.ver_header = 'version.h'
320 # Make backtrace function lookup to work for functions in the executable itself
321 daemon.env.append_value("LINKFLAGS", ["-Wl,-E"])
323 for source in [
324 'main.c',
325 'loader.c',
326 'log.c',
327 'sigsegv.c',
328 'proctitle.c',
329 'appdb.c',
330 'procfs.c',
331 'control.c',
332 'studio.c',
333 'graph.c',
334 'client.c',
335 'port.c',
336 'virtualizer.c',
337 'dict.c',
338 'graph_dict.c',
339 'escape.c',
340 'studio_jack_conf.c',
341 'studio_list.c',
342 'save.c',
343 'load.c',
344 'cmd_load_studio.c',
345 'cmd_new_studio.c',
346 'cmd_rename_studio.c',
347 'cmd_save_studio.c',
348 'cmd_start_studio.c',
349 'cmd_stop_studio.c',
350 'cmd_unload_studio.c',
351 'cmd_new_app.c',
352 'cmd_change_app_state.c',
353 'cmd_remove_app.c',
354 'cmd_create_room.c',
355 'cmd_delete_room.c',
356 'cmd_save_project.c',
357 'cmd_unload_project.c',
358 'cmd_load_project.c',
359 'cmd_exit.c',
360 'cqueue.c',
361 'app_supervisor.c',
362 'room.c',
363 'room_save.c',
364 'room_load.c',
365 'recent_store.c',
366 'recent_projects.c',
367 'check_integrity.c',
369 daemon.source.append(os.path.join("daemon", source))
371 for source in [
372 'jack_proxy.c',
373 'graph_proxy.c',
374 'a2j_proxy.c',
375 "jmcore_proxy.c",
376 "notify_proxy.c",
377 "conf_proxy.c",
379 daemon.source.append(os.path.join("proxies", source))
381 for source in [
382 'signal.c',
383 'method.c',
384 'error.c',
385 'object_path.c',
386 'interface.c',
387 'helpers.c',
389 daemon.source.append(os.path.join("dbus", source))
391 for source in [
392 'time.c',
393 'dirhelpers.c',
394 'catdup.c',
396 daemon.source.append(os.path.join("common", source))
398 daemon.source.append(os.path.join("alsapid", "helper.c"))
400 # process dbus.service.in -> ladish.service
401 create_service_taskgen(bld, DBUS_NAME_BASE + '.service', DBUS_NAME_BASE, daemon.target)
403 #####################################################
404 # jmcore
405 jmcore = bld.program(source = [], features = 'c cprogram', includes = [bld.path.get_bld()])
406 jmcore.target = 'jmcore'
407 jmcore.uselib = 'DBUS-1 JACK'
408 jmcore.defines = ['LOG_OUTPUT_STDOUT']
409 jmcore.source = ['jmcore.c']
411 for source in [
412 #'signal.c',
413 'method.c',
414 'error.c',
415 'object_path.c',
416 'interface.c',
417 'helpers.c',
419 jmcore.source.append(os.path.join("dbus", source))
421 create_service_taskgen(bld, DBUS_NAME_BASE + '.jmcore.service', DBUS_NAME_BASE + ".jmcore", jmcore.target)
423 #####################################################
424 # conf
425 ladiconfd = bld.program(source = [], features = 'c cprogram', includes = [bld.path.get_bld()])
426 ladiconfd.target = 'ladiconfd'
427 ladiconfd.uselib = 'DBUS-1'
428 ladiconfd.defines = ['LOG_OUTPUT_STDOUT']
429 ladiconfd.source = ['conf.c']
431 for source in [
432 'dirhelpers.c',
433 'catdup.c',
435 ladiconfd.source.append(os.path.join("common", source))
437 for source in [
438 'signal.c',
439 'method.c',
440 'error.c',
441 'object_path.c',
442 'interface.c',
443 'helpers.c',
445 ladiconfd.source.append(os.path.join("dbus", source))
447 create_service_taskgen(bld, DBUS_NAME_BASE + '.conf.service', DBUS_NAME_BASE + ".conf", ladiconfd.target)
449 #####################################################
450 # alsapid
451 bld.shlib(source = [os.path.join("alsapid", 'lib.c'), os.path.join("alsapid", "helper.c")], target = 'alsapid', uselib = 'DL')
453 #####################################################
454 # liblash
455 if bld.env['BUILD_LIBLASH']:
456 liblash = bld.shlib(source = [], features = 'c cshlib', includes = [bld.path.get_bld()])
457 liblash.uselib = 'DBUS-1'
458 liblash.target = 'lash'
459 liblash.vnum = "1.1.1"
460 liblash.defines = ['LOG_OUTPUT_STDOUT']
461 liblash.source = [os.path.join("lash_compat", "liblash", 'lash.c'), os.path.join("common", "catdup.c")]
463 bld.install_files('${PREFIX}/include/lash', bld.path.ant_glob('lash_compat/liblash/lash/*.h'))
465 # process lash-1.0.pc.in -> lash-1.0.pc
466 bld(
467 features = 'subst', # the feature 'subst' overrides the source/target processing
468 source = os.path.join("lash_compat", 'lash-1.0.pc.in'), # list of string or nodes
469 target = 'lash-1.0.pc', # list of strings or nodes
470 install_path = '${LIBDIR}/pkgconfig/',
471 # variables to use in the substitution
472 prefix = bld.env['PREFIX'],
473 exec_prefix = bld.env['PREFIX'],
474 libdir = bld.env['LIBDIR'],
475 includedir = os.path.normpath(bld.env['PREFIX'] + '/include'))
477 #####################################################
478 # pylash
479 if bld.env['BUILD_PYLASH']:
480 pylash = bld.shlib(source = [], features = 'c cshlib pyext', includes = ["lash_compat/liblash"])
481 pylash.target = '_lash'
482 pylash.use = 'lash'
483 pylash.install_path = '${PYTHONDIR}'
485 for source in [
486 'lash.c',
487 'lash_wrap.c',
489 pylash.source.append(os.path.join("lash_compat", "pylash", source))
491 bld.install_files('${PYTHONDIR}', os.path.join("lash_compat", "pylash", "lash.py"))
493 #####################################################
494 # gladish
495 if bld.env['BUILD_GLADISH']:
496 gladish = bld.program(source = [], features = 'c cxx cxxprogram', includes = [bld.path.get_bld()])
497 gladish.target = 'gladish'
498 gladish.defines = ['LOG_OUTPUT_STDOUT']
499 gladish.uselib = 'DBUS-1 DBUS-GLIB-1 FLOWCANVAS'
501 gladish.source = []
503 for source in [
504 'main.c',
505 'load_project_dialog.c',
506 'save_project_dialog.c',
507 'project_properties.c',
508 'world_tree.c',
509 'graph_view.c',
510 'canvas.cpp',
511 'graph_canvas.c',
512 'gtk_builder.c',
513 'ask_dialog.c',
514 'create_room_dialog.c',
515 'menu.c',
516 'dynmenu.c',
517 'toolbar.c',
518 'about.c',
519 'dbus.c',
520 'studio.c',
521 'studio_list.c',
522 'dialogs.c',
523 'jack.c',
524 'control.c',
525 'pixbuf.c',
526 'room.c',
527 'statusbar.c',
528 'action.c',
529 'settings.c',
530 'zoom.c',
532 gladish.source.append(os.path.join("gui", source))
534 for source in [
535 'jack_proxy.c',
536 'a2j_proxy.c',
537 'graph_proxy.c',
538 'studio_proxy.c',
539 'control_proxy.c',
540 'app_supervisor_proxy.c',
541 "room_proxy.c",
542 "conf_proxy.c",
544 gladish.source.append(os.path.join("proxies", source))
546 for source in [
547 'method.c',
548 'helpers.c',
550 gladish.source.append(os.path.join("dbus", source))
552 for source in [
553 'catdup.c',
554 'file.c',
556 gladish.source.append(os.path.join("common", source))
558 # GtkBuilder UI definitions (XML)
559 bld.install_files('${DATA_DIR}', 'gui/gladish.ui')
561 bld.install_files('${PREFIX}/bin', 'ladish_control', chmod=0755)
563 # 'Desktop' file (menu entry, icon, etc)
564 bld.install_files('${PREFIX}/share/applications/', 'gui/gladish.desktop', chmod=0644)
566 # Icons
567 icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256']
568 for icon_size in icon_sizes:
569 bld.path.ant_glob('art/' + icon_size + '/apps/*.png')
570 bld.install_files('${PREFIX}/share/icons/hicolor/' + icon_size + '/apps/', 'art/' + icon_size + '/apps/gladish.png')
572 status_images = []
573 for status in ["down", "unloaded", "started", "stopped", "warning", "error"]:
574 status_images.append("art/status_" + status + ".png")
576 bld.install_files('${DATA_DIR}', status_images)
577 bld.install_files('${DATA_DIR}', "art/ladish-logo-128x128.png")
578 bld.install_files('${DATA_DIR}', ["COPYING", "AUTHORS", "README", "NEWS"])
580 if bld.env['BUILD_DOXYGEN_DOCS'] == True:
581 html_docs_source_dir = "build/default/html"
582 if bld.cmd == 'clean':
583 if os.access(html_docs_source_dir, os.R_OK):
584 pprint('CYAN', "Removing doxygen generated documentation...")
585 shutil.rmtree(html_docs_source_dir)
586 pprint('CYAN', "Removing doxygen generated documentation done.")
587 elif bld.cmd == 'build':
588 if not os.access(html_docs_source_dir, os.R_OK):
589 os.popen("doxygen").read()
590 else:
591 pprint('CYAN', "doxygen documentation already built.")
593 bld(features='intltool_po', appname=APPNAME, podir='po', install_path="${LOCALE_DIR}")
595 def get_tags_dirs():
596 source_root = os.path.dirname(Utils.g_module.root_path)
597 if 'relpath' in os.path.__all__:
598 source_root = os.path.relpath(source_root)
599 paths = source_root
600 paths += " " + os.path.join(source_root, "common")
601 paths += " " + os.path.join(source_root, "dbus")
602 paths += " " + os.path.join(source_root, "proxies")
603 paths += " " + os.path.join(source_root, "daemon")
604 paths += " " + os.path.join(source_root, "gui")
605 paths += " " + os.path.join(source_root, "example-apps")
606 paths += " " + os.path.join(source_root, "lib")
607 paths += " " + os.path.join(source_root, "lash_compat", "liblash")
608 paths += " " + os.path.join(source_root, "lash_compat", "liblash", "lash")
609 return paths
611 def gtags(ctx):
612 '''build tag files for GNU global'''
613 cmd = "find %s -mindepth 1 -maxdepth 1 -name '*.[ch]' -print | gtags --statistics -f -" % get_tags_dirs()
614 #print("Running: %s" % cmd)
615 os.system(cmd)
617 def etags(ctx):
618 '''build TAGS file using etags'''
619 cmd = "find %s -mindepth 1 -maxdepth 1 -name '*.[ch]' -print | etags -" % get_tags_dirs()
620 #print("Running: %s" % cmd)
621 os.system(cmd)
622 os.system("stat -c '%y' TAGS")
624 class ladish_dist(waflib.Scripting.Dist):
625 cmd = 'dist'
626 fun = 'dist'
628 def __init__(self):
629 Dist.__init__(self)
630 if Options.options.distname:
631 self.base_name = Options.options.distname
632 else:
633 try:
634 self.base_name = self.cmd_and_log("LANG= git describe --tags", quiet=waflib.Context.BOTH).splitlines()[0]
635 except:
636 self.base_name = APPNAME + '-' + VERSION
637 self.base_name += Options.options.distsuffix
639 #print self.base_name
641 if Options.options.distname and Options.options.tagdist:
642 ret = self.exec_command("LANG= git tag " + self.base_name)
643 if ret != 0:
644 raise waflib.Errors.WafError('git tag creation failed')
646 def get_base_name(self):
647 return self.base_name
649 def get_excl(self):
650 excl = Dist.get_excl(self)
652 excl += ' .gitmodules'
653 excl += ' GTAGS'
654 excl += ' GRTAGS'
655 excl += ' GPATH'
656 excl += ' GSYMS'
658 if Options.options.distnodeps:
659 excl += ' laditools'
660 excl += ' flowcanvas'
661 excl += ' jack2'
662 excl += ' a2jmidid'
664 #print repr(excl)
665 return excl
667 def execute(self):
668 shutil.copy('./build/version.h', "./")
669 try:
670 super(ladish_dist, self).execute()
671 finally:
672 os.remove("version.h")