aboutsummaryrefslogtreecommitdiff
path: root/pkgs/stardict/enchant2.patch
blob: 56accdb3f10c76900db0987fa5c757e8d7c40914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From: Boyuan Yang <byang@debian.org>
Date: Fri, 31 Jan 2020 13:14:01 -0500
Subject: dict/configure.ac: Add support for enchant 2

---
 dict/configure.ac | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/dict/configure.ac b/dict/configure.ac
index fc7101a..ea5b30c 100644
--- a/dict/configure.ac
+++ b/dict/configure.ac
@@ -45,21 +45,34 @@ dnl ================================================================
 dnl spell plugin checks: enchant.
 dnl ================================================================
 
-ENCHANT_REQUIRED=1.2.0
+ENCHANT1_REQUIRED=1.2.0
+ENCHANT2_REQUIRED=2.2.3
 AC_ARG_ENABLE([spell],
 	AS_HELP_STRING([--disable-spell],[Disable spell plugin (default: enabled)]),
 	[enable_enchant=$enableval],
 	[enable_enchant=yes])
 
 if test "x$enable_enchant" = "xyes" ; then
-	PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED, \
-			have_enchant=yes, have_enchant=no)
-	if test "x$have_enchant" = "xyes"; then
-		ENCHANT_CFLAGS="${ENCHANT_CFLAGS}"
-		ENCHANT_LIBS="${ENCHANT_LIBS}"
-		SPELL_PLUGIN_DIR="stardict-spell-plugin"
+	PKG_CHECK_MODULES([ENCHANT2], enchant-2 >= $ENCHANT2_REQUIRED, \
+			have_enchant2=yes, have_enchant2=no)
+	PKG_CHECK_MODULES([ENCHANT1], enchant >= $ENCHANT1_REQUIRED, \
+			have_enchant1=yes, have_enchant1=no)
+	if test "x$have_enchant2" = "xyes"; then
+		if test "x$have_enchant1" = "xyes"; then
+			AC_MSG_ERROR([You have both Enchant 1.x and Enchant 2.x installed. This is not supported.])
+		else
+			ENCHANT_CFLAGS="${ENCHANT2_CFLAGS}"
+			ENCHANT_LIBS="${ENCHANT2_LIBS}"
+			SPELL_PLUGIN_DIR="stardict-spell-plugin"
+		fi
 	else
-		AC_MSG_ERROR([Enchant library not found or too old. Use --disable-spell to build without spell plugin.])
+		if test "x$have_enchant1" = "xyes"; then
+			ENCHANT_CFLAGS="${ENCHANT1_CFLAGS}"
+			ENCHANT_LIBS="${ENCHANT1_LIBS}"
+			SPELL_PLUGIN_DIR="stardict-spell-plugin"
+		else
+			AC_MSG_ERROR([Enchant library not found or too old. Use --disable-spell to build without spell plugin.])
+		fi
 	fi
 else
 	ENCHANT_CFLAGS=