diff --git a/packaging/macos/220-inkscape_package.sh b/packaging/macos/220-inkscape_package.sh
index 775f7c674c049217701fef341b65256bdd2d0fa2..9dae6140e896cf864196b9182e3dace21c3fb8d7 100755
--- a/packaging/macos/220-inkscape_package.sh
+++ b/packaging/macos/220-inkscape_package.sh
@@ -72,6 +72,12 @@ lib_change_paths @loader_path/../../.. "$INK_APP_LIB_DIR" \
lib_change_paths @loader_path/.. "$INK_APP_LIB_DIR" \
"$INK_APP_LIB_DIR"/enchant-2/enchant_applespell.so
+# Point Ghostscript towards INK_APP_LIB_DIR using @executable_path.
+lib_change_paths \
+ @executable_path/../lib \
+ "$INK_APP_LIB_DIR" \
+ "$INK_APP_BIN_DIR"/gs
+
#------------------------------------------------------ use rpath in cache files
sed -i '' \
diff --git a/packaging/macos/310-inkscape_test.sh b/packaging/macos/310-inkscape_test.sh
index 50b8f18ae79a8cadcd6189fd079ae1c50623b256..42d23c846460f200610ae82c9f49c379f3165b10 100755
--- a/packaging/macos/310-inkscape_test.sh
+++ b/packaging/macos/310-inkscape_test.sh
@@ -50,4 +50,11 @@ cd "$INK_BLD_DIR" || exit 1
ninja tests # build tests
-ctest -V # run tests
+# run tests
+# exclude four tests: https://gitlab.com/inkscape/inbox/-/issues/7304
+ctest -V -E "(\
+export-clone-group-filtered-mp|\
+export-filtered-clones-mp|\
+export-grouped-mp|\
+export-with-filters-multipage\
+)"
diff --git a/packaging/macos/inkscape.bundle b/packaging/macos/inkscape.bundle
index 022447c5126d16da1cfc7bbed2d52d0400d1d684..892963b97f4868846801ac010ac4a82940cadfdd 100644
--- a/packaging/macos/inkscape.bundle
+++ b/packaging/macos/inkscape.bundle
@@ -89,6 +89,16 @@
${prefix}/lib/enchant-2/*.so
+
+
+ ${prefix}/bin/gs
+
+
+ ${prefix}/share/ghostscript
+
+
+ ${prefix}/bin/ps2pdf*
+
${prefix}/lib/libgirepository-1.0.1.dylib
diff --git a/packaging/macos/jhb-custom.conf.sh b/packaging/macos/jhb-custom.conf.sh
index 84472c15ebbb8f21a7f4adbac877520a131aee71..94a92ac1cb63a57ebf311e53d20641dec0a3ab30 100644
--- a/packaging/macos/jhb-custom.conf.sh
+++ b/packaging/macos/jhb-custom.conf.sh
@@ -18,7 +18,7 @@
### variables ##################################################################
-VERSION=0.65
+VERSION=0.66
VER_DIR_TEMPLATE="\$WRK_DIR/mibap-\$VERSION"
RECOMMENDED_SDK_VER_X86_64=10.13
diff --git a/packaging/macos/modulesets/inkscape.modules b/packaging/macos/modulesets/inkscape.modules
index 72a4292ce12e4b927060e65b33b42f782649f735..b71131020065b82c3c53872db19d945e594968ee 100644
--- a/packaging/macos/modulesets/inkscape.modules
+++ b/packaging/macos/modulesets/inkscape.modules
@@ -99,6 +99,25 @@
+
+
+
+
+
+
+
+
@@ -276,6 +295,7 @@
+
diff --git a/packaging/macos/modulesets/patches/ghostscript_configure_libtiff.patch b/packaging/macos/modulesets/patches/ghostscript_configure_libtiff.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e53115e2f28e0c42577965a840c85c729ef5c0b3
--- /dev/null
+++ b/packaging/macos/modulesets/patches/ghostscript_configure_libtiff.patch
@@ -0,0 +1,11 @@
+--- a/configure 2022-04-04 15:48:49.000000000 +0200
++++ b/configure 2022-07-06 01:03:53.000000000 +0200
+@@ -8796,7 +8796,7 @@
+ if ! test -d "$LIBTIFFCONFDIR" ; then
+ mkdir "$LIBTIFFCONFDIR"
+ fi
+- cd "$LIBTIFFCONFDIR" && "$absolute_source_path/$LIBTIFFDIR/configure" $GS_TIFF_CONFIGURE_OPTS --disable-jbig --disable-lzma --disable-zstd --disable-webp --disable-libdeflate $SUBCONFIG_OPTS
++ cd "$LIBTIFFCONFDIR" && "$LIBTIFFDIR/configure" $GS_TIFF_CONFIGURE_OPTS --disable-jbig --disable-lzma --disable-zstd --disable-webp --disable-libdeflate $SUBCONFIG_OPTS
+ status=$?
+ if test $status -ne 0 ; then
+ as_fn_error $status "libtiff configure script failed" "$LINENO" 5
diff --git a/packaging/macos/modulesets/patches/ghostscript_link_cupsimage.patch b/packaging/macos/modulesets/patches/ghostscript_link_cupsimage.patch
new file mode 100644
index 0000000000000000000000000000000000000000..81bc20a88261a5aec8ea681a78eea75169ead976
--- /dev/null
+++ b/packaging/macos/modulesets/patches/ghostscript_link_cupsimage.patch
@@ -0,0 +1,11 @@
+--- a/base/unixlink.mak 2020-03-19 09:21:42.000000000 +0100
++++ b/base/unixlink.mak 2020-05-02 01:11:38.000000000 +0200
+@@ -168,7 +168,7 @@
+ $(ECHOGS_XE) -w $(ldt_tr) -n - $(CCLD) $(GS_LDFLAGS) -o $(GS_XE)
+ $(ECHOGS_XE) -a $(ldt_tr) -n -s $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) $(GS_DOT_O) -s
+ cat $(gsld_tr) >> $(ldt_tr)
+- $(ECHOGS_XE) -a $(ldt_tr) -s - $(EXTRALIBS) $(STDLIBS)
++ $(ECHOGS_XE) -a $(ldt_tr) -s - $(EXTRALIBS) $(STDLIBS) -lcupsimage
+ if [ x$(XLIBDIR) != x ]; then LD_RUN_PATH=$(XLIBDIR); export LD_RUN_PATH; fi; \
+ XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \
+ PSI_FEATURE_DEVS= FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \