Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Snap
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '10 12 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }}
AWS_DEFAULT_REGION: us-west-2

jobs:
docker_build:
name: snap-${{ matrix.type }}-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- type: x64
architecture: linux/amd64
snap_file: boinc_amd64.snap

steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y p7zip-full

- name: Running from origin repo
if: ${{ success() && env.AWS_ACCESS_KEY_ID != 0 && env.AWS_SECRET_ACCESS_KEY != 0 }}
run: |
echo "VCPKG_BINARY_SOURCES=clear;x-aws,s3://vcpkg.cache.boinc/,readwrite" >> $GITHUB_ENV

- name: Running from fork
if: ${{ success() && (env.AWS_ACCESS_KEY_ID == 0 || env.AWS_SECRET_ACCESS_KEY == 0) }}
run: |
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc/,read" >> $GITHUB_ENV

- name: Configure docker qemu
if: success()
uses: docker/setup-qemu-action@v2

- name: Build boinc snap
if: success()
run: |
docker run \
--rm \
--tty \
--privileged \
--volume $PWD:/root \
--workdir /root \
--platform "${{ matrix.architecture }}" \
--env VCPKG_BINARY_SOURCES=$VCPKG_BINARY_SOURCES \
--env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
--env AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
diddledani/snapcraft:core22 \
"snap run snapcraft --verbosity verbose pack --destructive-mode --output ${{ matrix.snap_file }}"

sudo chown $USER ${{ matrix.snap_file }}

- name: Install and test snap boinc inside docker
if: success()
run: |
docker run \
--rm \
--tty \
--privileged \
--volume $PWD:/root \
--workdir /root \
--platform "${{ matrix.architecture }}" \
diddledani/snapcraft:core22 \
"snap install --devmode ${{ matrix.snap_file }} && boinc --version && boinc.client --version"

- name: Install and test snap boinc x64
if: success() && matrix.type == 'x64'
run: |
sudo snap install --devmode ${{ matrix.snap_file }}
boinc --version
boinc.client --version

- name: Prepare logs on failure
if: ${{ failure() }}
run: |
sudo chown -R $USER parts/boinc/build/3rdParty/linux/vcpkg/buildtrees/
python ./deploy/prepare_deployment.py logs

- name: Upload logs on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: snap_logs_${{ matrix.type }}_${{ github.event.pull_request.head.sha }}
path: deploy/logs.7z

- name: Prepare artifacts for deploy
if: success()
run: python ./deploy/prepare_deployment.py linux_snap

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: success()
with:
name: linux_snap_${{ matrix.type }}_${{ github.event.pull_request.head.sha }}
path: deploy/linux_snap.7z
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,9 @@ boinc.html
boinc_client.html
boinccmd.html
switcher.html

# snap
parts/
prime/
stage/
*.snap
5 changes: 5 additions & 0 deletions 3rdParty/vcpkg_ports/triplets/ci/snap-linux-amd64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(VCPKG_BUILD_TYPE release)
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
10 changes: 8 additions & 2 deletions clientgui/SkinManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include "SkinManager.h"
#include "MainDocument.h"
#include "version.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <cstdlib>


