[gnome-builder/wip/gtk4-port: 1425/1774] plugins/meson-templates: remove legacy GTK 3 projects




commit c7487191b331665db40032dbab12652a9bba6ef5
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 8 13:48:41 2022 -0700

    plugins/meson-templates: remove legacy GTK 3 projects
    
    We don't want to be encouraging the creation of GTK 3 projects at this
    point, so just drop the crufty templates.
    
    That means we don't have GTK templates for C++ or C♯ at this point, and
    that is probably a good thing given their current state. If you'd like
    to fix this, please do!

 .../meson-templates/gbp-meson-template-provider.c  |  12 +-
 .../meson-templates/meson-templates.gresource.xml  |  32 +-
 src/plugins/meson-templates/meson_templates.py     | 429 ---------------------
 .../resources/flatpak-gtksharp.json.tmpl           |  63 ---
 .../meson-templates/resources/flatpak.json.in      | 139 -------
 .../meson-templates/resources/src/Cargo.toml       |  24 --
 .../src/{application.c => application-gtk4.c}      |   0
 .../src/{application.h => application-gtk4.h}      |   0
 .../src/{application.rs => application-gtk4.rs}    |   0
 .../meson-templates/resources/src/application.in   |   3 -
 .../meson-templates/resources/src/config.rs.in     |   5 -
 src/plugins/meson-templates/resources/src/main.c   |  42 --
 src/plugins/meson-templates/resources/src/main.cpp |  48 ---
 src/plugins/meson-templates/resources/src/main.cs  |  25 --
 .../meson-templates/resources/src/main.js.tmpl     |  27 --
 src/plugins/meson-templates/resources/src/main.py  |  27 --
 src/plugins/meson-templates/resources/src/main.rs  |  29 --
 .../meson-templates/resources/src/main.vala        |  14 -
 .../resources/src/meson-c-vala.build               |  18 +-
 .../meson-templates/resources/src/meson-cs.build   |  21 -
 .../meson-templates/resources/src/meson-py.build   |  34 --
 .../meson-templates/resources/src/meson-rs.build   |  55 ---
 .../resources/src/{window.c => window-gtk4.c}      |   0
 .../resources/src/{window.h => window-gtk4.h}      |   0
 .../src/{window.js.tmpl => window-gtk4.js}         |   0
 .../meson-templates/resources/src/window.cpp       |  35 --
 .../meson-templates/resources/src/window.hpp       |  23 --
 .../meson-templates/resources/src/window.py        |  13 -
 .../meson-templates/resources/src/window.rs        |  16 -
 .../meson-templates/resources/src/window.ui        |  37 --
 .../meson-templates/resources/src/window.vala      |  13 -
 31 files changed, 14 insertions(+), 1170 deletions(-)
