python-lief: rebuild; fix build for clang; restore mingw32

for #20732
This commit is contained in:
Christoph Reiter
2024-06-15 09:53:02 +02:00
parent 630156c8e0
commit dc72817baf
2 changed files with 46 additions and 4 deletions

View File

@@ -0,0 +1,34 @@
diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h
index e5ae9e18..7d194227 100644
--- a/include/fmt/ostream.h
+++ b/include/fmt/ostream.h
@@ -13,8 +13,6 @@
#if defined(_WIN32) && defined(__GLIBCXX__)
# include <ext/stdio_filebuf.h>
# include <ext/stdio_sync_filebuf.h>
-#elif defined(_WIN32) && defined(_LIBCPP_VERSION)
-# include <__std_stream>
#endif
#include "format.h"
@@ -37,10 +35,6 @@ class file_access {
template class file_access<file_access_tag, std::filebuf,
&std::filebuf::_Myfile>;
auto get_file(std::filebuf&) -> FILE*;
-#elif defined(_WIN32) && defined(_LIBCPP_VERSION)
-template class file_access<file_access_tag, std::__stdoutbuf<char>,
- &std::__stdoutbuf<char>::__file_>;
-auto get_file(std::__stdoutbuf<char>&) -> FILE*;
#endif
inline bool write_ostream_unicode(std::ostream& os, fmt::string_view data) {
@@ -57,9 +51,6 @@ inline bool write_ostream_unicode(std::ostream& os, fmt::string_view data) {
else
return false;
if (c_file) return write_console(c_file, data);
-#elif defined(_WIN32) && defined(_LIBCPP_VERSION)
- if (auto* buf = dynamic_cast<std::__stdoutbuf<char>*>(os.rdbuf()))
- if (FILE* f = get_file(*buf)) return write_console(f, data);
#else
ignore_unused(os, data);
#endif

View File

@@ -5,9 +5,9 @@ pkgbase=mingw-w64-python-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-python-${_realname}
pkgdesc="LIEF - Library to Instrument Executable Formats (mingw-w64)"
pkgver=0.13.2
pkgrel=2
pkgrel=3
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'mingw32')
msys2_references=(
'pypi: lief'
)
@@ -23,9 +23,11 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-python-tomli")
options=('staticlibs' '!strip' '!debug')
source=(lief-${pkgver}.tar.gz::https://github.com/lief-project/LIEF/archive/refs/tags/${pkgver}.tar.gz
0001-fix-exported-API-pymodule.patch)
0001-fix-exported-API-pymodule.patch
0001-fmt-no-private-clang-header.patch)
sha256sums=('c68ef94ee613c6557faccc135bdaba4322c2e044be2b806ceea1de763cc099cf'
'5d59f6a2e547f62ccbb00b469ab4316925576c562aee3be2a293beca6975c466')
'5d59f6a2e547f62ccbb00b469ab4316925576c562aee3be2a293beca6975c466'
'c042c09ccd0bde52565e7e95c38b9c3b73449dae9d857b5f3b60ed8e00f5a405')
prepare() {
cd "${srcdir}/LIEF-${pkgver}"
@@ -60,6 +62,12 @@ build() {
mkdir -p api/python/lief
# patch fmt which is vendored in spdlog which is vendored in lief
# to fix the build with newer clang
cmake --build . --target lief_spdlog_project
(cd lief_spdlog_project-prefix/src/lief_spdlog_project/include/spdlog/fmt/bundled &&
patch -p3 -i ${srcdir}/0001-fmt-no-private-clang-header.patch)
MSYS2_ARG_CONV_EXCL="--include-paths=;--typesystem-paths=" \
${MINGW_PREFIX}/bin/cmake.exe --build .