[gtk/more-vs-proj-updates] MSVC projects: Generate and install Emoji GResource data




commit 8d4d675030b3062b028c9a78a4287c9bb28f5302
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon May 30 19:50:16 2022 +0800

    MSVC projects: Generate and install Emoji GResource data
    
    Generate the full GResource XML files for the Emoji data, and generate
    the binary GResource data from them and copy them as appropriate.
    
    At this point, the installed data files are in-line with what the Meson
    builds install, sans the processed translation files.

 win32/generate-msvc.mak | 32 +++++++++++++++++++++++++++++++-
 win32/install-msvc.mak  |  3 ++-
 2 files changed, 33 insertions(+), 2 deletions(-)
---
diff --git a/win32/generate-msvc.mak b/win32/generate-msvc.mak
index 98a17dd703..dc243d2ba8 100644
--- a/win32/generate-msvc.mak
+++ b/win32/generate-msvc.mak
@@ -80,6 +80,14 @@ GTK3_DEMO_VCPROJS =  \
        $(GTK3_DEMO_VC1X_PROJS) \
        $(GTK3_DEMO_VC1X_PROJ_FILTERS)
 
+EMOJI_GRESOURCE_XML =  \
+       .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\de.gresource.xml        \
+       .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\es.gresource.xml        \
+       .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\fr.gresource.xml        \
+       .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\zh.gresource.xml
+
+EMOJI_GRESOURCE = $(EMOJI_GRESOURCE_XML:.gresource.xml=.gresource)
+
 generate-base-sources: \
        .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\config.h  \
        $(GDK_GENERATED_SOURCES)        \
@@ -91,7 +99,8 @@ generate-base-sources:        \
        .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk3-demo\demos.h       \
        .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk3-demo\demo_resources.c      \
        .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk3-icon-browser\resources.c   \
-       .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk3-widget-factory\widget_factory_resources.c
+       .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk3-widget-factory\widget_factory_resources.c  \
+       $(EMOJI_GRESOURCE)
 
 # Copy the pre-defined config.h.win32 and demos.h.win32
 .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\config.h: ..\config.h.win32
@@ -411,6 +420,25 @@ vs17\$(DEMO_VS1X_PROJ_FILTERS):
        @echo Copying $** to $@...
        @copy $** $@
 
+.\vs$(VSVER)\$(CFG)\$(PLAT)\bin\de.gresource.xml: ..\gtk\emoji\gresource.xml.in
+.\vs$(VSVER)\$(CFG)\$(PLAT)\bin\es.gresource.xml: ..\gtk\emoji\gresource.xml.in
+.\vs$(VSVER)\$(CFG)\$(PLAT)\bin\fr.gresource.xml: ..\gtk\emoji\gresource.xml.in
+.\vs$(VSVER)\$(CFG)\$(PLAT)\bin\zh.gresource.xml: ..\gtk\emoji\gresource.xml.in
+
+.\vs$(VSVER)\$(CFG)\$(PLAT)\bin\de.gresource: .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\de.gresource.xml 
..\gtk\emoji\de.data
+.\vs$(VSVER)\$(CFG)\$(PLAT)\bin\es.gresource: .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\es.gresource.xml 
..\gtk\emoji\es.data
+.\vs$(VSVER)\$(CFG)\$(PLAT)\bin\fr.gresource: .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\fr.gresource.xml 
..\gtk\emoji\fr.data
+.\vs$(VSVER)\$(CFG)\$(PLAT)\bin\zh.gresource: .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\zh.gresource.xml 
..\gtk\emoji\zh.data
+
+$(EMOJI_GRESOURCE_XML):
+       @echo Generating $@...
+       @if not exist $(@D)\ mkdir $(@D)
+       @$(PYTHON) replace.py -i=$** -o=$@ --action=replace-var --var=lang --outstring=$(@B:.gresource=)
+
+$(EMOJI_GRESOURCE):
+       @echo Generating $@...
+       @$(GLIB_COMPILE_RESOURCES) --sourcedir=..\gtk\emoji $@.xml --target=$@
+
 regenerate-demos-h-win32: ..\demos\gtk-demo\geninclude.py $(demo_actual_sources) $(GTK3_DEMO_VCPROJS)
        @echo Regenerating demos.h.win32 and gtk3-demo VS project files...
        @-del ..\demos\gtk-demo\demos.h.win32
@@ -420,6 +448,8 @@ regenerate-demos-h-win32: ..\demos\gtk-demo\geninclude.py $(demo_actual_sources)
 
 # Remove the generated files
 clean:
+       @-del /f /q .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.gresource
+       @-del /f /q .\vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.gresource.xml
        @-del /f /q .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk3-icon-browser\resources.c
        @-del /f /q .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk3-demo\demo_resources.c
        @-del /f /q .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk3-demo\demos.h
diff --git a/win32/install-msvc.mak b/win32/install-msvc.mak
index 600956106d..5fe35d8762 100644
--- a/win32/install-msvc.mak
+++ b/win32/install-msvc.mak
@@ -126,7 +126,8 @@ install-data:
        @for %t in (16 22 24 32 48 256) do @for %d in ($(PREFIX)\share\icons\hicolor\%tx%t\apps) do @((if not 
exist %d\ mkdir %d) & copy /b ..\demos\widget-factory\data\%tx%t\gtk3-widget-factory*.png "%d")
        @-$(BASE_BUILT_BIN_DIR)\gtk-update-icon-cache.exe --ignore-theme-index --force 
"$(PREFIX)\share\icons\hicolor"
 # Auxiliary build-related data files (m4, ITS files, RelaxNG files)
-       @for %d in (aclocal gettext\its gtk-3.0) do @if not exist $(PREFIX)\share\%d\ mkdir $(PREFIX)\share\%d
+       @for %d in (aclocal gettext\its gtk-3.0\emoji) do @if not exist $(PREFIX)\share\%d\ mkdir 
$(PREFIX)\share\%d
        @copy ..\m4macros\gtk-3.0.m4 $(PREFIX)\share\aclocal
        @for %x in (its loc) do @copy ..\gtk\gtkbuilder.%x $(PREFIX)\share\gettext\its
        @for %x in (rng) do @copy ..\gtk\gtkbuilder.%x $(PREFIX)\share\gtk-3.0
+       @for %l in (de es fr zh) do @for %f in ($(BASE_BUILT_BIN_DIR)\%l.gresource) do @copy %f 
$(PREFIX)\share\gtk-3.0\emoji


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