Skip to content

Commit b15c581

Browse files
committed
Add wine installation script for CentOS 8
1 parent 490d3e9 commit b15c581

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

script/install-wine-i686-centos8.sh

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#!/bin/bash
2+
3+
# Download, build and install wine 32-bit on CentOS 8
4+
5+
# For details of this script, please check
6+
# https://www.systutorials.com/install-32-bit-wine-1-8-centos-7/
7+
8+
# Authors:
9+
# Mika Knuutila (mika [at] digiaika.fi)
10+
# Eric Ma (https://www.ericzma.com)
11+
12+
set -o errexit
13+
14+
# Constants
15+
log=`mktemp -t install-wine.XXXXXX.log`
16+
NPROC=$(nproc)
17+
CFLAGS="-g -O2 -std=gnu99"
18+
wine2up="2 3 4 5" # wine 2 and up
19+
ver=5.0 # last stable version on 2020-03-19
20+
21+
# Install
22+
if [[ "$1" != "" ]]; then
23+
ver=$1
24+
fi
25+
26+
vermajor=$(echo ${ver} | cut -d'.' -f1)
27+
verurlstr=$(echo ${ver} | cut -d'.' -f1,2)
28+
29+
date > $log
30+
echo "Hello there. Start to download, build and install wine $ver 32-bit version..." | tee -a $log
31+
echo "Logs are in $log" | tee -a $log
32+
33+
echo "Enabling needed repos and update..." | tee -a $log
34+
35+
# Fixes for CentOS 8
36+
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y 2>&1 >>$log
37+
dnf config-manager --set-enable PowerTools 2>&1 >>$log
38+
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro 2>&1 >>$log
39+
dnf install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm -y 2>&1 >>$log
40+
dnf clean all 2>&1 >>$log
41+
dnf update --best --allowerasing -y 2>&1 >>$log
42+
43+
# echo "Please make sure you have EPEL and Nux Desktop repositories configured. Check https://www.systutorials.com/239893/additional-repositories-centos-linux/ for howto." | tee -a $log
44+
45+
echo "Uninstall old wine if you have installed it..." | tee -a $log
46+
47+
# yum erase wine wine-*
48+
dnf remove wine wine-* -y 2>&1 >>$log
49+
50+
echo "Install wine building tools..." | tee -a $log
51+
52+
dnf install samba-winbind-clients -y 2>&1 >>$log
53+
dnf groupinstall 'Development Tools' -y 2>&1 >> $log
54+
dnf install libjpeg-turbo-devel libtiff-devel freetype-devel -y 2>&1 >> $log
55+
dnf install glibc-devel.{i686,x86_64} libgcc.{i686,x86_64} libX11-devel.{i686,x86_64} freetype-devel.{i686,x86_64} gnutls-devel.{i686,x86_64} libxml2-devel.{i686,x86_64} libjpeg-turbo-devel.{i686,x86_64} libpng-devel.{i686,x86_64} libXrender-devel.{i686,x86_64} alsa-lib-devel.{i686,x86_64} glib2-devel.{i686,x86_64} libSM-devel.{i686,x86_64} -y 2>&1 >> $log
56+
57+
# Fixes for CentOS 8
58+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/prelink-0.5.0-9.el7.x86_64.rpm -y 2>&1 >> $log
59+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/isdn4k-utils-3.2-99.el7.x86_64.rpm -y 2>&1 >> $log
60+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/isdn4k-utils-devel-3.2-99.el7.x86_64.rpm -y 2>&1 >> $log
61+
dnf install glibc-devel libstdc++-devel icoutils openal-soft-devel prelink gstreamer1-plugins-base-devel gstreamer1-devel ImageMagick-devel fontpackages-devel libv4l-devel gsm-devel giflib-devel libXxf86dga-devel mesa-libOSMesa-devel isdn4k-utils-devel libgphoto2-devel fontforge libusb-devel lcms2-devel audiofile-devel -y 2>&1 >> $log
62+
63+
dnf install openldap-devel libxslt-devel libXcursor-devel libXi-devel libXxf86vm-devel libXrandr-devel libXinerama-devel libXcomposite-devel mesa-libGLU-devel ocl-icd opencl-headers libpcap-devel dbus-devel ncurses-devel libsane-hpaio pulseaudio-libs-devel cups-devel libmpg123-devel fontconfig-devel sane-backends-devel.x86_64 -y 2>&1 >> $log
64+
65+
# Fixes for CentOS 8
66+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/isdn4k-utils-3.2-99.el7.i686.rpm -y 2>&1 >> $log
67+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/isdn4k-utils-devel-3.2-99.el7.i686.rpm -y 2>&1 >> $log
68+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/audiofile-0.3.6-4.el7.i686.rpm -y 2>&1 >> $log
69+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/audiofile-devel-0.3.6-4.el7.i686.rpm -y 2>&1 >> $log
70+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/qt-4.8.7-3.el7_6.i686.rpm -y 2>&1 >> $log
71+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/libmng-1.0.10-14.el7.i686.rpm -y 2>&1 >> $log
72+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/qt-x11-4.8.7-3.el7_6.i686.rpm -y 2>&1 >> $log
73+
dnf install http://mirror.centos.org/centos/7/os/x86_64/Packages/qt-devel-4.8.7-3.el7_6.i686.rpm -y 2>&1 >> $log
74+
75+
dnf install glibc-devel.i686 dbus-devel.i686 freetype-devel.i686 pulseaudio-libs-devel.i686 libX11-devel.i686 mesa-libGLU-devel.i686 libICE-devel.i686 libXext-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libXxf86vm-devel.i686 libXrender-devel.i686 libXinerama-devel.i686 libXcomposite-devel.i686 libXrandr-devel.i686 mesa-libGL-devel.i686 mesa-libOSMesa-devel.i686 libxml2-devel.i686 zlib-devel.i686 gnutls-devel.i686 ncurses-devel.i686 sane-backends-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 libexif-devel.i686 lcms2-devel.i686 gettext-devel.i686 isdn4k-utils-devel.i686 cups-devel.i686 fontconfig-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 libtiff-devel.i686 unixODBC.i686 openldap-devel.i686 alsa-lib-devel.i686 audiofile-devel.i686 freeglut-devel.i686 giflib-devel.i686 gstreamer1-devel.i686 gstreamer1-plugins-base-devel.i686 libXmu-devel.i686 libXxf86dga-devel.i686 libieee1284-devel.i686 libpng-devel.i686 librsvg2-devel.i686 libstdc++-devel.i686 libusb-devel.i686 unixODBC-devel.i686 qt-devel.i686 libpcap-devel.i686 -y 2>&1 >> $log
76+
# Conflicting: pkgconfig.i686, libxslt-devel.i686, qt-devel.i686 and qt-x11.i686
77+
dnf clean all 2>&1 >>$log
78+
dnf update --best --allowerasing -y 2>&1 >>$log
79+
dnf builddep wine -y 2>&1 >>$log
80+
dnf update -y 2>&1 >>$log
81+
82+
if [[ "${wine2up}" =~ "${vermajor}" ]]; then
83+
# for wine 2 and up
84+
# Thanks to gretzware https://www.systutorials.com/install-32-bit-wine-1-8-centos-7/#comment-157977
85+
dnf install gstreamer1-plugins-base-devel.{x86_64,i686} gstreamer1-devel.{x86_64,i686} systemd-devel.{x86_64,i686} -y 2>&1 >> $log
86+
87+
# Thanks to gretzware https://www.systutorials.com/install-32-bit-wine-1-8-centos-7/#comment-158134
88+
dnf install libXfixes-devel.{x86_64,i686} -y 2>&1 >> $log
89+
fi
90+
91+
echo "Download and unpack the wine source package..." 2>&1 | tee -a $log
92+
93+
cd /usr/src 2>&1 >> $log
94+
if [[ "${vermajor}" == "1" ]]; then
95+
wget http://dl.winehq.org/wine/source/${verurlstr}/wine-${ver}.tar.bz2 -O wine-${ver}.tar.bz2 2>&1 >> $log
96+
tar xjf wine-${ver}.tar.bz2 2>&1 >> $log
97+
elif [[ "${wine2up}" =~ "${vermajor}" ]]; then
98+
wget http://dl.winehq.org/wine/source/${verurlstr}/wine-${ver}.tar.xz -O wine-${ver}.tar.xz 2>&1 >> $log
99+
tar xf wine-${ver}.tar.xz 2>&1 >> $log
100+
fi
101+
102+
echo "Build wine..." 2>&1 | tee -a $log
103+
cd wine-${ver}/ 2>&1 >> $log
104+
mkdir -p wine32 wine64 2>&1 >> $log
105+
106+
echo " build wine64..." 2>&1 | tee -a $log
107+
cd wine64 2>&1 >> $log
108+
../configure --enable-win64 CFLAGS="${CFLAGS}" 2>&1 >> $log
109+
make -j $NPROC 2>&1 >> $log
110+
111+
echo " build wine32..." 2>&1 | tee -a $log
112+
cd ../wine32 2>&1 >> $log
113+
PKG_CONFIG_PATH=/usr/lib/pkgconfig ../configure --with-wine64=../wine64 CFLAGS="${CFLAGS}" 2>&1 >> $log
114+
make -j $NPROC 2>&1 >> $log
115+
116+
echo "Install wine..." 2>&1 | tee -a $log
117+
echo " install wine32..." 2>&1 | tee -a $log
118+
make install 2>&1 >> $log
119+
120+
echo " install wine64..." 2>&1 | tee -a $log
121+
cd ../wine64 2>&1 >> $log
122+
make install 2>&1 >> $log
123+
124+
echo "Congratulation! All are done. Enjoy!" 2>&1 | tee -a $log
125+
# rm -f $log
126+
127+
# # Uninstall
128+
# cd /usr/src/wine-${ver}/wine32
129+
# make uninstall
130+
# cd /usr/src/wine-${ver}/wine64
131+
# make uninstall
132+

0 commit comments

Comments
 (0)