diff --git a/x11-packages/tabbed/build.sh b/x11-packages/tabbed/build.sh index bbe375426f..1fd546153d 100644 --- a/x11-packages/tabbed/build.sh +++ b/x11-packages/tabbed/build.sh @@ -2,9 +2,15 @@ TERMUX_PKG_HOMEPAGE=https://tools.suckless.org/tabbed/ TERMUX_PKG_DESCRIPTION="Generic tabbed interface" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=0.6 +TERMUX_PKG_VERSION=0.7 TERMUX_PKG_SRCURL=https://dl.suckless.org/tools/tabbed-${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_SHA256=7651ea3acbec5d6a25469e8665da7fc70aba2b4fa61a2a6a5449eafdfd641c42 -TERMUX_PKG_DEPENDS="libx11" +TERMUX_PKG_SHA256=6e8682230a213d7dabf8a79306bd3ce023875b2295a9097db427d65c1c68f322 +TERMUX_PKG_DEPENDS="libx11, libxft" TERMUX_PKG_BUILD_DEPENDS="xorgproto" TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_post_get_source() { + if [ ! -e ./xembed.1 ]; then + cp $TERMUX_PKG_BUILDER_DIR/xembed.1 ./ + fi +} diff --git a/x11-packages/tabbed/config.def.h.patch b/x11-packages/tabbed/config.def.h.patch index 9c5e49fbf6..1a6fd982df 100644 --- a/x11-packages/tabbed/config.def.h.patch +++ b/x11-packages/tabbed/config.def.h.patch @@ -1,11 +1,11 @@ --- a/config.def.h +++ b/config.def.h -@@ -20,7 +20,7 @@ +@@ -24,7 +24,7 @@ static Bool npisrelative = False; #define SETPROP(p) { \ -- .v = (char *[]){ "/bin/sh", "-c", \ -+ .v = (char *[]){ "@TERMUX_PREFIX@/bin/sh", "-c", \ - "prop=\"`xwininfo -children -id $1 | grep '^ 0x' | sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' | xargs -0 printf %b | dmenu -l 10`\" &&" \ - "xprop -id $1 -f $0 8s -set $0 \"$prop\"", \ - p, winid, NULL \ +- .v = (char *[]){ "/bin/sh", "-c", \ ++ .v = (char *[]){ "@TERMUX_PREFIX@/bin/sh", "-c", \ + "prop=\"`xwininfo -children -id $1 | grep '^ 0x' |" \ + "sed -e's@^ *\\(0x[0-9a-f]*\\) \"\\([^\"]*\\)\".*@\\1 \\2@' |" \ + "xargs -0 printf %b | dmenu -l 10 -w $1`\" &&" \ diff --git a/x11-packages/tabbed/config.mk.patch b/x11-packages/tabbed/config.mk.patch index 0cb0e8ed6f..0fd06bdd35 100644 --- a/x11-packages/tabbed/config.mk.patch +++ b/x11-packages/tabbed/config.mk.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -4,22 +4,22 @@ +@@ -4,30 +4,30 @@ # Customize below to fit your system # paths @@ -8,15 +8,27 @@ +PREFIX ?= @TERMUX_PREFIX@ MANPREFIX = ${PREFIX}/share/man +-X11INC = /usr/X11R6/include +-X11LIB = /usr/X11R6/lib ++X11INC = @TERMUX_PREFIX@/include ++X11LIB = @TERMUX_PREFIX@/lib + + # freetype + FREETYPELIBS = -lfontconfig -lXft +-FREETYPEINC = /usr/include/freetype2 ++FREETYPEINC = @TERMUX_PREFIX@/include/freetype2 + # OpenBSD (uncomment) + #FREETYPEINC = ${X11INC}/freetype2 + # includes and libs --INCS = -I. -I/usr/include --LIBS = -L/usr/lib -lc -lX11 -+INCS = -I. -I@TERMUX_PREFIX@/include -+LIBS = -L@TERMUX_PREFIX@/lib -lc -lX11 +-INCS = -I. -I/usr/include -I$(X11INC) -I${FREETYPEINC} +-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${FREETYPELIBS} ++INCS = -I. -I@TERMUX_PREFIX@/include -I$(X11INC) -I${FREETYPEINC} ++LIBS = -L@TERMUX_PREFIX@/lib -lc -L${X11LIB} -lX11 ${FREETYPELIBS} # flags - CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE --CFLAGS = -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} + CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE +-CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -s ${LIBS} +CFLAGS += -std=c99 -pedantic -Wall ${INCS} ${CPPFLAGS} +LDFLAGS += -s ${LIBS} @@ -28,4 +40,3 @@ # compiler and linker -CC = cc +CC ?= cc - diff --git a/x11-packages/tabbed/xembed.1 b/x11-packages/tabbed/xembed.1 new file mode 100644 index 0000000000..5b0c28c96d --- /dev/null +++ b/x11-packages/tabbed/xembed.1 @@ -0,0 +1,35 @@ +.TH XEMBED 1 tabbed\-VERSION +.SH NAME +xembed \- XEmbed foreground process +.SH SYNOPSIS +.B xembed +.I flag command +.RI [ "argument ..." ] +.SH DESCRIPTION +If the environment variable XEMBED is set, and +.B xembed +is in the foreground of its controlling tty, it will execute +.IP +command flag $XEMBED [argument ...] +.LP +Otherwise it will execute +.IP +command [argument ...] +.LP +.SH EXAMPLE +In a terminal emulator within a +.B tabbed +session, the shell alias +.IP +$ alias surf='xembed -e surf' +.LP +will cause `surf' to open in a new tab, unless it is run in the background, +i.e. `surf &', in which case it will instead open in a new window. +.SH AUTHORS +See the LICENSE file for the authors. +.SH LICENSE +See the LICENSE file for the terms of redistribution. +.SH SEE ALSO +.BR tabbed (1) +.SH BUGS +Please report them.