diff options
Diffstat (limited to 'x11/ly/files')
-rw-r--r-- | x11/ly/files/git-submodules-to-gh-tuple.awk | 20 | ||||
-rw-r--r-- | x11/ly/files/patch-makefile | 47 | ||||
-rw-r--r-- | x11/ly/files/patch-res_config.ini | 69 | ||||
-rw-r--r-- | x11/ly/files/patch-res_xsetup.sh | 41 | ||||
-rw-r--r-- | x11/ly/files/patch-src_config.c | 38 | ||||
-rw-r--r-- | x11/ly/files/patch-src_config.h | 10 | ||||
-rw-r--r-- | x11/ly/files/patch-src_login.c | 30 | ||||
-rw-r--r-- | x11/ly/files/pkg-message.in | 18 |
8 files changed, 273 insertions, 0 deletions
diff --git a/x11/ly/files/git-submodules-to-gh-tuple.awk b/x11/ly/files/git-submodules-to-gh-tuple.awk new file mode 100644 index 000000000000..8d275695ec5b --- /dev/null +++ b/x11/ly/files/git-submodules-to-gh-tuple.awk @@ -0,0 +1,20 @@ +#! /usr/bin/awk -f +# $FreeBSD$ + +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" +} diff --git a/x11/ly/files/patch-makefile b/x11/ly/files/patch-makefile new file mode 100644 index 000000000000..a13426278faa --- /dev/null +++ b/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" diff --git a/x11/ly/files/patch-res_config.ini b/x11/ly/files/patch-res_config.ini new file mode 100644 index 000000000000..0b60773658f5 --- /dev/null +++ b/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 diff --git a/x11/ly/files/patch-res_xsetup.sh b/x11/ly/files/patch-res_xsetup.sh new file mode 100644 index 000000000000..7e2123be67d4 --- /dev/null +++ b/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 + diff --git a/x11/ly/files/patch-src_config.c b/x11/ly/files/patch-src_config.c new file mode 100644 index 000000000000..697407edca34 --- /dev/null +++ b/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"); diff --git a/x11/ly/files/patch-src_config.h b/x11/ly/files/patch-src_config.h new file mode 100644 index 000000000000..4203e7d0782f --- /dev/null +++ b/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; diff --git a/x11/ly/files/patch-src_login.c b/x11/ly/files/patch-src_login.c new file mode 100644 index 000000000000..ae732aca101d --- /dev/null +++ b/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); diff --git a/x11/ly/files/pkg-message.in b/x11/ly/files/pkg-message.in new file mode 100644 index 000000000000..a5ea04aca381 --- /dev/null +++ b/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 +} +] |