desktop/wine/PKGBUILD

180 lines
3.8 KiB
Bash

#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=wine
pkgver=1.3.0
pkgrel=1
_pkgbasever=${pkgver/rc/-rc}
source=(http://ibiblio.org/pub/linux/system/emulators/$pkgname/$pkgname-$_pkgbasever.tar.bz2
unbreak-wow64.patch)
md5sums=('f266536a8096f6b705f2f802549dc0e5'
'c3118b7df69ad4e93b5ce98f6a592620')
pkgdesc="A compatibility layer for running Windows programs"
url="http://www.winehq.com"
arch=(i686 x86_64)
license=(LGPL)
depends=(
fontconfig lib32-fontconfig
mesa lib32-mesa
libxcursor lib32-libxcursor
libxrandr lib32-libxrandr
libxdamage lib32-libxdamage
libxxf86dga lib32-libxxf86dga
alsa-lib lib32-alsa-lib
)
makedepends=(autoconf ncurses bison perl fontforge flex prelink
'gcc>=4.5.0-2' cross32-gcc
'lib32-glibc>=2.12-5'
libgphoto2
giflib lib32-giflib
libxpm lib32-libxpm
libpng lib32-libpng
libxinerama lib32-libxinerama
libxcomposite lib32-libxcomposite
libxmu lib32-libxmu
libxxf86vm lib32-libxxf86vm
libxml2 lib32-libxml2
libxslt lib32-libxslt
libldap lib32-libldap
lcms lib32-lcms
openal lib32-openal
esound lib32-esound
jack lib32-jack
cups lib32-libcups
sane
samba
)
optdepends=(
libgphoto2
giflib lib32-giflib
libpng lib32-libpng
libldap lib32-libldap
lcms lib32-lcms
libxml2 lib32-libxml2
openal lib32-openal
esound lib32-esound
jack lib32-jack
cups lib32-libcups
sane
samba
)
if [[ $CARCH == i686 ]]; then
# Strip lib32 etc. on i686
depends=(${depends[@]/*32-*/})
makedepends=(${makedepends[@]/*32-*/})
optdepends=(${optdepends[@]/*32-*/})
else
provides=("bin32-wine=$pkgver" "wine-wow64=$pkgver")
conflicts=('bin32-wine' 'wine-wow64')
replaces=('bin32-wine')
_libdir32=/opt/lib32/usr/lib
_libdir64=/usr/lib
fi
build() {
cd "$srcdir"
# Allow ccache to work
mv $pkgname-$_pkgbasever $pkgname
msg2 "Patching..."
(
cd $pkgname
patch -Np1 -i "$srcdir/unbreak-wow64.patch"
)
# (Re)create build dirs
rm -rf $pkgname-{32,64}-build
mkdir $pkgname-{32,64}-build
if [[ $CARCH == i686 ]]; then
msg2 "Building Wine..."
cd "$srcdir/$pkgname-32-build"
../$pkgname/configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-x
make
else
msg2 "Building Wine-64..."
cd "$srcdir/$pkgname-64-build"
../$pkgname/configure \
--prefix=/usr \
--libdir="$_libdir64" \
--sysconfdir=/etc \
--with-x \
--enable-win64
make
msg2 "Building Wine-32..."
cd "$srcdir/$pkgname-32-build"
../$pkgname/configure \
CFLAGS="${CFLAGS/x86-64/i686}" \
CXXFLAGS="${CXXFLAGS/x86-64/i686}" \
LDFLAGS="$LDFLAGS -L/opt/lib32/lib -L/opt/lib32/usr/lib" \
LDD=/usr/bin/ldd32 \
--host=i686-unknown-linux-gnu \
--prefix=/usr \
--libdir="$_libdir32" \
--sysconfdir=/etc \
--with-x \
--with-wine64="$srcdir/$pkgname-64-build"
make
fi
}
package() {
if [[ $CARCH == i686 ]]; then
msg2 "Packaging Wine..."
cd "$srcdir/$pkgname-32-build"
make prefix="$pkgdir/usr" install
else
msg2 "Packaging Wine-32..."
cd "$srcdir/$pkgname-32-build"
make prefix="$pkgdir/usr" \
libdir="$pkgdir$_libdir32" \
dlldir="$pkgdir$_libdir32/wine" install
msg2 "Packaging Wine-64..."
cd "$srcdir/$pkgname-64-build"
make prefix="$pkgdir/usr" \
libdir="$pkgdir$_libdir64" \
dlldir="$pkgdir$_libdir64/wine" install
fi
mkdir -p "$pkgdir/etc/wine"
}
# vim:set ts=8 sts=2 sw=2 et: