updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / wine-multimedia-git / PKGBUILD
blob57ebc2c034644c58194afbbe76b4f6782e70ff2c
1 # Maintainer:  John Schoenick <john@pointysoftware.net>
2 # Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
3 # Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
4 # Contributor: Eduardo Romero <eduardo@archlinux.org>
5 # Contributor: Giovanni Scafora <giovanni@archlinux.org>
7 pkgname=wine-multimedia-git
8 _basename=wine
9 pkgver=20110909
10 pkgrel=1
12 pkgdesc="A compatibility layer for running Windows programs"
13 url="http://www.winehq.com"
14 arch=(i686 x86_64)
15 license=(LGPL)
16 install=wine.install
18 depends=(
19   fontconfig       lib32-fontconfig
20   mesa             lib32-mesa 
21   libxcursor       lib32-libxcursor
22   libxrandr        lib32-libxrandr
23   libxdamage       lib32-libxdamage
24   libxxf86dga      lib32-libxxf86dga
25   libxi            lib32-libxi
26   alsa-lib         lib32-alsa-lib
27   desktop-file-utils
28   
29   # Required for new openalSOFT api calls that arn't in release yet.
30   # Sound wont work without this!
31   openal-git       lib32-openal-git
32   # The pulse driver wont work without this, but you can remove it if you don't expect to use it.
33   alsa-plugins-git lib32-alsa-plugins-git
36 makedepends=(autoconf ncurses bison perl fontforge flex prelink git
37   'gcc>=4.5.0-2'  'gcc-multilib>=4.5.0-2'
38   giflib          lib32-giflib
39   libxpm          lib32-libxpm
40   libpng          lib32-libpng
41   libxinerama     lib32-libxinerama
42   libxcomposite   lib32-libxcomposite
43   libxmu          lib32-libxmu
44   libxxf86vm      lib32-libxxf86vm
45   libxml2         lib32-libxml2
46   libxslt         lib32-libxslt
47   libldap         lib32-libldap
48   lcms            lib32-lcms
49   mpg123          lib32-mpg123
50   openal          lib32-openal
51   libcups         lib32-libcups
52   gnutls          lib32-gnutls
53   v4l-utils       lib32-v4l-utils
54   
55   # This is required if you want the build to support OSS,
56   # but since this is an AUR package and just installing OSS can devestate your alsa sound system,
57   # I'm leaving it out by default.
58   #oss
60   
61 optdepends=(
62   giflib          lib32-giflib
63   libpng          lib32-libpng
64   libldap         lib32-libldap
65   lcms            lib32-lcms
66   libxml2         lib32-libxml2
67   mpg123          lib32-mpg123
68   openal          lib32-openal
69   libcups         lib32-libcups
70   gnutls          lib32-gnutls
71   v4l-utils       lib32-v4l-utils
72   oss
75 # Set to 1 to auto-rebase multimedia-git onto the latest wine-git
76 # Set to 0 if you just want to use the raw multimedia-git, which doesn't
77 # rebase itself all that often.
78 _rebase=1
80 # Wine gitweb:             http://source.winehq.org/git/wine.git
81 # Multimedia tree gitweb:  http://repo.or.cz/w/wine/multimedia.git
82 _gitroot=git://repo.or.cz/wine/multimedia.git
83 _gitname=wine-multimedia
84 _upstream=git://source.winehq.org/git/wine.git
86 # This is used when _rebase=1, see comment in build()
87 source=(winemultimedia_add_winepulse_getpriority.patch)
88 sha256sums=('209b22d5fe05a59ddb5108507261641f733256ba218bfe932df867fb0757aeb9')
90 if [[ $CARCH == i686 ]]; then
91   # Strip lib32 etc. on i686
92   depends=(${depends[@]/*32-*/})
93   makedepends=(${makedepends[@]/*32-*/})
94   makedepends=(${makedepends[@]/*-multilib*/})
95   optdepends=(${optdepends[@]/*32-*/})
96   provides=("wine=$pkgver")
97   conflicts=('wine')
98 else
99   provides=("wine=$pkgver" "bin32-wine=$pkgver" "wine-wow64=$pkgver")
100   conflicts=('wine' 'bin32-wine' 'wine-wow64')
101   replaces=('bin32-wine')
104 build() {
105   cd "$srcdir"
106   
107   # Get source
108   if [ ! -d "$_gitname" ]; then
109       (
110           # The reason we clone upstream and add a remote
111           # to multimedia is mainly because repo.or.cz
112           # is much slower - it could be done either way.
113           msg2 "Cloning wine git"
114           git clone "$_upstream" "$_gitname"
115           cd "$_gitname"
116           
117           msg2 "Fetching multimedia git"
118           git remote add multimedia "$_gitroot"
119           git fetch multimedia
120           git checkout -b multimedia multimedia/master
121       )
122   fi
123   (
124       cd "$_gitname"
125       msg2 "Updating multimedia git"
126       git checkout -f multimedia
127       # The multimedia branch sometimes rebases itself, so 
128       # we fetch and hard reset. If you want to apply your
129       # own patches to your local repository, replace this
130       # line with just "git pull" - But be aware that
131       # you're responsible for fixing desync in the future.
132       git fetch multimedia && git reset --hard multimedia/master && git clean -xfd
133       
134       if [ "$_rebase" -gt 0 ]; then
135         msg2 "Pulling upstream patches onto multimedia git"
136         git fetch origin
137         # Make a 'temp' branch to rebase on upstream
138         git branch -D temp || true
139         git checkout -b temp
141         git merge --squash -Xours origin/master || true
142         # -Xours resolves conflicts by just keeping the multimedia branch versions,
143         # this might return errors due to deleted files, which don't present a problem
144         # to the build
145         
146         # The following commit added GetPriority() to all the drivers:
147         # http://source.winehq.org/git/wine.git/commitdiff/c4b94b1ba4ee1664c0a14515d6fbc6d648e9175b
148         # So this patch adds the same thing to winepulse, fixing it refusing to load when rebasing
149         # on upstream.
150         # If this is failing to apply, its possible the multimedia folks added it, in which case
151         # it can be dropped here.
152         patch -Np1 -i "${srcdir}/winemultimedia_add_winepulse_getpriority.patch"
153       fi
154   )
155   
156   # Get rid of old build dirs
157   rm -rf $_basename-{32,64}-build
158   mkdir $_basename-32-build
160   if [[ $CARCH == x86_64 ]]; then
161     msg2 "Building Wine-64..."
163     mkdir $_basename-64-build
164     cd "$srcdir/$_basename-64-build"
165     ../$_gitname/configure \
166       --prefix=/usr \
167       --sysconfdir=/etc \
168       --libdir=/usr/lib \
169       --with-x \
170       --enable-win64
172     make
174     _wine32opts=(
175       --libdir=/usr/lib32
176       --with-wine64="$srcdir/$_basename-64-build"
177     )
179     export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
180   fi
182   msg2 "Building Wine-32..."
183   cd "$srcdir/$_basename-32-build"
184   ../$_gitname/configure \
185     --prefix=/usr \
186     --sysconfdir=/etc \
187     --with-x \
188     "${_wine32opts[@]}"
190   make
193 package() {
194   msg2 "Packaging Wine-32..."
195   cd "$srcdir/$_basename-32-build"
197   if [[ $CARCH == i686 ]]; then
198     make prefix="$pkgdir/usr" install
199   else
200     make prefix="$pkgdir/usr" \
201       libdir="$pkgdir/usr/lib32" \
202       dlldir="$pkgdir/usr/lib32/wine" install
204     msg2 "Packaging Wine-64..."
205     cd "$srcdir/$_basename-64-build"
206     make prefix="$pkgdir/usr" \
207       libdir="$pkgdir/usr/lib" \
208       dlldir="$pkgdir/usr/lib/wine" install
209   fi
212 # vim:set ts=8 sts=2 sw=2 et: