Hi, Here is an pledge patch for current pekwm version. Tested that basic features work with pledged version. Pledge promises needed: - stdio: work with mem - rpath: read pekwm configs - wpath,cpath: write pekwm configs under ~/.pekwm (like replacing the wm) - proc,exec: run external scripts from wm
Timo Index: Makefile =================================================================== RCS file: /cvs/ports/x11/pekwm/Makefile,v retrieving revision 1.33 diff -u -p -r1.33 Makefile --- Makefile 25 Sep 2017 21:25:19 -0000 1.33 +++ Makefile 18 Dec 2017 19:36:00 -0000 @@ -3,16 +3,17 @@ 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.my...@wickedbsd.net> +MAINTAINER= Timo Myyra <timo.my...@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,10 +27,12 @@ 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 Index: patches/patch-configure_ac =================================================================== RCS file: patches/patch-configure_ac diff -N patches/patch-configure_ac --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-configure_ac 18 Dec 2017 19:36:00 -0000 @@ -0,0 +1,15 @@ +$OpenBSD$ + +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 Index: patches/patch-src_main_cc =================================================================== RCS file: patches/patch-src_main_cc diff -N patches/patch-src_main_cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_main_cc 18 Dec 2017 19:36:00 -0000 @@ -0,0 +1,18 @@ +$OpenBSD$ + +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 {