| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
def set_systemd_user_unit_dir(conf): |
| 6 |
""" |
| 7 |
Adding systemd's user unit dir (by using pkg-config) to the configuration. |
| 8 |
""" |
| 9 |
systemd_user_unit_dir = conf.check_cfg( |
| 10 |
package='systemd', |
| 11 |
args='--variable=systemduserunitdir', |
| 12 |
okmsg='Successfully detected systemd user unit dir.', |
| 13 |
errormsg='Could not detect systemd user unit dir. Skipping...') |
| 14 |
if not systemd_user_unit_dir: |
| 15 |
conf.env['SYSTEMD_USER_UNIT_DIR'] = None |
| 16 |
else: |
| 17 |
conf.env['SYSTEMD_USER_UNIT_DIR'] = \ |
| 18 |
systemd_user_unit_dir.replace("\n", "") |
| 19 |
|
| 20 |
|
| 21 |
def configure(conf): |
| 22 |
set_systemd_user_unit_dir(conf) |
| 23 |
conf.env['JACK_USER_UNIT_CONFIG_DIR'] = '/etc/jack' |
| 24 |
|
| 25 |
|
| 26 |
def build(bld): |
| 27 |
if bld.env['SYSTEMD_USER_UNIT_DIR']: |
| 28 |
bld.install_files( |
| 29 |
bld.env['JACK_USER_UNIT_CONFIG_DIR'], |
| 30 |
bld.path.ant_glob('*.conf')) |
| 31 |
bld( |
| 32 |
features='subst', |
| 33 |
source='[email protected]', |
| 34 |
target='[email protected]', |
| 35 |
install_path=bld.env.SYSTEMD_USER_UNIT_DIR, |
| 36 |
PREFIX=bld.env.PREFIX) |