Don't link against VAmp plugins.
[ardour.git] / wscript
1 #!/usr/bin/env python
2 import autowaf
3 import os
4 import commands
5
6 # Variables for 'waf dist'
7 VERSION = '3.0pre0'
8 APPNAME = 'ardour'
9
10 # Mandatory variables
11 srcdir = '.'
12 blddir = 'build'
13
14 children = [
15         'libs/pbd',
16         'libs/midi++2',
17         'libs/evoral',
18         'libs/vamp-sdk',
19         'libs/vamp-plugins',
20         'libs/taglib',
21         'libs/rubberband',
22         'libs/surfaces',
23         'libs/ardour',
24         'libs/gtkmm2ext',
25         'gtk2_ardour'
26 ]
27
28
29 # Version stuff
30
31 def fetch_svn_revision (path):
32         cmd = "LANG= svn info " + path + " | awk '/^Revision:/ { print $2}'"
33         return commands.getoutput(cmd)
34
35 def fetch_git_revision (path):
36         cmd = "LANG= git log --abbrev HEAD^..HEAD " + path
37         output = commands.getoutput(cmd).splitlines()
38         rev = output[0].replace ("commit", "git")[0:10]
39         for line in output:
40                 try:
41                         if "git-svn-id" in line:
42                                 line = line.split('@')[1].split(' ')
43                                 rev = line[0]
44                 except:
45                         pass
46         return rev
47
48 def create_stored_revision():
49         rev = ""
50         if os.path.exists('.svn'):
51                 rev = fetch_svn_revision('.');
52         elif os.path.exists('.git'):
53                 rev = fetch_git_revision('.');
54         elif os.path.exists('libs/ardour/svn_revision.cc'):
55                 print "Using packaged svn revision"
56                 return
57         else:
58                 print "Missing libs/ardour/svn_revision.cc.  Blame the packager."
59                 sys.exit(-1)
60
61         try:
62                 text =  '#include <ardour/svn_revision.h>\n'
63                 text += 'namespace ARDOUR { extern const char* svn_revision = \"' + rev + '\"; }\n'
64                 print 'Writing svn revision info to libs/ardour/svn_revision.cc\n'
65                 o = file('libs/ardour/svn_revision.cc', 'w')
66                 o.write(text)
67                 o.close()
68         except IOError:
69                 print 'Could not open libs/ardour/svn_revision.cc for writing\n'
70                 sys.exit(-1)
71
72
73 # Waf stages
74
75 def set_options(opt):
76         autowaf.set_options(opt)
77         for i in children:
78                 opt.sub_options(i)
79
80 def sub_config_and_use(conf, name, has_objects = True):
81         conf.sub_config(name)
82         autowaf.set_local_lib(conf, name, has_objects)
83
84 def configure(conf):
85         create_stored_revision()
86         autowaf.set_recursive()
87         autowaf.configure(conf)
88         autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
89         autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0')
90         for i in children:
91                 sub_config_and_use(conf, i)
92
93 def build(bld):
94         autowaf.set_recursive()
95         for i in children:
96                 bld.add_subdirs(i)
97
98 def shutdown():
99         autowaf.shutdown()
100