Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153496824
D22228.id64274.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
14 KB
Referenced Files
None
Subscribers
None
D22228.id64274.diff
View Options
Index: x11/Makefile
===================================================================
--- x11/Makefile
+++ x11/Makefile
@@ -207,6 +207,7 @@
SUBDIR += lxqt-globalkeys
SUBDIR += lxqt-runner
SUBDIR += lxrandr
+ SUBDIR += ly
SUBDIR += mate
SUBDIR += mate-applets
SUBDIR += mate-base
Index: x11/ly/Makefile
===================================================================
--- /dev/null
+++ x11/ly/Makefile
@@ -0,0 +1,69 @@
+# $FreeBSD$
+
+PORTNAME= ly
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.4.0
+CATEGORIES= x11
+
+MAINTAINER= 0mp@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
+
+pre-build:
+ # This has to be done in the pre-build target instead of the post-patch
+ # target because we want the command "make clean patch makepatch" to
+ # yield the set of patches everytime. If we use the post-patch target
+ # instead, we would get a new set of patches with hardcoded values
+ # instead of placeholders like %%ETCDIR%%.
+ @${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 <bsd.port.mk>
Index: x11/ly/distinfo
===================================================================
--- /dev/null
+++ x11/ly/distinfo
@@ -0,0 +1,15 @@
+TIMESTAMP = 1573652164
+SHA256 (cylgom-ly-v0.4.0_GH0.tar.gz) = c4e505be200d54679f27929cffb1f4625c20ab51e8b6ffe7c06b3bccff5fb40d
+SIZE (cylgom-ly-v0.4.0_GH0.tar.gz) = 18807
+SHA256 (cylgom-argoat-36c41f09ecc2a10c9acf35e4194e08b6fa10cf45_GH0.tar.gz) = 5c284cae748b1cec4eef311845f53ad673f91996ec425c6e323f0c40e829e77f
+SIZE (cylgom-argoat-36c41f09ecc2a10c9acf35e4194e08b6fa10cf45_GH0.tar.gz) = 5497
+SHA256 (cylgom-testoasterror-71620b47872b5535f87c908883576d73153a6911_GH0.tar.gz) = bffa1100ffbb7d541a16a9a543e216748fe6f6264fd2b9137738cebcf68d3e8c
+SIZE (cylgom-testoasterror-71620b47872b5535f87c908883576d73153a6911_GH0.tar.gz) = 3360
+SHA256 (cylgom-configator-8227b3a835bf4c7e50a57e4ad6aff620ba0dc349_GH0.tar.gz) = bde1826acb80092bd551985082dc872c7f3e48e03132c377f0e5cdd2f9f331e3
+SIZE (cylgom-configator-8227b3a835bf4c7e50a57e4ad6aff620ba0dc349_GH0.tar.gz) = 4501
+SHA256 (cylgom-ctypes-5dd979d3644ab0c85ca14e72b61e6d3d238d432b_GH0.tar.gz) = 778189ee022a0ad97073372681fb92a7b2a1ecc5a242e99b1f23745f084ee3e1
+SIZE (cylgom-ctypes-5dd979d3644ab0c85ca14e72b61e6d3d238d432b_GH0.tar.gz) = 1242
+SHA256 (cylgom-dragonfail-6b40d1f8b7f6dda9746e688666af623dfbcceb94_GH0.tar.gz) = c185f739e392313c08b0d5fd27e93891b89c36b7b49b83570b601b9cbfbddae1
+SIZE (cylgom-dragonfail-6b40d1f8b7f6dda9746e688666af623dfbcceb94_GH0.tar.gz) = 3348
+SHA256 (cylgom-termbox_next-2312da153e44face7bb45aa2798ec284289c17ca_GH0.tar.gz) = b788c86e1454c32cd218d0478a87def0a4d1322fef407885359d1ed0c343b045
+SIZE (cylgom-termbox_next-2312da153e44face7bb45aa2798ec284289c17ca_GH0.tar.gz) = 23558
Index: x11/ly/files/git-submodules-to-gh-tuple.awk
===================================================================
--- /dev/null
+++ x11/ly/files/git-submodules-to-gh-tuple.awk
@@ -0,0 +1,20 @@
+#! /usr/bin/awk -f
+# $Id$
+
+BEGIN {
+ group_number = 0
+ printf "GH_TUPLE="
+}
+
+{
+ account = "cylgom"
+ project = $2
+ gsub(".*/", "", project)
+ hash = $1
+ path = $2
+ printf " \\\n\t%s:%s:%s:%s/%s", account, project, hash, project, path
+}
+
+END {
+ printf "\n"
+}
Index: x11/ly/files/patch-makefile
===================================================================
--- /dev/null
+++ x11/ly/files/patch-makefile
@@ -0,0 +1,47 @@
+--- makefile.orig 2019-09-21 16:00:16 UTC
++++ makefile
+@@ -1,9 +1,9 @@
+ NAME = ly
+ CC = gcc
+ FLAGS = -std=c99 -pedantic -g
+-FLAGS+= -Wall -Wno-unused-parameter -Wextra -Werror=vla -Werror
++FLAGS+= -Wall -Wno-unused-parameter -Wextra -Werror=vla
+ #FLAGS+= -DDEBUG
+-FLAGS+= -DGIT_VERSION_STRING=\"$(shell git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g')\"
++FLAGS+= -DGIT_VERSION_STRING=\"${DISTVERSIONFULL}\"
+ LINK = -lpam -lxcb
+ VALGRIND = --show-leak-kinds=all --track-origins=yes --leak-check=full --suppressions=../res/valgrind.supp
+ CMD = ./$(NAME)
+@@ -12,6 +12,10 @@ OS:= $(shell uname -s)
+ ifeq ($(OS), Linux)
+ FLAGS+= -D_DEFAULT_SOURCE
+ endif
++ifeq ($(OS), FreeBSD)
++ FLAGS+= -D_DEFAULT_SOURCE ${CPPFLAGS} ${CFLAGS}
++ LINK+= ${LIBS}
++endif
+
+ BIND = bin
+ OBJD = obj
+@@ -68,14 +72,13 @@ leakgrind: $(BIND)/$(NAME)
+
+ install: $(BIND)/$(NAME)
+ @echo "installing"
+- @install -dZ ${DESTDIR}/etc/ly
+- @install -DZ $(BIND)/$(NAME) -t ${DESTDIR}/usr/bin
+- @install -DZ $(RESD)/xsetup.sh -t ${DESTDIR}/etc/ly
+- @install -DZ $(RESD)/wsetup.sh -t ${DESTDIR}/etc/ly
+- @install -DZ $(RESD)/config.ini -t ${DESTDIR}/etc/ly
+- @install -dZ ${DESTDIR}/etc/ly/lang
+- @install -DZ $(RESD)/lang/* -t ${DESTDIR}/etc/ly/lang
+- @install -DZ $(RESD)/ly.service -t ${DESTDIR}/usr/lib/systemd/system
++ @install -dZ ${DESTDIR}${PREFIX}/etc/ly
++ @install -DZ $(BIND)/$(NAME) -t ${DESTDIR}${PREFIX}/bin
++ @install -DZ $(RESD)/xsetup.sh -t ${DESTDIR}${PREFIX}/etc/ly
++ @install -DZ $(RESD)/wsetup.sh -t ${DESTDIR}${PREFIX}/etc/ly
++ @install -DZ $(RESD)/config.ini -t ${DESTDIR}${PREFIX}/etc/ly
++ @install -dZ ${DESTDIR}${PREFIX}/etc/ly/lang
++ @install -DZ $(RESD)/lang/* -t ${DESTDIR}${PREFIX}/etc/ly/lang
+
+ uninstall:
+ @echo "uninstalling"
Index: x11/ly/files/patch-res_config.ini
===================================================================
--- /dev/null
+++ x11/ly/files/patch-res_config.ini
@@ -0,0 +1,69 @@
+--- res/config.ini.orig 2019-06-26 21:11:33 UTC
++++ res/config.ini
+@@ -1,3 +1,5 @@
++# This is a FreeBSD-ready patched version of the upstream configuration file.
++
+ # animation enabled
+ #animate = false
+ #animate = true
+@@ -52,12 +54,15 @@
+
+ # cookie generator
+ #mcookie_cmd = /usr/bin/mcookie
++# startx uses the same replacement for mcookie.
++mcookie_cmd = /usr/bin/openssl rand -hex 16
+
+ # event timeout in milliseconds
+ #min_refresh_delta = 5
+
+ # default path
+ #path = /sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/env
++path = /sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/bin/env
+
+ # command executed when pressing F2
+ #restart_cmd = /sbin/shutdown -r now
+@@ -67,12 +72,14 @@
+
+ # file in which to save and load the default desktop and login
+ #save_file = /etc/ly/save
++save_file = %%ETCDIR%%/save
+
+ # service name (pam needs this set to login)
+ #service_name = login
+
+ # command executed when pressing F1
+ #shutdown_cmd = /sbin/shutdown -a now
++shutdown_cmd = /sbin/shutdown -p now
+
+ # terminal reset command (tput is faster)
+ #term_reset_cmd = /usr/bin/tput reset
+@@ -80,20 +87,29 @@
+ # tty in use
+ #tty = 2
+
++# vt in use by X or Wayland
++#vt = 9
++
+ # wayland setup command
+ #wayland_cmd = /etc/ly/wsetup.sh
++wayland_cmd = %%ETCDIR%%/wsetup.sh
+
+ # wayland desktop environments
+ #waylandsessions = /usr/share/wayland-sessions
++waylandsessions = %%LOCALBASE%%/share/wayland-sessions
+
+ # xorg server command
+ #x_cmd = /usr/bin/X
++x_cmd = %%LOCALBASE%%/bin/X
+
+ # xorg setup command
+ #x_cmd_setup = /etc/ly/xsetup.sh
++x_cmd_setup = %%ETCDIR%%/xsetup.sh
+
+ # xorg xauthority edition tool
+ #xauth_cmd = /usr/bin/xauth
++xauth_cmd = %%LOCALBASE%%/bin/xauth
+
+ # xorg desktop environments
+ #xsessions = /usr/share/xsessions
++xsessions = %%LOCALBASE%%/share/xsessions
Index: x11/ly/files/patch-res_xsetup.sh
===================================================================
--- /dev/null
+++ x11/ly/files/patch-res_xsetup.sh
@@ -0,0 +1,41 @@
+--- res/xsetup.sh.orig 2019-11-13 13:46:11 UTC
++++ res/xsetup.sh
+@@ -55,8 +55,8 @@ esac
+ [ -f $HOME/.xprofile ] && . $HOME/.xprofile
+
+ # run all system xinitrc shell scripts.
+-if [ -d /etc/X11/xinit/xinitrc.d ]; then
+- for i in /etc/X11/xinit/xinitrc.d/* ; do
++if [ -d %%LOCALBASE%%/etc/X11/xinit/xinitrc.d ]; then
++ for i in %%LOCALBASE%%/etc/X11/xinit/xinitrc.d/* ; do
+ if [ -x "$i" ]; then
+ . "$i"
+ fi
+@@ -66,8 +66,8 @@ fi
+ # Load Xsession scripts
+ # OPTIONFILE, USERXSESSION, USERXSESSIONRC and ALTUSERXSESSION are required
+ # by the scripts to work
+-xsessionddir="/etc/X11/Xsession.d"
+-OPTIONFILE=/etc/X11/Xsession.options
++xsessionddir="%%LOCALBASE%%/etc/X11/Xsession.d"
++OPTIONFILE=%%LOCALBASE%%/etc/X11/Xsession.options
+ USERXSESSION=$HOME/.xsession
+ USERXSESSIONRC=$HOME/.xsessionrc
+ ALTUSERXSESSION=$HOME/.Xsession
+@@ -82,12 +82,12 @@ if [ -d "$xsessionddir" ]; then
+ done
+ fi
+
+-if [ -d /etc/X11/Xresources ]; then
+- for i in /etc/X11/Xresources/*; do
++if [ -d $$LOCALBASE%%/etc/X11/Xresources ]; then
++ for i in %%LOCALBASE%%/etc/X11/Xresources/*; do
+ [ -f $i ] && xrdb -merge $i
+ done
+-elif [ -f /etc/X11/Xresources ]; then
+- xrdb -merge /etc/X11/Xresources
++elif [ -f %%LOCALBASE%%/etc/X11/Xresources ]; then
++ xrdb -merge %%LOCALBASE%%/etc/X11/Xresources
+ fi
+ [ -f $HOME/.Xresources ] && xrdb -merge $HOME/.Xresources
+
Index: x11/ly/files/patch-src_config.h
===================================================================
--- /dev/null
+++ x11/ly/files/patch-src_config.h
@@ -0,0 +1,10 @@
+--- src/config.h.orig 2019-11-12 22:29:26 UTC
++++ src/config.h
+@@ -82,6 +82,7 @@ struct config
+ char* shutdown_cmd;
+ char* term_reset_cmd;
+ u8 tty;
++ u8 vt;
+ char* wayland_cmd;
+ char* waylandsessions;
+ char* x_cmd;
Index: x11/ly/files/patch-src_config.c
===================================================================
--- /dev/null
+++ x11/ly/files/patch-src_config.c
@@ -0,0 +1,38 @@
+--- src/config.c.orig 2019-06-26 21:11:33 UTC
++++ src/config.c
+@@ -9,8 +9,8 @@
+ #include <unistd.h>
+
+ #ifndef DEBUG
+- #define INI_LANG "/etc/ly/lang/%s.ini"
+- #define INI_CONFIG "/etc/ly/config.ini"
++ #define INI_LANG "%%ETCDIR%%/lang/%s.ini"
++ #define INI_CONFIG "%%ETCDIR%%/config.ini"
+ #else
+ #define INI_LANG "../res/lang/%s.ini"
+ #define INI_CONFIG "../res/config.ini"
+@@ -179,6 +179,7 @@ void config_load()
+ {"shutdown_cmd", &config.shutdown_cmd, config_handle_str},
+ {"term_reset_cmd", &config.term_reset_cmd, config_handle_str},
+ {"tty", &config.tty, config_handle_u8},
++ {"vt", &config.vt, config_handle_u8},
+ {"wayland_cmd", &config.wayland_cmd, config_handle_str},
+ {"waylandsessions", &config.waylandsessions, config_handle_str},
+ {"x_cmd", &config.x_cmd, config_handle_str},
+@@ -187,7 +188,7 @@ void config_load()
+ {"xsessions", &config.xsessions, config_handle_str},
+ };
+
+- uint16_t map_len[] = {34};
++ uint16_t map_len[] = {35};
+ struct configator_param* map[] =
+ {
+ map_no_section,
+@@ -284,6 +285,7 @@ void config_defaults()
+ config.shutdown_cmd = strdup("/sbin/shutdown -a now");
+ config.term_reset_cmd = strdup("/usr/bin/tput reset");
+ config.tty = 2;
++ config.vt = 9;
+ config.wayland_cmd = strdup("/etc/ly/wsetup.sh");
+ config.waylandsessions = strdup("/usr/share/wayland-sessions");
+ config.x_cmd = strdup("/usr/bin/X");
Index: x11/ly/files/patch-src_login.c
===================================================================
--- /dev/null
+++ x11/ly/files/patch-src_login.c
@@ -0,0 +1,30 @@
+--- src/login.c.orig 2019-09-21 16:00:16 UTC
++++ src/login.c
+@@ -239,9 +239,15 @@ void env_init(struct passwd* pwd, const char* display_
+
+ 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);
+@@ -553,7 +559,7 @@ void auth(
+
+ snprintf(display_name, 3, ":%d", display_id);
+ 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, display_name);
Index: x11/ly/files/pkg-message.in
===================================================================
--- /dev/null
+++ x11/ly/files/pkg-message.in
@@ -0,0 +1,18 @@
+[
+{ type: install
+ message: <<EOM
+Add the following entry to /etc/gettytab:
+
+Ly:\
+ :lo=%%PREFIX%%/bin/ly:\
+ :al=root:
+
+Modify the command field of the ttyv1 terminal entry in /etc/ttys
+
+ttyv1 "/usr/libexec/getty Ly" xterm on secure
+
+Make sure that "tty" is set appropriately in the %%ETCDIR%%/config.ini file if
+you decide to configure a different TTY for Ly instead.
+EOM
+}
+]
Index: x11/ly/pkg-descr
===================================================================
--- /dev/null
+++ x11/ly/pkg-descr
@@ -0,0 +1,5 @@
+Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD.
+
+It supports both X11 and Wayland sessions.
+
+WWW: https://github.com/cylgom/ly
Index: x11/ly/pkg-plist
===================================================================
--- /dev/null
+++ x11/ly/pkg-plist
@@ -0,0 +1,6 @@
+bin/ly
+@sample %%ETCDIR%%/config.ini.sample
+%%ETCDIR%%/lang/en.ini
+%%ETCDIR%%/lang/fr.ini
+@sample %%ETCDIR%%/wsetup.sh.sample
+@sample %%ETCDIR%%/xsetup.sh.sample
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 11:37 AM (5 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31975243
Default Alt Text
D22228.id64274.diff (14 KB)
Attached To
Mode
D22228: New port: x11/ly: TUI (ncurses-like) display manager for X and Wayland
Attached
Detach File
Event Timeline
Log In to Comment