On Sun, Aug 02, 2020 at 03:46:05PM +0200, Maarten van Gompel wrote:
> This is v2 of a big patch for svkbd. The overall intention is to make
> svkbd viable keyboard on a smartphone (the pinephone in particular).
> Svkbd is the keyboard of choice in the SXMO project
> (https://sr.ht/~mil/Sxmo/) by Miles Alan.
> 
> On request by Hiltjo I squashed less commits so the incremental history
> should be clearer, although this does result in a much longer patch series
> (14 now).
> 
> This message summarizes all of the changes. I incorporated all the
> feedback I received from Hiltjo, but be aware this occurs in patches 12
> and 13 of this series, so bear with me as you work through the earlier
> patches. It's an incremental/evolutionary path.
> 
> Miles had forked svkbd to make it more mobile friendly (smaller layout etc), 
> the first
> few patches are his unaltered contributions, I hope they come through 
> correctly
> as-such when I send them with git-send-mail (thought I had some issues last 
> time
> but all turned out well in the end).
> 
> I expanded upon his work by adding the following functionality:
> 
>  * Added Xft and Xinerama support
>  * Changed default fonts and layouts (default dark theme)
>  * Multiple layers, svkbd now support as many layers as you want and there's a
>    button to cycle between them.
>  * Overlay support, you can now long-press (>1s) certain keys and
>    an overlay will be put on the keyboard allowing you to enter variants
>    of the pressed letter. This is used e.g. for input of diacritics or
>    emojis. The overlay dissappears again as soon as a key is pressed.
>    (note: this functionality inevitably affects the ability to press
>    and without release hold certain keys and have them outputted on repeat)
>  * Added a degree of configurability using command line parameters and 
> environment variables,
>    because some run-time flexibility is needed on mobile devices. Layers can 
> be enabled/disabled on program start, overlay functionality can be disabled 
> on program start or on the fly (with a button).
>  * Made the original layouts compatible with the new implementation
> 
> The result is now that there are two new layouts:
> 
>  * mobile-intl - A small international layout optimised for mobile devices. 
> This layout consists of multiple layers which
>         can be switched on the fly, and overlays that appear on long-press of 
> certain keys, adding input ability for
>         diacritics and other variants, as well as some emoji. The available 
> layers in this layout are:
>     * a basic qwerty layer
>     * a layer for numeric input, arrows, and punctuation
>     * a layer for function keys, media keys, and arrows
>     * a cyrillic layer (ЙЦУКЕН)
>     * a dialer/numeric layer
>  * mobile-plain - This is the original English layout for sxmo with only a 
> qwerty layer and numeric/punctuation layer.
> 
> I made the new 'mobile-intl' layout the default, as it provides most of the 
> features
> one would expect on a mobile device. The older layouts should also work as 
> they
> did, and do not use any layers or overlays.
> 
> The README has been updated with more details.
> 
> This patch was also submitted downstream to SXMO and partially applied,
> see the discussion here:
> https://lists.sr.ht/~mil/sxmo-devel/%3C20200718122732.1192398-1-proycon%40anaproy.nl%3E
> and here:
> https://lists.sr.ht/~mil/sxmo-devel/%3C20200802123647.845631-1-proycon%40anaproy.nl%3E
> . But I think it makes most sense to incorporate these changes in svkbd
> itself rather than maintain a fork.
> 
> 
> 

Hi,

Thanks for improving the patches. There are many changes so bear with me to
review them.  It may take some time.

Some notes:

- The man page should list and document all the (new) options:
        -D, -O, -l, -s, -H, etc.
- `debug` could be a function debug(fmt, ...) and print to stderr + fflush.
- The default layout was changed, maybe it should stay english, svkbd is not
  only for mobile.  svkbd is not specificly for sxmo/mobile, but I'd like to
  support this project.
- Theres still a buffer overflow in SVKBD_LAYERS. You could use strdup() there.
- Code-style should be similar to st, comment style should be /*,
  TABs should be used consistently. */

Below is a patch to improve the Makefile:

- fix makefile to copy config.h rule.
- config.mk should use pkg-config (PKG_CONFIG), like st config.mk.


>From 3fe7bcc7a48ead2aa6246d2e78de64c74d8508f9 Mon Sep 17 00:00:00 2001
From: Hiltjo Posthuma <[email protected]>
Date: Sun, 2 Aug 2020 18:23:30 +0200
Subject: [PATCH] Makefile, config.mk: use pkg-config, fix config.h rule +
 tweaks

---
 Makefile  | 13 +++++++++----
 config.mk | 14 ++++++++++----
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 3e4f23e..6a175fa 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ include config.mk
 
 BIN = ${NAME}-${LAYOUT}
 SRC = drw.c ${NAME}.c util.c
-OBJ = ${NAME}-${LAYOUT}.o
+OBJ = ${SRC:.c=.o}
 MAN1 = ${NAME}.1
 
 all: ${BIN}
@@ -24,11 +24,16 @@ options:
 config.h:
        cp config.def.h $@
 
-${BIN}:
-       ${CC} -o $@ ${SRC} ${SVKBD_CFLAGS} ${SVKBD_CPPFLAGS} ${SVKBD_LDFLAGS}
+.c.o:
+       ${CC} ${SVKBD_CFLAGS} ${SVKBD_CPPFLAGS} -c $<
+
+${OBJ}: config.h config.mk
+
+${BIN}: ${OBJ}
+       ${CC} -o ${BIN} ${OBJ} ${SVKBD_LDFLAGS}
 
 clean:
-       rm -f ${NAME}-?? ${NAME}-??.o ${OBJ}
+       rm -f ${NAME}-?? ${NAME}-??.o ${OBJ} ${BIN}
 
 dist:
        rm -rf "${NAME}-${VERSION}"
diff --git a/config.mk b/config.mk
index bc4eeca..50d9c7f 100644
--- a/config.mk
+++ b/config.mk
@@ -7,15 +7,21 @@ MANPREFIX = ${PREFIX}/share/man
 X11INC = /usr/X11R6/include
 X11LIB = /usr/X11R6/lib
 
+PKG_CONFIG = pkg-config
+
 # Xinerama, comment if you don't want it
 XINERAMALIBS = -L${X11LIB} -lXinerama
 XINERAMAFLAGS = -DXINERAMA
 
 # includes and libs
-INCS = -I. -I./layouts -I${X11INC} -I/usr/include/freetype2
-LIBS = -L${X11LIB} -lX11 -lXtst -lfontconfig -lXft ${XINERAMALIBS}
+INCS = -I. -I./layouts -I${X11INC} \
+       `$(PKG_CONFIG) --cflags fontconfig` \
+       `$(PKG_CONFIG) --cflags freetype2`
+LIBS = -L${X11LIB} -lX11 -lXtst -lXft ${XINERAMALIBS} \
+       `$(PKG_CONFIG) --libs fontconfig` \
+       `$(PKG_CONFIG) --libs freetype2`
 
 # use system flags
-SVKBD_CFLAGS = ${CFLAGS}
+SVKBD_CFLAGS = ${CFLAGS} ${INCS}
 SVKBD_LDFLAGS = ${LDFLAGS} ${LIBS}
-SVKBD_CPPFLAGS = ${CPPFLAGS} ${INCS} -DVERSION=\"VERSION\" ${XINERAMAFLAGS} 
-DLAYOUT=\"layout.${LAYOUT}.h\"
+SVKBD_CPPFLAGS = ${CPPFLAGS} -DVERSION=\"VERSION\" ${XINERAMAFLAGS} 
-DLAYOUT=\"layout.${LAYOUT}.h\"
-- 
2.27.0

-- 
Kind regards,
Hiltjo

Reply via email to