winelauncher patch

Ove Kaaven ovek at arcticnet.no
Wed Feb 21 13:21:33 CST 2001


While packaging the new release as a .deb package, I did a few changes in
my packaging (removed the explicit rpath stuff in the build script, among
other things), and decided to patch winelauncher into working correctly.
Here's the non-debian-specific parts of what I did.

Explanations (mostly for Jeremy):

Hunk 1: WINESERVERBIN isn't used anywhere in this script, seems the
variable should be called WINESERVER. And since WINEDLLPATH is set to
WINELIBDLLS, it really should be initialized to the libdir (which is in
/usr/lib/wine in my package), so that wine can still find the dlls
whenever we decide to remove the LD_LIBRARY_PATH stuff.

Hunk 2:
real_name=`find $0` don't find anything if the user typed "wine" or
something, wine is in /usr/bin, which is in PATH, but the cwd is ~...
rather run it through `which $0` first. Also, the symlink it's reading
don't have to be absolute (my symlinks are relative), deal with that.

Hunk 3:
libntdll.so is more of a core dll than libuser.so IMHO (especially since
libuser.so is just a symlink to libuser32.so)

Hunk 4:
Detect invocation of winelib apps, e.g. regapi as a symlink to wine, with
regapi.so in the same dir, when wine equals the winelauncher. Use
WINEPRELOAD to handle it. (I assume exec -a would be a bashism)

Hunk 5:
If it's a winelib app, it doesn't need arguments...


ChangeLog entry:
Made the winelauncher support winelib app invocations. Fixed a few
file path issues.

--- wine-0.0.20010216.orig/tools/winelauncher.in
+++ wine-0.0.20010216/tools/winelauncher.in
@@ -29,8 +29,8 @@
 exec_prefix=@exec_prefix@
 WINEBIN=@bindir@
 WINELIB=@libdir@
-WINESERVERBIN=
-WINELIBDLLS=
+WINESERVER=
+WINELIBDLLS=@libdir@
 
 #------------------------------------------------------------------------------
 #  Establish Color Scheme
@@ -74,10 +74,18 @@
 #    of the actual script we're running (and lets remove at least
 #    one level of symlinking).
 #------------------------------------------------------------------------------
-real_name=`find $0 -type l -printf "%l\n"`
+argv0_path=`which $0`
+if [ -z $argv0_path ] ; then
+    argv0_path=$0
+fi
+
+real_name=`find $argv0_path -type l -printf "%l\n"`
 if [ ! $real_name ]; then
-    real_name=$0;
+    real_name=$argv0_path
+elif [ ! -x $real_name ]; then
+    real_name=`find $argv0_path -printf "%h\n"`/$real_name
 fi
+
 argv0_dir=`find $real_name -printf "%h\n"`
 
 if [ -z $argv0_dir ] ; then
@@ -130,7 +138,7 @@
     WINESERVER=$WINEBIN/server/wineserver
 fi
 
-if [ -r $WINELIB/dlls/libuser.so ] ; then
+if [ -r $WINELIB/dlls/libntdll.so ] ; then
     WINELIBDLLS=$WINELIB/dlls
 fi
 
@@ -161,6 +169,16 @@
 
 
 #------------------------------------------------------------------------------
+#  Handle winelib apps going through here
+#------------------------------------------------------------------------------
+winelib=0
+if [ -f $argv0_path.so ] ; then
+    winelib=1
+    export WINEPRELOAD=$argv0_path.so
+fi
+
+
+#------------------------------------------------------------------------------
 #  No arguments?  Help 'em out
 #------------------------------------------------------------------------------
 always_see_output=0
@@ -171,6 +189,10 @@
 
 if [ $# -eq 1 -a foo$1 = foo ] ; then
     no_args=1
+fi
+
+if [ $winelib -eq 1 ] ; then
+    no_args=0
 fi
 
 if [ $no_args -eq 1 ] ; then





More information about the wine-patches mailing list