1DOLLY 72PACKAGE zsh3REQUIRES HOST runtime@045# zsh from upstream's release, ported to spawn: Dolly has no fork6# (README.md, zsh-dolly.patch). It is configured outside, as Emacs is7# (prepare-zsh.sh); Dolly compiles every object and links in the modules8# zsh links statically, through Binaryen's cast emulation: zsh calls its9# hooks, builtins and callbacks through pointers of a common type.10FROM /v0.1.6/demos/tools/Dollyfile-tools-build f0a23271701bb566fdd11375946b1a4159d15510005f66c9781cf5a2f411eb5c11USE /v0.1.6/demos/tmux/Dollyfile-libterminfo 9d3697aa11d8bc57cf409f95c5fbeb55702ae39c56ab8e5cda6f8c849584302112USE /v0.1.6/demos/tools/Dollyfile-binaryen b3216db0b41d6bf6ecec13b766e7e505b920ca287285d90610e5e0ea0ecf17521314REQUIRES HEADER libc15REQUIRES HEADER termcap16REQUIRES LIB    terminfo17REQUIRES TOOL   cat18REQUIRES TOOL   cc19REQUIRES TOOL   cmp20REQUIRES TOOL   cp21REQUIRES TOOL   gzip22REQUIRES TOOL   head23REQUIRES TOOL   ls24REQUIRES TOOL   make25REQUIRES TOOL   mkdir26REQUIRES TOOL   printenv27REQUIRES TOOL   sleep28REQUIRES TOOL   sort29REQUIRES TOOL   tail30REQUIRES TOOL   tar31REQUIRES TOOL   text-page32REQUIRES TOOL   tr33REQUIRES TOOL   wasm-opt3435SOURCE /v0.1.6/dist/static/zsh/zsh.tar.gz 1e03835f23390df4f26923a0f60e94e611d3d659fa97711d8b37a526f856f01d /tmp/zsh.tar.gz36SLOP gzip -dc /tmp/zsh.tar.gz | tar -xf - -C /3738FILE /tmp/zsh.mk39    .RECIPEPREFIX := >40    .DELETE_ON_ERROR:41    MAKEFLAGS += -r42    S := /tmp/zsh/Src43    # zsh's objects and the modules configure links in (Src/Makemod and the44    # modules' Makefiles), compiled as its COMPILE rule does, with the GNU45    # extensions zsh turns on for Linux and musl (setresuid, setresgid).46    MAIN := main builtin compat cond context exec glob hashtable hashnameddir hist init input \47      jobs lex linklist loop math mem module options params parse pattern prompt signals \48      signames sort string subst text utils openssh_bsd_setres_id49    MODULES := Builtins/rlimits Builtins/sched Modules/datetime Modules/langinfo \50      Modules/parameter Modules/termcap Modules/zutil Zle/compctl Zle/complete Zle/compcore \51      Zle/compmatch Zle/compresult Zle/complist Zle/computil Zle/zleparameter \52      $(addprefix Zle/,zle_bindings zle_hist zle_keymap zle_main zle_misc zle_move zle_params \53        zle_refresh zle_thingy zle_tricky zle_utils zle_vi zle_word textobjects)54    all: /usr/bin/zsh55    $(S)/%.o: $(S)/%.c56    >cc -c -I$(dir $<) -I$(S) -I$(S)/Zle -DHAVE_CONFIG_H -D_GNU_SOURCE -O2 -o $@ $<57    /usr/bin/zsh: $(addprefix $(S)/,$(addsuffix .o,$(MAIN) $(MODULES)))58    >cc --dolly-cast-emulation $^ -lterminfo -lm -o $@59SLOP make -j4 -f /tmp/zsh.mk6061# What a fork did, by spawn: programs, pipelines through builtins and62# programs, command substitution, a function in a pipeline, a subshell that63# keeps its directory, a background job, exec; assignments for one command64# stay out of the shell, and a missing command is a status.65FILE /tmp/zsh-check.zsh66    ls -d /tmp /usr; print "after ls $?"67    print -l c a b | sort | head -n 268    x=$(print inside); print "subst $x"69    FOO=bar printenv FOO; print "FOO here [$FOO]"70    nosuchcommand 2> /dev/null; print "status $?"71    print to-file > /tmp/zsh-check.txt; cat /tmp/zsh-check.txt72    f() { print "in f $1" }; f arg | tr a-z A-Z73    (cd /usr && pwd); [[ $PWD != /usr ]] && print "outer stays"74    for i in 1 2 3; do print $i; done | tail -n 175    ls /usr | while read d; do n=$((n + 1)); done; (( n > 0 )) && print "read in the shell"76    sleep 1 & wait; print waited77    zsh -fc 'exec print exec-done'78    zsh -fc 'print $$; exec zsh -fc "print \$\$"' | { read a; read b; [[ $a == $b ]] && print "exec keeps the pid" }79    zsh -fc 'print $$; zsh -fc "print \$\$"' | { read a; read b; [[ $a == $b ]] && print "the last command too" }80    zsh -fc 'exec zsh -fc "exit 3"'; print "exec status $?"81FILE /tmp/zsh-check.expected82    /tmp83    /usr84    after ls 085    a86    b87    subst inside88    bar89    FOO here []90    status 12791    to-file92    IN F ARG93    /usr94    outer stays95    396    read in the shell97    waited98    exec-done99    exec keeps the pid100    the last command too101    exec status 3102SLOP zsh -f /tmp/zsh-check.zsh > /tmp/zsh-check.out 2>&1 && cmp /tmp/zsh-check.out /tmp/zsh-check.expected103104# The functions zsh looks for in its FPATH: completion, prompts, line editing.105SLOP mkdir -p /usr/share/zsh/5.9.2/functions106SLOP cp /tmp/zsh/Completion/compinit /tmp/zsh/Completion/compaudit /tmp/zsh/Completion/compdump /tmp/zsh/Completion/compinstall /usr/share/zsh/5.9.2/functions/107SLOP for f in /tmp/zsh/Completion/Base/*/* /tmp/zsh/Completion/Unix/*/* /tmp/zsh/Completion/Zsh/*/* /tmp/zsh/Functions/Misc/* /tmp/zsh/Functions/Prompts/* /tmp/zsh/Functions/Zle/*; do cp $f /usr/share/zsh/5.9.2/functions/; done108SLOP zsh -fc 'autoload -Uz compinit && compinit -D && (( ${#_comps} > 1000 ))'109110SLOP mkdir -p /usr/share/licenses/zsh111SLOP cp /tmp/zsh/LICENCE /usr/share/licenses/zsh/LICENCE112SLOP text-page /tmp/zsh/Doc/zsh.1113EXPORTS TOOL zsh114EXPORTS FOLDER zsh-functions /usr/share/zsh/5.9.2/functions115FILE /usr/share/licenses/zsh/LICENCE116# zsh links libterminfo statically and carries its licence.117FILE /usr/share/licenses/netbsd-curses/COPYING118FILE /usr/share/man/cat1/zsh.1119