Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
268 lines (221 sloc) 7.41 KB
# Maintainer: Thaodan <theodorstormgrade@gmail.com>
# Contributor : Anish Bhatt anish [at] gatech [dot] edu
# Contributor : Jesus Alvarez <jeezusjr@gmail.com>
# Contributor : sxe <sxxe@gmx.de>
# Based on the wine package in the community repository
_upname="wine"
pkgname=wine-staging-git-pba
pkgver=3.8.r0.g7280f7fb74+8f20f07
pkgrel=1
pkgdesc="A compatibility layer for running Windows programs git + staging patches not yet upstreamed git"
url="http://www.winehq.com"
license=('LGPL2.1')
arch=('x86_64' 'i686')
options=(staticlibs ccache !buildflags)
install=wine.install
_patches=(
#
)
source=(
# http://prdownloads.sourceforge.net/wine/wine-1.7.39.tar.bz2{,.sign}
"$_upname"::"git://source.winehq.org/git/wine.git"
"$pkgname"::"git+https://github.com/wine-staging/wine-staging"
"git+https://github.com/acomminos/wine-pba"
"30-win32-aliases.conf"
${_patches[*]}
)
validpgpkeys=('5AC1A08B03BD7A313E0A955AF5E6E9EEB9461DD7') # Alexandre Julliard
md5sums=('SKIP'
'SKIP'
'SKIP'
'1ff4e467f59409272088d92173a0f801')
_depends=(
attr lib32-attr
fontconfig lib32-fontconfig
lcms2 lib32-lcms2
libxml2 lib32-libxml2
libxcursor lib32-libxcursor
libxrandr lib32-libxrandr
libxdamage lib32-libxdamage
libxi lib32-libxi
gettext lib32-gettext
freetype2 lib32-freetype2
glu lib32-glu
libsm lib32-libsm
gcc-libs lib32-gcc-libs
libpcap lib32-libpcap
desktop-file-utils
)
makedepends=(autoconf ncurses bison perl fontforge flex
'gcc>=4.5.0-2' 'gcc-multilib'
giflib lib32-giflib
libpng lib32-libpng
gnutls lib32-gnutls
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
libxcomposite lib32-libxcomposite
mesa lib32-mesa
mesa-libgl lib32-mesa-libgl
opencl-icd-loader lib32-opencl-icd-loader
libxslt lib32-libxslt
libpulse lib32-libpulse
libva lib32-libva
gtk3 lib32-gtk3
gst-plugins-base-libs lib32-gst-plugins-base-libs
samba
opencl-headers
)
optdepends=(
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
opencl-icd-loader lib32-opencl-icd-loader
libxslt lib32-libxslt
libva lib32-libva
gtk3 lib32-gtk3
gst-plugins-base-libs lib32-gst-plugins-base-libs
vulkan-icd-loader lib32-vulkan-icd-loader
cups
samba dosbox
)
if [[ $CARCH == i686 ]]; then
# Strip lib32 etc. on i686
_depends=(${_depends[@]/*32-*/})
makedepends=(${makedepends[@]/*32-*/} ${_depends[@]})
makedepends=(${makedepends[@]/*-multilib*/})
optdepends=(${optdepends[@]/*32-*/})
provides=("wine=$pkgver")
conflicts=('wine')
else
makedepends=(${makedepends[@]} ${_depends[@]})
provides=("wine=$pkgver" "wine-wow64=$pkgver")
conflicts=('wine' 'wine-wow64')
fi
makedepends+=('git')
# Uncomment the line below if you want wine installed to /opt/wine-silverlight instead of replacing wine
#customprefix=1
_prefix="/usr"
_sysconf="/etc"
conflicts=('wine' 'wine-compholio')
provides=("wine=${pkgver}" "wine-compholio=${pkgver}" "wine-staging=${pkgver}")
pkgver() {
#date +%Y%m%d
cd "$srcdir/$_upname"
printf %s $(git describe --always --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g;s/^wine.//')
cd "$srcdir"/wine-pba
printf '+%s\n' $(git describe --always --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g;s/^wine.//')
}
prepare() {
cd "$srcdir"
# Get rid of old build dirs
rm -rf $pkgname-{32,64}-build
mkdir $pkgname-32-build
#cd "$srcdir"/$pkgname
cd "$srcdir"/$_upname
# fix wine-staging
for _patch in ${_patches[*]} ; do
patch -Np1 -i ../$_patch
done
msg2 "Cleaning the wine source code tree..."
# Restore the wine tree to its git origin state, without wine-staging patches
#+(necessary for reapllying wine-staging patches in succedent builds,
#+otherwise the patches will fail to be reapplied)
git reset --hard HEAD # Restore tracked files
git clean -d -x -f # Delete untracked files
# Change back to the wine upstream commit that this version of wine-staging is based in
git checkout $(../"$pkgname"/patches/patchinstall.sh --upstream-commit)
cd "$srcdir"/"$_upname"
# Apply all wine-staging patches
cd "$srcdir"
msg2 "Applying wine-staging patches..."
./"$pkgname"/patches/patchinstall.sh DESTDIR="${srcdir}/$_upname" --all
cd "$srcdir"/"$_upname"
for _patch in "$srcdir"/wine-pba/patches/* ; do
patch -p1 -i "$_patch"
done
# patch -Np1 -i "$srcdir"/KUSER_SHARED_DATA_KTIME.patch
# https://bugs.winehq.org/show_bug.cgi?id=42132
(cd "$srcdir"/"$_upname"
sed 's|OpenCL/opencl.h|CL/opencl.h|g' -i configure
)
}
build() {
export CFLAGS="-O2 -pipe -fstack-protector-strong"
export CXXFLAGS="${CFLAGS}"
cd "$srcdir"
if [[ $CARCH == x86_64 ]]; then
msg2 "Building Wine-64..."
mkdir -p $pkgname-64-build
cd "$srcdir/$pkgname-64-build"
../$_upname/configure \
--prefix=$_prefix \
--sysconfdir=$_sysconf \
--libdir=$_prefix/lib \
--with-x \
--with-gstreamer \
--enable-win64 \
--disable-tests
make
_wine32opts=(
--libdir=/$_prefix/lib32
--with-wine64="$srcdir/$pkgname-64-build"
)
export PKG_CONFIG_PATH="$_prefix/lib32/pkgconfig"
fi
msg2 "Building Wine-32..."
cd "$srcdir/$pkgname-32-build"
../$_upname/configure \
--prefix=$_prefix \
--sysconfdir=$_sysconf \
--with-x \
--with-gstreamer \
--disable-tests \
"${_wine32opts[@]}"
make
}
package() {
msg2 "Packaging Wine-32..."
cd "$srcdir/$pkgname-32-build"
if [[ $CARCH == i686 ]]; then
make prefix="$pkgdir/$_prefix" install
else
make prefix="$pkgdir/$_prefix" \
libdir="$pkgdir/$_prefix/lib32" \
dlldir="$pkgdir/$_prefix/lib32/wine" install
msg2 "Packaging Wine-64..."
cd "$srcdir/$pkgname-64-build"
make prefix="$pkgdir/$_prefix" \
libdir="$pkgdir/$_prefix/lib" \
dlldir="$pkgdir/$_prefix/lib/wine" install
fi
# 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"
# Provide symlinks in /opt/wine-compholio/bin
if [[ "$_prefix" != "/opt/wine-compholio" ]]; then
mkdir -p "$pkgdir/opt/wine-compholio/bin"
for _file in $(ls "$pkgdir/$_prefix/bin"); do \
ln -s "$_prefix/bin/$_file" "$pkgdir/opt/wine-compholio/bin/$_file"; \
done
fi
}
# vim:set ts=2 sw=2 tw=0 et: