Added InstallData wrapper method and used it to install icons...
...and desktop entry.
This commit is contained in:
parent
5dccfad437
commit
0b542118a8
2 changed files with 8 additions and 9 deletions
12
SConstruct
12
SConstruct
|
@ -467,16 +467,10 @@ env.Alias("install-wesnoth", [
|
|||
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
|
||||
|
|
|
@ -69,10 +69,15 @@ def hard_link(dest, src, symlink = False):
|
|||
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)})
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue