You are not logged in.

#1 2018-03-05 16:06:23

E5ten
Member
Registered: 2018-01-08
Posts: 16

Multiple wine versions

On other distros I've seen that wine is installed in /opt and allows multiple wine versions, although the exact program must be specified if you have multiple versions installed, however on arch multiple wine versions conflict with each other. Is there a way (not using playonlinux) to install multiple versions of wine on arch?

Offline

#2 2018-03-05 16:11:30

loqs
Member
Registered: 2014-03-06
Posts: 9,052

Re: Multiple wine versions

Customize the PKGBUILD of one of the wine packages to install under /opt

Offline

#3 2018-03-06 05:19:10

E5ten
Member
Registered: 2018-01-08
Posts: 16

Re: Multiple wine versions

Neither of the versions I want are in the AUR

Offline

#4 2018-03-06 07:44:09

sincomil
Member
Registered: 2018-02-13
Posts: 92

Re: Multiple wine versions

If you install community/playonlinux then you can select version of wine per prefix. Playonlinux will download and install it in your home directory (not system-wide)

Last edited by sincomil (2018-03-06 07:45:15)

Offline

#5 2018-03-06 08:20:47

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 7,757

Re: Multiple wine versions

@sincomil he specifically mentioned not wanting to use playonlinux, which is understandable to a certain degree, as these wine versions are often compiled with outdated libs

@e5ten loqs isn't talking about the AUR, official packages ultimately also use PKGBUILDs as their baseline, read: https://wiki.archlinux.org/index.php/Arch_Build_System and do your customizations on the official wine PKGBUILD (and potentially resulting into a proper AUR package, if you are satisfied with the result.)

Offline

#6 2018-03-06 09:53:21

sincomil
Member
Registered: 2018-02-13
Posts: 92

Re: Multiple wine versions

oh, my bad. I did not see that point :C
But then I think you can use binaries from PoL and unpack them with tar xjvf <wine-version-bianry-package.pol> to special directory and use it.
For version management purposes better use GUI application q4wine from AUR

Last edited by sincomil (2018-03-06 09:54:12)

Offline

#7 2018-03-06 14:54:46

E5ten
Member
Registered: 2018-01-08
Posts: 16

Re: Multiple wine versions

Ok V1del I see what you mean, but I don't really understand what part of the PKGBUILD I'm supposed to change.

Offline

#8 2018-03-06 16:08:08

loqs
Member
Registered: 2014-03-06
Posts: 9,052

Re: Multiple wine versions

This is untested as I do not use multilib but this is what I had in mind.  Change prefix to include /opt.  Remove binfmt so only the wine package not installed installed in /opt will be used bia binfmt detection.
Remove install file as that is only needed for binfmt support.  Remove conflicts as it can be installed alongside wine.  Remove provides as it does not provide the binaries in /usr/bin etc.

diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 5fa4cea..9fd5ee7 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -5,7 +5,7 @@
 # Contributor: Eduardo Romero <eduardo@archlinux.org>
 # Contributor: Giovanni Scafora <giovanni@archlinux.org>
 
-pkgname=wine-staging
+pkgname=wine-staging-opt
 pkgver=3.3
 pkgrel=1
 
@@ -14,14 +14,12 @@ _pkgbasever=${pkgver/rc/-rc}
 source=(https://dl.winehq.org/wine/source/3.x/wine-$_pkgbasever.tar.xz{,.sign}
         "wine-staging-v$_pkgbasever.tar.gz::https://github.com/wine-staging/wine-staging/archive/v$_pkgbasever.tar.gz"
         harmony-fix.diff
-        30-win32-aliases.conf
-        wine-binfmt.conf)
+        30-win32-aliases.conf)
 sha512sums=('c9e4c75e94d745837208bf877b19c4e4e46df1e78082d21e716f52c9f9d93eaabbec8bf34783cda68e4275f53e37929b81ac128e5b8a13c1e5035223b2621d6a'
             'SKIP'
             '02d48a9c403b93d01ca37b74af5dc81f86e49c72d67f194c71ccebd4556fa72c473728a1b1f9d5325c6f85f4e41bb7072a1183a2d81cafa8888e00dc53d12166'
             'b86edf07bfc560f403fdfd5a71f97930ee2a4c3f76c92cc1a0dbb2e107be9db3bed3a727a0430d8a049583c63dd11f5d4567fb7aa69b193997c6da241acc4f2e'
-            '6e54ece7ec7022b3c9d94ad64bdf1017338da16c618966e8baf398e6f18f80f7b0576edf1d1da47ed77b96d577e4cbb2bb0156b0b11c183a0accf22654b0a2bb'
-            'bdde7ae015d8a98ba55e84b86dc05aca1d4f8de85be7e4bd6187054bfe4ac83b5a20538945b63fb073caab78022141e9545685e4e3698c97ff173cf30859e285')
+            '6e54ece7ec7022b3c9d94ad64bdf1017338da16c618966e8baf398e6f18f80f7b0576edf1d1da47ed77b96d577e4cbb2bb0156b0b11c183a0accf22654b0a2bb')
 validpgpkeys=(5AC1A08B03BD7A313E0A955AF5E6E9EEB9461DD7
               DA23579A74D4AD9AF9D3F945CEFAC8EAAF17519D)
 
