summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-02-12 20:18:27 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2020-02-12 20:22:43 +0000
commit2ab9be54fb34c61eedbbb89b78ce9db23ba81e8a (patch)
tree67be4d07c490feaded55aced72e9e5ad8f3a3d7b
parent4247bf0fb64f5d9e65ac83f7cc48555c43e07cfd (diff)
downloadgtk+-2ab9be54fb34c61eedbbb89b78ce9db23ba81e8a.tar.gz
Rename the SCSS files for our themes
It seems that Meson's gnome.compile_resources() cannot deal with two files with the same name under different directories, which breaks the build parallelism because the GResource file ends up not depending on either the Adwaita or the HighContrast gtk-contained.css file. This commit only changes the on-disk names of the Adwaita and HighContrast SCSS files, and the corresponding generated CSS files; the files in the GResource are going to be aliased to the old file names, to minimise the breakage. We might want to change the theme entry points at some later date, if we decide to commit to this naming scheme. Fixes: #2423 See Meson bug: https://github.com/mesonbuild/meson/issues/6615
-rw-r--r--gtk/gen-gtk-gresources-xml.py8
-rw-r--r--gtk/meson.build25
-rw-r--r--gtk/theme/Adwaita/Adwaita-dark.scss (renamed from gtk/theme/Adwaita/gtk-contained-dark.scss)0
-rw-r--r--gtk/theme/Adwaita/Adwaita.scss (renamed from gtk/theme/Adwaita/gtk-contained.scss)0
-rw-r--r--gtk/theme/Adwaita/meson.build40
-rw-r--r--gtk/theme/HighContrast/HighContrast-inverse.scss (renamed from gtk/theme/HighContrast/gtk-contained-inverse.scss)0
-rw-r--r--gtk/theme/HighContrast/HighContrast.scss (renamed from gtk/theme/HighContrast/gtk-contained.scss)0
-rw-r--r--gtk/theme/HighContrast/meson.build40
8 files changed, 61 insertions, 52 deletions
diff --git a/gtk/gen-gtk-gresources-xml.py b/gtk/gen-gtk-gresources-xml.py
index 95bccf9268..9f3ea374ef 100644
--- a/gtk/gen-gtk-gresources-xml.py
+++ b/gtk/gen-gtk-gresources-xml.py
@@ -20,8 +20,8 @@ xml += '''
<file>theme/Empty/gtk.css</file>
<file>theme/Adwaita/gtk.css</file>
<file>theme/Adwaita/gtk-dark.css</file>
- <file>theme/Adwaita/gtk-contained.css</file>
- <file>theme/Adwaita/gtk-contained-dark.css</file>
+ <file alias='theme/Adwaita/gtk-contained.css'>theme/Adwaita/Adwaita.css</file>
+ <file alias='theme/Adwaita/gtk-contained-dark.css'>theme/Adwaita/Adwaita-dark.css</file>
'''
for f in get_files('theme/Adwaita/assets', '.png'):
@@ -35,8 +35,8 @@ for f in get_files('theme/Adwaita/assets', '.svg'):
xml += '''
<file>theme/HighContrast/gtk.css</file>
<file alias='theme/HighContrastInverse/gtk.css'>theme/HighContrast/gtk-inverse.css</file>
- <file>theme/HighContrast/gtk-contained.css</file>
- <file>theme/HighContrast/gtk-contained-inverse.css</file>
+ <file alias='theme/HighContrast/gtk-contained.css'>theme/HighContrast/HighContrast.css</file>
+ <file alias='theme/HighContrast/gtk-contained-inverse.css'>theme/HighContrast/HighContrast-inverse.css</file>
'''
for f in get_files('theme/HighContrast/assets', '.png'):
diff --git a/gtk/meson.build b/gtk/meson.build
index 295ed0af6d..4d2bed0ccf 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -751,7 +751,6 @@ gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml',
])
# Build the theme files
-theme_deps = []
sassc = find_program('sassc', required: false)
if not sassc.found()
subproject('sassc')
@@ -763,16 +762,22 @@ sassc_opts = [ '-a', '-M', '-t', 'compact' ]
subdir('theme/Adwaita')
subdir('theme/HighContrast')
+theme_deps = [
+ adwaita_theme_deps,
+ hc_theme_deps,
+]
+
gtkresources = gnome.compile_resources('gtkresources',
- gtk_gresources_xml,
- dependencies: theme_deps,
- source_dir: [
- # List in order of preference
- meson.current_build_dir(),
- meson.current_source_dir(),
- ],
- c_name: '_gtk',
- extra_args: '--manual-register')
+ gtk_gresources_xml,
+ dependencies: theme_deps,
+ source_dir: [
+ # List in order of preference
+ meson.current_build_dir(),
+ meson.current_source_dir(),
+ ],
+ c_name: '_gtk',
+ extra_args: '--manual-register',
+)
gtk_x11_sources = files([
'gtkapplication-x11.c',
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.scss b/gtk/theme/Adwaita/Adwaita-dark.scss
index 6e5753957b..6e5753957b 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.scss
+++ b/gtk/theme/Adwaita/Adwaita-dark.scss
diff --git a/gtk/theme/Adwaita/gtk-contained.scss b/gtk/theme/Adwaita/Adwaita.scss
index ee5e202856..ee5e202856 100644
--- a/gtk/theme/Adwaita/gtk-contained.scss
+++ b/gtk/theme/Adwaita/Adwaita.scss
diff --git a/gtk/theme/Adwaita/meson.build b/gtk/theme/Adwaita/meson.build
index 7a799f947d..c829c9126a 100644
--- a/gtk/theme/Adwaita/meson.build
+++ b/gtk/theme/Adwaita/meson.build
@@ -1,30 +1,32 @@
-scss_files = files([
+adwaita_scss_files = files([
'_colors-public.scss',
'_colors.scss',
'_common.scss',
'_drawing.scss',
])
-theme_variants = [
+adwaita_theme_variants = [
'dark',
]
-theme_deps += custom_target('Adwaita',
- input: 'gtk-contained.scss',
- output: 'gtk-contained.css',
- command: [
- sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
- ],
- depend_files: scss_files,
- build_by_default: true)
+adwaita_theme_deps = [
+ custom_target('Adwaita theme',
+ input: 'Adwaita.scss',
+ output: 'Adwaita.css',
+ command: [
+ sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
+ ],
+ depend_files: adwaita_scss_files,
+ ),
+]
-foreach variant: theme_variants
- theme_deps += custom_target('Adwaita-' + variant,
- input: 'gtk-contained-@0@.scss'.format(variant),
- output: 'gtk-contained-@0@.css'.format(variant),
- command: [
- sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
- ],
- depend_files: scss_files,
- build_by_default: true)
+foreach variant: adwaita_theme_variants
+ adwaita_theme_deps += custom_target('Adwaita theme variant: ' + variant,
+ input: 'Adwaita-@0@.scss'.format(variant),
+ output: 'Adwaita-@0@.css'.format(variant),
+ command: [
+ sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
+ ],
+ depend_files: adwaita_scss_files,
+ )
endforeach
diff --git a/gtk/theme/HighContrast/gtk-contained-inverse.scss b/gtk/theme/HighContrast/HighContrast-inverse.scss
index 6cc8033df1..6cc8033df1 100644
--- a/gtk/theme/HighContrast/gtk-contained-inverse.scss
+++ b/gtk/theme/HighContrast/HighContrast-inverse.scss
diff --git a/gtk/theme/HighContrast/gtk-contained.scss b/gtk/theme/HighContrast/HighContrast.scss
index 84fbdc5f50..84fbdc5f50 100644
--- a/gtk/theme/HighContrast/gtk-contained.scss
+++ b/gtk/theme/HighContrast/HighContrast.scss
diff --git a/gtk/theme/HighContrast/meson.build b/gtk/theme/HighContrast/meson.build
index f3230353ef..da81db45c5 100644
--- a/gtk/theme/HighContrast/meson.build
+++ b/gtk/theme/HighContrast/meson.build
@@ -1,29 +1,31 @@
-scss_files = files([
+hc_scss_files = files([
'_colors.scss',
'_common.scss',
'_drawing.scss',
])
-theme_variants = [
+hc_theme_variants = [
'inverse',
]
-theme_deps += custom_target('HighContrast',
- input: 'gtk-contained.scss',
- output: 'gtk-contained.css',
- command: [
- sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
- ],
- depend_files: scss_files,
- build_by_default: true)
+hc_theme_deps = [
+ custom_target('HighContrast theme',
+ input: 'HighContrast.scss',
+ output: 'HighContrast.css',
+ command: [
+ sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
+ ],
+ depend_files: hc_scss_files,
+ )
+]
-foreach variant: theme_variants
- theme_deps += custom_target('HighContrast-' + variant,
- input: 'gtk-contained-@0@.scss'.format(variant),
- output: 'gtk-contained-@0@.css'.format(variant),
- command: [
- sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
- ],
- depend_files: scss_files,
- build_by_default: true)
+foreach variant: hc_theme_variants
+ hc_theme_deps += custom_target('HighContrast theme variant: ' + variant,
+ input: 'HighContrast-@0@.scss'.format(variant),
+ output: 'HighContrast-@0@.css'.format(variant),
+ command: [
+ sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
+ ],
+ depend_files: hc_scss_files,
+ )
endforeach