HOWTO build wine 32bit on CentOS 7

Issues related to applications and software problems
gcomes
Posts: 7
Joined: 2014/11/12 00:22:14

HOWTO build wine 32bit on CentOS 7

Post by gcomes » 2014/11/12 17:35:46

I have seen around many messages about how it is not possible to build wine 32-bit on CentOS 7.
Although it is not straightforward, it is doable. In this small tutorial I'm going to explain how you can do it yourself.
I suggest you to do the build on a CentOS 7 installation in a virtual machine using snapshot. In this way if you make a mess
you can go back and start over again.

Below, as an attachment, you will find a small script called rpmrebuild.gz that I use to build the rpm. Save it in a place
included in your $PATH, decompress and make it executable.

Code: Select all

gunzip rpmrebuild.gz ; chmod a+x rpmrebuild
Its use is straitforward: rpmrebuild [-e] <package.src.rpm>
were the option -e allows to edit (with vi) the spec file before the build starts. The script will create the directories for RPM building
in the current directory and it will overwrite $HOME/.rpmmacros (make a backup copy of $HOME/.rpmmacros if you need to preserve its content).
Your CentOS installation should have at least all the Development packages installed. In this way the number of extra packages
you need to install is smaller. You need to add also the epel repository.

Step 1
become root and install the following packages:

Code: Select all

yum install glibc-devel libstdc++-devel icoutils openal-soft-devel prelink gstreamer-plugins-base-devel gstreamer-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
now install the following 32-bit packages:

Code: Select all

yum 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 libxslt-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 pkgconfig.i686 libtiff-devel.i686 unixODBC.i686 openldap-devel.i686 alsa-lib-devel.i686 audiofile-devel.i686 freeglut-devel.i686 giflib-devel.i686 gstreamer-devel.i686 gstreamer-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
if you dont have them, install the Development Tools:

Code: Select all

yum groupinstall "Development Tools"
Step 2
build auxiliary 32-bit packages:

download http://vault.centos.org/7.0.1406/os/Sou ... l7.src.rpm
build the 32-bit rpm:

Code: Select all

linux32 rpmrebuild chrpath-0.13-14.el7.src.rpm
remove chrpath 64-bit:

Code: Select all

yum remove chrpath
install chrpath 32-bit:

Code: Select all

yum localinstall rpmbuild/RPMS/i686/chrpath-0.13-14.el7.centos.i686.rpm
download openal-soft-1.16.0-2.el7.src.rpm or current version from: http://dl.fedoraproject.org/pub/epel/7/SRPMS/o/
build the 32-bit rpm (with spec file edit):

Code: Select all

linux32 rpmrebuild -e openal-soft-1.16.0-2.el7.src.rpm
remove the line BuildRequires: portaudio-devel (it takes too much work to compile portaudio-devel 32-bit), save and exit (ZZ)
install openal-soft and openal-soft-devel 32-bit:

Code: Select all

yum localinstall rpmbuild/RPMS/i686/openal-soft{,-devel}-1.16.0-2.el7.centos.i686.rpm
save openal-soft 32-bit rpm:

Code: Select all

cp rpmbuild/RPMS/i686/openal-soft-1.16.0-2.el7.centos.i686.rpm <destination_dir>
download nss-mdns-0.10-12.el7.src.rpm or current version from: http://dl.fedoraproject.org/pub/epel/7/SRPMS/n/
build the 32-bit rpm:

Code: Select all

linux32 rpmrebuild nss-mdns-0.10-12.el7.src.rpm
save nss-mdns 32-bit rpm:

Code: Select all

cp rpmbuild/RPMS/i686/nss-mdns-0.10-12.el7.centos.i686.rpm <destination_dir>
Step 3
build wine 32-bit:

download wine-1.7.22-1.el7.src.rpm or current version from: http://dl.fedoraproject.org/pub/epel/7/SRPMS/w/
build the 32-bit rpm (with spec file edit):

Code: Select all

linux32 rpmrebuild -e wine-1.7.22-1.el7.src.rpm
between the lines:
export CFLAGS="`echo $RPM_OPT_FLAGS | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//'` -Wno-error"
and
%configure \
insert the following line: (make winegcc generate 32-bit code)

Code: Select all

