From 8b0d15f1e4445d63ae114609ec40ff54ce744f67 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Fri, 11 Aug 2023 21:09:02 +0200
Subject: [PATCH 1/4] [macOS] define only one `*open-program*`

SBCL-2.3.7 on macOS defines both `bsd` and `darwin` features that
expands it into code which leads to
```
  Error while parsing arguments to DEFMACRO DEFVAR:
    too many elements in
      (*OPEN-PROGRAM* "open" "xdg-open"
       "The program to open unsupported files with.")
    to satisfy lambda list
      (VAR &OPTIONAL (VAL) (DOC)):
    between 1 and 3 expected, but got 4
```
---
 source/global.lisp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git source/global.lisp source/global.lisp
index 4104b7e8..7cf1e765 100644
--- source/global.lisp
+++ source/global.lisp
@@ -27,7 +27,7 @@ For user-facing controls, see `*run-from-repl-p*' and `*debug-on-error*'.")
 (declaim (type (or string null) *open-program*))
 (defvar *open-program*
   #+darwin "open"
-  #+(or linux bsd) "xdg-open"
+  #+(and (or linux bsd) (not darwin)) "xdg-open"
   #-(or linux bsd darwin) nil
   "The program to open unsupported files with.")
 
-- 
2.41.0


From d3d40749d20de3bb09da39e0f69e9b11a111b032 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Fri, 11 Aug 2023 21:29:12 +0200
Subject: [PATCH 2/4] [macOS] ignore unused variables

---
 source/configuration.lisp | 2 ++
 1 file changed, 2 insertions(+)

diff --git source/configuration.lisp source/configuration.lisp
index e163dce2..de0ef0e8 100644
--- source/configuration.lisp
+++ source/configuration.lisp
@@ -508,6 +508,8 @@ Return the persisted file as second value."
 
     (values config target))
   #-(and unix (not darwin))
+  (declare (ignore name))
+  (declare (ignore targets))
   (log:warn "Only supported on GNU / BSD systems running XDG-compatible desktop environments."))
 
 
-- 
2.41.0


From dc6e58b0abfa10df4c5909e30b427d05532f8c60 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Fri, 11 Aug 2023 22:45:23 +0200
Subject: [PATCH 3/4] Allow to overwrite env variables at Makefile

---
 makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git makefile makefile
index d0906cf6..738c371f 100644
--- makefile
+++ makefile
@@ -19,9 +19,13 @@ FLATPAK_APP_ID = engineer.atlas.Nyxt
 FLATPAK_MANIFEST := $(FLATPAK_APP_ID).yaml
 FLATPAK_EXPORT_REPOSITORY = _build/nyxt-flatpak-repository
 
-export NYXT_SUBMODULES=true
-export NYXT_RENDERER=gi-gtk
-export NASDF_USE_LOGICAL_PATHS=true
+NYXT_SUBMODULES ?= true
+NYXT_RENDERER ?= gi-gtk
+NASDF_USE_LOGICAL_PATHS ?= true
+
+export NYXT_SUBMODULES
+export NYXT_RENDERER
+export NASDF_USE_LOGICAL_PATHS
 
 .PHONY: help
 help:
-- 
2.41.0


From ec34fdd9dee1e5b3b5fb46c7e2a2901f9302a571 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Fri, 11 Aug 2023 23:35:45 +0200
Subject: [PATCH 4/4] `webkit-web-view-is-muted` may not be available

---
 source/renderer/gtk.lisp | 1 +
 1 file changed, 1 insertion(+)

diff --git source/renderer/gtk.lisp source/renderer/gtk.lisp
index 2dedc6f8..5eafbccf 100644
--- source/renderer/gtk.lisp
+++ source/renderer/gtk.lisp
@@ -2199,6 +2199,7 @@ As a second value, return the current buffer index starting from 0."
   (gtk:gtk-widget-is-focus (gtk-object buffer)))
 
 (define-ffi-method ffi-muted-p ((buffer gtk-buffer))
+  #+webkit2-mute
   (webkit:webkit-web-view-is-muted (gtk-object buffer)))
 
 (define-ffi-method ffi-tracking-prevention ((buffer gtk-buffer))
-- 
2.41.0

