Add kwin full source tree, greeter login, zsh, pcid service, and build system improvements
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
# Zsh on Redox
|
||||
|
||||
Production recipe for Zsh 5.9 on Red Bear OS / Redox.
|
||||
|
||||
## Status
|
||||
|
||||
- **Builds:** yes
|
||||
- **Runtime:** basic shell works; `times` builtin is a no-op stub
|
||||
- **Blockers:** `times()` and `getrusage()` not yet in relibc
|
||||
|
||||
## Patch Summary
|
||||
|
||||
| File | Change | Reason |
|
||||
|------|--------|--------|
|
||||
| `configure.ac` | Remove `getrusage` from `AC_CHECK_FUNCS` | Avoids configure-time detection of missing function |
|
||||
| `Src/builtin.c` | Stub `bin_times()` | `times()` unavailable in relibc |
|
||||
| `Src/Builtins/rlimits.c` | Disable `set_resinfo()` / `free_resinfo()` | These depend on `getrusage()` |
|
||||
|
||||
## Configure Flags
|
||||
|
||||
- `--disable-gdbm` — avoid GNU dbm dependency
|
||||
- `--disable-pcre` — avoid PCRE dependency
|
||||
- `--disable-cap` — avoid POSIX capabilities dependency
|
||||
- `zsh_cv_sys_elf=no` — skip ELF detection (not applicable on Redox)
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `ncursesw` — wide-character terminal library
|
||||
|
||||
## Install Targets
|
||||
|
||||
Zsh uses non-standard install targets:
|
||||
|
||||
```
|
||||
make install.bin install.modules install.fns DESTDIR="${COOKBOOK_STAGE}"
|
||||
```
|
||||
|
||||
## Configuration Files
|
||||
|
||||
The recipe installs Manjaro-inspired system-wide zsh configuration:
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `/etc/zsh/zshenv` | Environment variables for all zsh shells |
|
||||
| `/etc/zsh/zprofile` | Login shell profile (sources `/etc/profile` for compatibility) |
|
||||
| `/etc/zsh/zshrc` | Interactive shell config: history, completion, colors, prompt, aliases |
|
||||
| `/etc/skel/.zshrc` | Template for new users |
|
||||
| `/etc/skel/.zprofile` | Template for new users (login shell) |
|
||||
|
||||
### Features (Manjaro-style)
|
||||
|
||||
- **Colored prompt**: green for user, red for root, with hostname and working directory
|
||||
- **Right-side prompt**: shows exit code on error
|
||||
- **Tab completion**: with menu selection, approximate matching, and colorized listings
|
||||
- **History**: shared across sessions, ignores duplicates and leading-space entries
|
||||
- **Aliases**: `ls`, `ll`, `la`, `grep`, `cp`, `mv`, `rm` with color and safety flags
|
||||
- **Convenience**: `AUTO_CD`, `CORRECT`, `NO_BEEP`
|
||||
- **Optional plugins**: `zsh-syntax-highlighting`, `zsh-autosuggestions` (loaded if available)
|
||||
|
||||
## Future Work
|
||||
|
||||
- Re-enable `times` builtin when relibc gains `times()` support
|
||||
- Re-enable resource-limit info when relibc gains `getrusage()` support
|
||||
- Evaluate enabling `gdbm`, `pcre`, or `cap` if those libraries are ported
|
||||
- Package `zsh-syntax-highlighting` and `zsh-autosuggestions` plugins
|
||||
@@ -0,0 +1,4 @@
|
||||
# ~/.zprofile — User profile for login zsh(1) shells.
|
||||
# This file is sourced for login shells.
|
||||
|
||||
# User-specific environment variables can go here.
|
||||
@@ -0,0 +1,8 @@
|
||||
# ~/.zshrc — User configuration for interactive zsh(1) shells.
|
||||
# This file is sourced for interactive shells.
|
||||
|
||||
# User-specific aliases and functions can go here.
|
||||
# The system-wide configuration in /etc/zsh/zshrc is already loaded.
|
||||
|
||||
# Example: customize prompt further
|
||||
# PROMPT='%F{cyan}%n%f@%F{yellow}%m%f %F{green}%B%~%b%f $ '
|
||||
@@ -0,0 +1,6 @@
|
||||
# /etc/zsh/zprofile — System-wide profile for login zsh(1) shells.
|
||||
|
||||
# Source /etc/profile if it exists (for compatibility with Bourne-style login shells)
|
||||
if [[ -f /etc/profile ]]; then
|
||||
emulate sh -c 'source /etc/profile'
|
||||
fi
|
||||
@@ -0,0 +1,25 @@
|
||||
# /etc/zsh/zshenv — System-wide environment for all zsh(1) shells.
|
||||
|
||||
# Set PATH if not already set
|
||||
if [[ -z "$PATH" ]]; then
|
||||
export PATH=/usr/local/bin:/usr/bin:/bin
|
||||
fi
|
||||
|
||||
# Ensure /usr/local/bin and /usr/bin are in PATH
|
||||
if [[ ":$PATH:" != *":/usr/local/bin:"* ]]; then
|
||||
PATH=/usr/local/bin:$PATH
|
||||
fi
|
||||
if [[ ":$PATH:" != *":/usr/bin:"* ]]; then
|
||||
PATH=/usr/bin:$PATH
|
||||
fi
|
||||
|
||||
# Default editor
|
||||
export EDITOR="nano"
|
||||
export VISUAL="nano"
|
||||
|
||||
# Locale
|
||||
export LANG="C.UTF-8"
|
||||
|
||||
# Pager
|
||||
export PAGER="less"
|
||||
export LESS="-R -M --shift 5"
|
||||
@@ -0,0 +1,105 @@
|
||||
# /etc/zsh/zshrc — System-wide configuration for interactive zsh(1) shells.
|
||||
# Red Bear OS / Manjaro-inspired defaults.
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[[ -o interactive ]] || return
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# History
|
||||
# ---------------------------------------------------------------------------
|
||||
HISTFILE=~/.zsh_history
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
setopt HIST_IGNORE_DUPS # Don't record duplicate consecutive entries
|
||||
setopt HIST_IGNORE_SPACE # Don't record entries starting with a space
|
||||
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks
|
||||
setopt SHARE_HISTORY # Share history between all sessions
|
||||
setopt APPEND_HISTORY # Append to history file, don't overwrite
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Completion
|
||||
# ---------------------------------------------------------------------------
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
zstyle ':completion:*' auto-description 'specify: %d'
|
||||
zstyle ':completion:*' completer _expand _complete _correct _approximate
|
||||
zstyle ':completion:*' format 'Completing %d'
|
||||
zstyle ':completion:*' group-name ''
|
||||
zstyle ':completion:*' menu select=2
|
||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||
zstyle ':completion:*' list-colors ''
|
||||
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
|
||||
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
|
||||
zstyle ':completion:*' menu select=long
|
||||
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
|
||||
zstyle ':completion:*' use-compctl false
|
||||
zstyle ':completion:*' verbose true
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
||||
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Key bindings
|
||||
# ---------------------------------------------------------------------------
|
||||
bindkey -e # Emacs-style key bindings
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Colors & Prompt
|
||||
# ---------------------------------------------------------------------------
|
||||
autoload -Uz colors
|
||||
colors
|
||||
|
||||
# Set LS_COLORS for colorized directory listings
|
||||
export LS_COLORS='di=1;34:ln=1;36:so=1;35:pi=33:ex=1;32:bd=33;47:cd=33;47:su=37;41:sg=30;43:tw=30;42:ow=34;42'
|
||||
|
||||
# Manjaro-style colored prompt
|
||||
# User: green, Root: red
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
PROMPT='%F{red}%n%f@%F{magenta}%m%f %F{blue}%B%~%b%f %# '
|
||||
else
|
||||
PROMPT='%F{green}%n%f@%F{magenta}%m%f %F{blue}%B%~%b%f %# '
|
||||
fi
|
||||
|
||||
# Right-side prompt: show return code on error
|
||||
RPROMPT='%(?..%F{red}%? ↵%f)'
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Aliases
|
||||
# ---------------------------------------------------------------------------
|
||||
alias ls='ls --color=auto -F'
|
||||
alias ll='ls --color=auto -alF'
|
||||
alias la='ls --color=auto -A'
|
||||
alias l='ls --color=auto -CF'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
alias rm='rm -i'
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Misc
|
||||
# ---------------------------------------------------------------------------
|
||||
setopt AUTO_CD # Type a directory name to cd into it
|
||||
setopt CORRECT # Spell correction
|
||||
setopt NO_BEEP # No beep on error
|
||||
|
||||
# Enable color support of ls
|
||||
if command -v dircolors >/dev/null 2>&1; then
|
||||
eval "$(dircolors -b)"
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Optional plugins (loaded if available)
|
||||
# ---------------------------------------------------------------------------
|
||||
# zsh-syntax-highlighting
|
||||
if [[ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]]; then
|
||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
fi
|
||||
|
||||
# zsh-autosuggestions
|
||||
if [[ -f /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ]]; then
|
||||
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
fi
|
||||
@@ -0,0 +1,42 @@
|
||||
[source]
|
||||
tar = "https://github.com/zsh-users/zsh/archive/refs/tags/zsh-5.9.tar.gz"
|
||||
blake3 = "a15b94fae03e87aba6fc6a27df3c98e610b85b0c7c0fc90248f07fdcb8816860"
|
||||
patches = [
|
||||
"redox.patch"
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
autotools_recursive_regenerate
|
||||
"""
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"ncursesw",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--disable-gdbm
|
||||
--disable-pcre
|
||||
--disable-cap
|
||||
zsh_cv_sys_elf=no
|
||||
)
|
||||
|
||||
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
|
||||
|
||||
# Pre-generate signames artifacts deterministically for Redox cross builds.
|
||||
gawk -f "${COOKBOOK_SOURCE}/Src/signames1.awk" "${COOKBOOK_ROOT}/prefix/${TARGET}/sysroot/${TARGET}/include/signal.h" > "${COOKBOOK_BUILD}/Src/sigtmp.c"
|
||||
"${COOKBOOK_ROOT}/bin/${TARGET}-gcc" -E -P "${COOKBOOK_BUILD}/Src/sigtmp.c" > "${COOKBOOK_BUILD}/Src/sigtmp.out"
|
||||
gawk -f "${COOKBOOK_SOURCE}/Src/signames2.awk" "${COOKBOOK_BUILD}/Src/sigtmp.out" > "${COOKBOOK_BUILD}/Src/signames.c"
|
||||
grep 'define.*SIGCOUNT' "${COOKBOOK_BUILD}/Src/signames.c" > "${COOKBOOK_BUILD}/Src/sigcount.h"
|
||||
rm -f "${COOKBOOK_BUILD}/Src/sigtmp.c" "${COOKBOOK_BUILD}/Src/sigtmp.out"
|
||||
|
||||
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}"
|
||||
"${COOKBOOK_MAKE}" install.bin install.modules install.fns DESTDIR="${COOKBOOK_STAGE}"
|
||||
|
||||
# Install system-wide zsh configuration files
|
||||
mkdir -pv "${COOKBOOK_STAGE}/etc"
|
||||
cp -r "${COOKBOOK_RECIPE}/etc/"* "${COOKBOOK_STAGE}/etc/"
|
||||
"""
|
||||
@@ -0,0 +1,75 @@
|
||||
--- a/Src/builtin.c
|
||||
+++ b/Src/builtin.c
|
||||
@@ -7158,18 +7158,10 @@
|
||||
{
|
||||
struct tms buf;
|
||||
long clktck = get_clktck();
|
||||
-
|
||||
- /* get time accounting information */
|
||||
- if (times(&buf) == -1)
|
||||
- return 1;
|
||||
- pttime(buf.tms_utime); /* user time */
|
||||
- putchar(' ');
|
||||
- pttime(buf.tms_stime); /* system time */
|
||||
- putchar('\n');
|
||||
- pttime(buf.tms_cutime); /* user time, children */
|
||||
- putchar(' ');
|
||||
- pttime(buf.tms_cstime); /* system time, children */
|
||||
- putchar('\n');
|
||||
+ /* TODO: times() is not available on Redox; stubbed out.
|
||||
+ * Re-enable when relibc gains times() support. */
|
||||
+ (void)buf;
|
||||
+ (void)clktck;
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/Src/Builtins/rlimits.c
|
||||
+++ b/Src/Builtins/rlimits.c
|
||||
@@ -892,7 +892,8 @@
|
||||
int
|
||||
boot_(UNUSED(Module m))
|
||||
{
|
||||
- set_resinfo();
|
||||
+ /* TODO: set_resinfo() relies on getrusage() which is unavailable on Redox.
|
||||
+ * Re-enable when relibc gains getrusage() support. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -900,7 +901,8 @@
|
||||
int
|
||||
cleanup_(Module m)
|
||||
{
|
||||
- free_resinfo();
|
||||
+ /* TODO: free_resinfo() paired with set_resinfo(); disabled on Redox.
|
||||
+ * Re-enable when relibc gains getrusage() support. */
|
||||
return setfeatureenables(m, &module_features, NULL);
|
||||
}
|
||||
|
||||
--- a/Src/zsh_system.h
|
||||
+++ b/Src/zsh_system.h
|
||||
@@ -539,6 +539,14 @@
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
# include <sys/resource.h>
|
||||
+/* Redox: RLIM_NLIMITS may not be defined even with sys/resource.h */
|
||||
+#ifndef RLIM_NLIMITS
|
||||
+# ifdef RLIMIT_NLIMITS
|
||||
+# define RLIM_NLIMITS RLIMIT_NLIMITS
|
||||
+# else
|
||||
+# define RLIM_NLIMITS 7
|
||||
+# endif
|
||||
+#endif
|
||||
# if defined(__hpux) && !defined(RLIMIT_CPU)
|
||||
/* HPUX does have the BSD rlimits in the kernel. Officially they are *
|
||||
* unsupported but quite a few of them like RLIMIT_CORE seem to work. *
|
||||
--- a/Src/jobs.c
|
||||
+++ b/Src/jobs.c
|
||||
@@ -1029,7 +1029,7 @@
|
||||
return 1;
|
||||
#else
|
||||
{
|
||||
- clktck = get_clktck();
|
||||
+ long clktck = get_clktck();
|
||||
if ((j->procs->ti.ut + j->procs->ti.st) / clktck >= reporttime)
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user