PKGBUILD 4.04 KB
Newer Older
Giuseppe's avatar
Giuseppe committed
1
pkgname=wine
2
pkgver=4.4
Jeff Huang's avatar
Jeff Huang committed
3 4
pkgrel=1
_pkgver=${pkgver/rc/-rc}
5
source=(https://dl.winehq.org/wine/source/4.x/$pkgname-$_pkgver.tar.xz
Jeff Huang's avatar
Jeff Huang committed
6
        30-win32-aliases.conf)
Giuseppe's avatar
Giuseppe committed
7

8
md5sums=('caebe069d821f57499f8b5f6025a2250'
Jeff Huang's avatar
Jeff Huang committed
9
         '1ff4e467f59409272088d92173a0f801')
Giuseppe's avatar
Giuseppe committed
10
pkgdesc="A compatibility layer for running Windows programs"
Jeff Huang's avatar
Jeff Huang committed
11
url="https://www.winehq.org/"
12
categories=('system')
Jeff Huang's avatar
Jeff Huang committed
13 14
arch=('x86_64')
license=('LGPL')
Giuseppe's avatar
Giuseppe committed
15 16 17
install=wine.install

depends=(
Giuseppe's avatar
Giuseppe committed
18
  fontconfig            lib32-fontconfig
Jeff Huang's avatar
Jeff Huang committed
19 20
  lcms2			lib32-lcms2
  libxml2		lib32-libxml2
Giuseppe's avatar
Giuseppe committed
21 22 23 24 25
  libxcursor            lib32-libxcursor
  libxrandr             lib32-libxrandr
  libxdamage            lib32-libxdamage
  libxi                 lib32-libxi
  gettext               lib32-gettext
Xuetian Weng's avatar
Xuetian Weng committed
26 27 28 29
  freetype2             lib32-freetype2
  glu                   lib32-glu
  libsm                 lib32-libsm
  gcc-libs              lib32-gcc-libs
30
  desktop-file-utils
Giuseppe's avatar
Giuseppe committed
31 32
)

Jeff Huang's avatar
Jeff Huang committed
33
makedepends=(autoconf ncurses bison perl fontforge flex
Giuseppe's avatar
Giuseppe committed
34 35
  giflib         lib32-giflib
  libpng         lib32-libpng
Xuetian Weng's avatar
Xuetian Weng committed
36
  gnutls         lib32-gnutls
Giuseppe's avatar
Giuseppe committed
37 38 39 40 41 42 43 44 45
  libxinerama    lib32-libxinerama
  libxcomposite  lib32-libxcomposite
  libxmu         lib32-libxmu
  libxxf86vm     lib32-libxxf86vm
  libldap        lib32-libldap
  mpg123         lib32-mpg123
  openal         lib32-openal
  v4l-utils      lib32-v4l-utils
  alsa-lib       lib32-alsa-lib
Xuetian Weng's avatar
Xuetian Weng committed
46
  libpulse        lib32-libpulse
Xuetian Weng's avatar
Xuetian Weng committed
47 48 49 50 51
  mesa            lib32-mesa
  mesa-libgl      lib32-mesa-libgl
  libcl           lib32-libcl
  libxslt        lib32-libxslt
  jack           lib32-jack
52
  samba
Jeff Huang's avatar
Jeff Huang committed
53
  gst-plugins-base-libs lib32-gst-plugins-base-libs
54
  opencl-headers
Giuseppe's avatar
Giuseppe committed
55
)
Neophytos's avatar
Neophytos committed
56

Giuseppe's avatar
Giuseppe committed
57
optdepends=(
Xuetian Weng's avatar
Xuetian Weng committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
  giflib          lib32-giflib
  libpng          lib32-libpng
  libldap         lib32-libldap
  gnutls          lib32-gnutls
  mpg123          lib32-mpg123
  openal          lib32-openal
  v4l-utils       lib32-v4l-utils
  libpulse        lib32-libpulse
  alsa-plugins    lib32-alsa-plugins
  alsa-lib        lib32-alsa-lib
  libjpeg-turbo   lib32-libjpeg-turbo
  libxcomposite   lib32-libxcomposite
  libxinerama     lib32-libxinerama
  ncurses         lib32-ncurses
  libcl           lib32-libcl
  libxslt         lib32-libxslt
74
  cups
Xuetian Weng's avatar
Xuetian Weng committed
75
  samba           dosbox
Jeff Huang's avatar
Jeff Huang committed
76 77
  gst-plugins-base-libs lib32-gst-plugins-base-libs
  opencl-headers
Giuseppe's avatar
Giuseppe committed
78 79
)

