r486 - in trunk: . examples/duke3d/data examples/duke3d/scripts scripts

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Feb 13 06:25:00 EST 2008


Author: icculus
Date: 2008-02-13 06:24:47 -0500 (Wed, 13 Feb 2008)
New Revision: 486

Added:
   trunk/examples/duke3d/data/duke3d.png
Modified:
   trunk/docs.txt
   trunk/examples/duke3d/scripts/config.lua
   trunk/platform_unix.c
   trunk/scripts/config.lua
   trunk/scripts/mojosetup_mainline.lua
Log:
More desktop menu item fixes, and updated duke3d example...appears to work now!


Modified: trunk/docs.txt
===================================================================
--- trunk/docs.txt	2008-02-13 09:36:04 UTC (rev 485)
+++ trunk/docs.txt	2008-02-13 11:24:47 UTC (rev 486)
@@ -781,8 +781,10 @@
     !!! FIXME:  Things that collect mime info themselves, like web browsers
     !!! FIXME:  and email clients, can use new apps this way, however.
 
+    !!! FIXME: there is currently no way for an installer to add submenus.
 
 
+
 Add any localized strings:
 
 If you added strings to the installer or your config file that you want

Added: trunk/examples/duke3d/data/duke3d.png
===================================================================
(Binary files differ)


Property changes on: trunk/examples/duke3d/data/duke3d.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Modified: trunk/examples/duke3d/scripts/config.lua
===================================================================
--- trunk/examples/duke3d/scripts/config.lua	2008-02-13 09:36:04 UTC (rev 485)
+++ trunk/examples/duke3d/scripts/config.lua	2008-02-13 11:24:47 UTC (rev 486)
@@ -69,6 +69,19 @@
         uniquefile = "atominst/duke3d.grp"
     },
 
+    -- Install a desktop menu item with all install types.
+    Setup.DesktopMenuItem
+    {
+        disabled = false,
+        name = "Duke Nukem 3D",
+        genericname = "Duke Nukem 3D",
+        tooltip = "Always bet on Duke!",
+        builtin_icon = false,
+        icon = "duke3d.png",  -- relative to the dest; you must install it!
+        commandline = "/home/icculus/duke3d/duke3d",
+        category = "Game",
+    },
+
     Setup.OptionGroup
     {
         description = _("Installation type"),
@@ -87,7 +100,8 @@
 
             Setup.File
             {
-                wildcards = "*.txt";  -- catch all the EULAs and READMEs.
+                -- catch all the EULAs and READMEs, and the desktop menu icon.
+                wildcards = { "*.txt", "duke3d.png" }
             },
             Setup.File
             {
@@ -114,7 +128,8 @@
 
             Setup.File
             {
-                wildcards = "*.txt";  -- catch all the EULAs and READMEs.
+                -- catch all the EULAs and READMEs, and the desktop menu icon.
+                wildcards = { "*.txt", "duke3d.png" }
             },
 
             Setup.File

Modified: trunk/platform_unix.c
===================================================================
--- trunk/platform_unix.c	2008-02-13 09:36:04 UTC (rev 485)
+++ trunk/platform_unix.c	2008-02-13 11:24:47 UTC (rev 486)
@@ -1070,7 +1070,7 @@
 
     if (path != NULL)  // it's installed on the system; use that.
     {
-        char *cmd = path;
+        char *cmd = xstrdup(util);
         char *tmp = NULL;
         int i;
         for (i = 0; argv[i]; i++)
@@ -1082,7 +1082,7 @@
             cmd = tmp;
         } // for
 
-        tmp = format("%0 >/dev/null 2>&1", cmd);
+        tmp = format("%0/%1 >/dev/null 2>&1", path, cmd);
         free(cmd);
         cmd = tmp;
         retval = (system(cmd) == 0);

Modified: trunk/scripts/config.lua
===================================================================
--- trunk/scripts/config.lua	2008-02-13 09:36:04 UTC (rev 485)
+++ trunk/scripts/config.lua	2008-02-13 11:24:47 UTC (rev 486)
@@ -106,7 +106,7 @@
             builtin_icon = false,
             icon = "icon.png",  -- relative to the dest; you must install it!
             commandline = "command-line",
-            categories = "Game",
+            category = "Game",
             mimetype = { 'application/x-mygame-map', 'application/x-mygame-url' },
         },
 

Modified: trunk/scripts/mojosetup_mainline.lua
===================================================================
--- trunk/scripts/mojosetup_mainline.lua	2008-02-13 09:36:04 UTC (rev 485)
+++ trunk/scripts/mojosetup_mainline.lua	2008-02-13 11:24:47 UTC (rev 486)
@@ -820,7 +820,7 @@
         local objtype = type(obj)
         if objtype == "nil" then
             retval = "nil"
-        elseif objtype == "number" then
+        elseif (objtype == "number") or (objtype == "boolean") then
             retval = tostring(obj)
         elseif objtype == "string" then
             retval = string.format("%q", obj)
@@ -988,8 +988,8 @@
 
 
 local function freedesktop_menuitem_filename(pkg, idx)  -- only for Unix.
-    local vendor = string.gsub(pkg.vendor, "%..*$", "", 1)  -- chop off TLD.
-    local fname = vendor .. "-" .. pkg.id .. idx .. ".desktop"
+    local vendor = string.gsub(pkg.vendor, "%.", "_")
+    local fname = vendor .. "-" .. pkg.id .. "_" .. idx .. ".desktop"
     return MojoSetup.metadatadir .. "/" .. fname
 end
 
@@ -1005,7 +1005,7 @@
             elseif MojoSetup.info.platform == "beos" then
                 MojoSetup.fatal(_("Unimplemented"))  -- !!! FIXME: write me.
             else  -- freedesktop, we hope.
-                local fname = freedesktop_menuitem_filename(pkg, idx)
+                local fname = freedesktop_menuitem_filename(pkg, i)
                 if not MojoSetup.platform.uninstalldesktopmenuitem(fname) then
                     MojoSetup.fatal(_("Failed to uninstall desktop menu item"))
                 end
@@ -1032,7 +1032,7 @@
                 "Comment=" .. item.tooltip .. "\n" ..
                 "Icon=" .. icon .. "\n" ..
                 "Exec=" .. item.commandline .. "\n" ..
-                "Categories=" .. flatten_list(item.categories) .. "\n"
+                "Categories=" .. flatten_list(item.category) .. "\n"
 
     if item.mimetype ~= nil then
         str = str .. "MimeType=" .. flatten_list(item.mimetype) .. "\n"
@@ -1044,6 +1044,10 @@
     local perms = "0644"  -- !!! FIXME
     local key = MojoSetup.metadatakey
     local desc = MojoSetup.metadatadesc
+
+    --MojoSetup.logdebug("Install FreeDesktop file")
+    --MojoSetup.logdebug(dest)
+    --MojoSetup.logdebug(str)
     install_file_from_string(dest, str, perms, desc, key)
     if not MojoSetup.platform.installdesktopmenuitem(dest) then
         MojoSetup.fatal(_("Failed to install desktop menu item"))




More information about the mojosetup-commits mailing list