Skip to content

Commit

Permalink
Merge branch 'master' into travis_osx_build_clean
Browse files Browse the repository at this point in the history
Retained Travis changes for Linux that happened in the meantime.

Conflicts:
	.travis.yml
  • Loading branch information
ChristianBeer committed Aug 10, 2017
2 parents c84d1d1 + fd68b1c commit 2733339
Show file tree
Hide file tree
Showing 1,173 changed files with 101,529 additions and 13,570 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@
/win_build/installerv2/redist/Windows/src/boinccas/*.filters
/win_build/installerv2/redist/Windows/src/boinccas/boinccas.sdf

# Android (Studio, build scripts, artefacts, redundancies)
/android/**/*.iml
/android/**/.gradle
/android/**/local.properties
/android/**/.idea
/android/**/build
/android/**/captures
/android/**/.externalNativeBuild
/stage
/android/BOINC/app/src/main/assets/arm*
/android/BOINC/app/src/main/assets/mips*
/android/BOINC/app/src/main/assets/x86*
/android/BOINC/app/src/main/assets/all_projects_list.xml
/android/BOINC/app/src/main/assets/ca-bundle.crt

## files created by _autosetup (autoreconf):
*.in
*.in~
Expand Down Expand Up @@ -90,6 +105,11 @@ drupal/sites/default/project
## translation system
locale/*/*.flag

## dependency builds and CI cache directories
3rdParty/linux/
3rdParty/mac/
3rdParty/buildCache/

.libs/
svn_version.h

Expand Down Expand Up @@ -168,3 +188,6 @@ vda/ssim
vda/vda
vda/vdad
/win_build/*.sdf

# OS-specific files
.DS_Store
34 changes: 8 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ branches:
# on_success: always
# on_failure: always

# This switches to the container-based infrastructure and allows caching
sudo: false
# Use Trusty image and enable sudo to install apt dependencies
dist: trusty
sudo: required

cache:
apt: true
directories:
- 3rdParty/buildCache

Expand All @@ -35,28 +35,6 @@ addons:
build_command_prepend: "./configure --enable-apps"
build_command: "make -j 4"
branch_pattern: coverity_scan
apt_packages:
- freeglut3-dev
- libxmu-dev
- libxi-dev
#- python-mysqldb
- libfcgi-dev
#- libcurl4-openssl-dev
- libxss-dev
- libnotify-dev
- libxcb-util0-dev
- libsqlite3-dev
- libgtk2.0-dev
- libwebkitgtk-dev
- mingw-w64
- binutils-mingw-w64-i686
- binutils-mingw-w64-x86-64
- gcc-mingw-w64
- gcc-mingw-w64-i686
- gcc-mingw-w64-x86-64
- g++-mingw-w64
- g++-mingw-w64-i686
- g++-mingw-w64-x86-64

env:
global:
Expand Down Expand Up @@ -90,6 +68,10 @@ matrix:
- os: osx
env: BOINC_TYPE=apps-mingw

before_install:
- sudo apt-get -qq update
- sudo apt-get install freeglut3-dev libxmu-dev libxi-dev libfcgi-dev libxss-dev libnotify-dev libxcb-util0-dev libsqlite3-dev libgtk2.0-dev libwebkitgtk-dev mingw-w64 binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64

before_script:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then ( ./_autosetup ) fi

Expand All @@ -98,7 +80,7 @@ script:
- if [[ "${BOINC_TYPE}" == "server" ]]; then ( ./configure --disable-client --disable-manager && make ) fi
- if [[ "${BOINC_TYPE}" == "client" ]]; then ( ./configure --disable-server --disable-manager && make ) fi
- if [[ "${BOINC_TYPE}" == "apps" ]]; then ( ./configure --enable-apps --disable-server --disable-client --disable-manager && make ) fi
- if [[ "${BOINC_TYPE}" == "manager" && "${TRAVIS_OS_NAME}" == "linux" ]]; then ( ./build/getWxWidgets.sh && ./configure --disable-server --disable-client --with-wxdir=./build/wxWidgets-3.0.2/buildgtk && make ) fi
- if [[ "${BOINC_TYPE}" == "manager" && "${TRAVIS_OS_NAME}" == "linux" ]]; then ( ./3rdParty/buildLinuxDependencies.sh && ./configure --disable-server --disable-client --with-wx-prefix=${TRAVIS_BUILD_DIR}/3rdParty/buildCache/linux && make ) fi
- if [[ "${BOINC_TYPE}" == "manager" && "${TRAVIS_OS_NAME}" == "osx" ]]; then ( ./3rdParty/buildMacDependencies.sh && ./mac_build/buildMacBOINC-CI.sh --no_shared_headers ) fi
- if [[ "${BOINC_TYPE}" == "libs-mingw" ]]; then ( cd lib && MINGW=x86_64-w64-mingw32 make -f Makefile.mingw ) fi
- if [[ "${BOINC_TYPE}" == "apps-mingw" ]]; then ( cd lib && MINGW=x86_64-w64-mingw32 make -f Makefile.mingw wrapper ) fi
12 changes: 12 additions & 0 deletions 3rdParty/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Purpose of 3rdParty

This directory is used to download and build dependencies for BOINC components.
Archives should be downloaded into a platform specific subdirectory (e.g linux, mac, ...)
to allow cross compilation of several platforms on a single host.

Build products of dependencies should be installed into a corresponding subdirectory of
3rdParty/buildCache to allow CI systems to cache this data between BOINC builds.

See the existing [buildLinuxDependencies.sh](buildLinuxDependencies.sh) and
[buildMacDependencies.sh](buildMacDependencies.sh) scripts for how this is done
on Linux and Mac currently.
137 changes: 137 additions & 0 deletions 3rdParty/buildLinuxDependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#!/bin/bash

# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2017 University of California
#
# BOINC 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.
#
# BOINC 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 BOINC. If not, see <http://www.gnu.org/licenses/>.
#

## support script to build a specific wxWidgets version for linux
## This script checks if a cached version is available and builts one if not.
## The build is done in 3rdParty/linux and usable files are installed to 3rdParty/buildCache/linux
## in order to keep the cache as small as possible
## The 3rdParty/buildCache directory can be cached by CI systems for all subsequent builds

# checks if a given path is canonical (absolute and does not contain relative links)
# from http://unix.stackexchange.com/a/256437
isPathCanonical() {
case "x$1" in
(x*/..|x*/../*|x../*|x*/.|x*/./*|x./*)
rc=1
;;
(x/*)
rc=0
;;
(*)
rc=1
;;
esac
return $rc
}

# check working directory because the script needs to be called like: ./3rdParty/buildLinuxDependencies.sh
if [ ! -d "3rdParty" ]; then
echo "start this script in the source root directory"
exit 1
fi

ROOTDIR=$(pwd)
cache_dir=""
doclean=""
wxoption=""
build_config="Release"
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--cache_dir)
cache_dir="$2"
shift
;;
--clean)
doclean="yes"
;;
--debug)
wxoption="--debug"
build_config="Debug"
;;
*)
echo "unrecognized option $key"
;;
esac
shift # past argument or value
done

if [ "x$cache_dir" != "x" ]; then
if isPathCanonical "$cache_dir" && [ "$cache_dir" != "/" ]; then
PREFIX="$cache_dir"
else
echo "cache_dir must be an absolute path without ./ or ../ in it"
exit 1
fi
else
PREFIX="$(pwd)/3rdParty/buildCache/linux"
fi

if [ -f "${PREFIX}/build-config" ]; then
cur_config=$(<${PREFIX}/build-config)
if [ "${cur_config}" != "${build_config}" ]; then
doclean="yes"
wxoption="${wxoption} --clean"
fi
else
doclean="yes"
wxoption="${wxoption} --clean"
fi

download_and_build() {
cd "${ROOTDIR}/3rdParty/linux" || exit 1
DIRNAME="${1}"
FILENAME="${2}"
DLURL="${3}"
BUILDSCRIPT="${4}"
FLAGFILE="${PREFIX}/${DIRNAME}_done"
if [ -e "${FLAGFILE}" ]; then
echo "${DIRNAME} seems already to be present in ${PREFIX}"
return 0
fi
if [ ! -d ${DIRNAME} ]; then
if [ ! -e ${FILENAME} ]; then
wget ${DLURL}
fi
tar -xf ${FILENAME}
fi
cd ${DIRNAME} || exit 1
source ${BUILDSCRIPT} --prefix ${PREFIX}
if [ $? -ne 0 ]; then exit 1; fi
cd ../.. || exit 1
touch ${FLAGFILE}
}

mkdir -p 3rdParty/linux
mkdir -p ${PREFIX}
cd "${ROOTDIR}/3rdParty/linux" || exit 1

if [ "${doclean}" = "yes" ]; then
echo "cleaning cache"
rm -rf ${PREFIX}
mkdir -p ${PREFIX}
echo ${build_config} >${PREFIX}/build-config
fi

#download_and_build $DIRNAME $FILENAME $DOWNLOADURL $BUILDSCRIPT
download_and_build "wxWidgets-3.0.2" "wxWidgets-3.0.2.tar.bz2" "https://sourceforge.net/projects/wxwindows/files/3.0.2/wxWidgets-3.0.2.tar.bz2" "${ROOTDIR}/3rdParty/buildWxLinux.sh ${wxoption}"

# change back to root directory
cd ${ROOTDIR} || exit 1
101 changes: 101 additions & 0 deletions 3rdParty/buildWxLinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash

# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2017 University of California
#
# BOINC 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.
#
# BOINC 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 BOINC. If not, see <http://www.gnu.org/licenses/>.

# Script to build a wxWidgets GTK version for BOINC

# Usage:
# cd [path]/wxWidgets-3.0.2/
# source path_to_this_script [--clean] [--debug] [--prefix PATH]
#
# the --clean argument will force a full rebuild.
# the --debug argument will build the debug version of the library
# if --prefix is given as absolute path the library is installed into there

# Patch wxwidgets to work with GCC6
# from https://github.com/wxWidgets/wxWidgets/commit/73e9e18ea09ffffcaac50237def0d9728a213c02
if [ ! -f src/stc/scintilla/src/Editor.cxx.orig ]; then
cat >> /tmp/Editor.cxx.patch << ENDOFFILE
--- Editor.cxx 2014-10-06 23:33:44.000000000 +0200
+++ Editor_patched.cxx 2017-03-20 10:24:14.776685161 +0100
@@ -11,6 +11,7 @@
#include <ctype.h>
#include <assert.h>
+#include <cmath>
#include <string>
#include <vector>
#include <map>
@@ -5841,9 +5842,9 @@
}
static bool Close(Point pt1, Point pt2) {
- if (abs(pt1.x - pt2.x) > 3)
+ if (std::abs(pt1.x - pt2.x) > 3)
return false;
- if (abs(pt1.y - pt2.y) > 3)
+ if (std::abs(pt1.y - pt2.y) > 3)
return false;
return true;
}
ENDOFFILE
patch -blfu src/stc/scintilla/src/Editor.cxx /tmp/Editor.cxx.patch
rm -f /tmp/Editor.cxx.patch
else
echo "src/stc/scintilla/src/Editor.cxx already patched"
fi

doclean=""
debug_flag="--disable-debug_flag"
lprefix=""
cmdline_prefix=""
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-clean|--clean)
doclean="yes"
;;
-debug|--debug)
debug_flag="--enable-debug"
;;
-prefix|--prefix)
lprefix="$2"
cmdline_prefix="--prefix=${lprefix}"
shift
;;
esac
shift # past argument or value
done

if [ -d buildgtk ] && [ "${doclean}" = "yes" ]; then
rm -rf buildgtk
fi
mkdir -p buildgtk
cd buildgtk || return 1

../configure "${cmdline_prefix}" --with-gtk --disable-shared --enable-webview --disable-gtktest --disable-sdltest ${debug_flag}
if [ $? -ne 0 ]; then cd ..; return 1; fi
make 1>/dev/null # the wxWidgets build is very noisy so tune it down to warnings and errors only
if [ $? -ne 0 ]; then cd ..; return 1; fi
if [ "x${lprefix}" != "x" ]; then
make install
if [ $? -ne 0 ]; then cd ..; return 1; fi
fi

cd ..
return 0
13 changes: 0 additions & 13 deletions android/BOINC/.gitignore

This file was deleted.

Loading

0 comments on commit 2733339

Please sign in to comment.