From 81cc3015bb5fe35658dcc585c2de6fb909fdb725 Mon Sep 17 00:00:00 2001 From: Dexter Chua Date: Mon, 4 Jan 2021 16:50:01 +0800 Subject: [PATCH] Use replace-libs for matplotlib (#1037) The library that is supplied by USE_PNG is png, but matplotlib seeks png16. With the fastcomp backend, we end up ignoring it anyway, but with the upstream backend this will be the correct course of action --- packages/matplotlib/meta.yaml | 2 ++ pyodide_build/pywasmcross.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/matplotlib/meta.yaml b/packages/matplotlib/meta.yaml index e62ef8e0f..55d18880b 100644 --- a/packages/matplotlib/meta.yaml +++ b/packages/matplotlib/meta.yaml @@ -23,6 +23,8 @@ source: build: cflags: -s USE_FREETYPE=1 -s USE_LIBPNG=1 -s USE_ZLIB=1 ldflags: ../../../../emsdk/emsdk/fastcomp/emscripten/cache/asmjs/libpng.bc + replace-libs: + - png16=png post: | wget -O $SITEPACKAGES/matplotlib/mpl-data/fonts/ttf/Humor-Sans.ttf http://antiyawn.com/uploads/Humor-Sans-1.0.ttf rm -rf $SITEPACKAGES/matplotlib/backends/qt_editor diff --git a/pyodide_build/pywasmcross.py b/pyodide_build/pywasmcross.py index 2ad134293..d89e99f5b 100755 --- a/pyodide_build/pywasmcross.py +++ b/pyodide_build/pywasmcross.py @@ -330,7 +330,7 @@ def handle_command(line, args, dryrun=False): continue # See https://github.com/emscripten-core/emscripten/issues/8650 - if arg in ["-lfreetype", "-lz", "-lpng16", "-lgfortran"]: + if arg in ["-lfreetype", "-lz", "-lpng", "-lgfortran"]: continue new_args.append(arg)