10 DBUS_NAME_BASE
= 'org.ladish'
12 # these variables are mandatory ('/' are converted automatically)
16 def display_msg(conf
, msg
="", status
= None, color
= None):
18 conf
.check_message_1(msg
)
19 conf
.check_message_2(status
, color
)
21 Utils
.pprint('NORMAL', msg
)
23 def display_raw_text(conf
, text
, color
= 'NORMAL'):
24 Utils
.pprint(color
, text
, sep
= '')
26 def display_line(conf
, text
, color
= 'NORMAL'):
27 Utils
.pprint(color
, text
, sep
= os
.linesep
)
30 opt
.tool_options('compiler_cc')
31 opt
.tool_options('compiler_cxx')
32 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')
34 def add_cflag(conf
, flag
):
35 conf
.env
.append_unique('CXXFLAGS', flag
)
36 conf
.env
.append_unique('CCFLAGS', flag
)
39 conf
.check_tool('compiler_cc')
40 conf
.check_tool('compiler_cxx')
44 atleast_version
= '1.0.0',
46 errmsg
= "not installed, see http://dbus.freedesktop.org/",
47 args
= '--cflags --libs')
49 dbus_dir
= conf
.check_cfg(package
='dbus-1', args
='--variable=session_bus_services_dir', msg
="Retrieving D-Bus services dir")
53 dbus_dir
= dbus_dir
.strip()
54 conf
.env
['DBUS_SERVICES_DIR_REAL'] = dbus_dir
56 if Options
.options
.enable_pkg_config_dbus_service_dir
:
57 conf
.env
['DBUS_SERVICES_DIR'] = dbus_dir
59 conf
.env
['DBUS_SERVICES_DIR'] = os
.path
.join(os
.path
.normpath(conf
.env
['PREFIX']), 'share', 'dbus-1', 'services')
64 errmsg
= "not installed, see http://e2fsprogs.sourceforge.net/",
65 args
= '--cflags --libs')
67 conf
.check(header_name
='expat.h', define_name
="HAVE_EXPAT")
69 if conf
.is_defined('HAVE_EXPAT'):
70 conf
.env
['LIB_EXPAT'] = ['expat']
73 package
= 'dbus-glib-1',
75 errmsg
= "not installed, see http://dbus.freedesktop.org/",
76 args
= '--cflags --libs')
79 package
= 'glibmm-2.4',
81 errmsg
= "not installed, see http://www.gtkmm.org/",
82 args
= '--cflags --libs')
85 package
= 'gtkmm-2.4',
87 atleast_version
= '2.11.12',
88 errmsg
= "not installed, see http://www.gtkmm.org/",
89 args
= '--cflags --libs')
92 package
= 'libgnomecanvasmm-2.6',
94 errmsg
= "not installed, see http://www.gtkmm.org/",
95 args
= '--cflags --libs')
98 package
= 'libglademm-2.4',
100 errmsg
= "not installed, see http://www.gtkmm.org/",
101 args
= '--cflags --libs')
104 package
= 'flowcanvas',
106 atleast_version
= '0.4.0',
107 errmsg
= "not installed, see http://drobilla.net/software/flowcanvas/",
108 args
= '--cflags --libs')
110 # We need the boost headers package (e.g. libboost-dev)
111 # shared_ptr.hpp and weak_ptr.hpp
112 conf
.check_tool('boost')
115 add_cflag(conf
, '-g')
116 add_cflag(conf
, '-Wall')
117 add_cflag(conf
, '-Werror')
119 conf
.define('DATA_DIR', os
.path
.normpath(os
.path
.join(conf
.env
['PREFIX'], 'share', APPNAME
)))
120 conf
.define('DEFAULT_PROJECT_DIR', "audio-projects")
121 conf
.define('PACKAGE_VERSION', VERSION
)
122 conf
.define('DBUS_NAME_BASE', DBUS_NAME_BASE
)
123 conf
.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE
.replace('.', '/'))
124 conf
.define('_GNU_SOURCE', 1)
125 conf
.write_config_header('config.h')
129 display_msg(conf
, "==================")
130 version_msg
= APPNAME
+ "-" + VERSION
133 # version_msg += " exported from r" + rev
135 # version_msg += " git revision will checked and eventually updated during build"
137 display_msg(conf
, version_msg
)
140 display_msg(conf
, "Install prefix", conf
.env
['PREFIX'], 'CYAN')
142 display_msg(conf
, 'D-Bus service install directory', conf
.env
['DBUS_SERVICES_DIR'], 'CYAN')
144 if conf
.env
['DBUS_SERVICES_DIR'] != conf
.env
['DBUS_SERVICES_DIR_REAL']:
146 display_line(conf
, "WARNING: D-Bus session services directory as reported by pkg-config is", 'RED')
147 display_raw_text(conf
, "WARNING:", 'RED')
148 display_line(conf
, conf
.env
['DBUS_SERVICES_DIR_REAL'], 'CYAN')
149 display_line(conf
, 'WARNING: but service file will be installed in', 'RED')
150 display_raw_text(conf
, "WARNING:", 'RED')
151 display_line(conf
, conf
.env
['DBUS_SERVICES_DIR'], 'CYAN')
152 display_line(conf
, 'WARNING: You may need to adjust your D-Bus configuration after installing jackdbus', 'RED')
153 display_line(conf
, 'WARNING: You can override dbus service install directory', 'RED')
154 display_line(conf
, 'WARNING: with --enable-pkg-config-dbus-service-dir option to this script', 'RED')
159 daemon
= bld
.new_task_gen('cc', 'program')
160 daemon
.target
= 'ladishd'
161 daemon
.includes
= "build/default" # XXX config.h version.h and other generated files
162 daemon
.uselib
= 'DBUS-1 LIBXML-2.0 UUID'
163 daemon
.ver_header
= 'version.h'
164 daemon
.env
.append_value("LINKFLAGS", ["-lutil", "-ldl"])
184 daemon
.source
.append(os
.path
.join("daemon", source
))
196 daemon
.source
.append(os
.path
.join("dbus", source
))
198 daemon
.source
.append(os
.path
.join("common", "safety.c"))
200 # process name.arnaudov.nedko.ladish.service.in -> name.arnaudov.nedko.ladish.service
202 obj
= bld
.new_task_gen('subst')
203 obj
.source
= os
.path
.join('daemon', 'dbus.service.in')
204 obj
.target
= DBUS_NAME_BASE
+ '.service'
205 obj
.dict = {'dbus_object_path': DBUS_NAME_BASE
,
206 'daemon_bin_path': os
.path
.join(bld
.env
['PREFIX'], 'bin', daemon
.target
)}
207 obj
.install_path
= bld
.env
['DBUS_SERVICES_DIR'] + os
.path
.sep
208 obj
.fun
= misc
.subst_func
210 liblash
= bld
.new_task_gen('cc', 'shlib')
211 liblash
.includes
= "build/default" # XXX config.h version.h and other generated files
212 liblash
.uselib
= 'DBUS-1 LIBXML-2.0 UUID'
213 liblash
.target
= 'lash'
214 liblash
.vnum
= "1.1.1"
215 liblash
.defines
= ['LASH_OLD_API', 'DEBUG_OUTPUT_TERMINAL']
223 'dbus_iface_client.c',
228 liblash
.source
.append(os
.path
.join("lash_compat", "liblash", source
))
239 liblash
.source
.append(os
.path
.join("dbus", source
))
241 liblash
.source
.append(os
.path
.join("common", "safety.c"))
242 liblash
.source
.append(os
.path
.join("daemon", "legacy", "file.c"))
244 # pkgpyexec_LTLIBRARIES = _lash.la
245 # INCLUDES = $(PYTHON_INCLUDES)
246 # _lash_la_LDFLAGS = -module -avoid-version ../liblash/liblash.la
247 # _lash_la_SOURCES = lash.c lash.h lash_wrap.c
248 # pkgpyexec_SCRIPTS = lash.py
249 # CLEANFILES = lash_wrap.c lash.py lash.pyc zynjacku.defs
250 # EXTRA_DIST = test.py lash.i lash.py
251 # lash_wrap.c lash.py: lash.i lash.h
252 # swig -o lash_wrap.c -I$(top_srcdir) -python $(top_srcdir)/$(subdir)/lash.i
254 #####################################################
256 gladish
= bld
.new_task_gen('cxx', 'program')
257 gladish
.features
.append('cc')
258 gladish
.target
= 'gladish'
259 gladish
.defines
= ['DEBUG_OUTPUT_TERMINAL']
260 gladish
.includes
= "build/default" # XXX config.h version.h and other generated files
261 gladish
.uselib
= 'DBUS-1 LIBGNOMECANVASMM-2.6 LIBGLADEMM-2.4 FLOWCANVAS DBUS-GLIB-1'
273 #'load_projects_dialog.cpp',
277 #'project_properties.cpp',
286 gladish
.source
.append(os
.path
.join("gui", source
))
292 gladish
.source
.append(os
.path
.join("dbus", source
))
294 # Glade UI definitions (XML)
295 bld
.install_files(bld
.env
['DATA_DIR'], 'gui/gui.glade')
297 # 'Desktop' file (menu entry, icon, etc)
298 #obj = bld.create_obj('subst')
299 #obj.source = 'patchage.desktop.in'
300 #obj.target = 'patchage.desktop'
302 # 'BINDIR' : bld.env()['BINDIR'],
303 # 'APP_INSTALL_NAME' : bld.env()['APP_INSTALL_NAME'],
304 # 'APP_HUMAN_NAME' : bld.env()['APP_HUMAN_NAME'],
306 #install_as(os.path.normpath(bld.env()['DATADIR'] + 'applications/'), bld.env()['APP_INSTALL_NAME'] + '.desktop', 'build/default/patchage.desktop')
310 # Installation layout (with /usr prefix)
312 # /usr/share/applications/patchage.desktop
313 # /usr/share/icons/hicolor/16x16/apps/patchage.png
314 # /usr/share/icons/hicolor/22x22/apps/patchage.png
315 # /usr/share/icons/hicolor/24x24/apps/patchage.png
316 # /usr/share/icons/hicolor/32x32/apps/patchage.png
317 # /usr/share/icons/hicolor/48x48/apps/patchage.png
318 # /usr/share/icons/hicolor/scalable/apps/patchage.svg
319 # /usr/share/patchage/patchage.glade
321 # icon cache is updated using:
322 # gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
324 # Dave disabled this, ask why before removing this
325 #install_as(os.path.normpath(bld.env()['PREFIX'] + '/share/icons/hicolor/scalable/apps/'), bld.env()['APP_INSTALL_NAME'] + '.svg', 'icons/scalable/patchage.svg')
327 #icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48']
328 #for icon_size in icon_sizes:
329 # install_as(os.path.normpath(bld.env()['DATADIR'] + '/icons/hicolor/' + icon_size + '/apps/'), bld.env()['APP_INSTALL_NAME'] + '.png', 'icons/' + icon_size + '/patchage.png')
335 from Constants
import RUN_ME
336 from TaskGen
import feature
, after
341 def process_git(self
):
342 if getattr(self
, 'ver_header', None):
343 tsk
= self
.create_task('git_ver')
344 tsk
.set_outputs(self
.path
.find_or_declare(self
.ver_header
))
348 self
.ver
= commands
.getoutput("LANG= git rev-parse HEAD").splitlines()[0]
349 if commands
.getoutput("LANG= git diff-index --name-only HEAD").splitlines():
352 Utils
.pprint('BLUE', "git revision " + self
.ver
)
354 fi
= open(self
.outputs
[0].abspath(self
.env
), 'w')
355 fi
.write('#define GIT_VERSION "%s"\n' % self
.ver
)
358 cls
= Task
.task_type_from_func('git_ver', vars=[], func
=git_ver
, color
='BLUE', before
='cc')
362 cls
.runnable_status
= always
365 sg
= Utils
.h_list(self
.ver
)
366 node
= self
.outputs
[0]
367 variant
= node
.variant(self
.env
)
368 self
.generator
.bld
.node_sigs
[variant
][node
.id] = sg
369 cls
.post_run
= post_run