Blob Blame History Raw
From 92cd9a58cd2d342a69647fc0d91af766c562df79 Mon Sep 17 00:00:00 2001
From: Ivan Romanov <drizt@land.ru>
Date: Mon, 14 Apr 2014 15:41:03 +0600
Subject: [PATCH] use external qjdns

---
 psi.qc        |   3 +++
 qcm/qjdns.qcm |  56 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 136 insertions(+), 1 deletion(-)
 create mode 100644 qcm/qjdns.qcm

diff --git a/psi.qc b/psi.qc
index 6cc88b7..2b7725d 100644
--- a/psi.qc
+++ b/psi.qc
@@ -20,6 +20,9 @@
   <dep type='zlib'>
     <required/>
   </dep>
+  <dep type='qjdns'>
+    <required/>
+  </dep>
   <dep type='x11'>
     <required/>
   </dep>
diff --git a/qcm/qjdns.qcm b/qcm/qjdns.qcm
new file mode 100644
index 0000000..658fa0c
--- /dev/null
+++ b/qcm/qjdns.qcm
@@ -0,0 +1,56 @@
+/*
+-----BEGIN QCMOD-----
+name: jdns
+arg: with-qjdns-inc=[path],Path to QJDns include files
+arg: with-qjdns-lib=[path],Path to QJDns library files
+-----END QCMOD-----
+*/
+
+//----------------------------------------------------------------------------
+// qc_qjdns
+//----------------------------------------------------------------------------
+class qc_qjdns : public ConfObj
+{
+public:
+	qc_qjdns(Conf *c) : ConfObj(c) {}
+	QString name() const { return "QJDns"; }
+	QString shortname() const { return "qjdns"; }
+	bool exec()
+	{
+#if defined Q_OS_WIN || defined Q_OS_MAC
+		// HACK: on Windows and Mac OS X, always use psi's bundled qjdns
+		conf->addExtra("CONFIG += iris-qjdns");
+		return true;
+#else
+		QStringList incs;
+		QString version, libs, other;
+		QString s;
+
+		if(!conf->findPkgConfig("qjdns", VersionMin, "2.0.0", &version, &incs, &libs, &other)) {
+			s = conf->getenv("QC_WITH_QJDNS_INC");
+			if ((!s.isEmpty() && conf->checkHeader(s, "qjdns.h")) ||
+				(s.isEmpty() && conf->findHeader("qjdns.h", QStringList(), &s))) {
+				incs.append(s);
+			}
+
+			s = conf->getenv("QC_WITH_QJDNS_LIB");
+			if((!s.isEmpty() && conf->checkLibrary(s, "qjdns")) ||
+			   (s.isEmpty() && conf->findLibrary("qjdns", &s))) {
+				libs = s.isEmpty()? "-lqjdns -ljdns" : QString("-L%1 -lqjdns -ljdns").arg(s);
+			}
+		}
+
+		if (!incs.isEmpty() && !libs.isEmpty()) {
+			foreach(const QString &inc, incs) {
+				conf->addIncludePath(inc);
+			}
+			conf->addLib(libs);
+		}
+		else {
+			conf->addExtra("CONFIG += iris-qjdns");
+		}
+
+		return true;
+#endif
+	}
+};
From 97d1b34668f463e8bf3cf9ecd848d7439d041c50 Mon Sep 17 00:00:00 2001
From: Ivan Romanov <drizt@land.ru>
Date: Mon, 6 Jul 2015 14:12:07 +0500
Subject: [PATCH] updated qjdns qconf module

qjdns since 2.0.3 version can be coinstalled for Qt4 and Qt5.
Pkg-config files in this case named qjdns-qt4.pc and qjdns-qt5
respectively.
---
 qcm/qjdns.qcm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/qcm/qjdns.qcm b/qcm/qjdns.qcm
index 658fa0c..815a231 100644
--- a/qcm/qjdns.qcm
+++ b/qcm/qjdns.qcm
@@ -26,7 +26,12 @@ public:
 		QString version, libs, other;
 		QString s;
 
-		if(!conf->findPkgConfig("qjdns", VersionMin, "2.0.0", &version, &incs, &libs, &other)) {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+		bool found = conf->findPkgConfig("qjdns-qt5", VersionMin, "2.0.3", &version, &incs, &libs, &other);
+#else
+		bool found = conf->findPkgConfig("qjdns-qt4", VersionMin, "2.0.3", &version, &incs, &libs, &other);
+#endif
+		if(!found && !conf->findPkgConfig("qjdns", VersionMin, "2.0.0", &version, &incs, &libs, &other)) {
 			s = conf->getenv("QC_WITH_QJDNS_INC");
 			if ((!s.isEmpty() && conf->checkHeader(s, "qjdns.h")) ||
 				(s.isEmpty() && conf->findHeader("qjdns.h", QStringList(), &s))) {
-- 
2.4.3