@@ -104,10 +102,6 @@ optdepends=(
   samba           dosbox
 )
 
-provides=("wine=$pkgver" "wine-wow64=$pkgver")
-conflicts=('wine' 'wine-wow64')
-install=wine.install
-
 prepare() {
   # Allow ccache to work
   mv wine-$_pkgbasever $pkgname
@@ -137,8 +131,8 @@ build() {
 
   cd "$srcdir/$pkgname-64-build"
   ../$pkgname/configure \
-    --prefix=/usr \
-    --libdir=/usr/lib \
+    --prefix=/opt/usr \
+    --libdir=/opt/usr/lib \
     --with-x \
     --with-gstreamer \
     --enable-win64 \
@@ -151,11 +145,11 @@ build() {
   export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
   cd "$srcdir/$pkgname-32-build"
   ../$pkgname/configure \
-    --prefix=/usr \
+    --prefix=/opt/usr \
     --with-x \
     --with-gstreamer \
     --with-xattr \
-    --libdir=/usr/lib32 \
+    --libdir=/opt/usr/lib32 \
     --with-wine64="$srcdir/$pkgname-64-build"
 
   make
@@ -165,21 +159,20 @@ package() {
   msg2 "Packaging Wine-32..."
   cd "$srcdir/$pkgname-32-build"
 
-  make prefix="$pkgdir/usr" \
-    libdir="$pkgdir/usr/lib32" \
-    dlldir="$pkgdir/usr/lib32/wine" install
+  make prefix="$pkgdir/opt/usr" \
+    libdir="$pkgdir/opt/usr/lib32" \
+    dlldir="$pkgdir/opt/usr/lib32/wine" install
 
   msg2 "Packaging Wine-64..."
   cd "$srcdir/$pkgname-64-build"
-  make prefix="$pkgdir/usr" \
-    libdir="$pkgdir/usr/lib" \
-    dlldir="$pkgdir/usr/lib/wine" install
+  make prefix="$pkgdir/opt/usr" \
+    libdir="$pkgdir/opt/usr/lib" \
+    dlldir="$pkgdir/opt/usr/lib/wine" install
 
   # 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"
-  install -Dm 644 "$srcdir/wine-binfmt.conf" "$pkgdir/usr/lib/binfmt.d/wine.conf"
+  install -m644 "$srcdir/30-win32-aliases.conf" "$pkgdir/etc/fonts/conf.avail/30-win32-opt-aliases.conf"
+  ln -s ../conf.avail/30-win32-opt-aliases.conf "$pkgdir/etc/fonts/conf.d/30-win32-opt-aliases.conf"
 }
 
 # vim:set ts=8 sts=2 sw=2 et:
diff --git a/trunk/wine-binfmt.conf b/trunk/wine-binfmt.conf
deleted file mode 100644
index 4d43073..0000000
--- a/trunk/wine-binfmt.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# Start WINE on Windows executables
-:DOSWin:M::MZ::/usr/bin/wine:
diff --git a/trunk/wine.install b/trunk/wine.install
deleted file mode 100644
index cbe10cc..0000000
--- a/trunk/wine.install
+++ /dev/null
@@ -1,7 +0,0 @@
-post_install() {
-  echo "Run 'systemctl restart systemd-binfmt' in order to make the wine binfmt available on your system."
-}
-
-post_remove() {
-  echo "binfmt binary formats will be updated at reboot"
-}

Edit:
change pkgname to include opt
Edit2:
built in a clean chroot everything but the /etc/fonts files is under /opt as intended.

Last edited by loqs (2018-03-06 17:33:59)

Offline

#9 2018-03-06 17:28:54

E5ten
Member
Registered: 2018-01-08
Posts: 16

Re: Multiple wine versions

Thanks! I'll give that a shot when I get to my own computer.
Edit: So with some testing to confirm it works would that be worth putting in the AUR? Maybe after making it so something like /usr/bin/wine-staging-opt symlinks to the installed wine-staging in /opt?

Last edited by E5ten (2018-03-06 18:47:43)

Offline

#10 2018-03-06 23:04:15

E5ten
Member
Registered: 2018-01-08
Posts: 16

Re: Multiple wine versions

Would it also work to set all instances of /usr to /opt/wine-staging/usr instead of /opt/usr, that way allowing for multiple -opt versions of wine? you could then have wine-stable-opt installed to /opt/wine-stable/usr while keeping the normal wine package, which provides wine-devel, in the normally installed place.

Offline

#11 2018-03-06 23:15:14

loqs
Member
Registered: 2014-03-06
Posts: 9,052

Re: Multiple wine versions

No idea why dont you try it and see.  You could also consider adding symlinks from /usr/bin/wine-${SUFFIX} to /opt/wine-${SUFFIX}/usr/bin/wine etc.

Offline

#12 2018-03-06 23:36:03

E5ten
Member
Registered: 2018-01-08
Posts: 16

Re: Multiple wine versions

I had the same idea lol, it seems to be working, I symlinked everything in /opt/wine-staging/usr/bin to *-staging in /usr/bin, the * obviously representing what it's original name is.
Edit: the only thing I need to figure out a workaround for is setting the default wineprefix for staging while keeping my normally installed version of wine using ~/.wine as its prefix.
Edit 2: There actually are problems with that sadly, for example a symlink from /usr/bin/winecfg-staging to /opt/winecfg-staging/ will attempt to run ~/.wine-staging/drive_c/windows/system32/winecfg-staging.exe instead of winecfg.exe. so I guess I'll just have to live with specifying the path of staging if I wish to use it.

Last edited by E5ten (2018-03-07 00:06:12)

Offline

#13 2018-03-07 00:50:37

loqs
Member
Registered: 2014-03-06
Posts: 9,052

Re: Multiple wine versions

There might be a way around both issues in one:
You create a shell script /usr/bin/wine-staging and symlink all the other binaries to it.
Shell scripting is not my area of expertise and this is untested but this is what I was imagining

#!/usr/bin/bash
exe=${0%-staging}
WINEPREFIX=${WINEPREFIX:"~/.wine-staging"}
exec /opt/wine-staging/usr/bin/${exe} "$@"

edit:
string to delete is -staging not -opt

Last edited by loqs (2018-03-07 00:51:41)

Offline

#14 2018-03-07 00:56:04

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,853

Re: Multiple wine versions

You could use a "wine-staging" shellscript which runs `exec /opt/wine-staging/usr/bin/winecfg "$@"`

EDIT: loqs beat me to it.

The only thing I would change, is that you could just use #!/bin/sh for this (which runs faster if your /bin/sh is some lightweight POSIX shell like dash or busybox ash).
Also, the correct format for fallback values in a variable is ${WINEPREFIX:-"$HOME/.wine-staging"}, note the use of :- instead of :

The former specifies a default value, the latter requests an integer offset. smile
From the bash manpage:

:
       ${parameter:-word}
              Use Default Values.  If parameter is unset or null, the expansion of word is substituted.  Otherwise, the value of parameter is sub‐
              stituted.
       ${parameter:=word}
              Assign  Default  Values.   If parameter is unset or null, the expansion of word is assigned to parameter.  The value of parameter is
              then substituted.  Positional parameters and special parameters may not be assigned to in this way.
       ${parameter:?word}
              Display Error if Null or Unset.  If parameter is null or unset, the expansion of word (or a message to that effect if  word  is  not
              present) is written to the standard error and the shell, if it is not interactive, exits.  Otherwise, the value of parameter is sub‐
              stituted.
       ${parameter:+word}
              Use Alternate Value.  If parameter is null or unset, nothing is substituted, otherwise the expansion of word is substituted.
       ${parameter:offset}
       ${parameter:offset:length}
              Substring Expansion.  Expands to up to length characters of the value of parameter starting at the character  specified  by  offset.
              If  parameter is @, an indexed array subscripted by @ or *, or an associative array name, the results differ as described below.  If
              length is omitted, expands to the substring of the value of parameter starting at the character specified by offset and extending to
              the end of the value.  length and offset are arithmetic expressions (see ARITHMETIC EVALUATION below).

Last edited by eschwartz (2018-03-07 01:02:24)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#15 2018-03-07 02:29:02

E5ten
Member
Registered: 2018-01-08
Posts: 16

Re: Multiple wine versions

So that seems like it'll work with some small modification, but currently I get a permission denied error with that method, any idea why that might be?
Edit: I seem to have got it by removing /usr/bin from the bottom line and just specifying my exact wineprefix in the wineprefix line as well as putting export in front of it, I also made the file as "use-wine-staging" because wine-staging would be taken by the wine binary staging version. Thanks for all the help!

Last edited by E5ten (2018-03-07 06:14:02)

Offline

#16 2018-05-29 21:32:28

hazote
Member
Registered: 2013-07-24
Posts: 32

Re: Multiple wine versions

hello,
this is exactly What I wanna do: play different game that need different version of wine, without POL.

I have some games that I have download with a wine environment preconfigured, and this works even if I have on computer the actual official wine package from pacman.
I don't understand very well all.

Did you manage to get this working ?

Offline

Board footer

Powered by FluxBB