$OpenBSD$

SPDX-License-Identifier: AGPL-3.0-only

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

Index: apps/xftp-server/XFTPWeb.hs
--- apps/xftp-server/XFTPWeb.hs.orig
+++ apps/xftp-server/XFTPWeb.hs
@@ -12,3 +12,3 @@
 import Data.ByteString (ByteString)
-import Data.FileEmbed (embedDir, embedFile)
+import Data.FileEmbed (embedDir, embedFile, makeRelativeToProject)
 import Data.Maybe (isJust)
@@ -28,9 +28,9 @@
 xftpWebContent :: [(FilePath, ByteString)]
-xftpWebContent = $(embedDir "apps/xftp-server/static/xftp-web-bundle/")
+xftpWebContent = $(embedDir =<< makeRelativeToProject "apps/xftp-server/static/xftp-web-bundle/")
 
 xftpMediaContent :: [(FilePath, ByteString)]
-xftpMediaContent = $(embedDir "apps/xftp-server/static/media/")
+xftpMediaContent = $(embedDir =<< makeRelativeToProject "apps/xftp-server/static/media/")
 
 xftpFilePageHtml :: ByteString
-xftpFilePageHtml = $(embedFile "apps/xftp-server/static/file.html")
+xftpFilePageHtml = $(embedFile =<< makeRelativeToProject "apps/xftp-server/static/file.html")
 
