Merge pull request #1724 from G10h4ck/travis_mac_fix

Fix Continuous Integration
This commit is contained in:
G10h4ck 2019-11-28 22:29:57 +01:00 committed by GitHub
commit b8f2bee295
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 91 additions and 160 deletions

View File

@ -6,7 +6,7 @@ language: cpp
matrix:
include:
- os: linux
dist: trusty
dist: bionic
sudo: required
compiler: gcc
- os: osx
@ -16,21 +16,24 @@ 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
rapidjson-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 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 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
@ -49,13 +52,23 @@ 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/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 [ $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 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

View File

@ -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,10 +14,14 @@ 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 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

View File

@ -16,6 +16,8 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
################################################################################
CONFIG += c++11
!include("retroshare.pri"): error("Could not include file retroshare.pri")
TEMPLATE = subdirs
@ -29,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

View File

@ -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-sqlcipher mingw-w64-i686-libmicrohttpd 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
@ -138,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)
@ -146,15 +152,18 @@ before_package:
# to run your custom scripts instead of automatic MSBuild
build_script:
- env
- git submodule update --init
- qmake -Wall -spec win32-g++ "CONFIG=debug"
- qmake ../RetroShare -spec win32-g++ "CONFIG+=debug"
- mingw32-make -j3
# scripts to run after build
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%\
@ -234,24 +243,10 @@ 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%\
- find C:\projects\RetroShare >> filelist.txt
# to disable automatic builds
#build: off

0
build_scripts/OSX/travis_makeOSXPackage.sh Normal file → Executable file
View File

View File

@ -17,8 +17,6 @@
* *
*******************************************************************************/
#include "jsonapi.h"
#include <string>
#include <sstream>
#include <memory>
@ -26,6 +24,9 @@
#include <vector>
#include <openssl/crypto.h>
#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;
}

View File

@ -172,8 +172,6 @@ HEADERS += plugins/pluginmanager.h \
HEADERS += $$PUBLIC_HEADERS
SOURCES *= services/rsversion.cxx
################################# Linux ##########################################
linux-* {
CONFIG += link_pkgconfig

View File

@ -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;
};

View File

@ -80,34 +80,6 @@ constexpr auto RS_HUMAN_READABLE_VERSION =
RS_PRIVATE_STRINGIFY(RS_MINOR_VERSION) "." \
RS_PRIVATE_STRINGIFY(RS_MINI_VERSION) RS_EXTRA_VERSION;
#include <cstdint>
#include <string>
/**
* 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;
/* Because RetroShare-gui include this file in gui/images/retroshare_win.rc
* including any C++ things like `#include <string>` will break compilation of
* RetroShare-gui on Windows. Therefore this file must be kept minimal. */

View File

@ -32,12 +32,7 @@
#include <iomanip>
#include <string>
#include <typeinfo> // for typeid
#ifdef HAS_RAPIDJSON
#include <rapidjson/prettywriter.h>
#else
#include <rapid_json/prettywriter.h>
#endif // HAS_RAPIDJSON
static constexpr uint32_t MAX_SERIALIZED_CHUNK_SIZE = 10*1024*1024 ; // 10 MB.

View File

@ -1,35 +0,0 @@
/*******************************************************************************
* *
* libretroshare: retroshare core library *
* *
* Copyright (C) 2019 Gioacchino Mazzurco <gio@eigenlab.org> *
* *
* 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 <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#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;
}

View File

@ -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
}

View File

@ -19,19 +19,12 @@
* *
*******************************************************************************/
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/prettywriter.h>
#include "util/rsjson.h"
#ifdef HAS_RAPIDJSON
# include <rapidjson/writer.h>
# include <rapidjson/stringbuffer.h>
# include <rapidjson/prettywriter.h>
#else
# include <rapid_json/writer.h>
# include <rapid_json/stringbuffer.h>
# include <rapid_json/prettywriter.h>
#endif // HAS_RAPIDJSON
inline int getJsonManipulatorStatePosition()
{
static int p = std::ios_base::xalloc();

View File

@ -21,12 +21,7 @@
#pragma once
#include <iostream>
#ifdef HAS_RAPIDJSON
# include <rapidjson/document.h>
#else
# include <rapid_json/document.h>
#endif // HAS_RAPIDJSON
#include <rapidjson/document.h>
/**
* Use this type for JSON documents representations in RetroShare code

View File

@ -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
@ -479,11 +480,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 +703,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