upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / csound / trunk / PKGBUILD
blob4fd2685f39fe25a8615d7937bf350563ec3ca229
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Maintainer: Brett Cornwall <ainola@archlinux.org>
3 # Contributor: speps
4 # Contributor: Bernardo Barros
6 pkgbase=csound
7 pkgname=(csound csound-doc)
8 pkgver=6.18.1
9 _manual_pkgver=6.17.0
10 pkgrel=3
11 pkgdesc="Programming language for sound rendering and signal processing"
12 arch=(x86_64)
13 url="https://csound.com"
14 license=(LGPL2.1)
15 # libpd needs to be packaged: https://github.com/libpd/libpd/releases
16 # gmm > 5.1 breaks linear-algebra opcode: https://github.com/csound/csound/issues/920
17 makedepends=(
18   alsa-lib
19   cmake
20   doxygen
21   dssi
22   fluidsynth
23   hdf5
24   jack
25   java-environment
26   ladspa
27   libmusicxml
28   libsamplerate
29   libsndfile
30   libwebsockets
31   llvm
32   lua
33   openssl
34   portaudio
35   portmidi
36   portsmf
37   python
38   stk
39   strip-nondeterminism
40   swig
41   wiiuse
43 checkdepends=(cunit)
44 source=(
45   https://github.com/$pkgbase/$pkgbase/archive/$pkgver/$pkgname-$pkgver.tar.gz
46   $pkgbase.sh
47   https://github.com/$pkgbase/$pkgbase/releases/download/$_manual_pkgver/Csound${_manual_pkgver}_manual_html.zip
48   https://github.com/$pkgbase/$pkgbase/releases/download/$_manual_pkgver/Csound${_manual_pkgver}_manual_pdf.zip
50 sha512sums=('4ea4dccb36017c96482389a8d139f6f55c79c5ceb9cc34e6d2bfabcb930b4833d0301be4a4b21929db27b2d8ce30754b5c5867acd2ea5a849135e1b8d1506acf'
51             '53a8ae1e61db2a3a492930ef0f0881b613ae47108c5e8de0a6e2aa28bcf7a5c93c7fea8b7fc2bbae29ab92e1e68bf94ba406be1255ad8ab5725ea9078c1fd6dc'
52             'ff2098828e51e78aa80b10736ea162d90c0b1bef3265e469951a5df63250d283e852490cb2a6599dcb1b8a5c185cf4f0b9534f501e4cb755b9da67ecfb1f4ba6'
53             'bf664bab1dec073b48853ccf7519086c55ad74af33db86ac7f95746231c18fb10d46a485047788050094e412d27bbd0df65e238d31b01b435989f2fd734189a6')
54 b2sums=('1b258724dd986eea63921e36b43235eb05702729ee31e40ef724f7e7644755adeb5a3abdca9188d65296882d5f532693c0f9fc742ee5d39ccc7fbed860ec0bf4'
55         '8a556685d0f9ee55c4de521b3d76fc729936e98e991e8ea860d64b29a1b09d142ab0a51548b2dddadb41ecb796e84ba1f8ed114494b4c67d7d6d8ab3475b2ede'
56         '3148a60a398d49d6932864d84b2ee37ddf86d5389b91c99443b2c64f7c3b270d040b83ac88b80ebc772c198223682452da1618391fcc8963fe63151b7837037e'
57         'c0210f2fb97a6707ae6cd0a0cf38cd374f4d4c973b188ee8d418a7efd5c98dc1d4e61867de021ed2859bd8264cc0876b46deb565c358b6efea42f471d39671a9')
59 prepare() {
60   # fix file permissions in html manual
61   find html/ -type f -exec chmod -c 644 {} \;
64 build() {
65   local _java_major=$(java --version 2>/dev/null |grep 'openjdk'| cut -d ' ' -f2| cut -d '.' -f1)
66   local cmake_options=(
67     -B build
68     -D CMAKE_INSTALL_PREFIX=/usr
69     -D CMAKE_BUILD_TYPE=None
70     # it's not allowed to redistribute the scansyn opcodes: https://github.com/csound/csound/issues/1148
71     -D BUILD_SCANSYN_OPCODES=OFF
72     -D JAVA_AWT_LIBRARY="/usr/lib/jvm/java-${_java_major}-openjdk/jre/lib/libawt.so"
73     -D JAVA_JVM_LIBRARY="/usr/lib/jvm/java-${_java_major}-openjdk/jre/lib"
74     -D LUA_LIBRARY=/usr/lib/liblua.so
75     -D BUILD_STATIC_LIBRARY=ON
76     -S $pkgbase-$pkgver
77     -W no-dev
78   )
80   cmake "${cmake_options[@]}"
81   cmake --build build --verbose
82   # For reproducibility (See https://bugs.archlinux.org/task/70331)
83   find build -name '*.jar' -exec strip-nondeterminism {} +
86 check() {
87   ctest --test-dir build --output-on-failure
90 package_csound() {
91   groups=(
92     pro-audio
93   )
94   depends=(
95     curl libcurl.so
96     gcc-libs
97     glibc
98     libsamplerate libsamplerate.so
99     libsndfile libsndfile.so
100   )
101   optdepends=(
102     'alsa-lib: for librtalsa plugin'
103     'csound-doc: for the canonical Csound Reference Manual'
104     'csound-plugins: for additional opcodes'
105     'csoundqt: for frontend/ editor with integrated help'
106     'hdf5: for hdf5ops plugin'
107     'java-runtime: java integration'
108     'fluidsynth: for libfluidOpcodes plugin'
109     'jack: for libjacko, librtjack and libjackTransport plugins'
110     'liblo: for libosc plugin'
111     'ncurses: for libfaustcsound plugin'
112     'portmidi: for libpmidi plugin'
113     'portaudio: for librtpa plugin'
114     'libpulse: for librtpulse plugin'
115     'stk: for libstkops plugin'
116     'libwebsockets: for libwebsocketIO plugin'
117     'wiiuse: for libwiimote plugin'
118     'libx11: for libwidgets plugin'
119     'lua: for LUA integration'
120     'openssl: for libfaustcsound plugin'
121     'python-numpy: For Csound Python bindings'
122     'vim-csound: vim integration'
123     'zlib: for libfaustcsound plugin'
124   )
125   provides=(
126     libcsound64.so
127     libcsnd6.so
128   )
130   DESTDIR="$pkgdir" cmake --install build
132   # export vars in profile.d
133   install -vDm 755 "$srcdir/$pkgname.sh" -t "$pkgdir/etc/profile.d/"
134   # rename extract executable due to name conflict with libextractor
135   # https://github.com/csound/csound/issues/985
136   mv -v "$pkgdir/usr/bin/extract" "$pkgdir/usr/bin/$pkgname-extract"
137   # moving csnd6.jar to /usr/share/java
138   install -vdm 755 "$pkgdir/usr/share/java/"
139   mv -v "$pkgdir/usr/lib/"*.jar "$pkgdir/usr/share/java/"
142 package_csound-doc() {
143   pkgdesc+=" - documentation"
145   install -vDm 644 Csound${_manual_pkgver}_manual.pdf "$pkgdir/usr/share/doc/$pkgname/$pkgbase-manual.pdf"
147   install -dv "$pkgdir/usr/share/doc/$pkgname/html"
148   cp -av html/* "$pkgdir/usr/share/doc/$pkgname/html/"
150 # vim:set ts=2 sw=2 et: