On Fri, Mar 16, 2018 at 06:31:56PM +0100, Klemens Nanni wrote:
> On Fri, Mar 16, 2018 at 09:29:50AM +0100, Rafael Sadowski wrote:
> > Simple update to the latest stable version, Ok? Comments?
> Some comments inline with an updated diff in the end, st continues to
> work for me on amd64.
>
New diff as promised keeping INCS/LIBS/*FLAGS as Rafael did already
except with CFLAGS passed. I also fixed two of my own mistakes, see
inline comments.
This looks good to me now.
> > @@ -16,23 +17,23 @@ $OpenBSD: patch-config_mk,v 1.9 2017/04/
> > +X11LIB = ${X11BASE}/lib
> >
> > # includes and libs
> > --INCS = -I. -I/usr/include -I${X11INC} \
> > +-INCS = -I$(X11INC) \
> > - `pkg-config --cflags fontconfig` \
> > - `pkg-config --cflags freetype2`
> > --LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft \
> > -- `pkg-config --libs fontconfig` \
> > +-LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
> > +- `pkg-config --libs fontconfig` \
> > - `pkg-config --libs freetype2`
> > +INCS != pkg-config --cflags fontconfig
> > +LIBS = -lm -lX11 -lutil -lXft
> > +LIBS +!= pkg-config --libs fontconfig
That's fine.
> > # flags
> > --CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
> > --CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS}
> > ${CPPFLAGS}
> > --LDFLAGS += -g ${LIBS}
> > +-CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
> > +-STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS)
> > +-STLDFLAGS = $(LIBS) $(LDFLAGS)
> > +CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
> > -+CFLAGS += -std=c99 ${INCS} ${CPPFLAGS}
> > -+LDFLAGS += ${LIBS}
> > ++STCFLAGS += -std=c99 ${INCS} ${CPPFLAGS}
> > ++STLDFLAGS += ${LIBS}
> These might be handled in a clever way as well, but for now I've left
> these hunks untouched; will check later.
Did you leave CFLAGS out intentionally?
> +MAKE_ENV= LDFLAGS="${LDFLAGS}" \
> + PREFIX=${PREFIX} \
> + MANPREFIX=${PREFIX}/man \
PREFIX and MANPREFIX are obsolete with do-install.
> +SUBST_VARS= V
> +
> +pre-configure:
> + ${SUBST_CMD} ${WRKSRC}/st.1
> +
> +do-install:
> + ${INSTALL_PROGRAM} ${WRKSRC}/st ${PREFIX}/bin/
> + ${INSTALL_MAN} ${WRKSRC}/st.1 ${PREFIX}/man/man1/
Sloppy thinking on my part: it's VERSION not V, but SUBST_CMD wouldn't
work either way since it's looking for ${VAR} not VAR.
Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/st/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile 26 Sep 2017 23:03:53 -0000 1.15
+++ Makefile 17 Mar 2018 07:19:36 -0000
@@ -2,12 +2,12 @@
COMMENT= simple X terminal
-DISTNAME= st-0.7
-REVISION= 1
+V= 0.8
+DISTNAME= st-${V}
CATEGORIES= x11
-HOMEPAGE= http://st.suckless.org/
+HOMEPAGE= https://st.suckless.org/
MAINTAINER= Joerg Jung <[email protected]>
@@ -17,11 +17,18 @@ PERMIT_PACKAGE_CDROM= Yes
# uses pledge()
WANTLIB= c m util X11 Xft fontconfig freetype z
-MASTER_SITES= http://dl.suckless.org/st/
+MASTER_SITES= https://dl.suckless.org/st/
-MAKE_ENV= LDFLAGS="${LDFLAGS}"
-FAKE_FLAGS= DESTDIR=""
+MAKE_ENV= LDFLAGS="${LDFLAGS}" \
+ X11INC=${X11BASE}/include \
+ X11LIB=${X11BASE}/lib
NO_TEST= Yes
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/st ${PREFIX}/bin/
+ ${INSTALL_MAN} ${WRKSRC}/st.1 ${PREFIX}/man/man1/
+ sed -i s/VERSION/${V}/g ${PREFIX}/man/man1/st.1
+ tic -s -x -o ${PREFIX}/share/terminfo ${WRKSRC}/st.info
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/x11/st/distinfo,v
retrieving revision 1.9
diff -u -p -r1.9 distinfo
--- distinfo 9 Oct 2016 18:47:49 -0000 1.9
+++ distinfo 17 Mar 2018 07:19:36 -0000
@@ -1,2 +1,2 @@
-SHA256 (st-0.7.tar.gz) = 94cNkGzMmIkm7vLMmJUKmcx4cltoXpNMQiwDwSNOYAA=
-SIZE (st-0.7.tar.gz) = 42418
+SHA256 (st-0.8.tar.gz) = dzU5INB9ZsaEoPV+w3wmcMQv3FyHHWOCtwFgHNxZdXY=
+SIZE (st-0.8.tar.gz) = 45401
Index: patches/patch-Makefile
===================================================================
RCS file: patches/patch-Makefile
diff -N patches/patch-Makefile
--- patches/patch-Makefile 9 Jul 2015 22:07:23 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,44 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.4 2015/07/09 22:07:23 czarkoff Exp $
---- Makefile.orig Tue Jul 7 22:26:44 2015
-+++ Makefile Thu Jul 9 00:05:58 2015
-@@ -18,14 +18,12 @@ config.h:
- cp config.def.h config.h
-
- .c.o:
-- @echo CC $<
-- @${CC} -c ${CFLAGS} $<
-+ ${CC} -c ${CFLAGS} $<
-
- ${OBJ}: config.h config.mk
-
- st: ${OBJ}
-- @echo CC -o $@
-- @${CC} -o $@ ${OBJ} ${LDFLAGS}
-+ ${CC} -o $@ ${OBJ} ${LDFLAGS}
-
- clean:
- @echo cleaning
-@@ -40,16 +38,13 @@ dist: clean
- @rm -rf st-${VERSION}
-
- install: all
-- @echo installing executable file to ${DESTDIR}${PREFIX}/bin
-- @mkdir -p ${DESTDIR}${PREFIX}/bin
-- @cp -f st ${DESTDIR}${PREFIX}/bin
-- @chmod 755 ${DESTDIR}${PREFIX}/bin/st
-- @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
-- @mkdir -p ${DESTDIR}${MANPREFIX}/man1
-- @sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
-- @chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
-- @echo Please see the README file regarding the terminfo entry of st.
-- @tic -s st.info
-+ ${BSD_INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/bin
-+ ${BSD_INSTALL_PROGRAM} st ${DESTDIR}${PREFIX}/bin
-+ ${BSD_INSTALL_MAN_DIR} ${DESTDIR}${MANPREFIX}/man1
-+ sed "s/VERSION/${VERSION}/g" < st.1 > st.1.tmp
-+ mv st.1.tmp st.1
-+ ${BSD_INSTALL_MAN} st.1 ${DESTDIR}${MANPREFIX}/man1
-+ tic -s -o ${DESTDIR}${PREFIX}/share/terminfo st.info
-
- uninstall:
- @echo removing executable file from ${DESTDIR}${PREFIX}/bin
Index: patches/patch-config_def_h
===================================================================
RCS file: /cvs/ports/x11/st/patches/patch-config_def_h,v
retrieving revision 1.8
diff -u -p -r1.8 patch-config_def_h
--- patches/patch-config_def_h 9 Oct 2016 18:47:49 -0000 1.8
+++ patches/patch-config_def_h 17 Mar 2018 07:19:36 -0000
@@ -1,15 +1,7 @@
$OpenBSD: patch-config_def_h,v 1.8 2016/10/09 18:47:49 czarkoff Exp $
---- config.def.h.orig Sat Oct 8 21:48:13 2016
-+++ config.def.h Sat Oct 8 21:48:37 2016
-@@ -5,7 +5,7 @@
- *
- * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
- */
--static char font[] = "Liberation
Mono:pixelsize=12:antialias=true:autohint=true";
-+static char font[] = "DejaVu Sans
Mono:pixelsize=12:antialias=true:autohint=false";
- static int borderpx = 2;
-
- /*
+Index: config.def.h
+--- config.def.h.orig
++++ config.def.h
@@ -92,7 +92,7 @@ static const char *colorname[] = {
"blue2",
"magenta3",
Index: patches/patch-config_mk
===================================================================
RCS file: /cvs/ports/x11/st/patches/patch-config_mk,v
retrieving revision 1.9
diff -u -p -r1.9 patch-config_mk
--- patches/patch-config_mk 5 Apr 2017 21:29:57 -0000 1.9
+++ patches/patch-config_mk 17 Mar 2018 07:19:36 -0000
@@ -1,38 +1,28 @@
$OpenBSD: patch-config_mk,v 1.9 2017/04/05 21:29:57 juanfra Exp $
---- config.mk.orig Thu Aug 11 16:25:58 2016
-+++ config.mk Tue Mar 28 12:27:10 2017
-@@ -4,24 +4,21 @@ VERSION = 0.7
- # Customize below to fit your system
-
- # paths
--PREFIX = /usr/local
--MANPREFIX = ${PREFIX}/share/man
-+PREFIX ?= /usr/local
-+MANPREFIX = ${PREFIX}/man
-
--X11INC = /usr/X11R6/include
--X11LIB = /usr/X11R6/lib
-+X11INC = ${X11BASE}/include
-+X11LIB = ${X11BASE}/lib
+Index: config.mk
+--- config.mk.orig
++++ config.mk
+@@ -11,17 +11,14 @@ X11INC = /usr/X11R6/include
+ X11LIB = /usr/X11R6/lib
# includes and libs
--INCS = -I. -I/usr/include -I${X11INC} \
+-INCS = -I$(X11INC) \
- `pkg-config --cflags fontconfig` \
- `pkg-config --cflags freetype2`
--LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft \
-- `pkg-config --libs fontconfig` \
+-LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
+- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
+INCS != pkg-config --cflags fontconfig
+LIBS = -lm -lX11 -lutil -lXft
+LIBS +!= pkg-config --libs fontconfig
# flags
--CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
--CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS}
${CPPFLAGS}
--LDFLAGS += -g ${LIBS}
+-CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
+-STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS)
+-STLDFLAGS = $(LIBS) $(LDFLAGS)
+CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
-+CFLAGS += -std=c99 ${INCS} ${CPPFLAGS}
-+LDFLAGS += ${LIBS}
++STCFLAGS += -std=c99 ${INCS} ${CPPFLAGS} ${CFLAGS}
++STLDFLAGS += ${LIBS}
# compiler and linker
- # CC = cc
+ # CC = c99
Index: patches/patch-st_c
===================================================================
RCS file: /cvs/ports/x11/st/patches/patch-st_c,v
retrieving revision 1.4
diff -u -p -r1.4 patch-st_c
--- patches/patch-st_c 26 Sep 2017 23:03:53 -0000 1.4
+++ patches/patch-st_c 17 Mar 2018 07:19:36 -0000
@@ -2,15 +2,13 @@ $OpenBSD: patch-st_c,v 1.4 2017/09/26 23
Index: st.c
--- st.c.orig
+++ st.c
-@@ -1454,9 +1454,15 @@ ttynew(void)
+@@ -806,9 +806,13 @@ ttynew(char *line, char *cmd, char *out, char **args)
die("ioctl TIOCSCTTY failed: %s\n", strerror(errno));
close(s);
close(m);
-+
+ if (pledge("stdio getpw proc exec", NULL) == -1)
+ die("pledge\n");
-+
- execsh();
+ execsh(cmd, args);
break;
default:
+ if (pledge("stdio rpath tty proc", NULL) == -1)