diff --git a/packages/libf2c/meta.yaml b/packages/libf2c/meta.yaml index 6197a386d..1152dff7f 100644 --- a/packages/libf2c/meta.yaml +++ b/packages/libf2c/meta.yaml @@ -18,6 +18,9 @@ source: - patches/0003-remove-redundant-symbols.patch - patches/0004-correct-return-types.patch - patches/0005-Remove-symbols-defined-in-OpenBLAS.patch + # In CLAPACK's F2CLIBS/libf2c Makefile, some commands are mistakenly (?) hardcoded + # instead of using the right variables + - patches/0006-adjust-ld-ar-ranlib.patch extras: - [make.inc, make.inc] @@ -31,12 +34,7 @@ build: # easier to debug. chmod -R o+rx . - # In CLAPACK's Makefiles, some commands are mistakenly (?) hardcoded - # instead of using the right variables - sed -i 's/^ -ranlib /^ $(RANLIB)/' **/Makefile - sed -i 's/^ ar /^ $(ARCH)/' **/Makefile - sed -i 's/^ ld /^ $(LD)/' **/Makefile - + ARCH="emar" \ emmake make -j ${PYODIDE_JOBS:-3} f2clib mkdir -p ${WASM_LIBRARY_DIR}/{lib,include} cp INCLUDE/f2c.h ${WASM_LIBRARY_DIR}/include diff --git a/packages/libf2c/patches/0006-adjust-ld-ar-ranlib.patch b/packages/libf2c/patches/0006-adjust-ld-ar-ranlib.patch new file mode 100644 index 000000000..336f37616 --- /dev/null +++ b/packages/libf2c/patches/0006-adjust-ld-ar-ranlib.patch @@ -0,0 +1,33 @@ +Index: CLAPACK-3.2.1/F2CLIBS/libf2c/Makefile +=================================================================== +--- CLAPACK-3.2.1.orig/F2CLIBS/libf2c/Makefile ++++ CLAPACK-3.2.1/F2CLIBS/libf2c/Makefile +@@ -70,8 +70,8 @@ OFILES = $(MISC) $(POW) $(CX) $(DCX) $(R + all: f2c.h signal1.h sysdep1.h libf2c.a clapack_install + + libf2c.a: $(OFILES) +- ar r libf2c.a $? +- -ranlib libf2c.a ++ $(ARCH) r libf2c.a $? ++ $(RANLIB) libf2c.a + + ## Shared-library variant: the following rule works on Linux + ## systems. Details are system-dependent. Under Linux, -fPIC +@@ -80,7 +80,7 @@ libf2c.a: $(OFILES) + ## of "cc -shared". + + libf2c.so: $(OFILES) +- cc -shared -o libf2c.so $(OFILES) ++ $(CC) -shared -o libf2c.so $(OFILES) + + ### If your system lacks ranlib, you don't need it; see README. + +@@ -117,7 +117,7 @@ sysdep1.h: sysdep1.h0 + + install: libf2c.a + cp libf2c.a $(LIBDIR) +- -ranlib $(LIBDIR)/libf2c.a ++ $(RANLIB) $(LIBDIR)/libf2c.a + + clapack_install: libf2c.a + mv libf2c.a ..