ladish/wscript

701 lines
25 KiB
Plaintext
Raw Permalink Normal View History

2009-07-12 15:11:14 +03:00
#! /usr/bin/env python
# encoding: utf-8
from __future__ import with_statement
2010-11-14 16:35:43 +02:00
parallel_debug = False
2009-07-12 15:11:14 +03:00
APPNAME='ladish'
2012-03-05 04:12:00 +02:00
VERSION='2-dev'
DBUS_NAME_BASE = 'org.ladish'
2012-03-05 04:12:00 +02:00
RELEASE = False
2009-07-12 15:11:14 +03:00
# these variables are mandatory ('/' are converted automatically)
2010-11-14 16:35:43 +02:00
top = '.'
out = 'build'
import os, sys, re, io, optparse, shutil, tokenize
from hashlib import md5
from waflib import Errors, Utils, Options, Logs, Scripting
from waflib import Configure
from waflib import Context
2009-07-12 15:11:14 +03:00
def display_msg(conf, msg="", status = None, color = None):
if status:
2010-11-14 16:35:43 +02:00
conf.msg(msg, status, color)
else:
Logs.pprint('NORMAL', msg)
def display_raw_text(conf, text, color = 'NORMAL'):
Logs.pprint(color, text, sep = '')
def display_line(conf, text, color = 'NORMAL'):
Logs.pprint(color, text, sep = os.linesep)
def yesno(bool):
if bool:
return "yes"
else:
return "no"
2010-11-14 16:35:43 +02:00
def options(opt):
opt.load('compiler_c')
opt.load('compiler_cxx')
opt.load('python')
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')
opt.add_option('--enable-gladish', action='store_true', default=False, help='Build gladish')
opt.add_option('--enable-liblash', action='store_true', default=False, help='Build LASH compatibility library')
opt.add_option('--debug', action='store_true', default=False, dest='debug', help="Build debuggable binaries")
opt.add_option('--siginfo', action='store_true', default=False, dest='siginfo', help="Log backtrace on fatal signal")
opt.add_option('--doxygen', action='store_true', default=False, help='Enable build of doxygen documentation')
opt.add_option('--distnodeps', action='store_true', default=False, help="When creating distribution tarball, don't package git submodules")
opt.add_option('--distname', type='string', default=None, help="Name for the distribution tarball")
opt.add_option('--distsuffix', type='string', default="", help="String to append to the distribution tarball name")
opt.add_option('--tagdist', action='store_true', default=False, help='Create of git tag for distname')
2013-02-21 15:42:39 +02:00
opt.add_option('--libdir', type='string', default=None, help='Define lib dir')
opt.add_option('--docdir', type='string', default=None, help="Define doc dir [default: PREFIX'/share/doc/" + APPNAME + ']')
2010-11-14 16:35:43 +02:00
if parallel_debug:
opt.load('parallel_debug')
2009-07-12 15:11:14 +03:00
def add_cflag(conf, flag):
conf.env.prepend_value('CXXFLAGS', flag)
conf.env.prepend_value('CFLAGS', flag)
def add_linkflag(conf, flag):
conf.env.prepend_value('LINKFLAGS', flag)
def check_gcc_optimizations_enabled(flags):
gcc_optimizations_enabled = False
for flag in flags:
if len(flag) < 2 or flag[0] != '-' or flag[1] != 'O':
continue
if len(flag) == 2:
gcc_optimizations_enabled = True;
else:
gcc_optimizations_enabled = flag[2] != '0';
return gcc_optimizations_enabled
2010-09-20 00:59:06 +03:00
def create_service_taskgen(bld, target, opath, binary):
2010-11-14 16:35:43 +02:00
bld(
features = 'subst', # the feature 'subst' overrides the source/target processing
source = os.path.join('daemon', 'dbus.service.in'), # list of string or nodes
target = target, # list of strings or nodes
install_path = bld.env['DBUS_SERVICES_DIR'] + os.path.sep,
# variables to use in the substitution
dbus_object_path = opath,
daemon_bin_path = os.path.join(bld.env['PREFIX'], 'bin', binary))
2010-10-24 06:01:13 +03:00
2009-07-12 15:11:14 +03:00
def configure(conf):
conf.load('compiler_c')
conf.load('compiler_cxx')
conf.load('python')
conf.load('intltool')
2010-11-14 16:35:43 +02:00
if parallel_debug:
conf.load('parallel_debug')
2009-07-12 15:11:14 +03:00
2013-01-13 02:04:56 +02:00
# dladdr() is used by daemon/siginfo.c
# dlvsym() is used by the alsapid library
conf.check_cc(msg="Checking for libdl", lib=['dl'], uselib_store='DL')
# forkpty() is used by ladishd
conf.check_cc(msg="Checking for libutil", lib=['util'], uselib_store='UTIL')
2010-10-31 00:28:01 +03:00
2010-04-11 12:25:30 +03:00
conf.check_cfg(
package = 'jack',
mandatory = True,
errmsg = "not installed, see http://jackaudio.org/",
args = '--cflags --libs')
conf.check_cfg(
package = 'alsa',
mandatory = True,
errmsg = "not installed, see http://www.alsa-project.org/",
args = '--cflags')
conf.check_cfg(
package = 'dbus-1',
atleast_version = '1.0.0',
mandatory = True,
errmsg = "not installed, see http://dbus.freedesktop.org/",
2009-07-20 03:29:45 +03:00
args = '--cflags --libs')
dbus_dir = conf.check_cfg(package='dbus-1', args='--variable=session_bus_services_dir', msg="Retrieving D-Bus services dir")
if not dbus_dir:
return
dbus_dir = dbus_dir.strip()
conf.env['DBUS_SERVICES_DIR_REAL'] = dbus_dir
if Options.options.enable_pkg_config_dbus_service_dir:
conf.env['DBUS_SERVICES_DIR'] = dbus_dir
else:
conf.env['DBUS_SERVICES_DIR'] = os.path.join(os.path.normpath(conf.env['PREFIX']), 'share', 'dbus-1', 'services')
2023-05-01 07:46:34 +03:00
conf.check_cfg(
package = 'cdbus-1',
atleast_version = '1.0.0',
mandatory = True,
errmsg = "not installed, see https://github.com/LADI/cdbus",
2023-05-01 07:46:34 +03:00
args = '--cflags --libs')
2013-02-21 15:42:39 +02:00
if Options.options.libdir:
conf.env['LIBDIR'] = Options.options.libdir
else:
conf.env['LIBDIR'] = os.path.join(os.path.normpath(conf.env['PREFIX']), 'lib')
if Options.options.docdir:
conf.env['DOCDIR'] = Options.options.docdir
else:
conf.env['DOCDIR'] = os.path.join(os.path.normpath(conf.env['PREFIX']), 'share', 'doc', APPNAME)
conf.env['BUILD_DOXYGEN_DOCS'] = Options.options.doxygen
conf.check_cfg(
package = 'uuid',
mandatory = True,
errmsg = "not installed, see http://e2fsprogs.sourceforge.net/",
2009-07-20 03:29:45 +03:00
args = '--cflags --libs')
conf.check(
header_name='expat.h',
mandatory = True,
errmsg = "not installed, see http://expat.sourceforge.net/")
conf.env['LIB_EXPAT'] = ['expat']
2009-07-20 03:29:45 +03:00
if Options.options.enable_gladish:
conf.check_cfg(
package = 'glib-2.0',
errmsg = "not installed, see http://www.gtk.org/",
args = '--cflags --libs')
conf.check_cfg(
package = 'dbus-glib-1',
errmsg = "not installed, see http://dbus.freedesktop.org/",
args = '--cflags --libs')
conf.check_cfg(
package = 'gtk+-2.0',
atleast_version = '2.20.0',
errmsg = "not installed, see http://www.gtk.org/",
args = '--cflags --libs')
conf.check_cfg(
package = 'gtkmm-2.4',
atleast_version = '2.10.0',
errmsg = "not installed, see http://www.gtkmm.org",
args = '--cflags --libs')
conf.check_cfg(
package = 'libgnomecanvasmm-2.6',
atleast_version = '2.6.0',
errmsg = "not installed, see http://www.gtkmm.org",
args = '--cflags --libs')
#autowaf.check_pkg(conf, 'libgvc', uselib_store='AGRAPH', atleast_version='2.8', mandatory=False)
# The boost headers package (e.g. libboost-dev) is needed
conf.multicheck(
{'header_name': "boost/shared_ptr.hpp"},
{'header_name': "boost/weak_ptr.hpp"},
{'header_name': "boost/enable_shared_from_this.hpp"},
{'header_name': "boost/utility.hpp"},
msg = "Checking for boost headers",
mandatory = False)
display_msg(conf, 'Found boost/shared_ptr.hpp',
yesno(conf.env['HAVE_BOOST_SHARED_PTR_HPP']))
display_msg(conf, 'Found boost/weak_ptr.hpp',
yesno(conf.env['HAVE_BOOST_WEAK_PTR_HPP']))
display_msg(conf, 'Found boost/enable_shared_from_this.hpp',
yesno(conf.env['HAVE_BOOST_ENABLE_SHARED_FROM_THIS_HPP']))
display_msg(conf, 'Found boost/utility.hpp',
yesno(conf.env['HAVE_BOOST_UTILITY_HPP']))
if not (conf.env['HAVE_BOOST_SHARED_PTR_HPP'] and \
conf.env['HAVE_BOOST_WEAK_PTR_HPP'] and \
conf.env['HAVE_BOOST_ENABLE_SHARED_FROM_THIS_HPP'] and \
conf.env['HAVE_BOOST_UTILITY_HPP']):
display_line(conf, "One or more boost headers not found, see http://boost.org/")
sys.exit(1)
conf.env['BUILD_GLADISH'] = Options.options.enable_gladish
2010-10-24 06:01:13 +03:00
conf.env['BUILD_LIBLASH'] = Options.options.enable_liblash
conf.env['BUILD_SIGINFO'] = Options.options.siginfo
2010-10-24 06:01:13 +03:00
add_cflag(conf, '-fvisibility=hidden')
conf.env['BUILD_WERROR'] = False #not RELEASE
add_cflag(conf, '-Wall')
add_cflag(conf, '-Wimplicit-fallthrough=2')
if conf.env['BUILD_WERROR']:
add_cflag(conf, '-Werror')
# for pre gcc-4.4, enable optimizations so use of uninitialized variables gets detected
try:
is_gcc = conf.env['CC_NAME'] == 'gcc'
if is_gcc:
gcc_ver = []
for n in conf.env['CC_VERSION']:
gcc_ver.append(int(n))
if gcc_ver[0] < 4 or gcc_ver[1] < 4:
#print "optimize force enable is required"
if not check_gcc_optimizations_enabled(conf.env['CFLAGS']):
if Options.options.debug:
print ("C optimization must be forced in order to enable -Wuninitialized")
print ("However this will not be made because debug compilation is enabled")
else:
print ("C optimization forced in order to enable -Wuninitialized")
conf.env.append_unique('CFLAGS', "-O")
except:
pass
conf.env['BUILD_DEBUG'] = Options.options.debug
if conf.env['BUILD_DEBUG']:
add_cflag(conf, '-g')
add_cflag(conf, '-O0')
add_linkflag(conf, '-g')
2010-11-14 16:35:43 +02:00
conf.env['DATA_DIR'] = os.path.normpath(os.path.join(conf.env['PREFIX'], 'share', APPNAME))
2010-12-19 13:24:55 +02:00
conf.env['LOCALE_DIR'] = os.path.normpath(os.path.join(conf.env['PREFIX'], 'share', 'locale'))
2010-11-14 16:35:43 +02:00
# write some parts of the configure environment to the config.h file
conf.define('DATA_DIR', conf.env['DATA_DIR'])
2010-12-19 13:24:55 +02:00
conf.define('LOCALE_DIR', conf.env['LOCALE_DIR'])
2009-07-13 01:44:43 +03:00
conf.define('PACKAGE_VERSION', VERSION)
2009-07-13 02:34:32 +03:00
conf.define('DBUS_NAME_BASE', DBUS_NAME_BASE)
conf.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE.replace('.', '/'))
conf.define('BASE_NAME', APPNAME)
conf.define('SIGINFO_ENABLED', conf.env['BUILD_SIGINFO'])
conf.define('_GNU_SOURCE', 1)
2009-07-12 22:56:19 +03:00
conf.write_config_header('config.h')
display_msg(conf)
display_msg(conf, "==================")
version_msg = APPNAME + "-" + VERSION
2009-09-01 03:03:21 +03:00
if os.access('version.h', os.R_OK):
data = open('version.h').read()
2009-09-01 03:03:21 +03:00
m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
if m != None:
version_msg += " exported from " + m.group(1)
elif os.access('.git', os.R_OK):
version_msg += " git revision will checked and eventually updated during build"
display_msg(conf, version_msg)
display_msg(conf)
display_msg(conf, "Install prefix", conf.env['PREFIX'], 'CYAN')
display_msg(conf, 'Build gladish', yesno(conf.env['BUILD_GLADISH']))
display_msg(conf, 'Build liblash', yesno(Options.options.enable_liblash))
display_msg(conf, 'Build with siginfo', yesno(conf.env['BUILD_SIGINFO']))
display_msg(conf, 'Treat warnings as errors', yesno(conf.env['BUILD_WERROR']))
display_msg(conf, 'Debuggable binaries', yesno(conf.env['BUILD_DEBUG']))
display_msg(conf, 'Build doxygen documentation', yesno(conf.env['BUILD_DOXYGEN_DOCS']))
if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS_SERVICES_DIR_REAL']:
display_msg(conf)
display_line(conf, "WARNING: D-Bus session services directory as reported by pkg-config is", 'RED')
display_raw_text(conf, "WARNING:", 'RED')
display_line(conf, conf.env['DBUS_SERVICES_DIR_REAL'], 'CYAN')
display_line(conf, 'WARNING: but service file will be installed in', 'RED')
display_raw_text(conf, "WARNING:", 'RED')
display_line(conf, conf.env['DBUS_SERVICES_DIR'], 'CYAN')
display_line(conf, 'WARNING: You may need to adjust your D-Bus configuration after installing ladish', 'RED')
display_line(conf, 'WARNING: You can override dbus service install directory', 'RED')
display_line(conf, 'WARNING: with --enable-pkg-config-dbus-service-dir option to this script', 'RED')
display_msg(conf, 'C compiler flags', repr(conf.env['CFLAGS']))
2010-09-13 21:35:41 +03:00
display_msg(conf, 'C++ compiler flags', repr(conf.env['CXXFLAGS']))
display_msg(conf, 'Linker flags', repr(conf.env['LINKFLAGS']))
if not conf.env['BUILD_GLADISH']:
display_msg(conf)
display_line(conf, "WARNING: The GUI frontend will not built", 'RED')
display_msg(conf)
2010-11-14 16:35:43 +02:00
def git_ver(self):
bld = self.generator.bld
header = self.outputs[0].abspath()
if os.access('./version.h', os.R_OK):
header = os.path.join(os.getcwd(), out, "version.h")
shutil.copy('./version.h', header)
data = open(header).read()
2010-11-14 16:35:43 +02:00
m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
if m != None:
self.ver = m.group(1)
Logs.pprint('BLUE', "tarball from git revision " + self.ver)
2010-11-14 16:35:43 +02:00
else:
self.ver = "tarball"
return
if bld.srcnode.find_node('.git'):
self.ver = bld.cmd_and_log("LANG= git rev-parse HEAD", quiet=Context.BOTH).splitlines()[0]
if bld.cmd_and_log("LANG= git diff-index --name-only HEAD", quiet=Context.BOTH).splitlines():
2010-11-14 16:35:43 +02:00
self.ver += "-dirty"
Logs.pprint('BLUE', "git revision " + self.ver)
2010-11-14 16:35:43 +02:00
else:
self.ver = "unknown"
fi = open(header, 'w')
fi.write('#define GIT_VERSION "%s"\n' % self.ver)
fi.close()
2009-07-12 15:11:14 +03:00
def build(bld):
2010-11-14 16:35:43 +02:00
if not bld.env['DATA_DIR']:
raise "DATA_DIR is emtpy"
bld(rule=git_ver, target='version.h', update_outputs=True, always=True, ext_out=['.h'])
2010-11-14 19:25:34 +02:00
daemon = bld.program(source = [], features = 'c cprogram', includes = [bld.path.get_bld()])
2009-07-12 22:56:19 +03:00
daemon.target = 'ladishd'
2023-05-01 07:46:34 +03:00
daemon.uselib = 'DBUS-1 CDBUS-1 UUID EXPAT DL UTIL'
2009-07-13 01:44:43 +03:00
daemon.ver_header = 'version.h'
# Make backtrace function lookup to work for functions in the executable itself
daemon.env.append_value("LINKFLAGS", ["-Wl,-E"])
2013-01-13 02:04:56 +02:00
daemon.defines = ["HAVE_CONFIG_H"]
daemon.source = ["string_constants.c"]
2009-07-12 22:56:19 +03:00
for source in [
'main.c',
'loader.c',
'proctitle.c',
'procfs.c',
'control.c',
'studio.c',
2009-09-06 15:30:29 +03:00
'graph.c',
'graph_manager.c',
2009-09-06 00:13:05 +03:00
'client.c',
2009-09-06 20:31:42 +03:00
'port.c',
'virtualizer.c',
2009-09-07 01:05:36 +03:00
'dict.c',
'graph_dict.c',
2009-09-12 11:11:52 +03:00
'escape.c',
'studio_jack_conf.c',
2010-11-18 00:47:03 +02:00
'studio_list.c',
'save.c',
2010-08-08 23:51:31 +03:00
'load.c',
2009-10-19 01:16:59 +03:00
'cmd_load_studio.c',
'cmd_new_studio.c',
'cmd_rename_studio.c',
'cmd_save_studio.c',
'cmd_start_studio.c',
'cmd_stop_studio.c',
'cmd_unload_studio.c',
'cmd_new_app.c',
'cmd_change_app_state.c',
'cmd_remove_app.c',
'cmd_create_room.c',
'cmd_delete_room.c',
'cmd_save_project.c',
2010-08-08 23:51:31 +03:00
'cmd_unload_project.c',
'cmd_load_project.c',
'cmd_exit.c',
2009-10-19 01:16:59 +03:00
'cqueue.c',
2009-11-30 01:22:58 +02:00
'app_supervisor.c',
'room.c',
2010-08-06 05:00:04 +03:00
'room_save.c',
2010-08-08 23:51:31 +03:00
'room_load.c',
'recent_store.c',
'recent_projects.c',
2010-12-23 04:20:52 +02:00
'check_integrity.c',
2011-08-04 02:59:01 +03:00
'lash_server.c',
'jack_session.c',
2009-07-12 22:56:19 +03:00
]:
daemon.source.append(os.path.join("daemon", source))
if Options.options.siginfo:
daemon.source.append(os.path.join("daemon", 'siginfo.c'))
for source in [
'jack_proxy.c',
'graph_proxy.c',
'a2j_proxy.c',
"jmcore_proxy.c",
"notify_proxy.c",
"conf_proxy.c",
2011-08-04 02:59:01 +03:00
"lash_client_proxy.c",
]:
daemon.source.append(os.path.join("proxies", source))
for source in [
'log.c',
'time.c',
2010-09-19 17:04:14 +03:00
'dirhelpers.c',
2010-09-19 17:15:11 +03:00
'catdup.c',
]:
daemon.source.append(os.path.join("common", source))
2009-07-12 22:56:19 +03:00
daemon.source.append(os.path.join("alsapid", "helper.c"))
2010-04-11 08:28:26 +03:00
# process dbus.service.in -> ladish.service
2010-09-20 00:59:06 +03:00
create_service_taskgen(bld, DBUS_NAME_BASE + '.service', DBUS_NAME_BASE, daemon.target)
2009-07-12 15:11:14 +03:00
2010-04-11 12:25:30 +03:00
#####################################################
# jmcore
2010-11-14 19:25:34 +02:00
jmcore = bld.program(source = [], features = 'c cprogram', includes = [bld.path.get_bld()])
2010-04-11 12:25:30 +03:00
jmcore.target = 'jmcore'
2023-05-01 07:46:34 +03:00
jmcore.uselib = 'DBUS-1 CDBUS-1 JACK'
2010-04-11 12:25:30 +03:00
jmcore.defines = ['LOG_OUTPUT_STDOUT']
jmcore.source = ['jmcore.c']
for source in [
'log.c',
]:
jmcore.source.append(os.path.join("common", source))
2010-09-20 00:59:06 +03:00
create_service_taskgen(bld, DBUS_NAME_BASE + '.jmcore.service', DBUS_NAME_BASE + ".jmcore", jmcore.target)
#####################################################
# conf
2010-11-14 19:25:34 +02:00
ladiconfd = bld.program(source = [], features = 'c cprogram', includes = [bld.path.get_bld()])
2010-09-20 00:59:06 +03:00
ladiconfd.target = 'ladiconfd'
2023-05-01 07:46:34 +03:00
ladiconfd.uselib = 'DBUS-1 CDBUS-1'
2010-09-20 00:59:06 +03:00
ladiconfd.defines = ['LOG_OUTPUT_STDOUT']
ladiconfd.source = ['conf.c']
for source in [
'log.c',
2010-09-20 00:59:06 +03:00
'dirhelpers.c',
'catdup.c',
]:
ladiconfd.source.append(os.path.join("common", source))
2010-09-27 21:48:31 +03:00
create_service_taskgen(bld, DBUS_NAME_BASE + '.conf.service', DBUS_NAME_BASE + ".conf", ladiconfd.target)
2010-09-20 00:59:06 +03:00
2010-10-31 00:28:01 +03:00
#####################################################
# alsapid
alsapid = bld.shlib(source = [], features = 'c cshlib', includes = [bld.path.get_bld()])
alsapid.uselib = 'DL'
alsapid.target = 'alsapid'
for source in [
'lib.c',
'helper.c',
]:
alsapid.source.append(os.path.join("alsapid", source))
2010-10-31 00:28:01 +03:00
2010-09-20 00:59:06 +03:00
#####################################################
# liblash
if bld.env['BUILD_LIBLASH']:
2010-11-14 19:25:34 +02:00
liblash = bld.shlib(source = [], features = 'c cshlib', includes = [bld.path.get_bld()])
2023-05-01 07:46:34 +03:00
liblash.uselib = 'DBUS-1 CDBUS-1'
liblash.target = 'lash'
liblash.vnum = "1.1.1"
2009-09-20 18:23:42 +03:00
liblash.defines = ['LOG_OUTPUT_STDOUT']
2011-08-01 05:59:24 +03:00
liblash.source = [os.path.join("lash_compat", "liblash", 'lash.c')]
for source in [
'dirhelpers.c',
'catdup.c',
'file.c',
'log.c',
2011-08-01 05:59:24 +03:00
]:
liblash.source.append(os.path.join("common", source))
bld.install_files('${PREFIX}/include/lash-1.0/lash', bld.path.ant_glob('lash_compat/liblash/lash/*.h'))
# process lash-1.0.pc.in -> lash-1.0.pc
2010-11-14 16:35:43 +02:00
bld(
features = 'subst', # the feature 'subst' overrides the source/target processing
2010-11-14 19:31:50 +02:00
source = os.path.join("lash_compat", 'lash-1.0.pc.in'), # list of string or nodes
target = 'lash-1.0.pc', # list of strings or nodes
install_path = '${LIBDIR}/pkgconfig/',
# variables to use in the substitution
prefix = bld.env['PREFIX'],
exec_prefix = bld.env['PREFIX'],
libdir = bld.env['LIBDIR'],
includedir = os.path.normpath(bld.env['PREFIX'] + '/include'))
2009-07-20 03:29:45 +03:00
#####################################################
# gladish
if bld.env['BUILD_GLADISH']:
2010-11-14 19:25:34 +02:00
gladish = bld.program(source = [], features = 'c cxx cxxprogram', includes = [bld.path.get_bld()])
gladish.target = 'gladish'
2009-09-20 18:23:42 +03:00
gladish.defines = ['LOG_OUTPUT_STDOUT']
2023-05-01 07:46:34 +03:00
gladish.uselib = 'DBUS-1 CDBUS-1 DBUS-GLIB-1 GTKMM-2.4 LIBGNOMECANVASMM-2.6 GTK+-2.0'
gladish.source = ["string_constants.c"]
for source in [
'main.c',
'load_project_dialog.c',
'save_project_dialog.c',
'project_properties.c',
'world_tree.c',
'graph_view.c',
'canvas.cpp',
'graph_canvas.c',
'gtk_builder.c',
'ask_dialog.c',
2010-03-21 16:33:39 +02:00
'create_room_dialog.c',
'menu.c',
2010-10-16 01:39:06 +03:00
'dynmenu.c',
'toolbar.c',
'about.c',
'dbus.c',
'studio.c',
'studio_list.c',
'dialogs.c',
'jack.c',
'control.c',
'pixbuf.c',
'room.c',
'statusbar.c',
'action.c',
2010-09-28 00:18:44 +03:00
'settings.c',
'zoom.c',
]:
gladish.source.append(os.path.join("gui", source))
2009-08-10 02:18:55 +03:00
2012-04-07 23:47:03 +03:00
for source in [
'Module.cpp',
'Item.cpp',
'Port.cpp',
'Connection.cpp',
'Ellipse.cpp',
'Canvas.cpp',
'Connectable.cpp',
]:
gladish.source.append(os.path.join("gui", "flowcanvas", source))
for source in [
'jack_proxy.c',
'a2j_proxy.c',
'graph_proxy.c',
'studio_proxy.c',
'control_proxy.c',
'app_supervisor_proxy.c',
"room_proxy.c",
"conf_proxy.c",
]:
gladish.source.append(os.path.join("proxies", source))
2010-09-19 17:15:11 +03:00
for source in [
'log.c',
2010-09-19 17:15:11 +03:00
'catdup.c',
2010-10-18 13:32:14 +03:00
'file.c',
2010-09-19 17:15:11 +03:00
]:
gladish.source.append(os.path.join("common", source))
2010-02-07 22:59:21 +02:00
# GtkBuilder UI definitions (XML)
2010-11-14 16:35:43 +02:00
bld.install_files('${DATA_DIR}', 'gui/gladish.ui')
2013-02-21 15:42:39 +02:00
# 'Desktop' file (menu entry, icon, etc)
bld.install_files('${PREFIX}/share/applications/', 'gui/gladish.desktop', chmod=0o0644)
# Icons
icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256']
for icon_size in icon_sizes:
bld.path.ant_glob('art/' + icon_size + '/apps/*.png')
bld.install_files('${PREFIX}/share/icons/hicolor/' + icon_size + '/apps/', 'art/' + icon_size + '/apps/gladish.png')
2009-08-29 12:39:34 +03:00
status_images = []
for status in ["down", "unloaded", "started", "stopped", "warning", "error"]:
status_images.append("art/status_" + status + ".png")
2009-07-20 03:29:45 +03:00
bld.install_files('${DATA_DIR}', status_images)
bld.install_files('${DATA_DIR}', "art/ladish-logo-128x128.png")
2009-07-20 03:29:45 +03:00
bld(features='intltool_po', appname=APPNAME, podir='po', install_path="${LOCALE_DIR}")
bld.install_files('${PREFIX}/bin', 'ladish_control', chmod=0o0755)
2023-04-20 16:53:29 +03:00
bld.install_files('${DOCDIR}', ["AUTHORS", "README.adoc", "NEWS"])
bld.install_as('${DATA_DIR}/COPYING', "gpl2.txt")
if bld.env['BUILD_DOXYGEN_DOCS'] == True:
html_docs_source_dir = "build/default/html"
2010-11-14 16:35:43 +02:00
if bld.cmd == 'clean':
if os.access(html_docs_source_dir, os.R_OK):
Logs.pprint('CYAN', "Removing doxygen generated documentation...")
shutil.rmtree(html_docs_source_dir)
Logs.pprint('CYAN', "Removing doxygen generated documentation done.")
2010-11-14 16:35:43 +02:00
elif bld.cmd == 'build':
if not os.access(html_docs_source_dir, os.R_OK):
os.popen("doxygen").read()
else:
Logs.pprint('CYAN', "doxygen documentation already built.")
2010-05-12 00:39:10 +03:00
def get_tags_dirs():
2010-05-16 11:15:09 +03:00
source_root = os.path.dirname(Utils.g_module.root_path)
if 'relpath' in os.path.__all__:
source_root = os.path.relpath(source_root)
2010-05-11 23:20:12 +03:00
paths = source_root
paths += " " + os.path.join(source_root, "common")
paths += " " + os.path.join(source_root, "proxies")
paths += " " + os.path.join(source_root, "daemon")
paths += " " + os.path.join(source_root, "gui")
paths += " " + os.path.join(source_root, "example-apps")
paths += " " + os.path.join(source_root, "lib")
paths += " " + os.path.join(source_root, "lash_compat", "liblash")
paths += " " + os.path.join(source_root, "lash_compat", "liblash", "lash")
2010-05-12 00:39:10 +03:00
return paths
2010-05-11 23:20:12 +03:00
2010-05-12 00:39:10 +03:00
def gtags(ctx):
'''build tag files for GNU global'''
cmd = "find %s -mindepth 1 -maxdepth 1 -name '*.[ch]' -print | gtags --statistics -f -" % get_tags_dirs()
#print("Running: %s" % cmd)
os.system(cmd)
def etags(ctx):
'''build TAGS file using etags'''
cmd = "find %s -mindepth 1 -maxdepth 1 -name '*.[ch]' -print | etags -" % get_tags_dirs()
2010-05-11 23:20:12 +03:00
#print("Running: %s" % cmd)
os.system(cmd)
os.system("stat -c '%y' TAGS")
class ladish_dist(Scripting.Dist):
cmd = 'dist'
fun = 'dist'
def __init__(self):
2023-11-26 16:57:45 +02:00
Scripting.Dist.__init__(self)
if Options.options.distname:
self.base_name = Options.options.distname
else:
try:
sha = self.cmd_and_log("LANG= git rev-parse --short HEAD", quiet=Context.BOTH).splitlines()[0]
self.base_name = APPNAME + '-' + VERSION + "-g" + sha
except:
self.base_name = APPNAME + '-' + VERSION
self.base_name += Options.options.distsuffix
#print self.base_name
if Options.options.distname and Options.options.tagdist:
ret = self.exec_command("LANG= git tag " + self.base_name)
if ret != 0:
raise waflib.Errors.WafError('git tag creation failed')
def get_base_name(self):
return self.base_name
def get_excl(self):
2023-11-26 16:57:45 +02:00
excl = Scripting.Dist.get_excl(self)
excl += ' .gitmodules'
excl += ' GTAGS'
excl += ' GRTAGS'
excl += ' GPATH'
excl += ' GSYMS'
if Options.options.distnodeps:
excl += ' laditools'
excl += ' jack2'
excl += ' a2jmidid'
#print repr(excl)
return excl
def execute(self):
shutil.copy('./build/version.h', "./")
try:
super(ladish_dist, self).execute()
finally:
os.remove("version.h")