Changeset 1493

Show
Ignore:
Timestamp:
11/30/08 14:53:26 (15 years ago)
Author:
arnonym
Message:

Try to install a service-file for dbus if possible. This allows for dbus to start the ffado-dbus-server automaticly when someone wants to connect to org.ffado.Control.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/admin/pkgconfig.py

    r864 r1493  
    8484        return ret 
    8585 
     86# 
     87# Checks for the existance of the package and returns the value of the specified variable. 
     88# 
     89def GetPKGVariable( context, name, variable ): 
     90        import os 
     91 
     92        context.Message( "Checking for variable %s in package %s... \t" % (variable,name) ) 
     93 
     94        ret = context.TryAction( "pkg-config --exists '%s'" % name )[0] 
     95        if not ret: 
     96                context.Result( ret ) 
     97                return ret 
     98 
     99        out = os.popen2( "pkg-config --variable=%s %s" % (variable,name) )[1] 
     100        ret = out.read() 
     101 
     102        context.Result( True ) 
     103        return ret 
     104 
    86105def generate( env, **kw ): 
    87         env['PKGCONFIG_TESTS' ] = { 'CheckForPKGConfig' : CheckForPKGConfig, 'CheckForPKG' : CheckForPKG, 'GetPKGFlags' : GetPKGFlags
     106        env['PKGCONFIG_TESTS' ] = { 'CheckForPKGConfig' : CheckForPKGConfig, 'CheckForPKG' : CheckForPKG, 'GetPKGFlags' : GetPKGFlags, 'GetPKGVariable' : GetPKGVariable
    88107 
    89108def exists( env ): 
  • trunk/libffado/SConstruct

    r1491 r1493  
    4040else: 
    4141        build_base='' 
    42  
    43 destdir = ARGUMENTS.get( 'DESTDIR', "" ) 
    4442 
    4543if not os.path.isdir( "cache" ): 
     
    314312env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, '1.0.0' ) 
    315313 
     314# 
     315# Get the directory where dbus stores the service-files 
     316# 
     317env['dbus_service_dir'] = conf.GetPKGVariable( 'dbus-1', 'session_bus_services_dir' ).strip() 
    316318 
    317319config_guess = conf.ConfigGuess() 
     
    365367 
    366368# 
     369# Get the DESTDIR (if wanted) from the commandline 
     370# 
     371env.destdir = ARGUMENTS.get( 'DESTDIR', "" ) 
     372 
     373# 
    367374# Uppercase variables are for usage in code, lowercase versions for usage in 
    368375# scons-files for installing. 
     
    372379env['INCLUDEDIR'] = Template( env['INCLUDEDIR'] ).safe_substitute( env ) 
    373380env['SHAREDIR'] = Template( env['SHAREDIR'] ).safe_substitute( env ) 
    374 env['bindir'] = Template( destdir + env['BINDIR'] ).safe_substitute( env ) 
    375 env['libdir'] = Template( destdir + env['LIBDIR'] ).safe_substitute( env ) 
    376 env['includedir'] = Template( destdir + env['INCLUDEDIR'] ).safe_substitute( env ) 
    377 env['sharedir'] = Template( destdir + env['SHAREDIR'] ).safe_substitute( env ) 
     381env['bindir'] = Template( env.destdir + env['BINDIR'] ).safe_substitute( env ) 
     382env['libdir'] = Template( env.destdir + env['LIBDIR'] ).safe_substitute( env ) 
     383env['includedir'] = Template( env.destdir + env['INCLUDEDIR'] ).safe_substitute( env ) 
     384env['sharedir'] = Template( env.destdir + env['SHAREDIR'] ).safe_substitute( env ) 
    378385 
    379386env.Command( target=env['sharedir'], source="", action=Mkdir( env['sharedir'] ) ) 
     
    577584# their own :-/ 
    578585# 
    579 if len(destdir) > 0: 
     586if len(env.destdir) > 0: 
    580587        if not len( ARGUMENTS.get( "WILL_DEAL_WITH_XDG_MYSELF", "" ) ) > 0: 
    581588                print """ 
  • trunk/libffado/support/dbus/SConscript

    r1185 r1493  
     1#!/bin/env python 
    12# 
    23# Copyright (C) 2007-2008 Arnold Krille 
     
    2122# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
    2223# 
     24 
     25import os 
    2326 
    2427Import( 'env' ) 
     
    6467        env.Install( "$bindir", app ) 
    6568 
     69if env['dbus_service_dir'] and ( env.destdir or os.access( env['dbus_service_dir'], os.W_OK ) ): 
     70    print "Will install the service-file" 
     71    servicefile = env.ScanReplace('org.ffado.Control.service.in') 
     72    targetdir = env.destdir + env['dbus_service_dir'] 
     73    env.Alias( "install", env.Install( env.destdir + env['dbus_service_dir'], servicefile ) ) 
     74 
    6675# static versions 
    6776if static_env['BUILD_STATIC_TOOLS']: 
     
    7079        static_app = app + "-static" 
    7180        static_env.Program( target=static_app, source = static_env.Split( apps[app] ) ) 
     81 
     82# vim: et