sed -i '/winegcc/s/-o /-m32 &/' tools/makedep.c
find and remove the lines:
%if 0%{?rhel} >= 7
%{__ln_s} %{_bindir}/wine64 %{buildroot}%{_bindir}/wine
%endif


find the lines:
%if 0%{?rhel} >= 7
Requires: wine-core(x86-64) = %{version}-%{release}
%else
Requires: wine-core(x86-32) = %{version}-%{release}
%endif

and delete them except the line:
Requires: wine-core(x86-32) = %{version}-%{release}

remove the line %{_libdir}/wine/winegstreamer.dll.so (I didn't manage to make configure use gstreamer), save and exit (ZZ)

If there was no error now you have build wine 32-bit. Save the rpm:

Code: Select all

cp rpmbuild/RPMS/*/* <destination_dir>
If you don't need the debuginfo rpm you can delete it:

Code: Select all

rm <destination_dir>/wine-debuginfo-1.7.22-1.el7.centos.i686.rpm
In <destination_dir> you have now all the necessary rpm to run wine 32-bit (wine, nss-mdns, openal-soft). Move the content of <destination_dir>
in an appropriate place and shutdown the virtual machine used to build wine.

Step 4
install wine 32-bit:

Assuming the wine rpms just build are in a directory called <winerpm> then you can install them with:

Code: Select all

yum localinstall <winerpm>/*
The first time you run wine you may see the following error messages:
p11-kit: couldn't load module: /usr/lib/pkcs11/p11-kit-trust.so
p11-kit: couldn't load module: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated.

it means that samba-winbind-clients, gnome-keyring.i686 and p11-kit-trust.i686 are missing. You can install samba-winbind-clients and
gnome-keyring.i686 with:

Code: Select all

yum install samba-winbind-clients gnome-keyring.i686
p11-kit-trust.i686 is not available in the CentOS 7 repository and must be build from p11-kit-0.18.7-4.el7.src.rpm. This task is left to you as exercise.
Attachments
rpmrebuild.gz
(433 Bytes) Downloaded 3994 times

aTan
Posts: 1
Joined: 2014/12/26 22:51:54

Re: HOWTO build wine 32bit on CentOS 7

Post by aTan » 2014/12/26 22:55:59

Could you please upload somewhere all built rpms?

Beluga
Posts: 2
Joined: 2015/01/19 09:10:12

Re: HOWTO build wine 32bit on CentOS 7

Post by Beluga » 2015/01/19 09:14:26

I'm trying to do this in Scientific Linux 7, but building wine 32 fails with:
+ ln -s /usr/bin/wine64 /home/test/rpmbuild/BUILDROOT/wine-1.7.22-1.el7.i386/usr/bin/wine
ln: failed to create symbolic link '/home/test/rpmbuild/BUILDROOT/wine-1.7.22-1.el7.i386/usr/bin/wine': File exists

No rpms get created.

How can I fix this?
Thanks.

gcomes
Posts: 7
Joined: 2014/11/12 00:22:14

Re: HOWTO build wine 32bit on CentOS 7

Post by gcomes » 2015/01/20 03:56:22

Beluga wrote:I'm trying to do this in Scientific Linux 7, but building wine 32 fails with:
+ ln -s /usr/bin/wine64 /home/test/rpmbuild/BUILDROOT/wine-1.7.22-1.el7.i386/usr/bin/wine
ln: failed to create symbolic link '/home/test/rpmbuild/BUILDROOT/wine-1.7.22-1.el7.i386/usr/bin/wine': File exists

No rpms get created.

How can I fix this?
Thanks.
Looks like you didn't remove the lines:

%if 0%{?rhel} >= 7
%{__ln_s} %{_bindir}/wine64 %{buildroot}%{_bindir}/wine
%endif

from the spec file, isn't it?

Beluga
Posts: 2
Joined: 2015/01/19 09:10:12

Re: HOWTO build wine 32bit on CentOS 7

Post by Beluga » 2015/02/13 07:52:30

gcomes wrote: Looks like you didn't remove the lines:

%if 0%{?rhel} >= 7
%{__ln_s} %{_bindir}/wine64 %{buildroot}%{_bindir}/wine
%endif

from the spec file, isn't it?
Thanks, that did it. I guess I fumbled as I was concentrating on making notes of my own.
I totally missed your reply - I think I must have been looking at a cached version of this topic for a week, wondering why CentOS forums take so long to approve my post.

I'm actually doing this in the role of LibreOffice QA team member, trying to find out, if a bug reporter could use SL 7 instead of SL 6 and thus solve their clipboard problem by using a different clipboard manager: https://bugs.documentfoundation.org/sho ... i?id=86416 <- It's a long story :)

My final stumbling block is this (sorry for the Finnish msgs):
sudo yum localinstall winerpm/*
Virhe: Paketti: wine-core-1.7.22-1.el7.i686 (/wine-core-1.7.22-1.el7.i686)
Vaatii: nss-mdns(x86-32)

I guess I'll just notify the bug reporter to say that they should try to build wine 32bit on SL 7 as it seems doable. He is definitely more savvy than me, so will probably succeed more easily than me!

gcomes
Posts: 7
Joined: 2014/11/12 00:22:14

Re: HOWTO build wine 32bit on CentOS 7

Post by gcomes » 2015/02/13 15:01:32

Beluga wrote:
My final stumbling block is this (sorry for the Finnish msgs):
sudo yum localinstall winerpm/*
Virhe: Paketti: wine-core-1.7.22-1.el7.i686 (/wine-core-1.7.22-1.el7.i686)
Vaatii: nss-mdns(x86-32)
In the HOWTO at the end of Step 2 there are instructions on how to build nss-mdns 32-bit. It appears like you have skipped them too.

GZU
Posts: 1
Joined: 2015/04/14 05:50:45

Re: HOWTO build wine 32bit on CentOS 7

Post by GZU » 2015/04/14 05:54:56

Thanks for the effort put into working this out and providing the detailed instructions.
I've managed to compile a working 32bit version of Wine using your instructions (for Scientific Linux 7).

p-we
Posts: 4
Joined: 2015/05/23 02:18:34

Re: HOWTO build wine 32bit on CentOS 7

Post by p-we » 2015/05/23 02:42:39

Thanks for this tutorial. I think it will be important for many users. I'm a new convert to CentOS7.1 and new to yum and rpm as I have come over from ArchLinux. I need a more stable multimedia server than Arch Linux's bleeding edge rolling release design can offer. I'm an intermediate level user (not a dev).

I believe I'm stuck in a dependency circle. The yum install command for the i686 packages above (glibc-devel.i686...) has a i686 libdrm package as a dependency which conflicts with the pre installed x86_64 version:

Code: Select all

Protected multilib versions: libdrm-2.4.56-2.el7.i686 != libdrm-2.4.56-20.intel20143.x86_64
I've thought about building a i686 version of libdrm from source with a different name so they can co-exist but I can't download the needed 32bit build dependencies. I'm also reluctant to force anything and don't want to lose half of my 64bit install if I have to erase libdrm.x86_64 first.

Any words of wisdom to make a easy fix or do I have to get a bit dirty and go against yum?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: HOWTO build wine 32bit on CentOS 7

Post by TrevorH » 2015/05/23 12:12:31

Your current libdrm is not a CentOS supplied one. The 64 bit libdrm on CentOS 7 is libdrm-2.4.56-2.el7.x86_64 not libdrm-2.4.56-20.intel20143.x86_64. The one you have came from someone else and either they need to supply a matching 32 bit one or you need to remove it and replace it with ours.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ToddAndMargo
Posts: 400
Joined: 2007/02/20 04:27:08
Location: Milky Way/Sol/Earth/USA/Nevada GMT-8

Re: HOWTO build wine 32bit on CentOS 7

Post by ToddAndMargo » 2015/05/26 06:22:05

Dear gcomes,

I rewrote your directions for Scientific Linux 7.1. I quote you heavily. Before I post to Wine's or others blogs, I would like your permission to include your writing.

You are cited in the beginning as follows:

Based on gcomes article on 2014/11/12 17:35:46 titles How to Build wine 32 on CentOS7:
viewtopic.php?f=48&t=49542

If you would feel more comfortable, I can send you the whole document. I would need an eMail address (PM me).

Many thanks,
-Todd

Post Reply