Guest User

PKGBUILD

a guest
Feb 27th, 2025
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. # Maintainer: David Runge <[email protected]>
  2.  
  3. pkgbase=yabridge
  4. pkgname=(
  5. yabridge
  6. yabridgectl
  7. )
  8. # NOTE: currently only compatible with vst3sdk 3.7.7: https://github.com/robbert-vdh/yabridge/issues/312
  9. _vst3sdk_commit=3ff02a8fb91f8e14f61c4e26130841b51d601575 # refs/tags/v3.7.7_build_19-patched
  10. _bundled_vst3sdk=1 # whether to use bundled vst3sdk (1) or not (0)
  11. pkgver=5.1.1.r7.gca534308
  12. pkgrel=1
  13. pkgdesc="A modern and transparent way to use Windows VST2 and VST3 plugins on Linux"
  14. arch=(x86_64)
  15. url="https://github.com/robbert-vdh/yabridge"
  16. license=(GPL-3.0-or-later)
  17. makedepends=(
  18. asio
  19. bitsery
  20. clap
  21. cmake
  22. function2
  23. ghc-filesystem
  24. git
  25. lib32-libxcb
  26. libxcb
  27. meson
  28. rust
  29. tomlplusplus
  30. vst3sdk
  31. wine
  32. )
  33. # if LTO is enabled the cmake detection will explode because of wine
  34. options=(!lto)
  35. source=(
  36. git+$url
  37. $pkgbase-vst3sdk::git+https://github.com/robbert-vdh/vst3sdk.git#commit=$_vst3sdk_commit
  38. $pkgbase-vst3_base::git+https://github.com/steinbergmedia/vst3_base.git
  39. $pkgbase-vst3_pluginterfaces::git+https://github.com/steinbergmedia/vst3_pluginterfaces.git
  40. $pkgbase-vst3_public_sdk::git+https://github.com/steinbergmedia/vst3_public_sdk.git
  41. "405.patch"
  42. )
  43. sha512sums=('SKIP'
  44. '39d8b7188aa5b07442e9bf998644bce5d54e3c30000dbf3922cee76c4864e859ff850abe6699d178399948d3d73f3b4a639738429320aa2ebc4b1e0c85d63792'
  45. 'SKIP'
  46. 'SKIP'
  47. 'SKIP'
  48. 'SKIP')
  49. b2sums=('SKIP'
  50. '3f09ff6929db53a5387661be68a363726edbd966346605444191e791565cf596503e9f88138b7921d15366d1aa1688a41730e3d4163bdc694448269855d982a9'
  51. 'SKIP'
  52. 'SKIP'
  53. 'SKIP'
  54. 'SKIP')
  55.  
  56. pkgver() {
  57. cd "$pkgbase"
  58. git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
  59. }
  60.  
  61.  
  62. prepare() {
  63. echo "Patching with pull 405"
  64. patch -d $pkgbase -Np1 -i ../405.patch
  65. echo "Done patching pull 405"
  66.  
  67. # remove version pinning
  68. sed -e "s/'==/'>=/" -i $pkgbase/meson.build
  69. # remove version pinning for clap
  70. sed -e "s/, '<1.2'//" -i $pkgbase/meson.build
  71. # remove all wraps as they are ignored anyways
  72. rm -rv $pkgbase/subprojects/*
  73. # add a subproject dir for vst3sdk
  74. mkdir -vp $pkgbase/subprojects/vst3
  75.  
  76. if (( _bundled_vst3sdk > 0 )); then
  77. # use upstream's specific version of vst3sdk to get around compilation errors
  78. (
  79. cd $pkgbase-vst3sdk
  80. git submodule init
  81. git config submodule.base.url "$srcdir/$pkgbase-vst3_base"
  82. git config submodule.pluginterfaces.url "$srcdir/$pkgbase-vst3_pluginterfaces"
  83. git config submodule.publik.sdk.url "$srcdir/$pkgbase-vst3_public_sdk"
  84. git -c protocol.file.allow=always submodule update
  85. )
  86. # build using bundled vst3sdk
  87. cp -av $pkgbase-vst3sdk/* $pkgbase/subprojects/vst3/
  88. else
  89. # put system-installed vst3sdk in place and add upstream meson.build file
  90. cp -av /usr/src/vst3sdk/* $pkgbase/subprojects/vst3/
  91. cp -v $pkgbase-vst3sdk/meson.build $pkgbase/subprojects/vst3/meson.build
  92. fi
  93.  
  94. cd $pkgbase/tools/yabridgectl
  95. cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
  96.  
  97.  
  98. }
  99.  
  100. build() {
  101. # NOTE: we need to add -mwindows to cpp_link_args as we are otherwise overriding it
  102. local meson_options=(
  103. --cross-file=$pkgname/cross-wine.conf
  104. -D bitbridge=true
  105. -D system-asio=true
  106. -D b_lto=false
  107. -D b_pie=false
  108. -D build.cpp_link_args="$LDFLAGS"
  109. -D cpp_link_args="$LDFLAGS -mwindows"
  110. )
  111.  
  112. arch-meson $pkgbase build "${meson_options[@]}"
  113. ninja -C build
  114.  
  115. cd $pkgname/tools/yabridgectl
  116. cargo build --frozen --release --all-features
  117. }
  118.  
  119. package_yabridge() {
  120. groups=(pro-audio)
  121. depends=(
  122. gcc-libs
  123. glibc
  124. lib32-gcc-libs
  125. lib32-glibc
  126. lib32-libxcb
  127. libxcb
  128. sh
  129. wine
  130. )
  131. optdepends=(
  132. 'libnotify: for notification integration'
  133. 'yabridgectl: for optional setup and management utility'
  134. )
  135.  
  136. # project has no install target
  137. install -vDm 755 build/$pkgname-host{,-32}.exe{,.so} -t "$pkgdir/usr/bin"
  138. install -vDm 755 build/lib$pkgname-{,chainloader-}{clap,vst2,vst3}.so -t "$pkgdir/usr/lib/"
  139. }
  140.  
  141. package_yabridgectl() {
  142. depends=(
  143. gcc-libs
  144. glibc
  145. )
  146. pkgdesc="Optional utility to help set up and manage yabridge"
  147.  
  148. install -vDm 755 $pkgbase/tools/$pkgname/target/release/$pkgname -t "$pkgdir/usr/bin"
  149. }
Advertisement
Add Comment
Please, Sign In to add comment