Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Source2 linux packaging layout #120

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions core/AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ for sdk_name in MMS.sdks:
'vsp_bridge.cpp'
]

# Source2 hack. TODO: check this more deterministically, "are we doing an x64 build?"
if binary.compiler.target.arch == 'x86':
if cxx.target.arch == 'x86':
binary.sources += ['sourcehook/sourcehook_hookmangen.cpp']
nodes = builder.Add(binary)
MMS.binaries += [nodes]
7 changes: 4 additions & 3 deletions loader/AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ def configure_library(cxx, name, linux_defines):

for cxx in MMS.all_targets:
if cxx.target.platform == 'linux':
if cxx.target.arch == 'x64':
if cxx.target.arch == 'x86_64':
configure_library(cxx, 'libserver', ['LIB_PREFIX="lib"', 'LIB_SUFFIX=".so"'])
elif cxx.target.arch == 'x86':
configure_library(cxx, 'server_i486', ['LIB_PREFIX=""', 'LIB_SUFFIX="_i486.so"'])

configure_library(cxx, 'server', ['LIB_PREFIX="lib"', 'LIB_SUFFIX=".so"'])
configure_library(cxx, 'server', ['LIB_PREFIX=""', 'LIB_SUFFIX=".so"'])
else:
configure_library(cxx, 'server', [])
19 changes: 18 additions & 1 deletion support/buildbot/PackageScript
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import os

builder.SetBuildFolder('package')

def deduce_target_sdk(path):
for sdk_name in MMS.sdks:
sdk = MMS.sdks[sdk_name]
if ('metamod.' + sdk.ext) in path:
return sdk
return None

addons_folder = builder.AddFolder('addons')
metamod_folder = builder.AddFolder(os.path.join('addons', 'metamod'))
bin_folder = builder.AddFolder(os.path.join('addons', 'metamod', 'bin'))
Expand All @@ -11,14 +18,17 @@ for cxx in MMS.all_targets:
if cxx.target.arch == 'x86_64':
if cxx.target.platform == 'windows':
bin64_folder = builder.AddFolder(os.path.join('addons', 'metamod', 'bin', 'win64'))
bin64_s2_folder = bin64_folder
builder.AddCopy(os.path.join(builder.sourcePath, 'support', 'metamod_win64.vdf'),
os.path.join('addons', 'metamod_x64.vdf'))
elif cxx.target.platform == 'linux':
bin64_folder = builder.AddFolder(os.path.join('addons', 'metamod', 'bin', 'linux64'))
bin64_s2_folder = builder.AddFolder(os.path.join('addons', 'metamod', 'bin', 'linuxsteamrt64'))
builder.AddCopy(os.path.join(builder.sourcePath, 'support', 'metamod_linux64.vdf'),
os.path.join('addons', 'metamod_x64.vdf'))
elif cxx.target.platform == 'mac':
bin64_folder = builder.AddFolder(os.path.join('addons', 'metamod', 'bin', 'osx64'))
bin64_s2_folder = bin64_folder
builder.AddCopy(os.path.join(builder.sourcePath, 'support', 'metamod_osx64.vdf'),
os.path.join('addons', 'metamod_x64.vdf'))

Expand All @@ -28,8 +38,15 @@ builder.AddCopy(os.path.join(builder.sourcePath, 'support', 'README.txt'), metam

pdb_list = []
for task in MMS.binaries:
sdk = deduce_target_sdk(task.binary.path)

if task.target.arch == 'x86_64':
builder.AddCopy(task.binary, bin64_folder)
# libserver check is a hack to make sure that binary ends up in the correct folder
# as s2 folders differ to s1 layout
if 'libserver' in task.binary.path or (sdk is not None and sdk.name in ['dota', 'cs2']):
builder.AddCopy(task.binary, bin64_s2_folder)
else:
builder.AddCopy(task.binary, bin64_folder)
else:
builder.AddCopy(task.binary, bin_folder)

Expand Down