commit e139d1fd75eb5c607bb30e742408106aef963dee
parent 1a1d492cd84b9f55ffbba36d713dd18273638083
Author: bakkeby <bakkeby@gmail.com>
Date: Sun, 9 May 2021 15:06:02 +0200
Refactoring Makefile and config.mk to make it easier to enable patches such as the ligatures patch and the sixel patch
Diffstat:
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
@@ -4,13 +4,6 @@
include config.mk
-# Uncomment the line below and the hb.o line further down for the ligatures patch
-#LIGATURES_C = hb.c
-#LIGATURES_H = hb.h
-
-# Uncomment this for the SIXEL patch / SIXEL_PATCH
-#SIXEL_C = sixel.c sixel_hls.c
-
SRC = st.c x.c $(LIGATURES_C) $(SIXEL_C)
OBJ = $(SRC:.c=.o)
@@ -33,8 +26,6 @@ patches.h:
st.o: config.h st.h win.h
x.o: arg.h config.h st.h win.h $(LIGATURES_H)
-# Uncomment the below line for the ligatures patch
-#hb.o: st.h
$(OBJ): config.h config.mk patches.h
diff --git a/config.mk b/config.mk
@@ -18,15 +18,24 @@ PKG_CONFIG = pkg-config
# Uncomment this for the themed cursor patch / THEMED_CURSOR_PATCH
#XCURSOR = -lXcursor
+# Uncomment the lines below for the ligatures patch / LIGATURES_PATCH
+#LIGATURES_C = hb.c
+#LIGATURES_H = hb.h
+#LIGATURES_INC = `$(PKG_CONFIG) --cflags harfbuzz`
+#LIGATURES_LIBS = `$(PKG_CONFIG) --libs harfbuzz`
+
+# Uncomment this for the SIXEL patch / SIXEL_PATCH
+#SIXEL_C = sixel.c sixel_hls.c
+
# includes and libs, uncomment harfbuzz for the ligatures patch
INCS = -I$(X11INC) \
`$(PKG_CONFIG) --cflags fontconfig` \
`$(PKG_CONFIG) --cflags freetype2` \
-# `$(PKG_CONFIG) --cflags harfbuzz`
+ $(LIGATURES_INC)
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft ${XRENDER} ${XCURSOR}\
`$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2` \
-# `$(PKG_CONFIG) --libs harfbuzz`
+ $(LIGATURES_LIBS)
# flags
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
diff --git a/patches.def.h b/patches.def.h
@@ -169,9 +169,8 @@
/* This patch adds support for drawing ligatures using the Harfbuzz library to transform
* original text of a single line to a list of glyphs with ligatures included.
* This patch depends on the Harfbuzz library and headers to compile.
- * You need to uncomment the corresponding line in config.mk to use the harfbuzz library
+ * You need to uncomment the corresponding lines in config.mk to use the harfbuzz library
* when including this patch.
- * You need to uncomment the corresponding lines in Makefile when including this patch.
* https://github.com/cog1to/st-ligatures
* https://st.suckless.org/patches/ligatures/
*/