Closed kevinushey closed 1 month ago
(you could also argue it's my fault for having both an x86_64 installation of Homebrew in /usr/local
, as well as the regular arm64 installation in /opt/homebrew
...)
I also have this issue!
I think systemfonts gets around this by having a configure script that generates the Makevars: https://github.com/r-lib/systemfonts/blob/main/configure https://github.com/r-lib/systemfonts/blob/main/src/Makevars.in
which for me makes:
CXX_STD = CXX11
PKG_CPPFLAGS=-I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16
PKG_OBJCXXFLAGS=-fobjc-arc
DARWIN_LIBS = -framework CoreText -framework Foundation
DARWIN_OBJECTS = mac/FontManagerMac.o
UNIX_OBJECTS = unix/FontManagerLinux.o
PKG_LIBS = -L/opt/homebrew/opt/freetype/lib -L/opt/homebrew/opt/libpng/lib -lfreetype -lbz2 -lpng16 -lz $(DARWIN_LIBS)
OBJECTS = caches.o cpp11.o dev_metrics.o font_matching.o font_registry.o \
ft_cache.o string_shape.o font_metrics.o font_fallback.o string_metrics.o \
emoji.o cache_store.o init.o $(DARWIN_OBJECTS)
all: clean
clean:
rm -f $(SHLIB) $(OBJECTS)
and that works well
For reference, the installation log:
Would it be worth including a configure script that prefers libraries found in
/opt/homebrew/lib
if on arm64 macOS?