Telegram-iOS/third-party/libjxl/BUILD
Isaac 5962a563e4 feat: tgcalls CLI test tool with group SFU, video, and adaptation
Squashed buildout of the tgcalls testbench:

- CLI test tool with --mode p2p/reflector/group/group-churn,
  cross-version interop (--version, --version2), and quiet/summary output
- Linux toolchain + Docker multi-stage build, AWS Fargate mass test harness,
  local parallel mass test harness with signaling loss simulation
- SCTP writable gate, retransmission timer tuning, role-based handshake
- InstanceV2CompatImpl (PeerConnection backend with V2Impl signaling) and
  SignalingTranslator for v14.0.0 interop
- In-process Go/Pion SFU (ICE+DTLS+SRTP+SCTP per participant) with audio
  RTP forwarding, ActiveAudio/VideoSsrcs data channel broadcast, RTCP
  feedback path, and CGo c-archive integration
- GroupInstanceReferenceImpl (PeerConnection group-call) and mixed-impl
  group mode (--reference-participants), with SDP munging for simulcast
- H264 simulcast group video (FakeVideoTrackSource pattern generator,
  FakeVideoSink frame counting, --video flag, two-pass channel setup,
  reactive video setup from ActiveVideoSsrcs)
- Group churn stress mode (--mode group-churn, --churn-cycles)
- SFU stream-quality adaptation: BandwidthEstimator, LayerSelector
  state machine, RtxRingBuffer, simulcast SSRC rewrite
- Transport-cc feedback generation, NetworkSimulator (delay/jitter/loss/
  token-bucket bandwidth), --network-scenario step-down-up
- CLAUDE.md updates throughout

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 18:28:43 +02:00

131 lines
3.2 KiB
Text

headers = [
"jxl/codestream_header.h",
"jxl/cms_interface.h",
"jxl/color_encoding.h",
"jxl/decode_cxx.h",
"jxl/decode.h",
"jxl/encode_cxx.h",
"jxl/encode.h",
"jxl/jxl_export.h",
"jxl/jxl_threads_export.h",
"jxl/memory_manager.h",
"jxl/parallel_runner.h",
"jxl/stats.h",
"jxl/types.h",
"jxl/version.h",
]
libs = [
"jxl",
]
brotli_libs = [
"libbrotlicommon",
"libbrotlidec",
"libbrotlienc",
]
highway_libs = [
"libhwy"
]
filegroup(
name = "libjxl_sources",
srcs = glob([
"libjxl/**/*"
]),
)
genrule(
name = "libjxl_build",
srcs = [
"build-libjxl-bazel.sh",
":libjxl_sources",
"@cmake_tar_gz//file",
],
cmd_bash =
"""
set -ex
if [ "$(TARGET_CPU)" == "ios_armv7" ]; then
BUILD_ARCH="armv7"
elif [ "$(TARGET_CPU)" == "ios_arm64" ]; then
BUILD_ARCH="arm64"
elif [ "$(TARGET_CPU)" == "ios_sim_arm64" ]; then
BUILD_ARCH="sim_arm64"
elif [ "$(TARGET_CPU)" == "ios_x86_64" ]; then
BUILD_ARCH="x86_64"
elif [ "$(TARGET_CPU)" == "darwin_arm64" ]; then
BUILD_ARCH="macos_arm64"
else
echo "Unsupported architecture $(TARGET_CPU)"
fi
BUILD_DIR="$(RULEDIR)/build_$${BUILD_ARCH}"
rm -rf "$$BUILD_DIR"
mkdir -p "$$BUILD_DIR"
CMAKE_DIR="$$(pwd)/$$BUILD_DIR/cmake"
rm -rf "$$CMAKE_DIR"
mkdir -p "$$CMAKE_DIR"
tar -xzf "$(location @cmake_tar_gz//file)" -C "$$CMAKE_DIR"
cp $(location :build-libjxl-bazel.sh) "$$BUILD_DIR/"
SOURCE_PATH="third-party/libjxl/libjxl"
cp -R "$$SOURCE_PATH" "$$BUILD_DIR/"
mkdir -p "$$BUILD_DIR/Public/jxl"
PATH="$$CMAKE_DIR/cmake-4.1.2-macos-universal/CMake.app/Contents/bin:$$PATH" sh $$BUILD_DIR/build-libjxl-bazel.sh $$BUILD_ARCH "$$BUILD_DIR/libjxl" "$$BUILD_DIR"
""" +
"\n".join([
"cp -f \"$$BUILD_DIR/build/lib/include/{}\" \"$(location Public/{})\"".format(header, header) for header in headers
]) +
"\n" +
"\n".join([
"cp -f \"$$BUILD_DIR/build/lib/lib{}.a\" \"$(location Public/jxl/lib/lib{}.a)\"".format(lib, lib) for lib in libs
]) +
"\n" +
"\n".join([
"cp -f \"$$BUILD_DIR/build/third_party/brotli/{}.a\" \"$(location Public/jxl/lib/{}.a)\"".format(lib, lib) for lib in brotli_libs
]) +
"\n" +
"\n".join([
"cp -f \"$$BUILD_DIR/build/third_party/highway/{}.a\" \"$(location Public/jxl/lib/{}.a)\"".format(lib, lib) for lib in highway_libs
]),
outs = ["Public/" + x for x in headers] +
["Public/jxl/lib/lib{}.a".format(x) for x in libs] +
["Public/jxl/lib/{}.a".format(x) for x in brotli_libs] +
["Public/jxl/lib/{}.a".format(x) for x in highway_libs],
visibility = [
"//visibility:public",
]
)
cc_library(
name = "jxl_lib",
srcs = [":Public/jxl/lib/lib" + x + ".a" for x in libs] +
[":Public/jxl/lib/" + x + ".a" for x in brotli_libs] +
[":Public/jxl/lib/" + x + ".a" for x in highway_libs],
)
objc_library(
name = "jxl",
module_name = "jxl",
enable_modules = True,
hdrs = [":Public/" + x for x in headers],
includes = [
"Public",
"Public/jxl",
],
deps = [
":jxl_lib",
],
visibility = [
"//visibility:public",
],
)