summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9a158e91f3612ab02e22368fe465fda9b837d7d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Maintainer: Mike Swanson <mikeonthecomputer@gmail.com>

# Warning: If you are downgrading from the development branch (Wine ≥ 4.1,
# for example), your WINEPREFIX may break and experience unusual bugs.
# Try to make a clean WINEPREFIX, such as by doing “rm -rf ~/.wine”

pkgname=wine-stable
pkgver=4.0.2
pkgrel=1

source=(https://dl.winehq.org/wine/source/4.0/wine-$pkgver.tar.xz{,.sign}
        30-win32-aliases.conf
        wine-binfmt.conf)
sha512sums=('14cb7eeba188562b73125c668f2020e1df6802e486552e422d3aa75b95f6fccedc0f87868f7e58ce71697941ff49757981ec93b9ef288da37ca8570658f194fc'
            'SKIP'
            '6e54ece7ec7022b3c9d94ad64bdf1017338da16c618966e8baf398e6f18f80f7b0576edf1d1da47ed77b96d577e4cbb2bb0156b0b11c183a0accf22654b0a2bb'
            'bdde7ae015d8a98ba55e84b86dc05aca1d4f8de85be7e4bd6187054bfe4ac83b5a20538945b63fb073caab78022141e9545685e4e3698c97ff173cf30859e285')
validpgpkeys=(DA23579A74D4AD9AF9D3F945CEFAC8EAAF17519D)

pkgdesc="A compatibility layer for running Windows programs"
url="http://www.winehq.com"
arch=(x86_64)
options=(staticlibs)
license=(LGPL)
install=wine.install

depends=(desktop-file-utils fontconfig freetype2 gettext glu lcms2
  libpcap libsm libxcursor libxdamage libxi libxml2 libxrandr
  lib32-fontconfig lib32-freetype2 lib32-gcc-libs lib32-gettext
  lib32-glu lib32-lcms2 lib32-libpcap lib32-libsm lib32-libxcursor
  lib32-libxdamage lib32-libxi lib32-libxml2 lib32-libxrandr)

makedepends=(alsa-lib fontforge giflib gnutls gsm
  gst-plugins-base-libs libgl libgphoto2 libldap libpng libpulse
  libxcomposite libxinerama libxmu libxslt libxxf86vm mesa mpg123
  ncurses ocl-icd openal opencl-headers samba sane sdl2 v4l-utils
  vkd3d vulkan-headers vulkan-icd-loader lib32-alsa-lib lib32-giflib
  lib32-gnutls lib32-gst-plugins-base-libs lib32-libgl lib32-libldap
  lib32-libpng lib32-libpulse lib32-libxcomposite lib32-libxinerama
  lib32-libxmu lib32-libxslt lib32-libxxf86vm lib32-mesa lib32-mpg123
  lib32-ncurses lib32-ocl-icd lib32-openal lib32-sdl2 lib32-v4l-utils
  lib32-vkd3d lib32-vulkan-icd-loader)

optdepends=(alsa-lib alsa-plugins cups dosbox giflib gnutls gsm
  gst-plugins-base-libs libgphoto2 libjpeg-turbo libldap libpng
  libpulse libxcomposite libxinerama libxslt mpg123 ncurses ocl-icd
  openal samba sane sdl2 v4l-utils vkd3d vulkan-icd-loader
  lib32-alsa-lib lib32-alsa-plugins lib32-giflib lib32-gnutls
  lib32-gst-plugins-base-libs lib32-libjpeg-turbo lib32-libldap
  lib32-libpng lib32-libpulse lib32-libxcomposite lib32-libxinerama
  lib32-libxslt lib32-mpg123 lib32-ncurses lib32-ocl-icd lib32-openal
  lib32-sdl2 lib32-v4l-utils lib32-vkd3d lib32-vulkan-icd-loader)

provides=("wine=$pkgver")
conflicts=("wine")

prepare() {
  # Allow ccache to work
  mv wine-$pkgver wine

  for patch in *.patch; do
    if [ ! -f "$patch" ]; then
      break;
    else
      patch -d wine -p1 -i "../$patch"
    fi
  done

  # https://bugs.winehq.org/show_bug.cgi?id=43530
  export CFLAGS="${CFLAGS/-fno-plt/}"
  export LDFLAGS="${LDFLAGS/,-z,now/}"

  sed 's|OpenCL/opencl.h|CL/opencl.h|g' -i wine/configure*

  # Get rid of old build dirs
  rm -rf wine-{32,64}-build
  mkdir wine-{32,64}-build
}

build() {
  cd "$srcdir/wine-64-build"
  ../wine/configure \
      --prefix=/usr \
      --libdir=/usr/lib \
      --with-x \
      --with-gstreamer \
      --enable-win64

  make

  _wine32opts=(
    --libdir=/usr/lib32
    --with-wine64="$srcdir/wine-64-build"
  )

  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"

  cd "$srcdir/wine-32-build"
  ../wine/configure \
      --prefix=/usr \
      --with-x \
      --with-gstreamer \
      "${_wine32opts[@]}"

  make
}

package() {
  cd "$srcdir/wine-32-build"

  make STRIP=true prefix="$pkgdir/usr" \
       libdir="$pkgdir/usr/lib32" \
       dlldir="$pkgdir/usr/lib32/wine" install

  cd "$srcdir/wine-64-build"
  make STRIP=true prefix="$pkgdir/usr" \
       libdir="$pkgdir/usr/lib" \
       dlldir="$pkgdir/usr/lib/wine" install

  # Font aliasing settings for Win32 applications
  install -d "$pkgdir"/etc/fonts/conf.{avail,d}
  install -m644 "$srcdir/30-win32-aliases.conf" "$pkgdir/etc/fonts/conf.avail"
  ln -s ../conf.avail/30-win32-aliases.conf \
     "$pkgdir/etc/fonts/conf.d/30-win32-aliases.conf"
  install -Dm644 "$srcdir/wine-binfmt.conf" \
	  "$pkgdir/usr/lib/binfmt.d/wine.conf"
}