diff options
author | jperkin <jperkin@pkgsrc.org> | 2022-05-09 19:44:16 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2022-05-09 19:44:16 +0000 |
commit | 9b28b7d62de235c5adb4871430ee5430f70069d6 (patch) | |
tree | c5d8c55f9f07b27f79f7bd5bf55a2a836a6a219a | |
parent | 20348594d62a85f1da40c4977d0b6bcda589741b (diff) | |
download | pkgsrc-9b28b7d62de235c5adb4871430ee5430f70069d6.tar.gz |
kpty: Fixes for non-openpty bitrotted code.
-rw-r--r-- | devel/kpty/Makefile | 12 | ||||
-rw-r--r-- | devel/kpty/PLIST | 3 | ||||
-rw-r--r-- | devel/kpty/distinfo | 5 | ||||
-rw-r--r-- | devel/kpty/patches/patch-src_kgrantpty.c | 15 | ||||
-rw-r--r-- | devel/kpty/patches/patch-src_kpty.cpp | 77 |
5 files changed, 104 insertions, 8 deletions
diff --git a/devel/kpty/Makefile b/devel/kpty/Makefile index 3cdc48d727b..8afd3594557 100644 --- a/devel/kpty/Makefile +++ b/devel/kpty/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.33 2022/04/25 04:55:47 markd Exp $ +# $NetBSD: Makefile,v 1.34 2022/05/09 19:44:16 jperkin Exp $ DISTNAME= kpty-${KF5VER} CATEGORIES= devel @@ -11,6 +11,16 @@ LICENSE= gnu-lgpl-v2.1 USE_TOOLS+= msgmerge +CFLAGS.SunOS+= -D__EXTENSIONS__ + +.include "../../mk/bsd.prefs.mk" + +PLIST_VARS+= grantpty + +.if ${OPSYS} == "SunOS" +PLIST.grantpty= yes +.endif + .include "../../lang/python/tool.mk" .include "../../devel/kcoreaddons/buildlink3.mk" .include "../../devel/ki18n/buildlink3.mk" diff --git a/devel/kpty/PLIST b/devel/kpty/PLIST index 28ebf2ec4f2..b01257789c7 100644 --- a/devel/kpty/PLIST +++ b/devel/kpty/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.4 2022/04/25 04:55:47 markd Exp $ +@comment $NetBSD: PLIST,v 1.5 2022/05/09 19:44:16 jperkin Exp $ include/KF5/KPty/KPty include/KF5/KPty/KPtyDevice include/KF5/KPty/KPtyProcess @@ -14,6 +14,7 @@ lib/cmake/KF5Pty/KF5PtyTargets.cmake lib/libKF5Pty.so lib/libKF5Pty.so.5 lib/libKF5Pty.so.${PKGVERSION} +${PLIST.grantpty}libexec/kf5/kgrantpty qt5/mkspecs/modules/qt_KPty.pri share/locale/af/LC_MESSAGES/kpty5.mo share/locale/ar/LC_MESSAGES/kpty5.mo diff --git a/devel/kpty/distinfo b/devel/kpty/distinfo index 06e74eb06a2..acbf69da622 100644 --- a/devel/kpty/distinfo +++ b/devel/kpty/distinfo @@ -1,8 +1,9 @@ -$NetBSD: distinfo,v 1.14 2022/04/25 04:55:47 markd Exp $ +$NetBSD: distinfo,v 1.15 2022/05/09 19:44:16 jperkin Exp $ BLAKE2s (kpty-5.93.0.tar.xz) = 8db60fd2b426ad20ccf7f15acbad24615f5f572f489ceb5472eefe2ddf92cbb4 SHA512 (kpty-5.93.0.tar.xz) = 0d28e2a8bc3cee75f2ba00ddb63306152e166845c890b21ebf6eb10e7e9826de68c461a9c8492bf888e7f49aa41d1ccc635415e84b781b2e5bbd57bb77767d0d Size (kpty-5.93.0.tar.xz) = 59144 bytes SHA1 (patch-src_ConfigureCheck.cmake) = aa44e7b76545c450bc41265a8077877e9f69506b -SHA1 (patch-src_kpty.cpp) = 88b3039792040cabb9c2d31b748f8b1b2efd87f6 +SHA1 (patch-src_kgrantpty.c) = 81787e45e3399871387d9f665b5430500bf96992 +SHA1 (patch-src_kpty.cpp) = da6e41dbfc4256e2474d144dc4b14aa32523e6b1 SHA1 (patch-src_kptydevice.cpp) = 7c9dcf4ce662996286444c393a1f377bbbf88511 diff --git a/devel/kpty/patches/patch-src_kgrantpty.c b/devel/kpty/patches/patch-src_kgrantpty.c new file mode 100644 index 00000000000..7b49c31c380 --- /dev/null +++ b/devel/kpty/patches/patch-src_kgrantpty.c @@ -0,0 +1,15 @@ +$NetBSD: patch-src_kgrantpty.c,v 1.1 2022/05/09 19:44:16 jperkin Exp $ + +Don't include C++ headers in a C file. + +--- src/kgrantpty.c.orig 2022-04-02 10:26:01.000000000 +0000 ++++ src/kgrantpty.c +@@ -27,7 +27,7 @@ + + #include <config-pty.h> + +-#include <cerrno> ++#include <errno.h> + #include <grp.h> + #include <stdio.h> + #include <stdlib.h> diff --git a/devel/kpty/patches/patch-src_kpty.cpp b/devel/kpty/patches/patch-src_kpty.cpp index 4b21f9938dc..0a780f644c4 100644 --- a/devel/kpty/patches/patch-src_kpty.cpp +++ b/devel/kpty/patches/patch-src_kpty.cpp @@ -1,10 +1,70 @@ -$NetBSD: patch-src_kpty.cpp,v 1.2 2021/03/30 10:58:23 markd Exp $ +$NetBSD: patch-src_kpty.cpp,v 1.3 2022/05/09 19:44:16 jperkin Exp $ NetBSD loginx() complains if ut_type not set before calling ---- src/kpty.cpp.orig 2021-03-06 16:29:41.000000000 +0000 +--- src/kpty.cpp.orig 2022-04-02 10:26:01.000000000 +0000 +++ src/kpty.cpp -@@ -496,6 +496,9 @@ void KPty::login(const char *user, const +@@ -10,6 +10,7 @@ + + #include "kpty_p.h" + ++#include <QFile> + #include <QProcess> + #include <kpty_debug.h> + +@@ -168,7 +169,7 @@ KPtyPrivate::~KPtyPrivate() + bool KPtyPrivate::chownpty(bool grant) + { + return !QProcess::execute(QFile::decodeName(CMAKE_INSTALL_PREFIX "/" KDE_INSTALL_LIBEXECDIR_KF "/kgrantpty"), +- QStringList() << (grant ? "--grant" : "--revoke") << QString::number(masterFd)); ++ QStringList() << (grant ? QStringLiteral("--grant") : QStringLiteral("--revoke")) << QString::number(masterFd)); + } + #endif + +@@ -260,6 +261,7 @@ bool KPty::open() + } + #endif // HAVE_PTSNAME || TIOCGPTN + ++#if 0 + // Linux device names, FIXME: Trouble on other systems? + for (const char *s3 = "pqrstuvwxyzabcde"; *s3; s3++) { + for (const char *s4 = "0123456789abcdef"; *s4; s4++) { +@@ -289,8 +291,10 @@ bool KPty::open() + + qCWarning(KPTY_LOG) << "Can't open a pseudo teletype"; + return false; ++#endif + + gotpty: ++#if 0 + QFileInfo info(d->ttyName.data()); + if (!info.exists()) { + return false; // this just cannot happen ... *cough* Yeah right, I just +@@ -302,14 +306,15 @@ gotpty: + && !d->chownpty(true)) { + qCWarning(KPTY_LOG) << "chownpty failed for device " << ptyName << "::" << d->ttyName << "\nThis means the communication can be eavesdropped." << endl; + } ++#endif + + grantedpt: + +-#ifdef HAVE_REVOKE ++#if HAVE_REVOKE + revoke(d->ttyName.data()); + #endif + +-#ifdef HAVE_UNLOCKPT ++#if HAVE_UNLOCKPT + unlockpt(d->masterFd); + #elif defined(TIOCSPTLCK) + int flag = 0; +@@ -502,11 +507,14 @@ void KPty::login(const char *user, const + #endif + + #if HAVE_UTMPX +- gettimeofday(&l_struct.ut_tv, 0); ++ gettimeofday(&l_struct.ut_tv, nullptr); + #else l_struct.ut_time = time(0); #endif @@ -14,7 +74,7 @@ NetBSD loginx() complains if ut_type not set before calling #if HAVE_LOGIN #if HAVE_LOGINX ::loginx(&l_struct); -@@ -503,9 +506,6 @@ void KPty::login(const char *user, const +@@ -514,9 +522,6 @@ void KPty::login(const char *user, const ::login(&l_struct); #endif #else @@ -24,3 +84,12 @@ NetBSD loginx() complains if ut_type not set before calling #if HAVE_STRUCT_UTMP_UT_PID l_struct.ut_pid = getpid(); #if HAVE_STRUCT_UTMP_UT_SESSION +@@ -605,7 +610,7 @@ void KPty::logout() + ut->ut_type = DEAD_PROCESS; + #endif + #if HAVE_UTMPX +- gettimeofday(&(ut->ut_tv), 0); ++ gettimeofday(&(ut->ut_tv), nullptr); + pututxline(ut); + } + endutxent(); |