From b883db0d4d5389d2fd87159fe7cb8bf354469d9e Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 00:32:53 +0100 Subject: [PATCH 01/12] Fix TravisCI OSX build --- .travis.yml | 15 +++++++-------- build_scripts/OSX/travis_makeOSXPackage.sh | 0 2 files changed, 7 insertions(+), 8 deletions(-) mode change 100644 => 100755 build_scripts/OSX/travis_makeOSXPackage.sh diff --git a/.travis.yml b/.travis.yml index cc75af004..f71410a0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,19 +16,18 @@ matrix: before_install: - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update; fi - - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential libssl-dev libsqlcipher-dev libbz2-dev libmicrohttpd-dev libsqlite3-dev libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev libqt5x11extras5-dev libqt5designer5 libxapian-dev qttools5-dev; fi + - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential libssl-dev libsqlcipher-dev libbz2-dev libsqlite3-dev libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev libqt5x11extras5-dev libqt5designer5 libxapian-dev qttools5-dev; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew update ; fi - - if [ $TRAVIS_OS_NAME == osx ]; then brew install ccach; export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi + - if [ $TRAVIS_OS_NAME == osx ]; then brew install ccache; export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew install qt5; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew link --force qt5 ; fi - - if [ $TRAVIS_OS_NAME == osx ]; then brew install openssl miniupnpc libmicrohttpd sqlcipher xapian cmark; fi + - if [ $TRAVIS_OS_NAME == osx ]; then brew install openssl miniupnpc rapidjson sqlcipher xapian cmark; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew install p7zip; fi - if [ $TRAVIS_OS_NAME == osx ]; then npm install -g appdmg; fi - - wget https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz - - tar -xf v1.1.0.tar.gz - - if [ $TRAVIS_OS_NAME == osx ]; then cp -r rapidjson-1.1.0/include/rapidjson/ /usr/local/include/rapidjson ; fi + - if [ $TRAVIS_OS_NAME == linux ]; then wget https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz ; fi + - if [ $TRAVIS_OS_NAME == linux ]; then tar -xf v1.1.0.tar.gz ; fi - if [ $TRAVIS_OS_NAME == linux ]; then sudo cp -r rapidjson-1.1.0/include/rapidjson/ /usr/include/rapidjson ; fi env: @@ -49,13 +48,13 @@ addons: before_script: - env - if [ $TRAVIS_OS_NAME == linux ]; then qmake; fi - - if [ $TRAVIS_OS_NAME == osx ]; then qmake CONFIG+=rs_macos10.14 INCLUDEPATH+=/usr/local/opt/openssl/include/ INCLUDEPATH+=$(find /usr/local/Cellar/sqlcipher/*/include | headn -n 1) INCLUDEPATH+=$(find /usr/local/Cellar/libmicrohttpd/*/include | head -n 1) QMAKE_LIBDIR+=/usr/local/opt/openssl/lib/ QMAKE_LIBDIR+=$(find /usr/local/Cellar/libmicrohttpd/*/lib | head -n 1) QMAKE_LIBDIR+=$(find /usr/local/Cellar/sqlcipher/*/lib | head -n 1); fi + - if [ $TRAVIS_OS_NAME == osx ]; then qmake CONFIG+=rs_macos10.14 INCLUDEPATH+=$(find /usr/local/Cellar/openssl*/*/include/ | head -n 1) INCLUDEPATH+=$(find /usr/local/Cellar/rapidjson/*/include | head -n 1) INCLUDEPATH+=$(find /usr/local/Cellar/sqlcipher/*/include | head -n 1) QMAKE_LIBDIR+=$(find /usr/local/Cellar/openssl*/*/lib/ | head -n 1) QMAKE_LIBDIR+=$(find /usr/local/Cellar/sqlcipher/*/lib | head -n 1); fi script: - if [ $TRAVIS_OS_NAME == osx ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j4; fi after_success: - - if [ $TRAVIS_OS_NAME == osx ]; then chmod +x ./travis_makeOSXPackage.sh && ./travis_makeOSXPackage.sh ; fi + - if [ $TRAVIS_OS_NAME == osx ]; then build_scripts/OSX/travis_makeOSXPackage.sh ; fi - if [ $TRAVIS_OS_NAME == linux ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j2; fi diff --git a/build_scripts/OSX/travis_makeOSXPackage.sh b/build_scripts/OSX/travis_makeOSXPackage.sh old mode 100644 new mode 100755 From 516b5e7a83f94ed8bc99ac3afeb353611bed343b Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 01:24:22 +0100 Subject: [PATCH 02/12] Update and enable TravisCI for GNU/Linux --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f71410a0a..9cf89b2d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ language: cpp matrix: include: - os: linux - dist: trusty + dist: bionic sudo: required compiler: gcc - os: osx @@ -51,7 +51,7 @@ before_script: - if [ $TRAVIS_OS_NAME == osx ]; then qmake CONFIG+=rs_macos10.14 INCLUDEPATH+=$(find /usr/local/Cellar/openssl*/*/include/ | head -n 1) INCLUDEPATH+=$(find /usr/local/Cellar/rapidjson/*/include | head -n 1) INCLUDEPATH+=$(find /usr/local/Cellar/sqlcipher/*/include | head -n 1) QMAKE_LIBDIR+=$(find /usr/local/Cellar/openssl*/*/lib/ | head -n 1) QMAKE_LIBDIR+=$(find /usr/local/Cellar/sqlcipher/*/lib | head -n 1); fi script: - - if [ $TRAVIS_OS_NAME == osx ] && [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j4; fi + - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j4; fi after_success: - if [ $TRAVIS_OS_NAME == osx ]; then build_scripts/OSX/travis_makeOSXPackage.sh ; fi From 3bb42ca79959f35a8bb38a0633228b8e188bf175 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 01:33:17 +0100 Subject: [PATCH 03/12] Fix wrong rapidjson include on Appveyor --- appveyor.yml | 2 +- libretroshare/src/serialiser/rstypeserializer.cc | 5 ----- libretroshare/src/use_libretroshare.pri | 3 +-- libretroshare/src/util/rsjson.cc | 15 ++++----------- libretroshare/src/util/rsjson.h | 7 +------ 5 files changed, 7 insertions(+), 25 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 98686b717..786100b59 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -90,7 +90,7 @@ install: # Configuring MSys2 - set PATH=C:\msys64\usr\bin;%PATH% - set PATH=C:\msys64\mingw32\bin;%PATH% - - pacman --noconfirm -S mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd mingw-w64-i686-xapian-core mingw-w64-i686-cmark + - pacman --noconfirm -S mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-rapidjson mingw-w64-i686-sqlcipher mingw-w64-i686-xapian-core mingw-w64-i686-cmark #- pacman --noconfirm -S mingw-w64-i686-qt5-static mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd #- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH% diff --git a/libretroshare/src/serialiser/rstypeserializer.cc b/libretroshare/src/serialiser/rstypeserializer.cc index c166ce39c..47fd99e45 100644 --- a/libretroshare/src/serialiser/rstypeserializer.cc +++ b/libretroshare/src/serialiser/rstypeserializer.cc @@ -32,12 +32,7 @@ #include #include #include // for typeid - -#ifdef HAS_RAPIDJSON #include -#else -#include -#endif // HAS_RAPIDJSON static constexpr uint32_t MAX_SERIALIZED_CHUNK_SIZE = 10*1024*1024 ; // 10 MB. diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index 9b9622574..11a9801d8 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -38,11 +38,10 @@ bitdht { # always possible to find them RAPIDJSON_AVAILABLE = $$system(pkg-config --atleast-version 1.1 RapidJSON && echo yes) isEmpty(RAPIDJSON_AVAILABLE) { - message("using built-in rapidjson") + message("using rapidjson from submodule") INCLUDEPATH *= $$clean_path($${PWD}/../../supportlibs/rapidjson/include) } else { message("using system rapidjson") - DEFINES *= HAS_RAPIDJSON } diff --git a/libretroshare/src/util/rsjson.cc b/libretroshare/src/util/rsjson.cc index 37f6282e4..8af1cf942 100644 --- a/libretroshare/src/util/rsjson.cc +++ b/libretroshare/src/util/rsjson.cc @@ -19,19 +19,12 @@ * * *******************************************************************************/ +#include +#include +#include + #include "util/rsjson.h" -#ifdef HAS_RAPIDJSON -# include -# include -# include -#else -# include -# include -# include -#endif // HAS_RAPIDJSON - - inline int getJsonManipulatorStatePosition() { static int p = std::ios_base::xalloc(); diff --git a/libretroshare/src/util/rsjson.h b/libretroshare/src/util/rsjson.h index 8bbb2a992..db864a73f 100644 --- a/libretroshare/src/util/rsjson.h +++ b/libretroshare/src/util/rsjson.h @@ -21,12 +21,7 @@ #pragma once #include - -#ifdef HAS_RAPIDJSON -# include -#else -# include -#endif // HAS_RAPIDJSON +#include /** * Use this type for JSON documents representations in RetroShare code From 8a70174fb6c735eb2f414f22b33947d72b881e35 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 01:42:30 +0100 Subject: [PATCH 04/12] TravisCI linux use rapidjson from bionic repository --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9cf89b2d2..56becce24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ matrix: before_install: - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update; fi - - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential libssl-dev libsqlcipher-dev libbz2-dev libsqlite3-dev libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev libqt5x11extras5-dev libqt5designer5 libxapian-dev qttools5-dev; fi + - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential libssl-dev libsqlcipher-dev libbz2-dev libsqlite3-dev libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev libqt5x11extras5-dev libqt5designer5 libxapian-dev qttools5-dev rapidjson-dev ; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew update ; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew install ccache; export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi @@ -26,10 +26,6 @@ before_install: - if [ $TRAVIS_OS_NAME == osx ]; then brew install p7zip; fi - if [ $TRAVIS_OS_NAME == osx ]; then npm install -g appdmg; fi - - if [ $TRAVIS_OS_NAME == linux ]; then wget https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz ; fi - - if [ $TRAVIS_OS_NAME == linux ]; then tar -xf v1.1.0.tar.gz ; fi - - if [ $TRAVIS_OS_NAME == linux ]; then sudo cp -r rapidjson-1.1.0/include/rapidjson/ /usr/include/rapidjson ; fi - env: global: # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created From 722b1dbffcd8ff106be76984b38db938710a949f Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 13:51:13 +0100 Subject: [PATCH 05/12] Attempt to fix AppveyorCI + Cleanup macosx variables --- appveyor.yml | 2 +- libretroshare/src/retroshare/rsversion.h | 2 +- libretroshare/src/use_libretroshare.pri | 1 + retroshare.pri | 19 ------------------- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 786100b59..ef836a6a2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -147,7 +147,7 @@ before_package: build_script: - env - git submodule update --init - - qmake -Wall -spec win32-g++ "CONFIG=debug" + - qmake -Wall -spec win32-g++ "CONFIG+=debug" "CONFIG+=c++11" - mingw32-make -j3 # scripts to run after build diff --git a/libretroshare/src/retroshare/rsversion.h b/libretroshare/src/retroshare/rsversion.h index dde4fde89..172f6c5b3 100644 --- a/libretroshare/src/retroshare/rsversion.h +++ b/libretroshare/src/retroshare/rsversion.h @@ -81,7 +81,7 @@ constexpr auto RS_HUMAN_READABLE_VERSION = RS_PRIVATE_STRINGIFY(RS_MINI_VERSION) RS_EXTRA_VERSION; -#include +#include #include /** diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index 11a9801d8..8809d8493 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -18,6 +18,7 @@ RS_SRC_PATH=$$clean_path($${PWD}/../../) RS_BUILD_PATH=$$clean_path($${OUT_PWD}/../../) +CONFIG += c++11 DEPENDPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src/) INCLUDEPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src) LIBS *= -L$$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/) -lretroshare diff --git a/retroshare.pri b/retroshare.pri index 0158b2957..fb13a1f95 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -479,11 +479,6 @@ no_rs_cppwarning { rs_gxs_trans { DEFINES *= RS_GXS_TRANS - greaterThan(QT_MAJOR_VERSION, 4) { - CONFIG += c++11 - } else { - QMAKE_CXXFLAGS += -std=c++0x - } } bitdht { @@ -707,21 +702,7 @@ macx-* { message(***retroshare.pri:MacOSX) - # BIN_DIR += "/usr/bin" - # INC_DIR += "/usr/include" - # INC_DIR += "/usr/local/include" - # INC_DIR += "/opt/local/include" - # LIB_DIR += "/usr/local/lib" - # LIB_DIR += "/opt/local/lib" BIN_DIR += "/Applications/Xcode.app/Contents/Developer/usr/bin" - INC_DIR += "/usr/local/Cellar/miniupnpc/2.1/include" - INC_DIR += "/usr/local/Cellar/libmicrohttpd/0.9.62_1/include" - INC_DIR += "/usr/local/Cellar/sqlcipher/4.1.0/include" - LIB_DIR += "/usr/local/opt/openssl/lib/" - LIB_DIR += "/usr/local/Cellar/libmicrohttpd/0.9.62_1/lib" - LIB_DIR += "/usr/local/Cellar/sqlcipher/4.1.0/lib" - LIB_DIR += "/usr/local/Cellar/miniupnpc/2.1/lib" - CONFIG += c++11 INCLUDEPATH += "/usr/local/include" RS_UPNP_LIB = miniupnpc QT += macextras From 6bae8237e169fb99b1fbff36d49d61014f509f47 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 15:48:17 +0100 Subject: [PATCH 06/12] TavisCI OSX add miniupnpc include and lib path --- .travis.yml | 28 ++++++++++++++++++++----- README.asciidoc | 4 ++++ RetroShare.pro | 2 ++ libretroshare/src/use_libretroshare.pri | 1 - 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56becce24..14de55fd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,13 +16,21 @@ matrix: before_install: - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update; fi - - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential libssl-dev libsqlcipher-dev libbz2-dev libsqlite3-dev libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev libqt5x11extras5-dev libqt5designer5 libxapian-dev qttools5-dev rapidjson-dev ; fi - + - > + if [ $TRAVIS_OS_NAME == linux ]; then + sudo apt-get install -y + build-essential libssl-dev libsqlcipher-dev libbz2-dev libsqlite3-dev + libupnp-dev pkg-config qt5-default libxss-dev qtmultimedia5-dev + libqt5x11extras5-dev libqt5designer5 libxapian-dev qttools5-dev + rapidjson-dev ; + fi - if [ $TRAVIS_OS_NAME == osx ]; then brew update ; fi - - if [ $TRAVIS_OS_NAME == osx ]; then brew install ccache; export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew install qt5; fi - if [ $TRAVIS_OS_NAME == osx ]; then brew link --force qt5 ; fi - - if [ $TRAVIS_OS_NAME == osx ]; then brew install openssl miniupnpc rapidjson sqlcipher xapian cmark; fi + - > + if [ $TRAVIS_OS_NAME == osx ]; then + brew install openssl miniupnpc rapidjson sqlcipher xapian cmark; + fi - if [ $TRAVIS_OS_NAME == osx ]; then brew install p7zip; fi - if [ $TRAVIS_OS_NAME == osx ]; then npm install -g appdmg; fi @@ -44,7 +52,17 @@ addons: before_script: - env - if [ $TRAVIS_OS_NAME == linux ]; then qmake; fi - - if [ $TRAVIS_OS_NAME == osx ]; then qmake CONFIG+=rs_macos10.14 INCLUDEPATH+=$(find /usr/local/Cellar/openssl*/*/include/ | head -n 1) INCLUDEPATH+=$(find /usr/local/Cellar/rapidjson/*/include | head -n 1) INCLUDEPATH+=$(find /usr/local/Cellar/sqlcipher/*/include | head -n 1) QMAKE_LIBDIR+=$(find /usr/local/Cellar/openssl*/*/lib/ | head -n 1) QMAKE_LIBDIR+=$(find /usr/local/Cellar/sqlcipher/*/lib | head -n 1); fi + - > + if [ $TRAVIS_OS_NAME == osx ]; then + qmake CONFIG+=rs_macos10.14 + INCLUDEPATH+=$(find /usr/local/Cellar/miniupnpc/*/include | head -n 1) + QMAKE_LIBDIR+=$(find /usr/local/Cellar/miniupnpc/*/lib/ | head -n 1) + INCLUDEPATH+=$(find /usr/local/Cellar/openssl*/*/include/ | head -n 1) + QMAKE_LIBDIR+=$(find /usr/local/Cellar/openssl*/*/lib/ | head -n 1) + INCLUDEPATH+=$(find /usr/local/Cellar/rapidjson/*/include | head -n 1) + INCLUDEPATH+=$(find /usr/local/Cellar/sqlcipher/*/include | head -n 1) + QMAKE_LIBDIR+=$(find /usr/local/Cellar/sqlcipher/*/lib | head -n 1); + fi script: - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j4; fi diff --git a/README.asciidoc b/README.asciidoc index 2086c1bd5..14da7ebd9 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -19,6 +19,10 @@ updated documentation on how to build retroshare, instead we provide scripts and receipts that are used to create the packages for the supported platforms and more in the `build_scripts` directory of this repository. +Those packaging receipts toghether with the continuous integration files +`.travis.yml` and `appveyor.yml` are a good source of knoweldge on how to +compile retroshare on different platforms. + == Using RetroShare on a headless computer with WebUI diff --git a/RetroShare.pro b/RetroShare.pro index 845cdd3a6..760da5cb2 100644 --- a/RetroShare.pro +++ b/RetroShare.pro @@ -16,6 +16,8 @@ # along with this program. If not, see . # ################################################################################ +CONFIG += c++11 + !include("retroshare.pri"): error("Could not include file retroshare.pri") TEMPLATE = subdirs diff --git a/libretroshare/src/use_libretroshare.pri b/libretroshare/src/use_libretroshare.pri index 8809d8493..11a9801d8 100644 --- a/libretroshare/src/use_libretroshare.pri +++ b/libretroshare/src/use_libretroshare.pri @@ -18,7 +18,6 @@ RS_SRC_PATH=$$clean_path($${PWD}/../../) RS_BUILD_PATH=$$clean_path($${OUT_PWD}/../../) -CONFIG += c++11 DEPENDPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src/) INCLUDEPATH *= $$clean_path($${RS_SRC_PATH}/libretroshare/src) LIBS *= -L$$clean_path($${RS_BUILD_PATH}/libretroshare/src/lib/) -lretroshare From 5bf8792bc5945fbc6e6e71b28dc6117420b66241 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 16:29:10 +0100 Subject: [PATCH 07/12] Fix windows compile due to rsversion JSON API --- README.asciidoc | 13 ++++----- appveyor.yml | 6 ++-- libretroshare/src/jsonapi/jsonapi.cpp | 17 ++++++++++-- libretroshare/src/libretroshare.pro | 2 -- libretroshare/src/retroshare/rsjsonapi.h | 12 ++++++++ libretroshare/src/retroshare/rsversion.h | 32 ---------------------- libretroshare/src/services/rsversion.cxx | 35 ------------------------ 7 files changed, 37 insertions(+), 80 deletions(-) delete mode 100644 libretroshare/src/services/rsversion.cxx diff --git a/README.asciidoc b/README.asciidoc index 14da7ebd9..c2aad3e7f 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -2,8 +2,7 @@ RetroShare is a decentralized, private, secure, cross-platform, communication toolkit. -RetroShare provides filesharing, chat, messages, forums, channels and -more. +RetroShare provides filesharing, chat, messages, forums, channels and more. .Build Status |=============================================================================== @@ -15,13 +14,13 @@ more. == Compilation It is very difficult to keep a comprehensive (we support many platforms) and -updated documentation on how to build retroshare, instead we provide scripts and -receipts that are used to create the packages for the supported platforms and +updated documentation on how to build RetroShare, instead we provide scripts and +recipes that are used to create the packages for the supported platforms and more in the `build_scripts` directory of this repository. -Those packaging receipts toghether with the continuous integration files -`.travis.yml` and `appveyor.yml` are a good source of knoweldge on how to -compile retroshare on different platforms. +Those packaging receipts together with the continuous integration files +`.travis.yml` and `appveyor.yml` are a good source of knowledge on how to +compile RetroShare on different platforms. == Using RetroShare on a headless computer with WebUI diff --git a/appveyor.yml b/appveyor.yml index ef836a6a2..db33f5d04 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -90,8 +90,10 @@ install: # Configuring MSys2 - set PATH=C:\msys64\usr\bin;%PATH% - set PATH=C:\msys64\mingw32\bin;%PATH% - - pacman --noconfirm -S mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-rapidjson mingw-w64-i686-sqlcipher mingw-w64-i686-xapian-core mingw-w64-i686-cmark - #- pacman --noconfirm -S mingw-w64-i686-qt5-static mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd + - > + pacman --noconfirm -S + mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-rapidjson + mingw-w64-i686-sqlcipher mingw-w64-i686-xapian-core mingw-w64-i686-cmark #- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH% # Configuring Qt diff --git a/libretroshare/src/jsonapi/jsonapi.cpp b/libretroshare/src/jsonapi/jsonapi.cpp index 3884775da..b15dbefb5 100644 --- a/libretroshare/src/jsonapi/jsonapi.cpp +++ b/libretroshare/src/jsonapi/jsonapi.cpp @@ -17,8 +17,6 @@ * * *******************************************************************************/ -#include "jsonapi.h" - #include #include #include @@ -26,6 +24,9 @@ #include #include + +#include "jsonapi.h" + #include "util/rsjson.h" #include "retroshare/rsfiles.h" #include "util/radix64.h" @@ -36,6 +37,7 @@ #include "util/rsurl.h" #include "util/rstime.h" #include "retroshare/rsevents.h" +#include "retroshare/rsversion.h" // Generated at compile time #include "jsonapi-includes.inl" @@ -644,3 +646,14 @@ void JsonApiServer::runloop() RsInfo() << __PRETTY_FUNCTION__ << " finished!" << std::endl; } + +/*static*/ void RsJsonApi::version( + uint32_t& major, uint32_t& minor, uint32_t& mini, std::string& extra, + std::string& human ) +{ + major = RS_MAJOR_VERSION; + minor = RS_MINOR_VERSION; + mini = RS_MINI_VERSION; + extra = RS_EXTRA_VERSION; + human = RS_HUMAN_READABLE_VERSION; +} diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 0a9c75322..369f8075f 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -172,8 +172,6 @@ HEADERS += plugins/pluginmanager.h \ HEADERS += $$PUBLIC_HEADERS -SOURCES *= services/rsversion.cxx - ################################# Linux ########################################## linux-* { CONFIG += link_pkgconfig diff --git a/libretroshare/src/retroshare/rsjsonapi.h b/libretroshare/src/retroshare/rsjsonapi.h index e5c59c496..07a18c6b9 100644 --- a/libretroshare/src/retroshare/rsjsonapi.h +++ b/libretroshare/src/retroshare/rsjsonapi.h @@ -158,5 +158,17 @@ public: */ virtual bool isAuthTokenValid(const std::string& token) = 0; + /** + * @brief Write version information to given paramethers + * @jsonapi{development,unauthenticated} + * @param[out] major storage + * @param[out] minor storage + * @param[out] mini storage + * @param[out] extra storage + * @param[out] human storage + */ + static void version( uint32_t& major, uint32_t& minor, uint32_t& mini, + std::string& extra, std::string& human ); + virtual ~RsJsonApi() = default; }; diff --git a/libretroshare/src/retroshare/rsversion.h b/libretroshare/src/retroshare/rsversion.h index 172f6c5b3..a5e459a4a 100644 --- a/libretroshare/src/retroshare/rsversion.h +++ b/libretroshare/src/retroshare/rsversion.h @@ -79,35 +79,3 @@ constexpr auto RS_HUMAN_READABLE_VERSION = RS_PRIVATE_STRINGIFY(RS_MAJOR_VERSION) "." \ RS_PRIVATE_STRINGIFY(RS_MINOR_VERSION) "." \ RS_PRIVATE_STRINGIFY(RS_MINI_VERSION) RS_EXTRA_VERSION; - - -#include -#include - -/** - * Helper to expose version information to JSON API. - * From C++ you should use directly the macro and constants defined upstair - * @jsonapi{development} - */ -class RsVersion -{ -public: - /** - * @brief Write version information to given paramethers - * @jsonapi{development,unauthenticated} - * @param[out] major storage - * @param[out] minor storage - * @param[out] mini storage - * @param[out] extra storage - * @param[out] human storage - */ - static void version( uint32_t& major, uint32_t& minor, uint32_t& mini, - std::string& extra, std::string& human ); -}; - -/** - * Pointer to global instance of RsVersion, for the sake of JSON API, from C++ - * you can use directly the macro and constants defined upstair - * @jsonapi{development} - */ -extern RsVersion* rsVersion; diff --git a/libretroshare/src/services/rsversion.cxx b/libretroshare/src/services/rsversion.cxx deleted file mode 100644 index b4a06f7f7..000000000 --- a/libretroshare/src/services/rsversion.cxx +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * * - * libretroshare: retroshare core library * - * * - * Copyright (C) 2019 Gioacchino Mazzurco * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -#include "retroshare/rsversion.h" - -/*extern*/ RsVersion* rsVersion = new RsVersion; - -/*static*/ void RsVersion::version( - uint32_t& major, uint32_t& minor, uint32_t& mini, std::string& extra, - std::string& human ) -{ - major = RS_MAJOR_VERSION; - minor = RS_MINOR_VERSION; - mini = RS_MINI_VERSION; - extra = RS_EXTRA_VERSION; - human = RS_HUMAN_READABLE_VERSION; -} From ba4af74a0618683ecce953b925f9242230bd1d61 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 18:22:01 +0100 Subject: [PATCH 08/12] Add reminder to rsversion.h that no C++ includes are admitted --- libretroshare/src/retroshare/rsversion.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libretroshare/src/retroshare/rsversion.h b/libretroshare/src/retroshare/rsversion.h index a5e459a4a..b28aef021 100644 --- a/libretroshare/src/retroshare/rsversion.h +++ b/libretroshare/src/retroshare/rsversion.h @@ -79,3 +79,7 @@ constexpr auto RS_HUMAN_READABLE_VERSION = RS_PRIVATE_STRINGIFY(RS_MAJOR_VERSION) "." \ RS_PRIVATE_STRINGIFY(RS_MINOR_VERSION) "." \ RS_PRIVATE_STRINGIFY(RS_MINI_VERSION) RS_EXTRA_VERSION; + +/* Because RetroShare-gui include this file in gui/images/retroshare_win.rc + * including any C++ things like `#include ` will break compilation of + * RetroShare-gui on Windows. Therefore this file must be kept minimal. */ From 6464870cf9c3baefa834bc1d61ba67d6a0fc1293 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 19:03:55 +0100 Subject: [PATCH 09/12] Cleanup qmake files, Appveyor list produced files --- RetroShare.pro | 6 ------ appveyor.yml | 7 ++++--- retroshare.pri | 9 +++++---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/RetroShare.pro b/RetroShare.pro index 760da5cb2..2e9b0a17f 100644 --- a/RetroShare.pro +++ b/RetroShare.pro @@ -31,12 +31,6 @@ rs_jsonapi:isEmpty(JSONAPI_GENERATOR_EXE) { libretroshare.depends += jsonapi-generator } -rs_webui { - !rs_jsonapi { - error("rs_webui requires rs_jsonapi") - } -} - SUBDIRS += libbitdht libbitdht.file = libbitdht/src/libbitdht.pro libretroshare.depends += openpgpsdk libbitdht diff --git a/appveyor.yml b/appveyor.yml index db33f5d04..386370a44 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -149,11 +149,14 @@ before_package: build_script: - env - git submodule update --init - - qmake -Wall -spec win32-g++ "CONFIG+=debug" "CONFIG+=c++11" + - qmake -spec win32-g++ "CONFIG+=debug" - mingw32-make -j3 # scripts to run after build after_build: + - find C:\projects\RetroShare >> filelist.txt + - cat filelist.txt + - mkdir %RS_DEPLOY% - copy retroshare-service\src\retroshare-service.exe %RS_DEPLOY%\ - copy retroshare-gui\src\retroshare.exe %RS_DEPLOY%\ @@ -252,8 +255,6 @@ after_build: - copy C:\msys64\mingw32\bin\libcmark*.dll %RS_DEPLOY%\ - copy C:\msys64\mingw32\bin\libdouble-conversion*.dll %RS_DEPLOY%\ - - find C:\projects\RetroShare >> filelist.txt - # to disable automatic builds #build: off diff --git a/retroshare.pri b/retroshare.pri index fb13a1f95..f74fc7aa4 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -164,13 +164,14 @@ no_rs_broadcast_discovery:CONFIG -= rs_broadcast_discovery CONFIG *= rs_no_webui rs_webui:CONFIG -= rs_no_webui -# To enable webui append the following assignation to qmake -# command line "CONFIG+=rs_service_webui_terminal_password" +# To disable retroshare-service option to set webui password from the terminal +# append the following assignation to qmake command line +# "CONFIG+=no_rs_service_webui_terminal_password" CONFIG *= rs_service_webui_terminal_password no_rs_service_webui_terminal_password:CONFIG -= rs_service_webui_terminal_password -# To enable retroshare-service terminal login append the following assignation -# to qmake command line "CONFIG+=rs_service_terminal_login" +# To disable retroshare-service terminal login append the following assignation +# to qmake command line "CONFIG+=no_rs_service_terminal_login" CONFIG *= rs_service_terminal_login no_rs_service_terminal_login:CONFIG -= rs_service_terminal_login From 2cca38c2a63d942855b66c9d3ff9ceaa131e15da Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 19:51:22 +0100 Subject: [PATCH 10/12] Appveyor use a different directory for build --- appveyor.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 386370a44..8648aefd4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -140,6 +140,10 @@ configuration: Release # scripts to run before build before_build: - cd C:\projects\RetroShare + - git submodule update --init + - cd C:\projects\ + - mkdir RetroShare-build + - cd RetroShare-build # - find C:\ > filelist.txt # scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services) @@ -148,14 +152,12 @@ before_package: # to run your custom scripts instead of automatic MSBuild build_script: - env - - git submodule update --init - - qmake -spec win32-g++ "CONFIG+=debug" + - qmake ../RetroShare -spec win32-g++ "CONFIG+=debug" - mingw32-make -j3 # scripts to run after build after_build: - - find C:\projects\RetroShare >> filelist.txt - - cat filelist.txt + - find . - mkdir %RS_DEPLOY% - copy retroshare-service\src\retroshare-service.exe %RS_DEPLOY%\ From f94bd70ca62b938672616bd994e8606a9a2b0b01 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 20:26:10 +0100 Subject: [PATCH 11/12] Appveyor fix debug deploy --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8648aefd4..b15fd0e71 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -160,8 +160,10 @@ after_build: - find . - mkdir %RS_DEPLOY% - - copy retroshare-service\src\retroshare-service.exe %RS_DEPLOY%\ - - copy retroshare-gui\src\retroshare.exe %RS_DEPLOY%\ + - copy retroshare-gui\src\debug\retroshare.exe %RS_DEPLOY%\ + - copy retroshare-service\src\debug\retroshare-service.exe %RS_DEPLOY%\ +# - copy retroshare-service\src\retroshare-service.exe %RS_DEPLOY%\ +# - copy retroshare-gui\src\retroshare.exe %RS_DEPLOY%\ ## In Debug build winedeplyqt forget the non debug Qt libs - copy C:\msys64\mingw32\bin\Qt5Svg.dll %RS_DEPLOY%\ From c5472a2b2493723270014fdb0cdd6d4b63106dd3 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 28 Nov 2019 20:55:47 +0100 Subject: [PATCH 12/12] Appveyor remove abandoned libresapi libraries deploy --- appveyor.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b15fd0e71..d74e82c77 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -243,18 +243,6 @@ after_build: - copy C:\msys64\mingw32\bin\libwebpdemux*.dll %RS_DEPLOY%\ - copy C:\msys64\mingw32\bin\liblzma*.dll %RS_DEPLOY%\ -## Needed for libresapi http - - copy C:\msys64\mingw32\bin\libmicrohttpd*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libgnutls*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libgmp*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libhogweed*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libidn2*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libnettle*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libp11-kit*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libtasn1*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libunistring*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libffi*.dll %RS_DEPLOY%\ - ## Needed for cmark - copy C:\msys64\mingw32\bin\libcmark*.dll %RS_DEPLOY%\ - copy C:\msys64\mingw32\bin\libdouble-conversion*.dll %RS_DEPLOY%\