[fractal] misc: Create developers flatpak variant
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] misc: Create developers flatpak variant
- Date: Wed, 20 Apr 2022 08:31:49 +0000 (UTC)
commit b65188cdb67a13e8d7b4b80050786df53ae0e42d
Author: Kévin Commaille <zecakeh tedomum fr>
Date: Wed Apr 13 19:36:36 2022 +0200
misc: Create developers flatpak variant
Be able to use nightly while hacking
.gitlab-ci.yml | 40 ++++++++++++++-------
build-aux/org.gnome.Fractal.Hack.json | 65 +++++++++++++++++++++++++++++++++++
data/icons/org.gnome.Fractal.Hack.svg | 1 +
meson.build | 13 +++++--
meson_options.txt | 4 +--
src/meson.build | 2 +-
6 files changed, 108 insertions(+), 17 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ee095c4f8..f2d68e94e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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:
diff --git a/build-aux/org.gnome.Fractal.Hack.json b/build-aux/org.gnome.Fractal.Hack.json
new file mode 100644
index 000000000..02d1d28e0
--- /dev/null
+++ b/build-aux/org.gnome.Fractal.Hack.json
@@ -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": "../"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/data/icons/org.gnome.Fractal.Hack.svg b/data/icons/org.gnome.Fractal.Hack.svg
new file mode 100644
index 000000000..cd7493985
--- /dev/null
+++ b/data/icons/org.gnome.Fractal.Hack.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128"
height="128"><defs><linearGradient id="m" gradientUnits="userSpaceOnUse" x1="8.005" y1="252" x2="120.005"
y2="252" gradientTransform="translate(0 -172)"><stop offset="0" stop-color="#53bde0"/><stop offset=".036"
stop-color="#b4e2f1"/><stop offset=".07" stop-color="#53bde0"/><stop offset=".215"
stop-color="#24a0c9"/><stop offset=".25" stop-color="#4ab4d7"/><stop offset=".25" stop-color="#2589a9"/><stop
offset=".357" stop-color="#40b6dd"/><stop offset=".357" stop-color="#239bc3"/><stop offset=".913"
stop-color="#53bde0"/><stop offset=".954" stop-color="#8ed4eb"/><stop offset="1"
stop-color="#53bde0"/></linearGradient><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="8.005"
y1="252" x2="120.005" y2="252" gradientTransform="translate(0 -172)"><stop offset="0"
stop-color="#53bde0"/><stop offset=".036" stop-color="#b4e2f1"/><stop offset=".07"
stop-color="#53bde0"/><stop offset=".215" sto
p-color="#24a0c9"/><stop offset=".25" stop-color="#4ab4d7"/><stop offset=".25" stop-color="#2589a9"/><stop
offset=".357" stop-color="#40b6dd"/><stop offset=".357" stop-color="#239bc3"/><stop offset=".913"
stop-color="#53bde0"/><stop offset=".954" stop-color="#8ed4eb"/><stop offset="1"
stop-color="#53bde0"/></linearGradient><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="87" y1="267"
x2="119.505" y2="267" gradientTransform="translate(0 -172)"><stop offset="0" stop-color="#1a5fb4"/><stop
offset=".75" stop-color="#1a5fb4"/><stop offset=".888" stop-color="#3e88e3"/><stop offset="1"
stop-color="#1a5fb4"/></linearGradient><linearGradient id="n" gradientUnits="userSpaceOnUse" x1="87" y1="267"
x2="119.505" y2="267" gradientTransform="translate(0 -172)"><stop offset="0" stop-color="#1a5fb4"/><stop
offset=".75" stop-color="#1a5fb4"/><stop offset=".888" stop-color="#3e88e3"/><stop offset="1"
stop-color="#1a5fb4"/></linearGradient><linearGradient id="i" gradientUnits="userSpaceOnUse"
x1="300" y1="235" x2="428" y2="235" gradientTransform="matrix(0 .37 -.98462 0 295.385 -30.36)"><stop
offset="0" stop-color="#f9f06b"/><stop offset="1" stop-color="#f5c211"/></linearGradient><clipPath
id="a"><path d="M0 0h128v128H0z"/></clipPath><clipPath id="d"><path d="M0 0h128v128H0z"/></clipPath><clipPath
id="j"><path d="M0 0h128v128H0z"/></clipPath><clipPath id="h"><path d="M0 0h128v128H0z"/></clipPath><g id="k"
clip-path="url(#h)"><path d="M128 80.64V128H0V80.64zm0 0" fill="url(#i)"/><path d="M13.309 80.64L60.664
128H81.88l-47.36-47.36zm42.421 0L103.094 128h21.215L76.945 80.64zm42.43 0L128 110.48V89.27l-8.629-8.63zM0
88.548v21.215L18.238 128h21.215zm0 0"/></g><g id="f" clip-path="url(#a)"><path d="M32.004 36h80a8 8 0 018
8v64a8 8 0 01-8 8h-80a8 8 0 01-8-8V44a8 8 0 018-8zm0 0" fill="#1a5fb4"/><path d="M16.004 28c-4.43 0-8 3.566-8
8v72c0 4.434 3.57 8 8 8h16L32 128h4l12.004-12h64c4.433 0 8-3.566 8-8V36c0-4.434-3.567-8-8-8zm0 0"
fill="url(#b)"/><path d="M86.156 32v84h25.848c4.433 0
8-3.566 8-8V40c0-4.434-3.567-8-8-8zm0 0" fill="url(#c)"/><path d="M16.5 27.934h95.504a8 8 0 018 8V104a8 8 0
01-8 8H16.5a8 8 0 01-8-8V35.934a8 8 0 018-8zm0 0" fill="#3584e4"/><path d="M32.004 104L32 124h4l20.004-20zm0
0" fill-rule="evenodd" fill="#81dffe"/><path d="M16.004 28c-4.43 0-8 3.566-8 8v68c0 4.434 3.57 8 8
8h70.14a119.205 119.205 0 004.637-3.656c14.598-12.696 19.04-36.121
5.504-51.262-9.258-10.352-26.187-13.46-36.969-3.55-7.175 6.593-9.3 18.53-2.191 26 4.586 4.812 12.8 6.214
17.832 1.245 3.125-3.093 4.02-8.57.637-11.836-2.012-1.941-5.543-2.484-7.582-.257-1.164 1.254-1.473 3.433-.07
4.636.75.64 2.027.805
2.699-.039.332-.418.421-1.12-.067-1.465-.222-.148-.578-.18-.73.07-.043.098-.051.266.062.325.043.02.13.023.13-.023v-.04c-.067-.011
0-.03
0-.035.038-.02.105.032.105.07.035.126-.086.235-.2.262-.293.067-.492-.21-.562-.468-.098-.579.457-1.024.984-1.086
1.07-.125 1.864.898 1.934 1.875.144 1.847-1.617 3.168-3.32 3.242-3.016.133-5.11-2.742-5.176-5.54-.082-4.698
4.426-7.945 8.824-7.9
17 7.078.039 11.895 6.836 11.73 13.48-.257 10.305-10.21 17.242-19.949
16.836-14.636-.61-24.41-14.77-23.625-28.633 0-18.808 18.934-35.105 37.11-36.234zm0 0" fill="#81dffe"/></g><g
id="o" clip-path="url(#j)"><use xlink:href="#k" mask="url(#l)"/></g><g id="g" clip-path="url(#d)"
filter="url(#e)"><use xlink:href="#f"/></g><mask id="l"><g filter="url(#e)"><path fill-opacity=".8" d="M0
0h128v128H0z"/></g></mask><mask id="p"><use xlink:href="#g"/></mask><filter id="e"
filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"><feColorMatrix in="SourceGraphic"
values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/></filter></defs><path d="M32.004 36h80a8 8 0 018 8v64a8 8 0
01-8 8h-80a8 8 0 01-8-8V44a8 8 0 018-8zm0 0" fill="#1a5fb4"/><path d="M16.004 28c-4.43 0-8 3.566-8 8v72c0
4.434 3.57 8 8 8h16L32 128h4l12.004-12h64c4.433 0 8-3.566 8-8V36c0-4.434-3.567-8-8-8zm0 0"
fill="url(#m)"/><path d="M86.156 32v84h25.848c4.433 0 8-3.566 8-8V40c0-4.434-3.567-8-8-8zm0 0"
fill="url(#n)"/><path
d="M16.5 27.934h95.504a8 8 0 018 8V104a8 8 0 01-8 8H16.5a8 8 0 01-8-8V35.934a8 8 0 018-8zm0 0"
fill="#3584e4"/><path d="M32.004 104L32 124h4l20.004-20zm0 0" fill-rule="evenodd" fill="#81dffe"/><path
d="M16.004 28c-4.43 0-8 3.566-8 8v68c0 4.434 3.57 8 8 8h70.14a119.205 119.205 0 004.637-3.656c14.598-12.696
19.04-36.121 5.504-51.262-9.258-10.352-26.187-13.46-36.969-3.55-7.175 6.593-9.3 18.53-2.191 26 4.586 4.812
12.8 6.214 17.832 1.245 3.125-3.093 4.02-8.57.637-11.836-2.012-1.941-5.543-2.484-7.582-.257-1.164 1.254-1.473
3.433-.07 4.636.75.64 2.027.805
2.699-.039.332-.418.421-1.12-.067-1.465-.222-.148-.578-.18-.73.07-.043.098-.051.266.062.325.043.02.13.023.13-.023v-.04c-.067-.011
0-.03
0-.035.038-.02.105.032.105.07.035.126-.086.235-.2.262-.293.067-.492-.21-.562-.468-.098-.579.457-1.024.984-1.086
1.07-.125 1.864.898 1.934 1.875.144 1.847-1.617 3.168-3.32 3.242-3.016.133-5.11-2.742-5.176-5.54-.082-4.698
4.426-7.945 8.824-7.917 7.078.039 11.895 6.836 11.73 13.48-.257 10.305-10.21 17.242-1
9.949 16.836-14.636-.61-24.41-14.77-23.625-28.633 0-18.808 18.934-35.105 37.11-36.234zm0 0"
fill="#81dffe"/><use xlink:href="#o" mask="url(#p)"/></svg>
\ No newline at end of file
diff --git a/meson.build b/meson.build
index 7bb26abba..ed7ed47a6 100644
--- a/meson.build
+++ b/meson.build
@@ -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')
diff --git a/meson_options.txt b/meson_options.txt
index bcc926731..d539538d4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -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".'
)
diff --git a/src/meson.build b/src/meson.build
index a95b49464..a8e9092b6 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -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')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]