diff --git a/x11/ly/Makefile b/x11/ly/Makefile index a338809f2035..0bc98c2ee69c 100644 --- a/x11/ly/Makefile +++ b/x11/ly/Makefile @@ -1,64 +1,65 @@ PORTNAME= ly DISTVERSIONPREFIX= v DISTVERSION= 0.5.2 +PORTREVISION= 1 CATEGORIES= x11 MAINTAINER= nc@FreeBSD.org COMMENT= TUI (ncurses-like) display manager for X and Wayland LICENSE= WTFPL LICENSE_FILE= ${WRKSRC}/license.md BUILD_DEPENDS= ginstall:sysutils/coreutils USES= gmake localbase xorg USE_GITHUB= yes GH_ACCOUNT= cylgom GH_TUPLE= cylgom:argoat:36c41f09ecc2a10c9acf35e4194e08b6fa10cf45:argoat/sub/argoat \ cylgom:testoasterror:71620b47872b5535f87c908883576d73153a6911:testoasterror/sub/argoat/sub/testoasterror \ cylgom:configator:8227b3a835bf4c7e50a57e4ad6aff620ba0dc349:configator/sub/configator \ cylgom:ctypes:5dd979d3644ab0c85ca14e72b61e6d3d238d432b:ctypes/sub/ctypes \ cylgom:dragonfail:6b40d1f8b7f6dda9746e688666af623dfbcceb94:dragonfail/sub/dragonfail \ cylgom:termbox_next:2312da153e44face7bb45aa2798ec284289c17ca:termbox_next/sub/termbox_next USE_XORG= xcb MAKEFILE= makefile MAKE_ARGS= CC="${CC}" \ DISTVERSIONFULL="${DISTVERSIONFULL}" ALL_TARGET= final BINARY_ALIAS= install=ginstall SUB_FILES= pkg-message _GITDIR= ${WRKDIR}/${GH_PROJECT}-git post-patch: # Note to maintainers: patches can be regenerated with # "make clean extract do-patch makepatch" (YMMV). @${REINPLACE_CMD} "s|%%ETCDIR%%|${ETCDIR}|g" ${WRKSRC}/src/config.c @${REINPLACE_CMD} -e "s|%%ETCDIR%%|${ETCDIR}|g" \ -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \ ${WRKSRC}/res/config.ini @${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \ ${WRKSRC}/res/xsetup.sh post-install: @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ly .for _f in config.ini xsetup.sh wsetup.sh @${MV} ${STAGEDIR}${ETCDIR}/${_f} \ ${STAGEDIR}${ETCDIR}/${_f}.sample .endfor # Target for maintainers. Use this target to regenerate GH_TUPLE for Git # submodules used by the project (and project's dependencies). _git-submodules-to-gh-tuple: ${RM} -r ${_GITDIR} git clone https://github.com/${GH_ACCOUNT}/${GH_PROJECT} ${_GITDIR} git -C ${_GITDIR} checkout ${GH_TAGNAME} ${REINPLACE_CMD} 's/make github/${MAKE_CMD} github/g' ${_GITDIR}/makefile ${MAKE_CMD} -C ${_GITDIR} github git -C ${_GITDIR} submodule status --recursive | cut -c 2- | \ ${AWK} -f ${FILESDIR}/git-submodules-to-gh-tuple.awk .include diff --git a/x11/ly/files/patch-src_login.c b/x11/ly/files/patch-src_login.c index 8d70b31c605f..8aeff49939e9 100644 --- a/x11/ly/files/patch-src_login.c +++ b/x11/ly/files/patch-src_login.c @@ -1,104 +1,117 @@ ---- src/login.c.orig 2020-02-03 07:51:05 UTC -+++ src/login.c +diff -ru bak.ly-0.5.2/src/login.c ly-0.5.2/src/login.c +--- src/login.c 2021-10-16 23:20:01.325733000 -0400 ++++ src/login.c 2021-10-16 23:21:46.738595000 -0400 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include int get_free_display() -@@ -243,9 +243,15 @@ void env_init(struct passwd* pwd) +@@ -213,6 +213,11 @@ + // clean env + environ[0] = NULL; + ++ if (lang == NULL) ++ { ++ lang = "C.UTF-8"; ++ } ++ + if (term != NULL) + { + setenv("TERM", term, 1); +@@ -243,9 +248,15 @@ void env_xdg(const char* tty_id, const enum display_server display_server) { - char user[15]; - snprintf(user, 15, "/run/user/%d", getuid()); - setenv("XDG_RUNTIME_DIR", user, 0); + // The "/run/user/%d" directory is not available on FreeBSD. It is much + // better to stick to the defaults and let applications using + // XDG_RUNTIME_DIR to fall back to directories inside user's home + // directory. + /* + * char user[15]; + * snprintf(user, 15, "/run/user/%d", getuid()); + * setenv("XDG_RUNTIME_DIR", user, 0); + */ setenv("XDG_SESSION_CLASS", "user", 0); setenv("XDG_SEAT", "seat0", 0); setenv("XDG_VTNR", tty_id, 0); -@@ -271,8 +277,8 @@ void env_xdg(const char* tty_id, const enum display_se +@@ -271,8 +282,8 @@ } } -void add_utmp_entry( - struct utmp *entry, +void add_utmpx_entry( + struct utmpx *entry, char *username, pid_t display_pid ) { -@@ -283,24 +289,23 @@ void add_utmp_entry( +@@ -283,24 +294,23 @@ /* only correct for ptys named /dev/tty[pqr][0-9a-z] */ strcpy(entry->ut_id, ttyname(STDIN_FILENO) + strlen("/dev/tty")); - time((long int *) &entry->ut_time); + time((long int *) &entry->ut_tv.tv_sec); - strncpy(entry->ut_user, username, UT_NAMESIZE); - memset(entry->ut_host, 0, UT_HOSTSIZE); - entry->ut_addr = 0; - setutent(); + strncpy(entry->ut_user, username, sizeof(entry->ut_user)); + memset(entry->ut_host, 0, sizeof(entry->ut_host)); + setutxent(); - pututline(entry); + pututxline(entry); } -void remove_utmp_entry(struct utmp *entry) { +void remove_utmpx_entry(struct utmpx *entry) { entry->ut_type = DEAD_PROCESS; - memset(entry->ut_line, 0, UT_LINESIZE); - entry->ut_time = 0; - memset(entry->ut_user, 0, UT_NAMESIZE); - setutent(); - pututline(entry); - endutent(); + memset(entry->ut_line, 0, sizeof(entry->ut_line)); + entry->ut_tv.tv_sec = 0; + memset(entry->ut_user, 0, sizeof(entry->ut_user)); + setutxent(); + pututxline(entry); + endutxent(); } void xauth(const char* display_name, const char* shell, const char* dir) -@@ -581,7 +586,7 @@ void auth( +@@ -581,7 +591,7 @@ char vt[5]; snprintf(tty_id, 3, "%d", config.tty); - snprintf(vt, 5, "vt%d", config.tty); + snprintf(vt, 5, "vt%d", config.vt); // set env env_init(pwd); -@@ -636,13 +641,13 @@ void auth( +@@ -636,13 +646,13 @@ } // add utmp audit - struct utmp entry; - add_utmp_entry(&entry, pwd->pw_name, pid); + struct utmpx entry; + add_utmpx_entry(&entry, pwd->pw_name, pid); // wait for the session to stop int status; waitpid(pid, &status, 0); - remove_utmp_entry(&entry); + remove_utmpx_entry(&entry); reset_terminal(pwd);