initial revision (not working)
[pkgsrc-supercollider.git] / patches / patch-SConstruct
1 $NetBSD$
2
3 --- SConstruct.orig     2009-06-17 18:50:19.000000000 +0000
4 +++ SConstruct
5 @@ -62,7 +62,7 @@ if PLATFORM == 'darwin':
6      PLUGIN_EXT = '.scx'
7      DEFAULT_AUDIO_API = 'coreaudio'
8      DEFAULT_PREFIX = '/usr/local'
9 -elif PLATFORM == 'freebsd':
10 +elif PLATFORM == 'freebsd' or PLATFORM == 'netbsd':
11      PLATFORM_SYMBOL = 'SC_FREEBSD'
12      PLUGIN_EXT = '.so'
13      DEFAULT_AUDIO_API = 'jack'
14 @@ -289,7 +289,7 @@ opts.AddOptions(
15      BoolOption('DEBUG',
16                 'Build with debugging information', 0),
17      PathOption('DESTDIR',
18 -               'Intermediate installation prefix for packaging', '/'),
19 +               'Intermediate installation prefix for packaging', '/', PathOption.PathIsDirCreate),
20      BoolOption('DEVELOPMENT',
21                 'Build and install the development files', 0),
22      BoolOption('FFTW',
23 @@ -741,7 +741,7 @@ libscsynthEnv = serverEnv.Clone(
24  # platform specific
25  
26  # functionality of libdl is included in libc on freebsd
27 -if PLATFORM == 'freebsd':
28 +if PLATFORM == 'freebsd' or PLATFORM == 'netbsd':
29      serverEnv.Append(LIBS = ['common', 'pthread'])
30  else:
31      serverEnv.Append(LIBS = ['common', 'pthread', 'dl'])
32 @@ -751,7 +751,7 @@ if PLATFORM == 'darwin':
33                  LINKFLAGS = [
34                      '-framework', 'CoreServices'])
35                      #'-dylib_install_name', FINAL_PREFIX + '/lib/libsclang.dylib'])
36 -elif PLATFORM == 'linux':
37 +elif PLATFORM == 'linux' or PLATFORM == 'netbsd':
38      serverEnv.Append(
39                  CPPDEFINES = [('SC_PLUGIN_LOAD_SYM', '\\"load\\"')],
40                  LINKFLAGS = '-Wl,-rpath,' + FINAL_PREFIX + '/lib')
41 @@ -808,7 +808,7 @@ libscsynthStaticSources = libscsynthSour
42  libscsynthStatic = serverEnv.StaticLibrary('build/scsynth', libscsynthStaticSources)
43  env.Alias('install-programs', env.Install(lib_dir(INSTALL_PREFIX), [libscsynthStatic]))
44  
45 -scsynth = serverEnv.Program('build/scsynth', scsynthSources, LIBS = ['scsynth'])
46 +scsynth = serverEnv.Program('build/scsynth', scsynthSources, LIBS = ['scsynth'] + serverEnv['LIBS'])
47  env.Alias('install-programs', env.Install(bin_dir(INSTALL_PREFIX), [scsynth]))
48  
49  # ======================================================================
50 @@ -834,7 +834,7 @@ pluginEnv.Append(
51  if PLATFORM == 'darwin':
52      pluginEnv['SHLINKFLAGS'] = '$LINKFLAGS -bundle -flat_namespace -undefined suppress'
53  
54 -if PLATFORM == 'freebsd':
55 +if PLATFORM == 'freebsd' or PLATFORM == 'netbsd':
56      merge_lib_info(
57          pluginEnv,
58          libraries['sndfile'])
59 @@ -972,7 +972,7 @@ if env.has_key('amd64') and env['amd64']
60         langEnv.Append( CXXFLAGS = ['-m32'] )
61  
62  # functionality of libdl is included in libc on freebsd
63 -if PLATFORM == 'freebsd':
64 +if PLATFORM == 'freebsd' or PLATFORM == 'netbsd':
65      langEnv.Append(LIBS = ['common', 'scsynth', 'pthread', 'm'])
66  else:
67      langEnv.Append(LIBS = ['common', 'scsynth', 'pthread', 'dl',  'm'])
68 @@ -985,7 +985,7 @@ if PLATFORM == 'darwin':
69  elif PLATFORM == 'linux':
70      langEnv.Append(
71          LINKFLAGS = '-Wl,-rpath,build -Wl,-rpath,' + FINAL_PREFIX + '/lib')
72 -elif PLATFORM == 'freebsd':
73 +elif PLATFORM == 'freebsd' or PLATFORM == 'netbsd':
74      langEnv.Append(
75      LINKFLAGS = '-Wl,-rpath,build -Wl,-rpath,' + FINAL_PREFIX + '/lib')
76  
77 @@ -1038,6 +1038,7 @@ Source/lang/LangPrimSource/PyrSched.cpp
78  Source/lang/LangPrimSource/PyrPrimitive.cpp
79  Source/lang/LangPrimSource/PyrMathPrim.cpp
80  Source/lang/LangPrimSource/SC_ComPort.cpp
81 +Source/lang/LangPrimSource/SC_HID.cpp
82  Source/lang/LangPrimSource/OSCData.cpp
83  Source/lang/LangPrimSource/PyrArchiver.cpp
84  Source/lang/LangPrimSource/PyrArrayPrimitives.cpp
85 @@ -1071,7 +1072,6 @@ if PLATFORM == 'darwin':
86                  LINKFLAGS = '-framework Carbon -framework IOKit -framework IOBluetooth'
87          )
88      libsclangSources += Split('''
89 -Source/lang/LangPrimSource/SC_HID.cpp
90  Source/lang/LangPrimSource/SC_CoreAudioPrim.cpp
91  Source/lang/LangPrimSource/HID_Utilities/HID_Error_Handler.c
92  Source/lang/LangPrimSource/HID_Utilities/HID_Name_Lookup.c
93 @@ -1099,10 +1099,7 @@ sclangSources = ['Source/lang/LangSource
94  if env['LANG']:
95      libsclang = langEnv.SharedLibrary('build/sclang', libsclangSources)
96      env.Alias('install-bin', env.Install(lib_dir(INSTALL_PREFIX), [libsclang]))
97 -    if PLATFORM == 'darwin':
98 -        sclangLibs = ['scsynth', 'sclang']
99 -    else:
100 -        sclangLibs = ['sclang']
101 +    sclangLibs = ['scsynth', 'sclang'] + langEnv['LIBS']
102      sclang = langEnv.Program('build/sclang', sclangSources, LIBS=sclangLibs)
103      env.Alias('install-programs', env.Install(bin_dir(INSTALL_PREFIX), [sclang]))
104