Author: loonycyborg
Date: Thu Oct 16 19:48:05 2008
New Revision: 30204

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30204&view=rev
Log:
Added InstallData wrapper method and used it to install icons and
desktop entry.

Modified:
    trunk/SConstruct
    trunk/scons/install.py

Modified: trunk/SConstruct
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/SConstruct?rev=30204&r1=30203&r2=30204&view=diff
==============================================================================
--- trunk/SConstruct (original)
+++ trunk/SConstruct Thu Oct 16 19:48:05 2008
@@ -467,16 +467,10 @@
                 install_data, install_manual])
 if have_client_prereqs and have_X and env["desktop_entry"]:
      if sys.platform == "darwin":
-         env.Alias("install-wesnoth",
-            env.Install(icondir,
-                            "icons/wesnoth-icon-Mac.png"))
+         env.InstallData("icondir", "wesnoth", "icons/wesnoth-icon-Mac.png")
      else:
-         env.Alias("install-wesnoth",
-            env.Install(icondir,
-                            "icons/wesnoth-icon.png"))
-     env.Alias("install-wesnoth",
-         env.Install(desktopdir,
-                         "icons/wesnoth.desktop"))
+         env.InstallData("icondir", "wesnoth", "icons/wesnoth-icon.png")
+     env.InstallData("desktopdir", "wesnoth", "icons/wesnoth.desktop")
 InstallLocalizedManPage("install-wesnoth", "wesnoth.6", env)
 
 # Python tools

Modified: trunk/scons/install.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/scons/install.py?rev=30204&r1=30203&r2=30204&view=diff
==============================================================================
--- trunk/scons/install.py (original)
+++ trunk/scons/install.py Thu Oct 16 19:48:05 2008
@@ -69,10 +69,15 @@
 HardLink = ActionFactory(hard_link,
                          lambda dest, src: 'Hardlinking %s to %s' % (src, 
dest))
 
+def InstallData(env, datadir, component, source):
+    installdir = os.path.join(env["destdir"], env[datadir].lstrip("/"))
+    env.Alias("install-" + component, env.Install(installdir, source))
+
 def generate(env):
     #env.AddMethod(InstallWithSuffix)
     from SCons.Script.SConscript import SConsEnvironment
     SConsEnvironment.InstallWithSuffix = InstallWithSuffix
+    SConsEnvironment.InstallData = InstallData
 
     
env.Append(BUILDERS={'InstallFiltered':Builder(action=InstallFilteredHook)})
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to