80
prepare() {
81
#  cd $srcdir
82
  
83
  # Get rid of old code dir
84
  rm -rf $pkgname
85 86 87
  
  # Get rid of old build dirs
  rm -rf $pkgname-{32,64}-build
Giuseppe's avatar
Giuseppe committed
88 89

  # Allow ccache to work
Jeff Huang's avatar
Jeff Huang committed
90
  mv $pkgname-$_pkgver $pkgname
Jeff Huang's avatar
Jeff Huang committed
91
  
Jeff Huang's avatar
Jeff Huang committed
92 93 94 95
  # https://bugs.winehq.org/show_bug.cgi?id=43530
  export CFLAGS="${CFLAGS/-fno-plt/}"
  export LDFLAGS="${LDFLAGS/,-z,now/}"

Jeff Huang's avatar
Jeff Huang committed
96
  sed 's|OpenCL/opencl.h|CL/opencl.h|g' -i $pkgname/configure*
Giuseppe's avatar
Giuseppe committed
97

98 99 100
  # ncurses fix
  sed -i 's|libncurses|libncursesw|g' "$srcdir/$pkgname/configure"
  sed -i 's|lncurses|lncursesw|g' "$srcdir/$pkgname/configure"
Giuseppe's avatar
Giuseppe committed
101
  
102 103
  # These additional CPPFLAGS solve FS#27662 and FS#34195
  export CPPFLAGS="${CPPFLAGS/-D_FORTIFY_SOURCE=2/} -D_FORTIFY_SOURCE=0"
104 105 106
}

build() {
107
#  cd $srcdir
108

Manuel's avatar
Manuel committed
109
  msg2 "Building Wine-64..."
Chaoting Liu's avatar
Chaoting Liu committed
110

Xuetian Weng's avatar
Xuetian Weng committed
111
  mkdir -p $pkgname-64-build
Chaoting Liu's avatar
Chaoting Liu committed
112

Manuel's avatar
Manuel committed
113 114 115 116 117
  cd "$srcdir/$pkgname-64-build"
  ../$pkgname/configure \
    --prefix=/usr \
    --libdir=/usr/lib \
    --with-x \
Jeff Huang's avatar
Jeff Huang committed
118
    --with-gstreamer \
Manuel's avatar
Manuel committed
119
    --enable-win64
Giuseppe's avatar
Giuseppe committed
120

Giuseppe's avatar
Giuseppe committed
121
  make
Giuseppe's avatar
Giuseppe committed
122

Manuel's avatar
Manuel committed
123 124 125 126
  _wine32opts=(
    --libdir=/usr/lib32
    --with-wine64="$srcdir/$pkgname-64-build"
  )
Giuseppe's avatar
Giuseppe committed
127

Manuel's avatar
Manuel committed
128
  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
Giuseppe's avatar
Giuseppe committed
129 130

  msg2 "Building Wine-32..."
Xuetian Weng's avatar
Xuetian Weng committed
131
  mkdir -p "$srcdir/$pkgname-32-build"
Giuseppe's avatar
Giuseppe committed
132 133 134 135
  cd "$srcdir/$pkgname-32-build"
  ../$pkgname/configure \
    --prefix=/usr \
    --with-x \
Jeff Huang's avatar
Jeff Huang committed
136
    --with-gstreamer \
Giuseppe's avatar
Giuseppe committed
137 138 139 140 141 142
    "${_wine32opts[@]}"
}

package() {
  msg2 "Packaging Wine-32..."
  cd "$srcdir/$pkgname-32-build"
Manuel's avatar
Manuel committed
143
  make prefix="$pkgdir/usr" \
Giuseppe's avatar
Giuseppe committed
144 145
    libdir="$pkgdir/usr/lib32" \
    dlldir="$pkgdir/usr/lib32/wine" install
Giuseppe's avatar
Giuseppe committed
146

Manuel's avatar
Manuel committed
147 148 149
  msg2 "Packaging Wine-64..."
  cd "$srcdir/$pkgname-64-build"
  make prefix="$pkgdir/usr" \
Giuseppe's avatar
Giuseppe committed
150 151
    libdir="$pkgdir/usr/lib" \
    dlldir="$pkgdir/usr/lib/wine" install
152 153 154 155 156

  # 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"
Jeff Huang's avatar
Jeff Huang committed
157
}