A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

gtk3: Refactor meson.build

by roundabout, Saturday, 6 March 2021, 23:35:21 (1615073721), pushed by roundabout, Sunday, 11 May 2025, 13:22:59 (1746969779)

Author identity: nana-4 <hnmaigo@gmail.com>

48453c628362794fe53f4b1b9bb05a482e561241

src/gtk-3.0/meson.build

@@ -1,8 +1,4 @@

                                
                                
                                
                            
                                
                                    
                                        
                                        gtk_versions = [
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          '3.0',
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        ]
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        gtk_scss_depend_files = files([
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        gtk3_scss_depend_files = files([
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              '../_color-palette.scss',
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              '../_colors.scss',
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              '../_variables.scss',
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -22,71 +18,69 @@ gtk_scss_depend_files = files([

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            ])
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            foreach theme: themes
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk_variants = [
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk3_dir = join_paths(theme['dir'], 'gtk-3.0')
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk3_variants = [
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                '',
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              ]
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              # Only non-dark themes need a dark variant.
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              if theme['color'] != '-dark'
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            gtk_variants += '-dark'
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            gtk3_variants += '-dark'
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              endif
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk_scss_conf = configuration_data()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk_scss_conf.set('dark_theme', theme['scss_dark_theme'])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk_scss_conf.set('light_topbar', theme['scss_light_topbar'])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk_scss_conf.set('compact', theme['scss_compact'])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          install_subdir(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            'assets',
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            install_dir: gtk3_dir,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          foreach gtk_version: gtk_versions
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            gtk_version_dir = join_paths(theme['dir'], 'gtk-@0@'.format(gtk_version))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          install_subdir(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            'icons',
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            install_dir: gtk3_dir,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            install_subdir(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              'assets',
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              install_dir: gtk_version_dir,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            install_subdir(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              'icons',
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              install_dir: gtk_version_dir,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          #
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          # SCSS
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          #
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            #
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # SCSS
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            #
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk3_scss_conf = configuration_data()
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk3_scss_conf.set('dark_theme', theme['scss_dark_theme'])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk3_scss_conf.set('light_topbar', theme['scss_light_topbar'])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          gtk3_scss_conf.set('compact', theme['scss_compact'])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            foreach gtk_variant: gtk_variants
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              gtk_temp_name = 'gtk@0@.gtk-@1@.@2@'.format(gtk_variant, gtk_version, theme['name'])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          foreach gtk3_variant: gtk3_variants
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            gtk3_temp_name = 'gtk@0@.@1@'.format(gtk3_variant, theme['name'])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              # Configure SCSS file
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              gtk_scss = configure_file(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                input: 'gtk@0@.scss.in'.format(gtk_variant),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                output: '@0@.scss'.format(gtk_temp_name),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                configuration: gtk_scss_conf,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # Configure SCSS file
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            gtk3_scss = configure_file(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              input: 'gtk@0@.scss.in'.format(gtk3_variant),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              output: '@0@.scss'.format(gtk3_temp_name),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              configuration: gtk3_scss_conf,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              # Copy it from build dir to source dir
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              run_command(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                'cp',
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                gtk_scss,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                meson.current_source_dir(),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # Copy it from build dir to source dir
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            run_command(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              'cp',
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              gtk3_scss,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              meson.current_source_dir(),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              # Generate CSS file
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              gtk_css = custom_target(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                '@0@.css'.format(gtk_temp_name),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                input: '@0@.scss'.format(gtk_temp_name),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                output: '@0@.css'.format(gtk_temp_name),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                command: [sassc, sassc_opts, '@INPUT@', '@OUTPUT@'],
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                depend_files: gtk_scss_depend_files,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                build_by_default: true,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # Generate CSS file
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            gtk3_css = custom_target(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              '@0@.css'.format(gtk3_temp_name),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              input: '@0@.scss'.format(gtk3_temp_name),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              output: '@0@.css'.format(gtk3_temp_name),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              command: [sassc, sassc_opts, '@INPUT@', '@OUTPUT@'],
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              depend_files: gtk3_scss_depend_files,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              build_by_default: true,
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              # Install it while renaming to a valid name
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              meson.add_install_script(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                'sh', '-c', 'cp "@0@" "@1@"'.format(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                  gtk_css.full_path(),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                  join_paths('$MESON_INSTALL_DESTDIR_PREFIX', gtk_version_dir, 'gtk@0@.css'.format(gtk_variant)),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                ),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            endforeach
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            # Install it while renaming to a valid name
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            meson.add_install_script(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              'sh', '-c', 'cp "@0@" "@1@"'.format(
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                gtk3_css.full_path(),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                join_paths('$MESON_INSTALL_DESTDIR_PREFIX', gtk3_dir, 'gtk@0@.css'.format(gtk3_variant)),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              ),
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            )
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              endforeach
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            endforeach