call wineDEBSUFFIX instead of wine from desktop launchers
authorMichael Gilbert <mgilbert@debian.org>
Sat, 19 Mar 2022 00:48:02 +0000 (00:48 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Sat, 19 Mar 2022 00:48:02 +0000 (00:48 +0000)
forwarded: not-needed

Gbp-Pq: Topic debianization
Gbp-Pq: Name winemenubuilder.patch

programs/winemenubuilder/Makefile.in
programs/winemenubuilder/winemenubuilder.c

index 07e2702843bff131627854e18aeaad7aa41b3bde..bfe6a0d0a871b1b00fbd432834de6745cf92770e 100644 (file)
@@ -1,6 +1,7 @@
 MODULE    = winemenubuilder.exe
 APPMODE   = -mwindows -municode
 IMPORTS   = uuid windowscodecs shell32 shlwapi ole32 user32 advapi32
+EXTRADEFS = -DDEBSUFFIX="\"${DEBSUFFIX}\""
 
 C_SRCS = \
        winemenubuilder.c
index fe4998fb3733f6a5ad47e16add228b760ac6ea89..778ac15676e3d5c7987b7b53c04dea42dc963206 100644 (file)
@@ -106,6 +106,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(menubuilder);
 #define IS_OPTION_TRUE(ch) \
     ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
 
+static const char wine_debsuffix[] = "wine" DEBSUFFIX;
+
 /* link file formats */
 
 #include "pshpack1.h"
@@ -1466,11 +1468,11 @@ static BOOL write_desktop_entry(const char *unix_link, const char *location, con
     fprintf(file, "[Desktop Entry]\n");
     fprintf(file, "Name=%s\n", linkname);
     if (prefix)
-        fprintf(file, "Exec=env WINEPREFIX=\"%s\" wine %s %s\n", prefix, path, args);
+        fprintf(file, "Exec=env WINEPREFIX=\"%s\" %s %s %s\n", prefix, wine_debsuffix, path, args);
     else if (home)
-        fprintf(file, "Exec=env WINEPREFIX=\"%s/.wine\" wine %s %s\n", home, path, args);
+        fprintf(file, "Exec=env WINEPREFIX=\"%s/.wine\" %s %s %s\n", home, wine_debsuffix, path, args);
     else
-        fprintf(file, "Exec=wine %s %s\n", path, args);
+        fprintf(file, "Exec=%s %s %s\n", wine_debsuffix, path, args);
     fprintf(file, "Type=Application\n");
     fprintf(file, "StartupNotify=true\n");
     if (descr && *descr)
@@ -2513,11 +2515,11 @@ static BOOL write_freedesktop_association_entry(const char *desktopPath, const c
         fprintf(desktop, "Name=%s\n", friendlyAppName);
         fprintf(desktop, "MimeType=%s;\n", mimeType);
         if (prefix)
-            fprintf(desktop, "Exec=env WINEPREFIX=\"%s\" wine start /ProgIDOpen %s %%f\n", prefix, progId);
+            fprintf(desktop, "Exec=env WINEPREFIX=\"%s\" %s start /ProgIDOpen %s %%f\n", prefix, wine_debsuffix, progId);
         else if (home)
-            fprintf(desktop, "Exec=env WINEPREFIX=\"%s/.wine\" wine start /ProgIDOpen %s %%f\n", home, progId);
+            fprintf(desktop, "Exec=env WINEPREFIX=\"%s/.wine\" %s start /ProgIDOpen %s %%f\n", home, wine_debsuffix, progId);
         else
-            fprintf(desktop, "Exec=wine start /ProgIDOpen %s %%f\n", progId);
+            fprintf(desktop, "Exec=%s start /ProgIDOpen %s %%f\n", wine_debsuffix, progId);
         fprintf(desktop, "NoDisplay=true\n");
         fprintf(desktop, "StartupNotify=true\n");
         if (openWithIcon)