WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HOMEBREW_VERSION: 5.0.3-9-g49df5af
ORIGIN: https://github.com/Homebrew/brew
HEAD: 49df5af00957878632752b7634154d2b381aecdd
Last commit: 19 hours ago
Branch: main
Core tap HEAD: 3e5beabf14df61c2415a9a3112de6914d13526e5
Core tap last commit: 3 minutes ago
Core tap branch: shaka-packager
Core tap JSON: 22 Nov 09:42 UTC
Core cask tap HEAD: 4baa79ace9e2659ca1cdc927e3e3364937b36868
Core cask tap last commit: 8 hours ago
Core cask tap JSON: 22 Nov 09:42 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_AUTO_UPDATE_SECS: 86400
HOMEBREW_CASK_OPTS: []
HOMEBREW_DOWNLOAD_CONCURRENCY: 16
HOMEBREW_EDITOR: nano
HOMEBREW_FORBID_PACKAGES_FROM_PATHS: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.4.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.7/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 17.0.0 build 1700
Git: 2.51.2 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 26.2-arm64
CLT: 26.1.0.0.1.1761104275
Xcode: N/A
Rosetta 2: false
Output of brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!Warning: Some taps are not on the default git origin branch and may not receiveupdates. If this is a surprise to you, check out the default branch with: git -C $(brew --repo homebrew/core) checkout mainWarning: Some installed formulae are missing dependencies.You should `brew install` the missing dependencies: brew install icu4c@76Run `brew missing` for more details.
Description of issue
I am trying to write a formulae for shaka-packager and am facing a weird issue when trying to build the project via the formulae.
Building the project from source without brew
To build the project from source, you can find the build instructions here. However, at least on macOS26 it's required to cherry-pick one recent commit, so the steps look like this:
# get the source code
git clone --recursive-submodules https://github.com/shaka-project/shaka-packager.git
cd shaka-packager
git checkout "v3.4.2"# see https://github.com/shaka-project/shaka-packager/commit/7cd7e48e9cfd008542c2f7c7c292bde15837a15e
git cherry-pick 7cd7e48e9cfd008542c2f7c7c292bde15837a15e
# generate build files
cmake -S . -B build -G Ninja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DBUILD_SHARED_LIBS=OFF -DFULLY_STATIC=OFF -DCMAKE_BUILD_TYPE=Release
# build the project
cmake --build build --config Release
# install the binaries
cmake --install build --strip --config Release
First formulae
Thus, a minimal working example formulua (without any tests) looks like this:
classShakaPackager < Formuladesc"Tool and media packaging SDK for DASH and HLS packaging and encryption"homepage"https://github.com/shaka-project/shaka-packager"url"https://github.com/shaka-project/shaka-packager.git",tag: "v3.4.2",revision: "c819deaa2376399a89d41f3804bc72f4a20d9d6d"license"BSD-3-Clause"head"https://github.com/shaka-project/shaka-packager.git",branch: "main"depends_on"cmake"=>:builddepends_on"ninja"=>:builddefinstallsystem"git","cherry-pick","7cd7e48e9cfd008542c2f7c7c292bde15837a15e"args=%w[-DCMAKE_POLICY_VERSION_MINIMUM=3.5-DBUILD_SHARED_LIBS=OFF-DFULLY_STATIC=OFF]system"cmake","-S",".","-B","build","-G","Ninja", *args, *std_cmake_argssystem"cmake","--build","build","--config","Release"system"cmake","--install","build","--strip","--config","Release"endend
[793/1207] cd /private/tmp/shaka-packager-20251122-17689-v844j5/build/packager/third_party/libpng/source && /opt/homebrew/opt/cmake/bin/cmake -DINPUT=/private/tmp/shaka-packager-20251122-17689-v844j5/packager/third_party/libpng/source/scripts/intprefix.c -DOUTPUT=/private/tmp/shaka-packager-20251122-17689-v844j5/build/packager/third_party/libpng/source/scripts/intprefix.out -P /private/tmp/shaka-packager-20251122-17689-v844j5/build/packager/third_party/libpng/source/scripts/genout.cmake
FAILED: [code=1] packager/third_party/libpng/source/scripts/intprefix.out /private/tmp/shaka-packager-20251122-17689-v844j5/build/packager/third_party/libpng/source/scripts/intprefix.out
cd /private/tmp/shaka-packager-20251122-17689-v844j5/build/packager/third_party/libpng/source && /opt/homebrew/opt/cmake/bin/cmake -DINPUT=/private/tmp/shaka-packager-20251122-17689-v844j5/packager/third_party/libpng/source/scripts/intprefix.c -DOUTPUT=/private/tmp/shaka-packager-20251122-17689-v844j5/build/packager/third_party/libpng/source/scripts/intprefix.out -P /private/tmp/shaka-packager-20251122-17689-v844j5/build/packager/third_party/libpng/source/scripts/genout.cmake
In file included from /private/tmp/shaka-packager-20251122-17689-v844j5/packager/third_party/libpng/source/scripts/intprefix.c:22:
/private/tmp/shaka-packager-20251122-17689-v844j5/packager/third_party/libpng/source/scripts/../pngpriv.h:527:16: fatal error: 'fp.h' file not found
527 | # include <fp.h>
| ^~~~~~
1 error generated.
CMake Error at scripts/genout.cmake:78 (message):
Failed to generate
/private/tmp/shaka-packager-20251122-17689-v844j5/build/packager/third_party/libpng/source/scripts/intprefix.out.tf1
which is exactly the issue that the cherry-picked commit should fix.
Second formulae
While investigating this, I noticed that building using the --head flag and manually checking out the "v3.4.2" tag works strangely. So, using this formulae
classShakaPackager < Formuladesc"Tool and media packaging SDK for DASH and HLS packaging and encryption"homepage"https://github.com/shaka-project/shaka-packager"url"https://github.com/shaka-project/shaka-packager.git",tag: "v3.4.2",revision: "c819deaa2376399a89d41f3804bc72f4a20d9d6d"license"BSD-3-Clause"head"https://github.com/shaka-project/shaka-packager.git",branch: "main"depends_on"cmake"=>:builddepends_on"ninja"=>:builddefinstallsystem"git","checkout","v3.4.2"system"git","cherry-pick","7cd7e48e9cfd008542c2f7c7c292bde15837a15e"args=%w[-DCMAKE_POLICY_VERSION_MINIMUM=3.5-DBUILD_SHARED_LIBS=OFF-DFULLY_STATIC=OFF]system"cmake","-S",".","-B","build","-G","Ninja", *args, *std_cmake_argssystem"cmake","--build","build","--config","Release"system"cmake","--install","build","--strip","--config","Release"endend
works. This indicates that there is probably something going wrong inside brew while checking out the "v3.4.2" tag or while cherry-picking. Both the tag and the revision/commit id are correct as you can see here
We don't have such feature, so maybe you need to manually patch and bump libpng.
workaround
class ShakaPackager < Formula
desc "Tool and media packaging SDK for DASH and HLS packaging and encryption"
homepage "https://github.com/shaka-project/shaka-packager"
license "BSD-3-Clause"
head "https://github.com/shaka-project/shaka-packager.git", branch: "main"
depends_on "cmake" => :build
depends_on "ninja" => :build
stable do
url "https://github.com/shaka-project/shaka-packager.git",
tag: "v3.4.2",
revision: "c819deaa2376399a89d41f3804bc72f4a20d9d6d"
# see: https://github.com/shaka-project/shaka-packager/commit/7cd7e48e9cfd008542c2f7c7c292bde1…
Thanks! Unfortunately, it seems there's still something going wrong when the patch is applied to git submodules. This formulae
classShakaPackager < Formuladesc"Tool and media packaging SDK for DASH and HLS packaging and encryption"homepage"https://github.com/shaka-project/shaka-packager"url"https://github.com/shaka-project/shaka-packager.git",tag: "v3.4.2",revision: "c819deaa2376399a89d41f3804bc72f4a20d9d6d"license"BSD-3-Clause"head"https://github.com/shaka-project/shaka-packager.git",branch: "main"depends_on"cmake"=>:builddepends_on"ninja"=>:build# see: https://github.com/shaka-project/shaka-packager/commit/7cd7e48e9cfd008542c2f7c7c292bde15837a15establedoon_macosdoon_tahoe:or_newerdopatchdourl"https://github.com/shaka-project/shaka-packager/commit/7cd7e48e9cfd008542c2f7c7c292bde15837a15e.diff"sha256"e941290edda84ff18efc3b49e9677b33a14dfb40f48c632fe4713f2defaf5704"endendendenddefinstallargs=%w[-DCMAKE_POLICY_VERSION_MINIMUM=3.5-DBUILD_SHARED_LIBS=OFF-DFULLY_STATIC=OFF]system"cmake","-S",".","-B","build","-G","Ninja", *args, *std_cmake_argssystem"cmake","--build","build","--config","Release"system"cmake","--install","build","--strip","--config","Release"endend
If I had to guess, I'd say that it's probably because the patch is applied after git recursively pulled all git submodules. However, in this situation, we would need to apply the patch before the submodules are pulled.
We don't have such feature, so maybe you need to manually patch and bump libpng.
workaround
class ShakaPackager < Formula
desc "Tool and media packaging SDK for DASH and HLS packaging and encryption"
homepage "https://github.com/shaka-project/shaka-packager"
license "BSD-3-Clause"
head "https://github.com/shaka-project/shaka-packager.git", branch: "main"
depends_on "cmake" => :build
depends_on "ninja" => :build
stable do
url "https://github.com/shaka-project/shaka-packager.git",
tag: "v3.4.2",
revision: "c819deaa2376399a89d41f3804bc72f4a20d9d6d"
# see: https://github.com/shaka-project/shaka-packager/commit/7cd7e48e9cfd008542c2f7c7c292bde15837a15e
patch :DATA
resource "libpng" do
url "https://github.com/pnggroup/libpng/archive/2b978915d82377df13fcbb1fb56660195ded868a.tar.gz"
sha256 "fba1c8e793f01b493f3f47a926862edbfab487ae4240e02ec67131f1e2bf067f"
end
end
def install
# Remove bundled libpng and replace it with patched version
if build.stable?
libpng_source = buildpath/"packager/third_party/libpng/source"
rm_r libpng_source
libpng_source.install resource("libpng")
end
args = %w[
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DBUILD_SHARED_LIBS=OFF
-DFULLY_STATIC=OFF
]
system "cmake", "-S", ".", "-B", "build", "-G", "Ninja", *args, *std_cmake_args
system "cmake", "--build", "build", "--config", "Release"
system "cmake", "--install", "build", "--strip", "--config", "Release"
end
end
__END__
From 7cd7e48e9cfd008542c2f7c7c292bde15837a15e Mon Sep 17 00:00:00 2001
From: Joey Parrish <[email protected]>
Date: Fri, 21 Nov 2025 11:13:11 -0800
Subject: [PATCH] fix: Upgrade libpng to fix build on new macs (#1507)
This upgrades libpng from v1.6.37 to v1.6.50
This newer libpng doesn't assume the existence of fp.h on Mac (which
isn't present on newer ones), but the CMake options for libpng changed
and had to be adjusted somewhat.
---
.github/workflows/build.yaml | 1 +
packager/third_party/CMakeLists.txt | 3 ++-
packager/third_party/libpng/CMakeLists.txt | 8 ++++----
packager/third_party/libpng/source | 2 +-
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4d929259f045f5a57a3ee00ec092de83692de473..cfe84e3b0c2d4da467758ba890629162b94b3797 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -199,6 +199,7 @@ jobs:
fi
cmake \
+ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \
-DBUILD_SHARED_LIBS="$BUILD_SHARED_LIBS" \
-DFULLY_STATIC="$FULLY_STATIC" \
diff --git a/packager/third_party/CMakeLists.txt b/packager/third_party/CMakeLists.txt
index c883c0b7eb35e87ca53e27a9bd24e7a72b7e46f0..51f8585ccea040774abc4e35b6f97d01972904c7 100644
--- a/packager/third_party/CMakeLists.txt
+++ b/packager/third_party/CMakeLists.txt
@@ -42,6 +42,8 @@ add_subdirectory(c-ares EXCLUDE_FROM_ALL)
add_subdirectory(curl EXCLUDE_FROM_ALL)
add_subdirectory(googletest EXCLUDE_FROM_ALL)
add_subdirectory(json EXCLUDE_FROM_ALL)
+# NOTE: libpng references zlib, so put zlib before libpng
+add_subdirectory(zlib EXCLUDE_FROM_ALL)
add_subdirectory(libpng EXCLUDE_FROM_ALL)
add_subdirectory(libwebm EXCLUDE_FROM_ALL)
add_subdirectory(libxml2 EXCLUDE_FROM_ALL)
@@ -49,4 +51,3 @@ add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
add_subdirectory(mimalloc EXCLUDE_FROM_ALL)
add_subdirectory(mongoose EXCLUDE_FROM_ALL)
add_subdirectory(protobuf EXCLUDE_FROM_ALL)
-add_subdirectory(zlib EXCLUDE_FROM_ALL)
diff --git a/packager/third_party/libpng/CMakeLists.txt b/packager/third_party/libpng/CMakeLists.txt
index c9d33a828ca29862d4090101e56be3ef0260653a..02c3ad6f36305ca19c4e8156480462a9d45e29db 100644
--- a/packager/third_party/libpng/CMakeLists.txt
+++ b/packager/third_party/libpng/CMakeLists.txt
@@ -19,12 +19,12 @@ set(PNG_DEBUG OFF)
# Don't install anything.
set(SKIP_INSTALL_ALL ON)
-# A confusing name, but this means "let us tell you where to find zlib".
-set(PNG_BUILD_ZLIB ON)
-# Tell libpng where to find zlib headers.
+# Tell libpng where to find zlib.
+set(ZLIB_FOUND TRUE)
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../zlib/source/")
-# Tell libpng where to find zlib library to link to.
set(ZLIB_LIBRARY zlibstatic)
+add_library(ZLIB::ZLIB ALIAS zlibstatic)
+
# Tell libpng where to find libm on Linux (-lm).
set(M_LIBRARY m)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
We don't have such feature, so maybe you need to manually patch and bump
libpng.workaround