diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c16a301a759..d63d93f083f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,10 +38,10 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - name: Compile ${{matrix.renderer}} port on ${{matrix.os}} - run: nix-shell build-scripts/shell-${{matrix.renderer}}.nix --run 'make all NYXT_RENDERER=${{matrix.renderer}}' + run: nix-shell build-scripts/shell.nix --run 'make all NYXT_RENDERER=${{matrix.renderer}}' - name: Test ${{matrix.renderer}} port on ${{matrix.os}} env: NASDF_NON_INTERACTIVE_TESTS: true # It runs the tests for system nyxt, not nyxt/${{matrix.renderer}}. - run: nix-shell build-scripts/shell-${{matrix.renderer}}.nix --run 'make check' + run: nix-shell build-scripts/shell.nix --run 'make check' diff --git a/_build/cl-electron b/_build/cl-electron index e647943dac3..270856b4984 160000 --- a/_build/cl-electron +++ b/_build/cl-electron @@ -1 +1 @@ -Subproject commit e647943dac358f97f3a27ab4a49dad3625c5c471 +Subproject commit 270856b49849a6f48c8d96cc2b6a05ac89a2b997 diff --git a/build-scripts/nyxt.scm b/build-scripts/nyxt.scm index 656947c985a..e1cefa723c6 100644 --- a/build-scripts/nyxt.scm +++ b/build-scripts/nyxt.scm @@ -23,7 +23,6 @@ (use-modules (guix packages) (guix gexp) - (nongnu packages lisp) (gnu packages gstreamer) (gnu packages web-browsers) (gnu packages glib) @@ -61,7 +60,6 @@ cl-custom-hash-table cl-dexador cl-dissect - cl-electron cl-enchant cl-flexi-streams cl-gobject-introspection ; WebKitGTK diff --git a/build-scripts/shell-electron.nix b/build-scripts/shell-electron.nix deleted file mode 100644 index 0b2b30cc769..00000000000 --- a/build-scripts/shell-electron.nix +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-FileCopyrightText: Atlas Engineer LLC -# SPDX-License-Identifier: BSD-3-Clause - -# This file is meant to be used with the nyxt/electron system. Use this -# file to open a nix shell with the required dependencies to run SBCL -# and load nyxt/electron. - -{ pkgs ? import {} } : -with builtins; -let inherit (pkgs) stdenv; in -with pkgs; -stdenv.mkDerivation { - name = "nyxt-dev"; - - nativeBuildInputs = [ - pkgs.libressl.out - pkgs.libfixposix.out - pkgs.sbcl - pkgs.sqlite.out - pkgs.pkg-config.out - ]; - - buildInputs = [ electron_29-bin ]; - - LD_LIBRARY_PATH = with lib; "${makeLibraryPath [ pkgs.libfixposix.out - pkgs.sqlite.out - pkgs.libressl.out ]};"; - - shellHook = - '' - NYXT_ROOT=`dirname ${toString ../README.org}`; - export CL_SOURCE_REGISTRY=$HOME/common-lisp//:$NYXT_ROOT/_build//:$CL_SOURCE_REGISTRY; - ''; - -} diff --git a/build-scripts/shell-gi-gtk.nix b/build-scripts/shell-gi-gtk.nix deleted file mode 100644 index 79a92020b40..00000000000 --- a/build-scripts/shell-gi-gtk.nix +++ /dev/null @@ -1,68 +0,0 @@ -# SPDX-FileCopyrightText: Atlas Engineer LLC -# SPDX-License-Identifier: BSD-3-Clause - -# This file is meant to be used with the nyxt/gi-gtk system. Use this -# file to open a nix shell with the required dependencies to run SBCL -# and load nyxt/gi-gtk. - -{ pkgs ? import {} } : -with builtins; -let inherit (pkgs) stdenv; in -with pkgs; -stdenv.mkDerivation { - name = "nyxt-dev"; - - nativeBuildInputs = [ - pkgs.libressl.out - pkgs.webkitgtk - pkgs.sbcl - ]; - - buildInputs = [ - pkgs.sqlite - pkgs.gobject-introspection - pkgs.pkg-config - pkgs.enchant.out - pkgs.gsettings-desktop-schemas.out - pkgs.glib-networking.out - pkgs.pango.out - pkgs.cairo.out - pkgs.gdk-pixbuf.out - pkgs.gtk3.out - pkgs.glib.out - pkgs.libfixposix.out - pkgs.webkitgtk - ] ++ - (with gst_all_1; [ - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gst-libav - ]); - - LD_LIBRARY_PATH = with lib; "${makeLibraryPath [ pkgs.gsettings-desktop-schemas.out - pkgs.enchant.out - pkgs.sqlite.out - pkgs.glib-networking.out - pkgs.webkitgtk - pkgs.gobject-introspection - pkgs.pkg-config.out - pkgs.gtk3 - pkgs.pango.out - pkgs.cairo.out - pkgs.gdk-pixbuf.out - pkgs.glib.out - pkgs.libfixposix.out - pkgs.libressl.out ]};"; - - GIO_MODULE_DIR = "${pkgs.glib-networking.out}/lib/gio/modules/"; - GIO_EXTRA_MODULES = "${pkgs.glib-networking.out}/lib/gio/modules/"; - - shellHook = - '' - NYXT_ROOT=`dirname ${toString ../README.org}`; - export CL_SOURCE_REGISTRY=$HOME/common-lisp//:$NYXT_ROOT/_build//:$CL_SOURCE_REGISTRY; - ''; - -} diff --git a/build-scripts/shell.nix b/build-scripts/shell.nix new file mode 100644 index 00000000000..04c934db41d --- /dev/null +++ b/build-scripts/shell.nix @@ -0,0 +1,82 @@ +# SPDX-FileCopyrightText: Atlas Engineer LLC +# SPDX-License-Identifier: BSD-3-Clause + +# To start the CL REPL: + +# nix-shell /path/to/shell.nix --run 'sbcl --dynamic-space-size 3072' + +{ pkgs ? import {} } : +with builtins; +let inherit (pkgs) stdenv; in +with pkgs; +stdenv.mkDerivation { + name = "nyxt-dev"; + + nativeBuildInputs = [ + pkgs.libressl.out + pkgs.libfixposix.out + pkgs.sqlite.out + pkgs.pkg-config.out + pkgs.sbcl + ] + ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [ + pkgs.webkitgtk + ]; + + buildInputs = [ + pkgs.sqlite + pkgs.pkg-config + pkgs.enchant.out + pkgs.libfixposix.out + ] + ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [ + pkgs.gobject-introspection + pkgs.gsettings-desktop-schemas.out + pkgs.glib-networking.out + pkgs.pango.out + pkgs.cairo.out + pkgs.gdk-pixbuf.out + pkgs.gtk3.out + pkgs.glib.out + pkgs.webkitgtk + ] + ++ (with gst_all_1; [ + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gst-libav + ]); + + LD_LIBRARY_PATH = with lib; + makeLibraryPath ( + [ + pkgs.enchant.out + pkgs.sqlite.out + pkgs.pkg-config.out + pkgs.libfixposix.out + pkgs.libressl.out + ] + ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [ + pkgs.gobject-introspection + pkgs.gsettings-desktop-schemas.out + pkgs.glib-networking.out + pkgs.pango.out + pkgs.cairo.out + pkgs.gdk-pixbuf.out + pkgs.gtk3.out + pkgs.glib.out + pkgs.webkitgtk + ] + ); + + GIO_MODULE_DIR = "${pkgs.glib-networking.out}/lib/gio/modules/"; + GIO_EXTRA_MODULES = "${pkgs.glib-networking.out}/lib/gio/modules/"; + + shellHook = + '' + NYXT_ROOT=`dirname ${toString ../README.org}`; + export CL_SOURCE_REGISTRY=$HOME/common-lisp//:$NYXT_ROOT/_build//:$CL_SOURCE_REGISTRY; + ''; + +} diff --git a/source/input.lisp b/source/input.lisp index 6acccf00003..4d8a2ce487b 100644 --- a/source/input.lisp +++ b/source/input.lisp @@ -130,7 +130,6 @@ Return nil to forward to renderer or non-nil otherwise." (when (input-buffer-p buffer) (setf (last-event buffer) event)) (when (prompt-buffer-p buffer) - ;; Prompt buffer updating must happen on a separate thread. (run-thread "update-prompt-buffer" (update-prompt-input buffer (ps-eval :buffer buffer @@ -141,34 +140,24 @@ Return nil to forward to renderer or non-nil otherwise." (declare (ignore matching-keymap)) (cond ((keymaps:keymap-p bound-function) - (echo "Pressed keys: ~a" (keyspecs-without-keycode key-stack)) - (log:debug "Prefix binding ~a" (keyspecs key-stack translated-key)) + (log:debug "Prefix binding ~a." (keyspecs key-stack translated-key)) t) - ((typep bound-function '(and (not null) (or symbol command))) (let ((command (typecase bound-function (symbol (symbol-function (resolve-user-symbol bound-function :command))) (command bound-function)))) - (check-type command command) - (log:debug "Found key binding ~a to ~a" (keyspecs key-stack translated-key) bound-function) - ;; We save the last key separately to keep it available to the - ;; command even after key-stack has been reset in the other - ;; thread. + (log:debug "Found key binding ~a to ~a." (keyspecs key-stack translated-key) bound-function) (setf (last-key buffer) (first key-stack)) - (unwind-protect - (funcall (command-dispatcher *browser*) command) - ;; We must reset the key-stack on errors or else all subsequent - ;; keypresses will keep triggering the same erroring command. - (setf key-stack nil)) + (run-thread "run-command" + (unwind-protect (funcall (command-dispatcher *browser*) command) + (setf key-stack nil))) t)) - ((or (and (input-buffer-p buffer) (forward-input-events-p buffer)) (pointer-event-p (first (last key-stack)))) - (log:debug "Forward key ~s" (keyspecs key-stack)) + (log:debug "Forward key ~s." (keyspecs key-stack)) (setf key-stack nil) nil) - (t - (log:debug "Fallback forward key ~s" (keyspecs key-stack)) + (log:debug "Fallback forward key ~s." (keyspecs key-stack)) (setf key-stack nil) nil))))))