#!/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:=7.16} 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.3} MONO=${MONO:-7.3.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://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://dl.winehq.org/wine/wine-gecko/$GECKO/$GSRC64" get_source $GSRC64 $GURL64 fi MSRC="wine-mono-${MONO}-x86.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 1)" SRC="wine-${VERSION}.tar.$PACKAGE_EXT" URL="http://dl.winehq.org/wine/source/${SVER}.x/${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 echo "" echo "===========================" echo " Building WoW64 version" echo "===========================" sleep 5 export CCAS="as" export CFLAGS="$SLKCFLAGS" export CXXFLAGS="$SLKCFLAGS" export LDFLAGS="-L/usr/lib -ldl" OLD_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" export PKG_CONFIG_PATH="/usr/lib/pkgconfig:$PKG_CONFIG_PATH" # First build 64 bit version mkdir wine64 cd wine64 PKG_CONFIG_PATH="$OLD_PKG_CONFIG_PATH" \ CC=/usr/bin/gcc \ ../configure \ --enable-win64 \ --prefix=/usr \ --mandir=/usr/man \ --libdir=/usr/lib64 \ --docdir=/usr/doc/$PACKAGE-$VERSION \ --with-gnutls=yes \ --without-capi \ --without-oss \ --${do_opengl}-opengl \ --build=$ARCH-slackware-linux make $NUMJOBS depend make $NUMJOBS cd .. # Then build 32 bit version mkdir wine32 cd wine32 ../configure \ --with-wine64=../wine64 \ --prefix=/usr \ --mandir=/usr/man \ --libdir=/usr/lib \ --docdir=/usr/doc/$PACKAGE-$VERSION \ --with-gnutls=no \ --without-capi \ --without-oss \ --${do_opengl}-opengl \ --build=$ARCH-slackware-linux make $NUMJOBS 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 .. # 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/ install -m0644 $CWD/$GSRC64 $PKG/usr/share/wine/gecko/ 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 find $PKG/usr/lib/wine/ -name "*.dll" | xargs i686-w64-mingw32-strip --strip-unneeded find $PKG/usr/lib64/wine/ -name "*.dll" | xargs x86_64-w64-mingw32-strip --strip-unneeded fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/wine-$VERSION rm -rf $PKG fi