////@begin XPM images
Expand Down Expand Up @@ -978,8 +981,11 @@ wxString CSkinManager::GetSkinsLocation() {
strSkinLocation += wxT("skins");
#elif defined(__WXGTK__)
strSkinLocation = wxGetApp().GetRootDirectory();
if (strSkinLocation.StartsWith("/usr/")) {
strSkinLocation += wxT("/../share/boinc-manager/skins");
wxString strLinuxSkinLocation = strSkinLocation + wxT("/../share/boinc-manager/skins");
struct stat info;
// check if folder exist
if (stat( strLinuxSkinLocation.mb_str(), &info ) == 0 && info.st_mode & S_IFDIR) {
strSkinLocation = strLinuxSkinLocation;
}
else {
strSkinLocation += wxT("/skins");
Expand Down
21 changes: 15 additions & 6 deletions deploy/prepare_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,19 @@
'client/boinc_client.wasm',
]

snap_list = [
'./boinc_*.snap',
]

logs_list = [
'config.log',
'3rdParty/wasm/vcpkg/buildtrees/*.log',
'3rdParty/linux/vcpkg/buildtrees/*.log',
'3rdParty/osx/vcpkg/buildtrees/*.log',
'3rdParty/android/vcpkg/buildtrees/*.log',
'3rdParty/mingw/vcpkg/buildtrees/*.log',
'3rdParty/Windows/vcpkg/buildtrees/*.log',
'3rdParty/wasm/vcpkg/buildtrees/*/*.log',
'3rdParty/linux/vcpkg/buildtrees/*/*.log',
'3rdParty/osx/vcpkg/buildtrees/*/*.log',
'3rdParty/android/vcpkg/buildtrees/*/*.log',
'3rdParty/mingw/vcpkg/buildtrees/*/*.log',
'3rdParty/Windows/vcpkg/buildtrees/*/*.log',
'parts/boinc/build/3rdParty/linux/vcpkg/buildtrees/*/*.log',
'android/BOINC/app/build/reports/',
'mac_build/xcodebuild_*.log',
]
Expand Down Expand Up @@ -289,6 +294,9 @@ def prepare_wasm_client(target_directory):
def prepare_wasm_client_debug(target_directory):
prepare_7z_archive('wasm_client-debug', target_directory, wasm_client_debug_folder_list)

def prepare_linux_snap(target_directory):
prepare_7z_archive('linux_snap', target_directory, snap_list)

def prepare_logs(target_directory):
prepare_7z_archive('logs', target_directory, logs_list)

Expand All @@ -312,6 +320,7 @@ def prepare_logs(target_directory):
'win_manager': prepare_win_manager,
'wasm_client': prepare_wasm_client,
'wasm_client-debug': prepare_wasm_client_debug,
'linux_snap': prepare_linux_snap,
'logs': prepare_logs,
}

Expand Down
10 changes: 8 additions & 2 deletions linux/update_vcpkg_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ if [ ! -d "linux" ]; then
exit 1
fi

TRIPLET="x64-linux"
if [ ! -z "$1" ]; then
TRIPLET="$1"
fi

echo TRIPLET=$TRIPLET

. $PWD/3rdParty/vcpkg_ports/vcpkg_link.sh
CACHE_DIR="$PWD/3rdParty/buildCache/linux"
BUILD_DIR="$PWD/3rdParty/linux"
VCPKG_PORTS="$PWD/3rdParty/vcpkg_ports"
VCPKG_ROOT="$BUILD_DIR/vcpkg"
Expand All @@ -19,4 +25,4 @@ fi

git -C $VCPKG_ROOT pull
$VCPKG_ROOT/bootstrap-vcpkg.sh
$VCPKG_ROOT/vcpkg install --x-manifest-root=3rdParty/vcpkg_ports/configs/manager/linux --x-install-root=$VCPKG_ROOT/installed/ --overlay-ports=$VCPKG_PORTS/ports --overlay-triplets=$VCPKG_PORTS/triplets/ci --triplet=x64-linux --clean-after-build
$VCPKG_ROOT/vcpkg install --x-manifest-root=3rdParty/vcpkg_ports/configs/manager/linux --x-install-root=$VCPKG_ROOT/installed/ --overlay-ports=$VCPKG_PORTS/ports --overlay-triplets=$VCPKG_PORTS/triplets/ci --triplet=$TRIPLET --clean-after-build
20 changes: 20 additions & 0 deletions set-client-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,24 @@ def set_installshield(version):
line = f' <row><td>ProductVersion</td><td>{version}</td><td/></row>\n'
f.write(line)

def set_snapcraft(version):
with open('snap/snapcraft.yaml','r') as f:
lines = f.readlines()
with open('snap/snapcraft.yaml','w') as f:
for line in lines:
if line.startswith('version:'):
line = f'version: "{version}"\n'
f.write(line)

def set_snap_boinc_desktop(version):
with open('snap/gui/boinc.desktop','r') as f:
lines = f.readlines()
with open('snap/gui/boinc.desktop','w') as f:
for line in lines:
if line.startswith('version='):
line = f'version="{version}"\n'
f.write(line)

if (len(sys.argv) != 2):
print('Usage: set-client-version.py VERSION')
exit(1)
Expand All @@ -122,6 +140,8 @@ def set_installshield(version):
set_version_log(version)
set_build_gradle(version)
set_installshield(version)
set_snapcraft(version)
set_snap_boinc_desktop(version)

if (os.name == 'posix' and sys.platform != 'darwin'):
print('Running autosetup...')
Expand Down
18 changes: 18 additions & 0 deletions snap/gui/boinc.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Desktop Entry]
Type=Application
Version=7.23.0
Exec=boinc.manager
Icon=${SNAP}/meta/gui/boinc.png
Categories=System;Monitor;GTK;
Keywords=computation;science;
Name=BOINC Manager
GenericName=BOINC monitor and control utility
GenericName[cs]=Monitorovací a ovládací nástroj pro BOINC
GenericName[de]=BOINC Überwachungs- und Kontrollprogramm
GenericName[pt]=Monitorização BOINC e utilitário de controlo
GenericName[pt_BR]=Utilitário de controle e monitoramento do BOINC
Comment=Configure or monitor a BOINC core client
Comment[cs]=Monitoruje a nastavuje klienta BOINC
Comment[de]=BOINC Basis Client konfigurieren oder überwachen
Comment[pt]=Configurar ou monitorizar o cliente básico do BOINC
Comment[pt_BR]=Configure ou monitore o cliente básico do BOINC
Binary file added snap/gui/boinc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 121 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: boinc
base: core22
version: "7.23.0"
summary: BOINC lets you help cutting-edge science research using your computer.
description: |
BOINC lets you help cutting-edge science research using your computer. The BOINC app, running on your computer, downloads scientific computing jobs and runs them invisibly in the background. It's easy and safe.
About 30 science projects use BOINC. They investigate diseases, study climate change, discover pulsars, and do many other types of scientific research.
The BOINC and Science United projects are located at the University of California, Berkeley and are supported by the National Science Foundation.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

