Patches were recommended from gmp upstream and fix the crashes.
I've tested the patch and it works, however I have no idea if this is the right place
in the formula to apply the thing.
Fixes#84719Closes#84728.
Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
This reverts commit 3062c4bb78
for the most part. It reduced the formula's portability,
but neither the commit message nor the associated pull request
explain why this patch is needed.
Trying to build apngasm without the patch and with no further changes
results in the linker complaining about two undefined symbols, namely
the constructor and destructor for boost::scoped_static_mutex_lock. This
class is part of Boost.Regex (not Boost.Filesystem), and the error is
due to a change in Boost 1.76.0 that turned Regex it into a header-only
module when built in a C++11 environment, which Homebrew supplies when
building Boost itself. Unfortunately, Boost does not record this fact
in the Regex headers, so when any other software is built in C++03 mode
and tries to use Homebrew's Boost.Regex, it falls back onto the
non-header-only code and looks for the corresponding library symbols,
which don't exist because they weren't built when building Boost.
This can be resolved simply by triggering C++11 mode in the consumer
(apngasm in this case). With the apngasm filesystem patch, this was done
by accident, as the patch itself required C++17; but a C++17 environment
is not actually needed to build against the new Boost.Regex: C++11 is
enough; and Boost.Filesystem lets it build just fine, too.
I have verified that this builds on outdated macOS (High Sierra with
Xcode 10.1 and clang-1000.11.45.5) and on outdated Linux (with GCC 7.4).
Looking further back on Linux, brew.sh [brew] says Homebrew requires
GCC 4.7. As far as I can tell from GCC 4.7 documentation [GCC] and
from Boost.Regex source code [Regex], the C++ library in GCC 4.7
satisfies all C++11 requirements of Boost.Regex, so any combination
of built-from-source and bottled apngasm and Boost should work
without further GCC version restrictions.
[brew]: https://docs.brew.sh/Homebrew-on-Linux#requirements
[GCC]: https://gcc.gnu.org/onlinedocs/gcc-4.7.0/libstdc++/manual/manual/status.html#status.iso.2011
[Regex]: https://github.com/boostorg/regex/blob/boost-1.76.0/include/boost/regex/config.hpp
The C++17 requirements will reappear when apngasm publishes its next
release, which will include the std::filesystem patch. But until then,
they are unnecessary, and the formula can be used more widely.
Closes#85529.
Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>