[gnome-shell] build: Make sassc mandatory and always generate CSS files from Sass sources



commit c62e7a6a82fd94a3e66c8ebf02e112b45431eb9d
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Wed Feb 7 12:31:50 2018 +0000

    build: Make sassc mandatory and always generate CSS files from Sass sources
    
    The previous implementation of the CSS generation logic considered sassc
    an optional dependency and made sure for that reason that the result CSS
    files ended up in the source directory, so that they could be checked
    in and kept in sync with the source sass files.
    
    As we are making sassc a required dependency, we can now stop doing that
    extra work and simply rely on the CSS files being automatically generated
    each time the sass sources change. By doing this, we can now effectively
    get rid of the CSS files checked in the repo as well as of the parse_sass.sh
    script, since the CSS files will now live on the build directory only.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792822

 data/theme/README                        |   11 +-
 data/theme/gnome-shell-high-contrast.css | 1902 ------------------------------
 data/theme/gnome-shell.css               | 1891 -----------------------------
 data/theme/meson.build                   |   22 +-
 data/theme/parse-sass.sh                 |   10 -
 meson.build                              |    2 +-
 6 files changed, 19 insertions(+), 3819 deletions(-)
---
diff --git a/data/theme/README b/data/theme/README
index e8a584517..688892dba 100644
--- a/data/theme/README
+++ b/data/theme/README
@@ -1,12 +1,9 @@
 Summary
 -------
 
-* Do not edit the CSS directly, edit the source SCSS files and process them with SASS (running
-  `make` should do that when you have the required software installed, as described below;
-  run `./parse-sass.sh` manually if it doesn't)
-* Most SASS preprocessors should produce similar results, however the build system
-  integration and 'parse-sass.sh' script use sassc. You should be able to install
-  it with `pkcon install sassc` or your distribution's package manager.
+* Do not edit the CSS directly, edit the source SCSS files and the CSS files will be generated
+  automatically when building with meson + ninja and left inside the build directory to be
+  incorporated into the gresource XML (you'll need to have sassc installed).
 
 How to tweak the theme
 ----------------------
@@ -31,4 +28,4 @@ _common.scss        - actual definitions of style for each widget. This is where
                       your changes.
                       
 You can read about SASS at http://sass-lang.com/documentation/. Once you make your changes to the
-_common.scss file, you can either run make or the ./parse-sass.sh script.
+_common.scss file, you can run ninja to generate the final CSS files.
diff --git a/data/theme/meson.build b/data/theme/meson.build
index ee64e7c42..cf941ef27 100644
--- a/data/theme/meson.build
+++ b/data/theme/meson.build
@@ -7,15 +7,21 @@ theme_sources = files([
   'gnome-shell-sass/_high-contrast-colors.scss'
 ])
 
+styles = [
+  'gnome-shell-high-contrast',
+  'gnome-shell'
+]
+
 theme_deps = []
 
 if sassc.found()
-  parse_sass = files('parse-sass.sh')
-
-  theme_deps += custom_target('update-theme',
-    output: 'theme-update.stamp',
-    depend_files: theme_sources,
-    command: [parse_sass, '@OUTPUT@'],
-    build_by_default: true
-  )
+  foreach style: styles
+    theme_deps += custom_target('style-' + style,
+                                input: '@0@.scss'.format(style),
+                                output: '@0@.css'.format(style),
+                                command: [
+                                  sassc, '-a', '@INPUT@', '@OUTPUT@'
+                                ],
+                                depend_files: theme_sources)
+  endforeach
 endif
diff --git a/meson.build b/meson.build
index 9822de892..895246e61 100644
--- a/meson.build
+++ b/meson.build
@@ -138,7 +138,7 @@ endif
 
 mutter_typelibdir = mutter_dep.get_pkgconfig_variable('typelibdir')
 python = find_program('python3')
-sassc = find_program('sassc', required: false)
+sassc = find_program('sassc', required: true)
 
 cc = meson.get_compiler('c')
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]