Add pledge() support

While here, update MAINTAINER.  Diff from Timo Myyra (maintainer)
This commit is contained in:
jca 2017-12-20 17:22:37 +00:00
parent 0108da5db0
commit a15342c123
3 changed files with 40 additions and 4 deletions

View File

@ -1,18 +1,19 @@
# $OpenBSD: Makefile,v 1.33 2017/09/25 21:25:19 sthen Exp $
# $OpenBSD: Makefile,v 1.34 2017/12/20 17:22:37 jca Exp $
COMMENT= aewm++ based pretty themable window manager
DISTNAME= pekwm-0.1.17
REVISION= 2
REVISION= 3
CATEGORIES= x11
HOMEPAGE= https://www.pekwm.org/
MAINTAINER= Timo Myyra <timo.myyra@wickedbsd.net>
MAINTAINER= Timo Myyra <timo.myyra@bittivirhe.fi>
# GPLv2
PERMIT_PACKAGE_CDROM= Yes
# uses pledge()
WANTLIB += ICE SM X11 Xext Xft Xinerama Xpm Xrandr c iconv jpeg m png z
WANTLIB += ${COMPILER_LIBCXX}
@ -26,11 +27,13 @@ NO_TEST= Yes
USE_GMAKE= Yes
CONFIGURE_STYLE=gnu
CONFIGURE_STYLE=autoconf
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --enable-xinerama
AUTOCONF_VERSION= 2.69
post-install:
@mv ${WRKINST}/etc/pekwm ${PREFIX}/share/examples

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-configure_ac,v 1.1 2017/12/20 17:22:37 jca Exp $
Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -31,6 +31,9 @@ CXXFLAGS="$CXXFLAGS $INCICONV"
dnl Check for iconvctl
AC_CHECK_FUNC(iconvctl, [AC_DEFINE(HAVE_ICONVCTL, [1], [Define to 1 if you the iconvctl call])], )
+dnl Check for pledge
+AC_CHECK_FUNC(pledge, [AC_DEFINE(HAVE_PLEDGE, [1], [Define to 1 if you the pledge call])], )
+
dnl add x11 to the env
AC_PATH_X
AC_PATH_XTRA

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-src_main_cc,v 1.1 2017/12/20 17:22:37 jca Exp $
Index: src/main.cc
--- src/main.cc.orig
+++ src/main.cc
@@ -124,6 +124,12 @@ main(int argc, char **argv)
#endif // DEBUG
WindowManager *wm = WindowManager::start(command_line, config_file, replace);
+#if HAVE_PLEDGE
+ if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) {
+ cerr << "failed to pledge" << endl;
+ return 1;
+ }
+#endif
if (wm) {
try {