Author: gnorton
Date: 2005-03-24 13:35:15 -0500 (Thu, 24 Mar 2005)
New Revision: 42227

Modified:
   trunk/mcs/tools/macpack/ChangeLog
   trunk/mcs/tools/macpack/LOADER
   trunk/mcs/tools/macpack/MacPack.cs
Log:
2005-03-24  Geoff Norton  <[EMAIL PROTECTED]>

        * MacPack.cs:
          LOADER:
                Add support for macpacking Gtk#/X11 applications.




Modified: trunk/mcs/tools/macpack/ChangeLog
===================================================================
--- trunk/mcs/tools/macpack/ChangeLog   2005-03-24 18:00:11 UTC (rev 42226)
+++ trunk/mcs/tools/macpack/ChangeLog   2005-03-24 18:35:15 UTC (rev 42227)
@@ -1,3 +1,9 @@
+2005-03-24  Geoff Norton  <[EMAIL PROTECTED]>
+
+       * MacPack.cs:
+         LOADER:
+               Add support for macpacking Gtk#/X11 applications.
+
 2005-02-01  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * Makefile (EXTRA_DISTFILES): Distribute the resource files too.

Modified: trunk/mcs/tools/macpack/LOADER
===================================================================
--- trunk/mcs/tools/macpack/LOADER      2005-03-24 18:00:11 UTC (rev 42226)
+++ trunk/mcs/tools/macpack/LOADER      2005-03-24 18:35:15 UTC (rev 42227)
@@ -7,6 +7,7 @@
 # bundle maker.
 #
 
+X11_MODE=%X11_MODE%
 MWF_MODE=%MWF_MODE%
 COCOASHARP_MODE=%COCOASHARP_MODE%
 
@@ -15,7 +16,11 @@
 APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] 
!= "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
 
 # Fetch the app name (its our own name)
-APP_NAME=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+1] 
!= "") {idx++} printf("%s.exe", patharr[idx]); }'`
+if [ "$X11_MODE" -eq "1" ]; then
+       APP_NAME=`echo $0 | awk '{split($0,patharr,"/"); idx=1; 
while(patharr[idx+1] != "") {idx++} printf("%s", patharr[idx]); }'`
+else
+       APP_NAME=`echo $0 | awk '{split($0,patharr,"/"); idx=1; 
while(patharr[idx+1] != "") {idx++} printf("%s.exe", patharr[idx]); }'`
+fi
 
 # Setup the environment for MWF if needed
 if [ "$MWF_MODE" -eq "1" ]; then
@@ -30,4 +35,9 @@
 fi
 
 cd $APP_PATH/Contents/Resources
-mono $APP_NAME
+
+if [ "$X11_MODE" -eq "1" ]; then
+       open-x11 $APP_NAME
+else
+       mono $APP_NAME
+fi

Modified: trunk/mcs/tools/macpack/MacPack.cs
===================================================================
--- trunk/mcs/tools/macpack/MacPack.cs  2005-03-24 18:00:11 UTC (rev 42226)
+++ trunk/mcs/tools/macpack/MacPack.cs  2005-03-24 18:35:15 UTC (rev 42227)
@@ -56,7 +56,11 @@
                                        }
                                }
                        }
-                       File.Copy (opts.assembly, Path.Combine (opts.output, 
String.Format ("{0}.app/Contents/Resources/{0}.exe", opts.appname))); 
+                       if (opts.mode <= 2) {
+                               File.Copy (opts.assembly, Path.Combine 
(opts.output, String.Format ("{0}.app/Contents/Resources/{0}.exe", 
opts.appname))); 
+                       } else {
+                               File.Copy (opts.assembly, Path.Combine 
(opts.output, String.Format ("{0}.app/Contents/Resources/{0}", opts.appname))); 
+                       }
 
                        Stream s = Assembly.GetEntryAssembly 
().GetManifestResourceStream ("LOADER");
                        BinaryReader reader = new BinaryReader (s);
@@ -69,15 +73,23 @@
                                case 0:
                                        script = script.Replace ("%MWF_MODE%", 
"0");
                                        script = script.Replace 
("%COCOASHARP_MODE%", "0");
+                                       script = script.Replace ("%X11_MODE%", 
"0");
                                        break;
                                case 1:
                                        script = script.Replace ("%MWF_MODE%", 
"1");
                                        script = script.Replace 
("%COCOASHARP_MODE%", "0");
+                                       script = script.Replace ("%X11_MODE%", 
"0");
                                        break;
                                case 2:
                                        script = script.Replace ("%MWF_MODE%", 
"0");
                                        script = script.Replace 
("%COCOASHARP_MODE%", "1");
+                                       script = script.Replace ("%X11_MODE%", 
"0");
                                        break;
+                               case 3:
+                                       script = script.Replace ("%MWF_MODE%", 
"0");
+                                       script = script.Replace 
("%COCOASHARP_MODE%", "0");
+                                       script = script.Replace ("%X11_MODE%", 
"1");
+                                       break;
                        }
                        data = Encoding.ASCII.GetBytes (script);
                        writer.Write (data, 0, data.Length);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to