apps:
boinc:
command: usr/bin/boinc --dir $HOME
plugs:
- network
- network-bind

client:
command: usr/bin/boinc --dir $HOME
plugs:
- network
- network-bind

manager:
command: usr/bin/boincmgr --datadir $HOME
plugs:
- network
- network-bind
extensions:
- gnome
slots:
- dbus-daemon
common-id: boinc.manager
environment:
XAUTHORITY: $SNAP_REAL_HOME/.Xauthority

slots:
dbus-daemon:
interface: dbus
bus: session
name: boinc.manager

parts:
boinc:
build-packages:
- libftgl-dev
- freeglut3-dev
- libnotify-dev
- libxmu-dev
- libxi-dev
- libfcgi-dev
- libxss-dev
- libxcb-util0-dev
- libxxf86vm-dev
- libxrender-dev
- libxrandr-dev
- libdbus-1-dev
- libxtst-dev
# vcpkg dependencies
- build-essential
- pkg-config
- tar
- curl
- zip
- unzip
- git
- bison
# awscli dependencies
- software-properties-common
build-snaps:
- cmake
stage-packages:
- freeglut3-dev
- libxss-dev
source: .
plugin: autotools
build-environment:
- CRYPTOGRAPHY_DONT_BUILD_RUST: "1"
- triplet: snap-linux-$SNAPCRAFT_TARGET_ARCH
- VCPKG_DIR: "$PWD/3rdParty/linux/vcpkg/installed/$triplet"
- _libcurl_pc: "$VCPKG_DIR/lib/pkgconfig/libcurl.pc"
- VCPKG_BINARY_SOURCES: "$VCPKG_BINARY_SOURCES"
- AWS_ACCESS_KEY_ID: "$AWS_ACCESS_KEY_ID"
- AWS_SECRET_ACCESS_KEY: "$AWS_SECRET_ACCESS_KEY"
- AWS_DEFAULT_REGION: "$AWS_DEFAULT_REGION"
- prefix: /usr
- PKG_CONFIG_PATH: $VCPKG_DIR/lib/pkgconfig/
autotools-configure-parameters:
- --prefix=$prefix
- --with-libcurl=$VCPKG_DIR
- --with-ssl=$VCPKG_DIR
- --with-wx-config=$VCPKG_DIR/tools/wxwidgets/wx-config
- --enable-client
- --enable-manager
- --disable-server
- GTK_LIBS="`pkg-config --libs gtk+-3.0`"
override-build: |
echo ARCH=$SNAPCRAFT_TARGET_ARCH

# cmake
export PATH=/snap/cmake/current/bin/:$PATH
cmake --version

# aws
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
sudo add-apt-repository ppa:lizthegrey/misc
DEBIAN_FRONTEND=noninteractive sudo apt install awscli -y
aws --version

# ninja
export PATH=$HOME/.local/bin:$PATH
pip install -U --user pip
pip install --user ninja
ninja --version

export CFLAGS=-w
export CMAKE_C_FLAGS=-w
linux/update_vcpkg_manager.sh $triplet
./_autosetup
snapcraftctl build