Commit 0ef358cc authored by nedko's avatar nedko
Browse files

waf: installation of jack.pc

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2476 0c269be4-1314-0410-8aa9-9f06e86f4224
parent aeef5fb3
#! /usr/bin/env python
# encoding: utf-8
import re
import os
# by default waf subst tool uses @VAR@ while scons legacy is ${VAR}
# so we use same template as scons for now
def subst_func(tsk):
"Substitutes variables in a .in file"
m4_re = re.compile('\$\{(\w+)\}', re.M)
env = tsk.env()
infile = tsk.m_inputs[0].abspath(env)
outfile = tsk.m_outputs[0].abspath(env)
file = open(infile, 'r')
code = file.read()
file.close()
s = m4_re.sub(r'%(\1)s', code)
dict = tsk.dict
if not dict:
names = m4_re.findall(code)
for i in names:
if env[i] and type(env[i]) is types.ListType :
dict[i] = " ".join(env[i])
else: dict[i] = env[i]
file = open(outfile, 'w')
file.write(s % dict)
file.close()
return 0
def build(bld):
common_libsources = [
'JackActivationCount.cpp',
......@@ -88,3 +122,17 @@ def build(bld):
netmanager_lib.source = 'JackNetManager.cpp'
install_files('PREFIX', 'jack', 'jack/*.h')
# process jack.pc.in -> jack.pc
obj = bld.create_obj('subst')
obj.source = '../jack.pc.in'
obj.target = 'jack.pc'
obj.dict = {'PREFIX': bld.env()['PREFIX'],
'LIBDIR': os.path.normpath(bld.env()['PREFIX'] + '/lib'),
'INCLUDEDIR': os.path.normpath(bld.env()['PREFIX'] + '/include'),
'SERVERLIB': serverlib.target,
'JACK_VERSION': bld.env()['JACK_VERSION'],
}
obj.inst_var = bld.env()['PREFIX']
obj.inst_dir = '/lib/pkgconfig/'
obj.fun = subst_func # @VAR@ -> ${VAR}
......@@ -58,6 +58,7 @@ def configure(conf):
conf.env['LIB_DL'] = ['dl']
conf.env['LIB_RT'] = ['rt']
conf.env['JACK_API_VERSION'] = JACK_API_VERSION
conf.env['JACK_VERSION'] = VERSION
conf.define('ADDON_DIR', os.path.normpath(conf.env['PREFIX'] + '/lib/jack'))
conf.define('JACK_LOCATION', os.path.normpath(conf.env['PREFIX'] + '/bin'))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment