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
|
2009-02-25 18:48:10 -05:00
|
|
|
import os
|
2015-10-27 14:35:55 -04:00
|
|
|
import sys
|
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'
|
|
|
|
|
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',
|
2019-04-20 06:37:07 -04:00
|
|
|
'action_model.cc',
|
2010-08-16 22:48:24 -04:00
|
|
|
'application.cc',
|
2010-08-06 15:02:21 -04:00
|
|
|
'bindings.cc',
|
2011-12-07 08:57:45 -05:00
|
|
|
'cairo_packer.cc',
|
2021-01-26 17:01:05 -05:00
|
|
|
'cairo_theme.cc',
|
2011-12-07 08:57:45 -05:00
|
|
|
'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',
|
2017-07-17 12:34:35 -04:00
|
|
|
'colors.cc',
|
|
|
|
'colorspace.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
|
|
|
'gtk_ui.cc',
|
2010-03-16 11:33:04 -04:00
|
|
|
'gtkapplication.c',
|
2011-03-16 12:32:56 -04:00
|
|
|
'keyboard.cc',
|
2017-06-28 17:24:06 -04:00
|
|
|
'menu_elems.cc',
|
2012-06-11 17:21:10 -04:00
|
|
|
'persistent_tooltip.cc',
|
2011-03-16 12:32:56 -04:00
|
|
|
'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
|
|
|
]
|
|
|
|
|
2011-09-29 15:17:54 -04:00
|
|
|
def options(opt):
|
2022-01-25 11:43:36 -05:00
|
|
|
pass
|
2009-02-25 18:48:10 -05:00
|
|
|
|
|
|
|
def configure(conf):
|
2023-12-13 00:45:00 -05:00
|
|
|
if not conf.is_defined('YTK'):
|
|
|
|
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-07-02 09:32:29 -04:00
|
|
|
|
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)
|
2018-10-14 22:06:11 -04:00
|
|
|
obj.cxxflags = [ bld.env['compiler_flags_dict']['pic'] ]
|
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'
|
2023-12-13 00:45:00 -05:00
|
|
|
obj.uselib = 'XML CAIROMM PANGOMM'
|
2017-07-16 22:55:52 -04:00
|
|
|
obj.use = [ 'libpbd' ]
|
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') + '"']
|
2023-12-13 00:45:00 -05:00
|
|
|
if bld.is_defined('YTK'):
|
|
|
|
obj.use += [ 'libydk', 'libydkmm', 'libytkmm' ]
|
|
|
|
obj.uselib += ' GLIBMM GIOMM'
|
|
|
|
else:
|
|
|
|
obj.uselib += ' GTKMM GTK'
|
2015-10-27 14:35:55 -04:00
|
|
|
if sys.platform == 'darwin':
|
2017-03-19 23:21:08 -04:00
|
|
|
obj.source += ['gtkapplication_quartz.mm', 'nsglview.mm']
|
2020-01-20 22:35:40 -05:00
|
|
|
obj.uselib += ' OSX'
|
2011-04-22 18:15:21 -04:00
|
|
|
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
|
|
|
|
2022-01-25 15:28:12 -05:00
|
|
|
def i18n_func(bld):
|
2022-01-24 16:24:13 -05:00
|
|
|
autowaf.build_i18n(bld, '.', 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
|
2011-11-21 16:27:30 -05:00
|
|
|
'Paul Davis')
|
|
|
|
|
2022-01-25 15:28:12 -05:00
|
|
|
def i18n_pot_func(bld):
|
2022-01-24 16:24:13 -05:00
|
|
|
autowaf.build_i18n_pot(bld, '.', 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
|
2011-11-21 16:27:30 -05:00
|
|
|
'Paul Davis')
|
|
|
|
|
2022-01-25 15:28:12 -05:00
|
|
|
def i18n_po_func(bld):
|
2022-01-24 16:24:13 -05:00
|
|
|
autowaf.build_i18n_po(bld, '.', 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
|
2011-11-21 16:27:30 -05:00
|
|
|
'Paul Davis')
|
|
|
|
|
2022-01-25 15:28:12 -05:00
|
|
|
def i18n_mo_func(bld):
|
2022-01-24 16:24:13 -05:00
|
|
|
autowaf.build_i18n_mo(bld, '.', 'libs/gtkmm2ext', I18N_PACKAGE, gtkmm2ext_sources,
|
2011-11-05 12:35:24 -04:00
|
|
|
'Paul Davis')
|