summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dd764404107548f4eece49ea1076a2549fc14632 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Maintainer: Mike Swanson <mikeonthecomputer@gmail.com>

# Warning: If you are downgrading from the development branch (Wine ≥ 8.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-next
_pkgver=9.0-rc3
pkgver=${_pkgver/-/}  # Useful for wine-stable-next
pkgrel=1

source=(https://dl.winehq.org/wine/source/9.0/wine-$_pkgver.tar.xz{,.sign}
        30-win32-aliases.conf
        wine-binfmt.conf)
b2sums=('383161672da80e41bc1004fbcaa5318fe2b2b601bcc58861608ca0735e70836572be25e2a805753c80f9f88106947eadf136b9b8252bfb1b505c82103bf1f345'
        'SKIP'
        '45db34fb35a679dc191b4119603eba37b8008326bd4f7d6bd422fbbb2a74b675bdbc9f0cc6995ed0c564cf088b7ecd9fbe2d06d42ff8a4464828f3c4f188075b'
        'e9de76a32493c601ab32bde28a2c8f8aded12978057159dd9bf35eefbf82f2389a4d5e30170218956101331cf3e7452ae82ad0db6aad623651b0cc2174a61588')
validpgpkeys=(DA23579A74D4AD9AF9D3F945CEFAC8EAAF17519D)

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

depends=(
  desktop-file-utils
  fontconfig             lib32-fontconfig
  freetype2              lib32-freetype2
  gcc-libs               lib32-gcc-libs
  gettext                lib32-gettext
  libpcap                lib32-libpcap
  libunwind              lib32-libunwind
  libxcursor             lib32-libxcursor
  libxi                  lib32-libxi
  libxrandr              lib32-libxrandr
  wayland                lib32-wayland
)

makedepends=(
  alsa-lib               lib32-alsa-lib
  gnutls                 lib32-gnutls
  gst-plugins-base-libs  lib32-gst-plugins-base-libs
  libcups                lib32-libcups
  libgphoto2             lib32-libgphoto2
  libpulse               lib32-libpulse
  libxcomposite          lib32-libxcomposite
  libxinerama            lib32-libxinerama
  libxxf86vm             lib32-libxxf86vm
  mesa                   lib32-mesa
  mingw-w64-gcc
  ocl-icd                lib32-ocl-icd
  opencl-headers
  pcsclite               lib32-pcsclite
  perl
  samba
  sane
  sdl2                   lib32-sdl2
  unixodbc               lib32-unixodbc
  v4l-utils              lib32-v4l-utils
  vulkan-headers
  vulkan-icd-loader      lib32-vulkan-icd-loader
)

optdepends=(
  alsa-lib               lib32-alsa-lib
  alsa-plugins           lib32-alsa-plugins
  cups
  dosbox
  gnutls                 lib32-gnutls
  gst-plugins-bad        lib32-gst-plugins-bad
  gst-plugins-base       lib32-gst-plugins-base
  gst-plugins-base-libs  lib32-gst-plugins-base-libs
  gst-plugins-good       lib32-gst-plugins-good
  gst-plugins-ugly       lib32-gst-plugins-ugly
  libgphoto2             lib32-libgphoto2
  libpulse               lib32-libpulse
  libxcomposite          lib32-libxcomposite
  libxinerama            lib32-libxinerama
  ocl-icd                lib32-ocl-icd
  pcsclite               lib32-pcsclite
  samba
  sane
  sdl2                   lib32-sdl2
  unixodbc               lib32-unixodbc
  v4l-utils              lib32-v4l-utils
  vulkan-icd-loader      lib32-vulkan-icd-loader
  wine-gecko
  wine-mono
)

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

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

build() {
  cd "$srcdir/wine-64-build"

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

  ../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/share/wine/binfmt/wine.conf"
}