misc: Create developers flatpak variant

Be able to use nightly while hacking
This commit is contained in:
Kévin Commaille 2022-04-13 19:36:36 +02:00 committed by Julian Sparber
parent 89b89024c9
commit b65188cdb6
6 changed files with 108 additions and 17 deletions

View File

@ -6,16 +6,23 @@ stages:
- deploy
variables:
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json"
FLATPAK_MODULE: "fractal"
APP_ID: "org.gnome.Fractal.Devel"
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
CI_IMAGE_X86_64: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master"
CI_IMAGE_AARCH64: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/aarch64:gnome-nightly"
.hack:
variables:
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Hack.json"
APP_ID: "org.gnome.Fractal.Hack"
.devel:
variables:
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json"
APP_ID: "org.gnome.Fractal.Devel"
.build_template:
script:
- rewrite-flatpak-manifest ${MANIFEST_PATH} ${FLATPAK_MODULE} ${CONFIG_OPTS}
- >
xvfb-run -a -s "-screen 0 1024x768x24"
flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
@ -76,6 +83,7 @@ checks:
# Lint the code
cargo-clippy:
extends: .hack
image: '${CI_IMAGE_X86_64}'
stage: check
tags:
@ -87,36 +95,44 @@ cargo-clippy:
# Build a debug version of the flatpak
# Except on main
flatpak:
extends: .build_x86_64
extends:
- .hack
- .build_x86_64
stage: test
variables:
BUNDLE: "fractal-devel.flatpak"
CONFIG_OPTS: "-Dprofile=development"
BUNDLE: "fractal-hack.flatpak"
except:
- main
# Build the nightly version of the flatpak
# Only on main
build-x86_64:
extends: .build_x86_64
extends:
- .devel
- .build_x86_64
stage: build
variables:
BUNDLE: "fractal-nightly-x86_64.flatpak"
CONFIG_OPTS: "-Dprofile=nightly"
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json"
APP_ID: "org.gnome.Fractal.Devel"
BUNDLE: "fractal-devel-x86_64.flatpak"
only:
- main
build-aarch64:
extends: .build_aarch64
extends:
- .devel
- .build_aarch64
stage: build
variables:
BUNDLE: "fractal-nightly-aarch64.flatpak"
CONFIG_OPTS: "-Dprofile=nightly"
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json"
APP_ID: "org.gnome.Fractal.Devel"
BUNDLE: "fractal-devel-aarch64.flatpak"
only:
- main
# Build the docs
# Only on main
pages:
extends: .devel
image: '${CI_IMAGE_X86_64}'
stage: doc
tags:

View File

@ -0,0 +1,65 @@
{
"app-id": "org.gnome.Fractal.Hack",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable",
"org.freedesktop.Sdk.Extension.llvm12"
],
"command": "fractal",
"finish-args": [
"--socket=fallback-x11",
"--socket=wayland",
"--socket=pulseaudio",
"--share=network",
"--share=ipc",
"--device=dri",
"--env=RUST_LOG=fractal=debug",
"--env=G_MESSAGES_DEBUG=none",
"--env=RUST_BACKTRACE=1"
],
"build-options": {
"append-ld-library-path": "/usr/lib/sdk/llvm12/lib",
"append-path": "/usr/lib/sdk/llvm12/bin:/usr/lib/sdk/rust-stable/bin",
"build-args": [
"--share=network"
],
"test-args": [
"--socket=x11",
"--share=network"
]
},
"modules": [
{
"name": "libshumate",
"buildsystem": "meson",
"config-opts": [
"-Dgir=false",
"-Dvapi=false",
"-Dgtk_doc=false"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/libshumate/",
"tag": "1.0.0.alpha.1"
}
]
},
{
"name": "fractal",
"buildsystem": "meson",
"run-tests": true,
"config-opts": [
"-Dprofile=hack"
],
"sources": [
{
"type": "dir",
"path": "../"
}
]
}
]
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -47,7 +47,16 @@ iconsdir = datadir / 'icons'
podir = meson.project_source_root() / 'po'
gettext_package = meson.project_name()
if get_option('profile') == 'development' or get_option('profile') == 'nightly'
if get_option('profile') == 'hack'
profile = 'Hack'
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
if vcs_tag == ''
version_suffix = '-hack'
else
version_suffix = '-@0@'.format(vcs_tag)
endif
application_id = '@0@.@1@'.format(base_id, profile)
elif get_option('profile') == 'development'
profile = 'Devel'
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
if vcs_tag == ''
@ -68,7 +77,7 @@ meson.add_dist_script(
meson.project_source_root()
)
if get_option('profile') == 'development'
if get_option('profile') == 'hack'
# Setup pre-commit hook for ensuring coding style is always consistent
message('Setting up git pre-commit hook..')
run_command('cp', '-f', 'hooks/pre-commit.hook', '.git/hooks/pre-commit')

View File

@ -4,8 +4,8 @@ option(
choices: [
'default',
'development',
'nightly',
'hack',
],
value: 'default',
description: 'The build profile for Fractal. One of "default" or "development".'
description: 'The build profile for Fractal. One of "default", "development" or "hack".'
)

View File

@ -21,7 +21,7 @@ run_command(
cargo_options = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ]
cargo_options += [ '--target-dir', meson.project_build_root() / 'src' ]
if get_option('profile') == 'default' or get_option('profile') == 'nightly'
if get_option('profile') == 'default' or get_option('profile') == 'development'
cargo_options += [ '--release' ]
rust_target = 'release'
message('Building in release mode')