summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-x.ci/install.sh15
-rwxr-xr-x.ci/script.sh3
-rw-r--r--.travis.yml8
-rw-r--r--Dockerfile1
-rw-r--r--appveyor.yml2
-rw-r--r--deps/CMakeLists.txt4
-rw-r--r--deps/cmake/Json.cmake40
7 files changed, 37 insertions, 36 deletions
diff --git a/.ci/install.sh b/.ci/install.sh
index 72c34127..426f4c9c 100755
--- a/.ci/install.sh
+++ b/.ci/install.sh
@@ -7,6 +7,9 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then
     brew install qt5 lmdb clang-format ninja libsodium cmark
     brew upgrade boost cmake icu4c || true
 
+    brew tap nlohmann/json
+    brew install nlohmann_json
+
     curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
     sudo python get-pip.py
 
@@ -35,12 +38,12 @@ if [ "$TRAVIS_OS_NAME" == "linux" ]; then
     ./configure && make && make check && sudo make install
     popd
 
-    sudo add-apt-repository -y ppa:beineri/opt-qt${QT_VERSION}-trusty
     sudo apt-get update -qq
     sudo apt-get install -qq -y \
-        qt${QT_PKG}base \
-        qt${QT_PKG}tools \
-        qt${QT_PKG}svg \
-        qt${QT_PKG}multimedia \
-        liblmdb-dev
+        qtbase5-dev \
+        qttools5-dev \
+        libqt5svg5-dev \
+        qtmultimedia5-dev \
+        liblmdb-dev \
+        nlohmann-json-dev
 fi
diff --git a/.ci/script.sh b/.ci/script.sh
index ce65cb14..435f2c27 100755
--- a/.ci/script.sh
+++ b/.ci/script.sh
@@ -24,7 +24,8 @@ fi
 # Build & install dependencies
 cmake -GNinja -Hdeps -B.deps \
     -DUSE_BUNDLED_BOOST=${USE_BUNDLED_BOOST} \
-    -DUSE_BUNDLED_CMARK=${USE_BUNDLED_CMARK}
+    -DUSE_BUNDLED_CMARK=${USE_BUNDLED_CMARK} \
+    -DUSE_BUNDLED_JSON=${USE_BUNDLED_JSON}
 cmake --build .deps
 
 # Build nheko
diff --git a/.travis.yml b/.travis.yml
index c5cd84c2..13af8eec 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
 language: cpp
 sudo: required
-dist: trusty
+dist: bionic
 
 notifications:
   webhooks:
@@ -20,6 +20,7 @@ matrix:
               - DEPLOYMENT=1
               - USE_BUNDLED_BOOST=0
               - USE_BUNDLED_CMARK=0
+              - USE_BUNDLED_JSON=0
         - os: linux
           compiler: gcc
           env:
@@ -30,6 +31,7 @@ matrix:
               - DEPLOYMENT=1
               - USE_BUNDLED_BOOST=1
               - USE_BUNDLED_CMARK=1
+              - USE_BUNDLED_JSON=0
           addons:
               apt:
                   sources: ["ubuntu-toolchain-r-test"]
@@ -43,6 +45,7 @@ matrix:
               - QT_PKG=57
               - USE_BUNDLED_BOOST=1
               - USE_BUNDLED_CMARK=1
+              - USE_BUNDLED_JSON=0
           addons:
               apt:
                   sources: ["ubuntu-toolchain-r-test"]
@@ -56,6 +59,7 @@ matrix:
               - QT_PKG=59
               - USE_BUNDLED_BOOST=1
               - USE_BUNDLED_CMARK=1
+              - USE_BUNDLED_JSON=0
           addons:
               apt:
                   sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"]
@@ -109,4 +113,4 @@ deploy:
   on:
     condition: "$TRAVIS_OS_NAME == osx && $DEPLOYMENT == 1"
     repo: Nheko-Reborn/nheko
