#!/bin/bash # # wine.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # wine.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # Based on wine.SlackBuild by Eric Hameleers # default settings PACKAGE="wine" PACKAGE_EXT="xz" VERSION=${VERSION:=3.0.5} BUILD=${BUILD:=1} # Add the "Gecko", Wine's own implementation of Internet Explorer. # For matching wine_gecko & wine versions, see http://wiki.winehq.org/Gecko GECKO=${GECKO:-2.47} MONO=${MONO:-4.8.0} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required # If your video card does not support hardware accelerated OpenGL, # the run the script like: OPENGL=NO ./wine.SlackBuild OPENGL=${OPENGL:-YES} # If you want to build a WoW64 version. This only works on 64 bit systems. WOW64=${WOW64:-YES} GSRC="wine_gecko-${GECKO}-x86.msi" GURL="http://downloads.sourceforge.net/wine/$GSRC" GURL="http://dl.winehq.org/wine/wine-gecko/$GECKO/$GSRC" get_source $GSRC $GURL if [ "$ARCH" = "x86_64" -a "$WOW64" = "YES" ]; then GSRC64="wine_gecko-${GECKO}-x86_64.msi" GURL64="http://downloads.sourceforge.net/wine/$GSRC64" GURL64="http://dl.winehq.org/wine/wine-gecko/$GECKO/$GSRC64" get_source $GSRC64 $GURL64 fi MSRC="wine-mono-${MONO}.msi" MURL="http://downloads.sourceforge.net/wine/$MSRC" MURL="http://dl.winehq.org/wine/wine-mono/$MONO/$MSRC" get_source $MSRC $MURL SVER="$(echo $VERSION | cut -d '.' -f -2)" SRC="wine-${VERSION}.tar.$PACKAGE_EXT" URL="http://mirrors.ibiblio.org/wine/source/${SVER}/${SRC}" get_source $SRC $URL unpack_source $SRC wine-$VERSION # If OPENGL=YES above, then enable opengl; otherwise, disable it. if [ "$OPENGL" = "YES" ]; then do_opengl="with" else do_opengl="without" fi if [ "$WOW64" = "YES" -a "$LIBDIRSUFFIX" = "64" ]; then echo "" echo "===========================" echo " Building WoW64 version" echo "===========================" sleep 5 # First build 64 bit version mkdir wine64 cd wine64 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ../configure \ --enable-win64 \ --prefix=/usr \ --mandir=/usr/man \ --docdir=/usr/doc/$PACKAGE-$VERSION \ --with-gnutls=yes \ --without-capi \ --without-hal \ --without-oss \ --${do_opengl}-opengl \ --build=$ARCH-slackware-linux make depend make $NUMJOBS cd .. # Then build 32 bit version mkdir wine32 cd wine32 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ../configure \ --with-wine64=../wine64 \ --prefix=/usr \ --mandir=/usr/man \ --docdir=/usr/doc/$PACKAGE-$VERSION \ --with-gnutls=no \ --without-capi \ --without-hal \ --without-oss \ --${do_opengl}-opengl \ --build=$ARCH-slackware-linux make depend make $NUMJOBS # Install 32 bit version make install DESTDIR=$PKG cd .. cd wine64 # Install 64 bit over 32 bit. make install DESTDIR=$PKG cd .. else # Only 32 bit Windows support. CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --mandir=/usr/man \ --docdir=/usr/doc/$PACKAGE-$VERSION \ --with-gnutls=yes \ --without-capi \ --without-hal \ --without-oss \ --${do_opengl}-opengl \ --build=$ARCH-slackware-linux make depend make $NUMJOBS make install DESTDIR=$PKG fi # From Eric Hameleers script: # Add the wine-gecko MSI installer(s) to the Wine package: mkdir -p $PKG/usr/share/wine/gecko install -m0644 $CWD/$GSRC $PKG/usr/share/wine/gecko/ if [ "$ARCH" = "x86_64" -a "$WOW64" = "YES" ]; then install -m0644 $CWD/$GSRC64 $PKG/usr/share/wine/gecko/ fi mkdir -p $PKG/usr/share/wine/mono install -m0644 $CWD/$MSRC $PKG/usr/share/wine/mono/ # Add a desktop menu for the winecfg program: mkdir -p $PKG/usr/share/{icons/hicolor/scalable/apps,pixmaps} convert $CWD/wine.svg -scale 64 $PKG/usr/share/pixmaps/wine.png install -m0644 $CWD/wine.svg $PKG/usr/share/icons/hicolor/scalable/apps/ # I used karbon to extract a single picture out of the SVG: convert $CWD/winecfg.png -scale 64 $PKG/usr/share/pixmaps/winecfg.png cp -a programs/winecfg/winecfg.svg $PKG/usr/share/icons/hicolor/scalable/apps/ mkdir -p $PKG/usr/share/applications cat <<_EOT_ > $PKG/usr/share/applications/winecfg.desktop [Desktop Entry] Exec=winecfg Icon=winecfg Terminal=false Name=Wine Configuration Name[nl]=Wine Configuratie Comment=Configure Wine Comment[nl]=Configureer Wine Type=Application Categories=Settings _EOT_ mkdir -p $DOCS cp -a ANNOUNCE AUTHORS COPYING.LIB LICENSE* README VERSION $DOCS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/wine-$VERSION rm -rf $PKG fi