Merge pull request 'MacOS P2P Hashlink and Krom' (#11) from Dante/LNXSDK:main into main

Reviewed-on: #11
This commit is contained in:
2026-10-20 23:48:24 +00:00
14 changed files with 41 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1286,13 +1286,23 @@ def build_success():
else:
krom_location = sdk_path + '/Krom/Krom.app'
shutil.copytree(krom_location, files_path + '/Krom.app')
app_path = files_path + '/Krom.app'
app_name = lnx.utils.safestr(wrd.lnx_project_name)
os.rename(os.path.join(app_path, 'Contents/MacOS/Krom'),
os.path.join(app_path, 'Contents/MacOS/' + app_name))
subprocess.call(['/usr/libexec/PlistBuddy', '-c', 'Set :CFBundleExecutable ' + app_name,
os.path.join(app_path, 'Contents/Info.plist')])
deploy_dir = os.path.join(app_path, 'Contents/Resources/Deployment')
os.makedirs(deploy_dir, exist_ok=True)
game_files = os.listdir(files_path)
for f in game_files:
f = files_path + '/' + f
if os.path.isfile(f):
shutil.move(f, files_path + '/Krom.app/Contents/MacOS')
krom_exe = lnx.utils.safestr(wrd.lnx_project_name) + '.app'
os.rename(files_path + '/Krom.app', files_path + '/' + krom_exe)
shutil.move(f, deploy_dir)
shutil.rmtree(os.path.join(app_path, 'Contents/_CodeSignature'), ignore_errors=True)
subprocess.call(['codesign', '--force', '--deep', '--sign', '-', app_path])
krom_exe = app_name + '.app'
os.rename(app_path, files_path + '/' + krom_exe)
# Rename
ext = state.target.split('-')[-1] # krom-windows

View File

@ -16,16 +16,39 @@ project.addDefine('RTC_STATIC');
project.addDefine('MBEDTLS_ALLOW_PRIVATE_ACCESS');
project.addDefine('MBEDTLS_SSL_DTLS_SRTP');
project.addLibFor('x64', path.join(__dirname, 'lib/datachannel-static'));
project.addLibFor('x64', path.join(__dirname, 'lib/juice-static'));
project.addLibFor('x64', path.join(__dirname, 'lib/usrsctp'));
project.addLibFor('x64', path.join(__dirname, 'lib/MbedTLS'));
if (platform === Platform.Windows) {
project.addLibFor('x64', path.join(__dirname, 'lib/datachannel-static'));
project.addLibFor('x64', path.join(__dirname, 'lib/juice-static'));
project.addLibFor('x64', path.join(__dirname, 'lib/usrsctp'));
project.addLibFor('x64', path.join(__dirname, 'lib/MbedTLS'));
project.addLib('ws2_32');
project.addLib('Crypt32');
project.addLib('bcrypt');
}
else if (platform === Platform.OSX) {
// macOS links prebuilt .a (libdatachannel 0.24.6, mbedtls 3.6.4, OpenSSL backend) with 'brew install openssl@3' for the static ssl/crypto archives below
const isArm64 = arch === 'arm64' || (arch === 'default' && process.arch === 'arm64');
const libdir = path.join(__dirname, 'lib', isArm64 ? 'macos_arm64' : 'macos_x64');
project.addLinkerFlag(path.join(libdir, 'libdatachannel-static.a'));
project.addLinkerFlag(path.join(libdir, 'libjuice-static.a'));
project.addLinkerFlag(path.join(libdir, 'libusrsctp.a'));
project.addLinkerFlag(path.join(libdir, 'libsrtp2.a'));
project.addLinkerFlag(path.join(libdir, 'libMbedTLS.a'));
const odir = '/opt/homebrew/opt/openssl@3/lib';
project.addLinkerFlag(path.join(odir, 'libssl.a'));
project.addLinkerFlag(path.join(odir, 'libcrypto.a'));
}
else if (platform === Platform.Linux) {
// TODO
const libdir = path.join(__dirname, 'lib/linux_x64');
project.addLinkerFlag(path.join(libdir, 'libdatachannel-static.a'));
project.addLinkerFlag(path.join(libdir, 'libjuice-static.a'));
project.addLinkerFlag(path.join(libdir, 'libusrsctp.a'));
project.addLinkerFlag(path.join(libdir, 'libsrtp2.a'));
project.addLinkerFlag(path.join(libdir, 'libMbedTLS.a'));
project.addLinkerFlag('-lssl');
project.addLinkerFlag('-lcrypto');
}
if (parentProject) {
for (let sub of parentProject.subProjects) {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.