-    tags: true
\ No newline at end of file
+    tags: true
diff --git a/Dockerfile b/Dockerfile
index 163ae532..645b2fc4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -11,6 +11,7 @@ RUN \
 
 RUN \
     apt-get install -y \
+        nlohmann-json-dev \
         make \
         pkg-config \
         ninja-build \
diff --git a/appveyor.yml b/appveyor.yml
index d0cf82b7..1e0fcb1a 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -57,6 +57,7 @@ build_script:
     - cmake -G "Visual Studio 15 2017 Win64" -Hdeps -B.deps
         -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
         -DUSE_BUNDLED_BOOST=OFF
+        -DUSE_BUNDLED_JSON=OFF
     - cmake --build .deps --config Release
 
     # Build nheko
@@ -67,6 +68,7 @@ build_script:
       -DTWEENY_INCLUDE_DIR=.deps/usr/include
       -DCMARK_INCLUDE_DIR=C:/projects/nheko/.deps/usr/include
       -DCMARK_LIBRARY=C:/projects/nheko/.deps/usr/lib/cmark.lib
+      -DJSON_INCLUDE_DIR=.deps/usr/include
     - cmake --build build --config Release
 
 after_build:
diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt
index 418ec82e..290b523d 100644
--- a/deps/CMakeLists.txt
+++ b/deps/CMakeLists.txt
@@ -45,10 +45,10 @@ set(BOOST_SHA256
 
 set(
   MTXCLIENT_URL
-  https://github.com/Nheko-Reborn/mtxclient/archive/67d39691666bcdf3cc660db19ccc0d9941df13fd.tar.gz
+  https://github.com/Nheko-Reborn/mtxclient/archive/5dc567a4a494a2152658c6586e0d7637ecba85b4.tar.gz
   )
 set(MTXCLIENT_HASH
-  4aeb69a3261aec96bd1fbce2fedc10e3771d87a5a82657bab8bc6006b7f1ad10)
+  afea7b9681657233f6e833cccd161af66e320654be0c6bcffba855420e37f415)
 set(
   TWEENY_URL
   https://github.com/mobius3/tweeny/archive/b94ce07cfb02a0eb8ac8aaf66137dabdaea857cf.tar.gz
diff --git a/deps/cmake/Json.cmake b/deps/cmake/Json.cmake
index a37cc325..3b63550e 100644
--- a/deps/cmake/Json.cmake
+++ b/deps/cmake/Json.cmake
@@ -1,29 +1,19 @@
 ExternalProject_Add(
-    Json
-    PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/Json
-    GIT_REPOSITORY https://github.com/nlohmann/json.git
-    # For shallow git clone (without downloading whole history)
-    # GIT_SHALLOW 1
-    # For point at certain tag
-    GIT_TAG v3.2.0
-    #disables auto update on every build
-    UPDATE_DISCONNECTED 1
-    #disable following
-    CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_DIR "" INSTALL_COMMAND ""
-    )
-# Update json target
-add_custom_target(external-Json-update
-    COMMENT "Updated Nlohmann/Json"
-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Json/src/Json
-    COMMAND ${GIT_EXECUTABLE} pull
-    DEPENDS Json)
+  Json
 
-#ExternalProject_Add(
-#  json
-#
-#
-#  DOWNLOAD_COMMAND  file(DOWNLOAD ${JSON_HEADER_URL} ${DEPS_INSTALL_DIR}/include/json.hpp
-#    EXPECTED_HASH SHA256=${JSON_HEADER_HASH})
-#)
+  GIT_REPOSITORY ${JSON_URL}
+  GIT_TAG ${JSON_TAG}
+
+  BUILD_IN_SOURCE 1
+  SOURCE_DIR ${DEPS_BUILD_DIR}/json
+
+  CONFIGURE_COMMAND ${CMAKE_COMMAND}
+        -DJSON_BuildTests=OFF
+        -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
+        -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+
+  BUILD_COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}/json 
+  INSTALL_COMMAND make install
+)
 
 list(APPEND THIRD_PARTY_DEPS Json)