1DOLLY 72PACKAGE emacs3REQUIRES HOST runtime@045# GNU Emacs 31.1 for the terminal. demos/emacs/prepare-emacs.sh patches and6# configures the release outside; Dolly compiles every object and dumps it.7FROM /v0.1.5/Dollyfile-system 87fe1e350c90556f41ae3e45343f9122ea9eca8cc488ae18b8a3ec08f1af09898REQUIRES HEADER libc9REQUIRES TOOL   cc10REQUIRES TOOL   ar11REQUIRES TOOL   make12REQUIRES TOOL   sh13REQUIRES TOOL   sed14REQUIRES TOOL   awk15REQUIRES TOOL   gzip16REQUIRES TOOL   tar17REQUIRES TOOL   find18REQUIRES TOOL   xargs19REQUIRES TOOL   cp20REQUIRES TOOL   mkdir21REQUIRES TOOL   rm2223SOURCE /v0.1.5/dist/static/emacs/emacs.tar.gz 62ce971876ceb6e1780a66e73435225e6274cb28173edae4990ccdd2027ff9ab /tmp/emacs.tar.gz24SLOP gzip -dc /tmp/emacs.tar.gz | tar -xf - -C /2526# Built at -O0, Emacs needs more stack at its first prompt than a Worker gives27# a fresh Chromium's baseline code: it asks for the deeper one (docs/browser-stack.md).28FILE /tmp/emacs-stack.c29    __asm__(".section .custom_section.dolly.process.stack,\"\",@\n.byte 1\n");30SLOP cat /tmp/emacs-stack.c >> /tmp/emacs/src/emacs.c3132# The release's byte-compiled Lisp is used as shipped: bootstrapping it from33# source interprets the loadup files and overflows a browser Worker's stack.34SLOP make -C /tmp/emacs/lib -j435SLOP make -C /tmp/emacs/lib-src -j436SLOP make -C /tmp/emacs/src -j43738# Install as upstream's make install lays it out, which needs tar -c, and39# compress what it compresses: the Lisp sources whose bytecode is installed,40# the public suffix list and the info pages. Emacs reads them through gzip.41SLOP mkdir -p /usr/libexec/emacs/31.1/wasm64-unknown-emscripten /usr/share/emacs/31.1 \42  /usr/share/emacs/site-lisp /usr/share/licenses/emacs43SLOP cp /tmp/emacs/src/emacs /usr/bin/emacs44SLOP cp /tmp/emacs/lib-src/etags /usr/bin/etags45SLOP cp /tmp/emacs/lib-src/hexl /usr/libexec/emacs/31.1/wasm64-unknown-emscripten/hexl46SLOP cp /tmp/emacs/src/emacs.pdmp \47  "/usr/libexec/emacs/31.1/wasm64-unknown-emscripten/emacs-$(/tmp/emacs/src/emacs --fingerprint).pdmp"48SLOP cp -R /tmp/emacs/lisp /usr/share/emacs/31.1/lisp49SLOP cp -R /tmp/emacs/etc /usr/share/emacs/31.1/etc50SLOP cp -R /tmp/emacs/info /usr/share/info51SLOP find /usr/share/emacs/31.1/lisp -name '*.elc' | sed 's/c$//' | xargs gzip -9n52SLOP gzip -9n /usr/share/emacs/31.1/etc/publicsuffix.txt53SLOP find /usr/share/info -name '*.info' -exec gzip -9n {} +54SLOP find /usr/share/emacs/31.1 -name 'Makefile*' -exec rm -f {} +55SLOP cp /tmp/emacs/COPYING /usr/share/licenses/emacs/COPYING5657# The mode is on for what it skips: Emacs's XTVERSION probe, whose 0.1 s wait58# is shorter than the terminal's reply. Dolly's terminal reports no mouse.59FILE /usr/share/emacs/site-lisp/site-start.el60    ;;; -*- lexical-binding: t -*-61    (xterm-mouse-mode 1)6263EXPORTS TOOL   emacs64EXPORTS TOOL   etags65EXPORTS FOLDER emacs-data    /usr/share/emacs66EXPORTS FOLDER emacs-libexec /usr/libexec/emacs67EXPORTS FOLDER emacs-info    /usr/share/info68FILE /usr/share/licenses/emacs/COPYING6970FILE /tmp/emacs-check.el71    ;;; -*- lexical-binding: t -*-72    (require 'cl-lib)73    (with-temp-file "/tmp/emacs-check.txt" (insert "Dolly 日本語\n"))74    (cl-assert (equal (with-temp-buffer (insert-file-contents "/tmp/emacs-check.txt")75                        (buffer-string))76                      "Dolly 日本語\n"))77    (cl-assert (equal (shell-command-to-string "printf SLOP-CHILD") "SLOP-CHILD"))78    (cl-assert (= (call-process "/bin/slop" nil nil nil "-c" "exit 3") 3))79    (let* ((fired nil)80           (process (make-process :name "check" :buffer (generate-new-buffer "check")81                                  :command '("/bin/slop" "-c" "sleep 1; printf ASYNC; exit 4"))))82      (run-with-timer 0.2 nil (lambda () (setq fired t)))83      (while (process-live-p process) (accept-process-output process 0.1))84      (cl-assert fired)85      (cl-assert (= (process-exit-status process) 4))86      (cl-assert (equal (with-current-buffer (process-buffer process) (buffer-substring 1 6))87                        "ASYNC")))88    (require 'find-func)89    (cl-assert (string-suffix-p "/subr.el.gz" (find-library-name "subr")))90    (cl-assert (with-temp-buffer (insert-file-contents (find-library-name "subr"))91                 (search-forward ";;; subr.el ---" nil t)))92    (garbage-collect)93    (princ (format "%s %s\n" emacs-version system-type))94SLOP timeout 120 emacs --batch -l /tmp/emacs-check.el95FILE /usr/share/man/cat1/emacs.196    emacs: GNU Emacs 31.1 for the terminal, with etags.97    98      emacs FILE           edits FILE; C-x C-s saves, C-x C-c leaves99      emacs --batch ...    runs Lisp without a terminal100    101    M-! and M-x compile run Slop commands; M-x shell does not: Slop has no -i.102    C-g stops Lisp only when it makes a system call. There are no103    pseudo-terminals, network processes, emacsclient or Lisp threads here, and104    no Lisp packages are installed from the network. Its manual is inside it:105    C-h r, and C-h t for the tutorial.106