From d07067c6e95f1acb9d91dbd895cea7ed9a7cede2 Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Thu, 25 Feb 2016 16:44:58 +0100
Subject: Disable Hunspell support by default as it is not finished yet

Our Hunspell support has not been finished and thoroughly
tested yet. This commit disabled building with Hunspell
by default, even if the dependencies for it are installed
on the system.

Remove libhunspell-dev from the build depends in Debian
packaging.

Test-Information:

Tested on Debian 8.
Tested with and without the hunspell_enable=True flag.
With the spellchecking options are shown and however spell
checking is not stable.
Without it the spellchecking options are not shown and
spellchecking is disabled in general, as expected.

Change-Id: I100582852cbe128149fdb2e2a28d4ae407398be6

diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index ec3381d..3e8ab96 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -46,7 +46,8 @@ vars.Add("openssl_libnames", "Comma-separated openssl library names to override
 vars.Add(BoolVariable("openssl_force_bundled", "Force use of the bundled OpenSSL", "no"))
 vars.Add("openssl_include", "Location of OpenSSL include files (if not under (openssl)/include)", None)
 vars.Add("openssl_libdir", "Location of OpenSSL library files (if not under (openssl)/lib)", None)
-vars.Add(PackageVariable("hunspell", "Hunspell location", False))
+vars.Add(PackageVariable("hunspell_prefix", "Hunspell location", False))
+vars.Add(BoolVariable("hunspell_enable", "Build with Hunspell support", False))
 vars.Add(PathVariable("boost_includedir", "Boost headers location", None, PathVariable.PathAccept))
 vars.Add(PathVariable("boost_libdir", "Boost library location", None, PathVariable.PathAccept))
 vars.Add(BoolVariable("boost_bundled_enable", "Allow use of bundled Boost as last resort", "true"))
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index ac4d003..dafd2b0 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -569,19 +569,20 @@ if env["PLATFORM"] == "win32" :
 
 #Hunspell
 hunspell_env = conf_env.Clone()
-hunspell_prefix = isinstance(env.get("hunspell", False), str) and env["hunspell"] or ""
+hunspell_prefix = isinstance(env.get("hunspell_prefix", False), str) and env["hunspell_prefix"] or ""
 hunspell_flags = {}
 if hunspell_prefix :
 	hunspell_flags = {"CPPPATH":[os.path.join(hunspell_prefix, "include")], "LIBPATH":[os.path.join(hunspell_prefix, "lib")]}
 hunspell_env.MergeFlags(hunspell_flags)
 
 env["HAVE_HUNSPELL"] = 0;
-hunspell_conf = Configure(hunspell_env)
-if hunspell_conf.CheckCXXHeader("hunspell/hunspell.hxx") and hunspell_conf.CheckLib("hunspell") :
-	env["HAVE_HUNSPELL"] = 1
-	hunspell_flags["LIBS"] = ["hunspell"]
-	env["HUNSPELL_FLAGS"] = hunspell_flags
-hunspell_conf.Finish()
+if env.get("hunspell_enable", False) :
+	hunspell_conf = Configure(hunspell_env)
+	if hunspell_conf.CheckCXXHeader("hunspell/hunspell.hxx") and hunspell_conf.CheckLib("hunspell") :
+		env["HAVE_HUNSPELL"] = 1
+		hunspell_flags["LIBS"] = ["hunspell"]
+		env["HUNSPELL_FLAGS"] = hunspell_flags
+	hunspell_conf.Finish()
 
 # Bonjour
 if env["PLATFORM"] == "darwin" and env["target"] == "native" :
diff --git a/Swift/Packaging/Debian/debian/control.in b/Swift/Packaging/Debian/debian/control.in
index b664ffc..254610a 100644
--- a/Swift/Packaging/Debian/debian/control.in
+++ b/Swift/Packaging/Debian/debian/control.in
@@ -3,7 +3,7 @@ Section: net
 Priority: optional
 Maintainer: Swift Package Maintainer <packages@swift.im>
 Uploaders: Remko Tronçon <dev@el-tramo.be>, Kevin Smith <kevin@kismith.co.uk>
-Build-Depends: debhelper (>= 7), scons (>= 1.2.0), libssl-dev (>= 0.9.8g), qt5-default (>= 5.0.0), libqt5x11extras5-dev (>= 5.0.0), libqt5webkit5-dev (>= 5.0.0), qtmultimedia5-dev (>=5.0.0), qttools5-dev-tools (>=5.0.0), libxml2-dev (>= 2.7.6), libxss-dev (>= 1.2.0), libboost-dev (>= 1.34.1), libboost-filesystem-dev (>= 1.34.1), libboost-program-options-dev (>= 1.34.1), libboost-regex-dev (>= 1.34.1), libboost-signals-dev (>= 1.34.1), libboost-system-dev (>= 1.34.1), libboost-thread-dev (>= 1.34.1), libboost-date-time-dev (>= 1.34.1), libidn11-dev (>= 1.10), docbook-xsl (>= 1.75.0), docbook-xml (>= 4.5), xsltproc, libxml2-utils, libhunspell-dev, libnatpmp-dev, libminiupnpc-dev, libsqlite3-dev
+Build-Depends: debhelper (>= 7), scons (>= 1.2.0), libssl-dev (>= 0.9.8g), qt5-default (>= 5.0.0), libqt5x11extras5-dev (>= 5.0.0), libqt5webkit5-dev (>= 5.0.0), qtmultimedia5-dev (>=5.0.0), qttools5-dev-tools (>=5.0.0), libxml2-dev (>= 2.7.6), libxss-dev (>= 1.2.0), libboost-dev (>= 1.34.1), libboost-filesystem-dev (>= 1.34.1), libboost-program-options-dev (>= 1.34.1), libboost-regex-dev (>= 1.34.1), libboost-signals-dev (>= 1.34.1), libboost-system-dev (>= 1.34.1), libboost-thread-dev (>= 1.34.1), libboost-date-time-dev (>= 1.34.1), libidn11-dev (>= 1.10), docbook-xsl (>= 1.75.0), docbook-xml (>= 4.5), xsltproc, libxml2-utils, libnatpmp-dev, libminiupnpc-dev, libsqlite3-dev
 Standards-Version: 3.9.4
 Vcs-Git: git://swift.im/swift
 Vcs-Browser: http://swift.im/git/swift
-- 
cgit v0.10.2-6-g49f6