From 44b71ebfe38369791cbc032eef21475922aa0c82 Mon Sep 17 00:00:00 2001 From: Vertexwahn Date: Fri, 3 Jan 2025 22:15:35 +0100 Subject: [PATCH] Add libyuv Add libyuv --- .../0.0.0-20250102-47ddac2/MODULE.bazel | 8 ++ .../overlay/BUILD.bazel | 128 ++++++++++++++++++ .../overlay/MODULE.bazel | 1 + .../0.0.0-20250102-47ddac2/presubmit.yml | 18 +++ .../libyuv/0.0.0-20250102-47ddac2/source.json | 9 ++ modules/libyuv/metadata.json | 17 +++ 6 files changed, 181 insertions(+) create mode 100644 modules/libyuv/0.0.0-20250102-47ddac2/MODULE.bazel create mode 100644 modules/libyuv/0.0.0-20250102-47ddac2/overlay/BUILD.bazel create mode 120000 modules/libyuv/0.0.0-20250102-47ddac2/overlay/MODULE.bazel create mode 100644 modules/libyuv/0.0.0-20250102-47ddac2/presubmit.yml create mode 100644 modules/libyuv/0.0.0-20250102-47ddac2/source.json create mode 100644 modules/libyuv/metadata.json diff --git a/modules/libyuv/0.0.0-20250102-47ddac2/MODULE.bazel b/modules/libyuv/0.0.0-20250102-47ddac2/MODULE.bazel new file mode 100644 index 00000000000..13ca55aa28b --- /dev/null +++ b/modules/libyuv/0.0.0-20250102-47ddac2/MODULE.bazel @@ -0,0 +1,8 @@ +module( + name = "libyuv", + version = "0.0.0-20250102-47ddac2", + bazel_compatibility = [">=7.2.1"], # need support for "overlay" directory + compatibility_level = 1, +) + +bazel_dep(name = "rules_cc", version = "0.0.17") diff --git a/modules/libyuv/0.0.0-20250102-47ddac2/overlay/BUILD.bazel b/modules/libyuv/0.0.0-20250102-47ddac2/overlay/BUILD.bazel new file mode 100644 index 00000000000..437fc440b03 --- /dev/null +++ b/modules/libyuv/0.0.0-20250102-47ddac2/overlay/BUILD.bazel @@ -0,0 +1,128 @@ +# Copied from https://skia.googlesource.com/skia/+/refs/heads/main/bazel/external/libwebp/BUILD.bazel +# The copied code is available under the following BSD-style license (see +# https://skia.googlesource.com/skia/+/refs/heads/main/LICENSE): +# +# Copyright (c) 2011 Google Inc. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# This file will be copied into //third_party/externals/libwebp via the new_local_repository +# rule in WORKSPACE.bazel, so all files should be relative to that path. +# We define this here because the emscripten toolchain calls the cpu wasm, whereas the +# bazelbuild/platforms call it wasm32. https://github.com/emscripten-core/emsdk/issues/919 + +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +cc_library( + name = "libyuv", + srcs = [ + "include/libyuv/basic_types.h", + "include/libyuv/compare.h", + "include/libyuv/compare_row.h", + "include/libyuv/convert.h", + "include/libyuv/convert_argb.h", + "include/libyuv/convert_from.h", + "include/libyuv/convert_from_argb.h", + "include/libyuv/cpu_id.h", + "include/libyuv/loongson_intrinsics.h", + "include/libyuv/macros_msa.h", + "include/libyuv/mjpeg_decoder.h", + "include/libyuv/planar_functions.h", + "include/libyuv/rotate.h", + "include/libyuv/rotate_argb.h", + "include/libyuv/rotate_row.h", + "include/libyuv/row.h", + "include/libyuv/scale.h", + "include/libyuv/scale_argb.h", + "include/libyuv/scale_rgb.h", + "include/libyuv/scale_row.h", + "include/libyuv/scale_uv.h", + "include/libyuv/version.h", + "include/libyuv/video_common.h", + "source/compare.cc", + "source/compare_common.cc", + "source/compare_gcc.cc", + "source/compare_mmi.cc", + "source/compare_msa.cc", + "source/compare_neon.cc", + "source/compare_neon64.cc", + "source/compare_win.cc", + "source/convert.cc", + "source/convert_argb.cc", + "source/convert_from.cc", + "source/convert_from_argb.cc", + "source/convert_jpeg.cc", + "source/convert_to_argb.cc", + "source/convert_to_i420.cc", + "source/cpu_id.cc", + "source/mjpeg_decoder.cc", + "source/mjpeg_validate.cc", + "source/planar_functions.cc", + "source/rotate.cc", + "source/rotate_any.cc", + "source/rotate_argb.cc", + "source/rotate_common.cc", + "source/rotate_gcc.cc", + "source/rotate_lsx.cc", + "source/rotate_mmi.cc", + "source/rotate_msa.cc", + "source/rotate_neon.cc", + "source/rotate_neon64.cc", + "source/rotate_win.cc", + "source/row_any.cc", + "source/row_common.cc", + "source/row_gcc.cc", + "source/row_lasx.cc", + "source/row_lsx.cc", + "source/row_mmi.cc", + "source/row_msa.cc", + "source/row_neon.cc", + "source/row_neon64.cc", + "source/row_win.cc", + "source/scale.cc", + "source/scale_any.cc", + "source/scale_argb.cc", + "source/scale_common.cc", + "source/scale_gcc.cc", + "source/scale_lsx.cc", + "source/scale_mmi.cc", + "source/scale_msa.cc", + "source/scale_neon.cc", + "source/scale_neon64.cc", + "source/scale_rgb.cc", + "source/scale_uv.cc", + "source/scale_win.cc", + "source/video_common.cc", + ], + hdrs = [ + "include/libyuv.h", + ], + includes = [ + "include", + ], + local_defines = [ + "AVIF_CODEC_LIBGAV1=1", + "AVIF_LIBYUV_ENABLED=1", + ], + visibility = ["//visibility:public"], +) diff --git a/modules/libyuv/0.0.0-20250102-47ddac2/overlay/MODULE.bazel b/modules/libyuv/0.0.0-20250102-47ddac2/overlay/MODULE.bazel new file mode 120000 index 00000000000..9b599e3ad9c --- /dev/null +++ b/modules/libyuv/0.0.0-20250102-47ddac2/overlay/MODULE.bazel @@ -0,0 +1 @@ +../MODULE.bazel \ No newline at end of file diff --git a/modules/libyuv/0.0.0-20250102-47ddac2/presubmit.yml b/modules/libyuv/0.0.0-20250102-47ddac2/presubmit.yml new file mode 100644 index 00000000000..3c5bb1b4803 --- /dev/null +++ b/modules/libyuv/0.0.0-20250102-47ddac2/presubmit.yml @@ -0,0 +1,18 @@ +matrix: + platform: + - debian10 + - debian11 + - macos + - macos_arm64 + - ubuntu2004 + - ubuntu2204 + - ubuntu2404 + - windows + bazel: [7.x, 8.x, rolling] +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_targets: + - '@libyuv//:libyuv' diff --git a/modules/libyuv/0.0.0-20250102-47ddac2/source.json b/modules/libyuv/0.0.0-20250102-47ddac2/source.json new file mode 100644 index 00000000000..3eaa54bb56b --- /dev/null +++ b/modules/libyuv/0.0.0-20250102-47ddac2/source.json @@ -0,0 +1,9 @@ +{ + "url": "https://github.com/lemenkov/libyuv/archive/47ddac2996378c34aab9318f0d218303b1d282e7.zip", + "integrity": "sha256-8KNXn4rzNi9MDTgGgJsHIkd5/DXJb/FmDXiS2r3kd0s=", + "strip_prefix": "libyuv-47ddac2996378c34aab9318f0d218303b1d282e7", + "overlay": { + "BUILD.bazel": "sha256-a90k/2hXS14VLVYXXbs941vwiY7K8QaPJw6Htj5oACk=", + "MODULE.bazel": "sha256-w7L36ZqzDTtveq2lFiyiWNfQRqYjWrNGfV1vMJrgXr0=" + } +} diff --git a/modules/libyuv/metadata.json b/modules/libyuv/metadata.json new file mode 100644 index 00000000000..6ff9a69c387 --- /dev/null +++ b/modules/libyuv/metadata.json @@ -0,0 +1,17 @@ +{ + "homepage": "https://chromium.googlesource.com/libyuv/libyuv", + "maintainers": [ + { + "email": "julian.amann@tum.de", + "github": "Vertexwahn", + "name": "Julian Amann" + } + ], + "repository": [ + "github:lemenkov/libyuv" + ], + "versions": [ + "0.0.0-20250102-47ddac2" + ], + "yanked_versions": {} +}