allejo/VPNBlocker

Support for Ubuntu 18.04+

Closed this issue · 0 comments

Going off of allejo/LeagueOverseer#51, in order to compile on Ubuntu 18.04+ and likely whatever the new Debian LTS is, you must install libjson-c-dev and apply the following changes.

diff --git a/Makefile.am b/Makefile.am
index 871946d..a24a552 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@ lib_LTLIBRARIES = VPNBlocker.la

 VPNBlocker_la_SOURCES = VPNBlocker.cpp JsonObject/JsonObject.h JsonObject/JsonObject.cpp
 VPNBlocker_la_CPPFLAGS= -I$(top_srcdir)/include -I$(top_srcdir)/plugins/plugin_utils
-VPNBlocker_la_LDFLAGS = -module -avoid-version -shared -ljson
+VPNBlocker_la_LDFLAGS = -module -avoid-version -shared -ljson-c
 VPNBlocker_la_LIBADD = $(top_builddir)/plugins/plugin_utils/libplugin_utils.la

 AM_CPPFLAGS = $(CONF_CPPFLAGS)
diff --git a/VPNBlocker.cpp b/VPNBlocker.cpp
index 948f837..34a152e 100644
--- a/VPNBlocker.cpp
+++ b/VPNBlocker.cpp
@@ -21,7 +21,7 @@ THE SOFTWARE.
 */

 #include <cstdarg>
-#include <json/json.h>
+#include <json-c/json.h>
 #include <queue>

 #include "bzfsAPI.h"
diff --git a/JsonObject/JsonObject.cpp b/JsonObject/JsonObject.cpp
index 42f1222..e8ea7ba 100644
--- a/JsonObject.cpp
+++ b/JsonObject.cpp
@@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */

-#include <json/json.h>
+#include <json-c/json.h>
 #include <map>
 #include <string>
 #include <vector>
diff --git a/JsonObject/JsonObject.h b/JsonObject/JsonObject.h
index 95b8394..43a6461 100644
--- a/JsonObject.h
+++ b/JsonObject.h
@@ -23,7 +23,7 @@ THE SOFTWARE.
 #ifndef __JsonObject_H_
 #define __JsonObject_H_

-#include <json/json.h>
+#include <json-c/json.h>
 #include <string>
 #include <vector>
 #include <map>

While I investigate a way of possibly maintaining backward-compatibility with Ubuntu 16.04 LTS, these changes need to be made manually.

libjson0-dev has libjson-c-dev as a dependency, so I would hope that a swap to json-c in the #include would be ok and potentially -ljson too?

For now, consider this plug-in untested on 18.04+