updated on Sun Jan 15 16:02:00 UTC 2012
[aur-mirror.git] / csound / PKGBUILD
blobeff31e353958c46343d3795ffa047691e168db20
1 # Maintainer : Arch Linux Pro Audio <dev@archaudio.org>
2 # Contributor: SpepS <dreamspepser at yahoo dot it>
3 # Contributor: Bernardo Barros <bernardobarros@gmail.com>
5 pkgname=csound
6 pkgver=5.15.0
7 pkgrel=3
8 pkgdesc="A programming language for sound rendering and signal processing."
9 arch=(i686 x86_64)
10 url="http://csound.sourceforge.net/"
11 license=('GPL')
12 depends=('fltk' 'fluidsynth' 'liblo' 'portaudio' 'portmidi' 'tk')
13 makedepends=('scons' 'swig' "java-environment>=6" 'dssi' 'boost' 'pd' 'lua')
14 optdepends=('qutecsound: qt frontend'
15             'cecilia: tcl/tk frontend'
16             'cecilia4: wxpython frontend'
17             'vim: vim frontend'
18             'java-environment: java wrapper'
19             'lua: lua wrapper'
20             'python2: python wrapper')
21 provides=('csound5')
22 conflicts=('csound5')
23 source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}5/${pkgname}${pkgver%.*}/Csound${pkgver}.tar.gz"
24         "$pkgname.sh" "http://ccrma.stanford.edu/software/stk/release/stk-4.4.2.tar.gz") # needed by stk opcodes
25 md5sums=('c035606c63bf1c950a5ade16f338b100'
26          '71df553af0ba829df857c583a5938783'
27          '0b7bd1f913ca01fb8b2201ebcf853358')
28 _csopts="useDouble=1 usePortAudio=1 usePortMIDI=1 useALSA=1 useJack=1 useFLTK=1
29          noFLTKThreads=1 pythonVersion=2.7 buildCsoundVST=0 buildCsoundAC=1
30          buildCsound5GUI=1 generateTags=0 generatePdf=0 useOSC=1 bufferoverflowu=0
31          useUDP=1 buildPythonOpcodes=1 buildLuaOpcodes=1 prefix=/usr instdir="$pkgdir/"
32          buildRelease=1 noDebug=1 gcc3opt=0 gcc4opt=native useLrint=0 useGprof=0
33          Word64=1 Lib64=0 dynamicCsoundLibrary=1 buildStkOpcodes=1 install=0
34          buildPDClass=1 useCoreAudio=0 useAltivec=0 buildDSSI=1 buildUtilities=1
35          buildTclcsound=1 buildWinsound=0 buildVirtual=1 buildInterfaces=1
36          buildLuaWrapper=1 buildPythonWrapper=1 buildJavaWrapper=1 withICL=0
37          withMSVC=0 withSunStudio=0 buildNewParser=1 NewParserDebug=0 buildMultiCore=1
38          buildvst4cs=0 useGettext=1 buildImageOpcodes=1 useOpenMP=0 tclversion=8.5
39          includeWii=0 includeP5Glove=0 buildBeats=1 buildcatalog=1 includeSerial=1"
41 build() {
42   cd "$srcdir/Csound$pkgver"
44   # fix pd install path, remove uninstaller and ldconfig call
45   sed -e "s|/usr/local/lib|$pkgdir/usr/lib|" \
46       -e "/create/,/^print ''/d" \
47       -e "/getuid/,/ldconfig/d" \
48       -i install.py
50   # add custom java include path, remove fltk include path
51   sed -e '/\(usr\/\)\(include\)\/fltk-1.1/s//\1lib\/jvm\/java-6-openjdk\/\2/p;/6/s//7/p;' \
52       -e '/openjdk\/include/s//&\/linux/p;/7/s//6/' custom.py.mkg > custom.py
54   # add build optimization and java include path fixes, fix lua link
55   sed -e "s_mtune_march_g" \
56       -e "s|lua51|lua|g" \
57       -i SConstruct
59   # place stk sources for the stk opcodes
60   cp -a "$srcdir"/stk-4.4.2/{include,rawwaves,src} Opcodes/stk
62   scons $_csopts
65 package() {
66   cd "$srcdir/Csound$pkgver"
68   python2 install.py --vimdir="/usr/share/vim/vimfiles" \
69                      --instdir="$pkgdir" \
70                      --prefix="/usr"
72   # link libraries
73   ln -s /usr/lib/libcsound64.so "$pkgdir/usr/lib/libcsound.so"
74   ln -s /usr/lib/libcsound64.so "$pkgdir/usr/lib/libcsound.so.5.2"
76   # lua bindings
77   install -d "$pkgdir/usr/lib/lua/5.1"
78   install -Dm 755 luaC{snd,soundAC}.so "$pkgdir/usr/lib/lua/5.1"
79   ln -s /usr/lib/lua/5.1/luaCsnd.so "$pkgdir/usr/lib/luaCsnd.so"
81   # python CsoundAC bindings
82   install -D _CsoundAC.so CsoundAC.py "$pkgdir/usr/lib/python2.7/site-packages"
84   # examples
85   install -d "$pkgdir/usr/share/$pkgname"
86   cp -a examples "$pkgdir/usr/share/$pkgname"
87   cp -a samples "$pkgdir/usr/share/$pkgname"
89   # export vars in profile.d
90   install -Dm755 ../$pkgname.sh "$pkgdir/etc/profile.d/$pkgname.sh"
92   # python2 fix
93   sed -i "s/^\#\!.*python/&2/" `grep -rl "\#\!.*python" "$pkgdir"`
96 # vim:set ts=2 sw=2 et: