summaryrefslogtreecommitdiff
path: root/vst/SConscript
blob: 988a386de337315d02cb9ed8197ab10a762fd658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# -*- python -*-

import os
import os.path
import glob

from stat import *

Import('env install_prefix final_prefix config_prefix subst_dict libraries')

ardour_vst = env.Copy()

sources = Split ("""
winmain.c
#libs/fst/fst.o
#libs/fst/fstinfofile.o
#libs/fst/vstwin.o
#libs/fst/vsti.o
"""
)

ardour_vst.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst", LIBPATH='#gtk2_ardour', LIBS="ardourgtk")
ardour_vst.Append (LINKFLAGS='-L/usr/X11R6/lib -lasound -lX11 -lpthread') 
ardour_vst["CC"] ="winegcc"
ardour_vst["LINK"] ="wineg++ -mwindows"

ardour_vst.Merge ([
    libraries['ardour'],
    libraries['ardour_cp'],
    libraries['gtkmm2ext'],
    libraries['midi++2'],
    libraries['pbd'],
    libraries['gtkmm2'],
    libraries['glib2'],
    libraries['libgnomecanvas2'],
    libraries['libgnomecanvasmm'],
    libraries['sysmidi'],
    libraries['sndfile'],
    libraries['flac'],
    libraries['lrdf'],
    libraries['glibmm2'],
    libraries['pangomm'],
    libraries['atkmm'],
    libraries['gdkmm2'],
    libraries['sigc2'],
    libraries['gtk2'],
    libraries['xml'],
    libraries['xslt'],
    libraries['soundtouch'],
    libraries['samplerate'],
    libraries['jack']
])

#
# run winegcc to build a mini-win32 executable that wine can run. note: this also
# generates a script called 'ardour_vst' which we don't use
#

wine_generated_executable = ardour_vst.Program (target = 'ardour_vst', source = sources)

#
# generate a shell script that will run the .exe file correctly
# 

wine_executable = ardour_vst.SubstInFile ('ardourvst', 'ardourvst.in', SUBST_DICT = subst_dict)

# make sure the scripts are executable

if ardour_vst['VST']:
    ardour_vst.AddPostAction (wine_executable, ardour_vst.Action (Chmod ('vst/ardevst', 0755)))
    ardour_vst.AddPostAction (wine_executable, ardour_vst.Action (Chmod (wine_executable, 0755)))
    Default([wine_generated_executable, wine_executable])
    
    # the wine script - into the bin dir
    env.Alias('install', env.Install(os.path.join(install_prefix, 'bin'), wine_executable))
    # the win32 executable - into the lib dir since the wine script will look for it there
    env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), 'ardour_vst.exe.so'))

env.Alias ('tarball', env.Distribute (env['DISTTREE'],
                                      [ 'SConscript',
                                        'winmain.c',
                                        'ardourvst.in',
                                        'ardevst'
                                        ]))