From 10bc08d434359547031d488a35bc721ad36d6b4e Mon Sep 17 00:00:00 2001
From: Peter Levine <plevine457@gmail.com>
Date: Sun, 15 Sep 2019 16:09:53 -0400
Subject: app-office/gnucash: Fix testcases that write to /tmp

Have testcases write to "${T}" instead of /tmp

Closes: https://github.com/gentoo/gentoo/pull/12792
Package-Manager: Portage-2.3.75, Repoman-2.3.17
Signed-off-by: Peter Levine <plevine457@gmail.com>
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
 app-office/gnucash/gnucash-3.7.ebuild | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/app-office/gnucash/gnucash-3.7.ebuild b/app-office/gnucash/gnucash-3.7.ebuild
index 699125271a4b..824af8b7d919 100644
--- a/app-office/gnucash/gnucash-3.7.ebuild
+++ b/app-office/gnucash/gnucash-3.7.ebuild
@@ -97,6 +97,23 @@ src_unpack() {
 		|| die "Failed copying scm"
 }
 
+src_prepare() {
+	cmake-utils_src_prepare
+
+	# Fix tests writing to /tmp
+	local fixtestfiles=(
+		"${S}"/gnucash/report/report-system/test/test-commodity-utils.scm
+		"${S}"/gnucash/report/report-system/test/test-extras.scm
+		"${S}"/gnucash/report/report-system/test/test-report-html.scm
+		"${S}"/gnucash/report/report-system/test/test-report-system.scm
+		"${S}"/libgnucash/backend/xml/test/test-xml-pricedb.cpp
+		"${S}"/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
+	)
+	for x in "${fixtestfiles[@]}"; do
+		sed -i -e "s|\"/tmp/|\"${T}/|g" "${x}" || die "sed of "${x}" failed"
+	done
+}
+
 src_configure() {
 	export GUILE_AUTO_COMPILE=0
 
-- 
cgit v1.2.3-65-gdbad