[gtk: 1/2] build: require sassc and drop generated .css files



commit 4071e1e734754fcdf07b8ed9e4c20b925618afac
Author: Christoph Reiter <creiter src gnome org>
Date:   Fri May 3 18:04:16 2019 +0200

    build: require sassc and drop generated .css files
    
    Instead of requiring sassc to be installed add meson subprojects
    which build libsass and sassc (currently both forks of mine, tested
    under linux/mingw/msvc) when needed.
    
    This allows us to drop the generated .css files and build scripts from git.
    
    See #1502

 gtk/meson.build                                  |   15 +-
 gtk/theme/Adwaita/README                         |    7 +-
 gtk/theme/Adwaita/gtk-contained-dark.css         | 1966 ---------------------
 gtk/theme/Adwaita/gtk-contained.css              | 1982 ----------------------
 gtk/theme/Adwaita/parse-sass.sh                  |   13 -
 gtk/theme/HighContrast/gtk-contained-inverse.css | 1632 ------------------
 gtk/theme/HighContrast/gtk-contained.css         | 1638 ------------------
 gtk/theme/HighContrast/parse-sass.sh             |   13 -
 subprojects/libsass.wrap                         |    4 +
 subprojects/sassc.wrap                           |    4 +
 10 files changed, 19 insertions(+), 7255 deletions(-)
---
diff --git a/gtk/meson.build b/gtk/meson.build
index 07f706c51f..17156b001a 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -767,16 +767,19 @@ gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml',
                                       '@OUTPUT@'
                                     ])
 
-# Re-build the theme files if sassc is available
+# Build the theme files
 theme_deps = []
 sassc = find_program('sassc', required: false)
-if sassc.found()
-  sassc_opts = [ '-a', '-M', '-t', 'compact' ]
-
-  subdir('theme/Adwaita')
-  subdir('theme/HighContrast')
+if not sassc.found()
+  subproject('sassc')
+  sassc = find_program('sassc', required: true)
 endif
 
+sassc_opts = [ '-a', '-M', '-t', 'compact' ]
+
+subdir('theme/Adwaita')
+subdir('theme/HighContrast')
+
 gtkresources = gnome.compile_resources('gtkresources',
                                        gtk_gresources_xml,
                                        dependencies: theme_deps,
diff --git a/gtk/theme/Adwaita/README b/gtk/theme/Adwaita/README
index e2734ba30d..0588bcf5e3 100644
--- a/gtk/theme/Adwaita/README
+++ b/gtk/theme/Adwaita/README
@@ -1,13 +1,10 @@
 Summary
 -------
 
-* Do not edit the CSS directly, edit the source SCSS files
 * To be able to use the latest/adequate version of sass, install sassc
-* The configure script will detect whether or not you have sassc installed;
-  if you do, it will regenerate the CSS every time you modify the SCSS files.
+* meson will regenerate the CSS every time you modify the SCSS files.
 * Note that meson always builds out-of-tree, so the modified css files will
-  appear in your builddir, and you need to copy them back to the srcdir
-  to commit them.
+  appear in your builddir.
 
 How to tweak the theme
 ----------------------
diff --git a/subprojects/libsass.wrap b/subprojects/libsass.wrap
new file mode 100644
index 0000000000..dfd01816dc
--- /dev/null
+++ b/subprojects/libsass.wrap
@@ -0,0 +1,4 @@
+[wrap-git]
+directory=libsass
+url=https://github.com/lazka/libsass.git
+revision=meson
diff --git a/subprojects/sassc.wrap b/subprojects/sassc.wrap
new file mode 100644
index 0000000000..614ba5c80b
--- /dev/null
+++ b/subprojects/sassc.wrap
@@ -0,0 +1,4 @@
+[wrap-git]
+directory=sassc
+url=https://github.com/lazka/sassc.git
+revision=meson


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