---
diff --git a/src/plugins/meson-templates/gbp-meson-template-provider.c 
b/src/plugins/meson-templates/gbp-meson-template-provider.c
index 3875b7ee5..69006d9a0 100644
--- a/src/plugins/meson-templates/gbp-meson-template-provider.c
+++ b/src/plugins/meson-templates/gbp-meson-template-provider.c
@@ -64,14 +64,14 @@ static GbpMesonTemplateExpansion gtk4_expansions[] = {
   { "src/help-overlay.ui",                                 "src/gtk/help-overlay.ui" },
 
   /* C */
-  { "src/application.c", "src/{{prefix}}-application.c", IDE_STRV_INIT ("C") },
-  { "src/application.h", "src/{{prefix}}-application.h", IDE_STRV_INIT ("C") },
+  { "src/application-gtk4.c", "src/{{prefix}}-application.c", IDE_STRV_INIT ("C") },
+  { "src/application-gtk4.h", "src/{{prefix}}-application.h", IDE_STRV_INIT ("C") },
   { "src/hello.gresource.xml", "src/{{prefix}}.gresource.xml", IDE_STRV_INIT ("C") },
   { "src/main-gtk4.c", "src/main.c", IDE_STRV_INIT ("C") },
   { "src/meson-c-vala.build", "src/meson.build", IDE_STRV_INIT ("C") },
   { "src/window-gtk4.ui", "src/{{prefix}}-window.ui", IDE_STRV_INIT ("C") },
-  { "src/window.c", "src/{{prefix}}-window.c", IDE_STRV_INIT ("C") },
-  { "src/window.h", "src/{{prefix}}-window.h", IDE_STRV_INIT ("C") },
+  { "src/window-gtk4.c", "src/{{prefix}}-window.c", IDE_STRV_INIT ("C") },
+  { "src/window-gtk4.h", "src/{{prefix}}-window.h", IDE_STRV_INIT ("C") },
 
   /* JavaScript */
   { "src/hello.gresource.xml", "src/{{appid}}.data.gresource.xml", IDE_STRV_INIT ("JavaScript") },
@@ -81,7 +81,7 @@ static GbpMesonTemplateExpansion gtk4_expansions[] = {
   { "src/main-gtk4.js.tmpl", "src/main.js", IDE_STRV_INIT ("JavaScript") },
   { "src/meson-js.build", "src/meson.build", IDE_STRV_INIT ("JavaScript") },
   { "src/window-gtk4.ui", "src/window.ui", IDE_STRV_INIT ("JavaScript") },
-  { "src/window.js.tmpl", "src/window.js", IDE_STRV_INIT ("JavaScript") },
+  { "src/window-gtk4.js", "src/window.js", IDE_STRV_INIT ("JavaScript") },
 
   /* Python */
   { "src/__init__.py", "src/__init__.py", IDE_STRV_INIT ("Python") },
@@ -95,7 +95,7 @@ static GbpMesonTemplateExpansion gtk4_expansions[] = {
   { "build-aux/cargo.sh", "build-aux/cargo.sh", IDE_STRV_INIT ("Rust") },
   { "src/Cargo-gtk4.toml", "Cargo.toml", IDE_STRV_INIT ("Rust") },
   { "src/Cargo.lock", "Cargo.lock", IDE_STRV_INIT ("Rust") },
-  { "src/application.rs", "src/application.rs", IDE_STRV_INIT ("Rust") },
+  { "src/application-gtk4.rs", "src/application.rs", IDE_STRV_INIT ("Rust") },
   { "src/config-gtk4.rs.in", "src/config.rs.in", IDE_STRV_INIT ("Rust") },
   { "src/hello.gresource.xml", "src/{{prefix}}.gresource.xml", IDE_STRV_INIT ("Rust") },
   { "src/main-gtk4.rs", "src/main.rs", IDE_STRV_INIT ("Rust") },
diff --git a/src/plugins/meson-templates/meson-templates.gresource.xml 
b/src/plugins/meson-templates/meson-templates.gresource.xml
index e957c6c6b..32bb3853d 100644
--- a/src/plugins/meson-templates/meson-templates.gresource.xml
+++ b/src/plugins/meson-templates/meson-templates.gresource.xml
@@ -2,71 +2,51 @@
 <gresources>
   <gresource prefix="/plugins/meson-templates">
     <file>meson-templates.plugin</file>
-    <file compressed="true">resources/src/window.ui</file>
     <file compressed="true">resources/src/window-gtk4.ui</file>
     <file compressed="true">resources/src/help-overlay.ui</file>
-    <file compressed="true">resources/src/window.js.tmpl</file>
-    <file compressed="true">resources/src/meson-py.build</file>
+    <file compressed="true">resources/src/window-gtk4.js</file>
     <file compressed="true">resources/src/meson-py-gtk4.build</file>
-    <file compressed="true">resources/src/window.h</file>
+    <file compressed="true">resources/src/window-gtk4.h</file>
     <file compressed="true">resources/src/hello.js.in</file>
     <file compressed="true">resources/src/hello.gresource.xml</file>
     <file compressed="true">resources/src/hello-version.h.in</file>
     <file compressed="true">resources/src/meson-clib.build</file>
     <file compressed="true">resources/src/meson-js.build</file>
-    <file compressed="true">resources/src/meson-rs.build</file>
     <file compressed="true">resources/src/meson-rs-gtk4.build</file>
     <file compressed="true">resources/src/hello.c</file>
     <file compressed="true">resources/src/hello.h</file>
-    <file compressed="true">resources/src/application.c</file>
+    <file compressed="true">resources/src/application-gtk4.c</file>
     <file compressed="true">resources/src/application-gtk4.vala</file>
-    <file compressed="true">resources/src/application.h</file>
-    <file compressed="true">resources/src/application.rs</file>
+    <file compressed="true">resources/src/application-gtk4.h</file>
+    <file compressed="true">resources/src/application-gtk4.rs</file>
     <file compressed="true">resources/src/__init__.py</file>
     <file compressed="true">resources/src/meson-c-vala.build</file>
     <file compressed="true">resources/src/meson-empty.build</file>
-    <file compressed="true">resources/src/main.js.tmpl</file>
     <file compressed="true">resources/src/main-gtk4.js.tmpl</file>
-    <file compressed="true">resources/src/main.c</file>
     <file compressed="true">resources/src/main-gtk4.c</file>
     <file compressed="true">resources/src/main-cli.c</file>
-    <file compressed="true">resources/src/main.cpp</file>
     <file compressed="true">resources/src/main-cli.cpp</file>
     <file compressed="true">resources/src/hello.src.gresource.xml</file>
-    <file compressed="true">resources/src/window.c</file>
-    <file compressed="true">resources/src/window.cpp</file>
-    <file compressed="true">resources/src/window.hpp</file>
-    <file compressed="true">resources/src/window.py</file>
+    <file compressed="true">resources/src/window-gtk4.c</file>
     <file compressed="true">resources/src/window-gtk4.py</file>
-    <file compressed="true">resources/src/window.vala</file>
     <file compressed="true">resources/src/window-gtk4.vala</file>
-    <file compressed="true">resources/src/config.rs.in</file>
     <file compressed="true">resources/src/config-gtk4.rs.in</file>
-    <file compressed="true">resources/src/window.rs</file>
     <file compressed="true">resources/src/window-gtk4.rs</file>
-    <file compressed="true">resources/src/main.vala</file>
     <file compressed="true">resources/src/main-gtk4.vala</file>
     <file compressed="true">resources/src/main-cli.vala</file>
     <file compressed="true">resources/src/hello.py.in</file>
     <file compressed="true">resources/src/hello-cli.py.in</file>
-    <file compressed="true">resources/src/main.py</file>
     <file compressed="true">resources/src/main-gtk4.py</file>
     <file compressed="true">resources/src/main-cli.py</file>
-    <file compressed="true">resources/src/main.rs</file>
     <file compressed="true">resources/src/main-gtk4.rs</file>
     <file compressed="true">resources/src/main-cli.rs</file>
-    <file compressed="true">resources/src/application.in</file>
-    <file compressed="true">resources/src/main.cs</file>
     <file compressed="true">resources/src/Cargo.lock</file>
-    <file compressed="true">resources/src/Cargo.toml</file>
     <file compressed="true">resources/src/Cargo-gtk4.toml</file>
     <file compressed="true">resources/src/Cargo-cli.toml</file>
-    <file compressed="true">resources/src/meson-cs.build</file>
     <file compressed="true">resources/build-aux/cargo.sh</file>
     <file compressed="true">resources/meson.build</file>
     <file compressed="true">resources/src/meson-cli.build</file>
     <file compressed="true">resources/src/meson-py-cli.build</file>
-    <file compressed="true">resources/flatpak-gtksharp.json.tmpl</file>
     <file compressed="true">resources/data/meson.build</file>
     <file compressed="true">resources/data/hello.gschema.xml</file>
     <file compressed="true">resources/data/hello.desktop.in</file>
diff --git a/src/plugins/meson-templates/resources/flatpak.json.in 
b/src/plugins/meson-templates/resources/flatpak.json.in
index 2190cd8be..6112dabcd 100644
--- a/src/plugins/meson-templates/resources/flatpak.json.in
+++ b/src/plugins/meson-templates/resources/flatpak.json.in
@@ -45,145 +45,6 @@
         "*.a"
     ],
     "modules" : [
-{{if template == "gnome-app"}}
-{{if language == "c++"}}
-        {
-           "name" : "mm-common",
-           "buildsystem" : "meson",
-           "sources" : [
-               {
-                   "type" : "archive",
-                   "url" : "https://download.gnome.org/sources/mm-common/1.0/mm-common-1.0.4.tar.xz";,
-                   "sha256" : "e954c09b4309a7ef93e13b69260acdc5738c907477eb381b78bb1e414ee6dbd8"
-               }
-           ]
-        },
-        {
-            "name" : "sigc++-2",
-            "buildsystem" : "meson",
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://download.gnome.org/sources/libsigc++/2.10/libsigc++-2.10.8.tar.xz";,
-                    "sha256" : "235a40bec7346c7b82b6a8caae0456353dc06e71f14bc414bcc858af1838719a"
-                }
-            ]
-        },
-        {
-            "name" : "sigc++",
-            "buildsystem" : "meson",
-            "config-opts" : [ "-Dbuild-documentation=false", "-Dmaintainer-mode=false" ],
-            "sources" : [
-                {
-                    "type" : "git",
-                    "url" : "https://github.com/libsigcplusplus/libsigcplusplus.git";,
-                    "tag" : "3.2.0"
-                }
-            ]
-        },
-        {
-            "name" : "glibmm-2-70",
-            "buildsystem" : "meson",
-            "config-opts" : [ "-Dbuild-documentation=false", "-Dmaintainer-mode=false" ],
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://download.gnome.org/sources/glibmm/2.70/glibmm-2.70.0.tar.xz";,
-                    "sha256" : "8008fd8aeddcc867a3f97f113de625f6e96ef98cf7860379813a9c0feffdb520"
-                }
-            ]
-        },
-        {
-            "name" : "glibmm-2-66",
-            "buildsystem" : "meson",
-            "config-opts" : [ "-Dbuild-documentation=false", "-Dmaintainer-mode=false" ],
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://download.gnome.org/sources/glibmm/2.66/glibmm-2.66.2.tar.xz";,
-                    "sha256" : "b2a4cd7b9ae987794cbb5a1becc10cecb65182b9bb841868625d6bbb123edb1d"
-                }
-            ]
-        },
-        {
-            "name" : "cairomm-1-14",
-            "buildsystem" : "meson",
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://cairographics.org/releases/cairomm-1.14.3.tar.xz";,
-                    "sha256" : "0d37e067c5c4ca7808b7ceddabfe1932c5bd2a750ad64fb321e1213536297e78"
-                }
-            ]
-        },
-        {
-            "name" : "cairomm-1-16",
-            "buildsystem" : "meson",
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://cairographics.org/releases/cairomm-1.16.1.tar.xz";,
-                    "sha256" : "6f6060d8e98dd4b8acfee2295fddbdd38cf487c07c26aad8d1a83bb9bff4a2c6"
-                }
-            ]
-        },
-        {
-            "name" : "pangomm-2-46",
-            "buildsystem" : "meson",
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://download.gnome.org/sources/pangomm/2.46/pangomm-2.46.2.tar.xz";,
-                    "sha256" : "57442ab4dc043877bfe3839915731ab2d693fc6634a71614422fb530c9eaa6f4"
-                }
-            ]
-        },
-        {
-            "name" : "pangomm-2-50",
-            "buildsystem" : "meson",
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://download.gnome.org/sources/pangomm/2.50/pangomm-2.50.0.tar.xz";,
-                    "sha256" : "a27aa77e017b9afce9e751d85bd1cf890abbb3a58bf59d0fac917eef82db3b5b"
-                }
-            ]
-        },
-        {
-            "name" : "atkmm-2-28",
-            "buildsystem" : "meson",
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://download.gnome.org/sources/atkmm/2.28/atkmm-2.28.2.tar.xz";,
-                    "sha256" : "a0bb49765ceccc293ab2c6735ba100431807d384ffa14c2ebd30e07993fd2fa4"
-                }
-            ]
-        },
-        {
-            "name" : "atkmm-2-36",
-            "buildsystem" : "meson",
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://download.gnome.org/sources/atkmm/2.36/atkmm-2.36.1.tar.xz";,
-                    "sha256" : "e11324bfed1b6e330a02db25cecc145dca03fb0dff47f0710c85e317687da458"
-                }
-            ]
-        },
-        {
-            "name" : "gtkmm-3-24",
-            "buildsystem" : "meson",
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://download.gnome.org/sources/gtkmm/3.24/gtkmm-3.24.5.tar.xz";,
-                    "sha256" : "856333de86689f6a81c123f2db15d85db9addc438bc3574c36f15736aeae22e6"
-                }
-            ]
-        },
-{{end}}
-{{end}}
         {
             "name" : "{{name}}",
             "builddir" : true,
diff --git a/src/plugins/meson-templates/resources/src/application.c 
b/src/plugins/meson-templates/resources/src/application-gtk4.c
similarity index 100%
rename from src/plugins/meson-templates/resources/src/application.c
rename to src/plugins/meson-templates/resources/src/application-gtk4.c
diff --git a/src/plugins/meson-templates/resources/src/application.h 
b/src/plugins/meson-templates/resources/src/application-gtk4.h
similarity index 100%
rename from src/plugins/meson-templates/resources/src/application.h
rename to src/plugins/meson-templates/resources/src/application-gtk4.h
diff --git a/src/plugins/meson-templates/resources/src/application.rs 
b/src/plugins/meson-templates/resources/src/application-gtk4.rs
similarity index 100%
rename from src/plugins/meson-templates/resources/src/application.rs
rename to src/plugins/meson-templates/resources/src/application-gtk4.rs
diff --git a/src/plugins/meson-templates/resources/src/meson-c-vala.build 
b/src/plugins/meson-templates/resources/src/meson-c-vala.build
index e1484fe4b..f76b265cd 100644
--- a/src/plugins/meson-templates/resources/src/meson-c-vala.build
+++ b/src/plugins/meson-templates/resources/src/meson-c-vala.build
@@ -1,32 +1,19 @@
 {{name_}}_sources = [
 {{if language == "c"}}
   'main.c',
-{{if is_gtk4}}
   '{{prefix}}-application.c',
-{{end}}
   '{{prefix}}-window.c',
-{{else if language == "c++"}}
-  'main.cpp',
-  '{{prefix}}-window.cpp',
 {{else if language == "vala"}}
   'main.vala',
-{{if is_gtk4}}
   'application.vala',
-{{end}}
   'window.vala',
 {{end}}
 ]
 
 {{name_}}_deps = [
+  dependency('gtk4'),
 {{if is_adwaita}}
   dependency('libadwaita-1'),
-{{else if is_gtk4}}
-  dependency('gtk4'),
-{{else if language == "c++"}}
-  dependency('gtkmm-3.0', version: '>= 3.18'),
-{{else}}
-  dependency('gio-2.0', version: '>= 2.50'),
-  dependency('gtk+-3.0', version: '>= 3.22'),
 {{end}}
 ]
 
@@ -36,7 +23,6 @@
 )
 
 executable('{{name}}', {{name_}}_sources,
-{{if language == "vala"}}  vala_args: '--target-glib=2.50',{{end}}
   dependencies: {{name_}}_deps,
-  install: true,
+       install: true,
 )
diff --git a/src/plugins/meson-templates/resources/src/window.c 
b/src/plugins/meson-templates/resources/src/window-gtk4.c
similarity index 100%
rename from src/plugins/meson-templates/resources/src/window.c
rename to src/plugins/meson-templates/resources/src/window-gtk4.c
diff --git a/src/plugins/meson-templates/resources/src/window.h 
b/src/plugins/meson-templates/resources/src/window-gtk4.h
similarity index 100%
rename from src/plugins/meson-templates/resources/src/window.h
rename to src/plugins/meson-templates/resources/src/window-gtk4.h
diff --git a/src/plugins/meson-templates/resources/src/window.js.tmpl 
b/src/plugins/meson-templates/resources/src/window-gtk4.js
similarity index 100%
rename from src/plugins/meson-templates/resources/src/window.js.tmpl
rename to src/plugins/meson-templates/resources/src/window-gtk4.js


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