Various compilation scripts & patches for Linux programs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

257 lines
8.9 KiB

  1. # Maintainer: Daniel Bermond < yahoo-com: danielbermond >
  2. pkgname=wine-staging-git
  3. pkgver=2.3.r1.g3b947eae+wine.2.3.r0.ga2460b2424
  4. pkgrel=1
  5. pkgdesc="A compatibility layer for running Windows programs (staging branch, Git version)"
  6. arch=('i686' 'x86_64')
  7. url="https://github.com/wine-compholio/wine-staging/"
  8. license=('LGPL')
  9. _depends=(
  10. 'attr' 'lib32-attr'
  11. 'fontconfig' 'lib32-fontconfig'
  12. 'lcms2' 'lib32-lcms2'
  13. 'libxml2' 'lib32-libxml2'
  14. 'libxcursor' 'lib32-libxcursor'
  15. 'libxrandr' 'lib32-libxrandr'
  16. 'libxdamage' 'lib32-libxdamage'
  17. 'libxi' 'lib32-libxi'
  18. 'gettext' 'lib32-gettext'
  19. 'freetype2' 'lib32-freetype2'
  20. 'glu' 'lib32-glu'
  21. 'libsm' 'lib32-libsm'
  22. 'gcc-libs' 'lib32-gcc-libs'
  23. 'libpcap' 'lib32-libpcap'
  24. 'desktop-file-utils'
  25. )
  26. makedepends=('git' 'autoconf' 'ncurses' 'bison' 'perl' 'fontforge' 'flex'
  27. 'gcc>=4.5.0-2' 'gcc-multilib>=4.5.0-2'
  28. 'giflib' 'lib32-giflib'
  29. 'libpng' 'lib32-libpng'
  30. 'gnutls' 'lib32-gnutls'
  31. 'libxinerama' 'lib32-libxinerama'
  32. 'libxcomposite' 'lib32-libxcomposite'
  33. 'libxmu' 'lib32-libxmu'
  34. 'libxxf86vm' 'lib32-libxxf86vm'
  35. 'libldap' 'lib32-libldap'
  36. 'mpg123' 'lib32-mpg123'
  37. 'openal' 'lib32-openal'
  38. 'v4l-utils' 'lib32-v4l-utils'
  39. 'alsa-lib' 'lib32-alsa-lib'
  40. 'libxcomposite' 'lib32-libxcomposite'
  41. 'mesa' 'lib32-mesa'
  42. 'libgl' 'lib32-libgl'
  43. 'opencl-icd-loader' 'lib32-opencl-icd-loader'
  44. 'libxslt' 'lib32-libxslt'
  45. 'libpulse' 'lib32-libpulse'
  46. 'libva' 'lib32-libva'
  47. 'gst-plugins-base-libs' 'lib32-gst-plugins-base-libs'
  48. 'samba'
  49. 'opencl-headers'
  50. )
  51. optdepends=(
  52. 'giflib' 'lib32-giflib'
  53. 'libpng' 'lib32-libpng'
  54. 'libldap' 'lib32-libldap'
  55. 'gnutls' 'lib32-gnutls'
  56. 'mpg123' 'lib32-mpg123'
  57. 'openal' 'lib32-openal'
  58. 'v4l-utils' 'lib32-v4l-utils'
  59. 'libpulse' 'lib32-libpulse'
  60. 'alsa-plugins' 'lib32-alsa-plugins'
  61. 'alsa-lib' 'lib32-alsa-lib'
  62. 'libjpeg-turbo' 'lib32-libjpeg-turbo'
  63. 'libxcomposite' 'lib32-libxcomposite'
  64. 'libxinerama' 'lib32-libxinerama'
  65. 'ncurses' 'lib32-ncurses'
  66. 'opencl-icd-loader' 'lib32-opencl-icd-loader'
  67. 'libxslt' 'lib32-libxslt'
  68. 'libtxc_dxtn' 'lib32-libtxc_dxtn'
  69. 'libva' 'lib32-libva'
  70. 'gtk3' 'lib32-gtk3'
  71. 'gst-plugins-base-libs' 'lib32-gst-plugins-base-libs'
  72. 'vulkan-icd-loader' 'lib32-vulkan-icd-loader'
  73. 'cups'
  74. 'samba'
  75. 'dosbox'
  76. )
  77. options=('staticlibs')
  78. source=(wine-git::'git://source.winehq.org/git/wine.git'
  79. "$pkgname"::'git+https://github.com/wine-compholio/wine-staging.git'
  80. #'bleed-patches.tar.gz'
  81. '30-win32-aliases.conf'
  82. custompatch_default-documents-dir.patch
  83. custompatch_glsl_shader.patch
  84. custompatch_msi-add-dummyactionthreads.patch
  85. custompatch_photoshop_getticks_input.c.patch
  86. custompatch_photoshop_keepfocus_message.c.patch
  87. custompatch_photoshop_tooltip_win.c.patch
  88. custompatch_steam.patch
  89. custompatch_disable_automatic_menubuilding.patch
  90. )
  91. sha256sums=('SKIP'
  92. 'SKIP'
  93. '9901a5ee619f24662b241672a7358364617227937d5f6d3126f70528ee5111e7'
  94. '0bd6ae866253e446fc631b080e90dc0a500274e62175f9298277256e7c8eae8e'
  95. 'ca0dbe562eb43e4049c06f12b9352cb732ef14137c7da3d8fb71d9872c81aa60'
  96. '05b21e50c3942acfbedd274dfe4ee454f64cb03ada3a00e46f1d23bead06ff39'
  97. 'e934579174bc3f4d05f72fb02e6b4ec081e97f375f1965541465e83a8bc77cfe'
  98. '7f379b5fc985c8c87531c02ebd120b52b0f8801fbbb3dcd2a958f6550696c22f'
  99. 'bbbb3ab76dc1769d1e0a5253964aaf20e9db0eef6e02f2094df7c9fca3a870bc'
  100. '972d6b114f7621c5f3bd34b1105dd390b318db18fbc76328001c984db488a9b0'
  101. '11ddb9d6a4e1fd12f5e92d66458cc44aecfcc789efd04c1ed15d1f9b14c0efad')
  102. if [ "$CARCH" = "i686" ]; then
  103. # Strip lib32 etc. on i686
  104. _depends=(${_depends[@]/*32-*/})
  105. makedepends=(${makedepends[@]/*32-*/} ${_depends[@]})
  106. makedepends=(${makedepends[@]/*-multilib*/})
  107. optdepends=(${optdepends[@]/*32-*/})
  108. provides=(
  109. "wine=$(echo ${pkgver} | grep -o '+.*' | cut -c7-)"
  110. "wine-staging=$(echo ${pkgver} | grep -o '.*+' | sed 's/.\{1\}$//')"
  111. 'wine-git'
  112. )
  113. conflicts=('wine' 'wine-staging' 'wine-git')
  114. else
  115. makedepends=(${makedepends[@]} ${_depends[@]})
  116. provides=(
  117. "wine=$(echo ${pkgver} | grep -o '+.*' | cut -c7-)"
  118. "wine-wow64=$(echo ${pkgver} | grep -o '+.*' | cut -c7-)"
  119. "wine-staging=$(echo ${pkgver} | grep -o '.*+' | sed 's/.\{1\}$//')"
  120. 'wine-git'
  121. )
  122. conflicts=('wine' 'wine-wow64' 'wine-staging' 'wine-git')
  123. fi
  124. pkgver() {
  125. cd "${srcdir}/${pkgname}"
  126. _staging_tag="$(git tag | sort -r | head -n1 | sed 's/-/./g;s/^v//')"
  127. _staging_version="$(git describe --long \
  128. | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//' \
  129. | sed "s/^latest.release/${_staging_tag}/")"
  130. cd "${srcdir}/wine-git"
  131. _wine_version="$(git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g')"
  132. printf "%s+%s" "$_staging_version" "$_wine_version"
  133. }
  134. prepare() {
  135. cd "$srcdir"/wine-git
  136. msg2 "Cleaning the wine source code tree..."
  137. # Restore the wine tree to its git origin state, without wine-staging patches
  138. #+(necessary for reapllying wine-staging patches in succedent builds,
  139. #+otherwise the patches will fail to be reapplied)
  140. git reset --hard HEAD # Restore tracked files
  141. git clean -d -x -f # Delete untracked files
  142. # Change back to the wine upstream commit that this version of wine-staging is based in
  143. git checkout $(../"$pkgname"/patches/patchinstall.sh --upstream-commit)
  144. }
  145. build() {
  146. msg2 "Applying custom patches..."
  147. mv $srcdir/custompatch_disable_automatic_menubuilding.patch $srcdir/custompatch_disable_automatic_menubuilding.patch.disabled #Just a hack, because this fails with Wine-Staging for now
  148. cd "${srcdir}"/wine-git
  149. for i in $srcdir/*.patch
  150. do
  151. patch -Np1 < $i
  152. done
  153. cd "${srcdir}"
  154. # Delete old build dirs (from previous builds) and make new ones
  155. rm --recursive --force "$pkgname"-{32,64}-build
  156. mkdir --parents "$pkgname"-32-build
  157. # Apply all wine-staging patches
  158. msg2 "Applying wine-staging patches..."
  159. ./"$pkgname"/patches/patchinstall.sh DESTDIR="${srcdir}/wine-git" --all
  160. # We must apply this patch AFTER all Wine Staging patches, otherwise it fails
  161. cd "${srcdir}"/wine-git
  162. mv $srcdir/custompatch_disable_automatic_menubuilding.patch.disabled $srcdir/custompatch_disable_automatic_menubuilding.patch
  163. patch -Np1 -i $srcdir/custompatch_disable_automatic_menubuilding.patch
  164. cd "${srcdir}"
  165. # Build wine 64-bit
  166. #+(according to the wine wiki this 64-bit/32-bit building order is mandatory)
  167. if [ "$CARCH" = "x86_64" ]; then
  168. msg2 "Building Wine-64..."
  169. mkdir --parents "$pkgname"-64-build
  170. cd "$pkgname"-64-build
  171. ../wine-git/configure \
  172. --prefix=/usr \
  173. --libdir=/usr/lib \
  174. --with-x \
  175. --with-gstreamer \
  176. --enable-win64 \
  177. --with-xattr
  178. make
  179. _wine32opts=(
  180. --libdir=/usr/lib32
  181. )
  182. # --with-wine64="${srcdir}/${pkgname}-64-build"
  183. export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
  184. fi
  185. # Build wine 32-bit
  186. msg2 "Building Wine-32..."
  187. cd "$srcdir"/"$pkgname"-32-build
  188. ../wine-git/configure \
  189. --prefix=/usr \
  190. --with-x \
  191. --with-gstreamer \
  192. --with-xattr \
  193. "${_wine32opts[@]}"
  194. make
  195. }
  196. package() {
  197. depends=(${_depends[@]})
  198. # Package wine 32-bit
  199. #+(according to the wine wiki this reverse 32-bit/64-bit packaging order is important)
  200. msg2 "Packaging Wine-32..."
  201. cd "$srcdir"/"$pkgname"-32-build
  202. make prefix="${pkgdir}/usr32" \
  203. libdir="${pkgdir}/usr32/lib" \
  204. dlldir="${pkgdir}/usr32/lib/wine" install
  205. # Package wine 64-bit
  206. msg2 "Packaging Wine-64..."
  207. cd "$srcdir"/"$pkgname"-64-build
  208. make prefix="${pkgdir}/usr64" \
  209. libdir="${pkgdir}/usr64/lib64" \
  210. dlldir="${pkgdir}/usr64/lib64/wine" install
  211. mkdir -p $pkgdir/usr32/lib64
  212. cp -R $pkgdir/usr64/share/{wine,applications} $pkgdir/usr32/share
  213. # Font aliasing settings for Win32 applications
  214. install -d "$pkgdir"/etc/fonts/conf.{avail,d}
  215. install -m644 "${srcdir}/30-win32-aliases.conf" "${pkgdir}/etc/fonts/conf.avail"
  216. ln -s ../conf.avail/30-win32-aliases.conf "${pkgdir}/etc/fonts/conf.d/30-win32-aliases.conf"
  217. }