2009-02-25 18:48:10 -05:00
|
|
|
#!/usr/bin/env python
|
2011-09-29 15:17:54 -04:00
|
|
|
from waflib.extras import autowaf as autowaf
|
2013-03-20 17:18:55 -04:00
|
|
|
from waflib import Options
|
2009-02-25 18:48:10 -05:00
|
|
|
import os
|
2015-10-27 14:35:55 -04:00
|
|
|
import sys
|
|
|
|
import platform as PLATFORM
|
2009-02-25 18:48:10 -05:00
|
|
|
|
|
|
|
# Version of this package (even if built as a child)
|
2009-02-25 21:24:16 -05:00
|
|
|
MAJOR = '0'
|
|
|
|
MINOR = '8'
|
|
|
|
MICRO = '3'
|
|
|
|
GTKMM2EXT_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
|
2009-02-25 18:48:10 -05:00
|
|
|
|
|
|
|
# Library version (UNIX style major, minor, micro)
|
|
|
|
# major increment <=> incompatible changes
|
|
|
|
# minor increment <=> compatible changes (additions)
|
|
|
|
# micro increment <=> no interface changes
|
|
|
|
GTKMM2EXT_LIB_VERSION = '0.8.3'
|
|
|
|
|
|
|
|
# Variables for 'waf dist'
|
|
|
|
APPNAME = 'gtkmm2ext'
|
|
|
|
VERSION = GTKMM2EXT_VERSION
|
2011-11-21 16:27:30 -05:00
|
|
|
I18N_PACKAGE = 'gtkmm2ext3'
|
2009-02-25 18:48:10 -05:00
|
|
|
|
2009-08-08 18:36:32 -04:00
|
|
|
gtkmm2ext_sources = [
|
2011-03-16 12:32:56 -04:00
|
|
|
'actions.cc',
|
2010-08-16 22:48:24 -04:00
|
|
|
'application.cc',
|
2015-05-24 15:44:27 -04:00
|
|
|
'ardour_icon.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'auto_spin.cc',
|
|
|
|
'barcontroller.cc',
|
|
|
|
'binding_proxy.cc',
|
|
|
|
'bindable_button.cc',
|
2010-08-06 15:02:21 -04:00
|
|
|
'bindings.cc',
|
2011-06-01 07:51:32 -04:00
|
|
|
'cairocell.cc',
|
2015-07-21 22:37:19 -04:00
|
|
|
'cairo_icon.cc',
|
2011-12-07 08:57:45 -05:00
|
|
|
'cairo_packer.cc',
|
|
|
|
'cairo_widget.cc',
|
2011-12-06 16:43:30 -05:00
|
|
|
'cell_renderer_color_selector.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'cell_renderer_pixbuf_multi.cc',
|
|
|
|
'cell_renderer_pixbuf_toggle.cc',
|
|
|
|
'choice.cc',
|
|
|
|
'click_box.cc',
|
2014-09-10 16:47:49 -04:00
|
|
|
'cursors.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'debug.cc',
|
|
|
|
'dndtreeview.cc',
|
2014-10-23 13:17:27 -04:00
|
|
|
'emscale.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'focus_entry.cc',
|
|
|
|
'grouped_buttons.cc',
|
|
|
|
'gtk_ui.cc',
|
2010-03-16 11:33:04 -04:00
|
|
|
'gtkapplication.c',
|
2011-03-16 12:32:56 -04:00
|
|
|
'idle_adjustment.cc',
|
|
|
|
'keyboard.cc',
|
2016-05-25 23:31:32 -04:00
|
|
|
'pane.cc',
|
2014-02-26 19:35:57 -05:00
|
|
|
'paths_dialog.cc',
|
2012-06-11 17:21:10 -04:00
|
|
|
'persistent_tooltip.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'pixfader.cc',
|
|
|
|
'pixscroller.cc',
|
|
|
|
'popup.cc',
|
|
|
|
'prompter.cc',
|
|
|
|
'scroomer.cc',
|
2016-03-07 17:56:03 -05:00
|
|
|
'searchbar.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'selector.cc',
|
|
|
|
'slider_controller.cc',
|
|
|
|
'stateful_button.cc',
|
2015-07-07 22:12:21 -04:00
|
|
|
'tabbable.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'tearoff.cc',
|
|
|
|
'textviewer.cc',
|
2010-09-28 13:26:05 -04:00
|
|
|
'treeutils.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'utils.cc',
|
2013-03-25 20:03:59 -04:00
|
|
|
'visibility_tracker.cc',
|
2016-02-19 11:31:38 -05:00
|
|
|
'window_proxy.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'window_title.cc'
|
2009-08-08 18:36:32 -04:00
|
|
|
]
|
|
|
|
|
2009-02-25 18:48:10 -05:00
|
|
|
# Mandatory variables
|
2011-09-29 15:17:54 -04:00
|
|
|
top = '.'
|
|
|
|
out = 'build'
|
2009-02-25 18:48:10 -05:00
|
|
|
|
2009-02-25 21:24:16 -05:00
|
|
|
path_prefix = 'libs/gtkmm2ext/'
|
|
|
|
|
2011-09-29 15:17:54 -04:00
|
|
|
def options(opt):
|
2011-04-22 18:15:21 -04:00
|
|
|
autowaf.set_options(opt)
|
2009-02-25 18:48:10 -05:00
|
|
|
|
|
|
|
def configure(conf):
|
2011-09-29 15:58:05 -04:00
|
|
|
conf.load('compiler_cxx')
|
2011-04-22 18:15:21 -04:00
|
|
|
autowaf.configure(conf)
|
|
|
|
autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM', atleast_version='2.8')
|
|
|
|
autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK', atleast_version='2.12.1')
|
2009-08-08 18:36:32 -04:00
|
|
|
|
2009-02-25 18:48:10 -05:00
|
|
|
|
|
|
|
def build(bld):
|
2015-11-23 07:52:14 -05:00
|
|
|
# operate on copy to avoid adding sources twice
|
|
|
|
sources = list(gtkmm2ext_sources)
|
2015-05-06 13:15:09 -04:00
|
|
|
if bld.is_tracks_build():
|
2015-07-02 09:32:29 -04:00
|
|
|
sources += [ 'waves_fastmeter.cc', 'fader.cc' ]
|
2015-05-06 13:05:16 -04:00
|
|
|
else:
|
2015-07-02 09:32:29 -04:00
|
|
|
sources += [ 'fastmeter.cc' ]
|
|
|
|
|
2013-03-20 17:18:55 -04:00
|
|
|
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
|
2015-05-06 13:05:16 -04:00
|
|
|
obj = bld.shlib(features = 'c cxx cshlib cxxshlib', source=sources)
|
2013-10-17 11:26:01 -04:00
|
|
|
# defines for this library
|
2014-01-10 17:11:10 -05:00
|
|
|
obj.defines = [ 'LIBGTKMM2EXT_DLL_EXPORTS', 'ABSTRACT_UI_EXPORTS' ]
|
2013-03-20 17:18:55 -04:00
|
|
|
else:
|
2015-05-06 13:05:16 -04:00
|
|
|
obj = bld.stlib(features = 'c cxx cstlib cxxstlib', source=sources)
|
2013-03-20 17:18:55 -04:00
|
|
|
obj.cxxflags = [ '-fPIC' ]
|
2013-10-17 11:26:01 -04:00
|
|
|
obj.defines = [ ]
|
2013-03-20 17:18:55 -04:00
|
|
|
|
2011-09-29 15:17:54 -04:00
|
|
|
obj.export_includes = ['.']
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.includes = ['.']
|
|
|
|
obj.name = 'libgtkmm2ext'
|
|
|
|
obj.target = 'gtkmm2ext'
|
2016-02-28 15:16:44 -05:00
|
|
|
obj.uselib = 'GTKMM GTK XML'
|
2015-05-06 09:55:01 -04:00
|
|
|
obj.use = [ 'libpbd', 'libardour' ]
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.vnum = GTKMM2EXT_LIB_VERSION
|
2014-04-28 21:18:02 -04:00
|
|
|
obj.install_path = bld.env['LIBDIR']
|
2013-10-17 11:26:01 -04:00
|
|
|
obj.defines += [
|
2011-11-21 17:24:56 -05:00
|
|
|
'PACKAGE="' + I18N_PACKAGE + '"',
|
|
|
|
'LOCALEDIR="' + os.path.join(
|
2011-09-29 15:17:54 -04:00
|
|
|
os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
|
2015-10-27 14:35:55 -04:00
|
|
|
if sys.platform == 'darwin':
|
2011-04-22 18:15:21 -04:00
|
|
|
obj.source += ['gtkapplication_quartz.mm']
|
|
|
|
else:
|
|
|
|
obj.source += ['gtkapplication_x11.c']
|
2009-02-25 18:48:10 -05:00
|
|
|
|
2011-06-12 18:05:55 -04:00
|
|
|
# i18n
|
2011-09-30 12:22:04 -04:00
|
|
|
if bld.is_defined('ENABLE_NLS'):
|
2011-11-05 12:35:24 -04:00
|
|
|
mo_files = bld.path.ant_glob('po/*.mo')
|
2011-06-12 18:05:55 -04:00
|
|
|
for mo in mo_files:
|
2011-11-05 12:35:24 -04:00
|
|
|
lang = os.path.basename(mo.srcpath()).replace('.mo', '')
|
2014-12-09 08:19:11 -05:00
|
|
|
bld.install_as (os.path.join(os.path.normpath(bld.env['LOCALEDIR']), lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
|
|
|
|
mo)
|
2015-11-29 11:52:42 -05:00
|
|
|
|
2011-06-12 18:05:55 -04:00
|
|
|
def i18n(bld):
|
2011-11-21 16:27:30 -05:00
|
|
|
autowaf.build_i18n(bld, top, 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
|
|
|
|
'Paul Davis')
|
|
|
|
|
|
|
|
def i18n_pot(bld):
|
|
|
|
autowaf.build_i18n_pot(bld, top, 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
|
|
|
|
'Paul Davis')
|
|
|
|
|
|
|
|
def i18n_po(bld):
|
|
|
|
autowaf.build_i18n_po(bld, top, 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
|
|
|
|
'Paul Davis')
|
|
|
|
|
|
|
|
def i18n_mo(bld):
|
|
|
|
autowaf.build_i18n_mo(bld, top, 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
|
2011-11-05 12:35:24 -04:00
|
|
|
'Paul Davis')
|
2011-06-12 18:05:55 -04:00
|
|
|
|
2009-02-25 18:48:10 -05:00
|
|
|
def shutdown():
|
2011-04-22 18:15:21 -04:00
|
|
|
autowaf.shutdown()
|