gtk3: Remove theme versioning support

Since there's only one supported version, there's no need for this.
This commit is contained in:
Joonas Henriksson 2021-12-08 23:33:23 +02:00
parent 52241a0b13
commit e5ab834eda
No known key found for this signature in database
GPG Key ID: FAEDBC4FB5AA3B17
17 changed files with 12 additions and 53 deletions

View File

@ -69,24 +69,22 @@ 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 3, 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 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 versions that will be built can be set manually with `cinnamon_version`, `gnome_shell_version`, `gtk3_version` and `gtk4_version` build options.
The versions that will be built can be set manually with `cinnamon_version`, `gnome_shell_version` and `gtk4_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` for detecting GTK 3 and GTK 4 versions
* GTK 3 package, or its development files for distributions that ship those separately (e.g. `libgtk-3-dev` for Debian based distros or `gtk3-devel` for RPM based distros), for detecting GTK 3 version
* GTK 4 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 3 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 3, 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 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.
## Build options
Arc-theme specific build options can be set or changed with `meson configure -Doption=value <build_directory>` e.g.
meson configure -Dthemes=gtk3,plank,xfwm -Dtransparency=false -Dgtk3_version=3.24 build/
meson configure -Dthemes=gtk4,plank,xfwm -Dtransparency=false -Dgtk4_version=4.2 build/
Option | Default value | Description
--- | --- | ---
@ -95,7 +93,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
`gtk3_version` | - | Build GTK 3 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

View File

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 242 KiB

View File

@ -1,46 +1,14 @@
# supported versions
gtk3_versions = ['3.24']
# glib-compile-resources dependency
glib_compile_resources = find_program('glib-compile-resources')
# determine gtk3 version
if get_option('gtk3_version') != ''
gtk3_full_ver = get_option('gtk3_version')
else
gtk3_dep = dependency(
'gtk+-3.0',
version: '>= 3.23.0',
not_found_message : 'Could not determine GTK 3 version'
)
gtk3_full_ver = gtk3_dep.version()
endif
gtk3_ver_array = gtk3_full_ver.split('.')
if gtk3_ver_array[1].to_int().is_even()
gtk3_ver = gtk3_ver_array[0] + '.' + gtk3_ver_array[1]
else
# evenize development versions
gtk3_ver = gtk3_ver_array[0] + '.' + (gtk3_ver_array[1].to_int() + 1).to_string()
endif
if gtk3_ver not in gtk3_versions
if gtk3_ver.version_compare('>' + gtk3_versions[-1])
warning('GTK 3 version ' + gtk3_ver + ' not supported yet, building theme for ' + gtk3_versions[-1])
gtk3_ver = gtk3_versions[-1]
else
error('Unsupported GTK 3 version')
endif
endif
# render PNG assets
gtk3_asset_names = run_command(
'cat', gtk3_ver / 'assets.txt',
'cat', 'assets.txt',
check : true
).stdout().split()
assets_svg = gtk3_ver / 'assets.svg'
assets_svg = 'assets.svg'
gtk3_assets = []
gtk3_hidpi_assets = []
@ -79,7 +47,7 @@ endforeach
# compile CSS
sass_path = meson.current_source_dir() / gtk3_ver / 'sass'
sass_path = meson.current_source_dir() / 'sass'
sass_depend_files = run_command(
'find',
sass_path,
@ -89,12 +57,12 @@ sass_depend_files = run_command(
# always compile the dark CSS
input_scss_dark = configure_file(
input: meson.current_source_dir() / gtk3_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() / gtk3_ver / 'sass',
'sass_path' : meson.current_source_dir() / 'sass',
}
)
output_css_dark = 'gtk-main-dark.css'
@ -112,12 +80,12 @@ foreach variant : get_option('variants')
if variant != 'dark'
input_scss = configure_file(
input: meson.current_source_dir() / gtk3_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() / gtk3_ver / 'sass',
'sass_path' : meson.current_source_dir() / 'sass',
}
)

View File

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