diff --git a/modules/libpng/1.6.40/MODULE.bazel b/modules/libpng/1.6.40/MODULE.bazel new file mode 100644 index 00000000000..f8e041875c4 --- /dev/null +++ b/modules/libpng/1.6.40/MODULE.bazel @@ -0,0 +1,8 @@ +module( + name = "libpng", + version = "1.6.40", + compatibility_level = 1, +) + +bazel_dep(name = "platforms", version = "0.0.7") +bazel_dep(name = "zlib", version = "1.3") diff --git a/modules/libpng/1.6.40/patches/add_build_file.patch b/modules/libpng/1.6.40/patches/add_build_file.patch new file mode 100644 index 00000000000..95a96432d17 --- /dev/null +++ b/modules/libpng/1.6.40/patches/add_build_file.patch @@ -0,0 +1,62 @@ +--- BUILD.bazel ++++ BUILD.bazel +@@ -0,0 +1,59 @@ ++# Copied from https://github.com/google-deepmind/lab2d/blob/09474439959534b1de3fce3d4a4ed35d565ea230/bazel/png.BUILD ++# with minor modifications available under Apache 2.0 License ++# SPDX-License-Identifier: Apache-2.0 ++ ++# Description: ++# libpng is the official PNG reference library. ++ ++genrule( ++ name = "pnglibconf", ++ srcs = ["scripts/pnglibconf.h.prebuilt"], ++ outs = ["pnglibconf.h"], ++ cmd = "cp $(location scripts/pnglibconf.h.prebuilt) $(location pnglibconf.h)", ++) ++ ++cc_library( ++ name = "png", ++ srcs = [ ++ "png.c", ++ "pngdebug.h", ++ "pngerror.c", ++ "pngget.c", ++ "pnginfo.h", ++ "pnglibconf.h", ++ "pngmem.c", ++ "pngpread.c", ++ "pngpriv.h", ++ "pngread.c", ++ "pngrio.c", ++ "pngrtran.c", ++ "pngrutil.c", ++ "pngset.c", ++ "pngstruct.h", ++ "pngtrans.c", ++ "pngwio.c", ++ "pngwrite.c", ++ "pngwtran.c", ++ "pngwutil.c", ++ ] + select({ ++ "@platforms//cpu:arm64": [ ++ "arm/arm_init.c", ++ "arm/filter_neon_intrinsics.c", ++ "arm/palette_neon_intrinsics.c", ++ ], ++ "//conditions:default": [], ++ }), ++ hdrs = [ ++ "png.h", ++ "pngconf.h", ++ ], ++ includes = ["."], ++ linkopts = ["-lm"], ++ visibility = ["//visibility:public"], ++ deps = ["@zlib//:zlib"], ++) ++alias( ++ name = "libpng", ++ actual = ":png", ++ visibility = ["//visibility:public"], ++) diff --git a/modules/libpng/1.6.40/patches/module_dot_bazel.patch b/modules/libpng/1.6.40/patches/module_dot_bazel.patch new file mode 100644 index 00000000000..c303cb646f6 --- /dev/null +++ b/modules/libpng/1.6.40/patches/module_dot_bazel.patch @@ -0,0 +1,11 @@ +--- MODULE.bazel ++++ MODULE.bazel +@@ -0,0 +1,8 @@ ++module( ++ name = "libpng", ++ version = "1.6.40", ++ compatibility_level = 1, ++) ++ ++bazel_dep(name = "platforms", version = "0.0.7") ++bazel_dep(name = "zlib", version = "1.3") diff --git a/modules/libpng/1.6.40/presubmit.yml b/modules/libpng/1.6.40/presubmit.yml new file mode 100644 index 00000000000..59e2047242f --- /dev/null +++ b/modules/libpng/1.6.40/presubmit.yml @@ -0,0 +1,13 @@ +matrix: + platform: + - centos7 + - debian10 + - ubuntu2004 + - macos + - windows +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + build_targets: + - '@libpng//:libpng' diff --git a/modules/libpng/1.6.40/source.json b/modules/libpng/1.6.40/source.json new file mode 100644 index 00000000000..6723268151c --- /dev/null +++ b/modules/libpng/1.6.40/source.json @@ -0,0 +1,10 @@ +{ + "url": "https://download.sourceforge.net/libpng/libpng-1.6.40.tar.gz", + "integrity": "sha256-j3ILNjqghoPJvypWMjb0UxOvLFXVQrVIGuF92NGDu0I=", + "strip_prefix": "libpng-1.6.40", + "patches": { + "add_build_file.patch": "sha256-IKBdDmPuuugv3ZFYMxKbKbJEdKd9c9FPxr5BBjkYnmI=", + "module_dot_bazel.patch": "sha256-I4/ZDMvlGjXSTRyHy9dvW8idDHIInWXZ8e6jDW0mq6o=" + }, + "patch_strip": 0 +} \ No newline at end of file diff --git a/modules/libpng/metadata.json b/modules/libpng/metadata.json new file mode 100644 index 00000000000..fc381c94700 --- /dev/null +++ b/modules/libpng/metadata.json @@ -0,0 +1,15 @@ +{ + "homepage": "http://www.libpng.org/pub/png/libpng.html", + "maintainers": [ + { + "email": "julian.amann@tum.de", + "github": "Vertexwahn", + "name": "Julian Amann" + } + ], + "repository": [], + "versions": [ + "1.6.40" + ], + "yanked_versions": {} +} \ No newline at end of file