prepare standalone VST scanner tool.. part one

This commit is contained in:
Robin Gareus 2014-02-25 05:37:55 +01:00
parent 1c402f943f
commit 993ed56701
5 changed files with 138 additions and 1 deletions

View File

@ -237,7 +237,7 @@ vstfx_write_info_file (FILE* fp, vector<VSTInfo *> *infos)
* plugins contained in this shell
*/
vstfx_write_info_block(fp, *x);
fprintf( fp, "%d\n", infos->size() - 1 );
fprintf( fp, "%d\n", (int)infos->size() - 1 );
++x;
/* Now write out the info for each plugin */
for (; x != infos->end(); ++x) {

59
libs/fst/scanner.cc Normal file
View File

@ -0,0 +1,59 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include "ardour/filesystem_paths.h"
#include "ardour/linux_vst_support.h"
#include "ardour/vst_info_file.h"
/* make stupid waf happy.
* waf cannot build multiple variants of .o object files from the same
* source using different wscripts.. it mingles e.g.
* build/libs/ardour/vst_info_file.cc.1.o for
* both lib/ardour/wscript and lib/fst/wscript
*
* ...but waf does track include dependencies.
*/
#include "../ardour/vst_info_file.cc"
#include "../ardour/linux_vst_support.cc"
#include "../ardour/filesystem_paths.cc"
#include "../ardour/directory_names.cc"
#include "../pbd/error.cc"
#include "../pbd/basename.cc"
#include "../pbd/search_path.cc"
#include "../pbd/transmitter.cc"
#include "../pbd/whitespace.cc"
#ifdef LXVST_SUPPORT
void
vstfx_destroy_editor (VSTState* /*vstfx*/) { }
#endif
int main (int argc, char **argv) {
if (argc != 2) {
fprintf(stderr, "usage: %s <vst>\n", argv[0]);
return EXIT_FAILURE;
}
char *dllpath = argv[1];
std::vector<VSTInfo *> *infos;
#ifdef LXVST_SUPPORT
if (strstr (dllpath, ".so" ) == 0) {
infos = vstfx_get_info_lx(dllpath);
}
#endif
#ifdef WINDOWS_VST_SUPPORT
if (strstr (dllpath, ".dll" ) == 0) {
infos = vstfx_get_info_fst(dllpath);
}
#endif
if (infos->empty()) {
return EXIT_FAILURE;
} else {
return EXIT_SUCCESS;
}
}

2
libs/fst/scanner.wine Normal file
View File

@ -0,0 +1,2 @@
#/bin/sh
exec wine "`dirname "$0"`/ardour-@VERSION@-vst-scanner.exe.so" "$@"

75
libs/fst/wscript Normal file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env python
from waflib.extras import autowaf as autowaf
from waflib import Options, TaskGen
import waflib.Logs as Logs, waflib.Utils as Utils
import os
import shutil
import sys
import re
import time
from waflib.Task import Task
# Mandatory variables
top = '.'
out = 'build'
scanner_app_src = [
'scanner.cc',
]
# needed for code used from libardour
I18N_PACKAGE = 'ardour3'
def options(opt):
autowaf.set_options(opt)
def configure(conf):
conf.load('misc')
conf.load('compiler_cxx')
autowaf.configure(conf)
# Add a waf `feature' to allow compilation of things using winegcc
from waflib.TaskGen import feature
@feature("wine")
def set_winegcc(self):
self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
self.env.CC = 'winegcc'
def build(bld):
VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
if not (bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT')):
return
if bld.is_defined('WINDOWS_VST_SUPPORT') and bld.env['build_target'] != 'mingw':
# wine exec wrapper script
obj = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
obj.source = 'scanner.wine'
obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner'
obj.chmod = Utils.O755
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.dict = {
'VERSION' : bld.env['VERSION'],
}
obj = bld (features = 'c cxx cxxprogram wine')
obj.source = (
'scanner.cc',
'fst.c',
'vstwin.c',
)
obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner.exe.so'
obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
else:
obj = bld (features = 'cxx c cxxprogram')
obj.source = ( 'scanner.cc' )
obj.target = 'ardour-' + bld.env['VERSION'] + '-vst-scanner'
obj.includes = [ '../pbd/', '../ardour/', '.' ]
obj.defines = [
'_POSIX_SOURCE',
'USE_WS_PREFIX',
'VST_SCANNER_APP',
'PACKAGE="' + I18N_PACKAGE + '"',
]
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.uselib = ['GIOMM', 'DL']

View File

@ -74,6 +74,7 @@ children = [
'mcp',
'patchfiles',
'headless',
'libs/fst',
]
i18n_children = [