Bug#770813: /usr/bin/wine script insufficiently clever

2014-11-24 Thread Erik de Castro Lopo
Package: wine
Version: 1.6.2-16
Severity: normal

I have a number of project written in C that I cross compile from Linux
to Windows. These projects often have test programs also written in C
and these I run under Wine.

This all works fine when I'm compiling 32 bit windows binaries but for
64 bit binaries there's a bit of a problem, the /usr/bin/wine script
fails for 64 bit windows binaries although if I set some environment
variables I can run 64 bit binaries, eg:

WINARCH=wine64 WINEPREFIX=~/.wine64 wine hello64.exe

My suggestion is that if $WINEARCH and $WINEPREFIX are both empty
strings, the script could use the file command to figure out whether
the binary is 32 or 64 bits and set those variables appropriately.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable'), (500, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.17-rc5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_AU.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages wine depends on:
ii  file1:5.20-2
ii  wine32  1.6.2-16
ii  wine64  1.6.2-16

wine recommends no packages.

Versions of packages wine suggests:
pn  avscan | klamav | clamav   none
ii  binfmt-support 2.1.5-1
ii  ttf-mscorefonts-installer  3.6
pn  winbindnone

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#770813: /usr/bin/wine script insufficiently clever [patch]

2014-11-24 Thread Erik de Castro Lopo

The following seems to work for me.

--- /usr/bin/wine.orig  2014-11-03 05:33:12.0 +1100
+++ /usr/bin/wine   2014-11-24 20:35:10.081487087 +1100
@@ -6,6 +6,16 @@
 wine32=$bindir/wine32
 wine64=$bindir/wine64
 
+if test -z ${WINEARCH}${WINEPREFIX} ; then
+   if test $(file $1 | grep -c 'Intel 80386') -eq 1 ; then
+   WINEARCH=win32
+   WINEPREFIX=$HOME/.wine
+   elif test $(file $1 | grep -c 'x86-64') -eq 1 ; then
+   WINEARCH=win64
+   WINEPREFIX=$HOME/.wine64
+   fi
+fi
+
 if test -x $wine32 -a $WINEARCH != win64; then
 wine=$wine32
 elif test -x $wine64; then



-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org