Use TeXLive supplied graphite2 and HarfBuzz build

This commit is contained in:
Marcel Fabian Krüger 2022-01-02 11:01:00 +01:00
parent 80fc5864a2
commit 9a8574e788

View File

@ -3,11 +3,11 @@ TEXLIVE_SRC = $(HOME)/texlive-source
# We expect to find a precompiled static library compiled with -fpic here
LUA_DIR = $(HOME)/lua/
# HarfBuzz also should be compiled static, position independent in a build_meson subdirectory
HARFBUZZ_DIR = $(HOME)/harfbuzz
HARFBUZZ_DIR = $(TEXLIVE_SRC)/Work/libs/harfbuzz
# Graphite also should be compiled static, position independent in a build subdirectory
GRAPHITE_DIR = $(HOME)/graphite
GRAPHITE_DIR = $(TEXLIVE_SRC)/Work/libs/graphite2
HB_INCLUDE_DIRS = $(HARFBUZZ_DIR)/src
HB_INCLUDE_DIRS = $(HARFBUZZ_DIR)/include
TL_INCLUDE_DIRS = $(TEXLIVE_SRC)/Work/texk $(TEXLIVE_SRC)/texk
LUA_INCLUDE_DIRS = $(LUA_DIR)
LINK.so = $(LINK.o) -shared
@ -15,21 +15,28 @@ LINK.so = $(LINK.o) -shared
LUAHARFBUZZ_SRCS = $(wildcard luaharfbuzz/src/luaharfbuzz/*.c)
LUAHARFBUZZ_OBJS = $(patsubst %.c,%.o,$(LUAHARFBUZZ_SRCS))
override CFLAGS += -fpic -DHAVE_DECL_ISASCII=1 $(patsubst %,-I%,$(INCLUDE_DIRS))
# For Linux
override LDFLAGS += -Wl,linkscript.ld
SO_EXT = so
# For Windows instead:
# override LDFLAGS += -Wl,-version-script=versionscript
# SO_EXT = dll
# For MacOS instead:
# override LDFLAGS += -Wl,-exported_symbols_list,symbols_list,-alias_list,alias_list -lc++abi
# SO_EXT = dylib
luaharfbuzz/src/luaharfbuzz/%.o: INCLUDE_DIRS = $(HB_INCLUDE_DIRS) $(LUA_INCLUDE_DIRS)
luametalatex-kpse/lkpselib.o: INCLUDE_DIRS = $(TL_INCLUDE_DIRS) $(LUA_INCLUDE_DIRS)
luametalatex.so: luametalatex-kpse/lkpselib.o $(LUAHARFBUZZ_OBJS) $(TEXLIVE_SRC)/Work/texk/kpathsea/.libs/libkpathsea.a $(HARFBUZZ_DIR)/build_meson/src/libharfbuzz.a $(GRAPHITE_DIR)/build/src/libgraphite2.a $(LUA_DIR)/liblua.a
luametalatex.$(SO_EXT): luametalatex-kpse/lkpselib.o $(LUAHARFBUZZ_OBJS) $(TEXLIVE_SRC)/Work/texk/kpathsea/.libs/libkpathsea.a $(HARFBUZZ_DIR)/libharfbuzz.a $(GRAPHITE_DIR)/libgraphite2.a $(LUA_DIR)/liblua.a
%.so:
%.$(SO_EXT):
$(LINK.so) $^ $(LOADLIBES) $(LDLIBS) -o $@
.PHONY: clean
clean:
rm $(LUAHARFBUZZ_OBJS) luametalatex-kpse/lkpselib.o luametalatex.so
rm $(LUAHARFBUZZ_OBJS) luametalatex-kpse/lkpselib.o luametalatex.$(SO_EXT)
# lkpselib.o: lkpselib.c