summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Patchage.cpp40
-rw-r--r--src/Patchage.hpp15
-rw-r--r--src/PatchageCanvas.cpp10
-rw-r--r--src/PatchageEvent.cpp4
-rw-r--r--src/main.cpp4
l---------waf1
-rw-r--r--wscript281
7 files changed, 204 insertions, 151 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp
index 9a06819..d9723d6 100644
--- a/src/Patchage.cpp
+++ b/src/Patchage.cpp
@@ -28,7 +28,7 @@
#include "GladeFile.hpp"
#if defined(HAVE_JACK_DBUS)
#include "JackDbusDriver.hpp"
-#elif defined(HAVE_JACK)
+#elif defined(USE_LIBJACK)
#include "JackDriver.hpp"
#include <jack/statistics.h>
#endif
@@ -39,8 +39,10 @@
#ifdef HAVE_ALSA
#include "AlsaDriver.hpp"
#endif
-#ifdef HAVE_DBUS
+#if defined(HAVE_LASH) || defined(HAVE_JACK_DBUS)
#include "DBus.hpp"
+#endif
+#ifdef HAVE_LASH
#include "LashProxy.hpp"
#include "LoadProjectDialog.hpp"
#include "ProjectList.hpp"
@@ -86,7 +88,7 @@ gtkmm_set_width_for_given_text (Gtk::Widget &w, const gchar *text,
Patchage::Patchage(int argc, char** argv)
: _xml(GladeFile::open("patchage"))
-#ifdef HAVE_DBUS
+#ifdef HAVE_LASH
, _lash_proxy(NULL)
, _dbus(NULL)
, _project_list(NULL)
@@ -175,7 +177,7 @@ Patchage::Patchage(int argc, char** argv)
_zoom_full_but->signal_clicked().connect(
sigc::mem_fun(_canvas.get(), &PatchageCanvas::zoom_full));
-#ifdef HAVE_DBUS
+#ifdef HAVE_LASH
_menu_open_session->signal_activate().connect(
sigc::mem_fun(this, &Patchage::show_load_project_dialog));
_menu_view_projects->set_active(true);
@@ -234,7 +236,7 @@ Patchage::Patchage(int argc, char** argv)
_about_win->set_transient_for(*_main_win);
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
_jack_driver = new JackDriver(this);
_jack_driver->signal_detached.connect(sigc::mem_fun(this, &Patchage::queue_refresh));
@@ -248,7 +250,7 @@ Patchage::Patchage(int argc, char** argv)
_alsa_driver = new AlsaDriver(this);
#endif
-#ifdef HAVE_DBUS
+#ifdef HAVE_LASH
_dbus = new DBus(this);
_session = new Session();
_project_list = new ProjectList(this, _session);
@@ -270,13 +272,13 @@ Patchage::Patchage(int argc, char** argv)
Patchage::~Patchage()
{
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
delete _jack_driver;
#endif
#ifdef HAVE_ALSA
delete _alsa_driver;
#endif
-#ifdef HAVE_DBUS
+#ifdef HAVE_LASH
delete _lash_proxy;
#endif
delete _state_manager;
@@ -292,7 +294,7 @@ Patchage::attach()
{
_enable_refresh = false;
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
_jack_driver->attach(true);
#endif
@@ -321,7 +323,7 @@ Patchage::idle_callback()
}
// Process any JACK events
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
if (_jack_driver) {
_jack_driver->process_events(this);
}
@@ -349,7 +351,7 @@ Patchage::idle_callback()
void
Patchage::update_toolbar()
{
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
if (_enable_refresh && _jack_driver->is_attached())
_buffer_size_combo->set_active((int)log2f(_jack_driver->buffer_size()) - 5);
#endif
@@ -359,7 +361,7 @@ Patchage::update_toolbar()
bool
Patchage::update_load()
{
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
if (!_jack_driver->is_attached())
return true;
@@ -399,7 +401,7 @@ Patchage::refresh()
_canvas->destroy();
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
if (_jack_driver)
_jack_driver->refresh();
#endif
@@ -438,7 +440,7 @@ Patchage::store_window_location()
void
Patchage::clear_load()
{
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
_main_xrun_progress->set_fraction(0.0);
_jack_driver->reset_xruns();
_jack_driver->reset_max_dsp_load();
@@ -499,7 +501,7 @@ Patchage::update_state()
void
Patchage::connect_widgets()
{
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
_jack_driver->signal_attached.connect(
sigc::mem_fun(this, &Patchage::update_toolbar));
_jack_driver->signal_attached.connect(sigc::bind(
@@ -528,7 +530,7 @@ Patchage::connect_widgets()
#endif
}
-#ifdef HAVE_DBUS
+#ifdef HAVE_LASH
void
Patchage::show_load_project_dialog()
{
@@ -540,7 +542,7 @@ Patchage::show_load_project_dialog()
}
#endif
-#ifdef HAVE_DBUS
+#ifdef HAVE_LASH
void
Patchage::set_lash_available(bool available)
{
@@ -617,7 +619,7 @@ Patchage::on_quit()
#ifdef HAVE_ALSA
_alsa_driver->detach();
#endif
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
_jack_driver->detach();
#endif
_main_win->hide();
@@ -673,7 +675,7 @@ Patchage::on_scroll(GdkEventScroll* ev)
void
Patchage::buffer_size_changed()
{
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
const int selected = _buffer_size_combo->get_active_row_number();
if (selected == -1) {
diff --git a/src/Patchage.hpp b/src/Patchage.hpp
index 05cff7b..b35e43f 100644
--- a/src/Patchage.hpp
+++ b/src/Patchage.hpp
@@ -49,9 +49,11 @@ public:
#ifdef HAVE_ALSA
AlsaDriver* alsa_driver() const { return _alsa_driver; }
#endif
-#ifdef HAVE_DBUS
- LashProxy* lash_proxy() const { return _lash_proxy; }
- DBus* dbus() const { return _dbus; }
+#if defined(HAVE_LASH) || defined(HAVE_JACK_DBUS)
+ DBus* dbus() const { return _dbus; }
+#endif
+#ifdef HAVE_LASH
+ LashProxy* lash_proxy() const { return _lash_proxy; }
void show_load_project_dialog();
void set_lash_available(bool available);
@@ -97,9 +99,12 @@ protected:
Glib::RefPtr<Gnome::Glade::Xml> _xml;
-#ifdef HAVE_DBUS
+#if defined(HAVE_LASH) || defined(HAVE_JACK_DBUS)
+ DBus* _dbus;
+#endif
+
+#ifdef HAVE_LASH
LashProxy* _lash_proxy;
- DBus* _dbus;
ProjectList* _project_list;
Session* _session;
#endif
diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp
index 6b610e4..2735a61 100644
--- a/src/PatchageCanvas.cpp
+++ b/src/PatchageCanvas.cpp
@@ -21,7 +21,7 @@
#include "Patchage.hpp"
#if defined(HAVE_JACK_DBUS)
#include "JackDbusDriver.hpp"
-#elif defined(HAVE_JACK)
+#elif defined(USE_LIBJACK)
#include "JackDriver.hpp"
#endif
#include "PatchageModule.hpp"
@@ -70,7 +70,7 @@ PatchageCanvas::find_port(const PortID& id)
string module_name;
string port_name;
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
jack_port_t* jack_port = NULL;
#endif
@@ -79,7 +79,7 @@ PatchageCanvas::find_port(const PortID& id)
// TODO: filthy. keep a port map and make this O(log(n))
switch (id.type) {
-#if defined(HAVE_JACK) && !defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) && !defined(HAVE_JACK_DBUS)
case PortID::JACK_ID:
jack_port = jack_port_by_id(_app->jack_driver()->client(), id.id.jack_id);
if (!jack_port)
@@ -145,7 +145,7 @@ PatchageCanvas::connect(boost::shared_ptr<Connectable> port1, boost::shared_ptr<
if ((p1->type() == JACK_AUDIO && p2->type() == JACK_AUDIO)
|| ((p1->type() == JACK_MIDI && p2->type() == JACK_MIDI))) {
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
_app->jack_driver()->connect(p1, p2);
#endif
#ifdef HAVE_ALSA
@@ -183,7 +183,7 @@ PatchageCanvas::disconnect(boost::shared_ptr<Connectable> port1, boost::shared_p
if ((input->type() == JACK_AUDIO && output->type() == JACK_AUDIO)
|| (input->type() == JACK_MIDI && output->type() == JACK_MIDI)) {
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
_app->jack_driver()->disconnect(output, input);
#endif
#ifdef HAVE_ALSA
diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp
index 06e85d5..cc58350 100644
--- a/src/PatchageEvent.cpp
+++ b/src/PatchageEvent.cpp
@@ -24,7 +24,7 @@
#include "Driver.hpp"
#if defined(HAVE_JACK_DBUS)
#include "JackDbusDriver.hpp"
-#elif defined(HAVE_JACK)
+#elif defined(USE_LIBJACK)
#include "JackDriver.hpp"
#endif
#ifdef HAVE_ALSA
@@ -59,7 +59,7 @@ PatchageEvent::execute(Patchage* patchage)
Driver* driver = NULL;
if (_port_1.type == PortID::JACK_ID) {
-#if defined(HAVE_JACK) || defined(HAVE_JACK_DBUS)
+#if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS)
driver = patchage->jack_driver();
#endif
#ifdef HAVE_ALSA
diff --git a/src/main.cpp b/src/main.cpp
index 0e61d9d..3c20237 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -23,10 +23,6 @@
#include "Patchage.hpp"
-#ifdef HAVE_LASH
-#include <lash/lash.h>
-#endif // HAVE_LASH
-
int main(int argc, char** argv)
{
try {
diff --git a/waf b/waf
new file mode 120000
index 0000000..9770e60
--- /dev/null
+++ b/waf
@@ -0,0 +1 @@
+../waf \ No newline at end of file
diff --git a/wscript b/wscript
index a62d2f5..3b400f8 100644
--- a/wscript
+++ b/wscript
@@ -1,132 +1,181 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# waf build system from LADI patchage courtesy Nedko Arnaudov
-
+#!/usr/bin/env python
+# Parts from LADI Patchage by Nedko Arnaudov
import os
import Params
-import commands
from Configure import g_maxlen
-#g_maxlen = 40
-import shutil
-VERSION='0.4.3'
-APPNAME='patchage'
-APP_HUMAN_NAME='Patchage'
+# Version of this package (even if built as a child)
+PATCHAGE_VERSION = '0.4.2'
+
+# Variables for 'waf dist'
+APPNAME = 'patchage'
+VERSION = PATCHAGE_VERSION
+APP_HUMAN_NAME = 'Patchage'
-# these variables are mandatory ('/' are converted automatically)
+# Mandatory variables
srcdir = '.'
blddir = 'build'
-def display_msg(msg, status = None, color = None):
- sr = msg
- global g_maxlen
- g_maxlen = max(g_maxlen, len(msg))
- if status:
- print "%s :" % msg.ljust(g_maxlen),
- Params.pprint(color, status)
- else:
- print "%s" % msg.ljust(g_maxlen)
-
-def display_feature(msg, build):
- if build:
- display_msg(msg, "yes", 'GREEN')
- else:
- display_msg(msg, "no", 'YELLOW')
-
def set_options(opt):
- opt.tool_options('compiler_cxx')
+ opt.tool_options('compiler_cxx')
+ opt.add_option('--install-name', type='string', default=APPNAME, dest='app_install_name',
+ help="Install name. [Default: '" + APPNAME + "']")
+ 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 + "']")
+ opt.add_option('--no-jack-dbus', action='store_true', default=False, dest='no_jack_dbus',
+ help="Do not build Jack via D-Bus support")
+ opt.add_option('--no-lash', action='store_true', default=False, dest='no_lash',
+ help="Do not build Lash support")
+ opt.add_option('--no-alsa', action='store_true', default=False, dest='no_alsa',
+ help="Do not build Alsa Sequencer support")
- opt.add_option('--install-name', type='string', default=APPNAME, dest='app_install_name', help="Install name. [Default: '" + APPNAME + "']")
- 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 + "']")
+def display_msg(msg, status = None, color = None):
+ global g_maxlen
+ g_maxlen = max(g_maxlen, len(msg))
+ if status:
+ print "%s :" % msg.ljust(g_maxlen),
+ Params.pprint(color, status)
+ else:
+ print "%s" % msg.ljust(g_maxlen)
def configure(conf):
- conf.check_tool('compiler_cxx')
-
- conf.check_tool('misc') # subst tool
-
- conf.check_pkg('dbus-1', mandatory=True)
- conf.check_pkg('dbus-glib-1', mandatory=True)
- conf.check_pkg('glibmm-2.4', mandatory=True)
- conf.check_pkg('gtkmm-2.4', mandatory=True, vnum='2.11.12')
- conf.check_pkg('libgnomecanvasmm-2.6', mandatory=True)
- conf.check_pkg('libglademm-2.4', mandatory=True)
-
- # You need the boost headers package (e.g. libboost-dev)
- conf.check_header('boost/shared_ptr.hpp', mandatory=True)
- conf.check_header('boost/weak_ptr.hpp', mandatory=True)
-
- conf.check_pkg('flowcanvas', mandatory=True, vnum='0.4.0')
-
- conf.env['APP_INSTALL_NAME'] = Params.g_options.app_install_name
- conf.env['APP_HUMAN_NAME'] = Params.g_options.app_human_name
-
- conf.define('DATA_DIR', os.path.normpath(conf.env['PREFIX'] + '/share/' + conf.env['APP_INSTALL_NAME']))
- conf.write_config_header('config.h')
-
- print
- display_msg("Install prefix", conf.env['PREFIX'], 'CYAN')
- display_msg("Install name", "'" + conf.env['APP_INSTALL_NAME'] + "'", 'CYAN')
- display_msg("App human name", "'" + conf.env['APP_HUMAN_NAME'] + "'", 'CYAN')
- print
+ if not conf.env['CXX']:
+ conf.check_tool('compiler_cxx')
+ if not conf.env['HAVE_DBUS']:
+ conf.check_pkg('dbus-1', destvar='DBUS', mandatory=False)
+ if not conf.env['HAVE_DBUS_GLIB']:
+ conf.check_pkg('dbus-glib-1', destvar='DBUS_GLIB', mandatory=False)
+ if not conf.env['HAVE_FLOWCANVAS']:
+ conf.check_pkg('flowcanvas', destvar='FLOWCANVAS', vnum='0.5.1', mandatory=True)
+ if not conf.env['HAVE_GLADEMM']:
+ conf.check_pkg('libglademm-2.4', destvar='GLADEMM', vnum='2.6.0', mandatory=True)
+ if not conf.env['HAVE_GLIBMM']:
+ conf.check_pkg('glibmm-2.4', destvar='GLIBMM', vnum='2.16.0', mandatory=True)
+ if not conf.env['HAVE_GNOMECANVASMM']:
+ conf.check_pkg('libgnomecanvasmm-2.6', destvar='GNOMECANVASMM', mandatory=True)
+ if not conf.env['HAVE_GTHREAD']:
+ conf.check_pkg('gthread-2.0', destvar='GTHREAD', vnum='2.16.0', mandatory=True)
+ if not conf.env['HAVE_GTKMM']:
+ conf.check_pkg('gtkmm-2.4', destvar='GTKMM', vnum='2.11.12', mandatory=True)
+ if not conf.env['HAVE_RAUL']:
+ conf.check_pkg('raul', destvar='RAUL', vnum='0.5.1', mandatory=True)
+
+ # Use Jack D-Bus unless --no-jack-dbus (only one jack driver is allowed)
+ conf.env['HAVE_JACK_DBUS'] = conf.env['HAVE_DBUS'] and not Params.g_options.no_jack_dbus
+ if conf.env['HAVE_JACK_DBUS']:
+ conf.define('HAVE_JACK_DBUS', True)
+ elif not conf.env['HAVE_JACK']:
+ conf.check_pkg('jack', destvar='JACK', vnum='0.107.0', mandatory=False)
+ conf.define('USE_LIBJACK', conf.env['HAVE_JACK'])
+
+ # Use Alsa if present unless --no-alsa
+ if not Params.g_options.no_alsa and not conf.env['HAVE_ALSA']:
+ conf.check_pkg('alsa', destvar='ALSA', mandatory=False)
+
+ # Use LASH if we have DBUS unless --no-lash
+ if not Params.g_options.no_lash and conf.env['HAVE_DBUS_GLIB']:
+ conf.env['HAVE_LASH'] = True
+ conf.define('HAVE_LASH', True)
+ else:
+ conf.env['HAVE_LASH'] = False
+
+ conf.check_tool('misc') # subst tool
+
+ # Boost headers (e.g. libboost-dev)
+ conf.check_header('boost/shared_ptr.hpp', mandatory=True)
+ conf.check_header('boost/weak_ptr.hpp', mandatory=True)
+
+ conf.env['PATCHAGE_VERSION'] = PATCHAGE_VERSION
+ conf.env.append_value('CCFLAGS', '-DCONFIG_H_PATH=\\\"waf-config.h\\\"')
+ conf.env.append_value('CXXFLAGS', '-DCONFIG_H_PATH=\\\"waf-config.h\\\"')
+
+ conf.env['APP_INSTALL_NAME'] = Params.g_options.app_install_name
+ conf.env['APP_HUMAN_NAME'] = Params.g_options.app_human_name
+ conf.define('DATA_DIR', os.path.normpath(
+ conf.env['PREFIX'] + '/share/' + conf.env['APP_INSTALL_NAME']))
+
+ conf.write_config_header('waf-config.h')
+
+ print
+ display_msg("Install prefix", conf.env['PREFIX'], 'CYAN')
+ display_msg("Install name", "'" + conf.env['APP_INSTALL_NAME'] + "'", 'CYAN')
+ display_msg("App human name", "'" + conf.env['APP_HUMAN_NAME'] + "'", 'CYAN')
+ display_msg("Jack (D-Bus)", str(bool(conf.env['HAVE_JACK_DBUS'])), 'YELLOW')
+ display_msg("LASH (D-Bus)", str(bool(conf.env['HAVE_LASH'])), 'YELLOW')
+ display_msg("Jack (libjack)", str(bool(conf.env['USE_LIBJACK'])), 'YELLOW')
+ display_msg("Alsa Sequencer", str(bool(conf.env['HAVE_ALSA'])), 'YELLOW')
+ print
def build(bld):
- prog = bld.create_obj('cpp', 'program')
- prog.defines = [
- 'CONFIG_H_PATH=\\"config.h\\"',
- ]
- prog.source = [
- 'src/main.cpp',
- 'src/Patchage.cpp',
- 'src/PatchageCanvas.cpp',
- 'src/StateManager.cpp',
- 'src/JackDriver.cpp',
- 'src/JackDbusDriver.cpp',
- 'src/LashClient.cpp',
- 'src/LashProxy.cpp',
- 'src/Project.cpp',
- 'src/ProjectList.cpp',
- 'src/ProjectPropertiesDialog.cpp',
- 'src/Session.cpp'
- ]
- prog.includes = 'src' # make waf dependency tracking work
- prog.target = bld.env()['APP_INSTALL_NAME']
- prog.uselib = 'DBUS-1 LIBGNOMECANVASMM-2.6 LIBGLADEMM-2.4 FLOWCANVAS DBUS-GLIB-1'
-
- # Installation layout (with /usr prefix)
- # /usr/bin/patchage
- # /usr/share/applications/patchage.desktop
- # /usr/share/icons/hicolor/16x16/apps/patchage.png
- # /usr/share/icons/hicolor/22x22/apps/patchage.png
- # /usr/share/icons/hicolor/24x24/apps/patchage.png
- # /usr/share/icons/hicolor/32x32/apps/patchage.png
- # /usr/share/icons/hicolor/48x48/apps/patchage.png
- # /usr/share/icons/hicolor/scalable/apps/patchage.svg
- # /usr/share/patchage/patchage.glade
- #
- # icon cache is updated using:
- # gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
-
- install_files('PREFIX', '/share/' + bld.env()['APP_INSTALL_NAME'], 'src/patchage.glade')
-
- # process patchage.desktop.in -> patchage.desktop
- #install_files('PREFIX', '/share/applications/', 'patchage.desktop')
- obj = bld.create_obj('subst')
- obj.source = 'patchage.desktop.in'
- obj.target = 'patchage.desktop'
- obj.dict = {
- 'BINDIR': bld.env()['PREFIX'] + '/bin',
- 'APP_INSTALL_NAME': bld.env()['APP_INSTALL_NAME'],
- 'APP_HUMAN_NAME': bld.env()['APP_HUMAN_NAME'],
+ # Program
+ prog = bld.create_obj('cpp', 'program')
+ prog.includes = 'src' # make waf dependency tracking work
+ prog.target = bld.env()['APP_INSTALL_NAME']
+ prog.uselib = 'DBUS FLOWCANVAS GLADEMM DBUS_GLIB GNOMECANVASMM GTHREAD RAUL'
+ prog.source = '''
+ src/LashClient.cpp
+ src/Patchage.cpp
+ src/PatchageCanvas.cpp
+ src/PatchageEvent.cpp
+ src/StateManager.cpp
+ src/main.cpp
+ '''
+ if bld.env()['HAVE_JACK_DBUS']:
+ prog.source += '''
+ src/JackDbusDriver.cpp
+ '''
+ if bld.env()['HAVE_LASH']:
+ prog.source += '''
+ src/LashProxy.cpp
+ src/LoadProjectDialog.cpp
+ src/Project.cpp
+ src/ProjectList.cpp
+ src/ProjectPropertiesDialog.cpp
+ src/Session.cpp
+ '''
+ if bld.env()['HAVE_LASH'] or bld.env()['HAVE_JACK_DBUS']:
+ prog.source += ' src/DBus.cpp '
+ if bld.env()['USE_LIBJACK']:
+ prog.source += ' src/JackDriver.cpp '
+ prog.uselib += ' JACK '
+ if bld.env()['HAVE_ALSA']:
+ prog.source += ' src/AlsaDriver.cpp '
+ prog.uselib += ' ALSA '
+
+ # Glade UI definitions (XML)
+ install_files('PREFIX', '/share/' + bld.env()['APP_INSTALL_NAME'], 'src/patchage.glade')
+
+ # 'Desktop' file (menu entry, icon, etc)
+ obj = bld.create_obj('subst')
+ obj.source = 'patchage.desktop.in'
+ obj.target = 'patchage.desktop'
+ obj.dict = {
+ 'BINDIR' : bld.env()['PREFIX'] + '/bin',
+ 'APP_INSTALL_NAME' : bld.env()['APP_INSTALL_NAME'],
+ 'APP_HUMAN_NAME' : bld.env()['APP_HUMAN_NAME'],
}
- #obj.inst_var = os.path.normpath(bld.env()['PREFIX'] + '/share/applications/')
- #obj.inst_dir = '/'
- install_as(os.path.normpath(bld.env()['PREFIX'] + '/share/applications/'), bld.env()['APP_INSTALL_NAME'] + '.desktop', 'build/default/patchage.desktop')
-
- install_as(os.path.normpath(bld.env()['PREFIX'] + '/share/icons/hicolor/scalable/apps/'), bld.env()['APP_INSTALL_NAME'] + '.svg', 'icons/scalable/patchage.svg')
-
- icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48']
- for icon_size in icon_sizes:
- install_as(os.path.normpath(bld.env()['PREFIX'] + '/share/icons/hicolor/' + icon_size + '/apps/'), bld.env()['APP_INSTALL_NAME'] + '.png', 'icons/' + icon_size + '/patchage.png')
+ obj.inst_var = 'PREFIX'
+ obj.inst_dir = '/share/applications'
+
+ # Icons
+ #
+ # Installation layout (with /usr prefix)
+ # /usr/bin/patchage
+ # /usr/share/applications/patchage.desktop
+ # /usr/share/icons/hicolor/16x16/apps/patchage.png
+ # /usr/share/icons/hicolor/22x22/apps/patchage.png
+ # /usr/share/icons/hicolor/24x24/apps/patchage.png
+ # /usr/share/icons/hicolor/32x32/apps/patchage.png
+ # /usr/share/icons/hicolor/48x48/apps/patchage.png
+ # /usr/share/icons/hicolor/scalable/apps/patchage.svg
+ # /usr/share/patchage/patchage.glade
+ #
+ # icon cache is updated using:
+ # gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
+ icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48']
+ for s in icon_sizes:
+ install_as(
+ os.path.normpath(bld.env()['PREFIX'] + '/share/icons/hicolor/' + s + '/apps/'),
+ bld.env()['APP_INSTALL_NAME'] + '.png',
+ 'icons/' + s + '/patchage.png')
- # TODO: ask some packagers for best policy about updating icon cache here
- # gtk-update-icon-cache -f -t $(datadir)/icons/hicolor