2014-11-20 10:01:46 +01:00
|
|
|
# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
|
2009-08-30 09:46:56 +02:00
|
|
|
import os
|
|
|
|
|
2013-12-30 23:50:59 +01:00
|
|
|
builder.SetBuildFolder('package')
|
|
|
|
|
|
|
|
folder_list = [
|
|
|
|
'addons/sourcemod',
|
|
|
|
'addons/sourcemod/bin',
|
|
|
|
'addons/sourcemod/plugins',
|
|
|
|
'addons/sourcemod/plugins/disabled',
|
|
|
|
'addons/sourcemod/gamedata',
|
|
|
|
'addons/sourcemod/gamedata/core.games',
|
|
|
|
'addons/sourcemod/gamedata/sdkhooks.games',
|
|
|
|
'addons/sourcemod/gamedata/sdktools.games',
|
|
|
|
'addons/sourcemod/gamedata/sm-cstrike.games',
|
|
|
|
'addons/sourcemod/configs',
|
|
|
|
'addons/sourcemod/configs/geoip',
|
|
|
|
'addons/sourcemod/translations',
|
|
|
|
'addons/sourcemod/logs',
|
|
|
|
'addons/sourcemod/extensions',
|
|
|
|
'addons/sourcemod/data',
|
|
|
|
'addons/sourcemod/configs/sql-init-scripts',
|
|
|
|
'addons/sourcemod/configs/sql-init-scripts/mysql',
|
2021-05-09 01:46:08 +02:00
|
|
|
'addons/sourcemod/configs/sql-init-scripts/pgsql',
|
2013-12-30 23:50:59 +01:00
|
|
|
'addons/sourcemod/configs/sql-init-scripts/sqlite',
|
|
|
|
'addons/sourcemod/scripting',
|
|
|
|
'addons/sourcemod/scripting/include',
|
|
|
|
'addons/sourcemod/scripting/admin-flatfile',
|
|
|
|
'addons/sourcemod/scripting/adminmenu',
|
|
|
|
'addons/sourcemod/scripting/testsuite',
|
|
|
|
'addons/sourcemod/scripting/basecommands',
|
|
|
|
'addons/sourcemod/scripting/basecomm',
|
|
|
|
'addons/sourcemod/scripting/funvotes',
|
|
|
|
'addons/sourcemod/scripting/basevotes',
|
|
|
|
'addons/sourcemod/scripting/basebans',
|
|
|
|
'addons/sourcemod/scripting/funcommands',
|
|
|
|
'addons/sourcemod/scripting/playercommands',
|
|
|
|
'addons/metamod',
|
|
|
|
'cfg/sourcemod',
|
2009-08-30 09:46:56 +02:00
|
|
|
]
|
|
|
|
|
2020-08-16 06:25:25 +02:00
|
|
|
if 'x86_64' in SM.target_archs:
|
2017-12-20 08:56:23 +01:00
|
|
|
folder_list.extend([
|
|
|
|
'addons/sourcemod/bin/x64',
|
|
|
|
'addons/sourcemod/extensions/x64',
|
2020-10-19 19:02:20 +02:00
|
|
|
])
|
2017-12-20 08:56:23 +01:00
|
|
|
|
2021-05-09 01:46:08 +02:00
|
|
|
helpers = SM.package_helpers
|
|
|
|
helpers.builder = builder
|
|
|
|
folder_map = helpers.CreateFolders(folder_list)
|
2013-12-30 23:50:59 +01:00
|
|
|
|
|
|
|
# Copy binaries.
|
|
|
|
for cxx_task in SM.binaries:
|
2020-10-03 01:01:30 +02:00
|
|
|
# mms expects our loader (sourcemod_mm) to exist in /bin/
|
|
|
|
if cxx_task.target.arch == 'x86_64' and not 'sourcemod_mm' in cxx_task.binary.path:
|
2017-12-20 08:56:23 +01:00
|
|
|
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/bin/x64'])
|
|
|
|
else:
|
|
|
|
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/bin'])
|
2013-12-30 23:50:59 +01:00
|
|
|
for cxx_task in SM.extensions:
|
2020-08-16 06:25:25 +02:00
|
|
|
if cxx_task.target.arch == 'x86_64':
|
2017-12-20 08:56:23 +01:00
|
|
|
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions/x64'])
|
|
|
|
else:
|
|
|
|
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions'])
|
2020-08-16 06:25:25 +02:00
|
|
|
for cxx_task in SM.spvm:
|
|
|
|
if cxx_task.target.arch == 'x86':
|
|
|
|
dest_path = os.path.join('addons/sourcemod/bin',
|
|
|
|
'sourcepawn.jit.x86' + os.path.splitext(cxx_task.binary.path)[1])
|
|
|
|
builder.AddCopy(cxx_task.binary, dest_path)
|
|
|
|
elif cxx_task.target.arch == 'x86_64':
|
|
|
|
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/bin/x64'])
|
2020-10-19 19:02:20 +02:00
|
|
|
|
2021-05-09 01:46:08 +02:00
|
|
|
helpers.CopySpcomp('addons/sourcemod/scripting')
|
2013-12-30 23:51:01 +01:00
|
|
|
|
2013-12-30 23:51:00 +01:00
|
|
|
# Export PDB files. We write to a file in the build folder which is pretty
|
|
|
|
# verboten, but it's okay if it's in the root since AMBuild will never try
|
|
|
|
# to rmdir the root.
|
2017-12-20 08:56:23 +01:00
|
|
|
full_binary_list = SM.binaries + SM.extensions + SM.spcomp_bins
|
2013-12-30 23:51:00 +01:00
|
|
|
with open(os.path.join(builder.buildPath, 'pdblog.txt'), 'w') as fp:
|
|
|
|
for task in full_binary_list:
|
|
|
|
fp.write(task.debug.path + '\n')
|
|
|
|
|
2013-12-30 23:50:59 +01:00
|
|
|
# Copy plugins.
|
|
|
|
disabled_plugins = set([
|
|
|
|
'admin-sql-prefetch.smx',
|
|
|
|
'admin-sql-threaded.smx',
|
|
|
|
'sql-admin-manager.smx',
|
|
|
|
'mapchooser.smx',
|
|
|
|
'randomcycle.smx',
|
|
|
|
'rockthevote.smx',
|
|
|
|
'nominations.smx',
|
|
|
|
])
|
|
|
|
|
|
|
|
for smx_file in SM.smx_files:
|
|
|
|
smx_entry = SM.smx_files[smx_file]
|
|
|
|
if smx_file in disabled_plugins:
|
|
|
|
builder.AddCopy(smx_entry, folder_map['addons/sourcemod/plugins/disabled'])
|
|
|
|
else:
|
|
|
|
builder.AddCopy(smx_entry, folder_map['addons/sourcemod/plugins'])
|
|
|
|
|
|
|
|
# Do all straight-up file copies from the source tree.
|
2021-05-09 01:46:08 +02:00
|
|
|
helpers.CopyIncludes('addons/sourcemod/scripting/include')
|
2014-03-21 17:30:47 +01:00
|
|
|
|
2021-05-09 01:46:08 +02:00
|
|
|
helpers.CopyFiles('configs', 'addons/sourcemod/configs')
|
|
|
|
helpers.CopyFiles('configs/cfg', 'cfg/sourcemod')
|
|
|
|
helpers.CopyFiles('configs/metamod', 'addons/metamod')
|
|
|
|
helpers.CopyFiles('configs/sql-init-scripts/mysql', 'addons/sourcemod/configs/sql-init-scripts/mysql')
|
|
|
|
helpers.CopyFiles('configs/sql-init-scripts/pgsql', 'addons/sourcemod/configs/sql-init-scripts/pgsql')
|
|
|
|
helpers.CopyFiles('configs/sql-init-scripts/sqlite', 'addons/sourcemod/configs/sql-init-scripts/sqlite')
|
|
|
|
helpers.CopyFiles('gamedata', 'addons/sourcemod/gamedata')
|
|
|
|
helpers.CopyFiles('gamedata/sdkhooks.games', 'addons/sourcemod/gamedata/sdkhooks.games')
|
|
|
|
helpers.CopyFiles('gamedata/sdktools.games', 'addons/sourcemod/gamedata/sdktools.games')
|
|
|
|
helpers.CopyFiles('gamedata/core.games', 'addons/sourcemod/gamedata/core.games')
|
|
|
|
helpers.CopyFiles('gamedata/sm-cstrike.games', 'addons/sourcemod/gamedata/sm-cstrike.games')
|
|
|
|
helpers.CopyFiles('plugins', 'addons/sourcemod/scripting', '.sp')
|
|
|
|
helpers.CopyFiles('translations', 'addons/sourcemod/translations')
|
|
|
|
helpers.CopyFiles('licenses', 'addons/sourcemod')
|
|
|
|
helpers.CopyFiles('plugins/admin-flatfile', 'addons/sourcemod/scripting/admin-flatfile')
|
|
|
|
helpers.CopyFiles('plugins/adminmenu', 'addons/sourcemod/scripting/adminmenu')
|
|
|
|
helpers.CopyFiles('plugins/testsuite', 'addons/sourcemod/scripting/testsuite')
|
|
|
|
helpers.CopyFiles('plugins/basecommands', 'addons/sourcemod/scripting/basecommands')
|
|
|
|
helpers.CopyFiles('plugins/basecomm', 'addons/sourcemod/scripting/basecomm')
|
|
|
|
helpers.CopyFiles('plugins/funvotes', 'addons/sourcemod/scripting/funvotes')
|
|
|
|
helpers.CopyFiles('plugins/basevotes', 'addons/sourcemod/scripting/basevotes')
|
|
|
|
helpers.CopyFiles('plugins/basebans', 'addons/sourcemod/scripting/basebans')
|
|
|
|
helpers.CopyFiles('plugins/funcommands', 'addons/sourcemod/scripting/funcommands')
|
|
|
|
helpers.CopyFiles('plugins/playercommands', 'addons/sourcemod/scripting/playercommands')
|