From c253c1b87eff8fbfde7369c6e049c0a2b998f817 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 8 Oct 2023 10:57:56 +0300
Subject: [PATCH 67/67] Flatpak: Disallow build in srcdir

See osdn #48653

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 platforms/flatpak/build_flatpak.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/platforms/flatpak/build_flatpak.sh b/platforms/flatpak/build_flatpak.sh
index aebdaa3563..3bcd12f040 100755
--- a/platforms/flatpak/build_flatpak.sh
+++ b/platforms/flatpak/build_flatpak.sh
@@ -12,6 +12,12 @@
 #  GNU General Public License for more details.
 
 BROOT="$(pwd)"
+SROOT="$(cd $(dirname "$0") && pwd)"
+
+if test "${BROOT}" = "${SROOT}" ; then
+  echo "Run $0 from a separate build directory." >&2
+  exit 1
+fi
 
 cd "$(dirname "$0")" || exit 1
 FCVER=$(../../fc_version)
-- 
2.40.1