2 # Licensed under the GNU GPL v2 or later, see COPYING file for details.
3 # Copyright (C) 2008 Dave Robillard
4 # Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
9 # Version of this package (even if built as a child)
10 PATCHAGE_VERSION
= '5'
12 # Variables for 'waf dist'
14 VERSION
= PATCHAGE_VERSION
15 APP_HUMAN_NAME
= 'LADI Patchage'
22 autowaf
.set_options(opt
, False, False, False)
23 opt
.add_option('--install-name', type='string', default
=APPNAME
, dest
='app_install_name', help="Install name. [Default: '" + APPNAME
+ "']")
24 opt
.add_option('--app-human-name', type='string', default
=APP_HUMAN_NAME
, dest
='app_human_name', help="Human name for app. [Default: '" + APP_HUMAN_NAME
+ "']")
27 autowaf
.configure(conf
)
28 autowaf
.check_tool(conf
, 'compiler_cxx')
29 autowaf
.check_tool(conf
, 'compiler_cc')
31 conf
.check_tool('misc') # subst tool
33 conf
.check_pkg('dbus-1', mandatory
=True)
34 conf
.check_pkg('dbus-glib-1', mandatory
=True)
35 conf
.check_pkg('glibmm-2.4', mandatory
=True)
36 conf
.check_pkg('gtkmm-2.4', mandatory
=True, vnum
='2.11.12')
37 conf
.check_pkg('libgnomecanvasmm-2.6', mandatory
=True)
38 conf
.check_pkg('libglademm-2.4', mandatory
=True)
40 # You need the boost headers package (e.g. libboost-dev)
41 conf
.check_header('boost/shared_ptr.hpp', mandatory
=True)
42 conf
.check_header('boost/weak_ptr.hpp', mandatory
=True)
44 conf
.check_pkg('flowcanvas', mandatory
=True, vnum
='0.4.0')
46 conf
.define('PATCHAGE_APPNAME', APPNAME
)
47 conf
.env
['PATCHAGE_VERSION'] = PATCHAGE_VERSION
48 conf
.env
['APP_INSTALL_NAME'] = Params
.g_options
.app_install_name
49 conf
.env
['APP_HUMAN_NAME'] = Params
.g_options
.app_human_name
50 if conf
.env
['BUNDLE']:
51 conf
.define('PATCHAGE_DATA_DIR', os
.path
.normpath(
52 conf
.env
['DATADIRNAME'] + conf
.env
['APP_INSTALL_NAME']))
54 conf
.define('PATCHAGE_DATA_DIR', os
.path
.normpath(
55 conf
.env
['DATADIR'] + conf
.env
['APP_INSTALL_NAME']))
57 conf
.write_config_header('config.h')
60 autowaf
.display_msg("Install prefix", conf
.env
['PREFIX'], 'CYAN')
61 autowaf
.display_msg("Install name", "'" + conf
.env
['APP_INSTALL_NAME'] + "'", 'CYAN')
62 autowaf
.display_msg("App human name", "'" + conf
.env
['APP_HUMAN_NAME'] + "'", 'CYAN')
67 prog
= bld
.create_obj('cpp', 'program')
68 prog
.includes
= 'src' # make waf dependency tracking work
69 prog
.target
= bld
.env()['APP_INSTALL_NAME']
70 prog
.inst_dir
= bld
.env()['BINDIRNAME']
71 prog
.uselib
= 'DBUS-1 LIBGNOMECANVASMM-2.6 LIBGLADEMM-2.4 FLOWCANVAS DBUS-GLIB-1'
75 'src/PatchageCanvas.cpp',
76 'src/StateManager.cpp',
78 'src/lash_client.cpp',
80 'src/load_projects_dialog.cpp',
82 'src/project_list.cpp',
83 'src/project_properties.cpp',
89 # Executable wrapper script (if building a bundle)
90 autowaf
.build_wrapper(bld
, 'patchage.in', prog
)
92 # Glade UI definitions (XML)
93 install_files('DATADIR', bld
.env()['APP_INSTALL_NAME'], 'src/patchage.glade')
95 # 'Desktop' file (menu entry, icon, etc)
96 obj
= bld
.create_obj('subst')
97 obj
.source
= 'patchage.desktop.in'
98 obj
.target
= 'patchage.desktop'
100 'BINDIR' : bld
.env()['BINDIR'],
101 'APP_INSTALL_NAME' : bld
.env()['APP_INSTALL_NAME'],
102 'APP_HUMAN_NAME' : bld
.env()['APP_HUMAN_NAME'],
104 install_as(os
.path
.normpath(bld
.env()['DATADIR'] + 'applications/'), bld
.env()['APP_INSTALL_NAME'] + '.desktop', 'build/default/patchage.desktop')
108 # Installation layout (with /usr prefix)
110 # /usr/share/applications/patchage.desktop
111 # /usr/share/icons/hicolor/16x16/apps/patchage.png
112 # /usr/share/icons/hicolor/22x22/apps/patchage.png
113 # /usr/share/icons/hicolor/24x24/apps/patchage.png
114 # /usr/share/icons/hicolor/32x32/apps/patchage.png
115 # /usr/share/icons/hicolor/48x48/apps/patchage.png
116 # /usr/share/icons/hicolor/scalable/apps/patchage.svg
117 # /usr/share/patchage/patchage.glade
119 # icon cache is updated using:
120 # gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
122 # Dave disabled this, ask why before removing this
123 #install_as(os.path.normpath(bld.env()['PREFIX'] + '/share/icons/hicolor/scalable/apps/'), bld.env()['APP_INSTALL_NAME'] + '.svg', 'icons/scalable/patchage.svg')
125 icon_sizes
= ['16x16', '22x22', '24x24', '32x32', '48x48']
126 for icon_size
in icon_sizes
:
127 install_as(os
.path
.normpath(bld
.env()['DATADIR'] + '/icons/hicolor/' + icon_size
+ '/apps/'), bld
.env()['APP_INSTALL_NAME'] + '.png', 'icons/' + icon_size
+ '/patchage.png')