From 68291d7abcd654cce3d0bffaf61803f6296cdc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 25 Nov 2023 15:22:22 +0100 Subject: [PATCH] build: Remove Hack manifest and profile Now that the stable release is on the same codebase, it should be less necessary to have 2 development builds. Also since most performance issues have been fixed, it should not be necessary anymore to build the nightly version in release mode. --- .gitattributes | 1 - .gitlab-ci.yml | 11 ++-- CONTRIBUTING.md | 14 ++--- build-aux/org.gnome.Fractal.Devel.json | 6 +++ build-aux/org.gnome.Fractal.Hack.json | 71 -------------------------- data/icons/meson.build | 9 +--- data/meson.build | 6 +-- meson.build | 45 ++++++---------- meson_options.txt | 3 +- src/application.rs | 7 +-- src/meson.build | 2 +- 11 files changed, 38 insertions(+), 137 deletions(-) delete mode 100644 build-aux/org.gnome.Fractal.Hack.json diff --git a/.gitattributes b/.gitattributes index 72ba3f88..ac65bedd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,4 @@ build-aux/org.gnome.Fractal.Devel.json export-ignore -build-aux/org.gnome.Fractal.Hack.json export-ignore build-aux/org.gnome.Fractal.json export-ignore .editorconfig export-ignore .gitattributes export-ignore diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b0a0ef9..2fda141c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,17 +6,12 @@ stages: variables: FLATPAK_MODULE: "fractal" + MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json" + APP_ID: "org.gnome.Fractal.Devel" workflow: rules: - - if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_TAG - variables: - MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json" - APP_ID: "org.gnome.Fractal.Devel" - - if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != "main" - variables: - MANIFEST_PATH: "build-aux/org.gnome.Fractal.Hack.json" - APP_ID: "org.gnome.Fractal.Hack" + - if: $CI_COMMIT_BRANCH || $CI_COMMIT_TAG include: - local: .gitlab-ci/run_checks.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dcead7e8..10f882ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,10 +51,6 @@ If you are building the flatpak manually you will also need flatpak-builder on y Using [GNOME Builder](https://wiki.gnome.org/Apps/Builder) with [flatpak](https://flatpak.org/) is the recommended way of building and installing Fractal. -By default, GNOME Builder should select the `org.gnome.Fractal.Devel.json` manifest, which is the -manifest used for building the nightly version. It is recommended to switch to the -`org.gnome.Fractal.Hack.json` manifest which will build much faster. - ### Flatpak via fenv As an alternative, [fenv](https://gitlab.gnome.org/ZanderBrown/fenv) allows to setup a flatpak @@ -79,10 +75,10 @@ After that, move into the directory where you cloned Fractal and setup the proje ```sh # Setup the flatpak environment -fenv gen build-aux/org.gnome.Fractal.Hack.json +fenv gen build-aux/org.gnome.Fractal.Devel.json # Initialize the build system -fenv exec -- meson setup -Dprofile=hack --prefix=/app _build +fenv exec -- meson setup -Dprofile=development --prefix=/app _build ``` Finally, build and run the application: @@ -110,13 +106,13 @@ GNOME Builder can export a flatpak of the app after it has been successfully bui Fractal can then be installed with: ```sh -flatpak install --user --bundle path/to/org.gnome.Fractal.Hack.flatpak +flatpak install --user --bundle path/to/org.gnome.Fractal.Devel.flatpak ``` Alternatively, it can be built and installed with flatpak-builder: ```sh -flatpak-builder --user --install app build-aux/org.gnome.Fractal.Hack.json +flatpak-builder --user --install app build-aux/org.gnome.Fractal.Devel.json ``` _Note that the `flatpak-builder` command can be replaced with `flatpak run org.flatpak.Builder`._ @@ -124,7 +120,7 @@ _Note that the `flatpak-builder` command can be replaced with `flatpak run org.f It can then be entirely removed from your system with: ```sh -flatpak remove --delete-data org.gnome.Fractal.Hack +flatpak remove --delete-data org.gnome.Fractal.Devel ``` ### GNU/Linux diff --git a/build-aux/org.gnome.Fractal.Devel.json b/build-aux/org.gnome.Fractal.Devel.json index 72fb84b0..caad282e 100644 --- a/build-aux/org.gnome.Fractal.Devel.json +++ b/build-aux/org.gnome.Fractal.Devel.json @@ -22,6 +22,12 @@ "build-options": { "append-ld-library-path": "/usr/lib/sdk/llvm16/lib", "append-path": "/usr/lib/sdk/llvm16/bin:/usr/lib/sdk/rust-stable/bin", + "env": { + "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER": "clang", + "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS": "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold --cfg=ruma_identifiers_storage=\"Arc\"", + "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER": "clang", + "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS": "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold --cfg=ruma_identifiers_storage=\"Arc\"" + }, "build-args": [ "--share=network" ], diff --git a/build-aux/org.gnome.Fractal.Hack.json b/build-aux/org.gnome.Fractal.Hack.json deleted file mode 100644 index a7f6a5dd..00000000 --- a/build-aux/org.gnome.Fractal.Hack.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "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.llvm16" - ], - "command": "fractal", - "finish-args": [ - "--socket=fallback-x11", - "--socket=wayland", - "--socket=pulseaudio", - "--share=network", - "--share=ipc", - "--device=dri", - "--env=RUST_LOG=fractal=debug,warn", - "--env=G_MESSAGES_DEBUG=none", - "--env=RUST_BACKTRACE=1" - ], - "build-options": { - "append-ld-library-path": "/usr/lib/sdk/llvm16/lib", - "append-path": "/usr/lib/sdk/llvm16/bin:/usr/lib/sdk/rust-stable/bin", - "env": { - "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER": "clang", - "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS": "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold --cfg=ruma_identifiers_storage=\"Arc\"", - "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER": "clang", - "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS": "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold --cfg=ruma_identifiers_storage=\"Arc\"" - }, - "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": "archive", - "url": "https://download.gnome.org/sources/libshumate/1.1/libshumate-1.1.0.tar.xz", - "sha256": "b3b7c4c2d3002f37b951c9ca99b09275d0aa82265c69f53374ce12faefd3b14e" - } - ] - }, - { - "name": "fractal", - "buildsystem": "meson", - "run-tests": true, - "config-opts": [ - "-Dprofile=hack" - ], - "sources": [ - { - "type": "dir", - "path": "../" - } - ] - } - ] -} diff --git a/data/icons/meson.build b/data/icons/meson.build index e744fc94..13b6eb97 100644 --- a/data/icons/meson.build +++ b/data/icons/meson.build @@ -1,13 +1,6 @@ -if is_release - icon_name = '@0@.svg'.format(base_id) -else - icon_name = '@0@.Devel.svg'.format(base_id) -endif - install_data( - icon_name, + '@0@.svg'.format(application_id), install_dir: iconsdir / 'hicolor' / 'scalable' / 'apps', - rename: '@0@.svg'.format(application_id) ) install_data( diff --git a/data/meson.build b/data/meson.build index 8bacac39..2e770d98 100644 --- a/data/meson.build +++ b/data/meson.build @@ -26,9 +26,7 @@ if desktop_file_validate.found() endif # Appdata -if is_release - development_release = '' -else +if profile == 'Devel' appstream_version = major_version if pre_release_version != '' appstream_version += '~' + pre_release_version @@ -41,6 +39,8 @@ else

Development release.

'''.format(appstream_version, release_date) +else + development_release = '' endif appdata_conf = configuration_data() appdata_conf.set('app-id', application_id) diff --git a/meson.build b/meson.build index 75308a23..ea713bc5 100644 --- a/meson.build +++ b/meson.build @@ -8,10 +8,17 @@ i18n = import('i18n') gnome = import('gnome') base_id = 'org.gnome.Fractal' +application_id = base_id major_version = '5' pre_release_version = '' +version = major_version +if pre_release_version != '' + version += '.' + pre_release_version +endif +full_version = version + dependency('glib-2.0', version: '>= 2.72') # update when changing gtk version dependency('gio-2.0', version: '>= 2.72') # always same version as glib dependency('gtk4', version: '>= 4.10.0') @@ -58,43 +65,23 @@ iconsdir = datadir / 'icons' podir = meson.project_source_root() / 'po' gettext_package = meson.project_name() -if get_option('profile') == 'hack' - is_release = false - profile = 'Hack' -elif get_option('profile') == 'development' - is_release = false +if get_option('profile') == 'development' profile = 'Devel' -elif get_option('profile') == 'beta' - is_release = true - profile = 'Beta' -else - is_release = true - profile = 'Stable' -endif -if is_release - devel_version = '' - release_date = '' # should be unused with released versions - application_id = base_id -else vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip() if vcs_tag == '' devel_version = profile.to_lower() else devel_version = vcs_tag endif - release_date = run_command('git', 'show', '-s', '--format=%cI').stdout().strip() - application_id = '@0@.@1@'.format(base_id, profile) -endif - -version = major_version -if pre_release_version != '' - version += '.' + pre_release_version -endif - -full_version = version -if devel_version != '' full_version += '-' + devel_version + + release_date = run_command('git', 'show', '-s', '--format=%cI').stdout().strip() + application_id += '.' + profile +elif get_option('profile') == 'beta' + profile = 'Beta' +else + profile = 'Stable' endif meson.add_dist_script( @@ -103,7 +90,7 @@ meson.add_dist_script( meson.project_source_root() ) -if profile == 'Hack' +if profile == 'Devel' # 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 12d03017..51d5089f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,8 +5,7 @@ option( 'default', 'beta', 'development', - 'hack', ], value: 'default', - description: 'The build profile for Fractal. One of "default", "beta", "development" or "hack".' + description: 'The build profile for Fractal. One of "default", "beta" or "development".' ) diff --git a/src/application.rs b/src/application.rs index 2bd7dbef..b9d23eca 100644 --- a/src/application.rs +++ b/src/application.rs @@ -202,10 +202,8 @@ pub enum AppProfile { Stable, /// A beta release. Beta, - /// A nightly release. - Devel, /// A development release. - Hack, + Devel, } impl AppProfile { @@ -215,13 +213,12 @@ impl AppProfile { Self::Stable => "stable", Self::Beta => "beta", Self::Devel => "devel", - Self::Hack => "hack", } } /// Whether this `AppProfile` should use the `.devel` CSS class on windows. pub fn should_use_devel_class(&self) -> bool { - matches!(self, Self::Devel | Self::Hack) + matches!(self, Self::Devel) } } diff --git a/src/meson.build b/src/meson.build index 43009a05..13b1ee0e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -30,7 +30,7 @@ run_command( cargo_options = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ] cargo_options += [ '--target-dir', meson.project_build_root() / 'src' ] -if profile == 'Hack' +if profile == 'Devel' rust_target = 'debug' message('Building in debug mode') else