Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vertexwahn authored Dec 30, 2024
1 parent cc9afa4 commit 33f42cc
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 1 deletion.
11 changes: 11 additions & 0 deletions modules/libpng/1.6.44/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module(
name = "libpng",
version = "1.6.44",
bazel_compatibility = [">=7.2.1"], # need support for "overlay" directory
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "zlib", version = "1.3.1.bcr.4")
77 changes: 77 additions & 0 deletions modules/libpng/1.6.44/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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.

load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_license//rules:license.bzl", "license")

package(
default_applicable_licenses = [":license"],
)

exports_files([
"LICENSE",
])

license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:libpng-2.0"],
license_text = "LICENSE",
)

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"],
)

alias(
name = "libpng",
actual = ":png",
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions modules/libpng/1.6.44/overlay/MODULE.bazel
19 changes: 19 additions & 0 deletions modules/libpng/1.6.44/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
matrix:
platform:
- centos7
- 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:
- '@libpng//:libpng'
9 changes: 9 additions & 0 deletions modules/libpng/1.6.44/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/pnggroup/libpng/archive/refs/tags/v1.6.44.tar.gz",
"integrity": "sha256-DvW2M9DGX3gMT87Sf/gymY5xR4wTtF37bpTyOoL2T3w=",
"strip_prefix": "libpng-1.6.44",
"overlay": {
"BUILD.bazel": "sha256-zcPhCWABwguKHRSHV9DCKuoGOv8XHHIUSJ31wenHUV8=",
"MODULE.bazel": "sha256-6gch+b1GnlTlR1qYtSuYh4rsbGHFVYD8l27DXUlyuHI="
}
}
3 changes: 2 additions & 1 deletion modules/libpng/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"1.6.40",
"1.6.41",
"1.6.42",
"1.6.43"
"1.6.43",
"1.6.44"
],
"yanked_versions": {}
}

0 comments on commit 33f42cc

Please sign in to comment.