gtk4: Remove theme versioning support

The changes for the GTK 4 theme seem to be backwards compatible, and
small enough to not require version specific theming (at least at
4.6). Based on comments from developers, this shouldn't change in the
future either. Drop the versioning support, and only ship single
theme, to simplify both maintenance and building.
This commit is contained in:
Joonas Henriksson 2022-02-08 04:05:07 +02:00
parent b18f4c1cca
commit f040255886
No known key found for this signature in database
GPG Key ID: FAEDBC4FB5AA3B17
12 changed files with 12 additions and 54 deletions

View File

@ -74,22 +74,21 @@ Some themes (at least GTK 2) aren't loaded from `~/.local/share/themes/`. You ca
## Versioned themes
The source code comes branched for different versions of GTK 4, GNOME Shell, and Cinnamon. Only one version of those themes will be built and installed, and using the wrong versions will likely result in visual issues.
The source code comes branched for different versions of GNOME Shell, and Cinnamon. Only one version of those themes will be built and installed, and using the wrong versions will likely result in visual issues.
The versions that will be built can be set manually with `cinnamon_version`, `gnome_shell_version` and `gtk4_version` build options.
The versions that will be built can be set manually with `cinnamon_version` and `gnome_shell_version` build options.
Otherwise the build system tries to determine correct versions using the following packages on the build environment:
* `gnome-shell` for detecting GNOME Shell version
* `cinnamon` for detecting Cinnamon version
* `pkgconf` and the `gtk4` package (or its development files for distributions that ship those separately, e.g. `libgtk-4-dev` for Debian based distros or `gtk4-devel` for RPM based distros), for detecting GTK 4 version
**Note:** The build setup for GTK 4, Cinnamon and GNOME Shell themes will fail, if their versions can't be determined either from the build options, or from installed packages.
**Note:** The build setup for Cinnamon and GNOME Shell themes will fail, if their versions can't be determined either from the build options, or from installed packages.
## Build options
Arc-theme specific build options can be set or changed with `meson configure -Doption=value <build_directory>` e.g.
meson configure -Dthemes=gtk4,plank,xfwm -Dtransparency=false -Dgtk4_version=4.2 build/
meson configure -Dthemes=cinnamon,plank,xfwm -Dtransparency=false -Dcinnamon_version=5.0 build/
Option | Default value | Description
--- | --- | ---
@ -98,7 +97,6 @@ Option | Default value | Description
`transparency` | `true` | Enable or disable transparency
`cinnamon_version` | - | Build Cinnamon theme for specific version
`gnome_shell_version` | - | Build GNOME Shell theme for specific version
`gtk4_version` | - | Build GTK 4 theme for specific version
`gnome_shell_gresource` | `false` | Compile GNOME Shell theme into a gresource file
## Uninstallation

View File

@ -1 +0,0 @@
4.2

View File

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 242 KiB

View File

@ -1,47 +1,15 @@
# supported versions
gtk4_versions = ['4.0', '4.2']
# determine gtk4 version
if get_option('gtk4_version') != ''
gtk4_full_ver = get_option('gtk4_version')
else
gtk4_dep = dependency(
'gtk4',
version: '>= 4.0',
not_found_message : 'Could not determine GTK 4 version'
)
gtk4_full_ver = gtk4_dep.version()
endif
gtk4_ver_array = gtk4_full_ver.split('.')
if gtk4_ver_array[1].to_int().is_even()
gtk4_ver = gtk4_ver_array[0] + '.' + gtk4_ver_array[1]
else
# evenize development versions
gtk4_ver = gtk4_ver_array[0] + '.' + (gtk4_ver_array[1].to_int() + 1).to_string()
endif
if gtk4_ver not in gtk4_versions
if gtk4_ver.version_compare('>' + gtk4_versions[-1])
warning('GTK 4 version ' + gtk4_ver + ' not supported yet, building theme for ' + gtk4_versions[-1])
gtk4_ver = gtk4_versions[-1]
else
error('Unsupported GTK 4 version')
endif
endif
# render PNG assets
gtk4_asset_names = run_command(
'cat', gtk4_ver / 'assets' / 'assets.txt',
'cat', 'assets' / 'assets.txt',
check : true
).stdout().split()
subdir(gtk4_ver / 'assets')
subdir('assets')
# compile CSS
sass_path = meson.current_source_dir() / gtk4_ver / 'sass'
sass_path = meson.current_source_dir() / 'sass'
sass_depend_files = run_command(
'find',
sass_path,
@ -51,12 +19,12 @@ sass_depend_files = run_command(
# always compile the dark CSS
input_scss_dark = configure_file(
input: meson.current_source_dir() / gtk4_ver / 'sass' / 'gtk.scss.in',
input: meson.current_source_dir() / 'sass' / 'gtk.scss.in',
output : 'gtk-dark.scss',
configuration : {
'variant' : 'dark',
'transparency' : get_option('transparency').to_string(),
'sass_path' : meson.current_source_dir() / gtk4_ver / 'sass',
'sass_path' : meson.current_source_dir() / 'sass',
}
)
@ -77,12 +45,12 @@ foreach variant : get_option('variants')
if variant != 'dark'
input_scss = configure_file(
input: meson.current_source_dir() / gtk4_ver / 'sass' / 'gtk.scss.in',
input: meson.current_source_dir() / 'sass' / 'gtk.scss.in',
output : 'gtk-' + variant + '.scss',
configuration : {
'variant' : variant,
'transparency' : get_option('transparency').to_string(),
'sass_path' : meson.current_source_dir() / gtk4_ver / 'sass',
'sass_path' : meson.current_source_dir() / 'sass',
}
)
@ -138,8 +106,7 @@ foreach variant : get_option('variants')
command : [
glib_compile_resources,
'--sourcedir=@OUTDIR@',
'--sourcedir=@OUTDIR@' / gtk4_ver,
'--sourcedir=@CURRENT_SOURCE_DIR@' / gtk4_ver,
'--sourcedir=@CURRENT_SOURCE_DIR@',
'--target=@OUTPUT@',
'@INPUT@'
],

View File

@ -31,12 +31,6 @@ option(
description: 'Build GNOME Shell theme for specific version',
)
option(
'gtk4_version',
type: 'string',
description: 'Build GTK 4 theme for specific version',
)
option(
'gnome_shell_gresource',
type: 'boolean',