$OpenBSD$

SPDX-License-Identifier: AGPL-3.0-only

Resolve embedded web assets relative to the project root during Cabal builds.

Index: apps/common/Web/Embedded.hs
--- apps/common/Web/Embedded.hs.orig
+++ apps/common/Web/Embedded.hs
@@ -4,3 +4,3 @@
 
-import Data.FileEmbed (embedDir, embedFile)
+import Data.FileEmbed (embedDir, embedFile, makeRelativeToProject)
 import Simplex.Messaging.Server.Web (EmbeddedContent (..))
@@ -10,6 +10,6 @@
   EmbeddedContent
-    { indexHtml = $(embedFile "apps/common/Web/static/index.html"),
-      linkHtml = $(embedFile "apps/common/Web/static/link.html"),
-      mediaContent = $(embedDir "apps/common/Web/static/media/"),
-      wellKnown = $(embedDir "apps/common/Web/static/.well-known/")
+    { indexHtml = $(embedFile =<< makeRelativeToProject "apps/common/Web/static/index.html"),
+      linkHtml = $(embedFile =<< makeRelativeToProject "apps/common/Web/static/link.html"),
+      mediaContent = $(embedDir =<< makeRelativeToProject "apps/common/Web/static/media/"),
+      wellKnown = $(embedDir =<< makeRelativeToProject "apps/common/Web/static/.well-known/")
     }
